@xyd-js/framework 0.1.0-xyd.6 → 0.1.0-xyd.73
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/LICENSE +21 -0
- package/dist/Sidebar-CdavG0uc.d.ts +23 -0
- package/dist/hydration.d.ts +9 -3
- package/dist/hydration.js +189 -191
- package/dist/hydration.js.map +1 -1
- package/dist/index.d.ts +22 -4
- package/dist/index.js +34 -15
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +49 -9
- package/dist/react.js +446 -528
- package/dist/react.js.map +1 -1
- package/package.json +19 -16
- package/dist/hydration.d.mts +0 -11
- package/dist/hydration.mjs +0 -245
- package/dist/hydration.mjs.map +0 -1
- package/dist/index.d.mts +0 -6
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/react.d.mts +0 -32
- package/dist/react.mjs +0 -651
- package/dist/react.mjs.map +0 -1
- package/dist/sidebar-Dwf54qYp.d.mts +0 -15
- package/dist/sidebar-Dwf54qYp.d.ts +0 -15
- package/packages/hydration/README.md +0 -3
- package/packages/hydration/index.ts +0 -3
- package/packages/hydration/settings-to-props.ts +0 -325
- package/packages/react/README.md +0 -3
- package/packages/react/components/index.tsx +0 -337
- package/packages/react/components/sidebar/index.ts +0 -3
- package/packages/react/components/sidebar/sidebar-group.tsx +0 -240
- package/packages/react/components/sidebar/sidebar.tsx +0 -127
- package/packages/react/contexts/framework.tsx +0 -78
- package/packages/react/contexts/index.ts +0 -2
- package/packages/react/contexts/ui.tsx +0 -6
- package/packages/react/hooks/index.ts +0 -3
- package/packages/react/hooks/useMatchedNav.tsx +0 -29
- package/packages/react/index.ts +0 -12
- package/packages/react/utils/manualHydration.ts +0 -25
- package/packages/theme/context.tsx +0 -19
- package/packages/theme/index.ts +0 -0
- package/postcss.config.cjs +0 -5
- package/src/index.ts +0 -1
- package/src/types.ts +0 -5
- package/tsconfig.json +0 -45
- package/tsup.config.ts +0 -28
package/dist/index.js
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
// src/surfaces.ts
|
|
2
|
+
var SurfaceTarget = /* @__PURE__ */ ((SurfaceTarget2) => {
|
|
3
|
+
SurfaceTarget2["NavRight"] = "nav.right";
|
|
4
|
+
SurfaceTarget2["SidebarTop"] = "sidebar.top";
|
|
5
|
+
SurfaceTarget2["PageFooterBottom"] = "page.footer.bottom";
|
|
6
|
+
SurfaceTarget2["SidebarItemLeft"] = "sidebar.item.left";
|
|
7
|
+
SurfaceTarget2["SidebarItemRight"] = "sidebar.item.right";
|
|
8
|
+
return SurfaceTarget2;
|
|
9
|
+
})(SurfaceTarget || {});
|
|
10
|
+
var Surfaces = class {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.registry = {};
|
|
10
13
|
}
|
|
11
|
-
|
|
14
|
+
define(target, component, opts) {
|
|
15
|
+
if (opts == null ? void 0 : opts.append) {
|
|
16
|
+
if (Array.isArray(this.registry[target])) {
|
|
17
|
+
this.registry[target].push(component);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (this.registry[target]) {
|
|
21
|
+
this.registry[target] = [this.registry[target], component];
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
this.registry[target] = [component];
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.registry[target] = component;
|
|
28
|
+
}
|
|
29
|
+
get(target) {
|
|
30
|
+
return this.registry[target];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
SurfaceTarget,
|
|
35
|
+
Surfaces
|
|
12
36
|
};
|
|
13
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
-
|
|
15
|
-
// src/index.ts
|
|
16
|
-
var src_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(src_exports);
|
|
18
37
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
1
|
+
{"version":3,"sources":["../src/surfaces.ts"],"sourcesContent":["import React, { createContext } from 'react'\n\nexport enum SurfaceTarget {\n NavRight = \"nav.right\",\n\n SidebarTop = \"sidebar.top\",\n\n PageFooterBottom = \"page.footer.bottom\",\n\n SidebarItemLeft = \"sidebar.item.left\",\n SidebarItemRight = \"sidebar.item.right\",\n}\n\n// Type that allows both enum and string values\nexport type SurfaceTargetType = SurfaceTarget | `${SurfaceTarget}`\n\nexport interface SurfaceOptions {\n append?: boolean\n}\n\nexport interface ROSurface {\n get(target: SurfaceTargetType): React.JSX.Element | React.JSX.Element[] | undefined\n}\n\n// TODO: framework vs theme ?\nexport class Surfaces implements ROSurface {\n private registry: Partial<Record<SurfaceTargetType, React.JSX.Element | React.JSX.Element[]>> = {}\n\n public define(\n target: SurfaceTargetType,\n component: React.JSX.Element | React.ComponentType<any>, // TODO: fix any\n opts?: SurfaceOptions\n ) {\n if (opts?.append) {\n if (Array.isArray(this.registry[target])) {\n this.registry[target].push(component)\n return\n }\n\n if (this.registry[target]) {\n this.registry[target] = [this.registry[target], component]\n return\n }\n\n this.registry[target] = [component]\n\n return\n }\n\n this.registry[target] = component\n }\n\n public get(target: SurfaceTargetType): React.JSX.Element | React.JSX.Element[] | undefined {\n return this.registry[target]\n }\n}\n"],"mappings":";AAEO,IAAK,gBAAL,kBAAKA,mBAAL;AACH,EAAAA,eAAA,cAAW;AAEX,EAAAA,eAAA,gBAAa;AAEb,EAAAA,eAAA,sBAAmB;AAEnB,EAAAA,eAAA,qBAAkB;AAClB,EAAAA,eAAA,sBAAmB;AARX,SAAAA;AAAA,GAAA;AAuBL,IAAM,WAAN,MAAoC;AAAA,EAApC;AACH,SAAQ,WAAwF,CAAC;AAAA;AAAA,EAE1F,OACH,QACA,WACA,MACF;AACE,QAAI,6BAAM,QAAQ;AACd,UAAI,MAAM,QAAQ,KAAK,SAAS,MAAM,CAAC,GAAG;AACtC,aAAK,SAAS,MAAM,EAAE,KAAK,SAAS;AACpC;AAAA,MACJ;AAEA,UAAI,KAAK,SAAS,MAAM,GAAG;AACvB,aAAK,SAAS,MAAM,IAAI,CAAC,KAAK,SAAS,MAAM,GAAG,SAAS;AACzD;AAAA,MACJ;AAEA,WAAK,SAAS,MAAM,IAAI,CAAC,SAAS;AAElC;AAAA,IACJ;AAEA,SAAK,SAAS,MAAM,IAAI;AAAA,EAC5B;AAAA,EAEO,IAAI,QAAgF;AACvF,WAAO,KAAK,SAAS,MAAM;AAAA,EAC/B;AACJ;","names":["SurfaceTarget"]}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,32 +1,72 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { F as FwSidebarGroupProps } from './Sidebar-CdavG0uc.js';
|
|
3
|
+
import { SurfaceTargetType, ROSurface, Surfaces } from './index.js';
|
|
2
4
|
import * as _xyd_js_core from '@xyd-js/core';
|
|
3
|
-
import { Settings } from '@xyd-js/core';
|
|
4
|
-
import {
|
|
5
|
-
import { F as FwSidebarGroupProps } from './sidebar-Dwf54qYp.js';
|
|
5
|
+
import { Settings, Metadata } from '@xyd-js/core';
|
|
6
|
+
import { IBreadcrumb, ITOC, INavLinks } from '@xyd-js/ui';
|
|
6
7
|
|
|
7
8
|
declare function FwNav({ kind }: {
|
|
8
9
|
kind?: "middle";
|
|
9
10
|
}): React.JSX.Element;
|
|
10
11
|
declare function FwSubNav(): React.JSX.Element | null;
|
|
11
12
|
interface FwSidebarGroupsProps {
|
|
12
|
-
onePathBehaviour?: boolean;
|
|
13
|
-
clientSideRouting?: boolean;
|
|
14
13
|
}
|
|
15
14
|
declare function FwSidebarGroups(props: FwSidebarGroupsProps): React.JSX.Element;
|
|
16
15
|
declare function FwToc(): React.JSX.Element | null;
|
|
17
16
|
declare function FwBreadcrumbs(): React.JSX.Element;
|
|
18
17
|
declare function FwNavLinks(): React.JSX.Element | null;
|
|
18
|
+
declare function FwLogo(): React.JSX.Element | null;
|
|
19
|
+
declare function FwLink({ children, ...rest }: {
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
children: any;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
declare function FwCopyPage(): React.JSX.Element;
|
|
24
|
+
|
|
25
|
+
interface SurfaceContext {
|
|
26
|
+
surfaces?: ROSurface;
|
|
27
|
+
}
|
|
28
|
+
declare const SurfaceContext: React.Context<SurfaceContext>;
|
|
29
|
+
interface SurfaceProps {
|
|
30
|
+
target: SurfaceTargetType;
|
|
31
|
+
props?: any;
|
|
32
|
+
}
|
|
33
|
+
declare function Surface(props: SurfaceProps): React.JSX.Element | null;
|
|
19
34
|
|
|
20
35
|
interface FrameworkProps {
|
|
21
36
|
children: React.ReactNode;
|
|
22
37
|
settings: Settings;
|
|
38
|
+
metadata: Metadata;
|
|
23
39
|
sidebarGroups: FwSidebarGroupProps[];
|
|
24
|
-
|
|
40
|
+
surfaces: Surfaces;
|
|
41
|
+
components?: {
|
|
42
|
+
[componentName: string]: React.ComponentType<any>;
|
|
43
|
+
};
|
|
44
|
+
BannerContent: React.ComponentType<any>;
|
|
45
|
+
}
|
|
46
|
+
declare function Framework(props: FrameworkProps): React.JSX.Element;
|
|
47
|
+
interface FrameworkPageProps {
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
ContentComponent?: (props: {
|
|
50
|
+
components: any;
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
}) => React.JSX.Element;
|
|
53
|
+
metadata: Metadata;
|
|
25
54
|
breadcrumbs?: IBreadcrumb[];
|
|
55
|
+
rawPage?: string;
|
|
56
|
+
toc?: ITOC[];
|
|
26
57
|
navlinks?: INavLinks;
|
|
27
58
|
}
|
|
28
|
-
declare function
|
|
59
|
+
declare function FrameworkPage(props: FrameworkPageProps): React.JSX.Element;
|
|
60
|
+
declare function useSettings(): Readonly<Settings>;
|
|
61
|
+
declare function useMetadata(): Readonly<Metadata<void>>;
|
|
62
|
+
declare function useComponents(): Readonly<{
|
|
63
|
+
[componentName: string]: React.ComponentType<any>;
|
|
64
|
+
}> | undefined;
|
|
65
|
+
declare function useContentComponent(): (props: {
|
|
66
|
+
components: any;
|
|
67
|
+
children: React.ReactNode;
|
|
68
|
+
}) => React.JSX.Element;
|
|
29
69
|
|
|
30
|
-
declare function useMatchedSubNav(): _xyd_js_core.
|
|
70
|
+
declare function useMatchedSubNav(): _xyd_js_core.Segment | null;
|
|
31
71
|
|
|
32
|
-
export { Framework, type FrameworkProps, FwBreadcrumbs, FwNav, FwNavLinks, FwSidebarGroupProps, FwSidebarGroups, type FwSidebarGroupsProps, FwSubNav, FwToc, useMatchedSubNav };
|
|
72
|
+
export { Framework, FrameworkPage, type FrameworkProps, FwBreadcrumbs, FwCopyPage, FwLink, FwLogo, FwNav, FwNavLinks, FwSidebarGroupProps, FwSidebarGroups, type FwSidebarGroupsProps, FwSubNav, FwToc, Surface, SurfaceContext, useComponents, useContentComponent, useMatchedSubNav, useMetadata, useSettings };
|