@xyd-js/framework 0.1.0-xyd.21 → 0.1.0-xyd.4

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.
@@ -0,0 +1,78 @@
1
+ import React, {createContext, useContext} from "react";
2
+
3
+ import {Settings} from "@xyd-js/core";
4
+ import type {ITOC, IBreadcrumb, INavLinks} from "@xyd-js/ui";
5
+
6
+ import {FwSidebarGroupProps} from "../components/sidebar";
7
+
8
+ export interface IFramework {
9
+ settings: Settings
10
+
11
+ sidebarGroups: FwSidebarGroupProps[]
12
+
13
+ toc?: ITOC[]
14
+
15
+ breadcrumbs?: IBreadcrumb[]
16
+
17
+ navlinks?: INavLinks
18
+ }
19
+
20
+ // TODO: page context + app context?
21
+ const framework: IFramework = {
22
+ settings: {},
23
+ sidebarGroups: []
24
+ }
25
+ const FrameworkContext = createContext<IFramework>(framework)
26
+
27
+ export interface FrameworkProps {
28
+ children: React.ReactNode
29
+
30
+ settings: Settings,
31
+ sidebarGroups: FwSidebarGroupProps[],
32
+ toc?: ITOC[],
33
+ breadcrumbs?: IBreadcrumb[],
34
+ navlinks?: INavLinks
35
+ }
36
+
37
+ export function Framework(props: FrameworkProps) {
38
+ return <FrameworkContext.Provider value={{
39
+ settings: props.settings,
40
+ sidebarGroups: props.sidebarGroups,
41
+ toc: props.toc,
42
+ breadcrumbs: props.breadcrumbs,
43
+ navlinks: props.navlinks,
44
+ }}>
45
+ {props.children}
46
+ </FrameworkContext.Provider>
47
+ }
48
+
49
+
50
+ export function useSidebarGroups() {
51
+ const ctx = useContext(FrameworkContext)
52
+
53
+ return ctx.sidebarGroups
54
+ }
55
+
56
+ export function useSettings() {
57
+ const ctx = useContext(FrameworkContext)
58
+
59
+ return ctx.settings
60
+ }
61
+
62
+ export function useToC() {
63
+ const ctx = useContext(FrameworkContext)
64
+
65
+ return ctx.toc
66
+ }
67
+
68
+ export function useBreadcrumbs() {
69
+ const ctx = useContext(FrameworkContext)
70
+
71
+ return ctx.breadcrumbs
72
+ }
73
+
74
+ export function useNavLinks() {
75
+ const ctx = useContext(FrameworkContext)
76
+
77
+ return ctx.navlinks
78
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./framework"
2
+
@@ -0,0 +1,6 @@
1
+ import {createContext} from 'react';
2
+
3
+ export const UIContext = createContext({
4
+ href: '',
5
+ setHref: (v: any) => {}
6
+ });
@@ -0,0 +1,3 @@
1
+ export {
2
+ useMatchedSubNav
3
+ } from "./useMatchedNav";
@@ -0,0 +1,29 @@
1
+ import {useLocation} from "react-router";
2
+
3
+ import {useSettings} from "../contexts";
4
+
5
+ import {manualHydration} from "../utils/manualHydration";
6
+
7
+ function normalizeHref(href: string) {
8
+ if (href.startsWith("/")) {
9
+ return href
10
+ }
11
+
12
+ return `/${href}`
13
+ }
14
+
15
+ // TODO: better data structures
16
+ export function useMatchedSubNav() {
17
+ const settings = useSettings()
18
+ const location = useLocation()
19
+
20
+ const matchedSubnav = settings.structure?.header
21
+ ?.filter(item => item.sub)
22
+ ?.find(item => normalizeHref(location.pathname).startsWith(normalizeHref(item.sub?.match || "")))
23
+
24
+ if (!matchedSubnav) {
25
+ return null
26
+ }
27
+
28
+ return matchedSubnav.sub || null
29
+ }
@@ -0,0 +1,12 @@
1
+ export * from "./components"
2
+
3
+ export {Framework} from "./contexts"
4
+ export type {FrameworkProps} from "./contexts"
5
+
6
+ export {
7
+ useMatchedSubNav
8
+ } from "./hooks"
9
+
10
+ export type {
11
+ FwSidebarGroupProps
12
+ } from "./components/sidebar/sidebar"
@@ -0,0 +1,25 @@
1
+ import React, {ReactElement} from "react";
2
+
3
+ export function manualHydration(obj: any, key = 0): ReactElement<any, string | React.JSXElementConstructor<any>> {
4
+ if (typeof obj !== 'object' || obj === null) {
5
+ return React.createElement(React.Fragment, {key});
6
+ }
7
+
8
+ const {type, props} = obj || {};
9
+ if (typeof type !== 'string' && typeof type !== 'function') {
10
+ return React.createElement(React.Fragment, {key});
11
+ }
12
+
13
+ let children: ReactElement<any, string | React.JSXElementConstructor<any>>[] = [];
14
+ if (props?.children) {
15
+ if (Array.isArray(props.children)) {
16
+ children = props.children.map((child: any, i) => manualHydration(child, key + i)) || [];
17
+ } else {
18
+ children = [manualHydration(props.children, key)];
19
+ }
20
+ }
21
+
22
+ const elementProps = {...props, children, key};
23
+
24
+ return React.createElement(type, elementProps);
25
+ }
@@ -0,0 +1,19 @@
1
+ import {createContext, useContext} from "react";
2
+
3
+ import type {ITheme} from "@xyd-js/framework";
4
+
5
+ const theme = createContext<ITheme<any> | null>(null)
6
+
7
+ const Provider = theme.Provider
8
+
9
+ // TODO: finish theme context
10
+
11
+ export function withTheme(Component) {
12
+ return <Provider value={null}>
13
+ <Component/>
14
+ </Provider>
15
+ }
16
+
17
+ export function useTheme<T>(): ITheme<any> | null {
18
+ return useContext(theme)
19
+ }
File without changes
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ plugins: {
3
+ autoprefixer: {},
4
+ },
5
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export type * from "./types";
package/src/types.ts ADDED
@@ -0,0 +1,5 @@
1
+ export interface ITheme<T> {
2
+ children: JSX.Element | JSX.Element[]
3
+
4
+ themeSettings?: T
5
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "esnext",
4
+ "esModuleInterop": true,
5
+ "moduleResolution": "bundler",
6
+ "target": "ES6",
7
+ "compilerOptions": {
8
+ "baseUrl": ".",
9
+ "paths": {
10
+ "@/components/*": ["@/components/*"],
11
+ "@/lib/utils/*": ["@/lib/utils/*"],
12
+ "@/components/ui/*": ["@/components/ui/*"],
13
+ "@/components/magicui/*": ["@/components/magicui/*"]
14
+ }
15
+ },
16
+ "lib": [
17
+ "dom",
18
+ "dom.iterable",
19
+ "esnext"
20
+ ],
21
+ "allowJs": true,
22
+ "skipLibCheck": true,
23
+ "strict": false,
24
+ "noEmit": true,
25
+ "incremental": false,
26
+ "resolveJsonModule": true,
27
+ "isolatedModules": true,
28
+ "jsx": "preserve",
29
+ "plugins": [
30
+ {
31
+ "name": "next"
32
+ }
33
+ ],
34
+ "strictNullChecks": true
35
+ },
36
+ "include": [
37
+ "next-env.d.ts",
38
+ "**/*.ts",
39
+ "**/*.tsx",
40
+ ".next/types/**/*.ts"
41
+ ],
42
+ "exclude": [
43
+ "node_modules"
44
+ ]
45
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,28 @@
1
+ import {defineConfig} from 'tsup';
2
+
3
+ export default defineConfig({
4
+ entry: {
5
+ index: 'src/index.ts',
6
+ react: 'packages/react/index.ts',
7
+ hydration: 'packages/hydration/index.ts',
8
+ },
9
+ format: ['esm', 'cjs'], // Output both ESM and CJS formats
10
+ target: 'node16', // Ensure compatibility with Node.js 16
11
+ dts: {
12
+ entry: {
13
+ index: 'src/index.ts',
14
+ react: 'packages/react/index.ts',
15
+ hydration: 'packages/hydration/index.ts',
16
+ },
17
+ resolve: true, // Resolve external types
18
+ },
19
+ splitting: false, // Disable code splitting
20
+ sourcemap: true, // Generate source maps
21
+ clean: true, // Clean the output directory before each build
22
+ esbuildOptions: (options) => {
23
+ options.platform = 'node'; // Ensure the platform is set to Node.js
24
+ options.external = ['node:fs/promises', 'react-router']; // Mark 'node:fs/promises' as external
25
+ options.loader = {'.js': 'jsx'}; // Ensure proper handling of .js files
26
+ },
27
+ ignoreWatch: ['node_modules', 'dist', '.git', 'build'] // Exclude unnecessary directories
28
+ });
@@ -1,11 +0,0 @@
1
- import { Settings } from '@xyd-js/core';
2
- import { IBreadcrumb, INavLinks } from '@xyd-js/ui';
3
- import { F as FwSidebarGroupProps } from './sidebar-Dwf54qYp.js';
4
-
5
- declare function mapSettingsToProps(settings: Settings, slug: string): Promise<{
6
- groups: FwSidebarGroupProps[];
7
- breadcrumbs: IBreadcrumb[];
8
- navlinks?: INavLinks;
9
- }>;
10
-
11
- export { mapSettingsToProps };
package/dist/hydration.js DELETED
@@ -1,213 +0,0 @@
1
- // packages/hydration/settings-to-props.ts
2
- import { filterNavigationByLevels, pageFrontMatters } from "@xyd-js/content";
3
- function filterNavigation(settings, slug) {
4
- var _a;
5
- const sidebarItems = [];
6
- let multiSidebarMatch = null;
7
- (_a = settings == null ? void 0 : settings.structure) == null ? void 0 : _a.sidebar.filter((sidebar) => {
8
- var _a2;
9
- if ("match" in sidebar) {
10
- const sideMatch = normalizeHref(sidebar.match);
11
- const normalizeSlug = normalizeHref(slug);
12
- if (normalizeSlug.startsWith(sideMatch)) {
13
- if (multiSidebarMatch) {
14
- const findByMatchLvl = multiSidebarMatch.match.split("/").length;
15
- const urlMatchLvl = sideMatch.split("/").length;
16
- if (urlMatchLvl > findByMatchLvl) {
17
- multiSidebarMatch = sidebar;
18
- }
19
- } else {
20
- multiSidebarMatch = sidebar;
21
- }
22
- }
23
- return;
24
- }
25
- const ok = filterNavigationByLevels(((_a2 = settings == null ? void 0 : settings.structure) == null ? void 0 : _a2.header) || [], slug)(sidebar);
26
- if (ok) {
27
- sidebarItems.push(sidebar);
28
- }
29
- });
30
- if (multiSidebarMatch != null) {
31
- const side = multiSidebarMatch;
32
- sidebarItems.push(...side.items);
33
- }
34
- return sidebarItems;
35
- }
36
- function normalizeHrefCheck(first, second) {
37
- if (first.startsWith("/")) {
38
- first = first.slice(1);
39
- }
40
- if (second.startsWith("/")) {
41
- second = second.slice(1);
42
- }
43
- return first === second;
44
- }
45
- function normalizeHref(href) {
46
- if (href.startsWith("/")) {
47
- return href;
48
- }
49
- return `/${href}`;
50
- }
51
- function safePageLink(page) {
52
- return (page == null ? void 0 : page.startsWith("/")) ? page : `/${page}`;
53
- }
54
- async function mapSettingsToProps(settings, slug) {
55
- const filteredNav = filterNavigation(settings, slug);
56
- const frontmatters = await pageFrontMatters(filteredNav);
57
- const slugFrontmatter = frontmatters[slug] || null;
58
- const breadcrumbs = [];
59
- let navlinks = void 0;
60
- function mapItems(page, currentNav, nav) {
61
- var _a;
62
- if (typeof page !== "string") {
63
- const items = (_a = page.pages) == null ? void 0 : _a.map((p) => mapItems(p, page, nav));
64
- if (items == null ? void 0 : items.find((item) => normalizeHrefCheck(item.href, slug))) {
65
- breadcrumbs.unshift({
66
- title: page.group || "",
67
- href: ""
68
- // TODO:
69
- });
70
- }
71
- return {
72
- title: page.group,
73
- href: "",
74
- active: false,
75
- items
76
- };
77
- }
78
- const matterTitle = frontmatters && frontmatters[page] && frontmatters[page].title;
79
- let title = "";
80
- if (typeof matterTitle === "string") {
81
- title = matterTitle;
82
- } else {
83
- title = matterTitle;
84
- }
85
- if (!title) {
86
- console.error("Title not found for page", page);
87
- }
88
- if (slugFrontmatter && slugFrontmatter === frontmatters[page]) {
89
- const nlinks = mapNavToLinks(page, currentNav, nav, frontmatters);
90
- if (nlinks) {
91
- navlinks = nlinks;
92
- }
93
- if (currentNav.group) {
94
- breadcrumbs.push({
95
- title: currentNav.group,
96
- href: ""
97
- // TODO:
98
- });
99
- }
100
- breadcrumbs.push({
101
- // @ts-ignore
102
- title,
103
- href: page
104
- });
105
- }
106
- return {
107
- // @ts-ignore
108
- title,
109
- href: safePageLink(page),
110
- active: false
111
- // TODO:
112
- };
113
- }
114
- const groups = filteredNav.map((nav) => {
115
- var _a;
116
- if ("match" in nav) {
117
- return {
118
- group: "",
119
- items: []
120
- };
121
- }
122
- return {
123
- group: nav.group,
124
- items: ((_a = nav.pages) == null ? void 0 : _a.map((p) => {
125
- return mapItems(p, nav, filteredNav);
126
- })) || []
127
- };
128
- }) || [];
129
- return {
130
- groups,
131
- breadcrumbs,
132
- navlinks
133
- };
134
- }
135
- function mapNavToLinks(page, currentNav, nav, frontmatters) {
136
- var _a, _b, _c, _d, _e;
137
- if (!currentNav.group) {
138
- console.error("current nav need group to calculate navlinks");
139
- return;
140
- }
141
- const currentPageIndex = (_a = currentNav == null ? void 0 : currentNav.pages) == null ? void 0 : _a.findIndex((p) => page === p);
142
- const foundPageIndex = currentPageIndex != void 0 && currentPageIndex !== -1;
143
- if (!foundPageIndex) {
144
- return;
145
- }
146
- {
147
- let prev = (_b = currentNav == null ? void 0 : currentNav.pages) == null ? void 0 : _b[currentPageIndex - 1];
148
- let next = (_c = currentNav == null ? void 0 : currentNav.pages) == null ? void 0 : _c[currentPageIndex + 1];
149
- if (prev || next) {
150
- if (prev && typeof prev !== "string") {
151
- console.error("currently nested pages for navlinks are not supported (step 1)");
152
- return;
153
- }
154
- if (next && typeof next !== "string") {
155
- console.error("currently nested pages for navlinks are not supported (step 1)");
156
- return;
157
- }
158
- let prevTitle = prev ? ((_d = frontmatters[prev]) == null ? void 0 : _d.title) || "" : "";
159
- let nextTitle = next ? ((_e = frontmatters[next]) == null ? void 0 : _e.title) || "" : "";
160
- if (typeof prevTitle !== "string") {
161
- if (prevTitle == null ? void 0 : prevTitle.title) {
162
- prevTitle = prevTitle.title;
163
- }
164
- }
165
- if (typeof nextTitle !== "string") {
166
- if (nextTitle == null ? void 0 : nextTitle.title) {
167
- nextTitle = nextTitle.title;
168
- }
169
- }
170
- if (typeof prevTitle !== "string") {
171
- console.error("currently navlink 'prev' must be a string");
172
- return;
173
- }
174
- if (typeof nextTitle !== "string") {
175
- console.error("currently navlink 'next' must be a string");
176
- return;
177
- }
178
- if (prev && next) {
179
- return {
180
- prev: {
181
- title: prevTitle,
182
- href: safePageLink(prev)
183
- },
184
- next: {
185
- title: nextTitle,
186
- href: safePageLink(next)
187
- }
188
- };
189
- }
190
- if (prev) {
191
- return {
192
- prev: {
193
- title: prevTitle,
194
- href: safePageLink(prev)
195
- }
196
- };
197
- }
198
- if (next) {
199
- return {
200
- next: {
201
- title: nextTitle,
202
- href: safePageLink(next)
203
- }
204
- };
205
- }
206
- }
207
- }
208
- return {};
209
- }
210
- export {
211
- mapSettingsToProps
212
- };
213
- //# sourceMappingURL=hydration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/hydration/settings-to-props.ts"],"sourcesContent":["// server-only\n\nimport {Sidebar, PageFrontMatter, Settings, SidebarMulti} from \"@xyd-js/core\";\nimport {filterNavigationByLevels, pageFrontMatters} from \"@xyd-js/content\";\nimport {IBreadcrumb, INavLinks} from \"@xyd-js/ui\";\n\nimport {FwSidebarGroupProps} from \"../react\";\n\n// TODO: framework vs content responsibility\n\nfunction filterNavigation(settings: Settings, slug: string): Sidebar[] {\n const sidebarItems: Sidebar[] = []\n\n let multiSidebarMatch: SidebarMulti | null = null\n\n settings?.structure?.sidebar.filter(sidebar => {\n if (\"match\" in sidebar) {\n const sideMatch = normalizeHref(sidebar.match)\n const normalizeSlug = normalizeHref(slug)\n\n // TODO: startWith is not enough e.g `/docs/apps/buildISSUE` if `/docs/apps/build`\n if (normalizeSlug.startsWith(sideMatch)) {\n if (multiSidebarMatch) {\n const findByMatchLvl = multiSidebarMatch.match.split(\"/\").length\n const urlMatchLvl = sideMatch.split(\"/\").length\n\n if (urlMatchLvl > findByMatchLvl) {\n multiSidebarMatch = sidebar\n }\n } else {\n multiSidebarMatch = sidebar\n }\n }\n\n return\n }\n\n // TODO: better algorithm\n const ok = filterNavigationByLevels(settings?.structure?.header || [], slug)(sidebar)\n\n if (ok) {\n sidebarItems.push(sidebar)\n }\n })\n\n if (multiSidebarMatch != null) {\n const side = multiSidebarMatch as SidebarMulti\n sidebarItems.push(...side.items)\n }\n\n return sidebarItems\n}\n\n// TODO: rename this because it's no longer 'navigation' because it returns breadcrumbs, sidebar and nextlinks props\n// TODO: breadcrumbs and frontmatters as content plugins?\n// TODO: idea - calculate breadcrumbs and navlinks near server-side component?\n\nfunction normalizeHrefCheck(first: string, second: string) {\n if (first.startsWith(\"/\")) {\n first = first.slice(1)\n }\n\n if (second.startsWith(\"/\")) {\n second = second.slice(1)\n }\n\n return first === second\n}\n\nfunction normalizeHref(href: string) {\n if (href.startsWith(\"/\")) {\n return href\n }\n\n return `/${href}`\n}\n\nfunction safePageLink(page: string): string {\n return page?.startsWith(\"/\") ? page : `/${page}`\n}\n\n// mapSettingsToProps maps @xyd-js/core settings into @xyd-js/ui props\nexport async function mapSettingsToProps(\n settings: Settings,\n slug: string\n): Promise<{\n groups: FwSidebarGroupProps[],\n breadcrumbs: IBreadcrumb[]\n navlinks?: INavLinks\n}> {\n const filteredNav = filterNavigation(settings, slug)\n const frontmatters = await pageFrontMatters(filteredNav)\n\n const slugFrontmatter = frontmatters[slug] || null\n const breadcrumbs: IBreadcrumb[] = []\n let navlinks: INavLinks | undefined = undefined\n\n function mapItems(\n page: string | Sidebar,\n currentNav: Sidebar,\n nav: Sidebar[]\n ) {\n if (typeof page !== \"string\") {\n const items = page.pages?.map((p) => mapItems(p, page, nav))\n\n if (items?.find(item => normalizeHrefCheck(item.href, slug))) {\n breadcrumbs.unshift({\n title: page.group || \"\",\n href: \"\", // TODO:\n })\n }\n\n return {\n title: page.group,\n href: \"\",\n active: false,\n items,\n }\n }\n\n const matterTitle = frontmatters && frontmatters[page] && frontmatters[page].title\n\n let title = \"\"\n\n if (typeof matterTitle === \"string\") {\n title = matterTitle\n } else {\n // @ts-ignore\n title = matterTitle\n }\n\n if (!title) {\n console.error(\"Title not found for page\", page)\n }\n\n // TODO: better data structures - for example flat array of filtered nav\n if (slugFrontmatter && (slugFrontmatter === frontmatters[page])) {\n const nlinks = mapNavToLinks(page, currentNav, nav, frontmatters)\n\n if (nlinks) {\n navlinks = nlinks\n }\n\n if (currentNav.group) {\n breadcrumbs.push({\n title: currentNav.group,\n href: \"\", // TODO:\n })\n }\n breadcrumbs.push({\n // @ts-ignore\n title,\n href: page,\n })\n }\n\n return {\n // @ts-ignore\n title,\n href: safePageLink(page),\n active: false // TODO:\n }\n }\n\n const groups = filteredNav.map((nav) => {\n // TODO: finish\n if (\"match\" in nav) {\n return {\n group: \"\",\n items: [],\n } as FwSidebarGroupProps\n }\n\n return {\n group: nav.group,\n items: nav.pages?.map((p) => {\n // @ts-ignore\n return mapItems(p, nav, filteredNav)\n }) || [],\n } as FwSidebarGroupProps\n }) || []\n\n return {\n groups,\n breadcrumbs,\n navlinks\n }\n}\n\n// TODO: support next-prev for different 'groups' levels\nfunction mapNavToLinks(\n page: string | Sidebar,\n currentNav: Sidebar,\n nav: Sidebar[],\n frontmatters: PageFrontMatter\n): INavLinks | undefined {\n if (!currentNav.group) {\n console.error(\"current nav need group to calculate navlinks\")\n return\n }\n\n const currentPageIndex = currentNav?.pages?.findIndex(p => page === p)\n const foundPageIndex = currentPageIndex != undefined && currentPageIndex !== -1\n\n if (!foundPageIndex) {\n return\n }\n\n // same group level\n {\n let prev = currentNav?.pages?.[currentPageIndex - 1]\n let next = currentNav?.pages?.[currentPageIndex + 1]\n\n if (prev || next) {\n if (prev && typeof prev !== \"string\") {\n console.error(\"currently nested pages for navlinks are not supported (step 1)\")\n return\n }\n\n if (next && typeof next !== \"string\") {\n console.error(\"currently nested pages for navlinks are not supported (step 1)\")\n return\n }\n\n let prevTitle = prev ? frontmatters[prev]?.title || \"\" : \"\"\n let nextTitle = next ? frontmatters[next]?.title || \"\" : \"\"\n\n if (typeof prevTitle !== \"string\") {\n if (prevTitle?.title) {\n prevTitle = prevTitle.title\n }\n }\n\n if (typeof nextTitle !== \"string\") {\n if (nextTitle?.title) {\n nextTitle = nextTitle.title\n }\n }\n\n if (typeof prevTitle !== \"string\") {\n console.error(\"currently navlink 'prev' must be a string\")\n return\n }\n\n if (typeof nextTitle !== \"string\") {\n console.error(\"currently navlink 'next' must be a string\")\n return\n }\n\n if (prev && next) {\n return {\n prev: {\n title: prevTitle,\n href: safePageLink(prev),\n },\n next: {\n title: nextTitle,\n href: safePageLink(next),\n }\n }\n }\n\n if (prev) {\n return {\n prev: {\n title: prevTitle,\n href: safePageLink(prev),\n },\n }\n }\n\n if (next) {\n return {\n next: {\n title: nextTitle,\n href: safePageLink(next),\n },\n }\n }\n }\n }\n\n\n return {}\n}\n"],"mappings":";AAGA,SAAQ,0BAA0B,wBAAuB;AAOzD,SAAS,iBAAiB,UAAoB,MAAyB;AAVvE;AAWI,QAAM,eAA0B,CAAC;AAEjC,MAAI,oBAAyC;AAE7C,6CAAU,cA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AAClB,sBAAY,UAAU;AAAA,QAC1B;AAAA,MACJ;AAEA,UAAI,OAAO,cAAc,UAAU;AAC/B,gBAAQ,MAAM,2CAA2C;AACzD;AAAA,MACJ;AAEA,UAAI,OAAO,cAAc,UAAU;AAC/B,gBAAQ,MAAM,2CAA2C;AACzD;AAAA,MACJ;AAEA,UAAI,QAAQ,MAAM;AACd,eAAO;AAAA,UACH,MAAM;AAAA,YACF,OAAO;AAAA,YACP,MAAM,aAAa,IAAI;AAAA,UAC3B;AAAA,UACA,MAAM;AAAA,YACF,OAAO;AAAA,YACP,MAAM,aAAa,IAAI;AAAA,UAC3B;AAAA,QACJ;AAAA,MACJ;AAEA,UAAI,MAAM;AACN,eAAO;AAAA,UACH,MAAM;AAAA,YACF,OAAO;AAAA,YACP,MAAM,aAAa,IAAI;AAAA,UAC3B;AAAA,QACJ;AAAA,MACJ;AAEA,UAAI,MAAM;AACN,eAAO;AAAA,UACH,MAAM;AAAA,YACF,OAAO;AAAA,YACP,MAAM,aAAa,IAAI;AAAA,UAC3B;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAGA,SAAO,CAAC;AACZ;","names":["_a"]}
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
-
3
- interface ITheme<T> {
4
- children: React.ReactNode;
5
- themeSettings?: T;
6
- }
7
-
8
- export type { ITheme };
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/react.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import * as _xyd_js_core from '@xyd-js/core';
3
- import { Settings } from '@xyd-js/core';
4
- import { ITOC, IBreadcrumb, INavLinks } from '@xyd-js/ui';
5
- import { F as FwSidebarGroupProps } from './sidebar-Dwf54qYp.js';
6
-
7
- declare function FwNav({ kind }: {
8
- kind?: "middle";
9
- }): React.JSX.Element;
10
- declare function FwSubNav(): React.JSX.Element | null;
11
- interface FwSidebarGroupsProps {
12
- onePathBehaviour?: boolean;
13
- clientSideRouting?: boolean;
14
- }
15
- declare function FwSidebarGroups(props: FwSidebarGroupsProps): React.JSX.Element;
16
- declare function FwToc(): React.JSX.Element | null;
17
- declare function FwBreadcrumbs(): React.JSX.Element;
18
- declare function FwNavLinks(): React.JSX.Element | null;
19
-
20
- interface FrameworkProps {
21
- children: React.ReactNode;
22
- settings: Settings;
23
- sidebarGroups: FwSidebarGroupProps[];
24
- toc?: ITOC[];
25
- breadcrumbs?: IBreadcrumb[];
26
- navlinks?: INavLinks;
27
- }
28
- declare function Framework(props: FrameworkProps): React.JSX.Element;
29
-
30
- declare function useMatchedSubNav(): _xyd_js_core.SubHeader | null;
31
-
32
- export { Framework, type FrameworkProps, FwBreadcrumbs, FwNav, FwNavLinks, FwSidebarGroupProps, FwSidebarGroups, type FwSidebarGroupsProps, FwSubNav, FwToc, useMatchedSubNav };