@entur-partner/app-shell 6.1.6 → 6.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppShell.d.ts +20 -0
- package/dist/ConsentManagerProvider.d.ts +16 -0
- package/dist/EnvironmentBanner.d.ts +7 -0
- package/dist/LanguageProvider.d.ts +12 -0
- package/dist/MenuProvider.d.ts +17 -0
- package/dist/MicroFrontendLink.d.ts +8 -0
- package/dist/OrganisationProvider.d.ts +13 -0
- package/dist/OrganisationSelector.d.ts +15 -0
- package/dist/OrganisationsError.d.ts +3 -0
- package/dist/PostHogProviderWrapper.d.ts +32 -0
- package/dist/app-shell.cjs.development.js +815 -0
- package/dist/app-shell.cjs.development.js.map +1 -0
- package/dist/app-shell.cjs.production.min.js +2 -0
- package/dist/app-shell.cjs.production.min.js.map +1 -0
- package/dist/app-shell.esm.js +794 -0
- package/dist/app-shell.esm.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +8 -0
- package/dist/storage.d.ts +14 -0
- package/dist/types/ConsentTypes.d.ts +33 -0
- package/dist/types/UserTypes.d.ts +3 -0
- package/dist/util/convertUCServicesToConsents.d.ts +13 -0
- package/package.json +6 -6
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Auth0ContextInterface, type GetTokenSilentlyOptions } from "@auth0/auth0-react";
|
|
2
|
+
import { Environment } from "@entur-partner/common";
|
|
3
|
+
import type { User } from "@entur-partner/micro-frontend";
|
|
4
|
+
import React, { type ReactNode } from "react";
|
|
5
|
+
import type { DecorateUserFn } from "./types/UserTypes";
|
|
6
|
+
export interface AppShellValues {
|
|
7
|
+
logout: Auth0ContextInterface["logout"];
|
|
8
|
+
user: User;
|
|
9
|
+
getToken(options?: GetTokenSilentlyOptions): Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
export interface AppShellProps {
|
|
12
|
+
children: (options: AppShellValues) => ReactNode;
|
|
13
|
+
audience: string;
|
|
14
|
+
domain: string;
|
|
15
|
+
clientId: string;
|
|
16
|
+
decorateUser: DecorateUserFn;
|
|
17
|
+
redirectUri?: string;
|
|
18
|
+
environment?: Environment;
|
|
19
|
+
}
|
|
20
|
+
export declare const AppShell: ({ children, audience, domain, clientId, decorateUser, environment, }: AppShellProps) => React.JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
import type { Consents } from "./types/ConsentTypes";
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
UC_UI: {
|
|
6
|
+
showFirstLayer: () => void;
|
|
7
|
+
showSecondLayer: () => void;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const useConsentManager: () => Consents;
|
|
12
|
+
type Props = {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
export declare const ConsentManagerProvider: ({ children }: Props) => React.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Environment } from "@entur-partner/common";
|
|
2
|
+
import React from "react";
|
|
3
|
+
type EnvironmentBannerProps = {
|
|
4
|
+
environment: Exclude<Environment, Environment.Production>;
|
|
5
|
+
};
|
|
6
|
+
export declare const EnvironmentBanner: ({ environment }: EnvironmentBannerProps) => React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from "react";
|
|
2
|
+
interface LanguageContextType {
|
|
3
|
+
language: string;
|
|
4
|
+
setLanguage: (language: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useLanguage: () => LanguageContextType;
|
|
7
|
+
interface LanguageProviderProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
language: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const LanguageProvider: FC<LanguageProviderProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MenuItem, NavigationFunction } from "@entur-partner/micro-frontend";
|
|
2
|
+
import React, { type FC, type ReactNode } from "react";
|
|
3
|
+
interface MenuContextType {
|
|
4
|
+
getItemsForPath: (path: string) => MenuItem[];
|
|
5
|
+
addItems: (items: MenuItem[], path: string) => void;
|
|
6
|
+
getMFNavigate: (path: string) => NavigationFunction | undefined;
|
|
7
|
+
setMFNavigate: (path: string, navigation: NavigationFunction) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const MenuContext: React.Context<MenuContextType>;
|
|
10
|
+
export declare const useMenuGroupItems: (path: string) => MenuItem[];
|
|
11
|
+
export declare const useMenu: () => MenuContextType;
|
|
12
|
+
export declare const useMFNavigation: (path: string) => NavigationFunction | undefined;
|
|
13
|
+
interface MenuProviderProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare const MenuProvider: FC<MenuProviderProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AnchorHTMLAttributes, type FC, type ReactNode } from "react";
|
|
2
|
+
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
3
|
+
href: string;
|
|
4
|
+
navigate: () => void;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const MicroFrontendLink: FC<LinkProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from "react";
|
|
2
|
+
interface OrganisationContextType {
|
|
3
|
+
organisationId: number;
|
|
4
|
+
setOrganisationId: (organisationId: number) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useOrganisation: () => OrganisationContextType;
|
|
7
|
+
export declare const useOrganisationId: () => number;
|
|
8
|
+
interface OrganisationProviderProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
organisationId: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const OrganisationProvider: FC<OrganisationProviderProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GetTokenSilentlyOptions } from "@auth0/auth0-spa-js";
|
|
2
|
+
import { type FC } from "react";
|
|
3
|
+
export type GetOrganisationsFn = (token: string) => Promise<OrganisationV3[]>;
|
|
4
|
+
export interface OrganisationV3 {
|
|
5
|
+
organisationId: number;
|
|
6
|
+
tradingName: string;
|
|
7
|
+
}
|
|
8
|
+
export interface OrganisationSelectorProps {
|
|
9
|
+
getToken: (options?: GetTokenSilentlyOptions) => Promise<string>;
|
|
10
|
+
getOrganisations: GetOrganisationsFn | string;
|
|
11
|
+
selectedOrganisationId: number;
|
|
12
|
+
onChange: (organisationId: number) => void;
|
|
13
|
+
[key: string]: object | string | number | boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const OrganisationSelector: FC<OrganisationSelectorProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
/**
|
|
4
|
+
* Debug mode for PostHog.
|
|
5
|
+
*/
|
|
6
|
+
debug?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* PostHog API key for initializing the PostHog client.
|
|
9
|
+
* If not provided, PostHog will not be initialized.
|
|
10
|
+
*/
|
|
11
|
+
postHogApiKey?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Flag to indicate if the application is running in a standalone mode or as a micro-frontend.
|
|
14
|
+
* When true, it will turn on autocapture and go directly to PostHog's cloud.
|
|
15
|
+
* When false, it will turn off autocapture and the local ingest endpoint from App-Shell. Instead auto-capture
|
|
16
|
+
* will be handled by the App-Shell.
|
|
17
|
+
*/
|
|
18
|
+
isStandalone: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Optional project identifier for PostHog.
|
|
21
|
+
* This can be used to differentiate between different projects in PostHog.
|
|
22
|
+
*/
|
|
23
|
+
project?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Flag to force disable PostHog tracking.
|
|
26
|
+
* If true, PostHog will not be initialized even if postHogApiKey is provided.
|
|
27
|
+
*/
|
|
28
|
+
forceDisablePostHog?: boolean;
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
};
|
|
31
|
+
export declare const PostHogProviderWrapper: ({ debug, postHogApiKey, isStandalone, project, forceDisablePostHog, children, }: Props) => React.JSX.Element;
|
|
32
|
+
export {};
|