@jpmorganchase/mosaic-store 0.1.0-beta.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.
Files changed (101) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/CHANGELOG.md +7 -0
  3. package/README.md +9 -0
  4. package/dist/chunk-5L7EI47O.js +0 -0
  5. package/dist/chunk-5TAZCOCH.js +1 -0
  6. package/dist/chunk-AA7IK7Y5.js +1 -0
  7. package/dist/chunk-ASPK4M5R.js +0 -0
  8. package/dist/chunk-BHMVW2ZZ.js +0 -0
  9. package/dist/chunk-BZYGOU7Y.js +0 -0
  10. package/dist/chunk-C62PIKZ5.js +1 -0
  11. package/dist/chunk-DGGPN6YK.js +1 -0
  12. package/dist/chunk-HUM6DWGV.js +1 -0
  13. package/dist/chunk-LYZGAQ5N.js +1 -0
  14. package/dist/chunk-MBLLQB7A.js +0 -0
  15. package/dist/chunk-OHN6TEOW.js +1 -0
  16. package/dist/chunk-PN7DOU52.js +1 -0
  17. package/dist/chunk-SD2G45FB.js +1 -0
  18. package/dist/chunk-TEDOG7PC.js +1 -0
  19. package/dist/chunk-UGD4MMRB.js +0 -0
  20. package/dist/chunk-UK5NIPTI.js +0 -0
  21. package/dist/chunk-UMYWSM5J.js +1 -0
  22. package/dist/chunk-VXYECVIB.js +0 -0
  23. package/dist/chunk-ZJYDN5YH.js +0 -0
  24. package/dist/chunk-ZYJGHEAC.js +0 -0
  25. package/dist/index.d.ts +12 -0
  26. package/dist/index.js +1 -0
  27. package/dist/store.d.ts +30 -0
  28. package/dist/store.js +1 -0
  29. package/dist/types/appHeader.d.ts +66 -0
  30. package/dist/types/appHeader.js +1 -0
  31. package/dist/types/breadcrumbs.d.ts +20 -0
  32. package/dist/types/breadcrumbs.js +1 -0
  33. package/dist/types/footer.d.ts +16 -0
  34. package/dist/types/footer.js +1 -0
  35. package/dist/types/helpLinks.d.ts +13 -0
  36. package/dist/types/helpLinks.js +1 -0
  37. package/dist/types/index.d.ts +10 -0
  38. package/dist/types/index.js +1 -0
  39. package/dist/types/layout.d.ts +7 -0
  40. package/dist/types/layout.js +1 -0
  41. package/dist/types/meta.d.ts +12 -0
  42. package/dist/types/meta.js +1 -0
  43. package/dist/types/route.d.ts +7 -0
  44. package/dist/types/route.js +1 -0
  45. package/dist/types/sharedConfig.d.ts +14 -0
  46. package/dist/types/sharedConfig.js +1 -0
  47. package/dist/types/sidebar.d.ts +22 -0
  48. package/dist/types/sidebar.js +1 -0
  49. package/dist/types/tableOfContents.d.ts +18 -0
  50. package/dist/types/tableOfContents.js +1 -0
  51. package/dist/useAppHeader.d.ts +9 -0
  52. package/dist/useAppHeader.js +1 -0
  53. package/dist/useBreadcrumbs.d.ts +5 -0
  54. package/dist/useBreadcrumbs.js +1 -0
  55. package/dist/useFooter.d.ts +4 -0
  56. package/dist/useFooter.js +1 -0
  57. package/dist/useLayout.d.ts +4 -0
  58. package/dist/useLayout.js +1 -0
  59. package/dist/useMeta.d.ts +5 -0
  60. package/dist/useMeta.js +1 -0
  61. package/dist/useNextPrev.d.ts +4 -0
  62. package/dist/useNextPrev.js +1 -0
  63. package/dist/useRoute.d.ts +2 -0
  64. package/dist/useRoute.js +1 -0
  65. package/dist/useSidebar.d.ts +5 -0
  66. package/dist/useSidebar.js +1 -0
  67. package/dist/useTableOfContents.d.ts +4 -0
  68. package/dist/useTableOfContents.js +1 -0
  69. package/package.json +32 -0
  70. package/src/__tests__/store.test.ts +126 -0
  71. package/src/__tests__/test-utils/utils.tsx +25 -0
  72. package/src/__tests__/useAppHeader.test.ts +182 -0
  73. package/src/__tests__/useBreadcrumbs.test.ts +42 -0
  74. package/src/__tests__/useFooter.test.ts +64 -0
  75. package/src/__tests__/useLayout.test.ts +24 -0
  76. package/src/__tests__/useMeta.test.ts +35 -0
  77. package/src/__tests__/useRoute.test.ts +24 -0
  78. package/src/__tests__/useTableOfContents.test.ts +31 -0
  79. package/src/index.ts +13 -0
  80. package/src/store.ts +105 -0
  81. package/src/types/appHeader.ts +72 -0
  82. package/src/types/breadcrumbs.ts +21 -0
  83. package/src/types/footer.ts +17 -0
  84. package/src/types/helpLinks.ts +13 -0
  85. package/src/types/index.ts +10 -0
  86. package/src/types/layout.ts +7 -0
  87. package/src/types/meta.ts +13 -0
  88. package/src/types/route.ts +7 -0
  89. package/src/types/sharedConfig.ts +16 -0
  90. package/src/types/sidebar.ts +22 -0
  91. package/src/types/tableOfContents.ts +19 -0
  92. package/src/useAppHeader.ts +64 -0
  93. package/src/useBreadcrumbs.ts +11 -0
  94. package/src/useFooter.ts +10 -0
  95. package/src/useLayout.ts +9 -0
  96. package/src/useMeta.ts +17 -0
  97. package/src/useNextPrev.ts +43 -0
  98. package/src/useRoute.ts +9 -0
  99. package/src/useSidebar.ts +16 -0
  100. package/src/useTableOfContents.ts +10 -0
  101. package/tsconfig.json +9 -0
