@loomcycle/explorer 0.19.0 → 0.20.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/components/AnnotationCard.d.ts +63 -0
- package/dist/components/Breadcrumb.d.ts +11 -0
- package/dist/components/ChunkEditorModal.d.ts +1 -0
- package/dist/components/CreateMenu.d.ts +6 -0
- package/dist/components/DocumentChunkTree.d.ts +3 -1
- package/dist/components/DocumentViewerBody.d.ts +8 -1
- package/dist/components/HistoryModal.d.ts +6 -1
- package/dist/components/MoreMenu.d.ts +15 -0
- package/dist/components/Pane.d.ts +19 -0
- package/dist/components/PathTree.d.ts +13 -0
- package/dist/components/Splitter.d.ts +4 -1
- package/dist/components/TreeRow.d.ts +34 -0
- package/dist/index.cjs +5 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4085 -2677
- package/dist/index.js.map +1 -1
- package/dist/lib/colorScheme.d.ts +7 -2
- package/dist/lib/dataLayer.d.ts +9 -0
- package/dist/{components/DownloadMenu.d.ts → lib/documentDownload.d.ts} +5 -15
- package/dist/lib/lazyPathTree.d.ts +9 -2
- package/dist/lib/persisted.d.ts +6 -0
- package/dist/lib/treeFind.d.ts +26 -0
- package/dist/lib/useNarrow.d.ts +2 -0
- package/dist/styles.css +992 -387
- package/dist/types.d.ts +9 -0
- package/package.json +2 -1
- package/dist/components/IdCopy.d.ts +0 -7
- package/dist/components/StackSplitter.d.ts +0 -17
- package/dist/lib/chunkAncestry.d.ts +0 -2
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type FocusEvent, type KeyboardEvent, type ReactNode } from "react";
|
|
2
|
+
import type { BrowseScope, ChunkRow, DocScope } from "../types";
|
|
3
|
+
import type { ExplorerDataLayer } from "../lib/dataLayer";
|
|
4
|
+
export declare const CARD_DELAY_MS = 600;
|
|
5
|
+
export interface CardInfo {
|
|
6
|
+
title: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
status?: string;
|
|
9
|
+
path?: string;
|
|
10
|
+
brief?: string;
|
|
11
|
+
abstract?: string;
|
|
12
|
+
stale?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface CardSpec extends CardInfo {
|
|
15
|
+
key?: string;
|
|
16
|
+
load?: () => Promise<Partial<CardInfo> | undefined>;
|
|
17
|
+
}
|
|
18
|
+
export declare function CardCacheProvider({ children }: {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export interface CardScope {
|
|
22
|
+
data: ExplorerDataLayer;
|
|
23
|
+
scope: DocScope;
|
|
24
|
+
browse?: BrowseScope;
|
|
25
|
+
}
|
|
26
|
+
export declare const CardScopeContext: import("react").Context<CardScope | null>;
|
|
27
|
+
export interface CardTrigger {
|
|
28
|
+
anchorRef: (el: HTMLElement | null) => void;
|
|
29
|
+
hover: {
|
|
30
|
+
onMouseEnter: () => void;
|
|
31
|
+
onMouseLeave: () => void;
|
|
32
|
+
onMouseDown: () => void;
|
|
33
|
+
};
|
|
34
|
+
focus: {
|
|
35
|
+
onFocus: (e: FocusEvent<HTMLElement>) => void;
|
|
36
|
+
onBlur: (e: FocusEvent<HTMLElement>) => void;
|
|
37
|
+
onKeyDown: (e: KeyboardEvent<HTMLElement>) => void;
|
|
38
|
+
onMouseDown: () => void;
|
|
39
|
+
"aria-describedby"?: string;
|
|
40
|
+
};
|
|
41
|
+
card: ReactNode;
|
|
42
|
+
}
|
|
43
|
+
export declare function useAnnotationCard(spec: CardSpec | undefined): CardTrigger;
|
|
44
|
+
export declare function CardBody({ info, loading }: {
|
|
45
|
+
info: CardInfo;
|
|
46
|
+
loading?: boolean;
|
|
47
|
+
}): import("react").JSX.Element;
|
|
48
|
+
export declare function rowSummary(row: ChunkRow): Partial<CardInfo> | undefined;
|
|
49
|
+
export declare function chunkCard(row: ChunkRow, src: CardScope | null, listed?: boolean): CardSpec;
|
|
50
|
+
export declare function documentCard(documentId: string, title: string, src: Pick<CardScope, "data" | "scope" | "browse"> | null, known?: Partial<CardInfo>): CardSpec;
|
|
51
|
+
export declare function useButtonCard(spec: CardSpec | undefined): {
|
|
52
|
+
props: {
|
|
53
|
+
ref: (el: HTMLElement | null) => void;
|
|
54
|
+
onMouseEnter: () => void;
|
|
55
|
+
onMouseLeave: () => void;
|
|
56
|
+
onMouseDown: () => void;
|
|
57
|
+
onFocus: (e: FocusEvent<HTMLElement>) => void;
|
|
58
|
+
onBlur: (e: FocusEvent<HTMLElement>) => void;
|
|
59
|
+
onKeyDown: (e: KeyboardEvent<HTMLElement>) => void;
|
|
60
|
+
"aria-describedby": string | undefined;
|
|
61
|
+
};
|
|
62
|
+
card: ReactNode;
|
|
63
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CardSpec } from "./AnnotationCard";
|
|
2
|
+
export interface BreadcrumbProps {
|
|
3
|
+
path: string;
|
|
4
|
+
onFolder: (folder: string) => void;
|
|
5
|
+
cardFor?: (segmentPath: string, isDocument: boolean) => CardSpec | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare function breadcrumbSegments(path: string): {
|
|
8
|
+
name: string;
|
|
9
|
+
path: string;
|
|
10
|
+
}[];
|
|
11
|
+
export default function Breadcrumb({ path, onFolder, cardFor }: BreadcrumbProps): import("react").JSX.Element;
|
|
@@ -14,5 +14,7 @@ export interface DocumentChunkTreeProps {
|
|
|
14
14
|
scheme?: ColorScheme;
|
|
15
15
|
documentColor?: string;
|
|
16
16
|
linkedIds?: Set<string>;
|
|
17
|
+
documentType?: string;
|
|
18
|
+
documentStatus?: string;
|
|
17
19
|
}
|
|
18
|
-
export default function DocumentChunkTree({ tree, selectedId, onSelect, colorEnabled, scheme, documentColor, linkedIds, }: DocumentChunkTreeProps): import("react").JSX.Element;
|
|
20
|
+
export default function DocumentChunkTree({ tree, selectedId, onSelect, colorEnabled, scheme, documentColor, linkedIds, documentType, documentStatus, }: DocumentChunkTreeProps): import("react").JSX.Element;
|
|
@@ -19,5 +19,12 @@ export interface DocumentViewerBodyProps {
|
|
|
19
19
|
onRegenerateAnnotation?: (target: AnnotationTarget) => void | Promise<void>;
|
|
20
20
|
canEditAnnotations?: boolean;
|
|
21
21
|
onAnnotationChanged?: () => void;
|
|
22
|
+
pathLabel?: ReactNode;
|
|
23
|
+
documentActions?: {
|
|
24
|
+
rename?: () => void;
|
|
25
|
+
transfer?: () => void;
|
|
26
|
+
delete?: () => void;
|
|
27
|
+
};
|
|
22
28
|
}
|
|
23
|
-
export default function DocumentViewerBody({ documentId, scope, titleHint, browse: browseProp, principal, renderAssistant, initialChunkId, onOpenDocument, onTitle, onChunkSelect, focusChunk, onRegenerateAnnotation, canEditAnnotations, onAnnotationChanged, }: DocumentViewerBodyProps): import("react").JSX.Element;
|
|
29
|
+
export default function DocumentViewerBody({ documentId, scope, titleHint, browse: browseProp, principal, renderAssistant, initialChunkId, onOpenDocument, onTitle, onChunkSelect, focusChunk, onRegenerateAnnotation, canEditAnnotations, onAnnotationChanged, pathLabel, documentActions, }: DocumentViewerBodyProps): import("react").JSX.Element;
|
|
30
|
+
export declare function docLink(documentId: string, scope: DocScope): string;
|
|
@@ -6,4 +6,9 @@ export interface HistoryModalProps {
|
|
|
6
6
|
browse?: BrowseScope;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
}
|
|
9
|
-
export default function HistoryModal({ chunkId, chunkTitle, scope, browse, onClose
|
|
9
|
+
export default function HistoryModal({ chunkId, chunkTitle, scope, browse, onClose }: HistoryModalProps): import("react").JSX.Element;
|
|
10
|
+
export declare function HistoryView({ chunkId, scope, browse, }: {
|
|
11
|
+
chunkId: string;
|
|
12
|
+
scope: DocScope;
|
|
13
|
+
browse?: BrowseScope;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface MoreMenuItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
danger?: boolean;
|
|
8
|
+
run: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface MoreMenuProps {
|
|
11
|
+
groups: MoreMenuItem[][];
|
|
12
|
+
busy?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
export default function MoreMenu({ groups, busy, label }: MoreMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type PaneIconKind = "tree" | "outline" | "annotation" | "references" | "classification" | "history" | "search" | "collapse-left" | "collapse-right" | "close";
|
|
2
|
+
export declare function PaneIcon({ kind }: {
|
|
3
|
+
kind: PaneIconKind;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function CollapseButton({ label, side, onClick, shortcut, }: {
|
|
6
|
+
label: string;
|
|
7
|
+
side: "left" | "right";
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
shortcut?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export declare function PaneRail({ label, icon, count, countLabel, onExpand, shortcut, side, }: {
|
|
12
|
+
label: string;
|
|
13
|
+
icon: PaneIconKind;
|
|
14
|
+
count?: number;
|
|
15
|
+
countLabel?: string;
|
|
16
|
+
onExpand: () => void;
|
|
17
|
+
shortcut?: string;
|
|
18
|
+
side: "left" | "right";
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { DirListing, DirMap } from "../lib/lazyPathTree";
|
|
2
|
+
import type { PathEntry } from "../types";
|
|
3
|
+
import type { CardSpec } from "./AnnotationCard";
|
|
2
4
|
import { type DocSummary } from "../lib/colorScheme";
|
|
3
5
|
export interface PathNode {
|
|
4
6
|
name: string;
|
|
@@ -7,9 +9,15 @@ export interface PathNode {
|
|
|
7
9
|
resourceRef?: unknown;
|
|
8
10
|
hasChildren?: boolean;
|
|
9
11
|
listing?: DirListing;
|
|
12
|
+
documents?: number;
|
|
13
|
+
documentsCapped?: boolean;
|
|
14
|
+
matched?: boolean;
|
|
10
15
|
children: PathNode[];
|
|
11
16
|
}
|
|
12
17
|
export declare function buildLazyTree(dirs: DirMap, dir?: string): PathNode[];
|
|
18
|
+
export declare function folderDocuments(e: PathEntry): number | undefined;
|
|
19
|
+
export declare function formatCount(n: number, capped?: boolean): string;
|
|
20
|
+
export declare function countLabel(n: number, capped: boolean | undefined, filtered: boolean | undefined): string;
|
|
13
21
|
export declare function isAnnotationEntry(node: Pick<PathNode, "kind" | "name">): boolean;
|
|
14
22
|
export declare function nodeBrief(node: PathNode, summaries?: Map<string, DocSummary>): string | undefined;
|
|
15
23
|
export interface PathTreeProps {
|
|
@@ -22,5 +30,10 @@ export interface PathTreeProps {
|
|
|
22
30
|
selectedPath?: string;
|
|
23
31
|
onSelect: (node: PathNode) => void;
|
|
24
32
|
summaries?: Map<string, DocSummary>;
|
|
33
|
+
searchHits?: ReadonlySet<string>;
|
|
34
|
+
searchCurrent?: string;
|
|
35
|
+
filtered?: boolean;
|
|
25
36
|
}
|
|
37
|
+
export declare function nodeCard(node: PathNode, summaries?: Map<string, DocSummary>): CardSpec;
|
|
26
38
|
export default function PathTree(props: PathTreeProps): import("react").JSX.Element;
|
|
39
|
+
export declare function documentSummaryOf(node: PathNode, summaries?: Map<string, DocSummary>): DocSummary | undefined;
|
|
@@ -7,5 +7,8 @@ export interface SplitterProps {
|
|
|
7
7
|
storageKey?: string;
|
|
8
8
|
className?: string;
|
|
9
9
|
hideRight?: boolean;
|
|
10
|
+
hideLeft?: boolean;
|
|
11
|
+
leftRail?: ReactNode;
|
|
12
|
+
onHandleDoubleClick?: () => void;
|
|
10
13
|
}
|
|
11
|
-
export default function Splitter({ children, defaultLeftWidth, minLeftWidth, minRightWidth, storageKey, className, hideRight, }: SplitterProps): import("react").JSX.Element;
|
|
14
|
+
export default function Splitter({ children, defaultLeftWidth, minLeftWidth, minRightWidth, storageKey, className, hideRight, hideLeft, leftRail, onHandleDoubleClick, }: SplitterProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CSSProperties, KeyboardEvent, ReactNode } from "react";
|
|
2
|
+
import { type CardSpec } from "./AnnotationCard";
|
|
3
|
+
export type TreeIconKind = "folder" | "document" | "volume" | "memory" | "annotation" | "image" | "diagram" | "link";
|
|
4
|
+
export declare function TreeIcon({ kind }: {
|
|
5
|
+
kind: TreeIconKind;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function TreeMarks({ type, status, statusColor, extra, bare, }: {
|
|
8
|
+
type?: string;
|
|
9
|
+
status?: string;
|
|
10
|
+
statusColor?: string;
|
|
11
|
+
extra?: ReactNode;
|
|
12
|
+
bare?: boolean;
|
|
13
|
+
}): import("react").JSX.Element | null;
|
|
14
|
+
export interface TreeItemProps {
|
|
15
|
+
depth: number;
|
|
16
|
+
expandable: boolean;
|
|
17
|
+
expanded: boolean;
|
|
18
|
+
onToggle: () => void;
|
|
19
|
+
selected: boolean;
|
|
20
|
+
onSelect: () => void;
|
|
21
|
+
tabbable: boolean;
|
|
22
|
+
icon?: ReactNode;
|
|
23
|
+
name: ReactNode;
|
|
24
|
+
title?: string;
|
|
25
|
+
marks?: ReactNode;
|
|
26
|
+
count?: ReactNode;
|
|
27
|
+
card?: CardSpec;
|
|
28
|
+
rowClassName?: string;
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
className?: string;
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare function TreeItem({ depth, expandable, expanded, onToggle, selected, onSelect, tabbable, icon, name, title, marks, count, card, rowClassName, style, className, children, }: TreeItemProps): import("react").JSX.Element;
|
|
34
|
+
export declare function treeKeyDown(e: KeyboardEvent<HTMLElement>): void;
|