@redocly/theme 0.1.15 → 0.1.20
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/CopyButton/CopyButton.js +24 -13
- package/CopyButton/CopyButtonWrapper.js +25 -13
- package/Footer/CustomFooter.d.ts +7 -0
- package/Footer/CustomFooter.js +31 -0
- package/Footer/CustomFooterNavItem.d.ts +7 -0
- package/Footer/CustomFooterNavItem.js +25 -0
- package/Footer/Footer.d.ts +6 -2
- package/Footer/Footer.js +5 -14
- package/Footer/FooterColumn.d.ts +2 -2
- package/Footer/FooterColumn.js +10 -18
- package/Footer/FooterColumns.d.ts +6 -4
- package/Footer/FooterColumns.js +5 -15
- package/Footer/FooterCopyright.d.ts +6 -4
- package/Footer/FooterCopyright.js +2 -13
- package/JsonViewer/JsonViewer.js +33 -16
- package/JsonViewer/styled.js +1 -1
- package/Layout/PageLayout.js +4 -13
- package/Layout/RootLayout.js +5 -13
- package/Markdown/Admonition.js +5 -13
- package/Markdown/CodeSample/CodeSample.js +29 -13
- package/Markdown/CodeSample/styled.js +51 -4
- package/Markdown/Heading.js +29 -15
- package/Markdown/MarkdownLayout.js +8 -12
- package/Markdown/Mermaid.js +2 -2
- package/Markdown/Tabs/Tab.js +2 -13
- package/Markdown/Tabs/Tabs.js +33 -20
- package/Navbar/Navbar.d.ts +2 -1
- package/Navbar/Navbar.js +6 -13
- package/Navbar/NavbarDropdown.d.ts +8 -0
- package/Navbar/NavbarDropdown.js +21 -0
- package/Navbar/NavbarItem.d.ts +3 -36
- package/Navbar/NavbarItem.js +23 -23
- package/Navbar/NavbarMenu.d.ts +2 -1
- package/Navbar/NavbarMenu.js +4 -15
- package/NavbarLogo/NavbarLogo.js +3 -14
- package/PageNavigation/NextPageLink.js +7 -13
- package/PageNavigation/PageNavigation.js +4 -13
- package/PageNavigation/PreviousPageLink.js +7 -13
- package/Panel/PanelComponent.js +30 -14
- package/Search/Autocomplete.js +30 -3
- package/Search/ClearIcon.js +3 -2
- package/Search/Parameters.js +17 -17
- package/Search/Search.js +3 -13
- package/Search/SearchIcon.js +3 -2
- package/Search/SearchItem.js +30 -13
- package/Search/utils.js +28 -2
- package/Sidebar/ApiCallItem.js +7 -13
- package/Sidebar/ArrowBack.js +5 -13
- package/Sidebar/BackButton.js +4 -13
- package/Sidebar/Drilldown.js +6 -2
- package/Sidebar/DrilldownMenu.js +10 -13
- package/Sidebar/DrilldownMenuItem.js +6 -13
- package/Sidebar/ExternalIcon.js +7 -13
- package/Sidebar/MenuGroup.js +8 -13
- package/Sidebar/MenuItem.js +7 -13
- package/Sidebar/MenuLinkItem.js +2 -2
- package/Sidebar/Separator.js +4 -13
- package/Sidebar/SidebarLayout.js +6 -13
- package/SidebarLogo/SidebarLogo.js +3 -14
- package/SourceCode/SourceCode.js +11 -17
- package/TableOfContent/TableOfContent.js +40 -26
- package/Tooltip/Tooltip.js +4 -14
- package/globalStyle.js +1 -1
- package/icons/ShelfIcon/ShelfIcon.js +4 -13
- package/mocks/Link.js +5 -2
- package/package.json +1 -1
- package/src/Footer/CustomFooter.tsx +45 -0
- package/src/Footer/CustomFooterNavItem.tsx +40 -0
- package/src/Footer/Footer.tsx +6 -2
- package/src/Footer/FooterColumn.tsx +4 -4
- package/src/Footer/FooterColumns.tsx +9 -9
- package/src/Footer/FooterCopyright.tsx +6 -6
- package/src/JsonViewer/styled.ts +10 -3
- package/src/Markdown/CodeSample/styled.ts +48 -48
- package/src/Navbar/Navbar.tsx +5 -2
- package/src/Navbar/NavbarDropdown.tsx +44 -0
- package/src/Navbar/NavbarItem.tsx +44 -51
- package/src/Navbar/NavbarMenu.tsx +6 -3
- package/src/globalStyle.ts +1 -0
- package/src/types/portal/index.d.ts +0 -1
- package/src/types/portal/src/client/app/Sidebar/types.d.ts +1 -1
- package/src/types/portal/src/server/{utils → content}/content-provider.d.ts +9 -9
- package/src/types/portal/src/server/{version-store.d.ts → content/versions-config.d.ts} +7 -7
- package/src/types/portal/src/server/plugins/markdown/types.d.ts +14 -11
- package/src/types/portal/src/server/plugins/portal-config/types.d.ts +16 -19
- package/src/types/portal/src/server/plugins/types.d.ts +23 -15
- package/src/types/portal/src/server/store.d.ts +32 -33
- package/src/types/portal/src/server/utils/fs.d.ts +2 -1
- package/src/types/portal/src/server/utils/index.d.ts +0 -1
- package/src/types/portal/src/server/utils/paths.d.ts +3 -3
- package/src/types/portal/src/server/utils/reporter/formatter.d.ts +2 -1
- package/src/types/portal/src/server/utils/reporter/reporter.d.ts +2 -1
- package/src/types/portal/src/shared/constants.d.ts +2 -0
- package/src/types/portal/src/shared/models/active-item.d.ts +3 -0
- package/src/types/portal/src/shared/models/config.d.ts +28 -0
- package/src/types/portal/src/shared/models/index.d.ts +6 -0
- package/src/types/portal/src/shared/models/json-index.d.ts +5 -0
- package/src/types/portal/src/shared/models/operation-parameter.d.ts +6 -0
- package/src/types/portal/src/shared/models/search-data.d.ts +5 -0
- package/src/types/portal/src/shared/models/search-document.d.ts +11 -0
- package/src/types/portal/src/shared/types.d.ts +8 -2
- package/src/types/portal/src/shared/urls.d.ts +2 -0
- package/src/types/portal/src/shared/utils.d.ts +8 -2
- package/src/utils/ClipboardService.ts +19 -0
- package/ui/AlertIcon.js +20 -17
- package/ui/Arrow.js +4 -13
- package/ui/Button.js +6 -3
- package/ui/Dropdown.js +32 -14
- package/ui/Flex.js +2 -2
- package/ui/Tiles/ThinTile.js +29 -13
- package/ui/Tiles/WideTile.js +29 -13
- package/ui/UniversalLink.js +26 -3
- package/utils/ClipboardService.d.ts +1 -0
- package/utils/ClipboardService.js +19 -0
- package/src/types/portal/src/client/app/media-css.d.ts +0 -7
- package/src/types/portal/src/client/styling/default.d.ts +0 -601
- package/src/types/portal/src/client/styling/index.d.ts +0 -10
- package/src/types/portal/src/client/styling/resolve.d.ts +0 -1
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { Config,
|
|
2
|
-
import type { ContentProvider, ContentRecord } from '../../
|
|
1
|
+
import { Config, Node, RenderableTreeNode } from '@markdoc/markdoc/dist/src/types';
|
|
2
|
+
import type { ContentProvider, ContentRecord } from '../../content/content-provider.js';
|
|
3
|
+
import { PluginDefaultOptions } from '../types.js';
|
|
3
4
|
import type { RouteDetails } from '../types.js';
|
|
4
|
-
export declare type MarkdownOptions = {
|
|
5
|
-
contentDir: string;
|
|
6
|
-
outdir: string;
|
|
7
|
-
getRouteByFsPath: (relativePath: string) => RouteDetails;
|
|
8
|
-
getRouteBySlug: (slug: string) => RouteDetails;
|
|
9
|
-
contentProvider: ContentProvider;
|
|
10
|
-
};
|
|
11
5
|
export interface MdHeading {
|
|
12
6
|
id: string;
|
|
13
7
|
value: string;
|
|
14
8
|
depth: number;
|
|
15
9
|
}
|
|
10
|
+
export declare type MarkdownOptions = {
|
|
11
|
+
getRouteByFsPath: (relativePath: string) => RouteDetails | undefined;
|
|
12
|
+
getRouteBySlug?: (slug: string) => RouteDetails | undefined;
|
|
13
|
+
contentProvider: ContentProvider;
|
|
14
|
+
};
|
|
15
|
+
export interface MdPartialsContext {
|
|
16
|
+
partials: Record<string, Node>;
|
|
17
|
+
}
|
|
18
|
+
export declare type MdRenderContext = ContentRecord & PluginDefaultOptions & MdPartialsContext;
|
|
19
|
+
export declare type MdCompilationContext = MdRenderContext & MarkdownOptions;
|
|
16
20
|
export interface MdCompilationResult {
|
|
17
|
-
result:
|
|
21
|
+
result: RenderableTreeNode;
|
|
18
22
|
headings: MdHeading[];
|
|
19
23
|
}
|
|
20
|
-
export declare type MdCompilationContext = ContentRecord & MarkdownOptions;
|
|
21
24
|
export interface ExtendedMarkdocConfig extends Config {
|
|
22
25
|
currentProcessedPage?: string;
|
|
23
26
|
}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ResolvedConfigLinks } from '../../../shared/types.js';
|
|
2
|
+
import { PortalConfig, RawTheme } from '../../../shared/models/config.js';
|
|
3
|
+
import { Redirect } from '../types';
|
|
4
|
+
export interface GlobalData {
|
|
5
|
+
nav?: ResolvedConfigLinks;
|
|
6
|
+
logo?: PortalConfig['logo'];
|
|
7
|
+
footer?: ResolvedConfigLinks;
|
|
8
|
+
themeSettings?: PortalConfig['themes'];
|
|
7
9
|
}
|
|
8
|
-
export interface
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
columns?: FooterColumn[];
|
|
16
|
-
}
|
|
17
|
-
export interface FooterColumn {
|
|
18
|
-
group: string;
|
|
19
|
-
label?: string;
|
|
20
|
-
items: ResolvedNavItem[];
|
|
10
|
+
export interface GlobalConfig {
|
|
11
|
+
themes: RawTheme[];
|
|
12
|
+
scripts?: string;
|
|
13
|
+
stylesheets?: string;
|
|
14
|
+
redirects: Record<string, Redirect>;
|
|
15
|
+
fileName: string;
|
|
16
|
+
[k: string]: unknown;
|
|
21
17
|
}
|
|
18
|
+
export declare type RbacConfig = Record<string, string[]>;
|
|
22
19
|
export declare type CustomEntryPropertyType = Record<string, string | boolean>;
|
|
23
20
|
export declare type ScriptOrStylesheetConfig = string | CustomEntryPropertyType;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { PageProps, ResolvedNavItem } from '../../shared/types.js';
|
|
2
2
|
import type { Template } from '../store';
|
|
3
|
-
import type { ContentProvider } from '../
|
|
3
|
+
import type { ContentProvider } from '../content/content-provider.js';
|
|
4
|
+
import { SearchData, SearchDocument } from '../../shared/models';
|
|
5
|
+
import type { GlobalData, GlobalConfig, RbacConfig } from './portal-config/types.js';
|
|
4
6
|
export declare type DataLoaderContext = {
|
|
5
|
-
getRouteByFsPath: (relativePath: string) => RouteDetails;
|
|
6
|
-
getRouteBySlug: (relativePath: string) => RouteDetails;
|
|
7
|
+
getRouteByFsPath: (relativePath: string) => RouteDetails | undefined;
|
|
8
|
+
getRouteBySlug: (relativePath: string) => RouteDetails | undefined;
|
|
7
9
|
};
|
|
8
10
|
export declare type DataLoader<T = any> = (contentProvider: ContentProvider, context: DataLoaderContext) => Promise<T>;
|
|
9
11
|
export interface RouteDetails {
|
|
@@ -16,6 +18,11 @@ export interface RouteDetails {
|
|
|
16
18
|
};
|
|
17
19
|
getNavText?: () => Promise<string>;
|
|
18
20
|
getSidebar?(): ResolvedNavItem[];
|
|
21
|
+
getSearchDocuments?(): Promise<SearchDocument[]>;
|
|
22
|
+
}
|
|
23
|
+
export interface Redirect {
|
|
24
|
+
to: string;
|
|
25
|
+
type: number;
|
|
19
26
|
}
|
|
20
27
|
export interface PathVersionInfo {
|
|
21
28
|
version: string;
|
|
@@ -23,23 +30,22 @@ export interface PathVersionInfo {
|
|
|
23
30
|
versionFolderId: string;
|
|
24
31
|
}
|
|
25
32
|
export interface ProcessContentActions {
|
|
33
|
+
createSharedData(id: string, data: unknown): string;
|
|
34
|
+
addRouteSharedData(slug: string, dataKey: string, dataId: string): void;
|
|
26
35
|
addRoute: (route: RouteDetails) => void;
|
|
27
36
|
createTemplate: (template: Template) => Template;
|
|
28
|
-
|
|
29
|
-
addRouteSharedData(slug: string, dataKey: string, dataId: string): void;
|
|
37
|
+
setRbacConfig: (rbacConfig: RbacConfig) => void;
|
|
30
38
|
}
|
|
31
39
|
export interface AfterRoutesCreatedActions {
|
|
32
|
-
createSharedData(id: string, data:
|
|
40
|
+
createSharedData(id: string, data: unknown): string;
|
|
33
41
|
addRouteSharedData(routeSlug: string, dataKey: string, dataId: string): void;
|
|
34
|
-
getRouteByFsPath: (relativePath: string) => RouteDetails;
|
|
35
|
-
getRouteBySlug: (relativePath: string) => RouteDetails;
|
|
42
|
+
getRouteByFsPath: (relativePath: string) => RouteDetails | undefined;
|
|
43
|
+
getRouteBySlug: (relativePath: string) => RouteDetails | undefined;
|
|
36
44
|
getAllRoutes: () => RouteDetails[];
|
|
37
|
-
setGlobalData: (data:
|
|
38
|
-
setGlobalConfig: (data:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
type: number;
|
|
42
|
-
}) => void;
|
|
45
|
+
setGlobalData: (data: GlobalData) => void;
|
|
46
|
+
setGlobalConfig: (data: Partial<GlobalConfig>) => void;
|
|
47
|
+
setSearchData: (data: SearchData) => void;
|
|
48
|
+
addRedirect: (from: string, to: Redirect) => void;
|
|
43
49
|
contentDir: string;
|
|
44
50
|
}
|
|
45
51
|
export interface PluginInstance {
|
|
@@ -47,9 +53,11 @@ export interface PluginInstance {
|
|
|
47
53
|
processContent?: (content: ContentProvider, actions: ProcessContentActions) => Promise<void>;
|
|
48
54
|
afterRoutesCreated?: (content: ContentProvider, actions: AfterRoutesCreatedActions) => Promise<void>;
|
|
49
55
|
}
|
|
50
|
-
export interface
|
|
56
|
+
export interface PluginDefaultOptions {
|
|
51
57
|
contentDir: string;
|
|
52
58
|
outdir: string;
|
|
59
|
+
}
|
|
60
|
+
export interface PluginOptions extends PluginDefaultOptions {
|
|
53
61
|
[k: string]: unknown;
|
|
54
62
|
}
|
|
55
63
|
export declare type Plugin = (opts: PluginOptions) => PluginInstance;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Plugin } from 'esbuild';
|
|
2
|
+
import { JSONIndex, SearchDocument, SearchData } from '../shared/models';
|
|
3
|
+
import type { RouteDetails, Redirect } from './plugins/types.js';
|
|
4
|
+
import type { GlobalData, GlobalConfig, RbacConfig } from './plugins/portal-config/types';
|
|
2
5
|
export declare class Template {
|
|
3
|
-
|
|
6
|
+
pathOrThemePath: string;
|
|
4
7
|
id: string;
|
|
5
8
|
hash: string;
|
|
6
|
-
constructor(
|
|
9
|
+
constructor(pathOrThemePath: string, id: string);
|
|
7
10
|
}
|
|
8
11
|
export declare class Store {
|
|
9
12
|
contentDir: string;
|
|
@@ -12,42 +15,38 @@ export declare class Store {
|
|
|
12
15
|
routesBySlug: Map<string, RouteDetails>;
|
|
13
16
|
routesByFsPath: Map<string, RouteDetails>;
|
|
14
17
|
routesSharedData: Map<string, Record<string, string>>;
|
|
15
|
-
|
|
18
|
+
searchDocuments: SearchDocument[];
|
|
19
|
+
searchIndex: JSONIndex;
|
|
20
|
+
sharedData: Map<string, unknown>;
|
|
16
21
|
templates: Map<string, Template>;
|
|
17
|
-
esbuildPlugins:
|
|
22
|
+
esbuildPlugins: Plugin[];
|
|
18
23
|
listeners: Map<string, Set<Function>>;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
stylesheets: string;
|
|
24
|
-
redirects: Record<string, {
|
|
25
|
-
to: string;
|
|
26
|
-
type: number;
|
|
27
|
-
}>;
|
|
28
|
-
[k: string]: unknown;
|
|
29
|
-
};
|
|
24
|
+
rbacConfig: RbacConfig;
|
|
25
|
+
globalData: GlobalData;
|
|
26
|
+
cliOptions: Record<string, string>;
|
|
27
|
+
globalConfig: GlobalConfig;
|
|
30
28
|
constructor(contentDir: string, outdir?: string, renderMode?: 'thread_worker' | 'main');
|
|
31
|
-
on(type: 'routes-updated', cb: () => void
|
|
32
|
-
on(type: 'template-updated', cb: (
|
|
33
|
-
on(type: '
|
|
34
|
-
on(type: '
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
on(type: 'routes-updated', cb: () => void): void;
|
|
30
|
+
on(type: 'template-updated', cb: () => void): void;
|
|
31
|
+
on(type: 'build-updated', cb: () => void): void;
|
|
32
|
+
on(type: 'shared-data-updated', cb: (id: string, data: unknown) => void): void;
|
|
33
|
+
on(type: 'search-data-updated', cb: (data: SearchData) => void): void;
|
|
34
|
+
on(type: 'global-data-updated', cb: (pathname: string, data: Record<string, unknown>) => void): void;
|
|
35
|
+
runListeners<T extends Array<unknown>>(type: 'template-updated' | 'global-data-updated' | 'shared-data-updated' | 'search-data-updated' | 'routes-updated' | 'build-updated', ...args: T): void;
|
|
36
|
+
addEsbuildPlugin(plugin: Plugin): void;
|
|
37
|
+
setGlobalData(data: GlobalData): void;
|
|
38
|
+
setSearchData(data: SearchData): void;
|
|
39
|
+
setCliOptions(data: Record<string, string>): void;
|
|
40
|
+
setGlobalConfig(data: Partial<GlobalConfig>): void;
|
|
41
|
+
setRbacConfig(rbacConfig: RbacConfig): void;
|
|
42
|
+
addRedirect(from: string, to: Redirect): void;
|
|
43
|
+
createSharedData: (id: string, data: unknown) => string;
|
|
45
44
|
addRouteSharedData: (routeSlug: string, dataKey: string, dataId: string) => void;
|
|
46
45
|
addRoute: (route: RouteDetails) => void;
|
|
47
|
-
getRouteByFsPath: (relativePath: string) => RouteDetails;
|
|
48
|
-
getRouteBySlug: (slug: string) => RouteDetails;
|
|
46
|
+
getRouteByFsPath: (relativePath: string) => RouteDetails | undefined;
|
|
47
|
+
getRouteBySlug: (slug: string) => RouteDetails | undefined;
|
|
49
48
|
getAllRoutes: () => RouteDetails[];
|
|
50
|
-
getTemplate: (id: string) => Template;
|
|
49
|
+
getTemplate: (id: string) => Template | undefined;
|
|
51
50
|
createTemplate: (template: Template) => Template;
|
|
52
51
|
clear: () => void;
|
|
53
52
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export declare function readFileAsStringSync(filePath: string): string;
|
|
1
|
+
export declare function readFileAsStringSync(filePath: string): string | null | undefined;
|
|
2
2
|
export declare function readFileNames(dir: string): string[];
|
|
3
3
|
export declare function copyStaticFile(absolutePath: string, outdir: string): string;
|
|
4
|
+
export declare function ensureDir(path: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ContentProvider } from '
|
|
1
|
+
import type { ContentProvider } from '../content/content-provider.js';
|
|
2
2
|
export declare function getDataFromRelativePath(relativePath: string): {
|
|
3
|
-
pathVersion: string;
|
|
3
|
+
pathVersion: string | null;
|
|
4
4
|
basePath: string;
|
|
5
5
|
};
|
|
6
6
|
export declare function generatePagePathname(currentVersion?: string | null, defaultVersion?: string | null, ...combineParts: string[]): string;
|
|
@@ -10,4 +10,4 @@ export declare function fromCurrentDir(moduleUrl: string, path: string): string;
|
|
|
10
10
|
export declare function excludeVersion<T extends string[] | string>(arg: T): {
|
|
11
11
|
version?: string;
|
|
12
12
|
data: T;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Reporter } from './reporter';
|
|
1
2
|
declare const formatter: {
|
|
2
3
|
success(message: string, ...args: any[]): string;
|
|
3
4
|
info(message: string, ...args: any[]): string;
|
|
@@ -5,7 +6,7 @@ declare const formatter: {
|
|
|
5
6
|
error(message: string, ...args: any[]): string;
|
|
6
7
|
verbose(message: string, ...args: any[]): string;
|
|
7
8
|
formatMs(ms: number): string;
|
|
8
|
-
withTime(message:
|
|
9
|
+
withTime(message: string, reporter: Reporter): string;
|
|
9
10
|
format(pattern: string, ...args: any[]): string;
|
|
10
11
|
};
|
|
11
12
|
export default formatter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const reporter: {
|
|
2
2
|
now(): number;
|
|
3
3
|
startTiming(): void;
|
|
4
|
-
getTimeSpan(): number;
|
|
4
|
+
getTimeSpan(): number | undefined;
|
|
5
5
|
success(message: string, ...args: any[]): void;
|
|
6
6
|
successTime(message: string, ...args: any[]): void;
|
|
7
7
|
info(message: string, ...args: any[]): void;
|
|
@@ -15,3 +15,4 @@ export declare const reporter: {
|
|
|
15
15
|
panicOnBuild(message: string, ...args: any[]): void;
|
|
16
16
|
flushErrors(): void;
|
|
17
17
|
};
|
|
18
|
+
export declare type Reporter = typeof reporter;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const RUNTIME_RESOURCES_DIR = "runtime";
|
|
2
2
|
export declare const REDOC_OVERVIEW_ITEM_ID = "overview";
|
|
3
3
|
export declare const PORTAL_CUSTOM_THEMES_FOLDER = "@theme";
|
|
4
|
+
export declare const CUSTOM_MARKDOC_OPTIONS_PATH = "markdoc";
|
|
5
|
+
export declare const CUSTOM_MARKDOC_TAGS_PATH = "tags";
|
|
4
6
|
export declare const USER_THEME_ALIAS = "@theme";
|
|
5
7
|
export declare const PUBLIC_STATIC_FOLDER = "/static";
|
|
6
8
|
export declare enum FsErrors {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RawNavItem, LogoConfig, ResolvedNavItem } from '../types';
|
|
2
|
+
export interface PortalConfig extends Record<string, any> {
|
|
3
|
+
nav?: RawNavItem[];
|
|
4
|
+
logo?: LogoConfig;
|
|
5
|
+
themes?: RawTheme[];
|
|
6
|
+
footer?: FooterConfig;
|
|
7
|
+
}
|
|
8
|
+
export interface RawTheme {
|
|
9
|
+
name: string;
|
|
10
|
+
settings?: any;
|
|
11
|
+
}
|
|
12
|
+
export interface ResolvedTheme extends RawTheme {
|
|
13
|
+
stylesFile?: string;
|
|
14
|
+
markdoc: {
|
|
15
|
+
nodesFiles: string[];
|
|
16
|
+
tagsFiles: string[];
|
|
17
|
+
componentsFile?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface FooterConfig {
|
|
21
|
+
copyrightText?: string;
|
|
22
|
+
columns?: FooterColumn[];
|
|
23
|
+
}
|
|
24
|
+
export interface FooterColumn {
|
|
25
|
+
group: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
items: ResolvedNavItem[];
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OperationParameter } from './operation-parameter';
|
|
2
|
+
export interface SearchDocument {
|
|
3
|
+
id: string;
|
|
4
|
+
url: string;
|
|
5
|
+
title: string | string[];
|
|
6
|
+
text: string | string[];
|
|
7
|
+
path?: string[];
|
|
8
|
+
httpVerb?: string;
|
|
9
|
+
pathName?: string | string[];
|
|
10
|
+
parameters?: OperationParameter[];
|
|
11
|
+
}
|
|
@@ -16,8 +16,8 @@ export declare type ResolvedNavLinkItem = {
|
|
|
16
16
|
export declare type ResolvedNavGroupItem = {
|
|
17
17
|
type: 'group';
|
|
18
18
|
link?: string;
|
|
19
|
-
label
|
|
20
|
-
items
|
|
19
|
+
label?: string;
|
|
20
|
+
items?: ResolvedNavItem[];
|
|
21
21
|
version?: string;
|
|
22
22
|
isDefault?: boolean;
|
|
23
23
|
versionFolderId?: string;
|
|
@@ -53,6 +53,7 @@ export interface PageProps {
|
|
|
53
53
|
title: string;
|
|
54
54
|
};
|
|
55
55
|
versions?: Version[];
|
|
56
|
+
frontmatter?: Omit<PageProps, 'frontmatter'>;
|
|
56
57
|
[k: string]: unknown;
|
|
57
58
|
}
|
|
58
59
|
export interface PageData {
|
|
@@ -67,6 +68,8 @@ export interface CachedPageData extends PageData {
|
|
|
67
68
|
}
|
|
68
69
|
export interface ResolvedPageData extends CachedPageData {
|
|
69
70
|
sharedData: Record<string, unknown>;
|
|
71
|
+
nextPage?: any;
|
|
72
|
+
prevPage?: any;
|
|
70
73
|
}
|
|
71
74
|
export declare enum MenuStyle {
|
|
72
75
|
Drilldown = "drilldown"
|
|
@@ -114,3 +117,6 @@ export declare type VersionedFolderConfig = {
|
|
|
114
117
|
versions: VersionConfigItem[];
|
|
115
118
|
hasVersionsConfig?: boolean;
|
|
116
119
|
};
|
|
120
|
+
export declare type NavGroup = ResolvedNavItem[] | undefined | string;
|
|
121
|
+
export declare type NavGroupRecord = Record<string, NavGroup>;
|
|
122
|
+
export declare type ResolvedConfigLinks = NavGroup | NavGroupRecord;
|
|
@@ -3,6 +3,8 @@ export declare function getClientPageDataUrl(normalizedRoute: string): string;
|
|
|
3
3
|
export declare function getSidebarUrl(id: string): string;
|
|
4
4
|
export declare function getSharedDataUrl(id: string): string;
|
|
5
5
|
export declare const GLOBAL_DATA_URL = "/app-data.json";
|
|
6
|
+
export declare const SEARCH_DATA_URL = "/search-data.json";
|
|
7
|
+
export declare const SEARCH_INDEX_URL = "/search-index.json";
|
|
6
8
|
export declare function combineUrls(baseURL: string, ...relativeURLs: string[]): string;
|
|
7
9
|
export declare function withPathPrefix(url: string): string;
|
|
8
10
|
export declare function withoutHash(url: string): string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import picomatch from 'picomatch';
|
|
2
|
+
import type { Tag, Node } from '@markdoc/markdoc';
|
|
3
|
+
export declare const isLocalLink: (path: string | null | undefined) => boolean;
|
|
2
4
|
/**
|
|
3
5
|
*
|
|
4
6
|
* @returns url with leading and without trailing slash or empty string, e.g. '/prefix'
|
|
@@ -7,4 +9,8 @@ export declare function getPathPrefix(): string;
|
|
|
7
9
|
export declare function normalizePathPrefix(prefix: string): string;
|
|
8
10
|
export declare function addLeadingSlash(url: string): string;
|
|
9
11
|
export declare function removeTrailingSlash(url: string): string;
|
|
10
|
-
export declare
|
|
12
|
+
export declare type Glob = picomatch.Glob;
|
|
13
|
+
export declare function getGlobMatcher(glob: Glob, options?: {}): (file: string) => boolean;
|
|
14
|
+
export declare function isTag(value?: any): value is Tag;
|
|
15
|
+
export declare function isNode(value?: any): value is Node;
|
|
16
|
+
export declare const getCssPropertyValue: (name: string) => string;
|
|
@@ -6,4 +6,23 @@ export class ClipboardService {
|
|
|
6
6
|
static copyCustom(text: string): Promise<void> {
|
|
7
7
|
return navigator.clipboard.writeText(text);
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
static selectElement(element: HTMLDivElement | null): void {
|
|
11
|
+
if (!element) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
let range;
|
|
15
|
+
let selection;
|
|
16
|
+
if ((document.body as any).createTextRange) {
|
|
17
|
+
range = (document.body as any).createTextRange();
|
|
18
|
+
range.moveToElementText(element);
|
|
19
|
+
range.select();
|
|
20
|
+
} else if (document.createRange && window.getSelection) {
|
|
21
|
+
selection = window.getSelection();
|
|
22
|
+
range = document.createRange();
|
|
23
|
+
range.selectNodeContents(element);
|
|
24
|
+
selection?.removeAllRanges();
|
|
25
|
+
selection?.addRange(range);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
9
28
|
}
|
package/ui/AlertIcon.js
CHANGED
|
@@ -3,37 +3,40 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
6
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
8
|
};
|
|
20
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
10
|
exports.AlertIcon = void 0;
|
|
22
|
-
var
|
|
11
|
+
var react_1 = __importDefault(require("react"));
|
|
23
12
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
13
|
function Icon(_a) {
|
|
25
14
|
var type = _a.type, className = _a.className;
|
|
26
15
|
switch (type) {
|
|
27
16
|
case 'warning':
|
|
28
|
-
return (
|
|
17
|
+
return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
|
|
18
|
+
react_1.default.createElement("path", { d: "M250.3 15.1c-132.5 0-239.8 107.2-239.8 239.8 0 132.5 107.2 239.8 239.8 239.8 132.5 0 239.8-107.2 239.8-239.8C490.1 122.3 382.8 15.1 250.3 15.1zM250.3 457.1C138.5 457.1 48 366.7 48 254.8 48 143 138.5 52.5 250.3 52.5c111.8 0 202.3 90.5 202.3 202.3C452.6 366.7 362.1 457.1 250.3 457.1z" }),
|
|
19
|
+
react_1.default.createElement("path", { d: "M250.3 135.8c-10.3 0-18.7 8.4-18.7 18.7v120.6c0 10.3 8.4 18.7 18.7 18.7s18.7-8.4 18.7-18.7V154.5C269 144.2 260.7 135.8 250.3 135.8z" }),
|
|
20
|
+
react_1.default.createElement("circle", { cx: "250.3", cy: "342.1", r: "25.3" })));
|
|
29
21
|
case 'success':
|
|
30
|
-
return (
|
|
22
|
+
return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
|
|
23
|
+
react_1.default.createElement("path", { d: "M250.3 490.1c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 382.8 117.8 490.1 250.3 490.1zM250.3 48c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 452.6 48 362.1 48 250.3 48 138.5 138.5 48 250.3 48z" }),
|
|
24
|
+
react_1.default.createElement("path", { d: "M224.7 349.6c8.5 5.9 20.2 3.8 26.1-4.6L355 195.7c5.9-8.5 3.8-20.2-4.6-26.1s-20.2-3.8-26.1 4.6L220 323.5C214.1 332 216.2 343.7 224.7 349.6z" }),
|
|
25
|
+
react_1.default.createElement("path", { d: "M247.1 346.2c7.3-7.3 7.3-19.2 0-26.5l-55.9-55.9c-7.3-7.3-19.2-7.3-26.5 0s-7.3 19.2 0 26.5l55.9 55.9C228 353.5 239.8 353.5 247.1 346.2z" })));
|
|
31
26
|
case 'danger':
|
|
32
|
-
return (
|
|
27
|
+
return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
|
|
28
|
+
react_1.default.createElement("path", { d: "M250.3 490.1c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 382.8 117.8 490.1 250.3 490.1zM250.3 48c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 452.6 48 362.1 48 250.3 48 138.5 138.5 48 250.3 48z" }),
|
|
29
|
+
react_1.default.createElement("path", { d: "M168.4 332.2c7.3 7.3 19.2 7.3 26.5 0l137.3-137.3c7.3-7.3 7.3-19.2 0-26.5 -7.3-7.3-19.2-7.3-26.5 0L168.4 305.7C161.1 313 161.1 324.9 168.4 332.2z" }),
|
|
30
|
+
react_1.default.createElement("path", { d: "M168.4 168.4c-7.3 7.3-7.3 19.2 0 26.5l137.3 137.3c7.3 7.3 19.2 7.3 26.5 0 7.3-7.3 7.3-19.2 0-26.5L194.9 168.4C187.6 161.1 175.7 161.1 168.4 168.4z" })));
|
|
33
31
|
case 'attention':
|
|
34
|
-
return (
|
|
32
|
+
return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
|
|
33
|
+
react_1.default.createElement("path", { d: "M250.3 301.8c-8.3 0-15-6.7-15-15V181.9c0-8.3 6.7-15 15-15 8.3 0 15 6.7 15 15v104.9C265.3 295.1 258.6 301.8 250.3 301.8zM483.7 377L297.2 66.1c-21.2-35.3-72.6-35.4-93.8 0L16.9 377c-17.6 29.4 3.6 67.1 38 67.1h390.8C480.1 444.1 501.4 406.4 483.7 377L483.7 377zM445.7 414.1H54.9c-11.2 0-18-12.2-12.3-21.7L229.1 81.5c9.6-16 32.8-16 42.4 0L458 392.4C463.7 401.9 456.9 414.1 445.7 414.1z" }),
|
|
34
|
+
react_1.default.createElement("circle", { cx: "250.3", cy: "339.2", r: "22.5" })));
|
|
35
35
|
default:
|
|
36
|
-
return (
|
|
36
|
+
return (react_1.default.createElement("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Layer_1", x: "0", y: "0", viewBox: "0 0 500.6 500.6", enableBackground: "new 0 0 500.6 500.6" },
|
|
37
|
+
react_1.default.createElement("path", { d: "M250.3 490.7c132.5 0 239.8-107.2 239.8-239.8 0-132.5-107.2-239.8-239.8-239.8 -132.5 0-239.8 107.2-239.8 239.8C10.6 383.5 117.8 490.7 250.3 490.7zM250.3 48.6c111.8 0 202.3 90.5 202.3 202.3 0 111.8-90.5 202.3-202.3 202.3C138.5 453.2 48 362.7 48 250.9 48 139.1 138.5 48.6 250.3 48.6z" }),
|
|
38
|
+
react_1.default.createElement("path", { d: "M250.3 370c10.3 0 18.7-8.4 18.7-18.7V230.6c0-10.3-8.4-18.7-18.7-18.7 -10.3 0-18.7 8.4-18.7 18.7v120.6C231.6 361.6 240 370 250.3 370z" }),
|
|
39
|
+
react_1.default.createElement("circle", { cx: "250.3", cy: "163.7", r: "25.3" })));
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
exports.AlertIcon = (0, styled_components_1.default)(Icon).attrs(function () { return ({
|
package/ui/Arrow.js
CHANGED
|
@@ -3,23 +3,12 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
6
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
8
|
};
|
|
20
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
10
|
exports.Arrow = void 0;
|
|
22
|
-
var
|
|
11
|
+
var react_1 = __importDefault(require("react"));
|
|
23
12
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
13
|
function directionToTransform(_a) {
|
|
25
14
|
var direction = _a.direction;
|
|
@@ -36,7 +25,9 @@ function directionToTransform(_a) {
|
|
|
36
25
|
}
|
|
37
26
|
var Icon = function (_a) {
|
|
38
27
|
var className = _a.className;
|
|
39
|
-
return (
|
|
28
|
+
return (react_1.default.createElement("span", { "data-component-name": "ui/Arrow/Arrow" },
|
|
29
|
+
react_1.default.createElement("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 7 5", className: className },
|
|
30
|
+
react_1.default.createElement("path", { d: "M3.5 2.51L5.806.205a.7.7 0 01.99.99l-2.8 2.8a.698.698 0 01-.99 0l-2.8-2.8a.7.7 0 11.99-.99L3.5 2.51z" }))));
|
|
40
31
|
};
|
|
41
32
|
exports.Arrow = (0, styled_components_1.default)(Icon)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: var(--sidebar-chevron-size);\n height: var(--sidebar-chevron-size);\n fill: var(--sidebar-chevron-color);\n transform: rotate(", "deg);\n\n vertical-align: middle;\n"], ["\n width: var(--sidebar-chevron-size);\n height: var(--sidebar-chevron-size);\n fill: var(--sidebar-chevron-color);\n transform: rotate(", "deg);\n\n vertical-align: middle;\n"])), directionToTransform);
|
|
42
33
|
var templateObject_1;
|
package/ui/Button.js
CHANGED
|
@@ -10,18 +10,21 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
13
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
17
|
exports.Button = void 0;
|
|
15
|
-
var
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
16
19
|
var Button_1 = require("../Button");
|
|
17
20
|
var Link_1 = require("../mocks/Link");
|
|
18
21
|
var StyledButtonAsLink = Button_1.Button.withComponent(Link_1.Link);
|
|
19
22
|
function Button(props) {
|
|
20
23
|
if (props.to) {
|
|
21
|
-
return
|
|
24
|
+
return react_1.default.createElement(StyledButtonAsLink, __assign({}, props, { role: "button", "data-component-name": "ui/Button" }));
|
|
22
25
|
}
|
|
23
26
|
else {
|
|
24
|
-
return (
|
|
27
|
+
return (react_1.default.createElement(Button_1.Button, __assign({}, props, { role: "button", "data-component-name": "ui/Button" })));
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
exports.Button = Button;
|