@jpmorganchase/mosaic-store 0.1.0-beta.10
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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +29 -0
- package/README.md +9 -0
- package/dist/chunk-5L7EI47O.js +0 -0
- package/dist/chunk-62CYUXGR.js +1 -0
- package/dist/chunk-ASPK4M5R.js +0 -0
- package/dist/chunk-BHMVW2ZZ.js +0 -0
- package/dist/chunk-BZYGOU7Y.js +0 -0
- package/dist/chunk-C6AHZ6P3.js +1 -0
- package/dist/chunk-GJU2RNS6.js +1 -0
- package/dist/chunk-HUOJOLKA.js +1 -0
- package/dist/chunk-IJYHRP3M.js +1 -0
- package/dist/chunk-JHTRJDHH.js +1 -0
- package/dist/chunk-MBLLQB7A.js +0 -0
- package/dist/chunk-N4CAMXVV.js +1 -0
- package/dist/chunk-QPSCMC27.js +1 -0
- package/dist/chunk-SEY6KBKT.js +1 -0
- package/dist/chunk-TESIWQVD.js +1 -0
- package/dist/chunk-UGD4MMRB.js +0 -0
- package/dist/chunk-UK5NIPTI.js +0 -0
- package/dist/chunk-VXYECVIB.js +0 -0
- package/dist/chunk-ZJYDN5YH.js +0 -0
- package/dist/chunk-ZMWHBFUG.js +1 -0
- package/dist/chunk-ZYJGHEAC.js +0 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -0
- package/dist/store.d.ts +31 -0
- package/dist/store.js +1 -0
- package/dist/types/appHeader.d.ts +70 -0
- package/dist/types/appHeader.js +1 -0
- package/dist/types/breadcrumbs.d.ts +20 -0
- package/dist/types/breadcrumbs.js +1 -0
- package/dist/types/footer.d.ts +16 -0
- package/dist/types/footer.js +1 -0
- package/dist/types/helpLinks.d.ts +13 -0
- package/dist/types/helpLinks.js +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +1 -0
- package/dist/types/layout.d.ts +7 -0
- package/dist/types/layout.js +1 -0
- package/dist/types/meta.d.ts +12 -0
- package/dist/types/meta.js +1 -0
- package/dist/types/route.d.ts +7 -0
- package/dist/types/route.js +1 -0
- package/dist/types/sharedConfig.d.ts +14 -0
- package/dist/types/sharedConfig.js +1 -0
- package/dist/types/sidebar.d.ts +22 -0
- package/dist/types/sidebar.js +1 -0
- package/dist/types/tableOfContents.d.ts +18 -0
- package/dist/types/tableOfContents.js +1 -0
- package/dist/useAppHeader.d.ts +9 -0
- package/dist/useAppHeader.js +1 -0
- package/dist/useBreadcrumbs.d.ts +5 -0
- package/dist/useBreadcrumbs.js +1 -0
- package/dist/useFooter.d.ts +4 -0
- package/dist/useFooter.js +1 -0
- package/dist/useLayout.d.ts +4 -0
- package/dist/useLayout.js +1 -0
- package/dist/useMeta.d.ts +5 -0
- package/dist/useMeta.js +1 -0
- package/dist/useNextPrev.d.ts +9 -0
- package/dist/useNextPrev.js +1 -0
- package/dist/useRoute.d.ts +2 -0
- package/dist/useRoute.js +1 -0
- package/dist/useSidebar.d.ts +5 -0
- package/dist/useSidebar.js +1 -0
- package/dist/useTableOfContents.d.ts +3 -0
- package/dist/useTableOfContents.js +1 -0
- package/package.json +32 -0
- package/src/__tests__/store.test.ts +126 -0
- package/src/__tests__/test-utils/utils.tsx +26 -0
- package/src/__tests__/useAppHeader.test.ts +182 -0
- package/src/__tests__/useBreadcrumbs.test.ts +42 -0
- package/src/__tests__/useFooter.test.ts +64 -0
- package/src/__tests__/useLayout.test.ts +24 -0
- package/src/__tests__/useMeta.test.ts +35 -0
- package/src/__tests__/useRoute.test.ts +24 -0
- package/src/__tests__/useTableOfContents.test.ts +31 -0
- package/src/index.ts +11 -0
- package/src/store.ts +105 -0
- package/src/types/appHeader.ts +76 -0
- package/src/types/breadcrumbs.ts +21 -0
- package/src/types/footer.ts +17 -0
- package/src/types/helpLinks.ts +13 -0
- package/src/types/index.ts +10 -0
- package/src/types/layout.ts +7 -0
- package/src/types/meta.ts +13 -0
- package/src/types/route.ts +7 -0
- package/src/types/sharedConfig.ts +16 -0
- package/src/types/sidebar.ts +22 -0
- package/src/types/tableOfContents.ts +19 -0
- package/src/useAppHeader.ts +64 -0
- package/src/useBreadcrumbs.ts +11 -0
- package/src/useFooter.ts +10 -0
- package/src/useLayout.ts +9 -0
- package/src/useMeta.ts +17 -0
- package/src/useNextPrev.ts +44 -0
- package/src/useRoute.ts +9 -0
- package/src/useSidebar.ts +18 -0
- package/src/useTableOfContents.ts +8 -0
- package/tsconfig.json +8 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @jpmorganchase/mosaic-store
|
|
2
|
+
|
|
3
|
+
## 0.1.0-beta.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- af2f579: Converted repo to ESM and Salt DS nomenclature
|
|
8
|
+
|
|
9
|
+
- Switch UITK nomenclature to Salt DS
|
|
10
|
+
Upgraded to first stable version of Salt DS version 1.0.0
|
|
11
|
+
- CommonJS code switched to ESM and upgraded to Node 16
|
|
12
|
+
- Removed example-nextjs-ssr package as un-required, can be replaced by documentation
|
|
13
|
+
- Sites can now generate immutable snapshots of content that loads content like a SGS (statically generated site)
|
|
14
|
+
Snapshots can be used as a serverless solution when deployed to Vercel.
|
|
15
|
+
- New Middleware package `@jpmorganchase/mosaic-site-middleware`
|
|
16
|
+
|
|
17
|
+
## 0.1.0-beta.9
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- c3fee89: initial components package
|
|
22
|
+
|
|
23
|
+
- added JSDOM testing
|
|
24
|
+
|
|
25
|
+
## 0.1.0-beta.8
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- 2dca0b1: initial release of Mosaic store package
|
package/README.md
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as o}from"./chunk-C6AHZ6P3.js";function f(){return o(e=>e.sharedConfig?.footer)}export{f as a};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useLayoutEffect as a,createContext as s,useContext as S}from"react";import{createStore as f,useStore as u}from"zustand";import{devtools as d}from"zustand/middleware";var t;function c(){return{breadcrumbs:[],sidebarData:[],tableOfContents:[],sharedConfig:{},description:void 0,layout:void 0,route:void 0,title:void 0}}var n=s(void 0),b=n.Provider,i=(e={})=>f(d(()=>({...c(),...e})));function g(e,r=!1){if(typeof window>"u"||r)return()=>i(e);let o=Boolean(t);return t=t??i(e),a(()=>{e&&o&&t.setState({...t.getState(),...e},!0)}),()=>t}function C(e,r){let o=S(n);if(!o)throw new Error("Missing StoreProvider in the tree");return u(o,e,r)}export{b as a,i as b,g as c,C as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as t}from"./chunk-C6AHZ6P3.js";function o(){return{meta:t(e=>({description:e.description,breadcrumbs:e.breadcrumbs,title:e.title}))}}export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as i}from"./chunk-C6AHZ6P3.js";function u(e){return e.links!==void 0}function d(e){return e.link!==void 0}var o=e=>e?process.env[`SEARCH_ENDPOINT_${e}`]||"":process.env.SEARCH_ENDPOINT;function c(){let e=i(n=>n.sharedConfig?.header);if(!e)return;let t={};e.searchNamespace&&(t={HeaderControlsProps:{searchEndpoint:o(e.searchNamespace)}});let s=e.menu.reduce((n,r)=>{if(u(r)){let p={...r,type:"menu"};return[...n,p]}if(d(r)){let p={...r,type:"link"};return[...n,p]}return console.error("Unknown menu type passed to useAppHeader, ignoring",r),n},[]);return{...t,...e,menu:s}}export{c as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as t}from"./chunk-C6AHZ6P3.js";function e(){return{layout:t(o=>o.layout)}}export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e}from"./chunk-C6AHZ6P3.js";function u(){return{route:e(t=>t.route)}}export{u as a};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e}from"./chunk-C6AHZ6P3.js";function m(t=1){let r=e(b=>b.breadcrumbs);return{breadcrumbs:r||[],enabled:r?.length>t}}export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as t}from"./chunk-C6AHZ6P3.js";function s(){return{tableOfContents:t(e=>e.tableOfContents)||[]}}export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-N4CAMXVV.js";import{a as s}from"./chunk-JHTRJDHH.js";import{d as t}from"./chunk-C6AHZ6P3.js";function b(){let r=t(u=>u.sidebarData)||[],{route:e}=s(),{breadcrumbs:d}=o();return{sidebarData:r,selectedNodeId:e,expandedNodeIds:a(d)}}function a(r){return new Set(r.map(({id:e})=>e.substr(0,e.lastIndexOf("."))))}export{b as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-JHTRJDHH.js";import{d as o}from"./chunk-C6AHZ6P3.js";function N(){let t=o(s=>s.sidebarData)||[],{route:e}=i(),{next:r,prev:n}=d(t,e||"");return{next:r,prev:n}}var a=t=>{let e=[];return t.forEach(r=>{e.push({link:r.data.link,text:r.name}),r.childNodes&&(e=e.concat(a(r.childNodes)))}),e},u=(t,e)=>t>=0&&t<e-1,l=(t,e)=>t>0&&t<e,x=(t,e)=>{let r=t.map(m=>m.link).indexOf(e),{length:n}=t,s=u(r,n)?t[r+1]:null,c=l(r,n)?t[r-1]:null;return{next:s,prev:c}},d=(t,e)=>{let r=a(t);return x(r,e)};export{N as a};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=(e=>(e.MENU="menu",e.LINK="link",e))(t||{});export{t as a};
|
|
File without changes
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
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';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d}from"./chunk-SEY6KBKT.js";import{a as g}from"./chunk-QPSCMC27.js";import{a as p}from"./chunk-HUOJOLKA.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 m}from"./chunk-ZMWHBFUG.js";import"./chunk-VXYECVIB.js";import"./chunk-UK5NIPTI.js";import"./chunk-ZYJGHEAC.js";import{a as t}from"./chunk-N4CAMXVV.js";import{a as h}from"./chunk-62CYUXGR.js";import{a as x}from"./chunk-IJYHRP3M.js";import{a}from"./chunk-GJU2RNS6.js";import{a as c}from"./chunk-TESIWQVD.js";import{a as b}from"./chunk-JHTRJDHH.js";import{a as o,b as r,c as e,d as f}from"./chunk-C6AHZ6P3.js";export{m as MenuItemType,o as StoreProvider,r as initializeStore,p as useAppHeader,t as useBreadcrumbs,e as useCreateStore,h as useFooter,x as useLayout,a as useMeta,c as useNextPrev,b as useRoute,d as useSidebar,f as useStore,g as useTableOfContents};
|
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
import type { BreadcrumbsSlice } from './types/breadcrumbs';
|
|
4
|
+
import type { SharedConfigSlice } from './types/sharedConfig';
|
|
5
|
+
import type { LayoutSlice } from './types/layout';
|
|
6
|
+
import type { SidebarSlice } from './types/sidebar';
|
|
7
|
+
import type { TableOfContentsSlice } from './types/tableOfContents';
|
|
8
|
+
export declare type SiteState = BreadcrumbsSlice & LayoutSlice & SidebarSlice & TableOfContentsSlice & SharedConfigSlice & {
|
|
9
|
+
/** Page metadata description, used by search */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Page route */
|
|
12
|
+
route?: string;
|
|
13
|
+
/** Page title */
|
|
14
|
+
title?: string;
|
|
15
|
+
};
|
|
16
|
+
declare const StoreProvider: import("react").Provider<StoreApi<SiteState> | undefined>;
|
|
17
|
+
declare const initializeStore: (preloadedState?: Partial<SiteState>) => Omit<StoreApi<SiteState>, "setState"> & {
|
|
18
|
+
setState<A extends string | {
|
|
19
|
+
type: unknown;
|
|
20
|
+
}>(partial: SiteState | Partial<SiteState> | ((state: SiteState) => SiteState | Partial<SiteState>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
21
|
+
};
|
|
22
|
+
declare function useCreateStore(serverInitialState: Partial<SiteState>, isSSR?: boolean): () => Omit<StoreApi<SiteState>, "setState"> & {
|
|
23
|
+
setState<A extends string | {
|
|
24
|
+
type: unknown;
|
|
25
|
+
}>(partial: SiteState | Partial<SiteState> | ((state: SiteState) => SiteState | Partial<SiteState>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Hook providing access to state stored in the site store
|
|
29
|
+
*/
|
|
30
|
+
declare function useStore<T>(selector: (state: SiteState) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
31
|
+
export { useCreateStore, StoreProvider, useStore, initializeStore };
|
package/dist/store.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-C6AHZ6P3.js";export{a as StoreProvider,b as initializeStore,c as useCreateStore,d as useStore};
|
|
@@ -0,0 +1,70 @@
|
|
|
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 MenuLinksItem */
|
|
19
|
+
title: string;
|
|
20
|
+
/** Type of MenuLinksItem */
|
|
21
|
+
type: MenuItemType.MENU;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* [[`MenuLinksItem`]] defines a menu of links and includes a type
|
|
25
|
+
*/
|
|
26
|
+
export interface AppHeaderMenuLinksItem {
|
|
27
|
+
/** Collection of link options */
|
|
28
|
+
links: MenuLinkItem[];
|
|
29
|
+
/** Title of Tab */
|
|
30
|
+
title: string;
|
|
31
|
+
/** Type of Tab */
|
|
32
|
+
type: MenuItemType.MENU;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* [[`MenuLinkItem`]] define a menu link
|
|
36
|
+
*/
|
|
37
|
+
export interface MenuLinkItem {
|
|
38
|
+
/** URL linked by Tab */
|
|
39
|
+
link: string;
|
|
40
|
+
/** Title of Tab */
|
|
41
|
+
title?: string;
|
|
42
|
+
/** Type of MenuLinkItem */
|
|
43
|
+
type: MenuItemType.LINK;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* [[`MenuLinkItem`]] define a menu link and include a type
|
|
47
|
+
*/
|
|
48
|
+
export interface AppHeaderMenuLinkItem {
|
|
49
|
+
/** URL linked by Tab */
|
|
50
|
+
link: string;
|
|
51
|
+
/** Title of Tab */
|
|
52
|
+
title?: string;
|
|
53
|
+
/** Type of Tab */
|
|
54
|
+
type: MenuItemType.LINK;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* [[`AppHeaderSlice`]] specifies the contents of the AppHeader
|
|
58
|
+
*/
|
|
59
|
+
export declare type AppHeaderSlice = {
|
|
60
|
+
/** App logo/title */
|
|
61
|
+
title: string;
|
|
62
|
+
/** Link to the home page */
|
|
63
|
+
homeLink: string;
|
|
64
|
+
/** Logo URL */
|
|
65
|
+
logo?: string;
|
|
66
|
+
/** App Header menu */
|
|
67
|
+
menu: Menu[];
|
|
68
|
+
/** Search namespace, suffix used on env variable `process.env.SEARCH_ENDPOINT` to filter search results to a specific namespace. */
|
|
69
|
+
searchNamespace?: string;
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-ZMWHBFUG.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";
|
|
@@ -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";
|
|
@@ -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";
|
|
@@ -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-ZMWHBFUG.js";import"../chunk-VXYECVIB.js";import"../chunk-UK5NIPTI.js";import"../chunk-ZYJGHEAC.js";export{a as MenuItemType};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunk-BZYGOU7Y.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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunk-BHMVW2ZZ.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";
|
|
@@ -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";
|
|
@@ -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";
|
|
@@ -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-HUOJOLKA.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-ZMWHBFUG.js";import"./chunk-VXYECVIB.js";import"./chunk-UK5NIPTI.js";import"./chunk-ZYJGHEAC.js";import"./chunk-C6AHZ6P3.js";export{a as useAppHeader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-N4CAMXVV.js";import"./chunk-C6AHZ6P3.js";export{a as useBreadcrumbs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-62CYUXGR.js";import"./chunk-C6AHZ6P3.js";export{a as useFooter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-IJYHRP3M.js";import"./chunk-C6AHZ6P3.js";export{a as useLayout};
|
package/dist/useMeta.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-GJU2RNS6.js";import"./chunk-C6AHZ6P3.js";export{a as useMeta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-TESIWQVD.js";import"./chunk-JHTRJDHH.js";import"./chunk-C6AHZ6P3.js";export{a as useNextPrev};
|
package/dist/useRoute.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-JHTRJDHH.js";import"./chunk-C6AHZ6P3.js";export{a as useRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-SEY6KBKT.js";import"./chunk-N4CAMXVV.js";import"./chunk-JHTRJDHH.js";import"./chunk-C6AHZ6P3.js";export{a as useSidebar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-QPSCMC27.js";import"./chunk-C6AHZ6P3.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.10",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"style": "./dist/index.css",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "npm-run-all --parallel build:*",
|
|
12
|
+
"build:bundle": "node ../../scripts/bundle.js",
|
|
13
|
+
"build:types": "tsc",
|
|
14
|
+
"clean": "npx del-cli 'dist/**' && find . -type d -empty -delete",
|
|
15
|
+
"lint": "eslint --ignore-pattern \"**/__tests__/**\"",
|
|
16
|
+
"dev": "node ../../scripts/bundle.js watch"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"del-cli": "^4.0.1",
|
|
20
|
+
"typescript": "^4.8.3"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@testing-library/react": "^12.1.5",
|
|
24
|
+
"@testing-library/react-hooks": "8.0.1",
|
|
25
|
+
"zustand": "^4.1.1"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@types/react": "^16.9.34",
|
|
29
|
+
"react": "^16.8.0",
|
|
30
|
+
"react-dom": "^16.9.0"
|
|
31
|
+
}
|
|
32
|
+
}
|