@loomcycle/explorer 0.7.0 → 0.11.0
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/DocumentViewer.d.ts +6 -0
- package/dist/PathExplorer.d.ts +2 -1
- package/dist/components/ChunkTarget.d.ts +9 -0
- package/dist/components/Classification.d.ts +14 -0
- package/dist/components/Connections.d.ts +6 -1
- package/dist/components/CrossReferences.d.ts +20 -1
- package/dist/components/DocTrail.d.ts +6 -0
- package/dist/components/DocUnavailable.d.ts +6 -0
- package/dist/components/DocumentViewerBody.d.ts +10 -1
- package/dist/components/IdCopy.d.ts +7 -0
- package/dist/components/Mermaid.d.ts +3 -1
- package/dist/components/PathTree.d.ts +9 -6
- package/dist/components/ProposalReview.d.ts +23 -0
- package/dist/components/Splitter.d.ts +2 -1
- package/dist/components/Statement.d.ts +9 -0
- package/dist/components/SubjectTypeModal.d.ts +9 -0
- package/dist/index.cjs +14 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +4412 -2114
- package/dist/index.js.map +1 -1
- package/dist/lib/bulkReview.d.ts +23 -0
- package/dist/lib/chunkAncestry.d.ts +2 -0
- package/dist/lib/classify.d.ts +31 -0
- package/dist/lib/clipboard.d.ts +1 -0
- package/dist/lib/createClient.d.ts +15 -0
- package/dist/lib/dataLayer.d.ts +66 -9
- package/dist/lib/docTrail.d.ts +26 -0
- package/dist/lib/edgePages.d.ts +7 -0
- package/dist/lib/lazyPathTree.d.ts +43 -0
- package/dist/lib/navigator.d.ts +4 -0
- package/dist/lib/ruling.d.ts +114 -0
- package/dist/lib/statement.d.ts +13 -0
- package/dist/lib/subjectType.d.ts +4 -0
- package/dist/styles.css +558 -7
- package/dist/types.d.ts +130 -2
- package/package.json +7 -7
package/dist/DocumentViewer.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { AssistantContext, BrowseScope, DocScope, Principal } from "./types";
|
|
3
3
|
import { type ExplorerDataSource } from "./components/ExplorerRoot";
|
|
4
|
+
import { type DocLocation } from "./lib/docTrail";
|
|
4
5
|
export interface DocumentViewerProps extends ExplorerDataSource {
|
|
5
6
|
documentId: string;
|
|
6
7
|
scope: DocScope;
|
|
@@ -16,5 +17,10 @@ export interface DocumentViewerProps extends ExplorerDataSource {
|
|
|
16
17
|
/** Optional Document Assistant slot. Provide it to show an "assistant" toggle
|
|
17
18
|
* that renders the returned node into the panel; omit → no assistant. */
|
|
18
19
|
renderAssistant?: (ctx: AssistantContext) => ReactNode;
|
|
20
|
+
/** Take over "open another document" (a followed cross-document reference),
|
|
21
|
+
* e.g. to route to it. `target` is the document + chunk to open; `from` is
|
|
22
|
+
* the document being left, with the chunk selected in it. Omit → the viewer
|
|
23
|
+
* swaps the document itself and keeps a breadcrumb trail back. */
|
|
24
|
+
onOpenDocument?: (target: DocLocation, from: DocLocation) => void;
|
|
19
25
|
}
|
|
20
26
|
export default function DocumentViewer(props: DocumentViewerProps): import("react").JSX.Element;
|
package/dist/PathExplorer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { AssistantContext, BrowseScope, PathScope, Principal } from "./types";
|
|
2
|
+
import type { AssistantContext, BrowseScope, NavigatorContext, PathScope, Principal } from "./types";
|
|
3
3
|
import { type ExplorerDataSource } from "./components/ExplorerRoot";
|
|
4
4
|
export interface PathExplorerProps extends ExplorerDataSource {
|
|
5
5
|
theme?: "light" | "dark";
|
|
@@ -9,6 +9,7 @@ export interface PathExplorerProps extends ExplorerDataSource {
|
|
|
9
9
|
browse?: BrowseScope;
|
|
10
10
|
principal?: Principal;
|
|
11
11
|
renderAssistant?: (ctx: AssistantContext) => ReactNode;
|
|
12
|
+
renderNavigator?: (ctx: NavigatorContext) => ReactNode;
|
|
12
13
|
onError?: (e: unknown) => void;
|
|
13
14
|
}
|
|
14
15
|
export default function PathExplorer(props: PathExplorerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ChunkTargetProps {
|
|
2
|
+
id: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
targetDocumentId?: string;
|
|
5
|
+
documentId: string;
|
|
6
|
+
onSelectChunk: (id: string) => void;
|
|
7
|
+
onOpenDocument?: (documentId: string, chunkId: string, title?: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export default function ChunkTarget({ id, title, targetDocumentId, documentId, onSelectChunk, onOpenDocument, }: ChunkTargetProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BrowseScope, ClassifyAnswer, DocScope } from "../types";
|
|
2
|
+
export interface ClassificationProps {
|
|
3
|
+
documentId: string;
|
|
4
|
+
scope: DocScope;
|
|
5
|
+
browse?: BrowseScope;
|
|
6
|
+
rootFields: unknown;
|
|
7
|
+
requestKey: number;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onChanged: () => void;
|
|
10
|
+
}
|
|
11
|
+
export default function Classification({ documentId, scope, browse, rootFields, requestKey, onClose, onChanged, }: ClassificationProps): import("react").JSX.Element | null;
|
|
12
|
+
export declare function ClassifyAnswerView({ answer }: {
|
|
13
|
+
answer: ClassifyAnswer;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { BrowseScope, DocScope } from "../types";
|
|
2
|
+
import type { ReviewPanel } from "../lib/bulkReview";
|
|
3
|
+
export type ConnectionsReview = ReviewPanel;
|
|
2
4
|
export interface ConnectionsProps {
|
|
3
5
|
documentId: string;
|
|
4
6
|
selectedId?: string;
|
|
5
7
|
scope: DocScope;
|
|
6
8
|
browse?: BrowseScope;
|
|
7
9
|
onSelectChunk: (id: string) => void;
|
|
10
|
+
onOpenDocument?: (documentId: string, chunkId: string, title?: string) => void;
|
|
11
|
+
refreshKey?: number;
|
|
12
|
+
review?: ConnectionsReview;
|
|
8
13
|
}
|
|
9
|
-
export default function Connections({ documentId, selectedId, scope, browse, onSelectChunk, }: ConnectionsProps): import("react").JSX.Element;
|
|
14
|
+
export default function Connections({ documentId, selectedId, scope, browse, onSelectChunk, onOpenDocument, refreshKey, review, }: ConnectionsProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
import type { DocEdge } from "../types";
|
|
2
|
+
import { type StatementRuling } from "./Statement";
|
|
2
3
|
export interface CrossReferencesProps {
|
|
3
4
|
edges: DocEdge[];
|
|
4
5
|
documentId: string;
|
|
5
6
|
selectedId?: string;
|
|
6
7
|
onSelectChunk: (id: string) => void;
|
|
8
|
+
onOpenDocument?: (documentId: string, chunkId: string, title?: string) => void;
|
|
9
|
+
onRuleStatement?: StatementRuling;
|
|
10
|
+
incomplete?: boolean;
|
|
7
11
|
}
|
|
8
|
-
export default function CrossReferences({ edges, documentId, selectedId, onSelectChunk, }: CrossReferencesProps): import("react").JSX.Element | null;
|
|
12
|
+
export default function CrossReferences({ edges, documentId, selectedId, onSelectChunk, onOpenDocument, onRuleStatement, incomplete, }: CrossReferencesProps): import("react").JSX.Element | null;
|
|
13
|
+
export declare function RefRow({ edge, selectedId, documentId, onSelectChunk, onOpenDocument, onRuleStatement, }: {
|
|
14
|
+
edge: DocEdge;
|
|
15
|
+
selectedId: string;
|
|
16
|
+
documentId: string;
|
|
17
|
+
onSelectChunk: (id: string) => void;
|
|
18
|
+
onOpenDocument?: (documentId: string, chunkId: string, title?: string) => void;
|
|
19
|
+
onRuleStatement?: StatementRuling;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export declare function buildGraph(edges: DocEdge[]): string;
|
|
22
|
+
export declare function graphEndpoint(edges: DocEdge[], node: string): {
|
|
23
|
+
id: string;
|
|
24
|
+
documentId?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
} | undefined;
|
|
27
|
+
export declare function nodeId(id: string): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { AssistantContext, BrowseScope, DocScope, Principal } from "../types";
|
|
3
|
+
import { type DocLocation } from "../lib/docTrail";
|
|
3
4
|
export interface DocumentViewerBodyProps {
|
|
4
5
|
documentId: string;
|
|
5
6
|
scope: DocScope;
|
|
@@ -7,5 +8,13 @@ export interface DocumentViewerBodyProps {
|
|
|
7
8
|
browse?: BrowseScope;
|
|
8
9
|
principal?: Principal;
|
|
9
10
|
renderAssistant?: (ctx: AssistantContext) => ReactNode;
|
|
11
|
+
initialChunkId?: string;
|
|
12
|
+
onOpenDocument?: (target: DocLocation, from: DocLocation) => void;
|
|
13
|
+
onTitle?: (documentId: string, title: string) => void;
|
|
14
|
+
onChunkSelect?: (chunkId: string | undefined) => void;
|
|
15
|
+
focusChunk?: {
|
|
16
|
+
chunkId?: string;
|
|
17
|
+
seq: number;
|
|
18
|
+
};
|
|
10
19
|
}
|
|
11
|
-
export default function DocumentViewerBody({ documentId, scope, titleHint, browse: browseProp, principal, renderAssistant, }: DocumentViewerBodyProps): import("react").JSX.Element;
|
|
20
|
+
export default function DocumentViewerBody({ documentId, scope, titleHint, browse: browseProp, principal, renderAssistant, initialChunkId, onOpenDocument, onTitle, onChunkSelect, focusChunk, }: DocumentViewerBodyProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
export
|
|
2
|
+
export declare function flowchartNode(target: Element | null): string | undefined;
|
|
3
|
+
export default function MermaidDiagram({ code, onNodeClick, }: {
|
|
3
4
|
code: string;
|
|
5
|
+
onNodeClick?: (nodeId: string) => void;
|
|
4
6
|
}): ReactNode;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DirListing, DirMap } from "../lib/lazyPathTree";
|
|
2
2
|
import { type DocSummary } from "../lib/colorScheme";
|
|
3
3
|
export interface PathNode {
|
|
4
4
|
name: string;
|
|
5
5
|
fullPath: string;
|
|
6
6
|
kind: string;
|
|
7
7
|
resourceRef?: unknown;
|
|
8
|
-
|
|
8
|
+
listing?: DirListing;
|
|
9
9
|
children: PathNode[];
|
|
10
10
|
}
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function parentPathOf(fullPath: string): string;
|
|
13
|
-
export declare function collectDocumentIds(node: PathNode): string[];
|
|
11
|
+
export declare function buildLazyTree(dirs: DirMap, dir?: string): PathNode[];
|
|
14
12
|
export interface PathTreeProps {
|
|
15
13
|
tree: PathNode[];
|
|
14
|
+
root?: DirListing;
|
|
15
|
+
expanded: ReadonlySet<string>;
|
|
16
|
+
onToggle: (dir: string) => void;
|
|
17
|
+
onLoadMore: (dir: string) => void;
|
|
18
|
+
onRetry: (dir: string) => void;
|
|
16
19
|
selectedPath?: string;
|
|
17
20
|
onSelect: (node: PathNode) => void;
|
|
18
21
|
summaries?: Map<string, DocSummary>;
|
|
19
22
|
}
|
|
20
|
-
export default function PathTree(
|
|
23
|
+
export default function PathTree(props: PathTreeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BrowseScope, DocEdge } from "../types";
|
|
2
|
+
import type { DocRulingAnswer } from "../lib/dataLayer";
|
|
3
|
+
import { type RulingAction, type RulingScope } from "../lib/ruling";
|
|
4
|
+
export interface ProposalReviewProps {
|
|
5
|
+
documentId: string;
|
|
6
|
+
proposals: DocEdge[];
|
|
7
|
+
incomplete?: boolean;
|
|
8
|
+
scope: RulingScope;
|
|
9
|
+
browse?: BrowseScope;
|
|
10
|
+
onChanged: () => void;
|
|
11
|
+
onSelectChunk: (id: string) => void;
|
|
12
|
+
onOpenDocument?: (documentId: string, chunkId: string, title?: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export default function ProposalReview({ documentId, proposals, incomplete, scope, browse, onChanged, onSelectChunk, onOpenDocument, }: ProposalReviewProps): import("react").JSX.Element;
|
|
15
|
+
export declare function BulkConfirm({ step, onAnswer, }: {
|
|
16
|
+
step: {
|
|
17
|
+
action: RulingAction;
|
|
18
|
+
all: boolean;
|
|
19
|
+
dry: DocRulingAnswer;
|
|
20
|
+
changed: boolean;
|
|
21
|
+
};
|
|
22
|
+
onAnswer: (ok: boolean) => void;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
@@ -6,5 +6,6 @@ export interface SplitterProps {
|
|
|
6
6
|
minRightWidth?: number;
|
|
7
7
|
storageKey?: string;
|
|
8
8
|
className?: string;
|
|
9
|
+
hideRight?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export default function Splitter({ children, defaultLeftWidth, minLeftWidth, minRightWidth, storageKey, className, }: SplitterProps): import("react").JSX.Element;
|
|
11
|
+
export default function Splitter({ children, defaultLeftWidth, minLeftWidth, minRightWidth, storageKey, className, hideRight, }: SplitterProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StatementFields } from "../types";
|
|
2
|
+
export type StatementRuling = (id: string, accept: boolean, reason?: string) => Promise<void>;
|
|
3
|
+
export declare function StatementMeta({ statement }: {
|
|
4
|
+
statement: StatementFields;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export declare function StatementReview({ id, onRule }: {
|
|
7
|
+
id: string;
|
|
8
|
+
onRule: StatementRuling;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BrowseScope, ChunkDetail, DocScope } from "../types";
|
|
2
|
+
export interface SubjectTypeModalProps {
|
|
3
|
+
chunk: ChunkDetail;
|
|
4
|
+
scope: DocScope;
|
|
5
|
+
browse?: BrowseScope;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onSaved: (updated: ChunkDetail) => void;
|
|
8
|
+
}
|
|
9
|
+
export default function SubjectTypeModal({ chunk, scope, browse, onClose, onSaved }: SubjectTypeModalProps): import("react").JSX.Element;
|