@@ -0,0 +1,4 @@
1
+ @jpmorganchase/mosaic-store:build: cache hit, replaying output f4eaa1a5b64bccba
2
+ @jpmorganchase/mosaic-store:build: $ npm-run-all --parallel build:*
3
+ @jpmorganchase/mosaic-store:build: $ node ../../scripts/bundle.js
4
+ @jpmorganchase/mosaic-store:build: $ tsc
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @jpmorganchase/mosaic-store
2
+
3
+ ## 0.1.0-beta.8
4
+
5
+ ### Minor Changes
6
+
7
+ - 2dca0b1: initial release of Mosaic store package
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # Mosaic Site Store
2
+
3
+ `@dpmosaic/site-store` an extendable API for accessing Mosaic state and props.
4
+
5
+ The Mosaic store is based on [Zustand](https://zustand-demo.pmnd.rs/).
6
+
7
+ ## Installation
8
+
9
+ `yarn add @dpmosaic/site-store`
File without changes
@@ -0,0 +1 @@
1
+ var f=Object.defineProperty,g=Object.defineProperties;var h=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var i=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var e=(c,a,b)=>a in c?f(c,a,{enumerable:!0,configurable:!0,writable:!0,value:b}):c[a]=b,k=(c,a)=>{for(var b in a||(a={}))i.call(a,b)&&e(c,b,a[b]);if(d)for(var b of d(a))j.call(a,b)&&e(c,b,a[b]);return c},l=(c,a)=>g(c,h(a));export{k as a,l as b};
@@ -0,0 +1 @@
1
+ import{a as u}from"./chunk-SD2G45FB.js";import{d}from"./chunk-TEDOG7PC.js";import{a as t,b as p}from"./chunk-5TAZCOCH.js";function a(e){return e.links!==void 0}function m(e){return e.link!==void 0}var M=e=>e?process.env[`SEARCH_ENDPOINT_${e}`]||"":process.env.SEARCH_ENDPOINT;function I(){let e=d(r=>{var n;return(n=r.sharedConfig)==null?void 0:n.header});if(!e)return;let i={};e.searchNamespace&&(i={HeaderControlsProps:{searchEndpoint:M(e.searchNamespace)}});let o=e.menu.reduce((r,n)=>{if(a(n)){let s=p(t({},n),{type:u.MENU});return[...r,s]}if(m(n)){let s=p(t({},n),{type:u.LINK});return[...r,s]}return console.error("Unknown menu type passed to useAppHeader, ignoring",n),r},[]);return p(t(t({},i),e),{menu:o})}export{I as a};
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ import{d as t}from"./chunk-TEDOG7PC.js";function i(){return{meta:t(e=>({description:e.description,breadcrumbs:e.breadcrumbs,title:e.title}))}}export{i as a};
@@ -0,0 +1 @@
1
+ import{d as r}from"./chunk-TEDOG7PC.js";function u(t=1){let e=r(o=>o.breadcrumbs);return{breadcrumbs:e||[],enabled:(e==null?void 0:e.length)>t}}export{u as a};
@@ -0,0 +1 @@
1
+ import{d as e}from"./chunk-TEDOG7PC.js";function u(){return{route:e(t=>t.route)}}export{u as a};
@@ -0,0 +1 @@
1
+ import{d as t}from"./chunk-TEDOG7PC.js";function y(){return{layout:t(o=>o.layout)}}export{y as a};
File without changes
@@ -0,0 +1 @@
1
+ import{d as e}from"./chunk-TEDOG7PC.js";function i(){return e(t=>{var o;return(o=t.sharedConfig)==null?void 0:o.footer})}export{i as a};
@@ -0,0 +1 @@
1
+ import{d as t}from"./chunk-TEDOG7PC.js";function s(){return{tableOfContents:t(e=>e.tableOfContents)||[]}}export{s as a};
@@ -0,0 +1 @@
1
+ var t;(function(e){e.MENU="menu",e.LINK="link"})(t||(t={}));export{t as a};
@@ -0,0 +1 @@
1
+ import{a as r}from"./chunk-5TAZCOCH.js";import{useLayoutEffect as s,createContext as S,useContext as d}from"react";import{createStore as u,useStore as f}from"zustand";import{devtools as c}from"zustand/middleware";var t;function l(){return{breadcrumbs:[],sidebarData:[],tableOfContents:[],sharedConfig:{},description:void 0,layout:void 0,route:void 0,title:void 0}}var n=S(void 0),g=n.Provider,a=(e={})=>u(c(()=>r(r({},l()),e)));function C(e,i=!1){if(typeof window=="undefined"||i)return()=>a(e);let o=Boolean(t);return t=t!=null?t:a(e),s(()=>{e&&o&&t.setState(r(r({},t.getState()),e),!0)}),()=>t}function h(e,i){let o=d(n);if(!o)throw new Error("Missing StoreProvider in the tree");return f(o,e,i)}export{g as a,a as b,C as c,h as d};
File without changes
File without changes
@@ -0,0 +1 @@
1
+ import{a as n}from"./chunk-HUM6DWGV.js";import{a}from"./chunk-DGGPN6YK.js";import{d as s}from"./chunk-TEDOG7PC.js";function v(){let e=s(o=>o.sidebarData)||[],{route:t}=n(),{breadcrumbs:r}=a();return{sidebarData:e,selectedNodeId:t,expandedNodeIds:x(r)}}function x(e){return new Set(e.map(({id:t})=>t.substr(0,t.lastIndexOf("."))))}function C(){let e=s(u=>u.sidebarData)||[],{route:t}=n(),{next:r,prev:o}=c(e,t);return{next:r,prev:o}}var c=(e,t)=>{let r=p(e);return i(r,t)},p=e=>{let t=[];return e.forEach(r=>{t.push({link:r.data.link,text:r.name}),r.childNodes&&(t=t.concat(p(r.childNodes)))}),t},i=(e,t)=>{let r=e.map(m=>m.link).indexOf(t),{length:o}=e,u=d(r,o)?e[r+1]:null,f=l(r,o)?e[r-1]:null;return{next:u,prev:f}},d=(e,t)=>e>=0&&e<t-1,l=(e,t)=>e>0&&e<t;export{C as a,v as b};
File without changes
File without changes
File without changes
@@ -0,0 +1,12 @@
1
+ export * from './store';
2
+ export * from './useAppHeader';
3
+ export * from './useBreadcrumbs';
4
+ export * from './useLayout';
5
+ export * from './useMeta';
6
+ export * from './useNextPrev';
7
+ export * from './useRoute';
8
+ export * from './useSidebar';
9
+ export * from './useTableOfContents';
10
+ export * from './useFooter';
11
+ export * from './types';
12
+ export { MenuItemType } from './types';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{a as j,b as l}from"./chunk-UMYWSM5J.js";import{a as k}from"./chunk-HUM6DWGV.js";import{a as m}from"./chunk-PN7DOU52.js";import{a as f}from"./chunk-AA7IK7Y5.js";import"./chunk-ASPK4M5R.js";import"./chunk-BZYGOU7Y.js";import"./chunk-UGD4MMRB.js";import"./chunk-BHMVW2ZZ.js";import"./chunk-5L7EI47O.js";import"./chunk-MBLLQB7A.js";import"./chunk-ZJYDN5YH.js";import{a as e}from"./chunk-SD2G45FB.js";import"./chunk-VXYECVIB.js";import"./chunk-UK5NIPTI.js";import"./chunk-ZYJGHEAC.js";import{a as g}from"./chunk-DGGPN6YK.js";import{a as n}from"./chunk-OHN6TEOW.js";import{a as h}from"./chunk-LYZGAQ5N.js";import{a as i}from"./chunk-C62PIKZ5.js";import{a,b,c,d}from"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{e as MenuItemType,a as StoreProvider,b as initializeStore,f as useAppHeader,g as useBreadcrumbs,c as useCreateStore,n as useFooter,h as useLayout,i as useMeta,j as useNextPrev,k as useRoute,l as useSidebar,d as useStore,m as useTableOfContents};
@@ -0,0 +1,30 @@
1
+ import { StoreApi } from 'zustand';
2
+ import type { BreadcrumbsSlice } from './types/breadcrumbs';
3
+ import type { SharedConfigSlice } from './types/sharedConfig';
4
+ import type { LayoutSlice } from './types/layout';
5
+ import type { SidebarSlice } from './types/sidebar';
6
+ import type { TableOfContentsSlice } from './types/tableOfContents';
7
+ export declare type SiteState = BreadcrumbsSlice & LayoutSlice & SidebarSlice & TableOfContentsSlice & SharedConfigSlice & {
8
+ /** Page metadata description, used by search */
9
+ description?: string;
10
+ /** Page route */
11
+ route?: string;
12
+ /** Page title */
13
+ title?: string;
14
+ };
15
+ declare const StoreProvider: import("react").Provider<StoreApi<SiteState> | undefined>;
16
+ declare const initializeStore: (preloadedState?: Partial<SiteState>) => Omit<StoreApi<SiteState>, "setState"> & {
17
+ setState<A extends string | {
18
+ type: unknown;
19
+ }>(partial: SiteState | Partial<SiteState> | ((state: SiteState) => SiteState | Partial<SiteState>), replace?: boolean | undefined, action?: A | undefined): void;
20
+ };
21
+ declare function useCreateStore(serverInitialState: Partial<SiteState>, isSSR?: boolean): () => Omit<StoreApi<SiteState>, "setState"> & {
22
+ setState<A extends string | {
23
+ type: unknown;
24
+ }>(partial: SiteState | Partial<SiteState> | ((state: SiteState) => SiteState | Partial<SiteState>), replace?: boolean | undefined, action?: A | undefined): void;
25
+ };
26
+ /**
27
+ * Hook providing access to state stored in the site store
28
+ */
29
+ declare function useStore<T>(selector: (state: SiteState) => T, equalityFn?: (left: T, right: T) => boolean): T;
30
+ export { useCreateStore, StoreProvider, useStore, initializeStore };
package/dist/store.js ADDED
@@ -0,0 +1 @@
1
+ import{a,b,c,d}from"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as StoreProvider,b as initializeStore,c as useCreateStore,d as useStore};
@@ -0,0 +1,66 @@
1
+ /**
2
+ * [[`MenuItemType`]] defines the type of App header Menu items
3
+ */
4
+ export declare enum MenuItemType {
5
+ MENU = "menu",
6
+ LINK = "link"
7
+ }
8
+ /**
9
+ * [[`Menu`]] defines App Header menus
10
+ */
11
+ export declare type Menu = MenuLinksItem | MenuLinkItem;
12
+ /**
13
+ * [[`MenuLinksItem`]] defines a menu of links
14
+ */
15
+ export interface MenuLinksItem {
16
+ /** Collection of link options */
17
+ links: MenuLinkItem[];
18
+ /** Title of Tab */
19
+ title: string;
20
+ }
21
+ /**
22
+ * [[`MenuLinksItem`]] defines a menu of links and includes a type
23
+ */
24
+ export interface AppHeaderMenuLinksItem {
25
+ /** Collection of link options */
26
+ links: MenuLinkItem[];
27
+ /** Title of Tab */
28
+ title: string;
29
+ /** Type of Tab */
30
+ type: MenuItemType.MENU;
31
+ }
32
+ /**
33
+ * [[`MenuLinkItem`]] define a menu link
34
+ */
35
+ export interface MenuLinkItem {
36
+ /** URL linked by Tab */
37
+ link: string;
38
+ /** Title of Tab */
39
+ title?: string;
40
+ }
41
+ /**
42
+ * [[`MenuLinkItem`]] define a menu link and include a type
43
+ */
44
+ export interface AppHeaderMenuLinkItem {
45
+ /** URL linked by Tab */
46
+ link: string;
47
+ /** Title of Tab */
48
+ title?: string;
49
+ /** Type of Tab */
50
+ type: MenuItemType.LINK;
51
+ }
52
+ /**
53
+ * [[`AppHeaderSlice`]] specifies the contents of the AppHeader
54
+ */
55
+ export declare type AppHeaderSlice = {
56
+ /** App logo/title */
57
+ title: string;
58
+ /** Link to the home page */
59
+ homeLink: string;
60
+ /** Logo URL */
61
+ logo?: string;
62
+ /** App Header menu */
63
+ menu: Menu[];
64
+ /** Search namespace, suffix used on env variable `process.env.SEARCH_ENDPOINT` to filter search results to a specific namespace. */
65
+ searchNamespace?: string;
66
+ };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-SD2G45FB.js";import"../chunk-5TAZCOCH.js";export{a as MenuItemType};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * [[`Breadcrumb`]] defines the breadcrumb for a page
3
+ */
4
+ export declare type Breadcrumb = {
5
+ /** The associated route/path of the breadcrumb */
6
+ path: string;
7
+ /** Whether the breadcrumb is hidden */
8
+ hidden: boolean;
9
+ /** UID */
10
+ id: string;
11
+ /** Breadcrumb label */
12
+ label: string;
13
+ };
14
+ /**
15
+ * [[`BreadcrumbsSlice`]] is the associated [[`Breadcrumb`]] items
16
+ */
17
+ export declare type BreadcrumbsSlice = {
18
+ /** Path described in breadcrumbs */
19
+ breadcrumbs: Breadcrumb[];
20
+ };
@@ -0,0 +1 @@
1
+ import"../chunk-VXYECVIB.js";import"../chunk-5TAZCOCH.js";
@@ -0,0 +1,16 @@
1
+ import { HelpLinks } from './helpLinks';
2
+ /**
3
+ * [[`FooterSlice`]] specifies the footer props
4
+ */
5
+ export declare type FooterSlice = {
6
+ /** Footer description/message */
7
+ description: string;
8
+ /** Footer title */
9
+ title: string;
10
+ /** Sign-up URL */
11
+ href: string;
12
+ /** Support channels */
13
+ helpLinks: HelpLinks;
14
+ /** Sign-up label */
15
+ label: string;
16
+ };
@@ -0,0 +1 @@
1
+ import"../chunk-UK5NIPTI.js";import"../chunk-5TAZCOCH.js";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * [[`HelpLinks`]] specifies the support channels
3
+ */
4
+ export declare type HelpLinks = {
5
+ /** StackOverflow link label */
6
+ stackoverflowLabel: string;
7
+ /** StackOverflow URL for product support */
8
+ stackoverflowUrl: string;
9
+ /** Symphony link label */
10
+ symphonyLabel: string;
11
+ /** Symphony URL for product support */
12
+ symphonyUrl: string;
13
+ };
@@ -0,0 +1 @@
1
+ import"../chunk-ZYJGHEAC.js";import"../chunk-5TAZCOCH.js";
@@ -0,0 +1,10 @@
1
+ export * from './appHeader';
2
+ export * from './breadcrumbs';
3
+ export * from './footer';
4
+ export * from './helpLinks';
5
+ export * from './layout';
6
+ export * from './meta';
7
+ export * from './route';
8
+ export * from './sharedConfig';
9
+ export * from './sidebar';
10
+ export * from './tableOfContents';
@@ -0,0 +1 @@
1
+ import"../chunk-ASPK4M5R.js";import"../chunk-BZYGOU7Y.js";import"../chunk-UGD4MMRB.js";import"../chunk-BHMVW2ZZ.js";import"../chunk-5L7EI47O.js";import"../chunk-MBLLQB7A.js";import"../chunk-ZJYDN5YH.js";import{a}from"../chunk-SD2G45FB.js";import"../chunk-VXYECVIB.js";import"../chunk-UK5NIPTI.js";import"../chunk-ZYJGHEAC.js";import"../chunk-5TAZCOCH.js";export{a as MenuItemType};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * [[`LayoutSlice`]] specifies the page's anatomy
3
+ */
4
+ export declare type LayoutSlice = {
5
+ /** Layout name that will define the page's anatomy */
6
+ layout?: string;
7
+ };
@@ -0,0 +1 @@
1
+ import"../chunk-BZYGOU7Y.js";import"../chunk-5TAZCOCH.js";
@@ -0,0 +1,12 @@
1
+ import type { Breadcrumb } from './breadcrumbs';
2
+ /**
3
+ * [[`MetaSlice`]] specifies the page's head metadata
4
+ */
5
+ export declare type MetaSlice = {
6
+ /** Page description */
7
+ description?: string;
8
+ /** Page breadcrumbs */
9
+ breadcrumbs?: Breadcrumb[];
10
+ /** Page title */
11
+ title?: string;
12
+ };
@@ -0,0 +1 @@
1
+ import"../chunk-UGD4MMRB.js";import"../chunk-5TAZCOCH.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * [[`RouteSlice`]] specifies the page's route
3
+ */
4
+ export declare type RouteSlice = {
5
+ /** Current page route */
6
+ route?: string;
7
+ };
@@ -0,0 +1 @@
1
+ import"../chunk-BHMVW2ZZ.js";import"../chunk-5TAZCOCH.js";
@@ -0,0 +1,14 @@
1
+ import type { AppHeaderSlice } from './appHeader';
2
+ import type { FooterSlice } from './footer';
3
+ import type { SidebarSlice } from './sidebar';
4
+ export declare type SharedConfig = {
5
+ /** Footer props */
6
+ footer?: FooterSlice;
7
+ /** Header props */
8
+ header?: AppHeaderSlice;
9
+ /** Sidebar props */
10
+ sidebar?: SidebarSlice;
11
+ };
12
+ export declare type SharedConfigSlice = {
13
+ sharedConfig: SharedConfig;
14
+ };
@@ -0,0 +1 @@
1
+ import"../chunk-5L7EI47O.js";import"../chunk-5TAZCOCH.js";
@@ -0,0 +1,22 @@
1
+ export declare type SidebarItem = {
2
+ /** The id of the item */
3
+ id: string;
4
+ /** The name of the item */
5
+ name: string;
6
+ /** Sidebar data */
7
+ data: {
8
+ /** The link of the item */
9
+ link: string;
10
+ };
11
+ /** Child nodes */
12
+ childNodes: SidebarItem[];
13
+ /** Whether the item is hidden */
14
+ hidden: boolean;
15
+ };
16
+ /**
17
+ * [[`SidebarSlice`]] specifies sidebar content
18
+ */
19
+ export declare type SidebarSlice = {
20
+ /** Sidebar items */
21
+ sidebarData: SidebarItem[];
22
+ };
@@ -0,0 +1 @@
1
+ import"../chunk-MBLLQB7A.js";import"../chunk-5TAZCOCH.js";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * [[`TableOfContentsItem`]] defines a table of contents item
3
+ */
4
+ export declare type TableOfContentsItem = {
5
+ /** The depth of the heading */
6
+ level: number;
7
+ /** The id attribute of the heading */
8
+ id: string;
9
+ /** The heading text */
10
+ text: string;
11
+ };
12
+ /**
13
+ * [[`TableOfContentsSlice`]] defines the table of contents for a page
14
+ */
15
+ export declare type TableOfContentsSlice = {
16
+ /** Path described in breadcrumbs */
17
+ tableOfContents: TableOfContentsItem[];
18
+ };
@@ -0,0 +1 @@
1
+ import"../chunk-ZJYDN5YH.js";import"../chunk-5TAZCOCH.js";
@@ -0,0 +1,9 @@
1
+ import type { AppHeaderSlice, AppHeaderMenuLinkItem, AppHeaderMenuLinksItem } from './types';
2
+ export declare type AppHeaderMenu = Array<AppHeaderMenuLinksItem | AppHeaderMenuLinkItem>;
3
+ export interface AppHeader extends Omit<AppHeaderSlice, 'searchNamespace | menu'> {
4
+ HeaderControlsProps?: {
5
+ searchEndpoint: string;
6
+ };
7
+ menu: AppHeaderMenu;
8
+ }
9
+ export declare function useAppHeader(): AppHeader | undefined;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-AA7IK7Y5.js";import"./chunk-ASPK4M5R.js";import"./chunk-BZYGOU7Y.js";import"./chunk-UGD4MMRB.js";import"./chunk-BHMVW2ZZ.js";import"./chunk-5L7EI47O.js";import"./chunk-MBLLQB7A.js";import"./chunk-ZJYDN5YH.js";import"./chunk-SD2G45FB.js";import"./chunk-VXYECVIB.js";import"./chunk-UK5NIPTI.js";import"./chunk-ZYJGHEAC.js";import"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as useAppHeader};
@@ -0,0 +1,5 @@
1
+ export type { Breadcrumb } from './types';
2
+ export declare function useBreadcrumbs(minCrumbs?: number): {
3
+ breadcrumbs: import("./types").Breadcrumb[];
4
+ enabled: boolean;
5
+ };
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-DGGPN6YK.js";import"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as useBreadcrumbs};
@@ -0,0 +1,4 @@
1
+ import type { FooterSlice } from './types';
2
+ declare type Footer = FooterSlice | undefined;
3
+ export declare function useFooter(): Footer;
4
+ export {};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-OHN6TEOW.js";import"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as useFooter};
@@ -0,0 +1,4 @@
1
+ import type { LayoutSlice } from './types';
2
+ declare type Layout = LayoutSlice;
3
+ export declare function useLayout(): Layout;
4
+ export {};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-LYZGAQ5N.js";import"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as useLayout};
@@ -0,0 +1,5 @@
1
+ import type { MetaSlice } from './types';
2
+ export declare type Meta = {
3
+ meta: MetaSlice;
4
+ };
5
+ export declare function useMeta(): Meta;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-C62PIKZ5.js";import"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as useMeta};
@@ -0,0 +1,4 @@
1
+ export declare function useNextPrev(): {
2
+ next: any;
3
+ prev: any;
4
+ };
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-UMYWSM5J.js";import"./chunk-HUM6DWGV.js";import"./chunk-PN7DOU52.js";import"./chunk-AA7IK7Y5.js";import"./chunk-ASPK4M5R.js";import"./chunk-BZYGOU7Y.js";import"./chunk-UGD4MMRB.js";import"./chunk-BHMVW2ZZ.js";import"./chunk-5L7EI47O.js";import"./chunk-MBLLQB7A.js";import"./chunk-ZJYDN5YH.js";import"./chunk-SD2G45FB.js";import"./chunk-VXYECVIB.js";import"./chunk-UK5NIPTI.js";import"./chunk-ZYJGHEAC.js";import"./chunk-DGGPN6YK.js";import"./chunk-OHN6TEOW.js";import"./chunk-LYZGAQ5N.js";import"./chunk-C62PIKZ5.js";import"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as useNextPrev};
@@ -0,0 +1,2 @@
1
+ import type { RouteSlice } from './types';
2
+ export declare function useRoute(): RouteSlice;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-HUM6DWGV.js";import"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as useRoute};
@@ -0,0 +1,5 @@
1
+ export declare function useSidebar(): {
2
+ sidebarData: import(".").SidebarItem[];
3
+ selectedNodeId: string | undefined;
4
+ expandedNodeIds: Set<unknown>;
5
+ };
@@ -0,0 +1 @@
1
+ import{b as a}from"./chunk-UMYWSM5J.js";import"./chunk-HUM6DWGV.js";import"./chunk-PN7DOU52.js";import"./chunk-AA7IK7Y5.js";import"./chunk-ASPK4M5R.js";import"./chunk-BZYGOU7Y.js";import"./chunk-UGD4MMRB.js";import"./chunk-BHMVW2ZZ.js";import"./chunk-5L7EI47O.js";import"./chunk-MBLLQB7A.js";import"./chunk-ZJYDN5YH.js";import"./chunk-SD2G45FB.js";import"./chunk-VXYECVIB.js";import"./chunk-UK5NIPTI.js";import"./chunk-ZYJGHEAC.js";import"./chunk-DGGPN6YK.js";import"./chunk-OHN6TEOW.js";import"./chunk-LYZGAQ5N.js";import"./chunk-C62PIKZ5.js";import"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as useSidebar};
@@ -0,0 +1,4 @@
1
+ export type { TableOfContentsItem } from './types';
2
+ export declare function useTableOfContents(): {
3
+ tableOfContents: import("./types").TableOfContentsItem[];
4
+ };
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-PN7DOU52.js";import"./chunk-TEDOG7PC.js";import"./chunk-5TAZCOCH.js";export{a as useTableOfContents};
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@jpmorganchase/mosaic-store",
3
+ "description": "Mosaic - Store for site configuration",
4
+ "version": "0.1.0-beta.8",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "style": "./dist/index.css",
8
+ "scripts": {
9
+ "build": "npm-run-all --parallel build:*",
10
+ "build:bundle": "node ../../scripts/bundle.js",
11
+ "build:types": "tsc",
12
+ "clean": "del-cli 'dist/**' && find . -type d -empty -delete",
13
+ "dev": "node ../../scripts/bundle.js watch"
14
+ },
15
+ "devDependencies": {
16
+ "del-cli": "^4.0.1",
17
+ "typescript": "^4.8.3"
18
+ },
19
+ "dependencies": {
20
+ "@testing-library/react": "^12.1.5",
21
+ "@testing-library/react-hooks": "8.0.1",
22
+ "react-test-renderer": "^16.9.0",
23
+ "zustand": "^4.1.1"
24
+ },
25
+ "peerDependencies": {
26
+ "@types/react": "^16.9.34",
27
+ "react": "^16.8.0",
28
+ "react-dom": "^16.9.0"
29
+ },
30
+ "author": "",
31
+ "license": "ISC"
32
+ }