@entur-partner/micro-frontend 2.9.0 → 2.10.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 +1 -0
- package/dist/events.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +14 -6
- package/dist/index.mjs.map +1 -1
- package/dist/registerMicroFrontend.d.ts +6 -5
- package/dist/types.d.ts +11 -0
- package/package.json +3 -3
package/README.md
CHANGED
package/dist/events.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { MicroFrontendPayload } from "./types";
|
|
1
|
+
import type { MicroFrontendPayload, PublicMicroFrontendPayload } from "./types";
|
|
2
2
|
type MountEventDetail = {
|
|
3
3
|
id: string;
|
|
4
4
|
mountPoint: HTMLDivElement;
|
|
5
|
-
payload: MicroFrontendPayload;
|
|
5
|
+
payload: MicroFrontendPayload | PublicMicroFrontendPayload;
|
|
6
6
|
};
|
|
7
7
|
type UnmountEventDetail = {
|
|
8
8
|
id: string;
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@entur-partner/util`),t=require(`react`),n=require(`react/jsx-runtime`);var r=(0,t.createContext)(void 0),i=()=>{let n=(0,t.useContext)(r);return(0,e.assertIsDefined)(n),n.user},a=()=>{let n=(0,t.useContext)(r);return(0,e.assertIsDefined)(n),n.activeOrgId},o=()=>{let n=(0,t.useContext)(r);return(0,e.assertIsDefined)(n),n.navigate},s=({children:e,organisationId:i,getPermissions:a,...o})=>{let[s,c]=(0,t.useState)([]);return(0,t.useEffect)(()=>{async function e(){try{c(await a())}catch(e){console.error(`Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:`,e)}}e()},[a]),(0,n.jsx)(r.Provider,{value:{...o,user:{...o.user,permissions:s},activeOrgId:Number(i)},children:e})},c=`@entur-partner:mount`,l=`@entur-partner:unmount`;function u(e){return new CustomEvent(c,{detail:e})}function d(e){return new CustomEvent(l,{detail:e})}var f=`@entur-partner:after-route-change`,p=class extends CustomEvent{};function m(e){return new p(f,{detail:e,cancelable:!0})}var h=`@entur-partner:menu-items-added`;function g(e){return new CustomEvent(h,{detail:e})}function _(e){let{unmount:t,microFrontendId:n,mount:r}=e
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@entur-partner/util`),t=require(`react`),n=require(`react/jsx-runtime`);var r=(0,t.createContext)(void 0),i=()=>{let n=(0,t.useContext)(r);return(0,e.assertIsDefined)(n),n.user},a=()=>{let n=(0,t.useContext)(r);return(0,e.assertIsDefined)(n),n.activeOrgId},o=()=>{let n=(0,t.useContext)(r);return(0,e.assertIsDefined)(n),n.navigate},s=({children:e,organisationId:i,getPermissions:a,...o})=>{let[s,c]=(0,t.useState)([]);return(0,t.useEffect)(()=>{async function e(){try{c(await a())}catch(e){console.error(`Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:`,e)}}e()},[a]),(0,n.jsx)(r.Provider,{value:{...o,user:{...o.user,permissions:s},activeOrgId:Number(i)},children:e})},c=`@entur-partner:mount`,l=`@entur-partner:unmount`;function u(e){return new CustomEvent(c,{detail:e})}function d(e){return new CustomEvent(l,{detail:e})}var f=`@entur-partner:after-route-change`,p=class extends CustomEvent{};function m(e){return new p(f,{detail:e,cancelable:!0})}var h=`@entur-partner:menu-items-added`;function g(e){return new CustomEvent(h,{detail:e})}function _(e){let{unmount:t,microFrontendId:n,mount:r}=e,i=(e=>{e.detail.id.startsWith(n)&&r(e.detail.mountPoint,e.detail.payload,e.detail.mountPoint)}),a=(e=>{e.detail.id.startsWith(n)&&t(e.detail.mountPoint)});return window.addEventListener(c,i),window.addEventListener(l,a),()=>{window.removeEventListener(c,i),window.removeEventListener(l,a)}}function v(e){return _(e)}function y(e){return _(e)}function b(e){let n=(0,t.useRef)(e);(0,t.useEffect)(()=>{n.current=e}),(0,t.useEffect)(()=>{let e=e=>{n.current(e)};return window.addEventListener(f,e),()=>{window.removeEventListener(f,e)}},[])}exports.AppProvider=s,exports.MENU_ITEMS_EVENT_TYPE=h,exports.MOUNT_EVENT_TYPE=c,exports.ROUTE_CHANGE_EVENT_TYPE=f,exports.RouteChangeEvent=p,exports.UNMOUNT_EVENT_TYPE=l,exports.createMenuItemsEvent=g,exports.createMountEvent=u,exports.createRouteChangeEvent=m,exports.createUnmountEvent=d,exports.registerMicroFrontend=v,exports.registerPublicMicroFrontend=y,exports.useActiveOrgId=a,exports.useAfterRouteChange=b,exports.useNavigate=o,exports.useUser=i;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/AppProvider.tsx","../src/events.ts","../src/registerMicroFrontend.ts","../src/useAfterRouteChange.ts"],"sourcesContent":["import type { Permission } from \"@entur-partner/permission-client-node\";\nimport { assertIsDefined } from \"@entur-partner/util\";\nimport {\n\tcreateContext,\n\ttype FC,\n\ttype ReactNode,\n\tuseContext,\n\tuseEffect,\n\tuseState,\n} from \"react\";\n\nimport type { User } from \"./types\";\n\ninterface AppContextType {\n\tgetToken: () => Promise<string>;\n\tuser: User;\n\tlogout?: () => void;\n\tactiveOrgId: number;\n\tnavigate: (path: string) => void;\n}\n\nexport const AppContext = createContext<AppContextType | undefined>(undefined);\n\nexport const useUser = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.user;\n};\n\nexport const useActiveOrgId = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.activeOrgId;\n};\n\nexport interface AppProviderProps {\n\tchildren: ReactNode;\n\tgetToken: () => Promise<string>;\n\tuser: User;\n\tgetPermissions: () => Promise<Permission[]>;\n\torganisationId: string;\n\tnavigate: (path: string) => void;\n}\n\nexport const useNavigate = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.navigate;\n};\n\nexport const AppProvider: FC<AppProviderProps> = ({\n\tchildren,\n\torganisationId,\n\tgetPermissions,\n\t...rest\n}) => {\n\tconst [permissions, setPermissions] = useState<Permission[]>([]);\n\n\tuseEffect(() => {\n\t\tasync function fetchData() {\n\t\t\ttry {\n\t\t\t\tconst fetchedPermissions = await getPermissions();\n\t\t\t\tsetPermissions(fetchedPermissions);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t\"Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:\",\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tfetchData();\n\t}, [getPermissions]);\n\n\treturn (\n\t\t<AppContext.Provider\n\t\t\tvalue={{\n\t\t\t\t...rest,\n\t\t\t\tuser: { ...rest.user, permissions: permissions },\n\t\t\t\tactiveOrgId: Number(organisationId),\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</AppContext.Provider>\n\t);\n};\n","import type { MicroFrontendPayload } from \"./types\";\n\ntype MountEventDetail = {\n\tid: string;\n\tmountPoint: HTMLDivElement;\n\tpayload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n\tid: string;\n\tmountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = \"@entur-partner:mount\";\nexport const UNMOUNT_EVENT_TYPE = \"@entur-partner:unmount\";\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n\treturn new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n\treturn new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = \"@entur-partner:after-route-change\";\n\nexport type RouteAction = \"PUSH\" | \"POP\" | \"REPLACE\";\n\ntype RouteChangeEventDetail = {\n\tlocation: Location;\n\tpath: string;\n\taction: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n\nexport function createRouteChangeEvent(detail: RouteChangeEventDetail) {\n\treturn new RouteChangeEvent(ROUTE_CHANGE_EVENT_TYPE, {\n\t\tdetail,\n\t\tcancelable: true, // Allow listeners to call event.preventDefault() to indicate they handled the navigation\n\t});\n}\n\nexport interface MenuItemsEvent extends CustomEvent<MenuItemsEventDetail> {}\n\nexport const MENU_ITEMS_EVENT_TYPE = \"@entur-partner:menu-items-added\";\n\nexport interface MenuItemDetail {\n\ttitle: string;\n\tto: string;\n\tdisabled?: boolean;\n}\n\ntype MenuItemsEventDetail = {\n\tpath: string;\n\titems: MenuItemDetail[];\n};\n\nexport function createMenuItemsEvent(detail: MenuItemsEventDetail) {\n\treturn new CustomEvent<MenuItemsEventDetail>(MENU_ITEMS_EVENT_TYPE, {\n\t\tdetail,\n\t});\n}\n","import {\n\tMOUNT_EVENT_TYPE,\n\ttype MountEvent,\n\tUNMOUNT_EVENT_TYPE,\n\ttype UnmountEvent,\n} from \"./events\";\nimport type { MicroFrontendPayload } from \"./types\";\n\
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/AppProvider.tsx","../src/events.ts","../src/registerMicroFrontend.ts","../src/useAfterRouteChange.ts"],"sourcesContent":["import type { Permission } from \"@entur-partner/permission-client-node\";\nimport { assertIsDefined } from \"@entur-partner/util\";\nimport {\n\tcreateContext,\n\ttype FC,\n\ttype ReactNode,\n\tuseContext,\n\tuseEffect,\n\tuseState,\n} from \"react\";\n\nimport type { User } from \"./types\";\n\ninterface AppContextType {\n\tgetToken: () => Promise<string>;\n\tuser: User;\n\tlogout?: () => void;\n\tactiveOrgId: number;\n\tnavigate: (path: string) => void;\n}\n\nexport const AppContext = createContext<AppContextType | undefined>(undefined);\n\nexport const useUser = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.user;\n};\n\nexport const useActiveOrgId = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.activeOrgId;\n};\n\nexport interface AppProviderProps {\n\tchildren: ReactNode;\n\tgetToken: () => Promise<string>;\n\tuser: User;\n\tgetPermissions: () => Promise<Permission[]>;\n\torganisationId: string;\n\tnavigate: (path: string) => void;\n}\n\nexport const useNavigate = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.navigate;\n};\n\nexport const AppProvider: FC<AppProviderProps> = ({\n\tchildren,\n\torganisationId,\n\tgetPermissions,\n\t...rest\n}) => {\n\tconst [permissions, setPermissions] = useState<Permission[]>([]);\n\n\tuseEffect(() => {\n\t\tasync function fetchData() {\n\t\t\ttry {\n\t\t\t\tconst fetchedPermissions = await getPermissions();\n\t\t\t\tsetPermissions(fetchedPermissions);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t\"Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:\",\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tfetchData();\n\t}, [getPermissions]);\n\n\treturn (\n\t\t<AppContext.Provider\n\t\t\tvalue={{\n\t\t\t\t...rest,\n\t\t\t\tuser: { ...rest.user, permissions: permissions },\n\t\t\t\tactiveOrgId: Number(organisationId),\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</AppContext.Provider>\n\t);\n};\n","import type { MicroFrontendPayload, PublicMicroFrontendPayload } from \"./types\";\n\ntype MountEventDetail = {\n\tid: string;\n\tmountPoint: HTMLDivElement;\n\tpayload: MicroFrontendPayload | PublicMicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n\tid: string;\n\tmountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = \"@entur-partner:mount\";\nexport const UNMOUNT_EVENT_TYPE = \"@entur-partner:unmount\";\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n\treturn new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n\treturn new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = \"@entur-partner:after-route-change\";\n\nexport type RouteAction = \"PUSH\" | \"POP\" | \"REPLACE\";\n\ntype RouteChangeEventDetail = {\n\tlocation: Location;\n\tpath: string;\n\taction: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n\nexport function createRouteChangeEvent(detail: RouteChangeEventDetail) {\n\treturn new RouteChangeEvent(ROUTE_CHANGE_EVENT_TYPE, {\n\t\tdetail,\n\t\tcancelable: true, // Allow listeners to call event.preventDefault() to indicate they handled the navigation\n\t});\n}\n\nexport interface MenuItemsEvent extends CustomEvent<MenuItemsEventDetail> {}\n\nexport const MENU_ITEMS_EVENT_TYPE = \"@entur-partner:menu-items-added\";\n\nexport interface MenuItemDetail {\n\ttitle: string;\n\tto: string;\n\tdisabled?: boolean;\n}\n\ntype MenuItemsEventDetail = {\n\tpath: string;\n\titems: MenuItemDetail[];\n};\n\nexport function createMenuItemsEvent(detail: MenuItemsEventDetail) {\n\treturn new CustomEvent<MenuItemsEventDetail>(MENU_ITEMS_EVENT_TYPE, {\n\t\tdetail,\n\t});\n}\n","import {\n\tMOUNT_EVENT_TYPE,\n\ttype MountEvent,\n\tUNMOUNT_EVENT_TYPE,\n\ttype UnmountEvent,\n} from \"./events\";\nimport type { MicroFrontendPayload, PublicMicroFrontendPayload } from \"./types\";\n\ntype Config<TPayload> = {\n\tmicroFrontendId: string;\n\tmount: (\n\t\tmountPoint: HTMLDivElement,\n\t\tpayload: TPayload,\n\t\tdeprecatedMountPoint: HTMLDivElement,\n\t) => void;\n\tunmount: (mountPoint: HTMLDivElement) => void;\n};\n\nfunction registerFrontend<TPayload>(config: Config<TPayload>): () => void {\n\tconst { unmount, microFrontendId, mount } = config;\n\n\tconst onMount = ((event: MountEvent) => {\n\t\tif (!event.detail.id.startsWith(microFrontendId)) {\n\t\t\treturn;\n\t\t}\n\t\tmount(\n\t\t\tevent.detail.mountPoint,\n\t\t\tevent.detail.payload as TPayload,\n\t\t\tevent.detail.mountPoint,\n\t\t);\n\t}) as EventListener;\n\n\tconst onUnmount = ((event: UnmountEvent) => {\n\t\tif (!event.detail.id.startsWith(microFrontendId)) {\n\t\t\treturn;\n\t\t}\n\t\tunmount(event.detail.mountPoint);\n\t}) as EventListener;\n\n\twindow.addEventListener(MOUNT_EVENT_TYPE, onMount);\n\twindow.addEventListener(UNMOUNT_EVENT_TYPE, onUnmount);\n\n\treturn () => {\n\t\twindow.removeEventListener(MOUNT_EVENT_TYPE, onMount);\n\t\twindow.removeEventListener(UNMOUNT_EVENT_TYPE, onUnmount);\n\t};\n}\n\nexport function registerMicroFrontend(\n\tconfig: Config<MicroFrontendPayload>,\n): () => void {\n\treturn registerFrontend(config);\n}\n\nexport function registerPublicMicroFrontend(\n\tconfig: Config<PublicMicroFrontendPayload>,\n): () => void {\n\treturn registerFrontend(config);\n}\n","import { useEffect, useRef } from \"react\";\n\nimport { ROUTE_CHANGE_EVENT_TYPE, type RouteChangeEvent } from \"./events\";\n\n/**\n * Subscribes to the `@entur-partner:after-route-change` event dispatched by\n * the sidebar when a navigation link is activated. The event is cancelable:\n * call `event.preventDefault()` inside the handler to signal that the host\n * application handled the navigation.\n *\n * The handler is stored in a ref so callers do not need to memoize it; the\n * listener itself is subscribed once per mount.\n */\nexport function useAfterRouteChange(\n\thandler: (event: RouteChangeEvent) => void,\n): void {\n\tconst handlerRef = useRef(handler);\n\n\tuseEffect(() => {\n\t\thandlerRef.current = handler;\n\t});\n\n\tuseEffect(() => {\n\t\tconst listener = (event: Event) => {\n\t\t\thandlerRef.current(event as RouteChangeEvent);\n\t\t};\n\t\twindow.addEventListener(ROUTE_CHANGE_EVENT_TYPE, listener);\n\t\treturn () => {\n\t\t\twindow.removeEventListener(ROUTE_CHANGE_EVENT_TYPE, listener);\n\t\t};\n\t}, []);\n}\n"],"mappings":"0JAqBA,IAAa,GAAA,EAAA,EAAA,eAAuD,IAAA,GAAU,CAEjE,MAAgB,CAC5B,IAAM,GAAA,EAAA,EAAA,YAAqB,EAAW,CAEtC,OADA,EAAA,EAAA,iBAAgB,EAAQ,CACjB,EAAQ,MAGH,MAAuB,CACnC,IAAM,GAAA,EAAA,EAAA,YAAqB,EAAW,CAEtC,OADA,EAAA,EAAA,iBAAgB,EAAQ,CACjB,EAAQ,aAYH,MAAoB,CAChC,IAAM,GAAA,EAAA,EAAA,YAAqB,EAAW,CAEtC,OADA,EAAA,EAAA,iBAAgB,EAAQ,CACjB,EAAQ,UAGH,GAAqC,CACjD,WACA,iBACA,iBACA,GAAG,KACE,CACL,GAAM,CAAC,EAAa,IAAA,EAAA,EAAA,UAAyC,EAAE,CAAC,CAkBhE,OAhBA,EAAA,EAAA,eAAgB,CACf,eAAe,GAAY,CAC1B,GAAI,CAEH,EAAe,MADkB,GAAgB,CACf,OAC1B,EAAO,CACf,QAAQ,MACP,iHACA,EACA,EAIH,GAAW,EACT,CAAC,EAAe,CAAC,EAGnB,EAAA,EAAA,KAAC,EAAW,SAAZ,CACC,MAAO,CACN,GAAG,EACH,KAAM,CAAE,GAAG,EAAK,KAAmB,cAAa,CAChD,YAAa,OAAO,EAAe,CACnC,CAEA,WACoB,CAAA,ECtEX,EAAmB,uBACnB,EAAqB,yBAKlC,SAAgB,EAAiB,EAA0B,CAC1D,OAAO,IAAI,YAA8B,EAAkB,CAAE,SAAQ,CAAC,CAGvE,SAAgB,EAAmB,EAA4B,CAC9D,OAAO,IAAI,YAAgC,EAAoB,CAAE,SAAQ,CAAC,CAG3E,IAAa,EAA0B,oCAU1B,EAAb,cAAsC,WAAoC,GAE1E,SAAgB,EAAuB,EAAgC,CACtE,OAAO,IAAI,EAAiB,EAAyB,CACpD,SACA,WAAY,GACZ,CAAC,CAKH,IAAa,EAAwB,kCAarC,SAAgB,EAAqB,EAA8B,CAClE,OAAO,IAAI,YAAkC,EAAuB,CACnE,SACA,CAAC,CC9CH,SAAS,EAA2B,EAAsC,CACzE,GAAM,CAAE,UAAS,kBAAiB,SAAU,EAEtC,GAAY,GAAsB,CAClC,EAAM,OAAO,GAAG,WAAW,EAAgB,EAGhD,EACC,EAAM,OAAO,WACb,EAAM,OAAO,QACb,EAAM,OAAO,WACb,GAGI,GAAc,GAAwB,CACtC,EAAM,OAAO,GAAG,WAAW,EAAgB,EAGhD,EAAQ,EAAM,OAAO,WAAW,GAMjC,OAHA,OAAO,iBAAiB,EAAkB,EAAQ,CAClD,OAAO,iBAAiB,EAAoB,EAAU,KAEzC,CACZ,OAAO,oBAAoB,EAAkB,EAAQ,CACrD,OAAO,oBAAoB,EAAoB,EAAU,EAI3D,SAAgB,EACf,EACa,CACb,OAAO,EAAiB,EAAO,CAGhC,SAAgB,EACf,EACa,CACb,OAAO,EAAiB,EAAO,CC5ChC,SAAgB,EACf,EACO,CACP,IAAM,GAAA,EAAA,EAAA,QAAoB,EAAQ,EAElC,EAAA,EAAA,eAAgB,CACf,EAAW,QAAU,GACpB,EAEF,EAAA,EAAA,eAAgB,CACf,IAAM,EAAY,GAAiB,CAClC,EAAW,QAAQ,EAA0B,EAG9C,OADA,OAAO,iBAAiB,EAAyB,EAAS,KAC7C,CACZ,OAAO,oBAAoB,EAAyB,EAAS,GAE5D,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export type { AppProviderProps } from "./AppProvider";
|
|
|
2
2
|
export { AppProvider, useActiveOrgId, useNavigate, useUser, } from "./AppProvider";
|
|
3
3
|
export type { MenuItemDetail, MenuItemsEvent, MountEvent, RouteAction, UnmountEvent, } from "./events";
|
|
4
4
|
export { createMenuItemsEvent, createMountEvent, createRouteChangeEvent, createUnmountEvent, MENU_ITEMS_EVENT_TYPE, MOUNT_EVENT_TYPE, ROUTE_CHANGE_EVENT_TYPE, RouteChangeEvent, UNMOUNT_EVENT_TYPE, } from "./events";
|
|
5
|
-
export { registerMicroFrontend } from "./registerMicroFrontend";
|
|
6
|
-
export type { MenuItem, MicroFrontendPayload, NavigationFunction, User, } from "./types";
|
|
5
|
+
export { registerMicroFrontend, registerPublicMicroFrontend, } from "./registerMicroFrontend";
|
|
6
|
+
export type { MenuItem, MicroFrontendPayload, NavigationFunction, PublicMicroFrontendPayload, User, } from "./types";
|
|
7
7
|
export { useAfterRouteChange } from "./useAfterRouteChange";
|
package/dist/index.mjs
CHANGED
|
@@ -54,16 +54,24 @@ function b(e) {
|
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/registerMicroFrontend.ts
|
|
56
56
|
function x(e) {
|
|
57
|
-
let { unmount: t, microFrontendId: n, mount: r } = e
|
|
58
|
-
window.addEventListener(f, ((e) => {
|
|
57
|
+
let { unmount: t, microFrontendId: n, mount: r } = e, i = ((e) => {
|
|
59
58
|
e.detail.id.startsWith(n) && r(e.detail.mountPoint, e.detail.payload, e.detail.mountPoint);
|
|
60
|
-
})
|
|
59
|
+
}), a = ((e) => {
|
|
61
60
|
e.detail.id.startsWith(n) && t(e.detail.mountPoint);
|
|
62
|
-
})
|
|
61
|
+
});
|
|
62
|
+
return window.addEventListener(f, i), window.addEventListener(p, a), () => {
|
|
63
|
+
window.removeEventListener(f, i), window.removeEventListener(p, a);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function S(e) {
|
|
67
|
+
return x(e);
|
|
68
|
+
}
|
|
69
|
+
function C(e) {
|
|
70
|
+
return x(e);
|
|
63
71
|
}
|
|
64
72
|
//#endregion
|
|
65
73
|
//#region src/useAfterRouteChange.ts
|
|
66
|
-
function
|
|
74
|
+
function w(e) {
|
|
67
75
|
let t = i(e);
|
|
68
76
|
r(() => {
|
|
69
77
|
t.current = e;
|
|
@@ -77,6 +85,6 @@ function S(e) {
|
|
|
77
85
|
}, []);
|
|
78
86
|
}
|
|
79
87
|
//#endregion
|
|
80
|
-
export { d as AppProvider, y as MENU_ITEMS_EVENT_TYPE, f as MOUNT_EVENT_TYPE, g as ROUTE_CHANGE_EVENT_TYPE, _ as RouteChangeEvent, p as UNMOUNT_EVENT_TYPE, b as createMenuItemsEvent, m as createMountEvent, v as createRouteChangeEvent, h as createUnmountEvent,
|
|
88
|
+
export { d as AppProvider, y as MENU_ITEMS_EVENT_TYPE, f as MOUNT_EVENT_TYPE, g as ROUTE_CHANGE_EVENT_TYPE, _ as RouteChangeEvent, p as UNMOUNT_EVENT_TYPE, b as createMenuItemsEvent, m as createMountEvent, v as createRouteChangeEvent, h as createUnmountEvent, S as registerMicroFrontend, C as registerPublicMicroFrontend, l as useActiveOrgId, w as useAfterRouteChange, u as useNavigate, c as useUser };
|
|
81
89
|
|
|
82
90
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/AppProvider.tsx","../src/events.ts","../src/registerMicroFrontend.ts","../src/useAfterRouteChange.ts"],"sourcesContent":["import type { Permission } from \"@entur-partner/permission-client-node\";\nimport { assertIsDefined } from \"@entur-partner/util\";\nimport {\n\tcreateContext,\n\ttype FC,\n\ttype ReactNode,\n\tuseContext,\n\tuseEffect,\n\tuseState,\n} from \"react\";\n\nimport type { User } from \"./types\";\n\ninterface AppContextType {\n\tgetToken: () => Promise<string>;\n\tuser: User;\n\tlogout?: () => void;\n\tactiveOrgId: number;\n\tnavigate: (path: string) => void;\n}\n\nexport const AppContext = createContext<AppContextType | undefined>(undefined);\n\nexport const useUser = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.user;\n};\n\nexport const useActiveOrgId = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.activeOrgId;\n};\n\nexport interface AppProviderProps {\n\tchildren: ReactNode;\n\tgetToken: () => Promise<string>;\n\tuser: User;\n\tgetPermissions: () => Promise<Permission[]>;\n\torganisationId: string;\n\tnavigate: (path: string) => void;\n}\n\nexport const useNavigate = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.navigate;\n};\n\nexport const AppProvider: FC<AppProviderProps> = ({\n\tchildren,\n\torganisationId,\n\tgetPermissions,\n\t...rest\n}) => {\n\tconst [permissions, setPermissions] = useState<Permission[]>([]);\n\n\tuseEffect(() => {\n\t\tasync function fetchData() {\n\t\t\ttry {\n\t\t\t\tconst fetchedPermissions = await getPermissions();\n\t\t\t\tsetPermissions(fetchedPermissions);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t\"Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:\",\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tfetchData();\n\t}, [getPermissions]);\n\n\treturn (\n\t\t<AppContext.Provider\n\t\t\tvalue={{\n\t\t\t\t...rest,\n\t\t\t\tuser: { ...rest.user, permissions: permissions },\n\t\t\t\tactiveOrgId: Number(organisationId),\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</AppContext.Provider>\n\t);\n};\n","import type { MicroFrontendPayload } from \"./types\";\n\ntype MountEventDetail = {\n\tid: string;\n\tmountPoint: HTMLDivElement;\n\tpayload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n\tid: string;\n\tmountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = \"@entur-partner:mount\";\nexport const UNMOUNT_EVENT_TYPE = \"@entur-partner:unmount\";\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n\treturn new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n\treturn new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = \"@entur-partner:after-route-change\";\n\nexport type RouteAction = \"PUSH\" | \"POP\" | \"REPLACE\";\n\ntype RouteChangeEventDetail = {\n\tlocation: Location;\n\tpath: string;\n\taction: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n\nexport function createRouteChangeEvent(detail: RouteChangeEventDetail) {\n\treturn new RouteChangeEvent(ROUTE_CHANGE_EVENT_TYPE, {\n\t\tdetail,\n\t\tcancelable: true, // Allow listeners to call event.preventDefault() to indicate they handled the navigation\n\t});\n}\n\nexport interface MenuItemsEvent extends CustomEvent<MenuItemsEventDetail> {}\n\nexport const MENU_ITEMS_EVENT_TYPE = \"@entur-partner:menu-items-added\";\n\nexport interface MenuItemDetail {\n\ttitle: string;\n\tto: string;\n\tdisabled?: boolean;\n}\n\ntype MenuItemsEventDetail = {\n\tpath: string;\n\titems: MenuItemDetail[];\n};\n\nexport function createMenuItemsEvent(detail: MenuItemsEventDetail) {\n\treturn new CustomEvent<MenuItemsEventDetail>(MENU_ITEMS_EVENT_TYPE, {\n\t\tdetail,\n\t});\n}\n","import {\n\tMOUNT_EVENT_TYPE,\n\ttype MountEvent,\n\tUNMOUNT_EVENT_TYPE,\n\ttype UnmountEvent,\n} from \"./events\";\nimport type { MicroFrontendPayload } from \"./types\";\n\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/AppProvider.tsx","../src/events.ts","../src/registerMicroFrontend.ts","../src/useAfterRouteChange.ts"],"sourcesContent":["import type { Permission } from \"@entur-partner/permission-client-node\";\nimport { assertIsDefined } from \"@entur-partner/util\";\nimport {\n\tcreateContext,\n\ttype FC,\n\ttype ReactNode,\n\tuseContext,\n\tuseEffect,\n\tuseState,\n} from \"react\";\n\nimport type { User } from \"./types\";\n\ninterface AppContextType {\n\tgetToken: () => Promise<string>;\n\tuser: User;\n\tlogout?: () => void;\n\tactiveOrgId: number;\n\tnavigate: (path: string) => void;\n}\n\nexport const AppContext = createContext<AppContextType | undefined>(undefined);\n\nexport const useUser = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.user;\n};\n\nexport const useActiveOrgId = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.activeOrgId;\n};\n\nexport interface AppProviderProps {\n\tchildren: ReactNode;\n\tgetToken: () => Promise<string>;\n\tuser: User;\n\tgetPermissions: () => Promise<Permission[]>;\n\torganisationId: string;\n\tnavigate: (path: string) => void;\n}\n\nexport const useNavigate = () => {\n\tconst context = useContext(AppContext);\n\tassertIsDefined(context);\n\treturn context.navigate;\n};\n\nexport const AppProvider: FC<AppProviderProps> = ({\n\tchildren,\n\torganisationId,\n\tgetPermissions,\n\t...rest\n}) => {\n\tconst [permissions, setPermissions] = useState<Permission[]>([]);\n\n\tuseEffect(() => {\n\t\tasync function fetchData() {\n\t\t\ttry {\n\t\t\t\tconst fetchedPermissions = await getPermissions();\n\t\t\t\tsetPermissions(fetchedPermissions);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t\"Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:\",\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tfetchData();\n\t}, [getPermissions]);\n\n\treturn (\n\t\t<AppContext.Provider\n\t\t\tvalue={{\n\t\t\t\t...rest,\n\t\t\t\tuser: { ...rest.user, permissions: permissions },\n\t\t\t\tactiveOrgId: Number(organisationId),\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</AppContext.Provider>\n\t);\n};\n","import type { MicroFrontendPayload, PublicMicroFrontendPayload } from \"./types\";\n\ntype MountEventDetail = {\n\tid: string;\n\tmountPoint: HTMLDivElement;\n\tpayload: MicroFrontendPayload | PublicMicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n\tid: string;\n\tmountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = \"@entur-partner:mount\";\nexport const UNMOUNT_EVENT_TYPE = \"@entur-partner:unmount\";\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n\treturn new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n\treturn new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = \"@entur-partner:after-route-change\";\n\nexport type RouteAction = \"PUSH\" | \"POP\" | \"REPLACE\";\n\ntype RouteChangeEventDetail = {\n\tlocation: Location;\n\tpath: string;\n\taction: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n\nexport function createRouteChangeEvent(detail: RouteChangeEventDetail) {\n\treturn new RouteChangeEvent(ROUTE_CHANGE_EVENT_TYPE, {\n\t\tdetail,\n\t\tcancelable: true, // Allow listeners to call event.preventDefault() to indicate they handled the navigation\n\t});\n}\n\nexport interface MenuItemsEvent extends CustomEvent<MenuItemsEventDetail> {}\n\nexport const MENU_ITEMS_EVENT_TYPE = \"@entur-partner:menu-items-added\";\n\nexport interface MenuItemDetail {\n\ttitle: string;\n\tto: string;\n\tdisabled?: boolean;\n}\n\ntype MenuItemsEventDetail = {\n\tpath: string;\n\titems: MenuItemDetail[];\n};\n\nexport function createMenuItemsEvent(detail: MenuItemsEventDetail) {\n\treturn new CustomEvent<MenuItemsEventDetail>(MENU_ITEMS_EVENT_TYPE, {\n\t\tdetail,\n\t});\n}\n","import {\n\tMOUNT_EVENT_TYPE,\n\ttype MountEvent,\n\tUNMOUNT_EVENT_TYPE,\n\ttype UnmountEvent,\n} from \"./events\";\nimport type { MicroFrontendPayload, PublicMicroFrontendPayload } from \"./types\";\n\ntype Config<TPayload> = {\n\tmicroFrontendId: string;\n\tmount: (\n\t\tmountPoint: HTMLDivElement,\n\t\tpayload: TPayload,\n\t\tdeprecatedMountPoint: HTMLDivElement,\n\t) => void;\n\tunmount: (mountPoint: HTMLDivElement) => void;\n};\n\nfunction registerFrontend<TPayload>(config: Config<TPayload>): () => void {\n\tconst { unmount, microFrontendId, mount } = config;\n\n\tconst onMount = ((event: MountEvent) => {\n\t\tif (!event.detail.id.startsWith(microFrontendId)) {\n\t\t\treturn;\n\t\t}\n\t\tmount(\n\t\t\tevent.detail.mountPoint,\n\t\t\tevent.detail.payload as TPayload,\n\t\t\tevent.detail.mountPoint,\n\t\t);\n\t}) as EventListener;\n\n\tconst onUnmount = ((event: UnmountEvent) => {\n\t\tif (!event.detail.id.startsWith(microFrontendId)) {\n\t\t\treturn;\n\t\t}\n\t\tunmount(event.detail.mountPoint);\n\t}) as EventListener;\n\n\twindow.addEventListener(MOUNT_EVENT_TYPE, onMount);\n\twindow.addEventListener(UNMOUNT_EVENT_TYPE, onUnmount);\n\n\treturn () => {\n\t\twindow.removeEventListener(MOUNT_EVENT_TYPE, onMount);\n\t\twindow.removeEventListener(UNMOUNT_EVENT_TYPE, onUnmount);\n\t};\n}\n\nexport function registerMicroFrontend(\n\tconfig: Config<MicroFrontendPayload>,\n): () => void {\n\treturn registerFrontend(config);\n}\n\nexport function registerPublicMicroFrontend(\n\tconfig: Config<PublicMicroFrontendPayload>,\n): () => void {\n\treturn registerFrontend(config);\n}\n","import { useEffect, useRef } from \"react\";\n\nimport { ROUTE_CHANGE_EVENT_TYPE, type RouteChangeEvent } from \"./events\";\n\n/**\n * Subscribes to the `@entur-partner:after-route-change` event dispatched by\n * the sidebar when a navigation link is activated. The event is cancelable:\n * call `event.preventDefault()` inside the handler to signal that the host\n * application handled the navigation.\n *\n * The handler is stored in a ref so callers do not need to memoize it; the\n * listener itself is subscribed once per mount.\n */\nexport function useAfterRouteChange(\n\thandler: (event: RouteChangeEvent) => void,\n): void {\n\tconst handlerRef = useRef(handler);\n\n\tuseEffect(() => {\n\t\thandlerRef.current = handler;\n\t});\n\n\tuseEffect(() => {\n\t\tconst listener = (event: Event) => {\n\t\t\thandlerRef.current(event as RouteChangeEvent);\n\t\t};\n\t\twindow.addEventListener(ROUTE_CHANGE_EVENT_TYPE, listener);\n\t\treturn () => {\n\t\t\twindow.removeEventListener(ROUTE_CHANGE_EVENT_TYPE, listener);\n\t\t};\n\t}, []);\n}\n"],"mappings":";;;;AAqBA,IAAa,IAAa,EAA0C,KAAA,EAAU,EAEjE,UAAgB;CAC5B,IAAM,IAAU,EAAW,EAAW;AAEtC,QADA,EAAgB,EAAQ,EACjB,EAAQ;GAGH,UAAuB;CACnC,IAAM,IAAU,EAAW,EAAW;AAEtC,QADA,EAAgB,EAAQ,EACjB,EAAQ;GAYH,UAAoB;CAChC,IAAM,IAAU,EAAW,EAAW;AAEtC,QADA,EAAgB,EAAQ,EACjB,EAAQ;GAGH,KAAqC,EACjD,aACA,mBACA,mBACA,GAAG,QACE;CACL,IAAM,CAAC,GAAa,KAAkB,EAAuB,EAAE,CAAC;AAkBhE,QAhBA,QAAgB;EACf,eAAe,IAAY;AAC1B,OAAI;AAEH,MAAe,MADkB,GAAgB,CACf;YAC1B,GAAO;AACf,YAAQ,MACP,kHACA,EACA;;;AAIH,KAAW;IACT,CAAC,EAAe,CAAC,EAGnB,kBAAC,EAAW,UAAZ;EACC,OAAO;GACN,GAAG;GACH,MAAM;IAAE,GAAG,EAAK;IAAmB;IAAa;GAChD,aAAa,OAAO,EAAe;GACnC;EAEA;EACoB,CAAA;GCtEX,IAAmB,wBACnB,IAAqB;AAKlC,SAAgB,EAAiB,GAA0B;AAC1D,QAAO,IAAI,YAA8B,GAAkB,EAAE,WAAQ,CAAC;;AAGvE,SAAgB,EAAmB,GAA4B;AAC9D,QAAO,IAAI,YAAgC,GAAoB,EAAE,WAAQ,CAAC;;AAG3E,IAAa,IAA0B,qCAU1B,IAAb,cAAsC,YAAoC;AAE1E,SAAgB,EAAuB,GAAgC;AACtE,QAAO,IAAI,EAAiB,GAAyB;EACpD;EACA,YAAY;EACZ,CAAC;;AAKH,IAAa,IAAwB;AAarC,SAAgB,EAAqB,GAA8B;AAClE,QAAO,IAAI,YAAkC,GAAuB,EACnE,WACA,CAAC;;;;AC9CH,SAAS,EAA2B,GAAsC;CACzE,IAAM,EAAE,YAAS,oBAAiB,aAAU,GAEtC,MAAY,MAAsB;AAClC,IAAM,OAAO,GAAG,WAAW,EAAgB,IAGhD,EACC,EAAM,OAAO,YACb,EAAM,OAAO,SACb,EAAM,OAAO,WACb;KAGI,MAAc,MAAwB;AACtC,IAAM,OAAO,GAAG,WAAW,EAAgB,IAGhD,EAAQ,EAAM,OAAO,WAAW;;AAMjC,QAHA,OAAO,iBAAiB,GAAkB,EAAQ,EAClD,OAAO,iBAAiB,GAAoB,EAAU,QAEzC;AAEZ,EADA,OAAO,oBAAoB,GAAkB,EAAQ,EACrD,OAAO,oBAAoB,GAAoB,EAAU;;;AAI3D,SAAgB,EACf,GACa;AACb,QAAO,EAAiB,EAAO;;AAGhC,SAAgB,EACf,GACa;AACb,QAAO,EAAiB,EAAO;;;;AC5ChC,SAAgB,EACf,GACO;CACP,IAAM,IAAa,EAAO,EAAQ;AAMlC,CAJA,QAAgB;AACf,IAAW,UAAU;GACpB,EAEF,QAAgB;EACf,IAAM,KAAY,MAAiB;AAClC,KAAW,QAAQ,EAA0B;;AAG9C,SADA,OAAO,iBAAiB,GAAyB,EAAS,QAC7C;AACZ,UAAO,oBAAoB,GAAyB,EAAS;;IAE5D,EAAE,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { MicroFrontendPayload } from "./types";
|
|
2
|
-
|
|
1
|
+
import type { MicroFrontendPayload, PublicMicroFrontendPayload } from "./types";
|
|
2
|
+
type Config<TPayload> = {
|
|
3
3
|
microFrontendId: string;
|
|
4
|
-
mount: (mountPoint: HTMLDivElement, payload:
|
|
4
|
+
mount: (mountPoint: HTMLDivElement, payload: TPayload, deprecatedMountPoint: HTMLDivElement) => void;
|
|
5
5
|
unmount: (mountPoint: HTMLDivElement) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare function registerMicroFrontend(config: Config): void;
|
|
6
|
+
};
|
|
7
|
+
export declare function registerMicroFrontend(config: Config<MicroFrontendPayload>): () => void;
|
|
8
|
+
export declare function registerPublicMicroFrontend(config: Config<PublicMicroFrontendPayload>): () => void;
|
|
8
9
|
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export interface MenuItem {
|
|
|
31
31
|
navigate: (path: string) => void;
|
|
32
32
|
/** Is menu item disabled? */
|
|
33
33
|
disabled?: boolean;
|
|
34
|
+
/** Is public menu item? */
|
|
35
|
+
isPublic?: boolean;
|
|
34
36
|
/** Permissions required to view menu item */
|
|
35
37
|
requiredPermissions?: {
|
|
36
38
|
oneOf?: BusinessCapability[];
|
|
@@ -58,3 +60,12 @@ export interface MicroFrontendPayload {
|
|
|
58
60
|
* will try to use the navigate function from the first menu item instead. */
|
|
59
61
|
setMFNavigate: (navigate: NavigationFunction) => void;
|
|
60
62
|
}
|
|
63
|
+
export type PublicMicroFrontendPayload = Pick<MicroFrontendPayload, "language" | "navigate" | "setMFNavigate" | "addMenuItems"> & {
|
|
64
|
+
user?: User;
|
|
65
|
+
/** Function for getting an accessToken */
|
|
66
|
+
getToken?(options?: GetTokenSilentlyOptions): Promise<string>;
|
|
67
|
+
/** Active organisation identifier*/
|
|
68
|
+
organisationId?: string;
|
|
69
|
+
/** Log the user out */
|
|
70
|
+
logout?: () => void;
|
|
71
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur-partner/micro-frontend",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"posthog-js": "^1.369.5"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@entur-partner/util": "^1.
|
|
38
|
+
"@entur-partner/util": "^1.4.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "456dafa57c8f73fee42bee4b740904b2e03d7ce8"
|
|
41
41
|
}
|