@tensor_1/react 2.38.0 → 2.40.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.
Files changed (60) hide show
  1. package/README.md +65 -0
  2. package/dist/{chart-theme-Cl0IrkKQ.d.cts → ChartCore-BKK2HEfi.d.cts} +77 -50
  3. package/dist/chart-analytic-guide.d.ts +6 -0
  4. package/dist/chart-analytic-guide.js +10 -0
  5. package/dist/chart-analytic-model.d.ts +145 -0
  6. package/dist/chart-analytic-model.js +259 -0
  7. package/dist/chart-analytic.cjs +1379 -0
  8. package/dist/chart-analytic.d.cts +339 -0
  9. package/dist/chart-analytic.d.ts +19 -0
  10. package/dist/chart-analytic.js +95 -0
  11. package/dist/chart-panels-model.d.ts +92 -0
  12. package/dist/chart-panels-model.js +284 -0
  13. package/dist/chart-preset.cjs +41 -4
  14. package/dist/chart-preset.d.cts +2 -2
  15. package/dist/chart-preset.d.ts +1 -1
  16. package/dist/chart-stats-o4zDhpVm.d.cts +46 -0
  17. package/dist/chart-stats.d.ts +46 -0
  18. package/dist/chart-stats.js +89 -0
  19. package/dist/chart-theme.d.ts +3 -0
  20. package/dist/chart-theme.js +2 -0
  21. package/dist/chart.cjs +41 -4
  22. package/dist/chart.d.cts +2 -2
  23. package/dist/chart.d.ts +1 -1
  24. package/dist/components/Chart.d.ts +1 -1
  25. package/dist/components/ChartCore.d.ts +23 -3
  26. package/dist/components/ChartCore.js +40 -5
  27. package/dist/components/ChartPanels.d.ts +52 -0
  28. package/dist/components/ChartPanels.js +170 -0
  29. package/dist/components/Comments.d.ts +4 -1
  30. package/dist/components/Comments.js +3 -2
  31. package/dist/components/InsightCard.d.ts +86 -0
  32. package/dist/components/InsightCard.js +118 -0
  33. package/dist/components/Markdown.d.ts +9 -2
  34. package/dist/components/Markdown.js +16 -2
  35. package/dist/components/RichTextEditor.d.ts +17 -0
  36. package/dist/components/RichTextEditor.js +179 -11
  37. package/dist/components/ToggleRow.d.ts +8 -1
  38. package/dist/components/ToggleRow.js +17 -3
  39. package/dist/correlation-scatter-model.d.ts +68 -0
  40. package/dist/correlation-scatter-model.js +179 -0
  41. package/dist/icons/Icon.d.ts +17 -17
  42. package/dist/index.cjs +1663 -1427
  43. package/dist/index.d.cts +96 -3
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.js +10 -0
  46. package/dist/markdown-model-Cuwi6pIk.d.cts +110 -0
  47. package/dist/markdown-model.d.ts +38 -1
  48. package/dist/markdown-model.js +67 -0
  49. package/dist/markdown.cjs +90 -4
  50. package/dist/markdown.d.cts +11 -75
  51. package/dist/markdown.d.ts +1 -1
  52. package/dist/markdown.js +16 -2
  53. package/dist/rich-text/mention.d.ts +14 -0
  54. package/dist/rich-text/mention.js +57 -0
  55. package/dist/rich-text/pipeline.js +4 -1
  56. package/dist/rich-text.cjs +1795 -1483
  57. package/dist/rich-text.d.cts +27 -1
  58. package/dist/rich-text.d.ts +3 -0
  59. package/dist/rich-text.js +6 -0
  60. package/package.json +6 -1
package/dist/index.d.cts CHANGED
@@ -2,6 +2,7 @@ import * as react from 'react';
2
2
  import { RefObject, AnchorHTMLAttributes, ReactNode, ButtonHTMLAttributes, HTMLAttributes, AriaAttributes, CSSProperties, SelectHTMLAttributes, Ref, InputHTMLAttributes, TextareaHTMLAttributes, MouseEvent, DetailsHTMLAttributes, LiHTMLAttributes, TdHTMLAttributes, TableHTMLAttributes, ThHTMLAttributes, ReactElement } from 'react';
3
3
  import { P as Placement } from './overlay-position-2Afke51l.cjs';
4
4
  export { A as Align, a as PositionOptions, b as PositionResult, R as Rect, S as Side, c as Size, d as computePosition } from './overlay-position-2Afke51l.cjs';
5
+ export { C as ChartStatPoint, L as LinearFit, P as PredictionBandPoint, l as linearFit, n as normalQuantile, p as predictionBand, q as quantiles, s as studentTQuantile } from './chart-stats-o4zDhpVm.cjs';
5
6
 
6
7
  declare function cx(...args: (string | false | null | undefined | 0)[]): string;
7
8
 
@@ -3219,12 +3220,19 @@ interface RelatedLinksProps extends Omit<HTMLAttributes<HTMLElement>, 'title' |
3219
3220
  declare function RelatedLinks({ title, items, className, ...props }: RelatedLinksProps): react.JSX.Element;
3220
3221
 
3221
3222
  interface ToggleRowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
3223
+ /** The row's visible label. It is the switch's `<label>`: clicking it flips the switch, and it names the switch. */
3222
3224
  label: ReactNode;
3225
+ /** Shown under the label and announced as the switch's description (`aria-describedby`). */
3223
3226
  description?: ReactNode;
3224
3227
  checked: boolean;
3225
3228
  onCheckedChange: (checked: boolean) => void;
3226
3229
  disabled?: boolean;
3227
- accessibleLabel: string;
3230
+ /**
3231
+ * The switch's name when the visible label is not text (an icon, an image).
3232
+ * Leave it out for a text label: the label already names the switch, and a
3233
+ * repeated `aria-label` would replace it.
3234
+ */
3235
+ accessibleLabel?: string;
3228
3236
  }
3229
3237
  declare function ToggleRow({ label, description, checked, onCheckedChange, disabled, accessibleLabel, className, ...props }: ToggleRowProps): react.JSX.Element;
3230
3238
 
