@astra-spec/ui 0.0.3 → 0.0.4
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/README.md +173 -20
- package/TOKENS.md +6 -3
- package/components.css +1 -0
- package/dist/blocks/decisions-list.d.ts +0 -1
- package/dist/blocks/decisions-list.d.ts.map +1 -1
- package/dist/blocks/decisions-list.js +1 -5
- package/dist/blocks/decisions-list.js.map +1 -1
- package/dist/blocks/index.d.ts +3 -3
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/blocks/index.js +2 -2
- package/dist/blocks/index.js.map +1 -1
- package/dist/blocks/inputs-list.js +1 -1
- package/dist/blocks/inputs-list.js.map +1 -1
- package/dist/blocks/outputs-list.d.ts +2 -2
- package/dist/blocks/outputs-list.d.ts.map +1 -1
- package/dist/blocks/outputs-list.js +15 -19
- package/dist/blocks/outputs-list.js.map +1 -1
- package/dist/blocks/section.d.ts +1 -4
- package/dist/blocks/section.d.ts.map +1 -1
- package/dist/blocks/section.js +1 -12
- package/dist/blocks/section.js.map +1 -1
- package/dist/components/artifact-preview.d.ts +2 -54
- package/dist/components/artifact-preview.d.ts.map +1 -1
- package/dist/components/artifact-preview.js +2 -107
- package/dist/components/artifact-preview.js.map +1 -1
- package/dist/components/decision-detail.d.ts +1 -1
- package/dist/components/decision-detail.d.ts.map +1 -1
- package/dist/components/decision-detail.js.map +1 -1
- package/dist/components/finding-detail.d.ts +2 -2
- package/dist/components/finding-detail.d.ts.map +1 -1
- package/dist/components/finding-detail.js.map +1 -1
- package/dist/components/index.d.ts +9 -13
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +6 -8
- package/dist/components/index.js.map +1 -1
- package/dist/components/input-detail.d.ts +1 -2
- package/dist/components/input-detail.d.ts.map +1 -1
- package/dist/components/input-detail.js +0 -3
- package/dist/components/input-detail.js.map +1 -1
- package/dist/components/insight-detail.d.ts +2 -8
- package/dist/components/insight-detail.d.ts.map +1 -1
- package/dist/components/insight-detail.js +5 -11
- package/dist/components/insight-detail.js.map +1 -1
- package/dist/components/insight-trigger.d.ts +1 -1
- package/dist/components/insight-trigger.d.ts.map +1 -1
- package/dist/components/insight-trigger.js.map +1 -1
- package/dist/components/output-detail.d.ts +2 -7
- package/dist/components/output-detail.d.ts.map +1 -1
- package/dist/components/output-detail.js +3 -30
- package/dist/components/output-detail.js.map +1 -1
- package/dist/components/output-dialog.d.ts +2 -2
- package/dist/components/output-dialog.d.ts.map +1 -1
- package/dist/components/output-dialog.js +2 -1
- package/dist/components/output-dialog.js.map +1 -1
- package/dist/components/paper-detail.d.ts +14 -14
- package/dist/components/paper-detail.d.ts.map +1 -1
- package/dist/components/paper-detail.js +49 -29
- package/dist/components/paper-detail.js.map +1 -1
- package/dist/components/paper-pdf-viewer.d.ts +19 -0
- package/dist/components/paper-pdf-viewer.d.ts.map +1 -0
- package/dist/components/paper-pdf-viewer.js +250 -0
- package/dist/components/paper-pdf-viewer.js.map +1 -0
- package/dist/components/record-dialog.d.ts +7 -5
- package/dist/components/record-dialog.d.ts.map +1 -1
- package/dist/components/record-dialog.js +7 -5
- package/dist/components/record-dialog.js.map +1 -1
- package/dist/components/record-preview.d.ts +2 -2
- package/dist/components/record-preview.d.ts.map +1 -1
- package/dist/components/record-preview.js +2 -2
- package/dist/components/record-preview.js.map +1 -1
- package/dist/components/relation-items.d.ts +1 -1
- package/dist/components/relation-items.d.ts.map +1 -1
- package/dist/components/relation-items.js +10 -3
- package/dist/components/relation-items.js.map +1 -1
- package/dist/{components/use-detail-stack.d.ts → lib/detail-stack.d.ts} +17 -2
- package/dist/lib/detail-stack.d.ts.map +1 -0
- package/dist/{components/use-detail-stack.js → lib/detail-stack.js} +15 -2
- package/dist/lib/detail-stack.js.map +1 -0
- package/dist/lib/index.d.ts +14 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +9 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/labels.d.ts +20 -0
- package/dist/lib/labels.d.ts.map +1 -1
- package/dist/lib/labels.js +20 -0
- package/dist/lib/labels.js.map +1 -1
- package/dist/lib/pdf-quote.d.ts +47 -0
- package/dist/lib/pdf-quote.d.ts.map +1 -0
- package/dist/lib/pdf-quote.js +154 -0
- package/dist/lib/pdf-quote.js.map +1 -0
- package/dist/lib/pdf-runtime.d.ts +102 -0
- package/dist/lib/pdf-runtime.d.ts.map +1 -0
- package/dist/lib/pdf-runtime.js +48 -0
- package/dist/lib/pdf-runtime.js.map +1 -0
- package/dist/lib/preview-data.d.ts +55 -0
- package/dist/lib/preview-data.d.ts.map +1 -0
- package/dist/lib/preview-data.js +108 -0
- package/dist/lib/preview-data.js.map +1 -0
- package/dist/lib/prose.d.ts +37 -0
- package/dist/lib/prose.d.ts.map +1 -0
- package/dist/lib/prose.js +60 -0
- package/dist/lib/prose.js.map +1 -0
- package/dist/lib/use-isomorphic-layout-effect.d.ts +4 -0
- package/dist/lib/use-isomorphic-layout-effect.d.ts.map +1 -0
- package/dist/lib/use-isomorphic-layout-effect.js +4 -0
- package/dist/lib/use-isomorphic-layout-effect.js.map +1 -0
- package/dist/lib/use-output-expanded.d.ts +7 -0
- package/dist/lib/use-output-expanded.d.ts.map +1 -0
- package/dist/lib/use-output-expanded.js +29 -0
- package/dist/lib/use-output-expanded.js.map +1 -0
- package/dist/model/index.d.ts +5 -3
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +3 -2
- package/dist/model/index.js.map +1 -1
- package/dist/{primitives → model}/kind.d.ts +3 -0
- package/dist/model/kind.d.ts.map +1 -0
- package/dist/model/kind.js +25 -0
- package/dist/model/kind.js.map +1 -0
- package/dist/model/papers.d.ts +6 -6
- package/dist/model/papers.d.ts.map +1 -1
- package/dist/model/papers.js +8 -0
- package/dist/model/papers.js.map +1 -1
- package/dist/model/records.d.ts +5 -1
- package/dist/model/records.d.ts.map +1 -1
- package/dist/model/records.js +9 -0
- package/dist/model/records.js.map +1 -1
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/badge.d.ts.map +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/button.js.map +1 -1
- package/dist/primitives/dialog.d.ts +1 -1
- package/dist/primitives/dialog.d.ts.map +1 -1
- package/dist/primitives/dialog.js +3 -3
- package/dist/primitives/dialog.js.map +1 -1
- package/dist/primitives/index.d.ts +4 -9
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +2 -5
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/preview-popover.d.ts +1 -1
- package/dist/primitives/preview-popover.d.ts.map +1 -1
- package/dist/primitives/preview-popover.js +1 -1
- package/dist/primitives/preview-popover.js.map +1 -1
- package/dist/primitives/prose.d.ts +1 -35
- package/dist/primitives/prose.d.ts.map +1 -1
- package/dist/primitives/prose.js +2 -58
- package/dist/primitives/prose.js.map +1 -1
- package/dist/primitives/record-list.d.ts +1 -1
- package/dist/primitives/record-list.d.ts.map +1 -1
- package/dist/primitives/record-list.js +1 -1
- package/dist/primitives/record-list.js.map +1 -1
- package/dist/primitives/relation-list.d.ts +1 -1
- package/dist/primitives/relation-list.d.ts.map +1 -1
- package/dist/primitives/relation-list.js +1 -1
- package/dist/primitives/relation-list.js.map +1 -1
- package/dist/primitives/slot.d.ts.map +1 -0
- package/dist/{lib → primitives}/slot.js +1 -1
- package/dist/primitives/slot.js.map +1 -0
- package/dist/primitives/surface-header.d.ts +1 -1
- package/dist/primitives/surface-header.d.ts.map +1 -1
- package/dist/views/inventory.d.ts +7 -5
- package/dist/views/inventory.d.ts.map +1 -1
- package/dist/views/inventory.js +5 -4
- package/dist/views/inventory.js.map +1 -1
- package/package.json +11 -1
- package/src/blocks/decisions-list.tsx +1 -6
- package/src/blocks/index.ts +2 -3
- package/src/blocks/inputs-list.tsx +1 -1
- package/src/blocks/outputs-list.tsx +53 -30
- package/src/blocks/section.tsx +1 -14
- package/src/components/artifact-preview.tsx +6 -161
- package/src/components/decision-detail.tsx +2 -1
- package/src/components/finding-detail.tsx +3 -2
- package/src/components/index.ts +10 -30
- package/src/components/input-detail.tsx +2 -5
- package/src/components/insight-detail.tsx +20 -35
- package/src/components/insight-trigger.tsx +2 -1
- package/src/components/output-detail.tsx +17 -38
- package/src/components/output-dialog.tsx +4 -3
- package/src/components/paper-detail.tsx +121 -66
- package/src/components/paper-pdf-viewer.tsx +319 -0
- package/src/components/record-dialog.tsx +15 -10
- package/src/components/record-preview.tsx +5 -4
- package/src/components/relation-items.ts +15 -5
- package/src/{components/use-detail-stack.ts → lib/detail-stack.ts} +24 -1
- package/src/lib/index.ts +22 -0
- package/src/lib/labels.tsx +40 -0
- package/src/lib/pdf-quote.ts +189 -0
- package/src/lib/pdf-runtime.ts +131 -0
- package/src/lib/preview-data.ts +155 -0
- package/src/lib/prose.tsx +87 -0
- package/src/lib/use-isomorphic-layout-effect.ts +4 -0
- package/src/lib/use-output-expanded.ts +27 -0
- package/src/model/index.ts +4 -2
- package/src/{primitives → model}/kind.ts +14 -0
- package/src/model/papers.ts +9 -7
- package/src/model/records.ts +12 -0
- package/src/primitives/badge.tsx +1 -1
- package/src/primitives/button.tsx +1 -1
- package/src/primitives/dialog.tsx +3 -5
- package/src/primitives/index.ts +4 -17
- package/src/primitives/preview-popover.tsx +2 -2
- package/src/primitives/prose.tsx +1 -86
- package/src/primitives/record-list.tsx +1 -1
- package/src/primitives/relation-list.tsx +1 -1
- package/src/{lib → primitives}/slot.tsx +1 -1
- package/src/primitives/surface-header.tsx +1 -1
- package/src/views/inventory.tsx +12 -8
- package/styles/blocks/analysis-tree.css +2 -2
- package/styles/blocks/decisions-list.css +4 -4
- package/styles/blocks/outputs-list.css +246 -19
- package/styles/blocks/papers-list.css +2 -2
- package/styles/components/artifact-preview.css +6 -6
- package/styles/components/decision-detail.css +2 -2
- package/styles/components/evidence.css +2 -2
- package/styles/components/input-detail.css +4 -4
- package/styles/components/insight-detail.css +56 -94
- package/styles/components/insight-list.css +3 -3
- package/styles/components/insight-trigger.css +1 -4
- package/styles/components/output-detail.css +25 -140
- package/styles/components/paper-detail.css +76 -95
- package/styles/components/paper-doi.css +3 -12
- package/styles/components/paper-pdf-viewer.css +120 -0
- package/styles/components/record-preview.css +10 -10
- package/styles/primitives/badge.css +1 -1
- package/styles/primitives/count-heading.css +2 -2
- package/styles/primitives/detail-layout.css +5 -5
- package/styles/primitives/dialog.css +9 -9
- package/styles/primitives/record-list.css +17 -17
- package/styles/primitives/relation-list.css +6 -6
- package/styles/primitives/surface-header.css +5 -5
- package/styles/tokens.css +11 -3
- package/styles/views/inventory.css +3 -3
- package/dist/components/detail-entry.d.ts +0 -15
- package/dist/components/detail-entry.d.ts.map +0 -1
- package/dist/components/detail-entry.js +0 -14
- package/dist/components/detail-entry.js.map +0 -1
- package/dist/components/use-detail-stack.d.ts.map +0 -1
- package/dist/components/use-detail-stack.js.map +0 -1
- package/dist/lib/slot.d.ts.map +0 -1
- package/dist/lib/slot.js.map +0 -1
- package/dist/primitives/kind.d.ts.map +0 -1
- package/dist/primitives/kind.js +0 -14
- package/dist/primitives/kind.js.map +0 -1
- package/src/components/detail-entry.ts +0 -19
- /package/dist/{lib → primitives}/slot.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-detail.d.ts","sourceRoot":"","sources":["../../src/components/output-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"output-detail.d.ts","sourceRoot":"","sources":["../../src/components/output-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAA8C,KAAK,cAAc,EAAkB,MAAM,OAAO,CAAC;AACxG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG/E,OAAO,KAAK,EAAE,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AE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,EAAE,wBAAwB,+BAuB3H"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useEffect, useRef
|
|
2
|
+
import { forwardRef, useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import { isVisualOutput, recordTitle } from '../model/records.js';
|
|
4
4
|
import { cn } from '../lib/cn.js';
|
|
5
5
|
import { useLabels } from '../lib/labels.js';
|
|
@@ -81,9 +81,9 @@ export const OutputDetail = forwardRef(function OutputDetail({ record: output, r
|
|
|
81
81
|
opener.focus();
|
|
82
82
|
};
|
|
83
83
|
}, [expanded]);
|
|
84
|
-
const supportingDetails = (_jsxs("aside", { className: "astra-output-detail__provenance", "aria-label": "Output provenance and dependencies", children: [output.description ? (_jsxs("section", { className: "astra-output-detail__description", children: [_jsx("h4", { children: "Description" }), _jsx("div", { className: "astra-output-detail__description-text", children: _jsx(Prose, { text: output.description, field: "description", renderText: renderText }) })] })) : null, output.recipe?.command ? (_jsxs("section", { className: "astra-output-detail__recipe", children: [_jsx("h4", { children: "Recipe" }), _jsx("pre", { children: _jsx("code", { children: output.recipe.command }) }), output.recipe.container
|
|
84
|
+
const supportingDetails = (_jsxs("aside", { className: "astra-output-detail__provenance", "aria-label": "Output provenance and dependencies", children: [output.description ? (_jsxs("section", { className: "astra-output-detail__description", children: [_jsx("h4", { children: "Description" }), _jsx("div", { className: "astra-output-detail__description-text", children: _jsx(Prose, { text: output.description, field: "description", renderText: renderText }) })] })) : null, output.resolvedFrom ? (_jsx(RelationList, { className: "astra-detail__relations", title: "Resolved alias", items: relationItemsForLinks([relations.alias ?? { canonicalPath: output.resolvedFrom }], onOpenRecord), empty: null })) : null, _jsx(RelationList, { className: "astra-detail__relations", title: "Decision dependencies", items: relationItemsForLinks(relations.decisions, onOpenRecord), empty: "No decision dependencies are declared for this output." }), relations.indirectDecisions?.length ? (_jsx(RelationList, { className: "astra-detail__relations", title: "Indirect decision dependencies", items: relationItemsForLinks(relations.indirectDecisions, onOpenRecord), empty: null })) : null, _jsx(RelationList, { className: "astra-detail__relations", title: "Inputs and upstream outputs", items: relationItemsForLinks(relations.inputs, onOpenRecord).map((item) => (item.kind === 'output' ? { ...item, detail: 'intermediate output' } : item)), empty: "No upstream dependencies are declared for this output." }), output.recipe?.command ? (_jsxs("section", { className: "astra-output-detail__recipe", children: [_jsx("h4", { children: "Recipe" }), _jsx("pre", { children: _jsx("code", { children: output.recipe.command }) }), output.recipe.container
|
|
85
85
|
? _jsxs("p", { children: ["Container: ", _jsx("code", { children: output.recipe.container })] })
|
|
86
|
-
: null] })) : null
|
|
86
|
+
: null] })) : null] }));
|
|
87
87
|
return (_jsxs("div", { "data-slot": "output-detail", ...props, ref: ref, className: cn('astra-output-detail__layout', className), "data-layout": visual ? 'reader' : 'single', children: [_jsxs("div", { className: "astra-output-detail__result", children: [artifact != null ? (_jsxs("div", { ref: layerRef, className: "astra-output-detail__artifact", "data-type": output.type, ...(expanded
|
|
88
88
|
? { 'data-expanded': '', role: 'dialog', 'aria-modal': 'true', 'aria-label': `Full-screen ${output.type}: ${recordTitle(output)}` }
|
|
89
89
|
: {}), children: [expanded ? (_jsxs("div", { className: "astra-output-detail__fullscreen-header", children: [_jsxs("span", { children: [_jsx("small", { children: labels.actions.fullScreen }), _jsx("strong", { children: recordTitle(output) })] }), _jsxs("button", { type: "button", onClick: () => onExpandedChange?.(false), children: [_jsx("span", { "aria-hidden": "true", children: "\u00D7" }), _jsx("span", { children: labels.actions.exitFullScreen })] })] })) : null, _jsx("div", { className: "astra-output-detail__preview", "data-type": output.type, children: artifact })] })) : null, !visual ? supportingDetails : null] }), visual ? _jsx("div", { className: "astra-output-detail__provenance-slot", children: supportingDetails }) : null] }));
|
|
@@ -94,31 +94,4 @@ export function OutputDialogActions({ record: output, onOpenArtifact, expanded,
|
|
|
94
94
|
const visual = isVisualOutput(output);
|
|
95
95
|
return (_jsxs(_Fragment, { children: [onOpenArtifact && output.artifact ? (_jsxs(DialogAction, { onClick: () => { void onOpenArtifact(output); }, children: [_jsx("span", { "aria-hidden": "true", children: "\u2197" }), _jsx("span", { children: labels.actions.openArtifact })] })) : null, visual ? (_jsxs(DialogAction, { "aria-label": `View ${output.type} full screen`, "aria-expanded": expanded, onClick: () => { onExpandedChange(true); }, children: [_jsx("span", { "aria-hidden": "true", children: "\u26F6" }), _jsx("span", { children: labels.actions.fullScreen })] })) : null] }));
|
|
96
96
|
}
|
|
97
|
-
/** Full-screen state for an output, reset whenever the output changes (a controlled host is asked to reset). */
|
|
98
|
-
export function useOutputExpanded(output, controlled) {
|
|
99
|
-
const [internal, setInternal] = useState(false);
|
|
100
|
-
const [lastPath, setLastPath] = useState(output.canonicalPath);
|
|
101
|
-
if (lastPath !== output.canonicalPath) {
|
|
102
|
-
setLastPath(output.canonicalPath);
|
|
103
|
-
setInternal(false);
|
|
104
|
-
}
|
|
105
|
-
const isControlled = controlled?.expanded !== undefined;
|
|
106
|
-
const expanded = isControlled ? Boolean(controlled.expanded) : internal;
|
|
107
|
-
const onChange = controlled?.onExpandedChange;
|
|
108
|
-
const seenPath = useRef(output.canonicalPath);
|
|
109
|
-
const controlledExpanded = isControlled && Boolean(controlled.expanded);
|
|
110
|
-
useEffect(() => {
|
|
111
|
-
if (seenPath.current === output.canonicalPath)
|
|
112
|
-
return;
|
|
113
|
-
seenPath.current = output.canonicalPath;
|
|
114
|
-
if (controlledExpanded)
|
|
115
|
-
onChange?.(false);
|
|
116
|
-
}, [output.canonicalPath, controlledExpanded, onChange]);
|
|
117
|
-
const setExpanded = useCallback((next) => {
|
|
118
|
-
if (!isControlled)
|
|
119
|
-
setInternal(next);
|
|
120
|
-
onChange?.(next);
|
|
121
|
-
}, [isControlled, onChange]);
|
|
122
|
-
return [expanded, setExpanded];
|
|
123
|
-
}
|
|
124
97
|
//# sourceMappingURL=output-detail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-detail.js","sourceRoot":"","sources":["../../src/components/output-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"output-detail.js","sourceRoot":"","sources":["../../src/components/output-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAuC,MAAM,OAAO,CAAC;AAExG,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAyB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAS5D,yEAAyE;AACzE,MAAM,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,cAAc,EAAsB;IAC3F,OAAO,cAAc;QACnB,CAAC,CAAC,4BAAG,cAAc,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,GAAI;QAC5C,CAAC,CAAC,KAAC,eAAe,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,MAAsB,EAAE,cAA4C;IACxF,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,C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MAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,aAC3D,8BAAkB,MAAM,uBAAS,EACjC,yBAAO,MAAM,CAAC,OAAO,CAAC,YAAY,GAAQ,IAC7B,CAChB,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,CAAC,CAAC,CACR,MAAC,YAAY,kBACC,QAAQ,MAAM,CAAC,IAAI,cAAc,mBAC9B,QAAQ,EACvB,OAAO,EAAE,GAAG,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAE1C,8BAAkB,MAAM,uBAAS,EACjC,yBAAO,MAAM,CAAC,OAAO,CAAC,UAAU,GAAQ,IAC3B,CAChB,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -2,8 +2,8 @@ import type { ResolvedOutput } from '@astra-spec/sdk';
|
|
|
2
2
|
import type { OutputRelations } from '../model/relations.js';
|
|
3
3
|
import type { ArtifactRenderer } from './artifact-preview.js';
|
|
4
4
|
import { type DetailDialogProps } from '../primitives/dialog.js';
|
|
5
|
-
import type { TextRenderer } from '../
|
|
6
|
-
import type { OpenRecordHandler } from '
|
|
5
|
+
import type { TextRenderer } from '../lib/prose.js';
|
|
6
|
+
import type { OpenRecordHandler } from '../lib/detail-stack.js';
|
|
7
7
|
export interface OutputDialogProps extends Pick<DetailDialogProps, 'mode' | 'backText' | 'className' | 'onBack' | 'onClose'> {
|
|
8
8
|
record: ResolvedOutput;
|
|
9
9
|
relations: OutputRelations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-dialog.d.ts","sourceRoot":"","sources":["../../src/components/output-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAA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3B,MAAM,EAAE,MAAM,EACd,SAAS,EACT,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EAAE,kBAAkB,EAC5B,gBAAgB,EAChB,GAAG,MAAM,EACV,EAAE,iBAAiB,+BA+BnB"}
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { isVisualOutput, recordTitle } from '../model/records.js';
|
|
3
3
|
import { useLabels } from '../lib/labels.js';
|
|
4
4
|
import { DetailDialog } from '../primitives/dialog.js';
|
|
5
|
-
import { OutputDetail, OutputDialogActions
|
|
5
|
+
import { OutputDetail, OutputDialogActions } from './output-detail.js';
|
|
6
|
+
import { useOutputExpanded } from '../lib/use-output-expanded.js';
|
|
6
7
|
export function OutputDialog({ record: output, relations, renderArtifact, renderText, onOpenArtifact, onOpenRecord, expanded: controlledExpanded, onExpandedChange, ...dialog }) {
|
|
7
8
|
const labels = useLabels();
|
|
8
9
|
const [expanded, setExpanded] = useOutputExpanded(output, { expanded: controlledExpanded, onExpandedChange });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-dialog.js","sourceRoot":"","sources":["../../src/components/output-dialog.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"output-dialog.js","sourceRoot":"","sources":["../../src/components/output-dialog.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAA0B,MAAM,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, ResolvedInsight } from '@astra-spec/sdk';
|
|
2
|
-
import { type HTMLAttributes
|
|
3
|
-
import { type InventoryPaper, type InventoryPaperMetadata
|
|
2
|
+
import { type HTMLAttributes } from 'react';
|
|
3
|
+
import { type InventoryPaper, type InventoryPaperMetadata } from '../model/papers.js';
|
|
4
4
|
import { type DetailDialogProps } from '../primitives/dialog.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
/** Host slot for PDF, HTML, or any other paper presentation. */
|
|
10
|
-
export type PaperRenderer = (paper: InventoryPaper, options: PaperRenderOptions) => ReactNode;
|
|
5
|
+
import type { TextRenderer } from '../lib/prose.js';
|
|
6
|
+
import type { PdfJsLoader } from '../lib/pdf-runtime.js';
|
|
7
|
+
export type OpenPaperFileHandler = (paper: InventoryPaper) => void | Promise<void>;
|
|
11
8
|
export interface PaperDetailProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
12
9
|
record: InventoryPaper;
|
|
13
10
|
/** Fetch state for this DOI, if the host tracks it. */
|
|
14
11
|
metadata?: Pick<InventoryPaperMetadata, 'status' | 'error'> | undefined;
|
|
15
|
-
/** Insight whose first quoted passage is
|
|
12
|
+
/** Insight whose first quoted passage is located initially. */
|
|
16
13
|
focusInsight?: ResolvedInsight | undefined;
|
|
17
14
|
renderText?: TextRenderer | undefined;
|
|
18
|
-
|
|
15
|
+
/** Supplies pdf.js; with it and a `pdfUrl`, the paper is read in place and its passages located. */
|
|
16
|
+
loadPdfJs?: PdfJsLoader | undefined;
|
|
19
17
|
/** Notify the host to fetch this DOI; refreshed metadata returns through props. */
|
|
20
18
|
onFetchPaper?: ((doi: string) => void) | undefined;
|
|
21
19
|
onOpenInsight?: ((insight: ResolvedInsight) => void) | undefined;
|
|
22
20
|
onOpenDecision?: ((decision: ResolvedDecision) => void) | undefined;
|
|
23
21
|
}
|
|
24
|
-
/**
|
|
22
|
+
/** PDF paper content beside the insights and decisions it supports. */
|
|
25
23
|
export declare const PaperDetail: import("react").ForwardRefExoticComponent<PaperDetailProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
24
|
export interface PaperDialogProps extends Pick<DetailDialogProps, 'mode' | 'backText' | 'className' | 'onBack' | 'onClose'>, Omit<PaperDetailProps, 'className'> {
|
|
25
|
+
onOpenPaperFile?: OpenPaperFileHandler | undefined;
|
|
27
26
|
}
|
|
28
|
-
/** Header action linking to the paper's hosted content, when there is
|
|
27
|
+
/** Header action linking to the paper's hosted content, or to its DOI when there is none. */
|
|
29
28
|
export interface PaperDialogActionsProps {
|
|
30
29
|
record: InventoryPaper;
|
|
30
|
+
onOpenPaperFile?: OpenPaperFileHandler | undefined;
|
|
31
31
|
}
|
|
32
|
-
export declare function PaperDialogActions({ record: paper }: PaperDialogActionsProps): import("react").JSX.Element
|
|
33
|
-
export declare function PaperDialog({ record: paper, metadata, focusInsight, renderText,
|
|
32
|
+
export declare function PaperDialogActions({ record: paper, onOpenPaperFile }: PaperDialogActionsProps): import("react").JSX.Element;
|
|
33
|
+
export declare function PaperDialog({ record: paper, metadata, focusInsight, renderText, loadPdfJs, onFetchPaper, onOpenInsight, onOpenDecision, onOpenPaperFile, ...dialog }: PaperDialogProps): import("react").JSX.Element;
|
|
34
34
|
//# sourceMappingURL=paper-detail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paper-detail.d.ts","sourceRoot":"","sources":["../../src/components/paper-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"paper-detail.d.ts","sourceRoot":"","sources":["../../src/components/paper-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAoB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAsD,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIhG,OAAO,EAAiB,KAAK,cAAc,EAAE,KAAK,sBAAsB,EAAE,MAAM,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AC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CACpD;AAED,6FAA6F;AAC7F,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,cAAc,CAAC;IACvB,eAAe,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CACpD;AAED,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,uBAAuB,+BAgB7F;AAED,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EAAE,KAAK,EACb,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,EACf,GAAG,MAAM,EACV,EAAE,gBAAgB,+BAwBlB"}
|
|
@@ -1,60 +1,80 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useCallback, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { doiHref } from '../model/doi.js';
|
|
4
|
-
import { countLabel } from '../model/records.js';
|
|
4
|
+
import { countLabel, recordTitle } from '../model/records.js';
|
|
5
|
+
import { decisionInsightPaths } from '../model/relations.js';
|
|
5
6
|
import { paperEvidence } from '../model/papers.js';
|
|
6
7
|
import { cn } from '../lib/cn.js';
|
|
7
8
|
import { useLabels } from '../lib/labels.js';
|
|
8
9
|
import { CountHeading } from '../primitives/detail-layout.js';
|
|
9
10
|
import { DetailDialog, DialogAction } from '../primitives/dialog.js';
|
|
10
|
-
import {
|
|
11
|
-
import { RelationList } from '../primitives/relation-list.js';
|
|
11
|
+
import { surfaceGlyph } from '../model/kind.js';
|
|
12
12
|
import { InsightTrigger } from './insight-trigger.js';
|
|
13
|
-
import {
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
return undefined;
|
|
17
|
-
const evidence = paperEvidence(focusInsight, paper.doi)[0];
|
|
18
|
-
return evidence?.quote ? { key: `${focusInsight.canonicalPath}-source`, insight: focusInsight, evidence } : undefined;
|
|
13
|
+
import { PaperPdfViewer } from './paper-pdf-viewer.js';
|
|
14
|
+
function passageFor(key, evidence) {
|
|
15
|
+
return { key, quote: evidence.quote?.exact, page: evidence.location?.page };
|
|
19
16
|
}
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
function initialPassage(paper, focusInsight) {
|
|
18
|
+
const evidence = focusInsight ? paperEvidence(focusInsight, paper.doi)[0] : undefined;
|
|
19
|
+
return focusInsight && evidence ? passageFor(`${focusInsight.canonicalPath}-source`, evidence) : undefined;
|
|
20
|
+
}
|
|
21
|
+
/** PDF paper content beside the insights and decisions it supports. */
|
|
22
|
+
export const PaperDetail = forwardRef(function PaperDetail({ record: paper, metadata, focusInsight, renderText, loadPdfJs, onFetchPaper, onOpenInsight, onOpenDecision, className, ...props }, ref) {
|
|
22
23
|
const labels = useLabels();
|
|
23
24
|
const [focusKey, setFocusKey] = useState(undefined);
|
|
24
25
|
const [override, setOverride] = useState(undefined);
|
|
26
|
+
const [decisionFilter, setDecisionFilter] = useState(undefined);
|
|
27
|
+
// Keyed by URL so a failure for one paper never outlives it inside a persistent dialog.
|
|
28
|
+
const [failedPdfUrl, setFailedPdfUrl] = useState(undefined);
|
|
25
29
|
const key = `${paper.doi}|${focusInsight?.canonicalPath ?? ''}`;
|
|
26
30
|
if (focusKey !== key) {
|
|
27
31
|
setFocusKey(key);
|
|
28
32
|
setOverride(undefined);
|
|
33
|
+
setDecisionFilter(undefined);
|
|
29
34
|
}
|
|
30
|
-
// One object per request, kept across unrelated re-renders, with a
|
|
31
|
-
// that changes on every locate click so a
|
|
32
|
-
//
|
|
33
|
-
const
|
|
35
|
+
// One passage object per request, kept across unrelated re-renders, with a
|
|
36
|
+
// key that changes on every locate click so repeating a passage is still a
|
|
37
|
+
// new request to the viewer.
|
|
38
|
+
const passage = useMemo(() => override ?? initialPassage(paper, focusInsight), [override, paper, focusInsight]);
|
|
34
39
|
const sequence = useRef(0);
|
|
40
|
+
const canLocate = Boolean(paper.pdfUrl && loadPdfJs) && failedPdfUrl !== paper.pdfUrl;
|
|
35
41
|
const locate = useCallback((insight, evidence) => {
|
|
36
42
|
sequence.current += 1;
|
|
37
|
-
setOverride(
|
|
43
|
+
setOverride(passageFor(`${insight.canonicalPath}-${sequence.current}`, evidence));
|
|
38
44
|
}, []);
|
|
39
|
-
const canRender = Boolean(paper.pdfUrl && renderPaper);
|
|
40
45
|
const fetching = metadata?.status === 'fetching';
|
|
41
|
-
|
|
46
|
+
const filterDecision = paper.decisions.find((decision) => decision.canonicalPath === decisionFilter);
|
|
47
|
+
const visibleInsights = useMemo(() => {
|
|
48
|
+
if (!filterDecision)
|
|
49
|
+
return paper.insights;
|
|
50
|
+
const cited = new Set(decisionInsightPaths(filterDecision));
|
|
51
|
+
return paper.insights.filter((insight) => cited.has(insight.canonicalPath));
|
|
52
|
+
}, [paper, filterDecision]);
|
|
53
|
+
return (_jsxs("div", { "data-slot": "paper-detail", ...props, ref: ref, className: cn('astra-paper-detail__layout', className), children: [_jsx("div", { className: "astra-paper-detail__artifact", children: paper.pdfUrl && loadPdfJs ? (_jsx(PaperPdfViewer, { pdfUrl: paper.pdfUrl, title: paper.title, passage: passage, loadPdfJs: loadPdfJs, onLoadStateChange: (state) => { setFailedPdfUrl(state === 'error' ? paper.pdfUrl : undefined); } })) : (_jsx("div", { className: "astra-paper-detail__unavailable", ...(fetching ? { 'aria-busy': true } : {}), children: !paper.pdfUrl && onFetchPaper ? (_jsxs(_Fragment, { children: [_jsx("p", { ...(metadata?.status === 'error' ? { role: 'alert' } : {}), children: metadata?.status === 'error'
|
|
42
54
|
? (metadata.error ?? 'The paper could not be fetched.')
|
|
43
55
|
: 'No paper content is available from this host.' }), _jsx("button", { type: "button", disabled: fetching, onClick: () => { onFetchPaper(paper.doi); }, children: labels.actions.fetchPaper })] })) : (_jsx("p", { children: paper.pdfUrl
|
|
44
|
-
?
|
|
45
|
-
:
|
|
56
|
+
? labels.pdf.unavailable
|
|
57
|
+
: _jsxs(_Fragment, { children: ["Follow the ", _jsx("a", { href: doiHref(paper.doi), target: "_blank", rel: "noreferrer", children: "DOI" }), " for the published version."] }) })) })) }), _jsxs("aside", { className: "astra-paper-detail__rail", "aria-label": "Paper insights and decisions", children: [_jsxs("section", { className: "astra-paper-decisions", children: [_jsx(CountHeading, { title: "Informs decisions", count: paper.decisions.length }), paper.decisions.length ? (_jsx("div", { className: "astra-paper-decisions__filters", role: "group", "aria-label": "Filter insights by decision", children: paper.decisions.map((decision) => {
|
|
58
|
+
const active = decision.canonicalPath === decisionFilter;
|
|
59
|
+
return (_jsxs("button", { type: "button", className: "astra-paper-decisions__filter", "aria-pressed": active, onClick: () => {
|
|
60
|
+
setDecisionFilter(active ? undefined : decision.canonicalPath);
|
|
61
|
+
}, children: [_jsx("span", { "aria-hidden": "true", children: surfaceGlyph('decision') }), _jsx("span", { children: recordTitle(decision) })] }, decision.canonicalPath));
|
|
62
|
+
}) })) : (_jsx("p", { className: "astra-paper-decisions__empty", children: "No decisions cite insights from this paper." })), filterDecision && onOpenDecision ? (_jsxs("button", { type: "button", className: "astra-paper-decisions__open", onClick: () => { onOpenDecision(filterDecision); }, children: ["Open ", recordTitle(filterDecision), " \u2192"] })) : null] }), _jsxs("section", { className: "astra-insight-list", children: [_jsx(CountHeading, { title: filterDecision ? `Insights for ${recordTitle(filterDecision)}` : 'Insights from this paper', count: visibleInsights.length }), _jsx("ul", { className: "astra-evidence astra-paper-detail__insights", children: visibleInsights.map((insight) => {
|
|
46
63
|
const evidence = paperEvidence(insight, paper.doi);
|
|
47
|
-
return (_jsxs("li", { className: "astra-evidence__item astra-paper-insight", children: [_jsx(InsightTrigger, { insight: insight,
|
|
48
|
-
|
|
64
|
+
return (_jsxs("li", { className: "astra-evidence__item astra-paper-insight", children: [_jsx(InsightTrigger, { insight: insight, variant: "claim", renderText: renderText, onOpen: () => onOpenInsight?.(insight) }), evidence.length ? (_jsxs("div", { className: "astra-paper-insight__sources", children: [_jsx("span", { children: countLabel(evidence.length, 'passage') }), paper.pdfUrl && loadPdfJs ? (_jsx("div", { children: evidence.map((source, index) => (
|
|
65
|
+
// Kept focusable after a load failure so keyboard focus never drops out of the dialog.
|
|
66
|
+
_jsxs("button", { type: "button", className: "astra-paper-insight__locate", "aria-disabled": canLocate ? undefined : true, onClick: () => { if (canLocate)
|
|
67
|
+
locate(insight, source); }, "aria-label": labels.pdf.locatePassage(index + 1), children: [labels.actions.locate, evidence.length > 1 ? ` ${index + 1}` : ''] }, `${insight.canonicalPath}-${index}`))) })) : null] })) : null] }, insight.canonicalPath));
|
|
68
|
+
}) })] })] })] }));
|
|
49
69
|
});
|
|
50
|
-
export function PaperDialogActions({ record: paper }) {
|
|
70
|
+
export function PaperDialogActions({ record: paper, onOpenPaperFile }) {
|
|
51
71
|
const labels = useLabels();
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
54
|
-
return (_jsx(DialogAction, { asChild: true, children: _jsxs("a", { href: paper.pdfUrl, target: "_blank", rel: "noreferrer", children: [_jsx("span", { "aria-hidden": "true", children: "\u2197" }), _jsx("span", { children: labels.actions.openPaper })] }) }));
|
|
72
|
+
if (paper.pdfUrl && onOpenPaperFile)
|
|
73
|
+
return (_jsxs(DialogAction, { onClick: () => { void onOpenPaperFile(paper); }, children: [_jsx("span", { "aria-hidden": "true", children: "\u2197" }), _jsx("span", { children: labels.actions.openPaper })] }));
|
|
74
|
+
return (_jsx(DialogAction, { asChild: true, children: _jsxs("a", { href: paper.pdfUrl ?? doiHref(paper.doi), target: "_blank", rel: "noreferrer", children: [_jsx("span", { "aria-hidden": "true", children: "\u2197" }), _jsx("span", { children: labels.actions.openPaper })] }) }));
|
|
55
75
|
}
|
|
56
|
-
export function PaperDialog({ record: paper, metadata, focusInsight, renderText,
|
|
76
|
+
export function PaperDialog({ record: paper, metadata, focusInsight, renderText, loadPdfJs, onFetchPaper, onOpenInsight, onOpenDecision, onOpenPaperFile, ...dialog }) {
|
|
57
77
|
const labels = useLabels();
|
|
58
|
-
return (_jsx(DetailDialog, { ...dialog, kind: "paper", layout: "reader", kindLabel: labels.kinds.paper, title: paper.title, closeLabel: labels.closeRecord(labels.kinds.paper), actions: _jsx(PaperDialogActions, { record: paper }), children: _jsx(PaperDetail, { record: paper, metadata: metadata, focusInsight: focusInsight, renderText: renderText,
|
|
78
|
+
return (_jsx(DetailDialog, { ...dialog, kind: "paper", layout: "reader", kindLabel: labels.kinds.paper, title: paper.title, closeLabel: labels.closeRecord(labels.kinds.paper), actions: _jsx(PaperDialogActions, { record: paper, onOpenPaperFile: onOpenPaperFile }), children: _jsx(PaperDetail, { record: paper, metadata: metadata, focusInsight: focusInsight, renderText: renderText, loadPdfJs: loadPdfJs, onFetchPaper: onFetchPaper, onOpenInsight: onOpenInsight, onOpenDecision: onOpenDecision }) }));
|
|
59
79
|
}
|
|
60
80
|
//# sourceMappingURL=paper-detail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paper-detail.js","sourceRoot":"","sources":["../../src/components/paper-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"paper-detail.js","sourceRoot":"","sources":["../../src/components/paper-detail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAoD,MAAM,oBAAoB,CAAC;AACrG,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CA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19 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { type PdfPassage } from '../lib/pdf-quote.js';
|
|
3
|
+
import type { PdfJsLoader } from '../lib/pdf-runtime.js';
|
|
4
|
+
export type { PdfPassage } from '../lib/pdf-quote.js';
|
|
5
|
+
export type PdfLoadState = 'loading' | 'ready' | 'error';
|
|
6
|
+
export interface PaperPdfViewerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
7
|
+
pdfUrl: string;
|
|
8
|
+
/** Names the viewer for assistive technology. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Called once per document; a later identity is ignored, so an inline function is fine. */
|
|
11
|
+
loadPdfJs: PdfJsLoader;
|
|
12
|
+
/** Scrolls to and highlights a passage once the document is readable; a new `key` repeats the request. */
|
|
13
|
+
passage?: PdfPassage | undefined;
|
|
14
|
+
/** Reports loading, readiness, or failure with its reason. The latest callback is used; identity is not tracked. */
|
|
15
|
+
onLoadStateChange?: ((state: PdfLoadState, error?: unknown) => void) | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** Continuous PDF reading and passage navigation; the host supplies pdf.js through `loadPdfJs`. */
|
|
18
|
+
export declare const PaperPdfViewer: import("react").ForwardRefExoticComponent<PaperPdfViewerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
//# sourceMappingURL=paper-pdf-viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paper-pdf-viewer.d.ts","sourceRoot":"","sources":["../../src/components/paper-pdf-viewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwD,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIlG,OAAO,EAIL,KAAK,UAAU,EAGhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAsB,WAAW,EAA+C,MAAM,uBAAuB,CAAC;AAE1H,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,SAAS,EAAE,WAAW,CAAC;IACvB,0GAA0G;IAC1G,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,oHAAoH;IACpH,iBAAiB,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAClF;AA2JD,mGAAmG;AACnG,eAAO,MAAM,cAAc,gHAGzB,CAAC"}
|