@lax-wp/editor 0.4.13 → 0.4.15-beta.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/README.md +25 -0
- package/dist/api/audit.d.ts +79 -0
- package/dist/api/derivedRulebook.d.ts +470 -0
- package/dist/api/documentVersions.d.ts +519 -0
- package/dist/api/effectiveRules.d.ts +372 -0
- package/dist/api/methodology.d.ts +62 -0
- package/dist/api/playbook.d.ts +604 -0
- package/dist/api/promotions.d.ts +1432 -0
- package/dist/api/r1.d.ts +1097 -0
- package/dist/api/r1.fixtures.d.ts +111 -0
- package/dist/api/redlineJobs.d.ts +377 -0
- package/dist/api/redlineStream.d.ts +2979 -0
- package/dist/api/redlines.d.ts +504 -0
- package/dist/api/regsync.d.ts +2355 -0
- package/dist/api/ruleAuthoring.d.ts +305 -0
- package/dist/api/ruleBuilder.d.ts +1009 -0
- package/dist/api/ruleOverrides.d.ts +31 -0
- package/dist/api/ruleStats.d.ts +84 -0
- package/dist/api/rulesCatalog.d.ts +234 -0
- package/dist/api/versions.d.ts +76 -0
- package/dist/api/workspace.d.ts +41 -0
- package/dist/components/EditorSidebar.d.ts +4 -1
- package/dist/components/audit/AuditView.d.ts +8 -0
- package/dist/components/capturededits/AddAsRuleModal.d.ts +8 -0
- package/dist/components/capturededits/CapturedEditCard.d.ts +15 -0
- package/dist/components/capturededits/CapturedEditsTray.d.ts +4 -0
- package/dist/components/capturededits/capturedEditIntent.d.ts +23 -0
- package/dist/components/common/EscDropdown.d.ts +2 -0
- package/dist/components/compliance/MethodologyPanel.d.ts +14 -0
- package/dist/components/compliance/RegSyncPanel.d.ts +18 -0
- package/dist/components/compliance/index.d.ts +8 -0
- package/dist/components/compliance/primitives.d.ts +41 -0
- package/dist/components/documents/DocumentVersionHistory.d.ts +12 -0
- package/dist/components/documents/documentDiff.d.ts +68 -0
- package/dist/components/documents/index.d.ts +4 -0
- package/dist/components/flowdown/FlowdownPanel.d.ts +28 -0
- package/dist/components/flowdown/FlowdownRowCard.d.ts +27 -0
- package/dist/components/flowdown/flowdownModel.d.ts +150 -0
- package/dist/components/history/PlaybookVersionHistory.d.ts +10 -0
- package/dist/components/history/versionDiff.d.ts +14 -0
- package/dist/components/playbook/AllPlaybooksView.d.ts +41 -0
- package/dist/components/playbook/DerivedRulebookView.d.ts +9 -0
- package/dist/components/playbook/DraftedRulePreview.d.ts +17 -0
- package/dist/components/playbook/EffectiveRulesView.d.ts +11 -0
- package/dist/components/playbook/NewRuleDrawer.d.ts +11 -0
- package/dist/components/playbook/PlaybookCard.d.ts +13 -0
- package/dist/components/playbook/PlaybookPage.d.ts +29 -0
- package/dist/components/playbook/PlaybookPanel.d.ts +73 -0
- package/dist/components/playbook/PromotionSuggestions.d.ts +1 -0
- package/dist/components/playbook/ReprioritizeDialog.d.ts +16 -0
- package/dist/components/playbook/RuleDetail.d.ts +27 -0
- package/dist/components/playbook/RuleEditorFields.d.ts +42 -0
- package/dist/components/playbook/RuleEditorModal.d.ts +27 -0
- package/dist/components/playbook/RulePerformancePanel.d.ts +4 -0
- package/dist/components/playbook/RuleRow.d.ts +26 -0
- package/dist/components/playbook/ThisDocumentView.d.ts +45 -0
- package/dist/components/playbook/ViewTabs.d.ts +8 -0
- package/dist/components/playbook/index.d.ts +14 -0
- package/dist/components/playbook/predicateSummary.d.ts +10 -0
- package/dist/components/playbook/primitives.d.ts +82 -0
- package/dist/components/playbook/useFocusTrap.d.ts +6 -0
- package/dist/components/playbook/usePlaybookData.d.ts +161 -0
- package/dist/components/playbook/usePlaybookLabel.d.ts +18 -0
- package/dist/components/r1/ApprovalPanel.d.ts +10 -0
- package/dist/components/r1/CandidateRuleCard.d.ts +8 -0
- package/dist/components/r1/ExecSummaryPanel.d.ts +23 -0
- package/dist/components/r1/PrimeUploadPanel.d.ts +8 -0
- package/dist/components/r1/ReviewStartControls.d.ts +24 -0
- package/dist/components/r1/ReviewSummaryTab.d.ts +38 -0
- package/dist/components/r1/index.d.ts +13 -0
- package/dist/components/r1/primitives.d.ts +59 -0
- package/dist/components/redline/AiReviewPanel.d.ts +194 -0
- package/dist/components/redline/RedlineHoverCard.d.ts +13 -0
- package/dist/components/redline/RedlineItem.d.ts +12 -0
- package/dist/components/redline/ReviewCard.d.ts +49 -0
- package/dist/components/redline/index.d.ts +6 -0
- package/dist/components/redline/reviewItems.d.ts +49 -0
- package/dist/components/redline/reviewPrefs.d.ts +18 -0
- package/dist/components/redline/useRunScopedCards.d.ts +16 -0
- package/dist/components/rulebuilder/AuthorForms.d.ts +28 -0
- package/dist/components/rulebuilder/CandidateQueue.d.ts +21 -0
- package/dist/components/rulebuilder/DraftPane.d.ts +12 -0
- package/dist/components/rulebuilder/RuleBuilderPanel.d.ts +6 -0
- package/dist/components/rulebuilder/RuleCard.d.ts +16 -0
- package/dist/components/rulebuilder/TestBench.d.ts +10 -0
- package/dist/components/rulebuilder/VocabularyPanel.d.ts +26 -0
- package/dist/components/rulebuilder/index.d.ts +13 -0
- package/dist/components/rulebuilder/primitives.d.ts +54 -0
- package/dist/components/rulebuilder/useRuleBuilder.d.ts +291 -0
- package/dist/components/sidebar/ExpandableSidebar.d.ts +2 -0
- package/dist/components/sidebar/WorkspaceRetentionPanel.d.ts +18 -0
- package/dist/components/sidebar/content/TrackChangesContent.d.ts +8 -0
- package/dist/components/sidebar/content/anonymization-page/PIIAnonymization.d.ts +1 -1
- package/dist/components/sidebar/content/anonymization-page/PiiIdleView.d.ts +12 -0
- package/dist/components/sidebar/content/anonymization-page/PiiRecoveryView.d.ts +16 -0
- package/dist/components/sidebar/content/anonymization-page/PiiSummaryView.d.ts +34 -0
- package/dist/components/sidebar/content/anonymization-page/PiiUnavailableView.d.ts +1 -0
- package/dist/components/sidebar/content/anonymization-page/RestoreConfirmDialog.d.ts +9 -0
- package/dist/components/sidebar/content/anonymization-page/anonymizationUtils.d.ts +38 -17
- package/dist/components/sidebar/content/anonymization-page/piiVault.d.ts +18 -0
- package/dist/components/sidebar/content/index.d.ts +0 -1
- package/dist/components/toolbar/AutocompletionToggle.d.ts +1 -0
- package/dist/components/trackChanges/TrackChangesCards.d.ts +1 -0
- package/dist/components/trackChanges/index.d.ts +2 -0
- package/dist/components/trackChanges/utils.d.ts +5 -0
- package/dist/config/EditorConfig.d.ts +197 -73
- package/dist/constants/Extensions.d.ts +12 -0
- package/dist/constants/playbook.d.ts +108 -0
- package/dist/contexts/CapturedEditsContext.d.ts +56 -0
- package/dist/contexts/EditorShellContext.d.ts +4 -1
- package/dist/editor.css +1 -1
- package/dist/extensions/AnonymizedText.d.ts +31 -2
- package/dist/extensions/VariableText.d.ts +20 -0
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/plugins/CapturedEditsPlugin.d.ts +90 -0
- package/dist/extensions/plugins/MarkHighlightPlugin.d.ts +0 -1
- package/dist/extensions/plugins/RedlinePlugin.d.ts +9 -0
- package/dist/extensions/redline/changeTypes.d.ts +70 -0
- package/dist/extensions/redline/constants.d.ts +25 -0
- package/dist/extensions/redline/engine/blockNodes.d.ts +31 -0
- package/dist/extensions/redline/engine/clipboard.d.ts +16 -0
- package/dist/extensions/redline/engine/deletion.d.ts +34 -0
- package/dist/extensions/redline/engine/formatSplit.d.ts +16 -0
- package/dist/extensions/redline/engine/insertion.d.ts +26 -0
- package/dist/extensions/redline/engine/predicates.d.ts +73 -0
- package/dist/extensions/redline/engine/textReplace.d.ts +19 -0
- package/dist/extensions/redline/id.d.ts +7 -0
- package/dist/extensions/redline/index.d.ts +36 -0
- package/dist/extensions/redline/plugin.d.ts +34 -0
- package/dist/extensions/redline/query/scan.d.ts +52 -0
- package/dist/extensions/redline/review/applyChange.d.ts +25 -0
- package/dist/extensions/redline/review/index.d.ts +1 -0
- package/dist/extensions/redline/review/nodeResolvers.d.ts +29 -0
- package/dist/extensions/redline/review/pairedNodes.d.ts +38 -0
- package/dist/extensions/redline/review/structuralRevert.d.ts +20 -0
- package/dist/extensions/redline/review/textResolver.d.ts +9 -0
- package/dist/extensions/redline/schema/marks.d.ts +65 -0
- package/dist/extensions/redline/schema/shared.d.ts +34 -0
- package/dist/extensions/redline/session.d.ts +71 -0
- package/dist/extensions/redline/types.d.ts +24 -0
- package/dist/extensions/trackedChanges/TrackedChanges.d.ts +64 -0
- package/dist/extensions/trackedChanges/constants.d.ts +34 -0
- package/dist/extensions/trackedChanges/engine.d.ts +32 -0
- package/dist/extensions/trackedChanges/index.d.ts +13 -0
- package/dist/extensions/trackedChanges/marks.d.ts +20 -0
- package/dist/extensions/trackedChanges/normalize.d.ts +2 -0
- package/dist/extensions/trackedChanges/plugin.d.ts +32 -0
- package/dist/extensions/trackedChanges/query.d.ts +3 -0
- package/dist/extensions/trackedChanges/review.d.ts +34 -0
- package/dist/extensions/trackedChanges/types.d.ts +72 -0
- package/dist/extensions/trackedChanges/utils.d.ts +20 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -0
- package/dist/hooks/useRedlineHover.d.ts +17 -0
- package/dist/hooks/useRedlineReview.d.ts +83 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.es.js +38491 -22189
- package/dist/index.umd.js +224 -125
- package/dist/utils/cdts.d.ts +37 -0
- package/dist/utils/groundingAdapter.d.ts +36 -0
- package/package.json +39 -33
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AiReviewPanel — a minimal, neat AI redline-review side rail.
|
|
3
|
+
*
|
|
4
|
+
* Layout follows the "NDA Redline Review" reference (severity chip · clause ref ·
|
|
5
|
+
* title · rationale · playbook § ref · from→to diff · Accept/Reject · resolved
|
|
6
|
+
* states) but is skinned entirely in the editor's own design system
|
|
7
|
+
* (src/styles/tokens.css): Inter (--font-ui), --action blue, T1/T2/T3 severity
|
|
8
|
+
* tokens, --font-mono-rule for refs, --radius-* corners, cool neutrals. Purely
|
|
9
|
+
* presentational — the parent owns the decision state — except US-B7
|
|
10
|
+
* persistence: with `persist` set, decisions also PATCH the suggestion store
|
|
11
|
+
* (best-effort) and prior-session dispositions re-hydrate on mount.
|
|
12
|
+
*/
|
|
13
|
+
import { type ReactNode } from "react";
|
|
14
|
+
import { type RedlinesApiConfig } from "@/api/redlines";
|
|
15
|
+
import type { R1Provenance, SuggestionPositions } from "@/api/r1";
|
|
16
|
+
import type { ScopeWarningPayload } from "@/api/redlineStream";
|
|
17
|
+
export type ReviewSeverity = "high" | "medium" | "low";
|
|
18
|
+
export type ReviewStatus = "pending" | "accepted" | "rejected";
|
|
19
|
+
export type ReviewCategory = "legal" | "operational" | "financial" | "grammar" | "policy";
|
|
20
|
+
export interface ReviewItem {
|
|
21
|
+
id: string;
|
|
22
|
+
/** e.g. "§2 · Obligations" */
|
|
23
|
+
clause: string;
|
|
24
|
+
/** V6 category — drives the category tag hue (mapped to the design-system category hues). */
|
|
25
|
+
category: ReviewCategory;
|
|
26
|
+
severity: ReviewSeverity;
|
|
27
|
+
title: string;
|
|
28
|
+
rationale: string;
|
|
29
|
+
/** e.g. "Playbook 3.2 — Term limits" */
|
|
30
|
+
playbookRef?: string;
|
|
31
|
+
/**
|
|
32
|
+
* `citation.playbook_id` — the playbook that produced this item. Drives the
|
|
33
|
+
* playbook filter buckets; absent on lanes that carry no citation.
|
|
34
|
+
*/
|
|
35
|
+
playbookId?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Exact source text the finding points at, quoted neutrally. Distinct from
|
|
38
|
+
* `from`: an excerpt is being flagged, not removed, so it must never render
|
|
39
|
+
* struck through.
|
|
40
|
+
*/
|
|
41
|
+
excerpt?: string;
|
|
42
|
+
/** prior text (struck through) — omit for pure insertions */
|
|
43
|
+
from?: string;
|
|
44
|
+
/** proposed text — omit for pure deletions */
|
|
45
|
+
to?: string;
|
|
46
|
+
status: ReviewStatus;
|
|
47
|
+
/** R1: where the rule came from — "Prime §X" vs CDTS badge + click-through excerpt. */
|
|
48
|
+
provenance?: R1Provenance;
|
|
49
|
+
/** R1: preferred / fallback / walkaway position texts for suggestions. */
|
|
50
|
+
positions?: SuggestionPositions;
|
|
51
|
+
/** C2: which stream lane produced this finding — drives the lane identity chip. */
|
|
52
|
+
lane?: "panel" | "chronology" | "insertion";
|
|
53
|
+
/** C2 panel lane: personas that reviewed the section (attribution badges). */
|
|
54
|
+
personas?: string[];
|
|
55
|
+
/** C2 panel lane: the panel escalated this finding to a human. */
|
|
56
|
+
escalated?: boolean;
|
|
57
|
+
/** C2 insertions: human-readable placement, e.g. "Insert after node [10] · paragraph". */
|
|
58
|
+
placement?: string;
|
|
59
|
+
/** C2: how the suggestion text was produced — "drafted" | "template_fallback". */
|
|
60
|
+
textProvenance?: string;
|
|
61
|
+
/**
|
|
62
|
+
* US-B7: the suggestion store's record id (the SSE event's own id — the
|
|
63
|
+
* store preserves stream ids) — the PATCH target for persisted
|
|
64
|
+
* dispositions. Findings already carry the stream id as `id`; materialized
|
|
65
|
+
* redlines carry the editor MARK id there, so the host supplies the mark's
|
|
66
|
+
* groupId here. Persistence falls back to `id` when absent.
|
|
67
|
+
*/
|
|
68
|
+
streamId?: string;
|
|
69
|
+
}
|
|
70
|
+
/** One playbook this review ran against, as listed under "Reviewed against". */
|
|
71
|
+
export interface ReviewedPlaybook {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
/** e.g. "Gov › Services › MSA" — shown under the name. */
|
|
75
|
+
scopeLabel?: string;
|
|
76
|
+
ruleCount?: number;
|
|
77
|
+
/** Bundled/read-only library playbook. */
|
|
78
|
+
bundled?: boolean;
|
|
79
|
+
}
|
|
80
|
+
interface AiReviewPanelProps {
|
|
81
|
+
items: ReviewItem[];
|
|
82
|
+
/** Advisory findings (grammar/rulebook/irregularity lanes) — no decision bar. Rendered below `items`. */
|
|
83
|
+
findings?: ReviewItem[];
|
|
84
|
+
/** R1: minor deviations hidden behind an "N suppressed (show)" affordance below findings. */
|
|
85
|
+
suppressedFindings?: ReviewItem[];
|
|
86
|
+
selectedId?: string | null;
|
|
87
|
+
playbookName?: string;
|
|
88
|
+
/**
|
|
89
|
+
* The playbooks this review actually ran against. When supplied, the
|
|
90
|
+
* "Reviewed against …" line becomes a disclosure that lists them, and each
|
|
91
|
+
* name opens that playbook's rules. Without it the line stays a plain label.
|
|
92
|
+
*/
|
|
93
|
+
reviewedAgainst?: readonly ReviewedPlaybook[];
|
|
94
|
+
/** Opens the rules modal for one playbook (PlaybookPage). */
|
|
95
|
+
onOpenPlaybook?: (playbook: ReviewedPlaybook) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Workspace-controls §4: opens the attached prime's derived-rulebook view
|
|
98
|
+
* ("View derived rules" in the Parent contract section). Without it the
|
|
99
|
+
* link doesn't render.
|
|
100
|
+
*/
|
|
101
|
+
onViewDerivedRules?: (primeContractId: string) => void;
|
|
102
|
+
onSelect?: (id: string) => void;
|
|
103
|
+
onAccept?: (id: string) => void;
|
|
104
|
+
onReject?: (id: string) => void;
|
|
105
|
+
onUndo?: (id: string) => void;
|
|
106
|
+
/**
|
|
107
|
+
* The one resolved item that can still be undone (the most recent decision).
|
|
108
|
+
* Undo restores a document snapshot taken just before that decision, so only
|
|
109
|
+
* the latest is reversible — offering it on older cards would silently revert
|
|
110
|
+
* every decision made after them.
|
|
111
|
+
*/
|
|
112
|
+
undoableId?: string | null;
|
|
113
|
+
/** Dismiss every pending redline sharing this item's rule. */
|
|
114
|
+
onIgnoreRule?: (item: ReviewItem) => void;
|
|
115
|
+
onAcceptAll?: () => void;
|
|
116
|
+
/**
|
|
117
|
+
* US-B7: persist Accept/Reject dispositions to the suggestion store
|
|
118
|
+
* (PATCH /api/redlines/{id}/accept|reject, X-Actor) and re-hydrate prior
|
|
119
|
+
* decisions on mount (GET /api/redlines?document_id=). Best-effort: a
|
|
120
|
+
* failed PATCH shows an inline error but never blocks or reverts the local
|
|
121
|
+
* decision. Also gives advisory findings a decision bar — grammar/rulebook/
|
|
122
|
+
* advisory findings are dispositionable records too, they just never touch
|
|
123
|
+
* the document.
|
|
124
|
+
*/
|
|
125
|
+
persist?: {
|
|
126
|
+
documentId: string;
|
|
127
|
+
/** Host user's display name → X-Actor (localStorage `lax.flowdownActor` overrides). */
|
|
128
|
+
actorName?: string;
|
|
129
|
+
/** API endpoint config (base URL / workspace), shared with the flowdown tab. */
|
|
130
|
+
api?: RedlinesApiConfig;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* A2: lanes the backend reported as degraded (summary.lanes_degraded).
|
|
134
|
+
* Non-empty renders a prominent banner (not dismissable until acknowledged)
|
|
135
|
+
* and marks the review header as partial.
|
|
136
|
+
*/
|
|
137
|
+
degradedLanes?: readonly string[];
|
|
138
|
+
/** A2: mid-stream `event: error` frames arrived — also marks the review partial. */
|
|
139
|
+
hadStreamErrors?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Scope warnings (`scope_warning` stream events / summary.scope_warnings).
|
|
142
|
+
* The review's substantive scope collapsed — gov indicia without the gov
|
|
143
|
+
* regime, low coverage ratios, or an empty rulebook. Non-empty renders a
|
|
144
|
+
* prominent, NON-dismissable banner: unlike the degraded-lane banner there
|
|
145
|
+
* is no acknowledge affordance, because a silently under-scoped review is
|
|
146
|
+
* exactly the failure the banner exists to keep loud.
|
|
147
|
+
*/
|
|
148
|
+
scopeWarnings?: readonly ScopeWarningPayload[];
|
|
149
|
+
/**
|
|
150
|
+
* C1: regime selector rendered above the run button. `available` is the full
|
|
151
|
+
* regime vocabulary; `selected` (defaulted by the host to the regimes
|
|
152
|
+
* applicable to the document's scope) is what the next run sends.
|
|
153
|
+
*/
|
|
154
|
+
regimeSelector?: {
|
|
155
|
+
available: readonly string[];
|
|
156
|
+
selected: readonly string[];
|
|
157
|
+
onChange: (next: string[]) => void;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Flowdown tab (gov-baseline determinations). When set, a minimal two-tab
|
|
161
|
+
* bar renders at the top of the panel — "Review" (the existing list) and
|
|
162
|
+
* "Flowdown" (this node). Absent ⇒ the panel is unchanged.
|
|
163
|
+
*/
|
|
164
|
+
flowdownContent?: ReactNode;
|
|
165
|
+
/** Optional extra sidebar tabs (Sprint-2): playbook version history / audit trail. */
|
|
166
|
+
historyContent?: ReactNode;
|
|
167
|
+
auditContent?: ReactNode;
|
|
168
|
+
/** Post-review executive summary tab (r1/ReviewSummaryTab). */
|
|
169
|
+
summaryContent?: ReactNode;
|
|
170
|
+
/**
|
|
171
|
+
* Resolved-rulebook preview tab (playbook/EffectiveRulesView) — what WILL
|
|
172
|
+
* fire here after the precedence ladder, and what was superseded. Config,
|
|
173
|
+
* not results, but it belongs beside the review it predicts.
|
|
174
|
+
*/
|
|
175
|
+
effectiveContent?: ReactNode;
|
|
176
|
+
/** Row count badge for the Flowdown tab label. */
|
|
177
|
+
flowdownCount?: number;
|
|
178
|
+
/** Optional "Run AI Redline" action; when set, a primary button renders in the header. */
|
|
179
|
+
onRun?: () => void;
|
|
180
|
+
/** Disables the run button and shows a progress label while a review is in flight. */
|
|
181
|
+
running?: boolean;
|
|
182
|
+
/** Label for the run button (default "Run AI Redline"). */
|
|
183
|
+
runLabel?: string;
|
|
184
|
+
/** width in px (default 392, matching the reference rail) */
|
|
185
|
+
width?: number;
|
|
186
|
+
/**
|
|
187
|
+
* Render without the fixed-width <aside> chrome so the panel fills its
|
|
188
|
+
* container (e.g. the editor sidebar's expanded content slot). The header +
|
|
189
|
+
* scrollable card list are identical; only the outer wrapper differs.
|
|
190
|
+
*/
|
|
191
|
+
embedded?: boolean;
|
|
192
|
+
}
|
|
193
|
+
export declare const AiReviewPanel: ({ items, findings, suppressedFindings, selectedId, playbookName, reviewedAgainst, onOpenPlaybook, onViewDerivedRules, onSelect, onAccept, onReject, onUndo, undoableId, onIgnoreRule, onAcceptAll, persist, degradedLanes, hadStreamErrors, scopeWarnings, regimeSelector, flowdownContent, flowdownCount, historyContent, auditContent, summaryContent, effectiveContent, onRun, running, runLabel, width, embedded, }: AiReviewPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
194
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReviewItem } from "./AiReviewPanel";
|
|
2
|
+
export interface RedlineHoverCardProps {
|
|
3
|
+
item: ReviewItem;
|
|
4
|
+
/** bounding rect of the hovered mark (already first-line-clamped by caller) */
|
|
5
|
+
anchorRect: DOMRect;
|
|
6
|
+
onAccept: (id: string) => void;
|
|
7
|
+
onReject: (id: string) => void;
|
|
8
|
+
/** caller cancels the close timer */
|
|
9
|
+
onMouseEnter: () => void;
|
|
10
|
+
/** caller starts the close timer */
|
|
11
|
+
onMouseLeave: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const RedlineHoverCard: ({ item, anchorRect, onAccept, onReject, onMouseEnter, onMouseLeave, }: RedlineHoverCardProps) => import("react").ReactPortal;
|
|
@@ -10,8 +10,20 @@ export interface RedlineComment {
|
|
|
10
10
|
export interface RedlineChange {
|
|
11
11
|
id: string;
|
|
12
12
|
markIds?: string[];
|
|
13
|
+
/** Mark groupId when set (e.g. the AI/backend suggestion id from applyRedline).
|
|
14
|
+
* Lets onRedlineDecision consumers map a decision back to its source suggestion. */
|
|
15
|
+
groupId?: string;
|
|
13
16
|
type: RedlineChangeType;
|
|
14
17
|
content: string;
|
|
18
|
+
/**
|
|
19
|
+
* Replace halves kept apart. `content` concatenates every marked node in the
|
|
20
|
+
* group, so on a `*-replace` it mixes the struck text with the proposed text
|
|
21
|
+
* and neither can be recovered from it. These two preserve the before/after
|
|
22
|
+
* the review card needs. Set on every change, not just replaces, so a
|
|
23
|
+
* consumer never has to branch on type to read them.
|
|
24
|
+
*/
|
|
25
|
+
deletedContent?: string;
|
|
26
|
+
insertedContent?: string;
|
|
15
27
|
userId: string;
|
|
16
28
|
userName: string;
|
|
17
29
|
userProfilePic?: string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReviewCard — the shared inner card body for AI redline-review cards.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for the card content rendered by both the
|
|
5
|
+
* right-rail AiReviewPanel and the floating RedlineHoverCard: severity chip ·
|
|
6
|
+
* category · clause ref · title · rationale · playbook § ref · from→to diff ·
|
|
7
|
+
* Accept/Reject (pending) or Undo (resolved). Skinned entirely via
|
|
8
|
+
* src/styles/tokens.css design tokens — no hardcoded colors.
|
|
9
|
+
*/
|
|
10
|
+
import type { ReviewItem } from "./AiReviewPanel";
|
|
11
|
+
export declare const CAT: {
|
|
12
|
+
readonly legal: {
|
|
13
|
+
readonly label: "Legal";
|
|
14
|
+
readonly dot: "var(--cat-legal)";
|
|
15
|
+
readonly text: "var(--cat-legal-caption)";
|
|
16
|
+
};
|
|
17
|
+
readonly financial: {
|
|
18
|
+
readonly label: "Financial";
|
|
19
|
+
readonly dot: "var(--cat-commercial)";
|
|
20
|
+
readonly text: "var(--cat-commercial-text)";
|
|
21
|
+
};
|
|
22
|
+
readonly operational: {
|
|
23
|
+
readonly label: "Operational";
|
|
24
|
+
readonly dot: "var(--cdts-ops)";
|
|
25
|
+
readonly text: "var(--cdts-ops-text)";
|
|
26
|
+
};
|
|
27
|
+
readonly grammar: {
|
|
28
|
+
readonly label: "Grammar";
|
|
29
|
+
readonly dot: "var(--cat-language)";
|
|
30
|
+
readonly text: "var(--cat-language-text)";
|
|
31
|
+
};
|
|
32
|
+
readonly policy: {
|
|
33
|
+
readonly label: "Policy";
|
|
34
|
+
readonly dot: "var(--cat-compliance)";
|
|
35
|
+
readonly text: "var(--cat-compliance-text)";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const REVIEW_CARD_CSS = "\n.arp-root{--arp-mono:var(--font-mono-rule);box-sizing:border-box}\n.arp-root *{box-sizing:border-box}\n.arp-link{background:none;border:none;padding:0;cursor:pointer;font-family:var(--font-ui);color:var(--action-link);font-weight:600}\n.arp-link:hover{text-decoration:underline}\n.arp-card{transition:border-color .15s ease, box-shadow .15s ease, background .15s ease}\n.arp-card:hover{border-color:var(--action)!important}\n.arp-btn{font-family:var(--font-ui);border-radius:var(--radius-control);cursor:pointer;font-weight:600;font-size:12px;transition:background .15s ease, border-color .15s ease}\n/* Transparent border, not `none`: Reject carries a 1px border, and under\n `flex:1` the border sits outside the flex base size, so a borderless Accept\n renders 2px narrower than its sibling. Matching the box metrics keeps the\n pair symmetric. */\n.arp-accept{background:var(--action);color:var(--action-on);border:1px solid transparent;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}\n.arp-accept:hover{background:var(--action-hover)}\n.arp-reject{background:var(--pb-panel);color:var(--pb-text-secondary);border:1px solid var(--pb-border-strong);box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}\n.arp-reject:hover{background:var(--pb-card)}\n.dark .arp-accept,.dark .arp-reject{box-shadow:0 1px 3px rgba(0,0,0,.4)}\n.arp-undo{background:none;border:none;padding:0;cursor:pointer;font-family:var(--font-ui);color:var(--pb-text-muted);font-weight:500;font-size:11.5px;align-self:flex-start}\n.arp-undo:hover{color:var(--pb-text-primary);text-decoration:underline}\n.arp-ignore{background:none;border:none;padding:0;cursor:pointer;font-family:var(--font-ui);color:var(--pb-text-muted);font-weight:500;font-size:11px;white-space:nowrap;flex:none}\n.arp-ignore:hover{color:var(--st-error);text-decoration:underline}\n.arp-scroll{scrollbar-width:thin}\n";
|
|
39
|
+
export interface ReviewCardBodyProps {
|
|
40
|
+
item: ReviewItem;
|
|
41
|
+
onAccept?: (id: string) => void;
|
|
42
|
+
onReject?: (id: string) => void;
|
|
43
|
+
onUndo?: (id: string) => void;
|
|
44
|
+
/** Dismiss every pending redline produced by this card's rule. */
|
|
45
|
+
onIgnoreRule?: (item: ReviewItem) => void;
|
|
46
|
+
/** Advisory findings have no decision bar (no Accept/Reject, no Undo) regardless of status. */
|
|
47
|
+
advisory?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export declare const ReviewCardBody: ({ item, onAccept, onReject, onUndo, onIgnoreRule, advisory }: ReviewCardBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export { RedlinePanel } from './RedlinePanel';
|
|
2
2
|
export { RedlineItem } from './RedlineItem';
|
|
3
3
|
export type { RedlineChange, RedlineChangeType, RedlineComment } from './RedlineItem';
|
|
4
|
+
export { AiReviewPanel } from './AiReviewPanel';
|
|
5
|
+
export type { ReviewItem, ReviewSeverity, ReviewCategory, ReviewStatus } from './AiReviewPanel';
|
|
6
|
+
export { changesToReviewItems } from './reviewItems';
|
|
7
|
+
export type { ReviewMeta } from './reviewItems';
|
|
8
|
+
export { RedlineHoverCard } from './RedlineHoverCard';
|
|
9
|
+
export { ReviewCardBody, REVIEW_CARD_CSS } from './ReviewCard';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps the editor's live redline `changes` (from useRedline) into AiReviewPanel
|
|
3
|
+
* ReviewItem[]. Category / severity / rationale / playbook ref come from a
|
|
4
|
+
* grounding `meta` map keyed by the change's groupId (the backend suggestion id
|
|
5
|
+
* that applyRedline stamps onto the mark). Without meta, sensible defaults keep
|
|
6
|
+
* the panel functional. Accepted/rejected changes leave `changes`, so everything
|
|
7
|
+
* here is `pending`.
|
|
8
|
+
*/
|
|
9
|
+
import type { RedlineChange } from "./RedlineItem";
|
|
10
|
+
import type { ReviewItem, ReviewCategory, ReviewSeverity } from "./AiReviewPanel";
|
|
11
|
+
export interface ReviewMeta {
|
|
12
|
+
category?: ReviewCategory;
|
|
13
|
+
severity?: ReviewSeverity;
|
|
14
|
+
title?: string;
|
|
15
|
+
rationale?: string;
|
|
16
|
+
playbookRef?: string;
|
|
17
|
+
/** `citation.playbook_id` — which playbook produced this suggestion. */
|
|
18
|
+
playbookId?: string;
|
|
19
|
+
clause?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Filter bucket for a review item. Real playbook ids pass through (including
|
|
23
|
+
* the backend's synthetic lane playbooks `grammar:style-guide` and
|
|
24
|
+
* `chronology:date-order`); the panel lane has no citation and gets its own
|
|
25
|
+
* bucket; everything else without a playbook id falls into `lane:other`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const bucketOf: (it: Pick<ReviewItem, "lane" | "playbookId">) => string;
|
|
28
|
+
/** Display names for the non-playbook buckets; unknown ids render raw. */
|
|
29
|
+
export declare const BUCKET_LABELS: Record<string, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Rule id → suppression key.
|
|
32
|
+
*
|
|
33
|
+
* An emitted rule id carries a per-finding hash as its last segment
|
|
34
|
+
* ("grammar:and_or:3f2a91c48b0e7d15"), so it is unique to that one finding and
|
|
35
|
+
* can never suppress a rule. The family — everything before the hash — is the
|
|
36
|
+
* key the backend's `disabled_rule_ids` matches on. Ids without a trailing hash
|
|
37
|
+
* (e.g. "GOV-PAY-004") are already families and pass through unchanged.
|
|
38
|
+
*/
|
|
39
|
+
export declare const ruleFamily: (ruleId: string) => string;
|
|
40
|
+
export declare const SEV_RANK: Record<ReviewSeverity, number>;
|
|
41
|
+
/**
|
|
42
|
+
* Findings-wall ordering: severity first (high > medium > low, stable within a
|
|
43
|
+
* severity), then identical findings — same rule (playbookRef) and title at the
|
|
44
|
+
* same severity — collapse into one group so 125 copies of "Defined term
|
|
45
|
+
* capitalization" render as a single card with a ×125 badge instead of burying
|
|
46
|
+
* the high findings. Groups keep first-appearance order within their severity.
|
|
47
|
+
*/
|
|
48
|
+
export declare function groupFindings(findings: ReviewItem[]): ReviewItem[][];
|
|
49
|
+
export declare function changesToReviewItems(changes: RedlineChange[], meta?: Record<string, ReviewMeta>): ReviewItem[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-document review preferences, persisted in localStorage (same pattern as
|
|
3
|
+
* `lax.flowdownActor` in api/redlines.ts). Server-side persistence is a noted
|
|
4
|
+
* TODO (doc-rules store); localStorage first.
|
|
5
|
+
*
|
|
6
|
+
* lax.reviewExclusions.{documentId} JSON string[] of playbook ids the
|
|
7
|
+
* reviewer removed from the review set —
|
|
8
|
+
* sent as `disabled_playbook_ids` on runs.
|
|
9
|
+
* lax.primeContract.{documentId} the attached parent-contract id —
|
|
10
|
+
* sent as `prime_contract_id` on runs.
|
|
11
|
+
*
|
|
12
|
+
* All helpers fail soft (SSR / privacy mode): reads return the empty state,
|
|
13
|
+
* writes are best-effort.
|
|
14
|
+
*/
|
|
15
|
+
export declare const loadReviewExclusions: (documentId: string) => string[];
|
|
16
|
+
export declare const saveReviewExclusions: (documentId: string, ids: readonly string[]) => void;
|
|
17
|
+
export declare const loadPrimeContract: (documentId: string) => string | null;
|
|
18
|
+
export declare const savePrimeContract: (documentId: string, primeId: string | null) => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { JSONContent } from "@tiptap/core";
|
|
2
|
+
import type { ReviewItem, ReviewStatus } from "./AiReviewPanel";
|
|
3
|
+
export declare function useRunScopedCards(reviewItems: ReviewItem[], running: boolean): {
|
|
4
|
+
decisions: Record<string, ReviewStatus>;
|
|
5
|
+
setDecisions: import("react").Dispatch<import("react").SetStateAction<Record<string, ReviewStatus>>>;
|
|
6
|
+
knownItems: ReviewItem[];
|
|
7
|
+
displayItems: ReviewItem[];
|
|
8
|
+
undoable: {
|
|
9
|
+
id: string;
|
|
10
|
+
doc: JSONContent;
|
|
11
|
+
} | null;
|
|
12
|
+
setUndoable: import("react").Dispatch<import("react").SetStateAction<{
|
|
13
|
+
id: string;
|
|
14
|
+
doc: JSONContent;
|
|
15
|
+
} | null>>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type AuthorExample } from "@/api/ruleAuthoring";
|
|
2
|
+
import { type CapabilityStatus } from "@/api/ruleBuilder";
|
|
3
|
+
export declare const DescribeForm: ({ authoring, text, onTextChange, onDraft, busy, disabled, onRecheck, }: {
|
|
4
|
+
authoring: CapabilityStatus;
|
|
5
|
+
text: string;
|
|
6
|
+
onTextChange: (next: string) => void;
|
|
7
|
+
onDraft: () => void;
|
|
8
|
+
busy: boolean;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
onRecheck: () => void;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const ExamplesForm: ({ authoring, examples, onExamplesChange, guidance, onGuidanceChange, onDraft, busy, disabled, onRecheck, }: {
|
|
13
|
+
authoring: CapabilityStatus;
|
|
14
|
+
examples: AuthorExample[];
|
|
15
|
+
onExamplesChange: (next: AuthorExample[]) => void;
|
|
16
|
+
guidance: string;
|
|
17
|
+
onGuidanceChange: (next: string) => void;
|
|
18
|
+
onDraft: () => void;
|
|
19
|
+
busy: boolean;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
onRecheck: () => void;
|
|
22
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const ImportForm: ({ onImport, busy, disabled, error, }: {
|
|
24
|
+
onImport: (file: File) => void;
|
|
25
|
+
busy: boolean;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
error: string;
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CandidateQueue — the reviewer UI `POST /v1/playbooks/ingest` was written
|
|
3
|
+
* for and never got.
|
|
4
|
+
*
|
|
5
|
+
* The handler is explicit: "Rules are NOT auto-persisted. The no-code builder
|
|
6
|
+
* UI is expected to let a human review every candidate before writing into
|
|
7
|
+
* the store." So accept is per-candidate and explicit, reject is local (the
|
|
8
|
+
* candidate never existed server-side, so there is nothing to delete), and
|
|
9
|
+
* the paragraphs that FAILED to parse are shown next to the ones that
|
|
10
|
+
* succeeded — a silent 3-of-8 import is how a playbook quietly loses rules.
|
|
11
|
+
*/
|
|
12
|
+
import type { IngestParseError, PredicateInfo } from "@/api/ruleBuilder";
|
|
13
|
+
import type { CandidateReview } from "./useRuleBuilder";
|
|
14
|
+
export declare const CandidateQueue: ({ candidates, parseErrors, catalog, onAccept, onReject, onOpen, }: {
|
|
15
|
+
candidates: CandidateReview[];
|
|
16
|
+
parseErrors: IngestParseError[];
|
|
17
|
+
catalog: PredicateInfo[];
|
|
18
|
+
onAccept: (index: number) => void;
|
|
19
|
+
onReject: (index: number) => void;
|
|
20
|
+
onOpen: (index: number) => void;
|
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PredicateInfo } from "@/api/ruleBuilder";
|
|
2
|
+
import type { Draft } from "./useRuleBuilder";
|
|
3
|
+
export declare const DraftPane: ({ draft, catalog, busy, error, canRevise, onRevise, onCommit, onDiscard, }: {
|
|
4
|
+
draft: Draft;
|
|
5
|
+
catalog: PredicateInfo[];
|
|
6
|
+
busy: boolean;
|
|
7
|
+
error: string;
|
|
8
|
+
canRevise: boolean;
|
|
9
|
+
onRevise: (instruction: string) => void;
|
|
10
|
+
onCommit: () => void;
|
|
11
|
+
onDiscard: () => void;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface RuleBuilderPanelProps {
|
|
2
|
+
/** Preselects a playbook; otherwise the first one in the workspace. */
|
|
3
|
+
playbookId?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const RuleBuilderPanel: ({ playbookId, className }: RuleBuilderPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RuleCard — one rule rendered the way a lawyer reads it, not the way the
|
|
3
|
+
* store holds it: what the rule looks for, then the negotiation ladder
|
|
4
|
+
* (standard position → fallback → walkaway), then the machinery.
|
|
5
|
+
*
|
|
6
|
+
* The predicate is the one genuinely technical part, so it is rendered as a
|
|
7
|
+
* sentence built from the live `/v1/playbooks/predicates` catalog rather than
|
|
8
|
+
* as raw JSON — the catalog is exactly the vocabulary the drafting model was
|
|
9
|
+
* given, so the description shown is the description it authored against.
|
|
10
|
+
*/
|
|
11
|
+
import type { BuilderRule, PredicateInfo } from "@/api/ruleBuilder";
|
|
12
|
+
export declare const RuleCard: ({ rule, catalog, warnings, }: {
|
|
13
|
+
rule: BuilderRule;
|
|
14
|
+
catalog: PredicateInfo[];
|
|
15
|
+
warnings?: string[];
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EvaluateResult } from "@/api/ruleBuilder";
|
|
2
|
+
export declare const TestBench: ({ playbookName, result, busy, error, onRun, highlightRuleId, }: {
|
|
3
|
+
playbookName: string;
|
|
4
|
+
result: EvaluateResult | null;
|
|
5
|
+
busy: boolean;
|
|
6
|
+
error: string;
|
|
7
|
+
onRun: (clauseText: string) => void;
|
|
8
|
+
/** When set, the row for this rule is called out — "did MY rule fire?". */
|
|
9
|
+
highlightRuleId?: string | null;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VocabularyPanel — "what can I write a rule about?", answered by the three
|
|
3
|
+
* discovery endpoints.
|
|
4
|
+
*
|
|
5
|
+
* predicates always on — the kinds of test a rule can make.
|
|
6
|
+
* fields flag-gated — the named header fields `expr`/`one_of` can read.
|
|
7
|
+
* taxonomy flag-gated — the CDTS tree that says where a playbook applies.
|
|
8
|
+
*
|
|
9
|
+
* The two gated ones share a flag but fail differently, so each renders its
|
|
10
|
+
* own capability notice. This is the part of the surface that decays
|
|
11
|
+
* gracefully: without fields, a lawyer can still write clause-text rules, and
|
|
12
|
+
* the panel says exactly that rather than showing an empty list that reads as
|
|
13
|
+
* "there are no fields".
|
|
14
|
+
*/
|
|
15
|
+
import { type CapabilityStatus, type FieldCatalogEntry, type PredicateInfo, type TaxonomyNode } from "@/api/ruleBuilder";
|
|
16
|
+
export declare const VocabularyPanel: ({ predicates, predicatesError, onReloadPredicates, fields, fieldsStatus, onReloadFields, taxonomy, taxonomyStatus, onReloadTaxonomy, }: {
|
|
17
|
+
predicates: PredicateInfo[];
|
|
18
|
+
predicatesError: string;
|
|
19
|
+
onReloadPredicates: () => void;
|
|
20
|
+
fields: FieldCatalogEntry[];
|
|
21
|
+
fieldsStatus: CapabilityStatus;
|
|
22
|
+
onReloadFields: () => void;
|
|
23
|
+
taxonomy: TaxonomyNode[];
|
|
24
|
+
taxonomyStatus: CapabilityStatus;
|
|
25
|
+
onReloadTaxonomy: () => void;
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The no-code rule builder: one screen over the eight P2 authoring endpoints.
|
|
3
|
+
* `RuleBuilderPanel` is the whole surface; everything else is exported for
|
|
4
|
+
* tests and for hosts that want to place a piece of the flow themselves.
|
|
5
|
+
*/
|
|
6
|
+
export { RuleBuilderPanel } from "./RuleBuilderPanel";
|
|
7
|
+
export type { RuleBuilderPanelProps } from "./RuleBuilderPanel";
|
|
8
|
+
export { useRuleBuilder } from "./useRuleBuilder";
|
|
9
|
+
export type { BuilderMode, CandidateReview, Draft, RuleBuilderState } from "./useRuleBuilder";
|
|
10
|
+
export { RuleCard } from "./RuleCard";
|
|
11
|
+
export { CandidateQueue } from "./CandidateQueue";
|
|
12
|
+
export { TestBench } from "./TestBench";
|
|
13
|
+
export { VocabularyPanel } from "./VocabularyPanel";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared presentational pieces for the rule builder. Playbook design tokens
|
|
3
|
+
* + Tailwind only, matching `components/playbook/primitives.tsx`; every value
|
|
4
|
+
* renders as text, never HTML.
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactNode } from "react";
|
|
7
|
+
import type { CapabilityStatus } from "@/api/ruleBuilder";
|
|
8
|
+
export declare const Chip: ({ tone, title, children, }: {
|
|
9
|
+
tone?: "neutral" | "accent" | "warn" | "danger" | "ok";
|
|
10
|
+
title?: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const Section: ({ title, hint, actions, children, }: {
|
|
14
|
+
title: string;
|
|
15
|
+
hint?: ReactNode;
|
|
16
|
+
actions?: ReactNode;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const Button: ({ variant, disabled, busy, onClick, type, children, }: {
|
|
20
|
+
variant?: "primary" | "secondary" | "ghost" | "danger";
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
busy?: boolean;
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
type?: "button" | "submit";
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const TextArea: ({ label, value, onChange, placeholder, rows, disabled, }: {
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
onChange: (next: string) => void;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
rows?: number;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
/** Inline, non-blocking failure strip. Errors never take the screen away. */
|
|
36
|
+
export declare const ErrorStrip: ({ message, onRetry }: {
|
|
37
|
+
message: string;
|
|
38
|
+
onRetry?: () => void;
|
|
39
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
/**
|
|
41
|
+
* The honest degradation surface. A capability that is off server-side is
|
|
42
|
+
* NOT an error and NOT a hidden control: the user is told the capability
|
|
43
|
+
* exists, is disabled on this deployment, and which flag turns it on — so
|
|
44
|
+
* "why can't I do this" has an answer that does not require reading Go.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CapabilityNotice: ({ status, capability, flag, onRetry, }: {
|
|
47
|
+
status: CapabilityStatus;
|
|
48
|
+
capability: string;
|
|
49
|
+
flag?: string;
|
|
50
|
+
onRetry?: () => void;
|
|
51
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
52
|
+
export declare const EmptyHint: ({ children }: {
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
}) => import("react/jsx-runtime").JSX.Element;
|