@@ -4019,6 +4027,88 @@ interface StatProps extends HTMLAttributes<HTMLElement> {
4019
4027
  */
4020
4028
  declare const Stat: react.ForwardRefExoticComponent<StatProps & react.RefAttributes<HTMLElement>>;
4021
4029
 
4030
+ type InsightStatusTone = 'ok' | 'warning' | 'critical' | 'unknown';
4031
+ interface InsightStatus {
4032
+ tone: InsightStatusTone;
4033
+ /** The words: the status is always readable without its colour or icon. */
4034
+ label: string;
4035
+ }
4036
+ interface InsightComparison {
4037
+ text: ReactNode;
4038
+ /** Direction × whether that direction is good; `neutral` when it is neither. */
4039
+ tone?: 'neutral' | 'positive' | 'negative' | 'warning';
4040
+ }
4041
+ interface InsightTarget {
4042
+ actual: number;
4043
+ target: number;
4044
+ /** Qualitative bands from the start of the scale, e.g. [[0, 10], [10, 15], [15, 24]]. */
4045
+ ranges?: [number, number][];
4046
+ /** The scale's end. Default: the larger of the last range, the actual and the target, plus 10 %. */
4047
+ max?: number;
4048
+ }
4049
+ interface InsightKpi {
4050
+ value: ReactNode;
4051
+ label: ReactNode;
4052
+ comparison?: InsightComparison;
4053
+ target?: InsightTarget;
4054
+ }
4055
+ interface InsightCoverage {
4056
+ covered: number;
4057
+ total: number;
4058
+ /** What was counted, e.g. "changes classified". */
4059
+ note: ReactNode;
4060
+ /** Shown when the last period is still filling up. */
4061
+ partialPeriod?: ReactNode;
4062
+ }
4063
+ /** Every word the card writes itself. English defaults in {@link DEFAULT_INSIGHT_CARD_LABELS}. */
4064
+ interface InsightCardLabels {
4065
+ /** "412 of 431 changes classified (96%)". */
4066
+ coverage: (covered: number, total: number, percent: number, note: ReactNode) => ReactNode;
4067
+ /** The bullet's accessible description. */
4068
+ bullet: (actual: string, target: string) => string;
4069
+ source: string;
4070
+ updated: string;
4071
+ kpis: string;
4072
+ formatNumber: (value: number) => string;
4073
+ }
4074
+ declare const DEFAULT_INSIGHT_CARD_LABELS: InsightCardLabels;
4075
+ interface InsightCardProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
4076
+ eyebrow?: ReactNode;
4077
+ /** The answer, as a sentence (≤ 10 words reads best). */
4078
+ headline: ReactNode;
4079
+ /** The implication and the suggested decision. */
4080
+ sowhat?: ReactNode;
4081
+ status?: InsightStatus;
4082
+ kpis?: InsightKpi[];
4083
+ coverage?: InsightCoverage;
4084
+ /** One drill-down action (a link or button). */
4085
+ actions?: ReactNode;
4086
+ source?: ReactNode;
4087
+ updated?: ReactNode;
4088
+ /** `split` puts the aside on the right when the card is ≥ 60rem (960 px) wide; below, it stacks. */
4089
+ layout?: 'stack' | 'split';
4090
+ /**
4091
+ * `card` (default) draws its own border and surface. `plain` draws none, for a card that sits
4092
+ * inside another frame (a dashboard widget), so there is no card inside a card.
4093
+ */
4094
+ variant?: 'card' | 'plain';
4095
+ aside?: ReactNode;
4096
+ /** The headline's heading level. Default 3. */
4097
+ headingLevel?: 2 | 3 | 4;
4098
+ labels?: Partial<InsightCardLabels>;
4099
+ children?: ReactNode;
4100
+ }
4101
+ declare function InsightCard({ eyebrow, headline, sowhat, status, kpis, coverage, actions, source, updated, layout, variant, aside, headingLevel, labels: labelOverrides, className, children, ...props }: InsightCardProps): react.JSX.Element;
4102
+ interface BulletProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'>, InsightTarget {
4103
+ /** The accessible description, e.g. "18.7 h against a target of 15 h". */
4104
+ label: string;
4105
+ }
4106
+ /**
4107
+ * A bullet graph (Few): grey qualitative bands, a dark bar for the actual, a tick for the target.
4108
+ * It replaces a gauge: the comparison is a length on one scale, not an angle.
4109
+ */
4110
+ declare function Bullet({ actual, target, ranges, max, label, className, style, ...props }: BulletProps): react.JSX.Element;
4111
+
4022
4112
  interface ChipProps extends Omit<HTMLAttributes<HTMLElement>, 'onClick'> {
4023
4113
  /** The chip's text. */
4024
4114
  children?: ReactNode;
@@ -4371,7 +4461,10 @@ interface CommentsProps extends HTMLAttributes<HTMLDivElement> {
4371
4461
  */
4372
4462
  declare function Comments({ children, className, ...props }: CommentsProps): react.JSX.Element;
4373
4463
  interface CommentProps extends HTMLAttributes<HTMLDivElement> {
4374
- /** Usually an `<Avatar />` (the grid reserves the leading column). */
4464
+ /**
4465
+ * Usually an `<Avatar />` (the grid reserves the leading column). `false` drops the
4466
+ * column, for a comment that sits on a rail which already marks each row (a timeline).
4467
+ */
4375
4468
  avatar?: ReactNode;
4376
4469
  author?: ReactNode;
4377
4470
  meta?: ReactNode;
@@ -5865,4 +5958,4 @@ declare function hsvToHex(value: HsvColor): string;
5865
5958
  declare function contrastRatio(background: string, foreground: string): number | undefined;
5866
5959
  declare function meetsContrast(background: string, foreground: string, minimum?: number): boolean;
5867
5960
 
5868
- export { type AccessStateProps, Alert, type AlertProps, type AlertTone, AppShell, type AppShellProps, type AppliedBrandProfileSnapshot, type AsyncOperationState, AsyncOperationStatus, type AsyncOperationStatusProps, Attachment, type AttachmentLabels, AttachmentList, type AttachmentListProps, type AttachmentProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarPresence, type AvatarProps, type BoundedRelationshipGraph, type BrandProfile, BrandProfileEditor, type BrandProfileEditorLabels, type BrandProfileEditorProps, type BrandProfileLogo, type BrandProfileTypography, BrandProfiles, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BuilderCanvas, type BuilderCanvasItem, type BuilderCanvasLabels, type BuilderCanvasProps, type BuilderPaletteItem, BulkBar, type BulkBarProps, Button, ButtonGroup, type ButtonGroupProps, ButtonLink, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, type CalendarDay, type CalendarWeekday, Card, CardLink, type CardLinkProps, type CardProps, CellStrong, CellSub, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, CollapsibleSection, type CollapsibleSectionProps, ColorPicker, type ColorPickerLabels, type ColorPickerProps, type ColumnFilter, Combobox, type ComboboxOption, type ComboboxProps, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, Comment, type CommentProps, Comments, type CommentsProps, Composer, ComposerBar, type ComposerBarProps, type ComposerProps, ConfirmDialog, type ConfirmDialogProps, ContentList, ContentListItem, type ContentListItemProps, type ContentListProps, CopyButton, type CopyButtonProps, DAY, DEFAULT_ATTACHMENT_LABELS, DEFAULT_BRAND_PROFILE_EDITOR_LABELS, DEFAULT_BUILDER_CANVAS_LABELS, DEFAULT_COLOR_PICKER_LABELS, DEFAULT_DATE_PICKER_LABELS, DEFAULT_DATE_RANGE_PICKER_LABELS, DEFAULT_DATE_TIME_PICKER_LABELS, DEFAULT_DIFF_VIEWER_LABELS, DEFAULT_ENTITY_PICKER_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILTER_EDITOR_LABELS, DEFAULT_FILTER_SUMMARY_LABELS, DEFAULT_INLINE_EDIT_LABELS, DEFAULT_LIGHTBOX_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_PAGINATION_LABELS, DEFAULT_PRESENCE_LABELS, DEFAULT_RELATIONSHIP_GRAPH_LABELS, DEFAULT_RULE_BUILDER_LABELS, DEFAULT_RULE_SUMMARY_WORDS, DEFAULT_RULE_VALIDATION_MESSAGES, DEFAULT_SAVE_STATUS_LABELS, DEFAULT_SCHEDULING_CALENDAR_LABELS, DEFAULT_SCHEDULING_TIMELINE_LABELS, DEFAULT_STEP_STATE_LABELS, DEFAULT_TEXT_DIFF_LABELS, DEFAULT_TREE_LABELS, DashboardGrid, type DashboardGridBreakpoint, type DashboardGridColumnCount, type DashboardGridColumns, type DashboardGridGap, DashboardGridItem, type DashboardGridItemProps, type DashboardGridProps, type DashboardGridSpan, type DateInputProblem, type DatePart, DatePicker, type DatePickerLabels, type DatePickerProps, DateRangePicker, type DateRangePickerLabels, type DateRangePickerProps, type DateRangeValue, DateTimePicker, type DateTimePickerLabels, type DateTimePickerProps, type DaySpanLayout, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListItem, type DescriptionListProps, DetailLayout, type DetailLayoutProps, DetailPage, type DetailPageLinkProps, type DetailPageMetric, type DetailPageProps, type DetailPageTab, type DiffEntry, type DiffKind, type DiffResolution, type DiffSummary, DiffViewer, type DiffViewerLabels, type DiffViewerProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, EntityPicker, type EntityPickerLabels, type EntityPickerProps, type EntityPickerSearchResult, ErrorState, type ErrorStateProps, EventRow, type EventRowProps, ExpandToggle, type ExpandToggleProps, FeaturedRundown, FeaturedRundownItem, type FeaturedRundownItemProps, type FeaturedRundownProps, FeaturedStage, type FeaturedStageProps, Field, type FieldProps, type FileRejection, type FileRejectionReason, type FileSizeFormatter, type FileSizeOptions, FileUpload, type FileUploadItem, type FileUploadLabels, type FileUploadProps, type FileUploadStatus, type FilterChoice, FilterEditor, type FilterEditorLabels, type FilterEditorProps, type FilterField, type FilterKind, type FilterOp, type FilterOption, FilterPopover, type FilterPopoverProps, type FilterPreset, type FilterSummaryLabels, type FilterValue, type FilterValueKind, FilteredEmptyState, type FlatNode, Flow, FlowNode, type FlowNodeProps, type FlowNodeState, type FlowProps, type FlowVariant, type FoldedText, ForbiddenState, HOUR, Heartbeat, type HeartbeatProps, type HeartbeatState, Highlighted, type HighlightedProps, type HsvColor, Inbox, InboxDetail, type InboxDetailProps, InboxItem, type InboxItemProps, InboxList, type InboxListProps, type InboxProps, InfoTip, type InfoTipProps, InlineEdit, type InlineEditEditorProps, type InlineEditLabels, type InlineEditProps, Input, InputGroup, type InputGroupProps, type InputProps, type JsonPrimitive, type JsonValue, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, type KanbanMoveDirection, type KanbanProps, Kbd, KbdCombo, type KbdComboProps, type KbdPlatform, type KbdProps, Label, type LabelProps, type LaneCluster, type LaneInterval, type LanePlacement, type LayeredColumn, type LayeredEdgeClassification, type LayeredEdgeKind, type LayeredItem, type LayeredLayout, type LayeredLayoutOptions, type LayeredNavigationKey, type LayoutLaneOptions, type LayoutMonthSpansOptions, LicensePositionBar, type LicensePositionBarProps, Lightbox, type LightboxItem, type LightboxLabels, type LightboxProps, List, ListItem, type ListItemProps, type ListProps, LiveIndicator, type LiveIndicatorProps, LoadingState, type LoadingStateProps, Mark, type MarkProps, type MatchBulkResult, MatchReview, type MatchReviewAction, type MatchReviewCandidate, type MatchReviewField, type MatchReviewLabels, type MatchReviewProps, Menu, MenuGroup, type MenuGroupProps, MenuItem, type MenuItemAttributes, MenuItemCheckbox, type MenuItemCheckboxProps, type MenuItemProps, MenuItemRadio, type MenuItemRadioProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuSeparator, Meter, type MeterProps, type MeterTone, MetricInput, type MetricInputProps, Modal, type ModalProps, type MonthSpanGroup, type MonthSpanInput, type MonthSpanLayout, type MoveProposal, NUMBER_FILTER_OPERATORS, type NavFavouriteItem, NavFavourites, type NavFavouritesLabels, type NavFavouritesProps, NavGroup, type NavGroupProps, NavItem, type NavItemProps, NewsLead, type NewsLeadProps, NotFoundState, Note, type NoteProps, type NoteTone, NoticeQueue, type NoticeQueueProps, type NumberFilterOperator, type PackLanesOptions, type PackedLanes, PageHeader, type PageHeaderProps, PageIntro, type PageIntroProps, Pagination, type PaginationLabels, type PaginationProps, Peek, type PeekProps, type PillSize, type PillTone, type PillTreatment, Pipeline, type PipelineProps, PipelineStage, type PipelineStageProps, type PipelineStageState, type PlacedDaySpan, type PlacedMonthSpan, type PlacedSpan, Placement, Popconfirm, type PopconfirmProps, Popover, type PopoverProps, type PositionedRelationshipNode, PresenceDot, type PresenceDotProps, type Primitive, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Prose, type ProseProps, Radio, RadioCard, type RadioCardProps, RadioGroup, type RadioGroupProps, type RadioProps, type RelatedLinkItem, RelatedLinks, type RelatedLinksProps, RelationshipGraph, type RelationshipGraphArrow, type RelationshipGraphCluster, type RelationshipGraphEdge, type RelationshipGraphLabels, type RelationshipGraphLegendItem, type RelationshipGraphNode, type RelationshipGraphProps, RelativeTime, type RelativeTimeFormatContext, type RelativeTimeProps, type RelativeTimeUnit, type RelativeTimeValue, ResourceGrid, type ResourceGridProps, type RgbColor, type RoutedEdge, type Row, RowAction, type RowActionProps, RowActions, type RowActionsProps, type RuleAction, type RuleActionDefinition, RuleBuilder, type RuleBuilderLabels, type RuleBuilderProps, type RuleCheck, type RuleCondition, type RuleDefinition, type RuleFieldDefinition, type RuleGroup, type RuleOperatorDefinition, type RuleSummaryWords, type RuleValidationIssue, type RuleValidationOptions, type RuleValueEditorProps, SaveStatus, type SaveStatusLabels, type SaveStatusProps, type SaveStatusState, type SavedViewItem, SavedViewMenu, type SavedViewMenuProps, type SavedViewSection, type SchedulingAgendaGroup, type SchedulingBand, SchedulingCalendar, type SchedulingCalendarDay, type SchedulingCalendarEntry, type SchedulingCalendarLabels, type SchedulingCalendarOverlay, type SchedulingCalendarProps, type SchedulingCalendarView, type SchedulingDatePart, type SchedulingEntryState, type SchedulingLegendItem, type SchedulingMarker, type SchedulingMarkerEmphasis, type SchedulingOverlayKind, type SchedulingOverlayPattern, type SchedulingStatus, SchedulingTimeline, type SchedulingTimelineGroup, type SchedulingTimelineItem, type SchedulingTimelineLabels, type SchedulingTimelineLane, type SchedulingTimelineMarker, type SchedulingTimelineOverlay, type SchedulingTimelineOverlayKind, type SchedulingTimelineProps, type SearchSegment, SearchSuggest, type SearchSuggestAction, type SearchSuggestOption, type SearchSuggestProps, SectionHead, type SectionHeadProps, type Segment, Segmented, SegmentedOption, type SegmentedOptionProps, type SegmentedProps, Select, type SelectAllState, type SelectGroup, type SelectLabels, type SelectOption, type SelectProps, type ShellNav, Sidebar, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SortDir, type SortDirection, type SortKey, Spinner, type SpinnerProps, StarButton, type StarButtonProps, Stat, StatLine, type StatLineItem, type StatLineProps, type StatProps, type StatTrend, type StateVariant, StatusPill, type StatusPillProps, StatusRow, type StatusRowProps, Step, type StepProps, type StepState, type StepStateLabels, Steps, type StepsProps, SubNavItem, type SubNavItemProps, type SummarizeFilterOptions, Switch, type SwitchProps, TEXT_FILTER_OPERATORS, TOAST_LEAVE_MS, TOP_LANE_CROSS_MIDNIGHT_MINUTES, Tab, TabPanel, type TabPanelProps, type TabProps, Table, type TableDensity, type TableProps, TableWrap, type TableWrapProps, Tabs, type TabsProps, Td, type TdProps, TextDiff, type TextDiffGranularity, type TextDiffLabels, type TextDiffLine, type TextDiffOp, type TextDiffOptions, type TextDiffProps, type TextDiffResult, type TextDiffRow, type TextDiffSegment, type TextFilterOperator, Textarea, type TextareaProps, Th, type ThProps, type TimeGridDayLayout, type TimeGridEntryContext, type TimeGridEntryInput, type TimeGridPart, type TimeGridSegment, Timeline, TimelineItem, type TimelineItemProps, type TimelineProps, type TimelineRange, type TimelineScale, type TimelineSpan, type TimelineSubTick, type TimelineTick, Toast, type ToastAction, type ToastApi, type ToastDismissReason, type ToastKind, type ToastOptions, type ToastPromiseMessages, type ToastProps, type ToastRecord, type ToastStore, type ToastTone, Toaster, type ToasterProps, ToggleRow, type ToggleRowProps, Tooltip, type TooltipProps, Tr, type TrProps, Tree, type TreeLabels, type TreeLike, type TreeNavAction, type TreeNodeData, type TreeNodeProps, type TreeProps, type UixLabels, UixLabelsProvider, type UixLabelsProviderProps, type UixLinkProps, type UixRenderLink, type UndoableToastOptions, type UseAnchoredPositionOptions, type UseTableOptions, type UseTableResult, type UseVirtualRowsOptions, type UseVirtualRowsResult, UserChip, type UserChipProps, ViewMenu, type ViewMenuColumn, type ViewMenuColumnLabels, type ViewMenuProps, type ViewState, type VirtualWindow, type ZonedDateSpan, type ZonedDayBounds, type ZonedDayShift, type ZonedDaySpan, type ZonedHourSlot, addCalendarDays, addCalendarMonths, addZonedDays, appendRuleNode, applyBrandProfile, applyFilters, boundRelationshipGraph, buildMonthGrid, buildThreeWayDiff, cachedDateTimeFormat, clampMetricValue, clampWidth, classifyLayeredEdges, clusterIdFor, contrastRatio, createToastApi, createToastStore, cx, dashboardGridClassName, dashboardGridItemClassName, dateOrder, datePattern, defaultTimelineStep, diffText, diffTokens, emptyFilterValue, enumerateDateKeys, enumerateDateSpan, fileKind, fileMatchesAccept, filterComboboxOptions, findRuleNodeDepth, flattenTree, foldForSearch, formatDateKey, formatFileSize, hexToRgb, highlightSegments, hsvToHex, hsvToRgb, isDateInRange, isDateUnavailable, isFilterEmpty, isRuleGroup, isValidDateKey, itemDaySpan, joinDateTime, layeredNeighbor, layoutDaySpans, layoutLane, layoutLayeredGraph, layoutMonthSpans, layoutRelationshipGraph, layoutTimeGridDay, mapRuleGroup, matchFilter, matchFilterPreset, meetsContrast, mergePinned, moveRuleNode, multiSort, nextSortDir, normalizeHex, packLanes, parseDateInput, parseDateValue, parseMetricValue, parseView, partitionFiles, pixelsToMs, placeSpan, placesInTopLane, proposeMove, rankOverflow, relationshipNeighbors, relativeTimeValue, removeRuleNode, renderPlainLink, reorder, restoreBrandProfile, rgbToHex, rgbToHsv, ruleDepth, schedulingGridDays, searchRows, searchSegments, selectAllState, selectRangeDate, serializeView, setRuleCombinator, shiftSpan, shouldVirtualize, snapToStep, splitDateTime, startOfMonth, stepMetricValue, summarizeDiff, summarizeFilter, summarizeRule, textDiffRows, timeZoneName, timelineRepeatedHourOffset, timelineStepDelta, timelineSubTicks, timelineTicks, toDateKey, toast, toggleId, togglePage, toggleSort, tokenizeText, traverseRelationshipNode, treeNav, useAnchoredPosition, useDialog, useTable, useUixLabels, useVirtualRows, validateRuleDefinition, virtualWindow, wrapEdgeLabel, zonedDateKey, zonedDateSpan, zonedDayBounds, zonedDaySpan, zonedHourSlots, zonedTimeOfDay };
5961
+ export { type AccessStateProps, Alert, type AlertProps, type AlertTone, AppShell, type AppShellProps, type AppliedBrandProfileSnapshot, type AsyncOperationState, AsyncOperationStatus, type AsyncOperationStatusProps, Attachment, type AttachmentLabels, AttachmentList, type AttachmentListProps, type AttachmentProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarPresence, type AvatarProps, type BoundedRelationshipGraph, type BrandProfile, BrandProfileEditor, type BrandProfileEditorLabels, type BrandProfileEditorProps, type BrandProfileLogo, type BrandProfileTypography, BrandProfiles, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BuilderCanvas, type BuilderCanvasItem, type BuilderCanvasLabels, type BuilderCanvasProps, type BuilderPaletteItem, BulkBar, type BulkBarProps, Bullet, type BulletProps, Button, ButtonGroup, type ButtonGroupProps, ButtonLink, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, type CalendarDay, type CalendarWeekday, Card, CardLink, type CardLinkProps, type CardProps, CellStrong, CellSub, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, CollapsibleSection, type CollapsibleSectionProps, ColorPicker, type ColorPickerLabels, type ColorPickerProps, type ColumnFilter, Combobox, type ComboboxOption, type ComboboxProps, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, Comment, type CommentProps, Comments, type CommentsProps, Composer, ComposerBar, type ComposerBarProps, type ComposerProps, ConfirmDialog, type ConfirmDialogProps, ContentList, ContentListItem, type ContentListItemProps, type ContentListProps, CopyButton, type CopyButtonProps, DAY, DEFAULT_ATTACHMENT_LABELS, DEFAULT_BRAND_PROFILE_EDITOR_LABELS, DEFAULT_BUILDER_CANVAS_LABELS, DEFAULT_COLOR_PICKER_LABELS, DEFAULT_DATE_PICKER_LABELS, DEFAULT_DATE_RANGE_PICKER_LABELS, DEFAULT_DATE_TIME_PICKER_LABELS, DEFAULT_DIFF_VIEWER_LABELS, DEFAULT_ENTITY_PICKER_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILTER_EDITOR_LABELS, DEFAULT_FILTER_SUMMARY_LABELS, DEFAULT_INLINE_EDIT_LABELS, DEFAULT_INSIGHT_CARD_LABELS, DEFAULT_LIGHTBOX_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_PAGINATION_LABELS, DEFAULT_PRESENCE_LABELS, DEFAULT_RELATIONSHIP_GRAPH_LABELS, DEFAULT_RULE_BUILDER_LABELS, DEFAULT_RULE_SUMMARY_WORDS, DEFAULT_RULE_VALIDATION_MESSAGES, DEFAULT_SAVE_STATUS_LABELS, DEFAULT_SCHEDULING_CALENDAR_LABELS, DEFAULT_SCHEDULING_TIMELINE_LABELS, DEFAULT_STEP_STATE_LABELS, DEFAULT_TEXT_DIFF_LABELS, DEFAULT_TREE_LABELS, DashboardGrid, type DashboardGridBreakpoint, type DashboardGridColumnCount, type DashboardGridColumns, type DashboardGridGap, DashboardGridItem, type DashboardGridItemProps, type DashboardGridProps, type DashboardGridSpan, type DateInputProblem, type DatePart, DatePicker, type DatePickerLabels, type DatePickerProps, DateRangePicker, type DateRangePickerLabels, type DateRangePickerProps, type DateRangeValue, DateTimePicker, type DateTimePickerLabels, type DateTimePickerProps, type DaySpanLayout, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListItem, type DescriptionListProps, DetailLayout, type DetailLayoutProps, DetailPage, type DetailPageLinkProps, type DetailPageMetric, type DetailPageProps, type DetailPageTab, type DiffEntry, type DiffKind, type DiffResolution, type DiffSummary, DiffViewer, type DiffViewerLabels, type DiffViewerProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, EntityPicker, type EntityPickerLabels, type EntityPickerProps, type EntityPickerSearchResult, ErrorState, type ErrorStateProps, EventRow, type EventRowProps, ExpandToggle, type ExpandToggleProps, FeaturedRundown, FeaturedRundownItem, type FeaturedRundownItemProps, type FeaturedRundownProps, FeaturedStage, type FeaturedStageProps, Field, type FieldProps, type FileRejection, type FileRejectionReason, type FileSizeFormatter, type FileSizeOptions, FileUpload, type FileUploadItem, type FileUploadLabels, type FileUploadProps, type FileUploadStatus, type FilterChoice, FilterEditor, type FilterEditorLabels, type FilterEditorProps, type FilterField, type FilterKind, type FilterOp, type FilterOption, FilterPopover, type FilterPopoverProps, type FilterPreset, type FilterSummaryLabels, type FilterValue, type FilterValueKind, FilteredEmptyState, type FlatNode, Flow, FlowNode, type FlowNodeProps, type FlowNodeState, type FlowProps, type FlowVariant, type FoldedText, ForbiddenState, HOUR, Heartbeat, type HeartbeatProps, type HeartbeatState, Highlighted, type HighlightedProps, type HsvColor, Inbox, InboxDetail, type InboxDetailProps, InboxItem, type InboxItemProps, InboxList, type InboxListProps, type InboxProps, InfoTip, type InfoTipProps, InlineEdit, type InlineEditEditorProps, type InlineEditLabels, type InlineEditProps, Input, InputGroup, type InputGroupProps, type InputProps, InsightCard, type InsightCardLabels, type InsightCardProps, type InsightComparison, type InsightCoverage, type InsightKpi, type InsightStatus, type InsightStatusTone, type InsightTarget, type JsonPrimitive, type JsonValue, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, type KanbanMoveDirection, type KanbanProps, Kbd, KbdCombo, type KbdComboProps, type KbdPlatform, type KbdProps, Label, type LabelProps, type LaneCluster, type LaneInterval, type LanePlacement, type LayeredColumn, type LayeredEdgeClassification, type LayeredEdgeKind, type LayeredItem, type LayeredLayout, type LayeredLayoutOptions, type LayeredNavigationKey, type LayoutLaneOptions, type LayoutMonthSpansOptions, LicensePositionBar, type LicensePositionBarProps, Lightbox, type LightboxItem, type LightboxLabels, type LightboxProps, List, ListItem, type ListItemProps, type ListProps, LiveIndicator, type LiveIndicatorProps, LoadingState, type LoadingStateProps, Mark, type MarkProps, type MatchBulkResult, MatchReview, type MatchReviewAction, type MatchReviewCandidate, type MatchReviewField, type MatchReviewLabels, type MatchReviewProps, Menu, MenuGroup, type MenuGroupProps, MenuItem, type MenuItemAttributes, MenuItemCheckbox, type MenuItemCheckboxProps, type MenuItemProps, MenuItemRadio, type MenuItemRadioProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuSeparator, Meter, type MeterProps, type MeterTone, MetricInput, type MetricInputProps, Modal, type ModalProps, type MonthSpanGroup, type MonthSpanInput, type MonthSpanLayout, type MoveProposal, NUMBER_FILTER_OPERATORS, type NavFavouriteItem, NavFavourites, type NavFavouritesLabels, type NavFavouritesProps, NavGroup, type NavGroupProps, NavItem, type NavItemProps, NewsLead, type NewsLeadProps, NotFoundState, Note, type NoteProps, type NoteTone, NoticeQueue, type NoticeQueueProps, type NumberFilterOperator, type PackLanesOptions, type PackedLanes, PageHeader, type PageHeaderProps, PageIntro, type PageIntroProps, Pagination, type PaginationLabels, type PaginationProps, Peek, type PeekProps, type PillSize, type PillTone, type PillTreatment, Pipeline, type PipelineProps, PipelineStage, type PipelineStageProps, type PipelineStageState, type PlacedDaySpan, type PlacedMonthSpan, type PlacedSpan, Placement, Popconfirm, type PopconfirmProps, Popover, type PopoverProps, type PositionedRelationshipNode, PresenceDot, type PresenceDotProps, type Primitive, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Prose, type ProseProps, Radio, RadioCard, type RadioCardProps, RadioGroup, type RadioGroupProps, type RadioProps, type RelatedLinkItem, RelatedLinks, type RelatedLinksProps, RelationshipGraph, type RelationshipGraphArrow, type RelationshipGraphCluster, type RelationshipGraphEdge, type RelationshipGraphLabels, type RelationshipGraphLegendItem, type RelationshipGraphNode, type RelationshipGraphProps, RelativeTime, type RelativeTimeFormatContext, type RelativeTimeProps, type RelativeTimeUnit, type RelativeTimeValue, ResourceGrid, type ResourceGridProps, type RgbColor, type RoutedEdge, type Row, RowAction, type RowActionProps, RowActions, type RowActionsProps, type RuleAction, type RuleActionDefinition, RuleBuilder, type RuleBuilderLabels, type RuleBuilderProps, type RuleCheck, type RuleCondition, type RuleDefinition, type RuleFieldDefinition, type RuleGroup, type RuleOperatorDefinition, type RuleSummaryWords, type RuleValidationIssue, type RuleValidationOptions, type RuleValueEditorProps, SaveStatus, type SaveStatusLabels, type SaveStatusProps, type SaveStatusState, type SavedViewItem, SavedViewMenu, type SavedViewMenuProps, type SavedViewSection, type SchedulingAgendaGroup, type SchedulingBand, SchedulingCalendar, type SchedulingCalendarDay, type SchedulingCalendarEntry, type SchedulingCalendarLabels, type SchedulingCalendarOverlay, type SchedulingCalendarProps, type SchedulingCalendarView, type SchedulingDatePart, type SchedulingEntryState, type SchedulingLegendItem, type SchedulingMarker, type SchedulingMarkerEmphasis, type SchedulingOverlayKind, type SchedulingOverlayPattern, type SchedulingStatus, SchedulingTimeline, type SchedulingTimelineGroup, type SchedulingTimelineItem, type SchedulingTimelineLabels, type SchedulingTimelineLane, type SchedulingTimelineMarker, type SchedulingTimelineOverlay, type SchedulingTimelineOverlayKind, type SchedulingTimelineProps, type SearchSegment, SearchSuggest, type SearchSuggestAction, type SearchSuggestOption, type SearchSuggestProps, SectionHead, type SectionHeadProps, type Segment, Segmented, SegmentedOption, type SegmentedOptionProps, type SegmentedProps, Select, type SelectAllState, type SelectGroup, type SelectLabels, type SelectOption, type SelectProps, type ShellNav, Sidebar, type SidebarProps, SidebarSection, type SidebarSectionProps, Skeleton, type SkeletonProps, type SortDir, type SortDirection, type SortKey, Spinner, type SpinnerProps, StarButton, type StarButtonProps, Stat, StatLine, type StatLineItem, type StatLineProps, type StatProps, type StatTrend, type StateVariant, StatusPill, type StatusPillProps, StatusRow, type StatusRowProps, Step, type StepProps, type StepState, type StepStateLabels, Steps, type StepsProps, SubNavItem, type SubNavItemProps, type SummarizeFilterOptions, Switch, type SwitchProps, TEXT_FILTER_OPERATORS, TOAST_LEAVE_MS, TOP_LANE_CROSS_MIDNIGHT_MINUTES, Tab, TabPanel, type TabPanelProps, type TabProps, Table, type TableDensity, type TableProps, TableWrap, type TableWrapProps, Tabs, type TabsProps, Td, type TdProps, TextDiff, type TextDiffGranularity, type TextDiffLabels, type TextDiffLine, type TextDiffOp, type TextDiffOptions, type TextDiffProps, type TextDiffResult, type TextDiffRow, type TextDiffSegment, type TextFilterOperator, Textarea, type TextareaProps, Th, type ThProps, type TimeGridDayLayout, type TimeGridEntryContext, type TimeGridEntryInput, type TimeGridPart, type TimeGridSegment, Timeline, TimelineItem, type TimelineItemProps, type TimelineProps, type TimelineRange, type TimelineScale, type TimelineSpan, type TimelineSubTick, type TimelineTick, Toast, type ToastAction, type ToastApi, type ToastDismissReason, type ToastKind, type ToastOptions, type ToastPromiseMessages, type ToastProps, type ToastRecord, type ToastStore, type ToastTone, Toaster, type ToasterProps, ToggleRow, type ToggleRowProps, Tooltip, type TooltipProps, Tr, type TrProps, Tree, type TreeLabels, type TreeLike, type TreeNavAction, type TreeNodeData, type TreeNodeProps, type TreeProps, type UixLabels, UixLabelsProvider, type UixLabelsProviderProps, type UixLinkProps, type UixRenderLink, type UndoableToastOptions, type UseAnchoredPositionOptions, type UseTableOptions, type UseTableResult, type UseVirtualRowsOptions, type UseVirtualRowsResult, UserChip, type UserChipProps, ViewMenu, type ViewMenuColumn, type ViewMenuColumnLabels, type ViewMenuProps, type ViewState, type VirtualWindow, type ZonedDateSpan, type ZonedDayBounds, type ZonedDayShift, type ZonedDaySpan, type ZonedHourSlot, addCalendarDays, addCalendarMonths, addZonedDays, appendRuleNode, applyBrandProfile, applyFilters, boundRelationshipGraph, buildMonthGrid, buildThreeWayDiff, cachedDateTimeFormat, clampMetricValue, clampWidth, classifyLayeredEdges, clusterIdFor, contrastRatio, createToastApi, createToastStore, cx, dashboardGridClassName, dashboardGridItemClassName, dateOrder, datePattern, defaultTimelineStep, diffText, diffTokens, emptyFilterValue, enumerateDateKeys, enumerateDateSpan, fileKind, fileMatchesAccept, filterComboboxOptions, findRuleNodeDepth, flattenTree, foldForSearch, formatDateKey, formatFileSize, hexToRgb, highlightSegments, hsvToHex, hsvToRgb, isDateInRange, isDateUnavailable, isFilterEmpty, isRuleGroup, isValidDateKey, itemDaySpan, joinDateTime, layeredNeighbor, layoutDaySpans, layoutLane, layoutLayeredGraph, layoutMonthSpans, layoutRelationshipGraph, layoutTimeGridDay, mapRuleGroup, matchFilter, matchFilterPreset, meetsContrast, mergePinned, moveRuleNode, multiSort, nextSortDir, normalizeHex, packLanes, parseDateInput, parseDateValue, parseMetricValue, parseView, partitionFiles, pixelsToMs, placeSpan, placesInTopLane, proposeMove, rankOverflow, relationshipNeighbors, relativeTimeValue, removeRuleNode, renderPlainLink, reorder, restoreBrandProfile, rgbToHex, rgbToHsv, ruleDepth, schedulingGridDays, searchRows, searchSegments, selectAllState, selectRangeDate, serializeView, setRuleCombinator, shiftSpan, shouldVirtualize, snapToStep, splitDateTime, startOfMonth, stepMetricValue, summarizeDiff, summarizeFilter, summarizeRule, textDiffRows, timeZoneName, timelineRepeatedHourOffset, timelineStepDelta, timelineSubTicks, timelineTicks, toDateKey, toast, toggleId, togglePage, toggleSort, tokenizeText, traverseRelationshipNode, treeNav, useAnchoredPosition, useDialog, useTable, useUixLabels, useVirtualRows, validateRuleDefinition, virtualWindow, wrapEdgeLabel, zonedDateKey, zonedDateSpan, zonedDayBounds, zonedDaySpan, zonedHourSlots, zonedTimeOfDay };
package/dist/index.d.ts CHANGED
@@ -57,6 +57,8 @@ export { PillSize, PillTone, PillTreatment, StatusPill, StatusPillProps } from '
57
57
  export { Progress, ProgressProps } from './components/Progress.js';
58
58
  export { Meter, MeterProps, MeterTone } from './components/Meter.js';
59
59
  export { Stat, StatProps, StatTrend } from './components/Stat.js';
60
+ export { Bullet, BulletProps, DEFAULT_INSIGHT_CARD_LABELS, InsightCard, InsightCardLabels, InsightCardProps, InsightComparison, InsightCoverage, InsightKpi, InsightStatus, InsightStatusTone, InsightTarget } from './components/InsightCard.js';
61
+ export { ChartStatPoint, LinearFit, PredictionBandPoint, linearFit, normalQuantile, predictionBand, quantiles, studentTQuantile } from './chart-stats.js';
60
62
  export { Chip, ChipGroup, ChipGroupProps, ChipProps } from './components/Chip.js';
61
63
  export { Kbd, KbdCombo, KbdComboProps, KbdPlatform, KbdProps } from './components/Kbd.js';
62
64
  export { DEFAULT_STEP_STATE_LABELS, Step, StepProps, StepState, StepStateLabels, Steps, StepsProps } from './components/Steps.js';
package/dist/index.js CHANGED
@@ -71,6 +71,8 @@ import { StatusPill } from "./components/StatusPill.js";
71
71
  import { Progress } from "./components/Progress.js";
72
72
  import { Meter } from "./components/Meter.js";
73
73
  import { Stat } from "./components/Stat.js";
74
+ import { Bullet, DEFAULT_INSIGHT_CARD_LABELS, InsightCard } from "./components/InsightCard.js";
75
+ import { linearFit, normalQuantile, predictionBand, quantiles, studentTQuantile } from "./chart-stats.js";
74
76
  import { Chip, ChipGroup } from "./components/Chip.js";
75
77
  import { Kbd, KbdCombo } from "./components/Kbd.js";
76
78
  import { Steps, Step, DEFAULT_STEP_STATE_LABELS } from "./components/Steps.js";
@@ -225,6 +227,7 @@ export {
225
227
  Breadcrumbs,
226
228
  BuilderCanvas,
227
229
  BulkBar,
230
+ Bullet,
228
231
  Button,
229
232
  ButtonGroup,
230
233
  ButtonLink,
@@ -263,6 +266,7 @@ export {
263
266
  DEFAULT_FILTER_EDITOR_LABELS,
264
267
  DEFAULT_FILTER_SUMMARY_LABELS,
265
268
  DEFAULT_INLINE_EDIT_LABELS,
269
+ DEFAULT_INSIGHT_CARD_LABELS,
266
270
  DEFAULT_LIGHTBOX_LABELS,
267
271
  DEFAULT_MATCH_REVIEW_LABELS,
268
272
  DEFAULT_PAGINATION_LABELS,
@@ -315,6 +319,7 @@ export {
315
319
  InlineEdit,
316
320
  Input,
317
321
  InputGroup,
322
+ InsightCard,
318
323
  Kanban,
319
324
  KanbanCard,
320
325
  KanbanColumn,
@@ -466,10 +471,12 @@ export {
466
471
  layoutMonthSpans,
467
472
  layoutRelationshipGraph,
468
473
  layoutTimeGridDay,
474
+ linearFit,
469
475
  mapRuleGroup,
470
476
  matchFilterPreset,
471
477
  meetsContrast,
472
478
  moveRuleNode,
479
+ normalQuantile,
473
480
  normalizeHex,
474
481
  packLanes,
475
482
  parseDateInput,
@@ -479,7 +486,9 @@ export {
479
486
  pixelsToMs,
480
487
  placeSpan,
481
488
  placesInTopLane,
489
+ predictionBand,
482
490
  proposeMove,
491
+ quantiles,
483
492
  rankOverflow,
484
493
  relationshipNeighbors,
485
494
  relativeTimeValue,
@@ -498,6 +507,7 @@ export {
498
507
  splitDateTime,
499
508
  startOfMonth,
500
509
  stepMetricValue,
510
+ studentTQuantile,
501
511
  summarizeDiff,
502
512
  summarizeFilter,
503
513
  summarizeRule,
@@ -0,0 +1,110 @@
1
+ type MarkdownInline = {
2
+ type: 'text';
3
+ value: string;
4
+ } | {
5
+ type: 'code';
6
+ value: string;
7
+ } | {
8
+ type: 'strong';
9
+ children: MarkdownInline[];
10
+ } | {
11
+ type: 'em';
12
+ children: MarkdownInline[];
13
+ } | {
14
+ type: 'del';
15
+ children: MarkdownInline[];
16
+ } | {
17
+ type: 'link';
18
+ href: string;
19
+ title?: string;
20
+ children: MarkdownInline[];
21
+ bare?: boolean;
22
+ } | {
23
+ type: 'image';
24
+ src: string;
25
+ alt: string;
26
+ title?: string;
27
+ }
28
+ /** `@[Display name](mention:<id>)` — a person mentioned by id; `label` is the stored name. */
29
+ | {
30
+ type: 'mention';
31
+ id: string;
32
+ label: string;
33
+ } | {
34
+ type: 'br';
35
+ };
36
+ /**
37
+ * The one stored form of a mention: `@[Display name](mention:<id>)`. The id is the
38
+ * product's (a user id); the name is what the author saw, kept so the text still reads
39
+ * without the product. `[`, `]` and `\` in the name are backslash-escaped. Ids are
40
+ * limited to letters, digits and `_ . -`, so a mention can never carry a URL.
41
+ */
42
+ declare const MENTION_SCHEME = "mention:";
43
+ /** True when `id` can be stored in a mention. */
44
+ declare function isMentionId(id: string): boolean;
45
+ /** The markdown for one mention, or `null` when the id cannot be stored or the name is empty. */
46
+ declare function formatMention(mention: {
47
+ id: string;
48
+ label: string;
49
+ }): string | null;
50
+ /**
51
+ * The mention at the start of `text`, with the number of characters it spans, or `null`.
52
+ * Used by the viewer, the editor and products that read stored text on the server.
53
+ */
54
+ declare function readMention(text: string): {
55
+ id: string;
56
+ label: string;
57
+ length: number;
58
+ } | null;
59
+ type TableAlign = 'left' | 'center' | 'right' | null;
60
+ interface MarkdownListItem {
61
+ /** `null` for a plain item, otherwise the task state. */
62
+ checked: boolean | null;
63
+ children: MarkdownInline[];
64
+ /** Nested lists. */
65
+ lists: MarkdownList[];
66
+ }
67
+ interface MarkdownList {
68
+ type: 'list';
69
+ ordered: boolean;
70
+ start: number;
71
+ items: MarkdownListItem[];
72
+ }
73
+ type MarkdownBlock = {
74
+ type: 'paragraph';
75
+ children: MarkdownInline[];
76
+ } | {
77
+ type: 'heading';
78
+ level: number;
79
+ children: MarkdownInline[];
80
+ } | {
81
+ type: 'code';
82
+ lang: string;
83
+ value: string;
84
+ } | {
85
+ type: 'quote';
86
+ children: MarkdownInline[];
87
+ } | {
88
+ type: 'rule';
89
+ } | MarkdownList | {
90
+ type: 'table';
91
+ align: TableAlign[];
92
+ head: MarkdownInline[][];
93
+ rows: MarkdownInline[][][];
94
+ };
95
+ /** Inline markdown to nodes. Newlines become line breaks. */
96
+ declare function parseInline(text: string, depth?: number): MarkdownInline[];
97
+ /** The text a reader sees, for accessible names and image alt text. */
98
+ declare function plainText(nodes: ReadonlyArray<MarkdownInline>): string;
99
+ /**
100
+ * Every mention in a markdown text, in reading order (an id may repeat). Code spans and
101
+ * code blocks hold no mentions. For products that act on mentions when text is saved.
102
+ */
103
+ declare function findMentions(markdown: string): Array<{
104
+ id: string;
105
+ label: string;
106
+ }>;
107
+ /** Markdown source to blocks. Empty or whitespace-only input yields no blocks. */
108
+ declare function parseMarkdown(source: string): MarkdownBlock[];
109
+
110
+ export { MENTION_SCHEME as M, type TableAlign as T, type MarkdownBlock as a, type MarkdownInline as b, type MarkdownList as c, type MarkdownListItem as d, formatMention as e, findMentions as f, parseMarkdown as g, plainText as h, isMentionId as i, parseInline as p, readMention as r };
@@ -24,9 +24,38 @@ type MarkdownInline = {
24
24
  src: string;
25
25
  alt: string;
26
26
  title?: string;
27
+ }
28
+ /** `@[Display name](mention:<id>)` — a person mentioned by id; `label` is the stored name. */
29
+ | {
30
+ type: 'mention';
31
+ id: string;
32
+ label: string;
27
33
  } | {
28
34
  type: 'br';
29
35
  };
36
+ /**
37
+ * The one stored form of a mention: `@[Display name](mention:<id>)`. The id is the
38
+ * product's (a user id); the name is what the author saw, kept so the text still reads
39
+ * without the product. `[`, `]` and `\` in the name are backslash-escaped. Ids are
40
+ * limited to letters, digits and `_ . -`, so a mention can never carry a URL.
41
+ */
42
+ declare const MENTION_SCHEME = "mention:";
43
+ /** True when `id` can be stored in a mention. */
44
+ declare function isMentionId(id: string): boolean;
45
+ /** The markdown for one mention, or `null` when the id cannot be stored or the name is empty. */
46
+ declare function formatMention(mention: {
47
+ id: string;
48
+ label: string;
49
+ }): string | null;
50
+ /**
51
+ * The mention at the start of `text`, with the number of characters it spans, or `null`.
52
+ * Used by the viewer, the editor and products that read stored text on the server.
53
+ */
54
+ declare function readMention(text: string): {
55
+ id: string;
56
+ label: string;
57
+ length: number;
58
+ } | null;
30
59
  type TableAlign = 'left' | 'center' | 'right' | null;
31
60
  interface MarkdownListItem {
32
61
  /** `null` for a plain item, otherwise the task state. */
@@ -67,9 +96,17 @@ type MarkdownBlock = {
67
96
  declare function parseInline(text: string, depth?: number): MarkdownInline[];
68
97
  /** The text a reader sees, for accessible names and image alt text. */
69
98
  declare function plainText(nodes: ReadonlyArray<MarkdownInline>): string;
99
+ /**
100
+ * Every mention in a markdown text, in reading order (an id may repeat). Code spans and
101
+ * code blocks hold no mentions. For products that act on mentions when text is saved.
102
+ */
103
+ declare function findMentions(markdown: string): Array<{
104
+ id: string;
105
+ label: string;
106
+ }>;
70
107
  /** Split a table row on unescaped pipes outside code spans. */
71
108
  declare function splitTableRow(line: string): string[];
72
109
  /** Markdown source to blocks. Empty or whitespace-only input yields no blocks. */
73
110
  declare function parseMarkdown(source: string): MarkdownBlock[];
74
111
 
75
- export { type MarkdownBlock, type MarkdownInline, type MarkdownList, type MarkdownListItem, type TableAlign, parseInline, parseMarkdown, plainText, splitTableRow };
112
+ export { MENTION_SCHEME, type MarkdownBlock, type MarkdownInline, type MarkdownList, type MarkdownListItem, type TableAlign, findMentions, formatMention, isMentionId, parseInline, parseMarkdown, plainText, readMention, splitTableRow };
@@ -1,3 +1,21 @@
1
+ const MENTION_SCHEME = "mention:";
2
+ const MENTION_ID = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/;
3
+ const MENTION_RE = /^@\[((?:\\[\\[\]]|[^\\[\]\n]){1,200})\]\(mention:([A-Za-z0-9][A-Za-z0-9_.-]{0,127})\)/;
4
+ const cleanMentionLabel = (label) => label.replace(/\s+/gu, " ").trim().slice(0, 200);
5
+ function isMentionId(id) {
6
+ return MENTION_ID.test(id);
7
+ }
8
+ function formatMention(mention) {
9
+ const label = cleanMentionLabel(mention.label);
10
+ if (!isMentionId(mention.id) || !label) return null;
11
+ return `@[${label.replace(/[\\[\]]/g, (ch) => `\\${ch}`)}](${MENTION_SCHEME}${mention.id})`;
12
+ }
13
+ function readMention(text) {
14
+ const match = MENTION_RE.exec(text);
15
+ if (!match) return null;
16
+ const label = cleanMentionLabel(match[1].replace(/\\([\\[\]])/g, "$1"));
17
+ return label ? { id: match[2], label, length: match[0].length } : null;
18
+ }
1
19
  const ASCII_PUNCT = /[!-/:-@[-`{-~]/;
2
20
  const WORD = /[\p{L}\p{N}]/u;
3
21
  const NAMED_ENTITIES = {
@@ -152,6 +170,14 @@ function parseInline(text, depth = 0) {
152
170
  i += run.length;
153
171
  continue;
154
172
  }
173
+ if (ch === "@" && text[i + 1] === "[") {
174
+ const mention = readMention(rest);
175
+ if (mention) {
176
+ out.push({ type: "mention", id: mention.id, label: mention.label });
177
+ i += mention.length;
178
+ continue;
179
+ }
180
+ }
155
181
  if (ch === "!" && text[i + 1] === "[") {
156
182
  const end = findBracketEnd(text, i + 1);
157
183
  const dest = end > 0 ? readDestination(text, end + 1) : null;
@@ -246,11 +272,47 @@ function plainText(nodes) {
246
272
  return " ";
247
273
  case "image":
248
274
  return n.alt;
275
+ case "mention":
276
+ return `@${n.label}`;
249
277
  default:
250
278
  return plainText(n.children);
251
279
  }
252
280
  }).join("");
253
281
  }
282
+ const collectMentions = (nodes, out) => {
283
+ for (const n of nodes) {
284
+ if (n.type === "mention") out.push({ id: n.id, label: n.label });
285
+ else if ("children" in n) collectMentions(n.children, out);
286
+ }
287
+ };
288
+ function findMentions(markdown) {
289
+ const out = [];
290
+ const walkList = (list) => {
291
+ for (const item of list.items) {
292
+ collectMentions(item.children, out);
293
+ item.lists.forEach(walkList);
294
+ }
295
+ };
296
+ for (const block of parseMarkdown(markdown)) {
297
+ switch (block.type) {
298
+ case "paragraph":
299
+ case "heading":
300
+ case "quote":
301
+ collectMentions(block.children, out);
302
+ break;
303
+ case "list":
304
+ walkList(block);
305
+ break;
306
+ case "table":
307
+ block.head.forEach((cell) => collectMentions(cell, out));
308
+ block.rows.forEach((row) => row.forEach((cell) => collectMentions(cell, out)));
309
+ break;
310
+ default:
311
+ break;
312
+ }
313
+ }
314
+ return out;
315
+ }
254
316
  const FENCE_RE = /^(`{3,}|~{3,})\s*([^`\s]*)/;
255
317
  const HEADING_RE = /^(#{1,6})\s+(.*?)(?:\s+#+)?$/;
256
318
  const RULE_RE = /^(?:(?:\*\s*){3,}|(?:-\s*){3,}|(?:_\s*){3,})$/;
@@ -431,8 +493,13 @@ ${current.trim()}`;
431
493
  return blocks;
432
494
  }
433
495
  export {
496
+ MENTION_SCHEME,
497
+ findMentions,
498
+ formatMention,
499
+ isMentionId,
434
500
  parseInline,
435
501
  parseMarkdown,
436
502
  plainText,
503
+ readMention,
437
504
  splitTableRow
438
505
  };