@jpmorganchase/mosaic-store 0.1.0-beta.25 → 0.1.0-beta.26
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 +2 -2
- package/CHANGELOG.md +33 -0
- package/dist/{chunk-VKGBN5I5.js → chunk-5TVTLI2X.js} +1 -1
- package/dist/{chunk-UWHTRXA5.js → chunk-6PEKMIY4.js} +1 -1
- package/dist/chunk-AEFS63H5.js +1 -0
- package/dist/chunk-BWQLFNPL.js +1 -0
- package/dist/chunk-DVDAL7JW.js +1 -0
- package/dist/{chunk-O3KBYHXA.js → chunk-OTD2Q7J6.js} +1 -1
- package/dist/chunk-OYLDWTGY.js +1 -0
- package/dist/chunk-QVHG25G2.js +1 -0
- package/dist/chunk-RHLTSSFF.js +1 -0
- package/dist/{chunk-R6L4QR2K.js → chunk-SSINFAKX.js} +1 -1
- package/dist/chunk-TCTIPP3K.js +1 -0
- package/dist/{chunk-V54ZUOLT.js → chunk-THKJVARP.js} +1 -1
- package/dist/chunk-V2SJ6GGH.js +1 -0
- package/dist/index.js +1 -1
- package/dist/store.js +1 -1
- package/dist/types/searchIndex.d.ts +12 -0
- package/dist/useAppHeader.js +1 -1
- package/dist/useBreadcrumbs.js +1 -1
- package/dist/useColorMode.js +1 -1
- package/dist/useFooter.js +1 -1
- package/dist/useLayout.js +1 -1
- package/dist/useMeta.js +1 -1
- package/dist/useNavigation.js +1 -1
- package/dist/useRoute.js +1 -1
- package/dist/useSearchIndex.d.ts +1 -0
- package/dist/useSearchIndex.js +1 -1
- package/dist/useSidebar.js +1 -1
- package/dist/useStoreActions.js +1 -1
- package/dist/useTableOfContents.js +1 -1
- package/package.json +1 -1
- package/src/__tests__/store.test.ts +6 -0
- package/src/__tests__/useSearchIndex.test.ts +29 -2
- package/src/store.ts +1 -0
- package/src/types/searchIndex.ts +10 -0
- package/src/useSearchIndex.ts +5 -2
- package/dist/chunk-6QFYSQKC.js +0 -1
- package/dist/chunk-B2ENOVOY.js +0 -1
- package/dist/chunk-LHWBY2OA.js +0 -1
- package/dist/chunk-PK5C6TQI.js +0 -1
- package/dist/chunk-PZRAIZUK.js +0 -1
- package/dist/chunk-RGA5W3OD.js +0 -1
- package/dist/chunk-U6MP7RD5.js +0 -1
- package/dist/chunk-ZEATWUZ3.js +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@jpmorganchase/mosaic-store:build: cache hit, replaying output
|
|
1
|
+
@jpmorganchase/mosaic-store:build: cache hit, replaying output a6f28688d270091d
|
|
2
2
|
@jpmorganchase/mosaic-store:build: $ npm-run-all --parallel build:*
|
|
3
|
-
@jpmorganchase/mosaic-store:build: $ node ../../scripts/bundle.js
|
|
4
3
|
@jpmorganchase/mosaic-store:build: $ tsc
|
|
4
|
+
@jpmorganchase/mosaic-store:build: $ node ../../scripts/bundle.js
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @jpmorganchase/mosaic-store
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.26
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 531c87a: ## Mosaic Theme
|
|
8
|
+
|
|
9
|
+
The theme variables are now globally scoped and prefixed with `mosaic`.
|
|
10
|
+
|
|
11
|
+
## BrokenLinksPlugin
|
|
12
|
+
|
|
13
|
+
The `BrokenLinksPlugin` uses a running instance of mosaic to verify that all links in the source pages are alive.
|
|
14
|
+
|
|
15
|
+
If mosaic is running behind a corporate proxy, the `proxyEndpoint` option is required to fetch external URLs.
|
|
16
|
+
|
|
17
|
+
Configuration:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
modulePath: '@jpmorganchase/mosaic-plugins/BrokenLinksPlugin',
|
|
22
|
+
priority: -1,
|
|
23
|
+
// Exclude this plugin in builds
|
|
24
|
+
runTimeOnly: true,
|
|
25
|
+
options: {
|
|
26
|
+
baseUrl: process.env.MOSAIC_ACTIVE_MODE_URL || 'http://localhost:8080',
|
|
27
|
+
proxyEndpoint: 'http://some-proxy-url'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Next/Prev button
|
|
33
|
+
|
|
34
|
+
The next and prev buttons are visible again on pages that have a layout that uses these buttons.
|
|
35
|
+
|
|
3
36
|
## 0.1.0-beta.25
|
|
4
37
|
|
|
5
38
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as t}from"./chunk-
|
|
1
|
+
import{d as t}from"./chunk-QVHG25G2.js";function o(){return{meta:t(e=>({description:e.description,breadcrumbs:e.breadcrumbs,title:e.title}))}}export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e}from"./chunk-
|
|
1
|
+
import{d as e}from"./chunk-QVHG25G2.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-QVHG25G2.js";function e(){return{layout:t(o=>o.layout)}}export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as c}from"./chunk-QVHG25G2.js";function t(){let e=c(r=>r.searchIndex),o=c(r=>r.searchConfig),n=o!==void 0&&e!==void 0&&e.length>0;return{searchEnabled:n,searchIndex:n?e:[],searchConfig:n?o:{}}}export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as o}from"./chunk-QVHG25G2.js";function f(){return o(e=>e.sharedConfig?.footer)}export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as t}from"./chunk-
|
|
1
|
+
import{d as t}from"./chunk-QVHG25G2.js";function u(e){return e.links!==void 0}function d(e){return e.link!==void 0}function M(){let e=t(n=>n.sharedConfig?.header);if(!e)return;let i=e.menu.reduce((n,p)=>{if(u(p)){let r={...p,type:"menu"};return[...n,r]}if(d(p)){let r={...p,type:"link"};return[...n,r]}return console.error("Unknown menu type passed to useAppHeader, ignoring",p),n},[]);return{...e,menu:i}}export{M as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as o}from"./chunk-QVHG25G2.js";var r=()=>o(t=>t.actions);export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useLayoutEffect as s,createContext as S,useContext as d}from"react";import{createStore as c,useStore as l}from"zustand";import{devtools as f,persist as p}from"zustand/middleware";var r;function u(){return{breadcrumbs:[],sidebarData:[],tableOfContents:[],navigation:{},searchIndex:[],searchConfig:{},sharedConfig:{},description:void 0,layout:void 0,route:void 0,title:void 0,colorMode:"light"}}var n=S(void 0),M=n.Provider,m=e=>f(p(e,{name:"mosaic-theme-pref",partialize:t=>({colorMode:t.colorMode})})),i=(e={})=>c(m(o=>({...u(),...e,actions:{setColorMode:a=>o({colorMode:a})}})));function h(e,t=!1){if(typeof window>"u"||t)return()=>i(e);let o=Boolean(r);return r=r??i(e),s(()=>{e&&o&&r.setState({...r.getState(),...e},!0)}),()=>r}function x(e,t){let o=d(n);if(!o)throw new Error("Missing StoreProvider in the tree");return l(o,e,t)}export{M as a,i as b,h as c,x as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as o}from"./chunk-QVHG25G2.js";function d(){return o(r=>r.colorMode)}export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-TCTIPP3K.js";import{a as o}from"./chunk-6PEKMIY4.js";import{d as t}from"./chunk-QVHG25G2.js";function p(){let r=t(d=>d.sidebarData)||[],{route:e}=s(),{breadcrumbs:u}=o();return{menu:r,selectedNodeId:e,expandedNodeIds:m(u)}}function m(r){return new Set(r.map(({id:e})=>e.substr(0,e.lastIndexOf("."))))}export{p as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e}from"./chunk-QVHG25G2.js";function u(){return{route:e(t=>t.route)}}export{u as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as t}from"./chunk-
|
|
1
|
+
import{d as t}from"./chunk-QVHG25G2.js";function r(){let{next:o,prev:i}=t(n=>n.navigation)||{};return{next:o,prev:i}}export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as t}from"./chunk-QVHG25G2.js";function s(){return{tableOfContents:t(e=>e.tableOfContents)||[]}}export{s as a};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-THKJVARP.js";import{a as g}from"./chunk-BWQLFNPL.js";import{a as h}from"./chunk-SSINFAKX.js";import{a as d}from"./chunk-TCTIPP3K.js";import{a as k}from"./chunk-OYLDWTGY.js";import{a as i}from"./chunk-V2SJ6GGH.js";import{a as p}from"./chunk-OTD2Q7J6.js";import"./chunk-BHW7CEID.js";import"./chunk-IS7TJ54I.js";import"./chunk-5L7EI47O.js";import"./chunk-MBLLQB7A.js";import"./chunk-ZJYDN5YH.js";import"./chunk-UK5NIPTI.js";import"./chunk-ZYJGHEAC.js";import"./chunk-BZYGOU7Y.js";import"./chunk-UGD4MMRB.js";import"./chunk-LAADEEXW.js";import"./chunk-BHMVW2ZZ.js";import{a as m}from"./chunk-ZMWHBFUG.js";import"./chunk-VXYECVIB.js";import{a as t}from"./chunk-6PEKMIY4.js";import{a as x}from"./chunk-RHLTSSFF.js";import{a as j}from"./chunk-DVDAL7JW.js";import{a}from"./chunk-AEFS63H5.js";import{a as b}from"./chunk-5TVTLI2X.js";import{a as o,b as r,c as e,d as f}from"./chunk-QVHG25G2.js";export{m as MenuItemType,o as StoreProvider,r as initializeStore,p as useAppHeader,t as useBreadcrumbs,x as useColorMode,e as useCreateStore,j as useFooter,a as useLayout,b as useMeta,c as useNavigation,d as useRoute,g as useSearchIndex,h as useSidebar,f as useStore,k as useStoreActions,i as useTableOfContents};
|
package/dist/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-QVHG25G2.js";export{a as StoreProvider,b as initializeStore,c as useCreateStore,d as useStore};
|
|
@@ -4,7 +4,19 @@ declare type SearchDataPage = {
|
|
|
4
4
|
route: string;
|
|
5
5
|
};
|
|
6
6
|
export declare type SearchIndex = SearchDataPage[];
|
|
7
|
+
export declare type SearchConfig = {
|
|
8
|
+
includeScore?: boolean;
|
|
9
|
+
includeMatches?: boolean;
|
|
10
|
+
maxPatternLength?: number;
|
|
11
|
+
ignoreLocation?: boolean;
|
|
12
|
+
threshold?: number;
|
|
13
|
+
keys?: string[] | {
|
|
14
|
+
name: string;
|
|
15
|
+
weight: number;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
7
18
|
export declare type SearchIndexSlice = {
|
|
8
19
|
searchIndex?: SearchIndex;
|
|
20
|
+
searchConfig?: SearchConfig;
|
|
9
21
|
};
|
|
10
22
|
export {};
|
package/dist/useAppHeader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-OTD2Q7J6.js";import"./chunk-BHW7CEID.js";import"./chunk-IS7TJ54I.js";import"./chunk-5L7EI47O.js";import"./chunk-MBLLQB7A.js";import"./chunk-ZJYDN5YH.js";import"./chunk-UK5NIPTI.js";import"./chunk-ZYJGHEAC.js";import"./chunk-BZYGOU7Y.js";import"./chunk-UGD4MMRB.js";import"./chunk-LAADEEXW.js";import"./chunk-BHMVW2ZZ.js";import"./chunk-ZMWHBFUG.js";import"./chunk-VXYECVIB.js";import"./chunk-QVHG25G2.js";export{a as useAppHeader};
|
package/dist/useBreadcrumbs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-6PEKMIY4.js";import"./chunk-QVHG25G2.js";export{a as useBreadcrumbs};
|
package/dist/useColorMode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-RHLTSSFF.js";import"./chunk-QVHG25G2.js";export{a as useColorMode};
|
package/dist/useFooter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-DVDAL7JW.js";import"./chunk-QVHG25G2.js";export{a as useFooter};
|
package/dist/useLayout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-AEFS63H5.js";import"./chunk-QVHG25G2.js";export{a as useLayout};
|
package/dist/useMeta.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-5TVTLI2X.js";import"./chunk-QVHG25G2.js";export{a as useMeta};
|
package/dist/useNavigation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-THKJVARP.js";import"./chunk-QVHG25G2.js";export{a as useNavigation};
|
package/dist/useRoute.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-TCTIPP3K.js";import"./chunk-QVHG25G2.js";export{a as useRoute};
|
package/dist/useSearchIndex.d.ts
CHANGED
package/dist/useSearchIndex.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-BWQLFNPL.js";import"./chunk-QVHG25G2.js";export{a as useSearchIndex};
|
package/dist/useSidebar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-SSINFAKX.js";import"./chunk-TCTIPP3K.js";import"./chunk-6PEKMIY4.js";import"./chunk-QVHG25G2.js";export{a as useSidebar};
|
package/dist/useStoreActions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-OYLDWTGY.js";import"./chunk-QVHG25G2.js";export{a as useStoreActions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-V2SJ6GGH.js";import"./chunk-QVHG25G2.js";export{a as useTableOfContents};
|
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@ describe('GIVEN the store initializer', () => {
|
|
|
18
18
|
sidebarData: [],
|
|
19
19
|
tableOfContents: [],
|
|
20
20
|
searchIndex: [],
|
|
21
|
+
searchConfig: {},
|
|
21
22
|
sharedConfig: {},
|
|
22
23
|
description: undefined,
|
|
23
24
|
layout: undefined,
|
|
@@ -42,6 +43,7 @@ describe('GIVEN the store initializer', () => {
|
|
|
42
43
|
breadcrumbs: [],
|
|
43
44
|
navigation: {},
|
|
44
45
|
searchIndex: [],
|
|
46
|
+
searchConfig: {},
|
|
45
47
|
sidebarData: [],
|
|
46
48
|
tableOfContents: [],
|
|
47
49
|
sharedConfig: {},
|
|
@@ -64,6 +66,7 @@ describe('GIVEN the `useCreateStore` hook', () => {
|
|
|
64
66
|
breadcrumbs: [],
|
|
65
67
|
navigation: {},
|
|
66
68
|
searchIndex: [],
|
|
69
|
+
searchConfig: {},
|
|
67
70
|
sidebarData: [],
|
|
68
71
|
tableOfContents: [],
|
|
69
72
|
sharedConfig: {},
|
|
@@ -84,6 +87,7 @@ describe('GIVEN the `useCreateStore` hook', () => {
|
|
|
84
87
|
navigation: {},
|
|
85
88
|
sidebarData: [],
|
|
86
89
|
searchIndex: [],
|
|
90
|
+
searchConfig: {},
|
|
87
91
|
tableOfContents: [],
|
|
88
92
|
sharedConfig: {},
|
|
89
93
|
colorMode: 'light',
|
|
@@ -105,6 +109,7 @@ describe('GIVEN the `useCreateStore` hook', () => {
|
|
|
105
109
|
breadcrumbs: [],
|
|
106
110
|
navigation: {},
|
|
107
111
|
searchIndex: [],
|
|
112
|
+
searchConfig: {},
|
|
108
113
|
sidebarData: [],
|
|
109
114
|
tableOfContents: [],
|
|
110
115
|
sharedConfig: {},
|
|
@@ -126,6 +131,7 @@ describe('GIVEN the `useCreateStore` hook', () => {
|
|
|
126
131
|
navigation: {},
|
|
127
132
|
sidebarData: [],
|
|
128
133
|
searchIndex: [],
|
|
134
|
+
searchConfig: {},
|
|
129
135
|
tableOfContents: [],
|
|
130
136
|
sharedConfig: {},
|
|
131
137
|
colorMode: 'light',
|
|
@@ -20,11 +20,21 @@ const index: SiteState['searchIndex'] = [
|
|
|
20
20
|
}
|
|
21
21
|
];
|
|
22
22
|
|
|
23
|
+
const config: SiteState['searchConfig'] = {
|
|
24
|
+
includeScore: false,
|
|
25
|
+
includeMatches: true,
|
|
26
|
+
maxPatternLength: 240,
|
|
27
|
+
ignoreLocation: true,
|
|
28
|
+
threshold: 0.3,
|
|
29
|
+
keys: ['title', 'content']
|
|
30
|
+
};
|
|
31
|
+
|
|
23
32
|
const state: Partial<SiteState> = {
|
|
24
|
-
searchIndex: index
|
|
33
|
+
searchIndex: index,
|
|
34
|
+
searchConfig: config
|
|
25
35
|
};
|
|
26
36
|
|
|
27
|
-
describe('GIVEN the
|
|
37
|
+
describe('GIVEN the useSearchIndex hook', () => {
|
|
28
38
|
describe('WHEN there is no search index in the store', () => {
|
|
29
39
|
test('THEN searchEnabled is set to false', () => {
|
|
30
40
|
const { result } = renderHook(() => useSearchIndex(), {
|
|
@@ -39,6 +49,13 @@ describe('GIVEN the `useSearchIndex` hook', () => {
|
|
|
39
49
|
expect(Array.isArray(result.current.searchIndex)).toBe(true);
|
|
40
50
|
expect(result.current.searchIndex.length).toBe(0);
|
|
41
51
|
});
|
|
52
|
+
test('AND searchConfig is set to an empty object', () => {
|
|
53
|
+
const { result } = renderHook(() => useSearchIndex(), {
|
|
54
|
+
wrapper: createWrapper()
|
|
55
|
+
});
|
|
56
|
+
expect(typeof result.current.searchConfig).toBe('object');
|
|
57
|
+
expect(Object.keys(result.current.searchConfig).length).toBe(0);
|
|
58
|
+
});
|
|
42
59
|
});
|
|
43
60
|
|
|
44
61
|
describe('WHEN there is a search index in the store', () => {
|
|
@@ -55,5 +72,15 @@ describe('GIVEN the `useSearchIndex` hook', () => {
|
|
|
55
72
|
expect(Array.isArray(result.current.searchIndex)).toBe(true);
|
|
56
73
|
expect(result.current.searchIndex.length).toBe(index.length);
|
|
57
74
|
});
|
|
75
|
+
test('AND searchIndex contains the search config', () => {
|
|
76
|
+
const { result } = renderHook(() => useSearchIndex(), {
|
|
77
|
+
wrapper: createWrapper({ ...state })
|
|
78
|
+
});
|
|
79
|
+
expect(typeof result.current.searchConfig).toBe('object');
|
|
80
|
+
expect(Object.keys(result.current.searchConfig).length).toBe(Object.keys(config).length);
|
|
81
|
+
expect(result.current.searchConfig.ignoreLocation).toBe(true);
|
|
82
|
+
expect(result.current.searchConfig.maxPatternLength).toBe(240);
|
|
83
|
+
expect(result.current.searchConfig.keys).toEqual(['title', 'content']);
|
|
84
|
+
});
|
|
58
85
|
});
|
|
59
86
|
});
|
package/src/store.ts
CHANGED
package/src/types/searchIndex.ts
CHANGED
|
@@ -6,6 +6,16 @@ type SearchDataPage = {
|
|
|
6
6
|
|
|
7
7
|
export type SearchIndex = SearchDataPage[];
|
|
8
8
|
|
|
9
|
+
export type SearchConfig = {
|
|
10
|
+
includeScore?: boolean;
|
|
11
|
+
includeMatches?: boolean;
|
|
12
|
+
maxPatternLength?: number;
|
|
13
|
+
ignoreLocation?: boolean;
|
|
14
|
+
threshold?: number;
|
|
15
|
+
keys?: string[] | { name: string; weight: number }[];
|
|
16
|
+
};
|
|
17
|
+
|
|
9
18
|
export type SearchIndexSlice = {
|
|
10
19
|
searchIndex?: SearchIndex;
|
|
20
|
+
searchConfig?: SearchConfig;
|
|
11
21
|
};
|
package/src/useSearchIndex.ts
CHANGED
|
@@ -4,11 +4,14 @@ export type { SearchIndexSlice } from './types';
|
|
|
4
4
|
|
|
5
5
|
export function useSearchIndex() {
|
|
6
6
|
const searchIndex = useStore(state => state.searchIndex);
|
|
7
|
+
const searchConfig = useStore(state => state.searchConfig);
|
|
7
8
|
|
|
8
|
-
const searchEnabled =
|
|
9
|
+
const searchEnabled =
|
|
10
|
+
searchConfig !== undefined && searchIndex !== undefined && searchIndex.length > 0;
|
|
9
11
|
|
|
10
12
|
return {
|
|
11
13
|
searchEnabled,
|
|
12
|
-
searchIndex: searchEnabled ? searchIndex : []
|
|
14
|
+
searchIndex: searchEnabled ? searchIndex : [],
|
|
15
|
+
searchConfig: searchEnabled ? searchConfig : {}
|
|
13
16
|
};
|
|
14
17
|
}
|
package/dist/chunk-6QFYSQKC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as r}from"./chunk-ZEATWUZ3.js";function o(){let e=r(t=>t.searchIndex),n=e!==void 0&&e.length>0;return{searchEnabled:n,searchIndex:n?e:[]}}export{o as a};
|
package/dist/chunk-B2ENOVOY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as o}from"./chunk-ZEATWUZ3.js";function d(){return o(r=>r.colorMode)}export{d as a};
|
package/dist/chunk-LHWBY2OA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as t}from"./chunk-ZEATWUZ3.js";function e(){return{layout:t(o=>o.layout)}}export{e as a};
|
package/dist/chunk-PK5C6TQI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as t}from"./chunk-ZEATWUZ3.js";function s(){return{tableOfContents:t(e=>e.tableOfContents)||[]}}export{s as a};
|
package/dist/chunk-PZRAIZUK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e}from"./chunk-ZEATWUZ3.js";function u(){return{route:e(t=>t.route)}}export{u as a};
|
package/dist/chunk-RGA5W3OD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as o}from"./chunk-ZEATWUZ3.js";function f(){return o(e=>e.sharedConfig?.footer)}export{f as a};
|
package/dist/chunk-U6MP7RD5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as o}from"./chunk-ZEATWUZ3.js";var r=()=>o(t=>t.actions);export{r as a};
|
package/dist/chunk-ZEATWUZ3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useLayoutEffect as s,createContext as S,useContext as d}from"react";import{createStore as c,useStore as l}from"zustand";import{devtools as f,persist as p}from"zustand/middleware";var r;function u(){return{breadcrumbs:[],sidebarData:[],tableOfContents:[],navigation:{},searchIndex:[],sharedConfig:{},description:void 0,layout:void 0,route:void 0,title:void 0,colorMode:"light"}}var n=S(void 0),M=n.Provider,m=e=>f(p(e,{name:"mosaic-theme-pref",partialize:t=>({colorMode:t.colorMode})})),i=(e={})=>c(m(o=>({...u(),...e,actions:{setColorMode:a=>o({colorMode:a})}})));function h(e,t=!1){if(typeof window>"u"||t)return()=>i(e);let o=Boolean(r);return r=r??i(e),s(()=>{e&&o&&r.setState({...r.getState(),...e},!0)}),()=>r}function x(e,t){let o=d(n);if(!o)throw new Error("Missing StoreProvider in the tree");return l(o,e,t)}export{M as a,i as b,h as c,x as d};
|