@danxbot/ui 20.23.3 → 21.1.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/index.js +23607 -22540
- package/dist/index.js.map +1 -1
- package/dist/pure.js +290 -210
- package/dist/pure.js.map +1 -1
- package/dist/types/components/AppShell.d.ts +1 -1
- package/dist/types/components/Board.d.ts +4 -6
- package/dist/types/components/Card.d.ts +25 -1
- package/dist/types/components/Combobox.d.ts +2 -1
- package/dist/types/components/CommandPalette.d.ts +2 -0
- package/dist/types/components/DateField.d.ts +2 -2
- package/dist/types/components/DragDrop.d.ts +2 -4
- package/dist/types/components/InlineEdit.d.ts +4 -4
- package/dist/types/components/InlineMarkdownEdit.d.ts +2 -2
- package/dist/types/components/PagedWindowList.d.ts +1 -9
- package/dist/types/components/Progress.d.ts +4 -4
- package/dist/types/components/ReadMore.d.ts +2 -2
- package/dist/types/components/SecretField.d.ts +1 -1
- package/dist/types/components/Slider.d.ts +1 -1
- package/dist/types/components/SortMenu.d.ts +1 -1
- package/dist/types/components/Stat.d.ts +1 -1
- package/dist/types/components/StatusSelect.d.ts +1 -1
- package/dist/types/components/TriStateSwitch.d.ts +1 -7
- package/dist/types/components/board/context.d.ts +2 -4
- package/dist/types/components/calendar/CalendarMonth.d.ts +2 -3
- package/dist/types/components/calendar/CalendarTimeGrid.d.ts +1 -2
- package/dist/types/components/calendar/EventActions.d.ts +1 -2
- package/dist/types/components/calendar/format.d.ts +10 -9
- package/dist/types/components/calendar/use-calendar-drag.d.ts +0 -1
- package/dist/types/components/calendar/use-event-keyboard.d.ts +0 -1
- package/dist/types/components/chart/BarList.d.ts +1 -1
- package/dist/types/components/chart/ShareBar.d.ts +1 -1
- package/dist/types/components/chart/TimeSeriesChart.d.ts +2 -4
- package/dist/types/components/chart/shared.d.ts +2 -2
- package/dist/types/components/chart/time-series-scale.d.ts +1 -1
- package/dist/types/components/chat/EffortControl.d.ts +2 -2
- package/dist/types/components/chat/MessageScroller.d.ts +1 -1
- package/dist/types/components/checklist/StatusChecklist.d.ts +1 -1
- package/dist/types/components/edit/outcome.d.ts +0 -12
- package/dist/types/components/file-viewer/frames.d.ts +2 -1
- package/dist/types/components/kanban/KanbanBoard.d.ts +2 -21
- package/dist/types/components/kanban/types.d.ts +1 -1
- package/dist/types/components/markdown/Affordances.d.ts +3 -1
- package/dist/types/components/openapi/resolve.d.ts +7 -3
- package/dist/types/components/openapi/types.d.ts +2 -1
- package/dist/types/components/provenance/ConfidenceBar.d.ts +1 -1
- package/dist/types/components/provenance/ConfidenceReadout.d.ts +2 -2
- package/dist/types/components/provenance/ProvenanceBadge.d.ts +4 -3
- package/dist/types/components/provenance/ProvenanceDetail.d.ts +4 -6
- package/dist/types/components/provenance/ProvenanceDisclosure.d.ts +1 -1
- package/dist/types/components/provenance/absence.d.ts +4 -3
- package/dist/types/components/rbac/RoleKeyPicker.d.ts +1 -1
- package/dist/types/components/rbac/permissionSections.d.ts +1 -1
- package/dist/types/components/rbac/stagedForm.d.ts +4 -4
- package/dist/types/components/roadmap/RoadmapItemCard.d.ts +0 -1
- package/dist/types/index.d.ts +9 -7
- package/dist/types/lib/board/index.d.ts +2 -1
- package/dist/types/lib/board/move.d.ts +2 -2
- package/dist/types/lib/board/rejection.d.ts +8 -0
- package/dist/types/lib/board/types.d.ts +46 -0
- package/dist/types/lib/board/use-board.d.ts +2 -2
- package/dist/types/lib/calendar/drag.d.ts +1 -1
- package/dist/types/lib/calendar/index.d.ts +1 -1
- package/dist/types/lib/calendar/types.d.ts +3 -3
- package/dist/types/lib/confidence.d.ts +5 -0
- package/dist/types/lib/dnd/announce.d.ts +5 -23
- package/dist/types/lib/dnd/index.d.ts +1 -1
- package/dist/types/lib/format.d.ts +19 -18
- package/dist/types/lib/i18n/areas/auth-provenance-flows.d.ts +258 -0
- package/dist/types/lib/i18n/areas/board.d.ts +51 -0
- package/dist/types/lib/i18n/areas/chat-chart.d.ts +164 -0
- package/dist/types/lib/i18n/areas/code-editor.d.ts +40 -0
- package/dist/types/lib/i18n/areas/dates.d.ts +103 -0
- package/dist/types/lib/i18n/areas/docs-views.d.ts +268 -0
- package/dist/types/lib/i18n/areas/feedback.d.ts +104 -0
- package/dist/types/lib/i18n/areas/formats.d.ts +30 -0
- package/dist/types/lib/i18n/areas/forms.d.ts +130 -0
- package/dist/types/lib/i18n/areas/markdown.d.ts +139 -0
- package/dist/types/lib/i18n/areas/move-rejected.d.ts +16 -0
- package/dist/types/lib/i18n/areas/navigation.d.ts +144 -0
- package/dist/types/lib/i18n/areas/rbac.d.ts +584 -0
- package/dist/types/lib/i18n/emphasis.d.ts +3 -0
- package/dist/types/lib/i18n/index.d.ts +8 -0
- package/dist/types/lib/i18n/number-format.d.ts +5 -0
- package/dist/types/lib/i18n/plural.d.ts +7 -0
- package/dist/types/lib/i18n/provider.d.ts +16 -0
- package/dist/types/lib/i18n/strings.d.ts +15 -0
- package/dist/types/lib/intl-cache.d.ts +31 -0
- package/dist/types/lib/markdown/commands.d.ts +4 -2
- package/dist/types/lib/markdown/dom.d.ts +27 -21
- package/dist/types/lib/markdown/hotkeys.d.ts +12 -5
- package/dist/types/lib/markdown/image-decoration.d.ts +22 -1
- package/dist/types/lib/markdown/image-pipeline.d.ts +2 -0
- package/dist/types/lib/markdown/images.d.ts +1 -1
- package/dist/types/lib/markdown/reconcile.d.ts +4 -2
- package/dist/types/lib/markdown/surface.d.ts +4 -2
- package/dist/types/lib/reduced-motion-help.d.ts +2 -1
- package/dist/types/lib/time/relativeAge.d.ts +3 -2
- package/dist/types/lib/time/zone.d.ts +9 -0
- package/dist/types/lib/values/boolean.d.ts +11 -10
- package/dist/types/lib/values/currency.d.ts +5 -5
- package/dist/types/lib/values/date.d.ts +4 -4
- package/dist/types/lib/values/datetime.d.ts +3 -3
- package/dist/types/lib/values/locale-date.d.ts +34 -0
- package/dist/types/lib/values/number.d.ts +5 -5
- package/dist/types/pure.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ export interface ProvenanceDisclosureProps {
|
|
|
6
6
|
record: ProvenanceRecord;
|
|
7
7
|
/** Rendered at the foot of the panel. {@link ProvenanceDetailProps.actions} */
|
|
8
8
|
actions?: ReactNode;
|
|
9
|
-
/** Shown in place of the value when there is none and it did not fail. */
|
|
9
|
+
/** Shown in place of the value when there is none and it did not fail. Absent means the provider's own words. */
|
|
10
10
|
emptyLabel?: string;
|
|
11
11
|
/** Shown in place of the value when the viewer may not see it. */
|
|
12
12
|
redactedLabel?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { type IconName } from "../Icon";
|
|
3
|
+
import type { UiStrings } from "../../lib/i18n";
|
|
3
4
|
import type { ProvenanceRecord } from "./types";
|
|
4
5
|
declare const ABSENCE: Record<"redacted" | "empty" | "failed", {
|
|
5
6
|
icon: IconName;
|
|
@@ -30,7 +31,7 @@ export declare function isFailed(record: ProvenanceRecord): boolean;
|
|
|
30
31
|
* next actions.
|
|
31
32
|
*/
|
|
32
33
|
export declare function shownValue(record: ProvenanceRecord, { emptyLabel, redactedLabel }: {
|
|
33
|
-
emptyLabel
|
|
34
|
-
redactedLabel
|
|
35
|
-
}): ReactNode;
|
|
34
|
+
emptyLabel?: string;
|
|
35
|
+
redactedLabel?: string;
|
|
36
|
+
}, absence: UiStrings["provenanceAbsence"]): ReactNode;
|
|
36
37
|
export {};
|
|
@@ -16,7 +16,7 @@ export interface RoleKeyPickerProps {
|
|
|
16
16
|
className?: string;
|
|
17
17
|
}
|
|
18
18
|
/** Why `role` can't be chosen, naming the missing permissions by label. `null` when it can. */
|
|
19
|
-
export declare function roleUnavailableReason(role: Role, own: ReadonlySet<string>, permissions: Permission[]): string | null;
|
|
19
|
+
export declare function roleUnavailableReason(role: Role, own: ReadonlySet<string>, permissions: Permission[], unavailable: (permissionLabels: string[]) => string): string | null;
|
|
20
20
|
/** Whether `roleId` names a role in `roles` that the issuer may choose. */
|
|
21
21
|
export declare function isRoleSelectable(roleId: string, roles: Role[], own: ReadonlySet<string>): boolean;
|
|
22
22
|
/** The id of the selectable role holding the fewest permissions (the first of any tie), or `""` when none is selectable. */
|
|
@@ -14,4 +14,4 @@ export interface PermissionSection {
|
|
|
14
14
|
* explicit "Other" bucket for the rest, because at that point the absence of
|
|
15
15
|
* a category on a handful of rows is itself information worth a heading.
|
|
16
16
|
*/
|
|
17
|
-
export declare function groupByCategory(permissions: Permission[]): PermissionSection[];
|
|
17
|
+
export declare function groupByCategory(permissions: Permission[], otherLabel: string): PermissionSection[];
|
|
@@ -9,8 +9,6 @@ export interface SaveFlow {
|
|
|
9
9
|
save: (run: () => Promise<void>) => Promise<void>;
|
|
10
10
|
}
|
|
11
11
|
export declare function useSaveFlow(failureMessage: string): SaveFlow;
|
|
12
|
-
/** The line under a staged image, naming what Save will do with it. */
|
|
13
|
-
export declare function stagedImageNote(noun: string, saveLabel: string, removed: boolean): string;
|
|
14
12
|
export interface StagedFormActionsProps {
|
|
15
13
|
onSave: () => void;
|
|
16
14
|
onDiscard: () => void;
|
|
@@ -19,7 +17,9 @@ export interface StagedFormActionsProps {
|
|
|
19
17
|
/** The draft differs from what is saved in ANY way, including whitespace Save would trim away. */
|
|
20
18
|
canDiscard: boolean;
|
|
21
19
|
saving: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/** The Save button's text; omit for the built-in one. */
|
|
21
|
+
saveLabel?: string;
|
|
22
|
+
/** The Discard button's text; omit for the built-in one. */
|
|
23
|
+
discardLabel?: string;
|
|
24
24
|
}
|
|
25
25
|
export declare function StagedFormActions({ onSave, onDiscard, canSave, canDiscard, saving, saveLabel, discardLabel, }: StagedFormActionsProps): import("react").JSX.Element;
|
|
@@ -2,7 +2,6 @@ import { type BadgeProps } from "../Badge";
|
|
|
2
2
|
import type { Domain, Phase, RoadmapItem, RoadmapItemStatus, Track, UseCase, UseCaseStatus } from "./types";
|
|
3
3
|
export declare const ROADMAP_ITEM_STATUS_BADGE: Record<RoadmapItemStatus, {
|
|
4
4
|
tone: BadgeProps["tone"];
|
|
5
|
-
label: string;
|
|
6
5
|
live?: boolean;
|
|
7
6
|
}>;
|
|
8
7
|
export interface RoadmapItemCardProps {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ export { MarkdownSurface, type SurfaceOptions, type Splice } from "./lib/markdow
|
|
|
93
93
|
export { project, projectedText, ProjectionError } from "./lib/markdown/project";
|
|
94
94
|
export type { Projection, PNode, PText, PElement } from "./lib/markdown/project";
|
|
95
95
|
export { attachInput, type InputOptions } from "./lib/markdown/input";
|
|
96
|
-
export { HOTKEYS, hotkeyFor, chordsOf, type Hotkey, type HotkeyGroup, type EditorRequest } from "./lib/markdown/hotkeys";
|
|
96
|
+
export { HOTKEYS, hotkeyFor, chordsOf, type Hotkey, type HotkeyGroup, type EditorRequest, type HotkeyId } from "./lib/markdown/hotkeys";
|
|
97
97
|
export { MarkdownImageUploadProvider, type MarkdownImageUploadProviderProps, } from "./components/markdown/ImageUpload";
|
|
98
98
|
export type { ImageUploader, ImageUploadState } from "./lib/markdown/image-pipeline";
|
|
99
99
|
export { findUnstoredImages, isUnstoredImageSrc, type UnstoredImage } from "./lib/markdown/images";
|
|
@@ -111,11 +111,11 @@ export { tokenize, listLanguages, resolveLanguage, defineGrammar, registerGramma
|
|
|
111
111
|
export { parseMarkdown, MarkdownNodes, sanitizeHref, type MdNode, type MdInline, type MdCodeRenderer, } from "./lib/syntax/markdown";
|
|
112
112
|
export { DragDrop, DragDropContainer, DragDropItem, DragDropHandle, DragDropSurface, type DragDropProps, type DragDropContainerProps, type DragDropItemProps, type DragDropHandleProps, type DragDropSurfaceProps, } from "./components/DragDrop";
|
|
113
113
|
export { KanbanBoard, type KanbanBoardProps, type KanbanLane, type KanbanMove, type KanbanRefusal, } from "./components/kanban/KanbanBoard";
|
|
114
|
-
export {
|
|
114
|
+
export { DRAG_INSTRUCTIONS_ID, DragInstructions, DragLiveRegion, DragSession, DragSessionProvider, applyMove, attachAutoScroll, attachKeyboardSensor, attachPointerSensor, attachSessionWindowListeners, isNoOp, resolveTarget, sameTarget, scrollVelocity, useCreateDragSession, useDragAnnouncements, useDragSession, useDragState, useDragLive, useDraggable, useDropContainer, type ContainerId, type CrossDrop, type DragAxis, type DragCancelEvent, type DragEndEvent, type DragId, type DragMode, type DragPhase, type DragSessionCallbacks, type DragStartEvent, type DragState, type AutoScrollOptions, type DragAnnouncementContext, type DragAnnouncementOptions, type DragAnnouncements, type DragInstructionsProps, type DragLiveRegionProps, type DropTarget, type KeyboardSensorOptions, type PointerActivation, } from "./lib/dnd";
|
|
115
115
|
export { Board, BoardColumn, BoardCard, BoardCardSurface, type BoardProps, type BoardColumnProps, type BoardCardProps, type BoardCardSurfaceProps, } from "./components/Board";
|
|
116
|
-
export { buildBoardModel, resolveMove, applyBoardMoves, useBoard, moveAnchor, columnLength, positionInColumn, type BoardModel, type MoveAnchor, type UseBoardResult, } from "./lib/board";
|
|
117
|
-
export type { BoardAccessors, BoardColumnDef, BoardEdge, BoardColumnId, BoardColumnModel, BoardItemId, BoardMove, BoardMoveTarget, BoardMoveRequest, BoardMoveSource, BoardMoveVerdict, BoardReorderLabels, UseBoardOptions, } from "./lib/board";
|
|
118
|
-
export { PagedWindowList, type PagedWindowItemPosition, type PagedWindowListProps,
|
|
116
|
+
export { buildBoardModel, resolveMove, applyBoardMoves, describeMoveRejection, useBoard, moveAnchor, columnLength, positionInColumn, type BoardModel, type MoveAnchor, type UseBoardResult, } from "./lib/board";
|
|
117
|
+
export type { BoardAccessors, BoardColumnDef, BoardEdge, BoardColumnId, BoardColumnModel, BoardItemId, BoardMove, BoardMoveTarget, BoardMoveRequest, BoardMoveSource, BoardMoveOutcome, BoardMoveRejection, BoardMoveVerdict, BoardReorderLabels, UseBoardOptions, } from "./lib/board";
|
|
118
|
+
export { PagedWindowList, type PagedWindowItemPosition, type PagedWindowListProps, } from "./components/PagedWindowList";
|
|
119
119
|
export { PAGED_WINDOW_SETTLE_MS, PagedWindowStore, usePagedWindow, windowPageNumbers, type LoadCount, type LoadPage, type LoadPageContext, type PageResponse, type PageSnapshot, type PageStatus, type PagedWindow, type PagedWindowMode, type PagedWindowOptions, type PagedWindowSnapshot, type UsePagedWindowOptions, } from "./lib/paged-window";
|
|
120
120
|
export type { MessageRole, MessagePart, TextPart, CodePart, ReasoningPart, ToolPart, ToolStatus, FilePart, ComponentPart, ChatFile, ChatMessage, RenderContext, PartRenderer, PartRenderers, ChatComponentRenderer, ChatComponents, } from "./components/chat/types";
|
|
121
121
|
export { Chat, ChatPopover, type ChatProps, type ChatPopoverProps, type ChatSurface, } from "./components/chat/Chat";
|
|
@@ -129,7 +129,7 @@ export { FileViewer, PageNumberJumpField, type FileViewerProps, type PageNumberJ
|
|
|
129
129
|
export { fileIconFor, type FileIdentity } from "./components/chat/file-icon";
|
|
130
130
|
export { VideoPlayer, type VideoPlayerProps, type VideoTrack } from "./components/VideoPlayer";
|
|
131
131
|
export { ModelSelector, type ModelSelectorProps, type ChatModel, } from "./components/chat/ModelSelector";
|
|
132
|
-
export { EffortControl,
|
|
132
|
+
export { EffortControl, type EffortControlProps, type EffortLevel, } from "./components/chat/EffortControl";
|
|
133
133
|
export { ContextMeter, ChatStatus, type ContextMeterProps, type ContextSegment, type UsageLimit, type ChatStatusProps, } from "./components/chat/ContextMeter";
|
|
134
134
|
export { cn } from "./lib/cn";
|
|
135
135
|
export { formatBytes, formatTokens, formatCompactNumber } from "./lib/format";
|
|
@@ -153,7 +153,7 @@ export { EVENT_PALETTE, DEFAULT_PALETTE_KEY, isPaletteKey, paletteFor, } from ".
|
|
|
153
153
|
export { cellLabel, eventLabel, formatDateRange, longDate, monthTitle, timeOfDay, weekdayName, zoneLabel, } from "./components/calendar/format";
|
|
154
154
|
export { initialFocusDay, isInMonth, nextDayForKey, useGridNavigation, type GridNavigation, type GridNavigationOptions, } from "./components/calendar/use-grid-navigation";
|
|
155
155
|
export { AmbiguousTimeError, addDays, addDuration, addMonths, atMidnight, atTime, comparePlainDate, dayFraction, dayLengthMs, dayOfWeek, daysBetween, daysInMonth, endOfMonth, hoursInDay, instantAtFraction, instantToPlainDate, instantToPlainDateTime, isSameDate, isoDateString, isoDateTimeString, monthGridDays, nextDay, offsetAt, parsePlainDate, plainDateTimeToInstant, relativeAge, startOfDay, startOfMonth, startOfWeek, weekDays, type CalendarDuration, type Disambiguation, type Instant, type PlainDate, type PlainDateTime, type TimeZone, } from "./lib/time";
|
|
156
|
-
export { allDayBandSegment, dayKey, daySlots, isAllDay, packBand, packLanes, snapFractionToInstant, timeSegments, timedBandSegment, type AllDayEvent, type BandInput, type BandOptions, type BandPlacement, type BandResult, type BandSegment, type CalendarEvent, type CalendarEventId, type CalendarView, type DaySlot, type DragKind, type EventDraft, type EventPalette, type LaneInput, type LaneOptions, type LanePlacement, type PaletteEntry, type TimeSegment, type TimedEvent, type VisibleRange, } from "./lib/calendar";
|
|
156
|
+
export { allDayBandSegment, dayKey, daySlots, isAllDay, packBand, packLanes, snapFractionToInstant, timeSegments, timedBandSegment, type AllDayEvent, type BandInput, type BandOptions, type BandPlacement, type BandResult, type BandSegment, type CalendarEvent, type CalendarEventId, type CalendarView, type DaySlot, type DragKind, type EventDraft, type EventPalette, type LaneInput, type LaneOptions, type LanePlacement, type PaletteEntry, type PaletteKey, type TimeSegment, type TimedEvent, type VisibleRange, } from "./lib/calendar";
|
|
157
157
|
export { RBACProvider, useRBAC, Can, useHasPermission, AccountMenu, AccountMenuSection, TeamSwitcher, DevToolsPopover, RolePermissionMatrix, RoleEditorDialog, ProfileForm, ProfilePage, RolesPermissionsPage, MembersPanel, ChangePasswordForm, SessionsList, ApiKeysPanel, AgentKeysList, AccessRequestPanel, PermissionRequestPanel, RoleKeyPicker, isRoleSelectable, leastPrivilegeRoleId, InvitationsList, InviteMembersDialog, Brand, TeamSettingsForm, DangerZone, type RBACProviderProps, type RBACHookResult, type CanProps, type AccountMenuProps, type TeamSwitcherProps, type DevToolsPopoverProps, type RolePermissionMatrixProps, type RoleEditorDialogProps, type RoleEditorDialogSubmitInput, type ProfileFormProps, type ProfileFormAccount, type ProfileFormSaveInput, type ProfilePageProps, type RolesPermissionsPageProps, type MembersPanelProps, type MembersPanelMember, type ChangePasswordFormProps, type SessionsListProps, type Session, type ApiKeysPanelProps, type AgentKeysListProps, type ApiKey, type KeyGrant, type KeyRoleEditor, type AccessRequestPanelProps, type AccessRequest, type AccessRequestKind, type AccessRequestState, type ExpiredNote, type PermissionRequestPanelProps, type PermissionRequest, type RoleKeyPickerProps, type InvitationsListProps, type InvitationsListItem, type InvitationStatus, type InviteMembersDialogProps, type Permission, type Role, type User, type Team, type TeamMembership, type BrandProps, type TeamSettingsFormProps, type TeamSettingsFormTeam, type TeamSettingsFormSaveInput, type DangerZoneProps, } from "./components/rbac";
|
|
158
158
|
export { AuthLayout, AcceptInvitationCard, SignupCard, TermsAcceptance, LoginForm, ForgotPasswordForm, ResetPasswordForm, type AuthLayoutProps, type AcceptInvitationCardProps, type SignupCardProps, type TermsAcceptanceProps, type LoginFormProps, type ForgotPasswordFormProps, type ResetPasswordFormProps, } from "./components/auth";
|
|
159
159
|
export { UseCaseCard, RoadmapItemCard, RoadmapSwimlaneBoard, UseCaseLedgerPage, RoadmapPage, PhaseManager, TrackManager, deriveRoadmapItemStatus, isFullyBuilt, isUnbuilt, trackIds, trackProgress, toneForIndex, CATEGORY_TONES, type Domain, type Phase, type Track, type RoadmapItem, type RoadmapItemStatus, type UseCase, type UseCaseStatus, type UseCaseDecision, type UseCaseCardProps, type RoadmapItemCardProps, type RoadmapSwimlaneBoardProps, type UseCaseLedgerPageProps, type RoadmapPageProps, type PhaseManagerProps, type TrackManagerProps, } from "./components/roadmap";
|
|
@@ -168,3 +168,5 @@ export { OpenApiViewer, type OpenApiViewerProps, OperationCard, type OperationCa
|
|
|
168
168
|
export { defineRecordType, resetRecordTypes, useRecord, useRecords, useStaleness, write, writeAll, peekRecord, readState, readStaleness, subscribeToKey, subscribeToStaleness, retainKeys, sweepRecords, setRecordStoreTenant, getRecordStoreTenant, flushRecordNotifications, resetRecordStore, recordStoreStats, UNKNOWN_STATE, normalizeTypeName, normalizeTimestamp, recordKey, isRecordRef, type RecordRef, type ReadOptions, type RecordPayload, type RecordState, type RecordTypeOptions, type RecordTypeToken, type StalenessEntry, type WriteAllResult, type WriteOptions, type WriteResult, type WriteSource, type WriteVerdict, } from "./lib/records";
|
|
169
169
|
export { RealtimeProvider, useRealtime, useRealtimeEpoch, useRealtimeHealth, useRealtimeRegistry, SubscriptionRegistry, normalizeScope, scopeKey, subscriptionKey, readRealtimeEpoch, subscribeToRealtimeEpoch, subscribeToRealtimeEvents, resetRealtimeSignals, type RealtimeChannel, type RealtimeConnectionState, type RealtimeDiagnostic, type RealtimeEvent, type RealtimeHealth, type RealtimeProviderProps, type RealtimeScope, type RealtimeScopeInput, type RealtimeStatus, type RealtimeTransport, type RegistryOptions, type SubscriptionHealth, type SubscriptionLease, type SubscriptionRequest, } from "./lib/realtime";
|
|
170
170
|
export { useRecordRead, useRecordListRead, useRecordStoreSweep, applyMutationResult, optimisticWrite, beginOptimisticWrite, resetOptimisticWrites, type OptimisticHandle, type OptimisticWriteOptions, type OptimisticWriteSpec, type SlotDescriptor, acquireSlot, appendCreated, emptySlotSnapshot, readSlot, resetSlots, slotKeys, subscribeToSlot, writeSlot, RefetchRunner, registerActiveRead, resetActiveReads, type ActiveRead, type ListFetch, type ListFetchResult, type ListReadOptions, type ListReadResult, type ReadError, type RecordFetch, type RecordReadOptions, type RecordReadResult, type RunnerOptions, type SlotSnapshot, } from "./lib/reads";
|
|
171
|
+
export { ENGLISH_UI_STRINGS, UiLocaleProvider, useUiLocale, useUiStrings, type UiLocaleProviderProps, type UiLocaleValue, type UiStrings, } from "./lib/i18n";
|
|
172
|
+
export type { BooleanStrings, FormatsStrings, ReadErrorStrings, RelativeAgeStrings } from "./lib/i18n/areas/formats";
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
* NOT wired into the package's top-level `src/index.ts` — that barrel is
|
|
9
9
|
* owned by the contract's author, not this agent (see this round's brief).
|
|
10
10
|
*/
|
|
11
|
-
export type { BoardAccessors, BoardColumnDef, BoardEdge, BoardColumnId, BoardColumnModel, BoardItemId, BoardMove, BoardMoveTarget, BoardMoveRequest, BoardMoveSource, BoardMoveVerdict, BoardReorderLabels, UseBoardOptions, } from "./types";
|
|
11
|
+
export type { BoardAccessors, BoardColumnDef, BoardEdge, BoardColumnId, BoardColumnModel, BoardItemId, BoardMove, BoardMoveTarget, BoardMoveRequest, BoardMoveSource, BoardMoveOutcome, BoardMoveRejection, BoardMoveVerdict, BoardReorderLabels, UseBoardOptions, } from "./types";
|
|
12
12
|
export { buildBoardModel, type BoardModel } from "./model";
|
|
13
|
+
export { describeMoveRejection } from "./rejection";
|
|
13
14
|
export { moveAnchor, type MoveAnchor } from "./anchor";
|
|
14
15
|
export { columnLength, positionInColumn } from "./position";
|
|
15
16
|
export { applyBoardMoves, resolveMove, type ResolveMoveContext, type ResolvedMove, } from "./move";
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
* other shape — cross-column, or any bulk request — has no single shared
|
|
114
114
|
* array to splice, so it goes through the residual-and-insert pass above.
|
|
115
115
|
*/
|
|
116
|
-
import type { BoardAccessors, BoardColumnDef, BoardMove, BoardMoveRequest, BoardMoveVerdict } from "./types";
|
|
116
|
+
import type { BoardAccessors, BoardColumnDef, BoardMove, BoardMoveRequest, BoardMoveOutcome, BoardMoveVerdict } from "./types";
|
|
117
117
|
/** Everything `resolveMove` reads to prove a request is structurally real. */
|
|
118
118
|
export interface ResolveMoveContext<T> {
|
|
119
119
|
items: readonly T[];
|
|
@@ -123,7 +123,7 @@ export interface ResolveMoveContext<T> {
|
|
|
123
123
|
validateMove?: (request: BoardMoveRequest) => BoardMoveVerdict;
|
|
124
124
|
}
|
|
125
125
|
export interface ResolvedMove {
|
|
126
|
-
verdict:
|
|
126
|
+
verdict: BoardMoveOutcome;
|
|
127
127
|
/**
|
|
128
128
|
* The subset of the request's moves worth committing, in original order.
|
|
129
129
|
* Empty whenever there is nothing to write — either every move was a
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UiStrings } from "../i18n";
|
|
2
|
+
import type { BoardMoveRejection } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* DX-4740: the sentence a person reads for a refused move. The core answers with values
|
|
5
|
+
* (`BoardMoveRejection`); the provider's `moveRejected` strings word them. A consumer's own
|
|
6
|
+
* sentence passes through untouched.
|
|
7
|
+
*/
|
|
8
|
+
export declare function describeMoveRejection(strings: UiStrings["moveRejected"], locale: string, reason: BoardMoveRejection): string;
|
|
@@ -196,6 +196,52 @@ export type BoardMoveVerdict = {
|
|
|
196
196
|
ok: false;
|
|
197
197
|
reason: string;
|
|
198
198
|
};
|
|
199
|
+
/**
|
|
200
|
+
* DX-4740: WHY THE CORE REFUSED A MOVE, AS VALUES, NEVER AS A SENTENCE. The core
|
|
201
|
+
* (`resolveMove`) has no language; the component that shows the refusal words it
|
|
202
|
+
* through the provider's `moveRejected` strings. Only the refusals a person can
|
|
203
|
+
* reach are listed: a stale request (the card was moved or removed under them) and
|
|
204
|
+
* a consumer's own sentence. A column that is no longer declared is the same kind of
|
|
205
|
+
* stale request (a live update removed it during the drag). A malformed request (a negative
|
|
206
|
+
* index, a duplicate item, a multi-move request that is not `"bulk"`) is the
|
|
207
|
+
* caller's bug and throws an English `Error` from `resolveMove` instead.
|
|
208
|
+
*/
|
|
209
|
+
export type BoardMoveRejection = {
|
|
210
|
+
code: "unknownItem";
|
|
211
|
+
itemId: BoardItemId;
|
|
212
|
+
} | {
|
|
213
|
+
code: "unknownColumn";
|
|
214
|
+
columnId: BoardColumnId;
|
|
215
|
+
} | {
|
|
216
|
+
code: "wrongColumn";
|
|
217
|
+
itemId: BoardItemId;
|
|
218
|
+
actualColumnId: BoardColumnId;
|
|
219
|
+
claimedColumnId: BoardColumnId;
|
|
220
|
+
} | {
|
|
221
|
+
code: "fromIndexPastEnd";
|
|
222
|
+
itemId: BoardItemId;
|
|
223
|
+
index: number;
|
|
224
|
+
columnId: BoardColumnId;
|
|
225
|
+
count: number;
|
|
226
|
+
} | {
|
|
227
|
+
code: "toIndexPastEnd";
|
|
228
|
+
itemId: BoardItemId;
|
|
229
|
+
index: number;
|
|
230
|
+
columnId: BoardColumnId;
|
|
231
|
+
max: number;
|
|
232
|
+
}
|
|
233
|
+
/** The consumer's own sentence (`reorderLocked`, `validateMove`), already in their language: shown as is. */
|
|
234
|
+
| {
|
|
235
|
+
code: "consumer";
|
|
236
|
+
message: string;
|
|
237
|
+
};
|
|
238
|
+
/** What `resolveMove` and `useBoard().requestMove` answer: `BoardMoveVerdict`, with a structured reason. */
|
|
239
|
+
export type BoardMoveOutcome = {
|
|
240
|
+
ok: true;
|
|
241
|
+
} | {
|
|
242
|
+
ok: false;
|
|
243
|
+
reason: BoardMoveRejection;
|
|
244
|
+
};
|
|
199
245
|
/** A column as the core computes it, ready to render. */
|
|
200
246
|
export interface BoardColumnModel<T> {
|
|
201
247
|
id: BoardColumnId;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* the same way, mirroring why `requestMove` exists as a single funnel for
|
|
30
30
|
* moves rather than one per source.
|
|
31
31
|
*/
|
|
32
|
-
import type { BoardColumnModel, BoardItemId, BoardMoveRequest,
|
|
32
|
+
import type { BoardColumnModel, BoardItemId, BoardMoveRequest, BoardMoveOutcome, UseBoardOptions } from "./types";
|
|
33
33
|
export interface UseBoardResult<T> {
|
|
34
34
|
/** One entry per declared column, in `columns` order, ready to render. */
|
|
35
35
|
columns: readonly BoardColumnModel<T>[];
|
|
@@ -42,6 +42,6 @@ export interface UseBoardResult<T> {
|
|
|
42
42
|
setSelected: (ids: readonly BoardItemId[]) => void;
|
|
43
43
|
clearSelection: () => void;
|
|
44
44
|
/** The single funnel every input source calls. See the file header. */
|
|
45
|
-
requestMove: (request: BoardMoveRequest) =>
|
|
45
|
+
requestMove: (request: BoardMoveRequest) => BoardMoveOutcome;
|
|
46
46
|
}
|
|
47
47
|
export declare function useBoard<T>(options: UseBoardOptions<T>): UseBoardResult<T>;
|
|
@@ -120,6 +120,6 @@ export declare function createdEvent(anchor: CalendarTarget, target: CalendarTar
|
|
|
120
120
|
* "Moved to 2:30 PM, Wednesday" — the SLOT, not the fact that something moved.
|
|
121
121
|
* "Moved" alone tells a screen-reader user nothing they can act on.
|
|
122
122
|
*/
|
|
123
|
-
export declare function describeTarget(target: CalendarTarget, zone: TimeZone, locale
|
|
123
|
+
export declare function describeTarget(target: CalendarTarget, zone: TimeZone, locale: string): string;
|
|
124
124
|
/** Where in the grid a fraction sits, for the preview. Inverse of the resolve. */
|
|
125
125
|
export declare function fractionOf(zone: TimeZone, day: PlainDate, instant: Instant): number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { isAllDay, type AllDayEvent, type CalendarEvent, type CalendarEventId, type CalendarView, type DragKind, type EventDraft, type EventPalette, type PaletteEntry, type TimedEvent, type VisibleRange, } from "./types";
|
|
1
|
+
export { isAllDay, type AllDayEvent, type CalendarEvent, type CalendarEventId, type CalendarView, type DragKind, type EventDraft, type EventPalette, type PaletteEntry, type PaletteKey, type TimedEvent, type VisibleRange, } from "./types";
|
|
2
2
|
export { packLanes, type LaneInput, type LaneOptions, type LanePlacement } from "./lane-packer";
|
|
3
3
|
export { packBand, type BandInput, type BandOptions, type BandPlacement, type BandResult } from "./band-packer";
|
|
4
4
|
export { allDayBandSegment, dayKey, daySlots, snapFractionToInstant, timeSegments, timedBandSegment, type BandSegment, type DaySlot, type TimeSegment, } from "./segments";
|
|
@@ -138,10 +138,10 @@ export interface EventDraft {
|
|
|
138
138
|
* So the palette is curated, each pair is measured, and a consumer supplying
|
|
139
139
|
* arbitrary hex gets a documented refusal rather than an unreadable chip.
|
|
140
140
|
*/
|
|
141
|
+
/** The eight swatch keys. Each one's spoken name is a built-in string (`calendar.colors`), so colour is never the only cue. */
|
|
142
|
+
export type PaletteKey = "iris" | "aqua" | "mint" | "amber" | "rose" | "azure" | "orchid" | "slate";
|
|
141
143
|
export interface PaletteEntry {
|
|
142
|
-
readonly key:
|
|
143
|
-
/** Human name, used in the accessible label so colour is never the only cue. */
|
|
144
|
-
readonly label: string;
|
|
144
|
+
readonly key: PaletteKey;
|
|
145
145
|
readonly fill: string;
|
|
146
146
|
readonly text: string;
|
|
147
147
|
/** Border and left-edge accent; darker than `fill`, still AA against it. */
|
|
@@ -19,5 +19,10 @@ export declare function confidenceLevel(rating: number, scale: number): Confiden
|
|
|
19
19
|
* Each level's own word, the operator's scale (SG-843): 4 is "Confident" and 5
|
|
20
20
|
* is "Highly confident", so the two readings of "fine" stay distinguishable in
|
|
21
21
|
* words exactly as they are in colour and length.
|
|
22
|
+
*
|
|
23
|
+
* These are the ENGLISH words for a non-React consumer that cannot read the
|
|
24
|
+
* provider (the demand letter's Vue overlay bundles them, SG-901). Components
|
|
25
|
+
* read `confidenceBar.levels` from the provider, whose English set is this very
|
|
26
|
+
* object, so there is one place the English lives.
|
|
22
27
|
*/
|
|
23
28
|
export declare const CONFIDENCE_LEVEL_LABELS: Readonly<Record<ConfidenceLevel, string>>;
|
|
@@ -15,6 +15,8 @@ export interface DragAnnouncementContext {
|
|
|
15
15
|
containerLabel: string;
|
|
16
16
|
/** 1-based, as spoken, in the WHOLE container — a windowed container reports its real offset and length (DX-4540). */
|
|
17
17
|
position: number;
|
|
18
|
+
/** `position` written the way the active locale writes numbers (DX-4740): what a message prints. */
|
|
19
|
+
positionText: string;
|
|
18
20
|
/**
|
|
19
21
|
* The list length WITH the carried item counted in it, so `position` is never
|
|
20
22
|
* "4 of 3". The session's own indices exclude the carried item — see the
|
|
@@ -22,33 +24,14 @@ export interface DragAnnouncementContext {
|
|
|
22
24
|
* user a list is one shorter than the one they are looking at.
|
|
23
25
|
*/
|
|
24
26
|
total: number;
|
|
27
|
+
/** `total` written the way the active locale writes numbers (DX-4740): what a message prints. */
|
|
28
|
+
totalText: string;
|
|
25
29
|
}
|
|
26
|
-
export interface DragStrings {
|
|
27
|
-
/** Rendered by `<DragInstructions>`; referenced by each handle's `aria-describedby`. */
|
|
28
|
-
instructions: string;
|
|
29
|
-
picked: (c: DragAnnouncementContext) => string;
|
|
30
|
-
moved: (c: DragAnnouncementContext) => string;
|
|
31
|
-
dropped: (c: DragAnnouncementContext) => string;
|
|
32
|
-
/** `moved`, for a card held over another container that takes it as a whole (`crossDrop: "lane"`): no position is spoken. */
|
|
33
|
-
movedToLane: (c: DragAnnouncementContext) => string;
|
|
34
|
-
/** `dropped`, for a card released over such a container. */
|
|
35
|
-
droppedInLane: (c: DragAnnouncementContext) => string;
|
|
36
|
-
/** Describes the item's ORIGINAL position — cancel is a restore, not a move. */
|
|
37
|
-
cancelled: (c: DragAnnouncementContext) => string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Exported as data so a consumer can read one message, override one message, or
|
|
41
|
-
* assert on the set — a grammar hidden inside the component that renders it can
|
|
42
|
-
* only be checked by rendering it.
|
|
43
|
-
*/
|
|
44
|
-
export declare const DEFAULT_DRAG_STRINGS: DragStrings;
|
|
45
30
|
export interface DragAnnouncementOptions {
|
|
46
31
|
/** Human name for an item. Falls back to the id. */
|
|
47
32
|
labelOf?: (id: DragId) => string;
|
|
48
33
|
/** Human name for a container. Falls back to the id. */
|
|
49
34
|
containerLabelOf?: (id: ContainerId) => string;
|
|
50
|
-
/** Override any subset of the grammar — localisation, or a domain noun. */
|
|
51
|
-
strings?: Partial<DragStrings>;
|
|
52
35
|
}
|
|
53
36
|
/**
|
|
54
37
|
* One id for the whole page, deliberately not `useId()`.
|
|
@@ -117,7 +100,6 @@ export type DragLiveRegionProps = {
|
|
|
117
100
|
*/
|
|
118
101
|
export declare function DragLiveRegion({ session, ...options }: DragLiveRegionProps): import("react").JSX.Element;
|
|
119
102
|
export interface DragInstructionsProps {
|
|
120
|
-
strings?: Partial<DragStrings>;
|
|
121
103
|
/**
|
|
122
104
|
* The element id each handle's `aria-describedby` points at.
|
|
123
105
|
*
|
|
@@ -139,4 +121,4 @@ export interface DragInstructionsProps {
|
|
|
139
121
|
* of the rest of this file. Visually hidden because the same information is
|
|
140
122
|
* carried for sighted users by the cursor and the moving card.
|
|
141
123
|
*/
|
|
142
|
-
export declare function DragInstructions({
|
|
124
|
+
export declare function DragInstructions({ id }?: DragInstructionsProps): import("react").JSX.Element;
|
|
@@ -14,4 +14,4 @@ export { attachPointerSensor, attachSessionWindowListeners, type PointerActivati
|
|
|
14
14
|
export { attachKeyboardSensor, type KeyboardSensorOptions, } from "./sensors/keyboard";
|
|
15
15
|
export { attachAutoScroll, scrollVelocity, type AutoScrollOptions, } from "./autoscroll";
|
|
16
16
|
export { DragSessionProvider, useCreateDragSession, useDragSession, useDragState, useDragLive, useDraggable, useDropContainer, type UseDraggableOptions, type UseDraggableResult, type UseDropContainerOptions, type UseDropContainerResult, } from "./use-drag";
|
|
17
|
-
export {
|
|
17
|
+
export { DRAG_INSTRUCTIONS_ID, DragInstructions, DragLiveRegion, useDragAnnouncements, type DragAnnouncementContext, type DragAnnouncementOptions, type DragAnnouncements, type DragInstructionsProps, type DragLiveRegionProps, } from "./announce";
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
/** Binary units, because these are file sizes and every OS reports them this way. */
|
|
2
|
-
export declare function formatBytes(bytes: number): string;
|
|
2
|
+
export declare function formatBytes(bytes: number, locale: string): string;
|
|
3
3
|
/**
|
|
4
|
-
* 241_600 → "241.
|
|
4
|
+
* 241_600 → "241.6K". A thin, token-domain-named wrapper — see
|
|
5
5
|
* `formatCompactNumber` below for the shared algorithm and its own reasoning.
|
|
6
6
|
* Kept as its own function (rather than every call site switching to the
|
|
7
7
|
* generic one directly) because "tokens" is a real vocabulary word in this
|
|
8
8
|
* package's chat components, and renaming every call site to the generic name
|
|
9
9
|
* would cost real diff for zero behavioral gain.
|
|
10
10
|
*/
|
|
11
|
-
export declare function formatTokens(tokens: number): string;
|
|
11
|
+
export declare function formatTokens(tokens: number, locale: string): string;
|
|
12
12
|
/**
|
|
13
|
-
* A GENERIC large count, abbreviated the way
|
|
14
|
-
* `850` → `"850"`, `1_100` → `"1.
|
|
13
|
+
* A GENERIC large count, abbreviated the way the locale writes it: in en-US
|
|
14
|
+
* `850` → `"850"`, `1_100` → `"1.1K"`, `3_400_000` → `"3.4M"`,
|
|
15
15
|
* `4_400_000_000` → `"4.4B"`. `null` / `undefined` / non-finite → `"—"`.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* already used for a token budget; the difference that justified a SEPARATE,
|
|
22
|
-
* generic export rather than just widening that one is scope: `formatTokens`
|
|
23
|
-
* is a token-budget's own vocabulary (a live context meter), while this
|
|
24
|
-
* function is for any large count a screen needs to abbreviate — a field
|
|
25
|
-
* tally, a donut's fraction, a record count — with no token-specific meaning
|
|
26
|
-
* attached to its name.
|
|
17
|
+
* DX-4740: THE SUFFIXES COME FROM `Intl` (`notation: "compact"`), NOT FROM A
|
|
18
|
+
* TABLE HERE. A hand-written T/B/M/k ladder is English: "B" for 10^9 reads as
|
|
19
|
+
* "billón" (10^12) to an es-AR reader, and every other language has its own
|
|
20
|
+
* words for thousand and million. en-US now writes an uppercase "K".
|
|
27
21
|
*
|
|
28
|
-
*
|
|
22
|
+
* One decimal at most, trimmed of a trailing ".0" (`1_000_000` → `"1M"`, not
|
|
23
|
+
* `"1.0M"`), and exact below 1,000 — a count small enough to read digit-by-digit
|
|
24
|
+
* gets no abbreviation at all, since "850" is not improved by becoming "0.9K".
|
|
25
|
+
* `formatTokens` is the token-budget's name for the same thing; this one is for
|
|
26
|
+
* any large count a screen needs to abbreviate — a field tally, a donut's
|
|
27
|
+
* fraction, a record count.
|
|
28
|
+
*
|
|
29
|
+
* NEGATIVE VALUES keep their sign (`-1_100` → `"-1.1K"`) rather than being
|
|
29
30
|
* treated as absent — a generic count utility cannot assume its caller's
|
|
30
|
-
* domain never has one
|
|
31
|
+
* domain never has one.
|
|
31
32
|
*/
|
|
32
|
-
export declare function formatCompactNumber(value: number | null | undefined): string;
|
|
33
|
+
export declare function formatCompactNumber(value: number | null | undefined, locale: string): string;
|