@loomcycle/explorer 0.16.0 → 0.18.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 +8 -1
- package/dist/PathExplorer.d.ts +3 -1
- package/dist/components/AnnotationPanel.d.ts +12 -0
- package/dist/components/DocumentViewerBody.d.ts +5 -2
- package/dist/components/DownloadMenu.d.ts +27 -0
- package/dist/components/PathTree.d.ts +3 -0
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2071 -1569
- package/dist/index.js.map +1 -1
- package/dist/lib/annotation.d.ts +14 -0
- package/dist/lib/colorScheme.d.ts +1 -0
- package/dist/lib/dataLayer.d.ts +13 -1
- package/dist/lib/download.d.ts +30 -0
- package/dist/styles.css +194 -0
- package/dist/types.d.ts +34 -0
- package/package.json +2 -1
package/dist/DocumentViewer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { AssistantContext, BrowseScope, DocScope, Principal } from "./types";
|
|
2
|
+
import type { AnnotationTarget, AssistantContext, BrowseScope, DocScope, Principal } from "./types";
|
|
3
3
|
import { type ExplorerDataSource } from "./components/ExplorerRoot";
|
|
4
4
|
import { type DocLocation } from "./lib/docTrail";
|
|
5
5
|
export interface DocumentViewerProps extends ExplorerDataSource {
|
|
@@ -27,5 +27,12 @@ export interface DocumentViewerProps extends ExplorerDataSource {
|
|
|
27
27
|
* the document being left, with the chunk selected in it. Omit → the viewer
|
|
28
28
|
* swaps the document itself and keeps a breadcrumb trail back. */
|
|
29
29
|
onOpenDocument?: (target: DocLocation, from: DocLocation) => void;
|
|
30
|
+
/** Have an annotation written again (tenant-scope documents). The host owns
|
|
31
|
+
* how — typically by starting the annotating agent's run; the viewer reloads
|
|
32
|
+
* the annotation when the returned promise settles. Omit → no Regenerate. */
|
|
33
|
+
onRegenerateAnnotation?: (target: AnnotationTarget) => void | Promise<void>;
|
|
34
|
+
/** Whether the reader may edit annotations by hand (the operator plane; the
|
|
35
|
+
* runtime refuses anyone else). Default false: no Edit is offered. */
|
|
36
|
+
canEditAnnotations?: boolean;
|
|
30
37
|
}
|
|
31
38
|
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, NavigatorContext, PathScope, Principal } from "./types";
|
|
2
|
+
import type { AnnotationTarget, AssistantContext, BrowseScope, NavigatorContext, PathScope, Principal } from "./types";
|
|
3
3
|
import { type NavigatorMode } from "./lib/navigator";
|
|
4
4
|
import { type ExplorerDataSource } from "./components/ExplorerRoot";
|
|
5
5
|
export interface PathExplorerProps extends ExplorerDataSource {
|
|
@@ -10,6 +10,8 @@ export interface PathExplorerProps extends ExplorerDataSource {
|
|
|
10
10
|
browse?: BrowseScope;
|
|
11
11
|
principal?: Principal;
|
|
12
12
|
renderAssistant?: (ctx: AssistantContext) => ReactNode;
|
|
13
|
+
onRegenerateAnnotation?: (target: AnnotationTarget) => void | Promise<void>;
|
|
14
|
+
canEditAnnotations?: boolean;
|
|
13
15
|
renderNavigator?: (ctx: NavigatorContext) => ReactNode;
|
|
14
16
|
navigator?: NavigatorMode;
|
|
15
17
|
onError?: (e: unknown) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Annotation, AnnotationLevel } from "../types";
|
|
2
|
+
export declare function AnnotationBrief({ record }: {
|
|
3
|
+
record?: Annotation;
|
|
4
|
+
}): import("react").JSX.Element | null;
|
|
5
|
+
export interface AnnotationPanelProps {
|
|
6
|
+
records: Annotation[];
|
|
7
|
+
newLevel: AnnotationLevel;
|
|
8
|
+
onSave?: (level: AnnotationLevel, brief: string, abstract: string) => Promise<void>;
|
|
9
|
+
onRegenerate?: (level: AnnotationLevel) => Promise<void>;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export default function AnnotationPanel({ records, newLevel, onSave, onRegenerate, defaultOpen, }: AnnotationPanelProps): import("react").JSX.Element | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { AssistantContext, BrowseScope, DocScope, Principal } from "../types";
|
|
2
|
+
import type { AnnotationTarget, AssistantContext, BrowseScope, DocScope, Principal } from "../types";
|
|
3
3
|
import { type DocLocation } from "../lib/docTrail";
|
|
4
4
|
export interface DocumentViewerBodyProps {
|
|
5
5
|
documentId: string;
|
|
@@ -16,5 +16,8 @@ export interface DocumentViewerBodyProps {
|
|
|
16
16
|
chunkId?: string;
|
|
17
17
|
seq: number;
|
|
18
18
|
};
|
|
19
|
+
onRegenerateAnnotation?: (target: AnnotationTarget) => void | Promise<void>;
|
|
20
|
+
canEditAnnotations?: boolean;
|
|
21
|
+
onAnnotationChanged?: () => void;
|
|
19
22
|
}
|
|
20
|
-
export default function DocumentViewerBody({ documentId, scope, titleHint, browse: browseProp, principal, renderAssistant, initialChunkId, onOpenDocument, onTitle, onChunkSelect, focusChunk, }: DocumentViewerBodyProps): import("react").JSX.Element;
|
|
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;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BrowseScope, DocScope } from "../types";
|
|
2
|
+
import { type ExplorerDataLayer } from "../lib/dataLayer";
|
|
3
|
+
/** One entry of the document's download menu. */
|
|
4
|
+
export type DownloadKind = "pdf" | "docx" | "html" | "md" | "canvas";
|
|
5
|
+
interface DownloadEntry {
|
|
6
|
+
kind: DownloadKind;
|
|
7
|
+
label: string;
|
|
8
|
+
title: string;
|
|
9
|
+
rendered: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** The entries the menu offers for a data layer: the rendered formats only when
|
|
12
|
+
* it can fetch a rendered file. */
|
|
13
|
+
export declare function downloadEntries(data: Pick<ExplorerDataLayer, "documentExportFile">): DownloadEntry[];
|
|
14
|
+
/** Fetch one download through the data layer and hand it to the browser.
|
|
15
|
+
* .md and .canvas keep their own exports (the round-trippable Markdown with
|
|
16
|
+
* metadata comments, the canvas graph); the rest are rendered by the runtime. */
|
|
17
|
+
export declare function runDownload(data: ExplorerDataLayer, kind: DownloadKind, documentId: string, scope: DocScope, browse: BrowseScope | undefined, title: string | undefined, save?: (blob: Blob, filename: string) => void): Promise<void>;
|
|
18
|
+
export interface DownloadMenuProps {
|
|
19
|
+
documentId: string;
|
|
20
|
+
scope: DocScope;
|
|
21
|
+
browse?: BrowseScope;
|
|
22
|
+
/** The document's title, for a file name the server does not supply. */
|
|
23
|
+
title?: string;
|
|
24
|
+
onError: (message: string) => void;
|
|
25
|
+
}
|
|
26
|
+
export default function DownloadMenu({ documentId, scope, browse, title, onError }: DownloadMenuProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -5,10 +5,13 @@ export interface PathNode {
|
|
|
5
5
|
fullPath: string;
|
|
6
6
|
kind: string;
|
|
7
7
|
resourceRef?: unknown;
|
|
8
|
+
hasChildren?: boolean;
|
|
8
9
|
listing?: DirListing;
|
|
9
10
|
children: PathNode[];
|
|
10
11
|
}
|
|
11
12
|
export declare function buildLazyTree(dirs: DirMap, dir?: string): PathNode[];
|
|
13
|
+
export declare function isAnnotationEntry(node: Pick<PathNode, "kind" | "name">): boolean;
|
|
14
|
+
export declare function nodeBrief(node: PathNode, summaries?: Map<string, DocSummary>): string | undefined;
|
|
12
15
|
export interface PathTreeProps {
|
|
13
16
|
tree: PathNode[];
|
|
14
17
|
root?: DirListing;
|