@gravitee/graphene-policy-studio 2.48.1 → 2.49.0-feat-385-doc-section-nav.f4e7714
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/dist/components/DocumentationPane/DocumentationEmptyState.d.ts +6 -0
- package/dist/components/DocumentationPane/DocumentationEmptyState.d.ts.map +1 -0
- package/dist/components/DocumentationPane/DocumentationLoadingState.d.ts +2 -0
- package/dist/components/DocumentationPane/DocumentationLoadingState.d.ts.map +1 -0
- package/dist/components/DocumentationPane/DocumentationPane.d.ts +2 -1
- package/dist/components/DocumentationPane/DocumentationPane.d.ts.map +1 -1
- package/dist/components/DocumentationPane/DocumentationRenderer.d.ts +4 -1
- package/dist/components/DocumentationPane/DocumentationRenderer.d.ts.map +1 -1
- package/dist/components/DocumentationPane/SectionNav.d.ts +10 -0
- package/dist/components/DocumentationPane/SectionNav.d.ts.map +1 -0
- package/dist/components/DocumentationPane/index.d.ts +2 -0
- package/dist/components/DocumentationPane/index.d.ts.map +1 -1
- package/dist/components/DocumentationPane/use-document-headings.d.ts +31 -0
- package/dist/components/DocumentationPane/use-document-headings.d.ts.map +1 -0
- package/dist/index.js +3911 -3585
- package/dist/lib/policy-documentation.d.ts +2 -0
- package/dist/lib/policy-documentation.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface DocumentationEmptyStateProps {
|
|
2
|
+
readonly policyName: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function DocumentationEmptyState({ policyName }: DocumentationEmptyStateProps): import("react").JSX.Element;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=DocumentationEmptyState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentationEmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/DocumentationEmptyState.tsx"],"names":[],"mappings":"AAGA,UAAU,4BAA4B;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,uBAAuB,CAAC,EAAE,UAAU,EAAE,EAAE,4BAA4B,+BAenF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentationLoadingState.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/DocumentationLoadingState.tsx"],"names":[],"mappings":"AAEA,wBAAgB,yBAAyB,gCAkCxC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Policy } from '../../types';
|
|
2
2
|
interface DocumentationPaneProps {
|
|
3
3
|
readonly policy: Policy;
|
|
4
|
+
readonly showHeader?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare function DocumentationPane({ policy }: DocumentationPaneProps): import("react").JSX.Element;
|
|
6
|
+
export declare function DocumentationPane({ policy, showHeader }: DocumentationPaneProps): import("react").JSX.Element;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=DocumentationPane.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentationPane.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/DocumentationPane.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentationPane.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/DocumentationPane.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAuB,MAAM,aAAa,CAAC;AAU/D,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAiB,EAAE,EAAE,sBAAsB,+BAgKtF"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { DocHeading } from './use-document-headings';
|
|
1
2
|
type DocumentationLanguage = 'ASCIIDOC' | 'MARKDOWN';
|
|
2
3
|
interface DocumentationRendererProps {
|
|
3
4
|
readonly content: string;
|
|
4
5
|
readonly language: DocumentationLanguage;
|
|
5
6
|
readonly className?: string;
|
|
7
|
+
readonly onHeadingsExtracted?: (headings: DocHeading[]) => void;
|
|
8
|
+
readonly onReady?: () => void;
|
|
6
9
|
}
|
|
7
|
-
declare const DocumentationRenderer: import('react').MemoExoticComponent<({ content, language, className, }: DocumentationRendererProps) => import("react").JSX.Element>;
|
|
10
|
+
declare const DocumentationRenderer: import('react').MemoExoticComponent<({ content, language, className, onHeadingsExtracted, onReady, }: DocumentationRendererProps) => import("react").JSX.Element>;
|
|
8
11
|
export { DocumentationRenderer };
|
|
9
12
|
export type { DocumentationRendererProps };
|
|
10
13
|
//# sourceMappingURL=DocumentationRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentationRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/DocumentationRenderer.tsx"],"names":[],"mappings":"AAOA,KAAK,qBAAqB,GAAG,UAAU,GAAG,UAAU,CAAC;AAErD,UAAU,0BAA0B;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentationRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/DocumentationRenderer.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAQ1D,KAAK,qBAAqB,GAAG,UAAU,GAAG,UAAU,CAAC;AAErD,UAAU,0BAA0B;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAkHD,QAAA,MAAM,qBAAqB,wGAMxB,0BAA0B,iCA2B3B,CAAC;AAEH,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DocHeading } from './use-document-headings';
|
|
2
|
+
interface SectionNavProps {
|
|
3
|
+
readonly headings: DocHeading[];
|
|
4
|
+
readonly activeId: string | null;
|
|
5
|
+
readonly onSelect: (id: string) => void;
|
|
6
|
+
readonly compact?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function SectionNav({ headings, activeId, onSelect, compact }: SectionNavProps): import("react").JSX.Element | null;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=SectionNav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionNav.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/SectionNav.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAY1D,UAAU,eAAe;IACvB,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAiCD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAe,EAAE,EAAE,eAAe,sCAiC5F"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { DocumentationPane } from './DocumentationPane';
|
|
2
2
|
export { DocumentationRenderer, type DocumentationRendererProps } from './DocumentationRenderer';
|
|
3
|
+
export { SectionNav } from './SectionNav';
|
|
4
|
+
export type { DocHeading } from './use-document-headings';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface DocHeading {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly text: string;
|
|
4
|
+
readonly level: number;
|
|
5
|
+
}
|
|
6
|
+
interface UseActiveHeadingOptions {
|
|
7
|
+
/** When set, intersection updates are suppressed (e.g. during smooth scroll-to-section). */
|
|
8
|
+
readonly scrollLockRef?: React.RefObject<string | null>;
|
|
9
|
+
}
|
|
10
|
+
interface UseActiveHeadingResult {
|
|
11
|
+
readonly activeId: string | null;
|
|
12
|
+
readonly setActiveId: (id: string | null) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Tracks which heading is currently visible in a scroll container via IntersectionObserver.
|
|
16
|
+
* Returns the `id` of the topmost visible heading in the observation band.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useActiveHeading(scrollContainerRef: React.RefObject<HTMLElement | null>, headings: DocHeading[], options?: UseActiveHeadingOptions): UseActiveHeadingResult;
|
|
19
|
+
/**
|
|
20
|
+
* Extracts headings from rendered HTML content (used for AsciiDoc output).
|
|
21
|
+
* Looks for h2/h3 elements and returns their id + text.
|
|
22
|
+
*/
|
|
23
|
+
export declare function extractHeadingsFromHtml(html: string): DocHeading[];
|
|
24
|
+
/** Extracts h2/h3 headings from Markdown source (ATX-style `##` / `###` lines). */
|
|
25
|
+
export declare function extractHeadingsFromMarkdown(content: string): DocHeading[];
|
|
26
|
+
/** Generates a URL-safe slug from heading text. */
|
|
27
|
+
export declare function slugify(text: string): string;
|
|
28
|
+
/** Ensures heading ids are unique within a document (appends `-2`, `-3`, … on collision). */
|
|
29
|
+
export declare function ensureUniqueHeadingId(base: string, used: Set<string>): string;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=use-document-headings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-document-headings.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentationPane/use-document-headings.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,uBAAuB;IAC/B,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACzD;AAED,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACvD,QAAQ,EAAE,UAAU,EAAE,EACtB,OAAO,CAAC,EAAE,uBAAuB,GAChC,sBAAsB,CA6DxB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAalE;AAED,mFAAmF;AACnF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CAmBzE;AAED,mDAAmD;AACnD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5C;AAED,6FAA6F;AAC7F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAe7E"}
|