@50arms/ui 0.0.0-stage → 35.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/LICENSE +21 -0
- package/README.md +193 -2
- package/dist/components/Accordion.js +68 -0
- package/dist/components/Accordion.js.map +1 -0
- package/dist/components/AgentWorkingSpinner.js +46 -0
- package/dist/components/AgentWorkingSpinner.js.map +1 -0
- package/dist/components/AppShell.js +228 -0
- package/dist/components/AppShell.js.map +1 -0
- package/dist/components/Attention.js +130 -0
- package/dist/components/Attention.js.map +1 -0
- package/dist/components/Avatar.js +99 -0
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Badge.js +143 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Board.js +292 -0
- package/dist/components/Board.js.map +1 -0
- package/dist/components/Button.js +327 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Callout.js +106 -0
- package/dist/components/Callout.js.map +1 -0
- package/dist/components/Card.js +140 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Choice.js +361 -0
- package/dist/components/Choice.js.map +1 -0
- package/dist/components/CodeEditor.js +384 -0
- package/dist/components/CodeEditor.js.map +1 -0
- package/dist/components/ColorPicker.js +174 -0
- package/dist/components/ColorPicker.js.map +1 -0
- package/dist/components/Combobox.js +212 -0
- package/dist/components/Combobox.js.map +1 -0
- package/dist/components/CommandPalette.js +163 -0
- package/dist/components/CommandPalette.js.map +1 -0
- package/dist/components/ConcentricRing.js +60 -0
- package/dist/components/ConcentricRing.js.map +1 -0
- package/dist/components/ConnectionCard.js +98 -0
- package/dist/components/ConnectionCard.js.map +1 -0
- package/dist/components/ContextItemRow.js +49 -0
- package/dist/components/ContextItemRow.js.map +1 -0
- package/dist/components/CopyValue.js +57 -0
- package/dist/components/CopyValue.js.map +1 -0
- package/dist/components/CountBadge.js +26 -0
- package/dist/components/CountBadge.js.map +1 -0
- package/dist/components/DateCalendar.js +156 -0
- package/dist/components/DateCalendar.js.map +1 -0
- package/dist/components/DateField.js +166 -0
- package/dist/components/DateField.js.map +1 -0
- package/dist/components/DatePicker.js +56 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/DateTimeText.js +19 -0
- package/dist/components/DateTimeText.js.map +1 -0
- package/dist/components/DescriptionList.js +25 -0
- package/dist/components/DescriptionList.js.map +1 -0
- package/dist/components/Dialog.js +332 -0
- package/dist/components/Dialog.js.map +1 -0
- package/dist/components/DragDrop.js +395 -0
- package/dist/components/DragDrop.js.map +1 -0
- package/dist/components/Drawer.js +100 -0
- package/dist/components/Drawer.js.map +1 -0
- package/dist/components/EditGutter.js +110 -0
- package/dist/components/EditGutter.js.map +1 -0
- package/dist/components/EmojiPicker.js +174 -0
- package/dist/components/EmojiPicker.js.map +1 -0
- package/dist/components/ErrorBoundary.js +47 -0
- package/dist/components/ErrorBoundary.js.map +1 -0
- package/dist/components/Field.js +115 -0
- package/dist/components/Field.js.map +1 -0
- package/dist/components/FileUpload.js +128 -0
- package/dist/components/FileUpload.js.map +1 -0
- package/dist/components/FilterMenu.js +256 -0
- package/dist/components/FilterMenu.js.map +1 -0
- package/dist/components/GatesSection.js +79 -0
- package/dist/components/GatesSection.js.map +1 -0
- package/dist/components/Icon.js +50 -0
- package/dist/components/Icon.js.map +1 -0
- package/dist/components/IconButton.js +59 -0
- package/dist/components/IconButton.js.map +1 -0
- package/dist/components/IconStack.js +69 -0
- package/dist/components/IconStack.js.map +1 -0
- package/dist/components/ImageUploadField.js +146 -0
- package/dist/components/ImageUploadField.js.map +1 -0
- package/dist/components/InlineEdit.js +432 -0
- package/dist/components/InlineEdit.js.map +1 -0
- package/dist/components/InlineMarkdownEdit.js +184 -0
- package/dist/components/InlineMarkdownEdit.js.map +1 -0
- package/dist/components/Input.js +156 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/LegalDocument.js +155 -0
- package/dist/components/LegalDocument.js.map +1 -0
- package/dist/components/LineDiff.js +95 -0
- package/dist/components/LineDiff.js.map +1 -0
- package/dist/components/ListHeader.js +72 -0
- package/dist/components/ListHeader.js.map +1 -0
- package/dist/components/Loading.js +111 -0
- package/dist/components/Loading.js.map +1 -0
- package/dist/components/Markdown.js +28 -0
- package/dist/components/Markdown.js.map +1 -0
- package/dist/components/MarkdownEditor.js +467 -0
- package/dist/components/MarkdownEditor.js.map +1 -0
- package/dist/components/Menu.js +185 -0
- package/dist/components/Menu.js.map +1 -0
- package/dist/components/Navigation.js +87 -0
- package/dist/components/Navigation.js.map +1 -0
- package/dist/components/NumberInput.js +119 -0
- package/dist/components/NumberInput.js.map +1 -0
- package/dist/components/OTPInput.js +71 -0
- package/dist/components/OTPInput.js.map +1 -0
- package/dist/components/OrderedEntityManager.js +170 -0
- package/dist/components/OrderedEntityManager.js.map +1 -0
- package/dist/components/PagedWindowList.js +74 -0
- package/dist/components/PagedWindowList.js.map +1 -0
- package/dist/components/PaginationBar.js +95 -0
- package/dist/components/PaginationBar.js.map +1 -0
- package/dist/components/Panel.js +396 -0
- package/dist/components/Panel.js.map +1 -0
- package/dist/components/PasswordInput.js +32 -0
- package/dist/components/PasswordInput.js.map +1 -0
- package/dist/components/PasswordRequirements.js +25 -0
- package/dist/components/PasswordRequirements.js.map +1 -0
- package/dist/components/PatchDiff.js +96 -0
- package/dist/components/PatchDiff.js.map +1 -0
- package/dist/components/PendingVeil.js +18 -0
- package/dist/components/PendingVeil.js.map +1 -0
- package/dist/components/Popover.js +214 -0
- package/dist/components/Popover.js.map +1 -0
- package/dist/components/Progress.js +419 -0
- package/dist/components/Progress.js.map +1 -0
- package/dist/components/RatingScale.js +89 -0
- package/dist/components/RatingScale.js.map +1 -0
- package/dist/components/ReadMore.js +232 -0
- package/dist/components/ReadMore.js.map +1 -0
- package/dist/components/RecordCard.js +202 -0
- package/dist/components/RecordCard.js.map +1 -0
- package/dist/components/RelativeTime.js +29 -0
- package/dist/components/RelativeTime.js.map +1 -0
- package/dist/components/SandboxedFrame.js +135 -0
- package/dist/components/SandboxedFrame.js.map +1 -0
- package/dist/components/SearchInput.js +38 -0
- package/dist/components/SearchInput.js.map +1 -0
- package/dist/components/SecretField.js +228 -0
- package/dist/components/SecretField.js.map +1 -0
- package/dist/components/SectionNav.js +42 -0
- package/dist/components/SectionNav.js.map +1 -0
- package/dist/components/Select.js +172 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/SequenceDiagram.js +109 -0
- package/dist/components/SequenceDiagram.js.map +1 -0
- package/dist/components/SettingRow.js +124 -0
- package/dist/components/SettingRow.js.map +1 -0
- package/dist/components/SignOffRings.js +36 -0
- package/dist/components/SignOffRings.js.map +1 -0
- package/dist/components/Slider.js +353 -0
- package/dist/components/Slider.js.map +1 -0
- package/dist/components/SolutionChoice.js +89 -0
- package/dist/components/SolutionChoice.js.map +1 -0
- package/dist/components/SortMenu.js +75 -0
- package/dist/components/SortMenu.js.map +1 -0
- package/dist/components/Spinner.js +42 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/Stat.js +148 -0
- package/dist/components/Stat.js.map +1 -0
- package/dist/components/StatusSelect.js +119 -0
- package/dist/components/StatusSelect.js.map +1 -0
- package/dist/components/Surface.js +210 -0
- package/dist/components/Surface.js.map +1 -0
- package/dist/components/Table.js +300 -0
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Tabs.js +288 -0
- package/dist/components/Tabs.js.map +1 -0
- package/dist/components/ThemeMenu.js +198 -0
- package/dist/components/ThemeMenu.js.map +1 -0
- package/dist/components/Toast.js +217 -0
- package/dist/components/Toast.js.map +1 -0
- package/dist/components/Toggle.js +147 -0
- package/dist/components/Toggle.js.map +1 -0
- package/dist/components/ToggleMatrix.js +157 -0
- package/dist/components/ToggleMatrix.js.map +1 -0
- package/dist/components/Tree.js +125 -0
- package/dist/components/Tree.js.map +1 -0
- package/dist/components/TriStateSwitch.js +111 -0
- package/dist/components/TriStateSwitch.js.map +1 -0
- package/dist/components/VideoPlayer.js +64 -0
- package/dist/components/VideoPlayer.js.map +1 -0
- package/dist/components/auth/AcceptInvitationCard.js +110 -0
- package/dist/components/auth/AcceptInvitationCard.js.map +1 -0
- package/dist/components/auth/AuthLayout.js +18 -0
- package/dist/components/auth/AuthLayout.js.map +1 -0
- package/dist/components/auth/ForgotPasswordForm.js +44 -0
- package/dist/components/auth/ForgotPasswordForm.js.map +1 -0
- package/dist/components/auth/LoginForm.js +76 -0
- package/dist/components/auth/LoginForm.js.map +1 -0
- package/dist/components/auth/ResetPasswordForm.js +69 -0
- package/dist/components/auth/ResetPasswordForm.js.map +1 -0
- package/dist/components/auth/SignInProviders.js +45 -0
- package/dist/components/auth/SignInProviders.js.map +1 -0
- package/dist/components/auth/SignupCard.js +204 -0
- package/dist/components/auth/SignupCard.js.map +1 -0
- package/dist/components/auth/TermsAcceptance.js +43 -0
- package/dist/components/auth/TermsAcceptance.js.map +1 -0
- package/dist/components/board/context.js +32 -0
- package/dist/components/board/context.js.map +1 -0
- package/dist/components/board/recipe.js +94 -0
- package/dist/components/board/recipe.js.map +1 -0
- package/dist/components/calendar/CalendarMonth.js +299 -0
- package/dist/components/calendar/CalendarMonth.js.map +1 -0
- package/dist/components/calendar/CalendarTimeGrid.js +430 -0
- package/dist/components/calendar/CalendarTimeGrid.js.map +1 -0
- package/dist/components/calendar/EventActions.js +101 -0
- package/dist/components/calendar/EventActions.js.map +1 -0
- package/dist/components/calendar/format.js +73 -0
- package/dist/components/calendar/format.js.map +1 -0
- package/dist/components/calendar/palette.js +31 -0
- package/dist/components/calendar/palette.js.map +1 -0
- package/dist/components/calendar/use-calendar-drag.js +149 -0
- package/dist/components/calendar/use-calendar-drag.js.map +1 -0
- package/dist/components/calendar/use-event-keyboard.js +87 -0
- package/dist/components/calendar/use-event-keyboard.js.map +1 -0
- package/dist/components/calendar/use-grid-navigation.js +79 -0
- package/dist/components/calendar/use-grid-navigation.js.map +1 -0
- package/dist/components/calendar/use-now.js +27 -0
- package/dist/components/calendar/use-now.js.map +1 -0
- package/dist/components/card-face/AcRingGlyph.js +39 -0
- package/dist/components/card-face/AcRingGlyph.js.map +1 -0
- package/dist/components/card-face/BoardCardAgentSlot.js +17 -0
- package/dist/components/card-face/BoardCardAgentSlot.js.map +1 -0
- package/dist/components/card-face/CardFace.js +109 -0
- package/dist/components/card-face/CardFace.js.map +1 -0
- package/dist/components/card-face/CardTypeBadge.js +17 -0
- package/dist/components/card-face/CardTypeBadge.js.map +1 -0
- package/dist/components/card-face/EffortBadge.js +11 -0
- package/dist/components/card-face/EffortBadge.js.map +1 -0
- package/dist/components/card-face/GateRingGlyph.js +31 -0
- package/dist/components/card-face/GateRingGlyph.js.map +1 -0
- package/dist/components/card-face/OverflowRow.js +70 -0
- package/dist/components/card-face/OverflowRow.js.map +1 -0
- package/dist/components/card-face/TapTip.js +32 -0
- package/dist/components/card-face/TapTip.js.map +1 -0
- package/dist/components/card-face/hit-area.js +6 -0
- package/dist/components/card-face/hit-area.js.map +1 -0
- package/dist/components/card-face/vocabulary.js +102 -0
- package/dist/components/card-face/vocabulary.js.map +1 -0
- package/dist/components/chart/BarList.js +78 -0
- package/dist/components/chart/BarList.js.map +1 -0
- package/dist/components/chart/LineChart.js +310 -0
- package/dist/components/chart/LineChart.js.map +1 -0
- package/dist/components/chart/ShareBar.js +141 -0
- package/dist/components/chart/ShareBar.js.map +1 -0
- package/dist/components/chart/TimeSeriesChart.js +305 -0
- package/dist/components/chart/TimeSeriesChart.js.map +1 -0
- package/dist/components/chart/label-metrics.js +17 -0
- package/dist/components/chart/label-metrics.js.map +1 -0
- package/dist/components/chart/line-chart-axis.js +38 -0
- package/dist/components/chart/line-chart-axis.js.map +1 -0
- package/dist/components/chart/line-chart-scale.js +132 -0
- package/dist/components/chart/line-chart-scale.js.map +1 -0
- package/dist/components/chart/line-series-style.js +22 -0
- package/dist/components/chart/line-series-style.js.map +1 -0
- package/dist/components/chart/share-bar-labels.js +14 -0
- package/dist/components/chart/share-bar-labels.js.map +1 -0
- package/dist/components/chart/shared.js +157 -0
- package/dist/components/chart/shared.js.map +1 -0
- package/dist/components/chart/time-series-scale.js +51 -0
- package/dist/components/chart/time-series-scale.js.map +1 -0
- package/dist/components/chat/Attachment.js +316 -0
- package/dist/components/chat/Attachment.js.map +1 -0
- package/dist/components/chat/Chat.js +171 -0
- package/dist/components/chat/Chat.js.map +1 -0
- package/dist/components/chat/Composer.js +274 -0
- package/dist/components/chat/Composer.js.map +1 -0
- package/dist/components/chat/ContextMeter.js +202 -0
- package/dist/components/chat/ContextMeter.js.map +1 -0
- package/dist/components/chat/EffortControl.js +116 -0
- package/dist/components/chat/EffortControl.js.map +1 -0
- package/dist/components/chat/FileCover.js +78 -0
- package/dist/components/chat/FileCover.js.map +1 -0
- package/dist/components/chat/Message.js +356 -0
- package/dist/components/chat/Message.js.map +1 -0
- package/dist/components/chat/MessageScroller.js +104 -0
- package/dist/components/chat/MessageScroller.js.map +1 -0
- package/dist/components/chat/ModelSelector.js +156 -0
- package/dist/components/chat/ModelSelector.js.map +1 -0
- package/dist/components/chat/StreamingMarkdown.js +42 -0
- package/dist/components/chat/StreamingMarkdown.js.map +1 -0
- package/dist/components/chat/download-file.js +9 -0
- package/dist/components/chat/download-file.js.map +1 -0
- package/dist/components/chat/file-icon.js +39 -0
- package/dist/components/chat/file-icon.js.map +1 -0
- package/dist/components/checklist/StatusChecklist.js +103 -0
- package/dist/components/checklist/StatusChecklist.js.map +1 -0
- package/dist/components/checklist/tally.js +29 -0
- package/dist/components/checklist/tally.js.map +1 -0
- package/dist/components/code-editor/context.js +13 -0
- package/dist/components/code-editor/context.js.map +1 -0
- package/dist/components/code-editor/editing.js +93 -0
- package/dist/components/code-editor/editing.js.map +1 -0
- package/dist/components/code-editor/highlight.js +27 -0
- package/dist/components/code-editor/highlight.js.map +1 -0
- package/dist/components/code-editor/recipe.js +75 -0
- package/dist/components/code-editor/recipe.js.map +1 -0
- package/dist/components/date-timeline/DateTimeline.js +358 -0
- package/dist/components/date-timeline/DateTimeline.js.map +1 -0
- package/dist/components/date-timeline/TimelineRow.js +100 -0
- package/dist/components/date-timeline/TimelineRow.js.map +1 -0
- package/dist/components/date-timeline/useBarDrag.js +44 -0
- package/dist/components/date-timeline/useBarDrag.js.map +1 -0
- package/dist/components/date-timeline/useMarkerDrag.js +40 -0
- package/dist/components/date-timeline/useMarkerDrag.js.map +1 -0
- package/dist/components/date-timeline/useTimelineZoom.js +44 -0
- package/dist/components/date-timeline/useTimelineZoom.js.map +1 -0
- package/dist/components/drag-drop/context.js +37 -0
- package/dist/components/drag-drop/context.js.map +1 -0
- package/dist/components/drag-drop/recipe.js +270 -0
- package/dist/components/drag-drop/recipe.js.map +1 -0
- package/dist/components/drag-drop/shift.js +157 -0
- package/dist/components/drag-drop/shift.js.map +1 -0
- package/dist/components/edit/activation.js +10 -0
- package/dist/components/edit/activation.js.map +1 -0
- package/dist/components/edit/outcome.js +47 -0
- package/dist/components/edit/outcome.js.map +1 -0
- package/dist/components/edit/use-edit-session.js +146 -0
- package/dist/components/edit/use-edit-session.js.map +1 -0
- package/dist/components/file-viewer/FileViewer.js +97 -0
- package/dist/components/file-viewer/FileViewer.js.map +1 -0
- package/dist/components/file-viewer/PageNumberJumpField.js +47 -0
- package/dist/components/file-viewer/PageNumberJumpField.js.map +1 -0
- package/dist/components/file-viewer/ViewerControls.js +122 -0
- package/dist/components/file-viewer/ViewerControls.js.map +1 -0
- package/dist/components/file-viewer/ViewerRail.js +57 -0
- package/dist/components/file-viewer/ViewerRail.js.map +1 -0
- package/dist/components/file-viewer/ViewerStage.js +112 -0
- package/dist/components/file-viewer/ViewerStage.js.map +1 -0
- package/dist/components/file-viewer/frames.js +37 -0
- package/dist/components/file-viewer/frames.js.map +1 -0
- package/dist/components/file-viewer/use-frame-cursor.js +32 -0
- package/dist/components/file-viewer/use-frame-cursor.js.map +1 -0
- package/dist/components/file-viewer/use-viewer-keys.js +50 -0
- package/dist/components/file-viewer/use-viewer-keys.js.map +1 -0
- package/dist/components/file-viewer/use-viewer-zoom.js +68 -0
- package/dist/components/file-viewer/use-viewer-zoom.js.map +1 -0
- package/dist/components/focus-web/FocusWeb.js +322 -0
- package/dist/components/focus-web/FocusWeb.js.map +1 -0
- package/dist/components/focus-web/layout.js +34 -0
- package/dist/components/focus-web/layout.js.map +1 -0
- package/dist/components/graph-explorer/GraphExplorer.js +441 -0
- package/dist/components/graph-explorer/GraphExplorer.js.map +1 -0
- package/dist/components/graph-explorer/camera-math.js +102 -0
- package/dist/components/graph-explorer/camera-math.js.map +1 -0
- package/dist/components/graph-explorer/tree-layout.js +103 -0
- package/dist/components/graph-explorer/tree-layout.js.map +1 -0
- package/dist/components/graph-explorer/use-camera.js +82 -0
- package/dist/components/graph-explorer/use-camera.js.map +1 -0
- package/dist/components/graph-explorer/viewport-gesture.js +107 -0
- package/dist/components/graph-explorer/viewport-gesture.js.map +1 -0
- package/dist/components/kanban/KanbanBoard.js +219 -0
- package/dist/components/kanban/KanbanBoard.js.map +1 -0
- package/dist/components/kanban/recipe.js +144 -0
- package/dist/components/kanban/recipe.js.map +1 -0
- package/dist/components/markdown/Affordances.js +398 -0
- package/dist/components/markdown/Affordances.js.map +1 -0
- package/dist/components/markdown/AttachmentStrip.js +128 -0
- package/dist/components/markdown/AttachmentStrip.js.map +1 -0
- package/dist/components/markdown/ImageUpload.js +45 -0
- package/dist/components/markdown/ImageUpload.js.map +1 -0
- package/dist/components/media-error.js +7 -0
- package/dist/components/media-error.js.map +1 -0
- package/dist/components/nav-sections.js +61 -0
- package/dist/components/nav-sections.js.map +1 -0
- package/dist/components/node-canvas/NodeCanvas.js +384 -0
- package/dist/components/node-canvas/NodeCanvas.js.map +1 -0
- package/dist/components/node-canvas/layout.js +237 -0
- package/dist/components/node-canvas/layout.js.map +1 -0
- package/dist/components/node-canvas/use-canvas-gestures.js +143 -0
- package/dist/components/node-canvas/use-canvas-gestures.js.map +1 -0
- package/dist/components/openapi/OpenApiViewer.js +137 -0
- package/dist/components/openapi/OpenApiViewer.js.map +1 -0
- package/dist/components/openapi/OperationCard.js +145 -0
- package/dist/components/openapi/OperationCard.js.map +1 -0
- package/dist/components/openapi/SchemaView.js +68 -0
- package/dist/components/openapi/SchemaView.js.map +1 -0
- package/dist/components/openapi/resolve.js +102 -0
- package/dist/components/openapi/resolve.js.map +1 -0
- package/dist/components/openapi/types.js +5 -0
- package/dist/components/openapi/types.js.map +1 -0
- package/dist/components/overlay-shell.js +29 -0
- package/dist/components/overlay-shell.js.map +1 -0
- package/dist/components/overlay-stack.js +27 -0
- package/dist/components/overlay-stack.js.map +1 -0
- package/dist/components/paged-window/PageBlock.js +50 -0
- package/dist/components/paged-window/PageBlock.js.map +1 -0
- package/dist/components/provenance/ConfidenceBar.js +60 -0
- package/dist/components/provenance/ConfidenceBar.js.map +1 -0
- package/dist/components/provenance/ConfidenceMeter.js +36 -0
- package/dist/components/provenance/ConfidenceMeter.js.map +1 -0
- package/dist/components/provenance/ConfidenceReadout.js +31 -0
- package/dist/components/provenance/ConfidenceReadout.js.map +1 -0
- package/dist/components/provenance/ProvenanceBadge.js +44 -0
- package/dist/components/provenance/ProvenanceBadge.js.map +1 -0
- package/dist/components/provenance/ProvenanceDetail.js +114 -0
- package/dist/components/provenance/ProvenanceDetail.js.map +1 -0
- package/dist/components/provenance/ProvenanceDisclosure.js +111 -0
- package/dist/components/provenance/ProvenanceDisclosure.js.map +1 -0
- package/dist/components/provenance/absence.js +31 -0
- package/dist/components/provenance/absence.js.map +1 -0
- package/dist/components/provenance/types.js +30 -0
- package/dist/components/provenance/types.js.map +1 -0
- package/dist/components/rbac/AccessRequestPanel.js +153 -0
- package/dist/components/rbac/AccessRequestPanel.js.map +1 -0
- package/dist/components/rbac/AccountMenu.js +118 -0
- package/dist/components/rbac/AccountMenu.js.map +1 -0
- package/dist/components/rbac/AgentKeysList.js +20 -0
- package/dist/components/rbac/AgentKeysList.js.map +1 -0
- package/dist/components/rbac/ApiKeysPanel.js +172 -0
- package/dist/components/rbac/ApiKeysPanel.js.map +1 -0
- package/dist/components/rbac/ApiKeysTable.js +167 -0
- package/dist/components/rbac/ApiKeysTable.js.map +1 -0
- package/dist/components/rbac/Brand.js +13 -0
- package/dist/components/rbac/Brand.js.map +1 -0
- package/dist/components/rbac/Can.js +18 -0
- package/dist/components/rbac/Can.js.map +1 -0
- package/dist/components/rbac/ChangePasswordForm.js +73 -0
- package/dist/components/rbac/ChangePasswordForm.js.map +1 -0
- package/dist/components/rbac/DangerZone.js +27 -0
- package/dist/components/rbac/DangerZone.js.map +1 -0
- package/dist/components/rbac/DevToolsPopover.js +140 -0
- package/dist/components/rbac/DevToolsPopover.js.map +1 -0
- package/dist/components/rbac/EndedLine.js +24 -0
- package/dist/components/rbac/EndedLine.js.map +1 -0
- package/dist/components/rbac/InvitationsList.js +148 -0
- package/dist/components/rbac/InvitationsList.js.map +1 -0
- package/dist/components/rbac/InviteMembersDialog.js +97 -0
- package/dist/components/rbac/InviteMembersDialog.js.map +1 -0
- package/dist/components/rbac/MembersPanel.js +138 -0
- package/dist/components/rbac/MembersPanel.js.map +1 -0
- package/dist/components/rbac/PermissionRequestPanel.js +141 -0
- package/dist/components/rbac/PermissionRequestPanel.js.map +1 -0
- package/dist/components/rbac/ProfileForm.js +86 -0
- package/dist/components/rbac/ProfileForm.js.map +1 -0
- package/dist/components/rbac/ProfilePage.js +58 -0
- package/dist/components/rbac/ProfilePage.js.map +1 -0
- package/dist/components/rbac/RBACProvider.js +82 -0
- package/dist/components/rbac/RBACProvider.js.map +1 -0
- package/dist/components/rbac/RoleEditorDialog.js +90 -0
- package/dist/components/rbac/RoleEditorDialog.js.map +1 -0
- package/dist/components/rbac/RoleKeyPicker.js +77 -0
- package/dist/components/rbac/RoleKeyPicker.js.map +1 -0
- package/dist/components/rbac/RolePermissionMatrix.js +37 -0
- package/dist/components/rbac/RolePermissionMatrix.js.map +1 -0
- package/dist/components/rbac/RolesPermissionsPage.js +142 -0
- package/dist/components/rbac/RolesPermissionsPage.js.map +1 -0
- package/dist/components/rbac/SessionsList.js +146 -0
- package/dist/components/rbac/SessionsList.js.map +1 -0
- package/dist/components/rbac/TeamSettingsForm.js +69 -0
- package/dist/components/rbac/TeamSettingsForm.js.map +1 -0
- package/dist/components/rbac/TeamSwitcher.js +66 -0
- package/dist/components/rbac/TeamSwitcher.js.map +1 -0
- package/dist/components/rbac/approvalPanelParts.js +130 -0
- package/dist/components/rbac/approvalPanelParts.js.map +1 -0
- package/dist/components/rbac/permissionSections.js +8 -0
- package/dist/components/rbac/permissionSections.js.map +1 -0
- package/dist/components/rbac/stagedForm.js +42 -0
- package/dist/components/rbac/stagedForm.js.map +1 -0
- package/dist/components/rbac/useStagedImage.js +21 -0
- package/dist/components/rbac/useStagedImage.js.map +1 -0
- package/dist/components/roadmap/PhaseManager.js +48 -0
- package/dist/components/roadmap/PhaseManager.js.map +1 -0
- package/dist/components/roadmap/RoadmapItemCard.js +96 -0
- package/dist/components/roadmap/RoadmapItemCard.js.map +1 -0
- package/dist/components/roadmap/RoadmapPage.js +34 -0
- package/dist/components/roadmap/RoadmapPage.js.map +1 -0
- package/dist/components/roadmap/RoadmapSwimlaneBoard.js +91 -0
- package/dist/components/roadmap/RoadmapSwimlaneBoard.js.map +1 -0
- package/dist/components/roadmap/TrackManager.js +58 -0
- package/dist/components/roadmap/TrackManager.js.map +1 -0
- package/dist/components/roadmap/UseCaseCard.js +93 -0
- package/dist/components/roadmap/UseCaseCard.js.map +1 -0
- package/dist/components/roadmap/UseCaseLedgerPage.js +98 -0
- package/dist/components/roadmap/UseCaseLedgerPage.js.map +1 -0
- package/dist/components/roadmap/chip-tones.js +9 -0
- package/dist/components/roadmap/chip-tones.js.map +1 -0
- package/dist/components/roadmap/derive.js +28 -0
- package/dist/components/roadmap/derive.js.map +1 -0
- package/dist/components/stepper/Stepper.js +276 -0
- package/dist/components/stepper/Stepper.js.map +1 -0
- package/dist/components/stepper/derive.js +53 -0
- package/dist/components/stepper/derive.js.map +1 -0
- package/dist/confidence.css +222 -0
- package/dist/fonts/bricolage-grotesque-0.woff2 +0 -0
- package/dist/fonts/bricolage-grotesque-1.woff2 +0 -0
- package/dist/fonts/bricolage-grotesque-2.woff2 +0 -0
- package/dist/fonts/figtree-0.woff2 +0 -0
- package/dist/fonts/figtree-1.woff2 +0 -0
- package/dist/fonts/figtree-2.woff2 +0 -0
- package/dist/fonts/figtree-3.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-0.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-1.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-10.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-11.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-2.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-3.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-4.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-5.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-6.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-7.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-8.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-9.woff2 +0 -0
- package/dist/fonts.css +187 -0
- package/dist/icons/data.js +233 -0
- package/dist/icons/data.js.map +1 -0
- package/dist/index.js +942 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/attention.js +75 -0
- package/dist/lib/attention.js.map +1 -0
- package/dist/lib/board/anchor.js +14 -0
- package/dist/lib/board/anchor.js.map +1 -0
- package/dist/lib/board/model.js +41 -0
- package/dist/lib/board/model.js.map +1 -0
- package/dist/lib/board/move.js +161 -0
- package/dist/lib/board/move.js.map +1 -0
- package/dist/lib/board/position.js +11 -0
- package/dist/lib/board/position.js.map +1 -0
- package/dist/lib/board/rejection.js +22 -0
- package/dist/lib/board/rejection.js.map +1 -0
- package/dist/lib/board/use-board.js +43 -0
- package/dist/lib/board/use-board.js.map +1 -0
- package/dist/lib/calendar/band-packer.js +44 -0
- package/dist/lib/calendar/band-packer.js.map +1 -0
- package/dist/lib/calendar/drag.js +74 -0
- package/dist/lib/calendar/drag.js.map +1 -0
- package/dist/lib/calendar/lane-packer.js +67 -0
- package/dist/lib/calendar/lane-packer.js.map +1 -0
- package/dist/lib/calendar/segments.js +82 -0
- package/dist/lib/calendar/segments.js.map +1 -0
- package/dist/lib/calendar/types.js +7 -0
- package/dist/lib/calendar/types.js.map +1 -0
- package/dist/lib/chart-palette.js +27 -0
- package/dist/lib/chart-palette.js.map +1 -0
- package/dist/lib/clipboard.js +30 -0
- package/dist/lib/clipboard.js.map +1 -0
- package/dist/lib/cn.js +9 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/color.js +24 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/lib/component-guidance.js +297 -0
- package/dist/lib/component-guidance.js.map +1 -0
- package/dist/lib/confidence.js +22 -0
- package/dist/lib/confidence.js.map +1 -0
- package/dist/lib/date-timeline/scale.js +197 -0
- package/dist/lib/date-timeline/scale.js.map +1 -0
- package/dist/lib/design-frame/document.js +44 -0
- package/dist/lib/design-frame/document.js.map +1 -0
- package/dist/lib/design-frame/mini-app-script.js +107 -0
- package/dist/lib/design-frame/mini-app-script.js.map +1 -0
- package/dist/lib/design-frame/mini-app.js +12 -0
- package/dist/lib/design-frame/mini-app.js.map +1 -0
- package/dist/lib/design-frame/protocol.js +46 -0
- package/dist/lib/design-frame/protocol.js.map +1 -0
- package/dist/lib/dev-warn.js +17 -0
- package/dist/lib/dev-warn.js.map +1 -0
- package/dist/lib/dnd/announce.js +120 -0
- package/dist/lib/dnd/announce.js.map +1 -0
- package/dist/lib/dnd/autoscroll.js +123 -0
- package/dist/lib/dnd/autoscroll.js.map +1 -0
- package/dist/lib/dnd/cross-drop.js +11 -0
- package/dist/lib/dnd/cross-drop.js.map +1 -0
- package/dist/lib/dnd/geometry.js +99 -0
- package/dist/lib/dnd/geometry.js.map +1 -0
- package/dist/lib/dnd/sensors/gesture.js +86 -0
- package/dist/lib/dnd/sensors/gesture.js.map +1 -0
- package/dist/lib/dnd/sensors/keyboard.js +47 -0
- package/dist/lib/dnd/sensors/keyboard.js.map +1 -0
- package/dist/lib/dnd/sensors/pointer.js +32 -0
- package/dist/lib/dnd/sensors/pointer.js.map +1 -0
- package/dist/lib/dnd/session.js +256 -0
- package/dist/lib/dnd/session.js.map +1 -0
- package/dist/lib/dnd/use-drag.js +90 -0
- package/dist/lib/dnd/use-drag.js.map +1 -0
- package/dist/lib/dom/scroll-ancestor.js +18 -0
- package/dist/lib/dom/scroll-ancestor.js.map +1 -0
- package/dist/lib/format.js +23 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/group-in-order.js +13 -0
- package/dist/lib/group-in-order.js.map +1 -0
- package/dist/lib/header-fold.js +11 -0
- package/dist/lib/header-fold.js.map +1 -0
- package/dist/lib/i18n/areas/auth-provenance-flows.js +156 -0
- package/dist/lib/i18n/areas/auth-provenance-flows.js.map +1 -0
- package/dist/lib/i18n/areas/board.js +35 -0
- package/dist/lib/i18n/areas/board.js.map +1 -0
- package/dist/lib/i18n/areas/card-face.js +10 -0
- package/dist/lib/i18n/areas/card-face.js.map +1 -0
- package/dist/lib/i18n/areas/chat-chart.js +118 -0
- package/dist/lib/i18n/areas/chat-chart.js.map +1 -0
- package/dist/lib/i18n/areas/code-editor.js +24 -0
- package/dist/lib/i18n/areas/code-editor.js.map +1 -0
- package/dist/lib/i18n/areas/date-timeline.js +21 -0
- package/dist/lib/i18n/areas/date-timeline.js.map +1 -0
- package/dist/lib/i18n/areas/dates.js +71 -0
- package/dist/lib/i18n/areas/dates.js.map +1 -0
- package/dist/lib/i18n/areas/docs-views.js +183 -0
- package/dist/lib/i18n/areas/docs-views.js.map +1 -0
- package/dist/lib/i18n/areas/feedback.js +75 -0
- package/dist/lib/i18n/areas/feedback.js.map +1 -0
- package/dist/lib/i18n/areas/formats.js +24 -0
- package/dist/lib/i18n/areas/formats.js.map +1 -0
- package/dist/lib/i18n/areas/forms.js +110 -0
- package/dist/lib/i18n/areas/forms.js.map +1 -0
- package/dist/lib/i18n/areas/keys.js +25 -0
- package/dist/lib/i18n/areas/keys.js.map +1 -0
- package/dist/lib/i18n/areas/markdown.js +136 -0
- package/dist/lib/i18n/areas/markdown.js.map +1 -0
- package/dist/lib/i18n/areas/move-rejected.js +14 -0
- package/dist/lib/i18n/areas/move-rejected.js.map +1 -0
- package/dist/lib/i18n/areas/navigation.js +104 -0
- package/dist/lib/i18n/areas/navigation.js.map +1 -0
- package/dist/lib/i18n/areas/rbac.js +331 -0
- package/dist/lib/i18n/areas/rbac.js.map +1 -0
- package/dist/lib/i18n/emphasis.js +6 -0
- package/dist/lib/i18n/emphasis.js.map +1 -0
- package/dist/lib/i18n/number-format.js +9 -0
- package/dist/lib/i18n/number-format.js.map +1 -0
- package/dist/lib/i18n/plural.js +9 -0
- package/dist/lib/i18n/plural.js.map +1 -0
- package/dist/lib/i18n/provider.js +27 -0
- package/dist/lib/i18n/provider.js.map +1 -0
- package/dist/lib/i18n/strings.js +38 -0
- package/dist/lib/i18n/strings.js.map +1 -0
- package/dist/lib/icons.js +17 -0
- package/dist/lib/icons.js.map +1 -0
- package/dist/lib/interactive-target.js +9 -0
- package/dist/lib/interactive-target.js.map +1 -0
- package/dist/lib/intl-cache.js +69 -0
- package/dist/lib/intl-cache.js.map +1 -0
- package/dist/lib/legal-document.js +37 -0
- package/dist/lib/legal-document.js.map +1 -0
- package/dist/lib/line-diff-model.js +51 -0
- package/dist/lib/line-diff-model.js.map +1 -0
- package/dist/lib/markdown/attachments.js +71 -0
- package/dist/lib/markdown/attachments.js.map +1 -0
- package/dist/lib/markdown/caret-map.js +153 -0
- package/dist/lib/markdown/caret-map.js.map +1 -0
- package/dist/lib/markdown/caret.js +35 -0
- package/dist/lib/markdown/caret.js.map +1 -0
- package/dist/lib/markdown/commands.js +443 -0
- package/dist/lib/markdown/commands.js.map +1 -0
- package/dist/lib/markdown/convert.js +153 -0
- package/dist/lib/markdown/convert.js.map +1 -0
- package/dist/lib/markdown/dom.js +89 -0
- package/dist/lib/markdown/dom.js.map +1 -0
- package/dist/lib/markdown/edit.js +92 -0
- package/dist/lib/markdown/edit.js.map +1 -0
- package/dist/lib/markdown/history.js +79 -0
- package/dist/lib/markdown/history.js.map +1 -0
- package/dist/lib/markdown/hotkeys.js +63 -0
- package/dist/lib/markdown/hotkeys.js.map +1 -0
- package/dist/lib/markdown/image-pipeline.js +236 -0
- package/dist/lib/markdown/image-pipeline.js.map +1 -0
- package/dist/lib/markdown/images.js +85 -0
- package/dist/lib/markdown/images.js.map +1 -0
- package/dist/lib/markdown/input.js +210 -0
- package/dist/lib/markdown/input.js.map +1 -0
- package/dist/lib/markdown/keys.js +37 -0
- package/dist/lib/markdown/keys.js.map +1 -0
- package/dist/lib/markdown/paste.js +180 -0
- package/dist/lib/markdown/paste.js.map +1 -0
- package/dist/lib/markdown/position.js +111 -0
- package/dist/lib/markdown/position.js.map +1 -0
- package/dist/lib/markdown/project.js +108 -0
- package/dist/lib/markdown/project.js.map +1 -0
- package/dist/lib/markdown/reconcile.js +127 -0
- package/dist/lib/markdown/reconcile.js.map +1 -0
- package/dist/lib/markdown/surface.js +373 -0
- package/dist/lib/markdown/surface.js.map +1 -0
- package/dist/lib/motion.js +22 -0
- package/dist/lib/motion.js.map +1 -0
- package/dist/lib/pad.js +7 -0
- package/dist/lib/pad.js.map +1 -0
- package/dist/lib/paged-window/layout.js +15 -0
- package/dist/lib/paged-window/layout.js.map +1 -0
- package/dist/lib/paged-window/list-owner.js +21 -0
- package/dist/lib/paged-window/list-owner.js.map +1 -0
- package/dist/lib/paged-window/records-binding.js +239 -0
- package/dist/lib/paged-window/records-binding.js.map +1 -0
- package/dist/lib/paged-window/store.js +562 -0
- package/dist/lib/paged-window/store.js.map +1 -0
- package/dist/lib/paged-window/use-measured-pitch.js +38 -0
- package/dist/lib/paged-window/use-measured-pitch.js.map +1 -0
- package/dist/lib/paged-window/use-page-visibility.js +36 -0
- package/dist/lib/paged-window/use-page-visibility.js.map +1 -0
- package/dist/lib/paged-window/use-paged-window.js +43 -0
- package/dist/lib/paged-window/use-paged-window.js.map +1 -0
- package/dist/lib/paged-window/use-scroll-root.js +12 -0
- package/dist/lib/paged-window/use-scroll-root.js.map +1 -0
- package/dist/lib/persist.js +84 -0
- package/dist/lib/persist.js.map +1 -0
- package/dist/lib/preference-values.js +13 -0
- package/dist/lib/preference-values.js.map +1 -0
- package/dist/lib/preferences.js +86 -0
- package/dist/lib/preferences.js.map +1 -0
- package/dist/lib/reads/hooks.js +156 -0
- package/dist/lib/reads/hooks.js.map +1 -0
- package/dist/lib/reads/optimistic.js +169 -0
- package/dist/lib/reads/optimistic.js.map +1 -0
- package/dist/lib/reads/refetch.js +108 -0
- package/dist/lib/reads/refetch.js.map +1 -0
- package/dist/lib/reads/slots.js +215 -0
- package/dist/lib/reads/slots.js.map +1 -0
- package/dist/lib/realtime/hooks.js +40 -0
- package/dist/lib/realtime/hooks.js.map +1 -0
- package/dist/lib/realtime/provider.js +25 -0
- package/dist/lib/realtime/provider.js.map +1 -0
- package/dist/lib/realtime/registry.js +472 -0
- package/dist/lib/realtime/registry.js.map +1 -0
- package/dist/lib/records/define-record-type.js +33 -0
- package/dist/lib/records/define-record-type.js.map +1 -0
- package/dist/lib/records/hooks.js +39 -0
- package/dist/lib/records/hooks.js.map +1 -0
- package/dist/lib/records/store.js +572 -0
- package/dist/lib/records/store.js.map +1 -0
- package/dist/lib/records/wire.js +58 -0
- package/dist/lib/records/wire.js.map +1 -0
- package/dist/lib/reduced-motion-help.js +19 -0
- package/dist/lib/reduced-motion-help.js.map +1 -0
- package/dist/lib/scroll-caret.js +18 -0
- package/dist/lib/scroll-caret.js.map +1 -0
- package/dist/lib/sim/createSimStore.js +54 -0
- package/dist/lib/sim/createSimStore.js.map +1 -0
- package/dist/lib/sim/latency.js +28 -0
- package/dist/lib/sim/latency.js.map +1 -0
- package/dist/lib/sim/registry.js +13 -0
- package/dist/lib/sim/registry.js.map +1 -0
- package/dist/lib/sim/settings.js +41 -0
- package/dist/lib/sim/settings.js.map +1 -0
- package/dist/lib/submit-shortcut.js +25 -0
- package/dist/lib/submit-shortcut.js.map +1 -0
- package/dist/lib/syntax/index.js +33 -0
- package/dist/lib/syntax/index.js.map +1 -0
- package/dist/lib/syntax/languages/bash.js +77 -0
- package/dist/lib/syntax/languages/bash.js.map +1 -0
- package/dist/lib/syntax/languages/css.js +81 -0
- package/dist/lib/syntax/languages/css.js.map +1 -0
- package/dist/lib/syntax/languages/html.js +91 -0
- package/dist/lib/syntax/languages/html.js.map +1 -0
- package/dist/lib/syntax/languages/index.js +49 -0
- package/dist/lib/syntax/languages/index.js.map +1 -0
- package/dist/lib/syntax/languages/javascript.js +133 -0
- package/dist/lib/syntax/languages/javascript.js.map +1 -0
- package/dist/lib/syntax/languages/json.js +45 -0
- package/dist/lib/syntax/languages/json.js.map +1 -0
- package/dist/lib/syntax/languages/mongodb.js +24 -0
- package/dist/lib/syntax/languages/mongodb.js.map +1 -0
- package/dist/lib/syntax/languages/plain.js +10 -0
- package/dist/lib/syntax/languages/plain.js.map +1 -0
- package/dist/lib/syntax/languages/sql.js +113 -0
- package/dist/lib/syntax/languages/sql.js.map +1 -0
- package/dist/lib/syntax/languages/vue.js +31 -0
- package/dist/lib/syntax/languages/vue.js.map +1 -0
- package/dist/lib/syntax/languages/yaml.js +55 -0
- package/dist/lib/syntax/languages/yaml.js.map +1 -0
- package/dist/lib/syntax/markdown/grammar.js +52 -0
- package/dist/lib/syntax/markdown/grammar.js.map +1 -0
- package/dist/lib/syntax/markdown/inline.js +477 -0
- package/dist/lib/syntax/markdown/inline.js.map +1 -0
- package/dist/lib/syntax/markdown/parse.js +464 -0
- package/dist/lib/syntax/markdown/parse.js.map +1 -0
- package/dist/lib/syntax/markdown/refs.js +94 -0
- package/dist/lib/syntax/markdown/refs.js.map +1 -0
- package/dist/lib/syntax/markdown/render.js +230 -0
- package/dist/lib/syntax/markdown/render.js.map +1 -0
- package/dist/lib/syntax/markdown/spans.js +40 -0
- package/dist/lib/syntax/markdown/spans.js.map +1 -0
- package/dist/lib/syntax/registry.js +55 -0
- package/dist/lib/syntax/registry.js.map +1 -0
- package/dist/lib/syntax/tokenize.js +96 -0
- package/dist/lib/syntax/tokenize.js.map +1 -0
- package/dist/lib/time/instant.js +7 -0
- package/dist/lib/time/instant.js.map +1 -0
- package/dist/lib/time/plain.js +83 -0
- package/dist/lib/time/plain.js.map +1 -0
- package/dist/lib/time/relativeAge.js +20 -0
- package/dist/lib/time/relativeAge.js.map +1 -0
- package/dist/lib/time/relativeClock.js +59 -0
- package/dist/lib/time/relativeClock.js.map +1 -0
- package/dist/lib/time/types.js +23 -0
- package/dist/lib/time/types.js.map +1 -0
- package/dist/lib/time/zone.js +148 -0
- package/dist/lib/time/zone.js.map +1 -0
- package/dist/lib/use-controllable.js +16 -0
- package/dist/lib/use-controllable.js.map +1 -0
- package/dist/lib/use-fill-height.js +49 -0
- package/dist/lib/use-fill-height.js.map +1 -0
- package/dist/lib/use-hydrated.js +14 -0
- package/dist/lib/use-hydrated.js.map +1 -0
- package/dist/lib/use-media-query.js +30 -0
- package/dist/lib/use-media-query.js.map +1 -0
- package/dist/lib/use-relabel-base-ui-dismiss.js +26 -0
- package/dist/lib/use-relabel-base-ui-dismiss.js.map +1 -0
- package/dist/lib/use-release-snap-drag.js +29 -0
- package/dist/lib/use-release-snap-drag.js.map +1 -0
- package/dist/lib/use-roving-options.js +18 -0
- package/dist/lib/use-roving-options.js.map +1 -0
- package/dist/lib/values/absent.js +5 -0
- package/dist/lib/values/absent.js.map +1 -0
- package/dist/lib/values/boolean.js +13 -0
- package/dist/lib/values/boolean.js.map +1 -0
- package/dist/lib/values/currency.js +23 -0
- package/dist/lib/values/currency.js.map +1 -0
- package/dist/lib/values/date.js +35 -0
- package/dist/lib/values/date.js.map +1 -0
- package/dist/lib/values/datetime.js +54 -0
- package/dist/lib/values/datetime.js.map +1 -0
- package/dist/lib/values/locale-date.js +60 -0
- package/dist/lib/values/locale-date.js.map +1 -0
- package/dist/lib/values/number.js +16 -0
- package/dist/lib/values/number.js.map +1 -0
- package/dist/pure.js +379 -0
- package/dist/pure.js.map +1 -0
- package/dist/styles.css +190 -0
- package/dist/theme.css +360 -0
- package/dist/types/components/Accordion.d.ts +15 -0
- package/dist/types/components/AgentWorkingSpinner.d.ts +23 -0
- package/dist/types/components/AppShell.d.ts +164 -0
- package/dist/types/components/Attention.d.ts +87 -0
- package/dist/types/components/Avatar.d.ts +154 -0
- package/dist/types/components/Badge.d.ts +131 -0
- package/dist/types/components/Board.d.ts +239 -0
- package/dist/types/components/Button.d.ts +208 -0
- package/dist/types/components/Callout.d.ts +163 -0
- package/dist/types/components/Card.d.ts +219 -0
- package/dist/types/components/Choice.d.ts +127 -0
- package/dist/types/components/CodeEditor.d.ts +86 -0
- package/dist/types/components/ColorPicker.d.ts +14 -0
- package/dist/types/components/Combobox.d.ts +43 -0
- package/dist/types/components/CommandPalette.d.ts +35 -0
- package/dist/types/components/ConcentricRing.d.ts +61 -0
- package/dist/types/components/ConnectionCard.d.ts +64 -0
- package/dist/types/components/ContextItemRow.d.ts +35 -0
- package/dist/types/components/CopyValue.d.ts +14 -0
- package/dist/types/components/CountBadge.d.ts +14 -0
- package/dist/types/components/DateCalendar.d.ts +30 -0
- package/dist/types/components/DateField.d.ts +29 -0
- package/dist/types/components/DatePicker.d.ts +20 -0
- package/dist/types/components/DateTimeText.d.ts +9 -0
- package/dist/types/components/DescriptionList.d.ts +40 -0
- package/dist/types/components/Dialog.d.ts +269 -0
- package/dist/types/components/DragDrop.d.ts +196 -0
- package/dist/types/components/Drawer.d.ts +163 -0
- package/dist/types/components/EditGutter.d.ts +44 -0
- package/dist/types/components/EmojiPicker.d.ts +30 -0
- package/dist/types/components/ErrorBoundary.d.ts +43 -0
- package/dist/types/components/Field.d.ts +37 -0
- package/dist/types/components/FileUpload.d.ts +22 -0
- package/dist/types/components/FilterMenu.d.ts +120 -0
- package/dist/types/components/GatesSection.d.ts +79 -0
- package/dist/types/components/Icon.d.ts +40 -0
- package/dist/types/components/IconButton.d.ts +69 -0
- package/dist/types/components/IconStack.d.ts +28 -0
- package/dist/types/components/ImageUploadField.d.ts +38 -0
- package/dist/types/components/InlineEdit.d.ts +183 -0
- package/dist/types/components/InlineMarkdownEdit.d.ts +100 -0
- package/dist/types/components/Input.d.ts +128 -0
- package/dist/types/components/LegalDocument.d.ts +23 -0
- package/dist/types/components/LineDiff.d.ts +53 -0
- package/dist/types/components/ListHeader.d.ts +45 -0
- package/dist/types/components/Loading.d.ts +131 -0
- package/dist/types/components/Markdown.d.ts +35 -0
- package/dist/types/components/MarkdownEditor.d.ts +129 -0
- package/dist/types/components/Menu.d.ts +157 -0
- package/dist/types/components/Navigation.d.ts +67 -0
- package/dist/types/components/NumberInput.d.ts +177 -0
- package/dist/types/components/OTPInput.d.ts +13 -0
- package/dist/types/components/OrderedEntityManager.d.ts +64 -0
- package/dist/types/components/PagedWindowList.d.ts +23 -0
- package/dist/types/components/PaginationBar.d.ts +31 -0
- package/dist/types/components/Panel.d.ts +94 -0
- package/dist/types/components/PasswordInput.d.ts +7 -0
- package/dist/types/components/PasswordRequirements.d.ts +11 -0
- package/dist/types/components/PatchDiff.d.ts +38 -0
- package/dist/types/components/PendingVeil.d.ts +8 -0
- package/dist/types/components/Popover.d.ts +231 -0
- package/dist/types/components/Progress.d.ts +580 -0
- package/dist/types/components/RatingScale.d.ts +30 -0
- package/dist/types/components/ReadMore.d.ts +26 -0
- package/dist/types/components/RecordCard.d.ts +413 -0
- package/dist/types/components/RelativeTime.d.ts +17 -0
- package/dist/types/components/SandboxedFrame.d.ts +37 -0
- package/dist/types/components/SearchInput.d.ts +6 -0
- package/dist/types/components/SecretField.d.ts +90 -0
- package/dist/types/components/SectionNav.d.ts +15 -0
- package/dist/types/components/Select.d.ts +53 -0
- package/dist/types/components/SequenceDiagram.d.ts +15 -0
- package/dist/types/components/SettingRow.d.ts +144 -0
- package/dist/types/components/SignOffRings.d.ts +29 -0
- package/dist/types/components/Slider.d.ts +255 -0
- package/dist/types/components/SolutionChoice.d.ts +49 -0
- package/dist/types/components/SortMenu.d.ts +45 -0
- package/dist/types/components/Spinner.d.ts +29 -0
- package/dist/types/components/Stat.d.ts +136 -0
- package/dist/types/components/StatusSelect.d.ts +93 -0
- package/dist/types/components/Surface.d.ts +145 -0
- package/dist/types/components/Table.d.ts +164 -0
- package/dist/types/components/Tabs.d.ts +142 -0
- package/dist/types/components/ThemeMenu.d.ts +56 -0
- package/dist/types/components/Toast.d.ts +63 -0
- package/dist/types/components/Toggle.d.ts +168 -0
- package/dist/types/components/ToggleMatrix.d.ts +51 -0
- package/dist/types/components/Tree.d.ts +20 -0
- package/dist/types/components/TriStateSwitch.d.ts +63 -0
- package/dist/types/components/VideoPlayer.d.ts +26 -0
- package/dist/types/components/auth/AcceptInvitationCard.d.ts +54 -0
- package/dist/types/components/auth/AuthLayout.d.ts +12 -0
- package/dist/types/components/auth/ForgotPasswordForm.d.ts +6 -0
- package/dist/types/components/auth/LoginForm.d.ts +13 -0
- package/dist/types/components/auth/ResetPasswordForm.d.ts +9 -0
- package/dist/types/components/auth/SignInProviders.d.ts +56 -0
- package/dist/types/components/auth/SignupCard.d.ts +62 -0
- package/dist/types/components/auth/TermsAcceptance.d.ts +14 -0
- package/dist/types/components/auth/index.d.ts +8 -0
- package/dist/types/components/board/context.d.ts +65 -0
- package/dist/types/components/board/recipe.d.ts +97 -0
- package/dist/types/components/calendar/CalendarMonth.d.ts +32 -0
- package/dist/types/components/calendar/CalendarTimeGrid.d.ts +74 -0
- package/dist/types/components/calendar/EventActions.d.ts +16 -0
- package/dist/types/components/calendar/format.d.ts +42 -0
- package/dist/types/components/calendar/palette.d.ts +17 -0
- package/dist/types/components/calendar/use-calendar-drag.d.ts +53 -0
- package/dist/types/components/calendar/use-event-keyboard.d.ts +23 -0
- package/dist/types/components/calendar/use-grid-navigation.d.ts +47 -0
- package/dist/types/components/calendar/use-now.d.ts +20 -0
- package/dist/types/components/card-face/AcRingGlyph.d.ts +20 -0
- package/dist/types/components/card-face/BoardCardAgentSlot.d.ts +19 -0
- package/dist/types/components/card-face/CardFace.d.ts +106 -0
- package/dist/types/components/card-face/CardTypeBadge.d.ts +21 -0
- package/dist/types/components/card-face/EffortBadge.d.ts +9 -0
- package/dist/types/components/card-face/GateRingGlyph.d.ts +22 -0
- package/dist/types/components/card-face/OverflowRow.d.ts +40 -0
- package/dist/types/components/card-face/TapTip.d.ts +15 -0
- package/dist/types/components/card-face/hit-area.d.ts +20 -0
- package/dist/types/components/card-face/vocabulary.d.ts +83 -0
- package/dist/types/components/chart/BarList.d.ts +27 -0
- package/dist/types/components/chart/LineChart.d.ts +64 -0
- package/dist/types/components/chart/ShareBar.d.ts +26 -0
- package/dist/types/components/chart/TimeSeriesChart.d.ts +60 -0
- package/dist/types/components/chart/label-metrics.d.ts +9 -0
- package/dist/types/components/chart/line-chart-axis.d.ts +14 -0
- package/dist/types/components/chart/line-chart-scale.d.ts +55 -0
- package/dist/types/components/chart/line-series-style.d.ts +14 -0
- package/dist/types/components/chart/share-bar-labels.d.ts +17 -0
- package/dist/types/components/chart/shared.d.ts +122 -0
- package/dist/types/components/chart/time-series-scale.d.ts +29 -0
- package/dist/types/components/chat/Attachment.d.ts +125 -0
- package/dist/types/components/chat/Chat.d.ts +60 -0
- package/dist/types/components/chat/Composer.d.ts +62 -0
- package/dist/types/components/chat/ContextMeter.d.ts +45 -0
- package/dist/types/components/chat/EffortControl.d.ts +23 -0
- package/dist/types/components/chat/FileCover.d.ts +14 -0
- package/dist/types/components/chat/Message.d.ts +66 -0
- package/dist/types/components/chat/MessageScroller.d.ts +18 -0
- package/dist/types/components/chat/ModelSelector.d.ts +44 -0
- package/dist/types/components/chat/StreamingMarkdown.d.ts +11 -0
- package/dist/types/components/chat/download-file.d.ts +7 -0
- package/dist/types/components/chat/file-icon.d.ts +29 -0
- package/dist/types/components/chat/types.d.ts +165 -0
- package/dist/types/components/checklist/StatusChecklist.d.ts +37 -0
- package/dist/types/components/checklist/index.d.ts +3 -0
- package/dist/types/components/checklist/tally.d.ts +19 -0
- package/dist/types/components/checklist/types.d.ts +28 -0
- package/dist/types/components/code-editor/context.d.ts +32 -0
- package/dist/types/components/code-editor/editing.d.ts +39 -0
- package/dist/types/components/code-editor/highlight.d.ts +20 -0
- package/dist/types/components/code-editor/recipe.d.ts +109 -0
- package/dist/types/components/date-timeline/DateTimeline.d.ts +99 -0
- package/dist/types/components/date-timeline/TimelineRow.d.ts +22 -0
- package/dist/types/components/date-timeline/useBarDrag.d.ts +15 -0
- package/dist/types/components/date-timeline/useMarkerDrag.d.ts +14 -0
- package/dist/types/components/date-timeline/useTimelineZoom.d.ts +23 -0
- package/dist/types/components/drag-drop/context.d.ts +85 -0
- package/dist/types/components/drag-drop/recipe.d.ts +163 -0
- package/dist/types/components/drag-drop/shift.d.ts +153 -0
- package/dist/types/components/edit/activation.d.ts +21 -0
- package/dist/types/components/edit/outcome.d.ts +29 -0
- package/dist/types/components/edit/use-edit-session.d.ts +77 -0
- package/dist/types/components/file-viewer/FileViewer.d.ts +2 -0
- package/dist/types/components/file-viewer/PageNumberJumpField.d.ts +9 -0
- package/dist/types/components/file-viewer/ViewerControls.d.ts +20 -0
- package/dist/types/components/file-viewer/ViewerRail.d.ts +10 -0
- package/dist/types/components/file-viewer/ViewerStage.d.ts +22 -0
- package/dist/types/components/file-viewer/frames.d.ts +28 -0
- package/dist/types/components/file-viewer/index.d.ts +3 -0
- package/dist/types/components/file-viewer/types.d.ts +70 -0
- package/dist/types/components/file-viewer/use-frame-cursor.d.ts +13 -0
- package/dist/types/components/file-viewer/use-viewer-keys.d.ts +24 -0
- package/dist/types/components/file-viewer/use-viewer-zoom.d.ts +29 -0
- package/dist/types/components/focus-web/FocusWeb.d.ts +3 -0
- package/dist/types/components/focus-web/index.d.ts +4 -0
- package/dist/types/components/focus-web/layout.d.ts +55 -0
- package/dist/types/components/focus-web/types.d.ts +131 -0
- package/dist/types/components/graph-explorer/GraphExplorer.d.ts +42 -0
- package/dist/types/components/graph-explorer/camera-math.d.ts +119 -0
- package/dist/types/components/graph-explorer/index.d.ts +5 -0
- package/dist/types/components/graph-explorer/tree-layout.d.ts +67 -0
- package/dist/types/components/graph-explorer/types.d.ts +62 -0
- package/dist/types/components/graph-explorer/use-camera.d.ts +81 -0
- package/dist/types/components/graph-explorer/viewport-gesture.d.ts +32 -0
- package/dist/types/components/kanban/KanbanBoard.d.ts +72 -0
- package/dist/types/components/kanban/recipe.d.ts +73 -0
- package/dist/types/components/kanban/types.d.ts +55 -0
- package/dist/types/components/markdown/Affordances.d.ts +105 -0
- package/dist/types/components/markdown/AttachmentStrip.d.ts +25 -0
- package/dist/types/components/markdown/ImageUpload.d.ts +56 -0
- package/dist/types/components/media-error.d.ts +11 -0
- package/dist/types/components/nav-sections.d.ts +10 -0
- package/dist/types/components/node-canvas/NodeCanvas.d.ts +66 -0
- package/dist/types/components/node-canvas/index.d.ts +3 -0
- package/dist/types/components/node-canvas/layout.d.ts +29 -0
- package/dist/types/components/node-canvas/types.d.ts +207 -0
- package/dist/types/components/node-canvas/use-canvas-gestures.d.ts +39 -0
- package/dist/types/components/openapi/OpenApiViewer.d.ts +14 -0
- package/dist/types/components/openapi/OperationCard.d.ts +33 -0
- package/dist/types/components/openapi/SchemaView.d.ts +14 -0
- package/dist/types/components/openapi/index.d.ts +6 -0
- package/dist/types/components/openapi/resolve.d.ts +72 -0
- package/dist/types/components/openapi/types.d.ts +128 -0
- package/dist/types/components/overlay-shell.d.ts +48 -0
- package/dist/types/components/overlay-stack.d.ts +18 -0
- package/dist/types/components/paged-window/PageBlock.d.ts +31 -0
- package/dist/types/components/provenance/ConfidenceBar.d.ts +118 -0
- package/dist/types/components/provenance/ConfidenceMeter.d.ts +21 -0
- package/dist/types/components/provenance/ConfidenceReadout.d.ts +17 -0
- package/dist/types/components/provenance/ProvenanceBadge.d.ts +23 -0
- package/dist/types/components/provenance/ProvenanceDetail.d.ts +109 -0
- package/dist/types/components/provenance/ProvenanceDisclosure.d.ts +107 -0
- package/dist/types/components/provenance/absence.d.ts +37 -0
- package/dist/types/components/provenance/index.d.ts +7 -0
- package/dist/types/components/provenance/types.d.ts +137 -0
- package/dist/types/components/rbac/AccessRequestPanel.d.ts +92 -0
- package/dist/types/components/rbac/AccountMenu.d.ts +46 -0
- package/dist/types/components/rbac/AgentKeysList.d.ts +20 -0
- package/dist/types/components/rbac/ApiKeysPanel.d.ts +26 -0
- package/dist/types/components/rbac/ApiKeysTable.d.ts +63 -0
- package/dist/types/components/rbac/Brand.d.ts +8 -0
- package/dist/types/components/rbac/Can.d.ts +19 -0
- package/dist/types/components/rbac/ChangePasswordForm.d.ts +18 -0
- package/dist/types/components/rbac/DangerZone.d.ts +8 -0
- package/dist/types/components/rbac/DevToolsPopover.d.ts +36 -0
- package/dist/types/components/rbac/EndedLine.d.ts +21 -0
- package/dist/types/components/rbac/InvitationsList.d.ts +39 -0
- package/dist/types/components/rbac/InviteMembersDialog.d.ts +21 -0
- package/dist/types/components/rbac/MembersPanel.d.ts +31 -0
- package/dist/types/components/rbac/PermissionRequestPanel.d.ts +36 -0
- package/dist/types/components/rbac/ProfileForm.d.ts +27 -0
- package/dist/types/components/rbac/ProfilePage.d.ts +16 -0
- package/dist/types/components/rbac/RBACProvider.d.ts +69 -0
- package/dist/types/components/rbac/RoleEditorDialog.d.ts +28 -0
- package/dist/types/components/rbac/RoleKeyPicker.d.ts +24 -0
- package/dist/types/components/rbac/RolePermissionMatrix.d.ts +21 -0
- package/dist/types/components/rbac/RolesPermissionsPage.d.ts +24 -0
- package/dist/types/components/rbac/SessionsList.d.ts +35 -0
- package/dist/types/components/rbac/TeamSettingsForm.d.ts +22 -0
- package/dist/types/components/rbac/TeamSwitcher.d.ts +5 -0
- package/dist/types/components/rbac/approvalPanelParts.d.ts +69 -0
- package/dist/types/components/rbac/index.d.ts +25 -0
- package/dist/types/components/rbac/permissionSections.d.ts +8 -0
- package/dist/types/components/rbac/stagedForm.d.ts +25 -0
- package/dist/types/components/rbac/types.d.ts +65 -0
- package/dist/types/components/rbac/useStagedImage.d.ts +15 -0
- package/dist/types/components/roadmap/PhaseManager.d.ts +19 -0
- package/dist/types/components/roadmap/RoadmapItemCard.d.ts +51 -0
- package/dist/types/components/roadmap/RoadmapPage.d.ts +12 -0
- package/dist/types/components/roadmap/RoadmapSwimlaneBoard.d.ts +15 -0
- package/dist/types/components/roadmap/TrackManager.d.ts +19 -0
- package/dist/types/components/roadmap/UseCaseCard.d.ts +30 -0
- package/dist/types/components/roadmap/UseCaseLedgerPage.d.ts +29 -0
- package/dist/types/components/roadmap/chip-tones.d.ts +2 -0
- package/dist/types/components/roadmap/derive.d.ts +39 -0
- package/dist/types/components/roadmap/index.d.ts +10 -0
- package/dist/types/components/roadmap/types.d.ts +86 -0
- package/dist/types/components/stepper/Stepper.d.ts +79 -0
- package/dist/types/components/stepper/derive.d.ts +49 -0
- package/dist/types/components/stepper/index.d.ts +3 -0
- package/dist/types/components/stepper/types.d.ts +118 -0
- package/dist/types/icons/data.d.ts +2054 -0
- package/dist/types/index.d.ts +209 -0
- package/dist/types/lib/attention.d.ts +62 -0
- package/dist/types/lib/board/anchor.d.ts +69 -0
- package/dist/types/lib/board/index.d.ts +17 -0
- package/dist/types/lib/board/model.d.ts +43 -0
- package/dist/types/lib/board/move.d.ts +181 -0
- package/dist/types/lib/board/position.d.ts +22 -0
- package/dist/types/lib/board/rejection.d.ts +8 -0
- package/dist/types/lib/board/types.d.ts +294 -0
- package/dist/types/lib/board/use-board.d.ts +47 -0
- package/dist/types/lib/calendar/band-packer.d.ts +53 -0
- package/dist/types/lib/calendar/drag.d.ts +125 -0
- package/dist/types/lib/calendar/index.d.ts +4 -0
- package/dist/types/lib/calendar/lane-packer.d.ts +88 -0
- package/dist/types/lib/calendar/segments.d.ts +91 -0
- package/dist/types/lib/calendar/types.d.ts +166 -0
- package/dist/types/lib/chart-palette.d.ts +14 -0
- package/dist/types/lib/clipboard.d.ts +12 -0
- package/dist/types/lib/cn.d.ts +7 -0
- package/dist/types/lib/color.d.ts +14 -0
- package/dist/types/lib/component-guidance.d.ts +15 -0
- package/dist/types/lib/confidence.d.ts +28 -0
- package/dist/types/lib/date-timeline/scale.d.ts +143 -0
- package/dist/types/lib/design-frame/document.d.ts +39 -0
- package/dist/types/lib/design-frame/mini-app-script.d.ts +29 -0
- package/dist/types/lib/design-frame/mini-app.d.ts +17 -0
- package/dist/types/lib/design-frame/protocol.d.ts +78 -0
- package/dist/types/lib/dev-warn.d.ts +10 -0
- package/dist/types/lib/dnd/announce.d.ts +124 -0
- package/dist/types/lib/dnd/autoscroll.d.ts +88 -0
- package/dist/types/lib/dnd/cross-drop.d.ts +18 -0
- package/dist/types/lib/dnd/geometry.d.ts +126 -0
- package/dist/types/lib/dnd/index.d.ts +17 -0
- package/dist/types/lib/dnd/sensors/gesture.d.ts +37 -0
- package/dist/types/lib/dnd/sensors/keyboard.d.ts +54 -0
- package/dist/types/lib/dnd/sensors/pointer.d.ts +59 -0
- package/dist/types/lib/dnd/session.d.ts +124 -0
- package/dist/types/lib/dnd/types.d.ts +226 -0
- package/dist/types/lib/dnd/use-drag.d.ts +82 -0
- package/dist/types/lib/dom/scroll-ancestor.d.ts +15 -0
- package/dist/types/lib/format.d.ts +33 -0
- package/dist/types/lib/group-in-order.d.ts +13 -0
- package/dist/types/lib/header-fold.d.ts +10 -0
- package/dist/types/lib/i18n/areas/auth-provenance-flows.d.ts +287 -0
- package/dist/types/lib/i18n/areas/board.d.ts +51 -0
- package/dist/types/lib/i18n/areas/card-face.d.ts +8 -0
- package/dist/types/lib/i18n/areas/chat-chart.d.ts +202 -0
- package/dist/types/lib/i18n/areas/code-editor.d.ts +40 -0
- package/dist/types/lib/i18n/areas/date-timeline.d.ts +36 -0
- package/dist/types/lib/i18n/areas/dates.d.ts +103 -0
- package/dist/types/lib/i18n/areas/docs-views.d.ts +297 -0
- package/dist/types/lib/i18n/areas/feedback.d.ts +132 -0
- package/dist/types/lib/i18n/areas/formats.d.ts +30 -0
- package/dist/types/lib/i18n/areas/forms.d.ts +182 -0
- package/dist/types/lib/i18n/areas/keys.d.ts +15 -0
- package/dist/types/lib/i18n/areas/markdown.d.ts +150 -0
- package/dist/types/lib/i18n/areas/move-rejected.d.ts +16 -0
- package/dist/types/lib/i18n/areas/navigation.d.ts +185 -0
- package/dist/types/lib/i18n/areas/rbac.d.ts +633 -0
- package/dist/types/lib/i18n/emphasis.d.ts +3 -0
- package/dist/types/lib/i18n/index.d.ts +10 -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 +18 -0
- package/dist/types/lib/icons.d.ts +22 -0
- package/dist/types/lib/interactive-target.d.ts +3 -0
- package/dist/types/lib/intl-cache.d.ts +31 -0
- package/dist/types/lib/legal-document.d.ts +82 -0
- package/dist/types/lib/line-diff-model.d.ts +39 -0
- package/dist/types/lib/markdown/attachments.d.ts +50 -0
- package/dist/types/lib/markdown/caret-map.d.ts +69 -0
- package/dist/types/lib/markdown/caret.d.ts +6 -0
- package/dist/types/lib/markdown/commands.d.ts +186 -0
- package/dist/types/lib/markdown/convert.d.ts +99 -0
- package/dist/types/lib/markdown/dom.d.ts +30 -0
- package/dist/types/lib/markdown/edit.d.ts +16 -0
- package/dist/types/lib/markdown/history.d.ts +59 -0
- package/dist/types/lib/markdown/hotkeys.d.ts +63 -0
- package/dist/types/lib/markdown/image-pipeline.d.ts +173 -0
- package/dist/types/lib/markdown/images.d.ts +138 -0
- package/dist/types/lib/markdown/input.d.ts +38 -0
- package/dist/types/lib/markdown/keys.d.ts +34 -0
- package/dist/types/lib/markdown/paste.d.ts +9 -0
- package/dist/types/lib/markdown/position.d.ts +43 -0
- package/dist/types/lib/markdown/project.d.ts +88 -0
- package/dist/types/lib/markdown/reconcile.d.ts +63 -0
- package/dist/types/lib/markdown/surface.d.ts +236 -0
- package/dist/types/lib/motion.d.ts +30 -0
- package/dist/types/lib/pad.d.ts +6 -0
- package/dist/types/lib/paged-window/index.d.ts +2 -0
- package/dist/types/lib/paged-window/layout.d.ts +21 -0
- package/dist/types/lib/paged-window/list-owner.d.ts +12 -0
- package/dist/types/lib/paged-window/records-binding.d.ts +102 -0
- package/dist/types/lib/paged-window/store.d.ts +307 -0
- package/dist/types/lib/paged-window/use-measured-pitch.d.ts +34 -0
- package/dist/types/lib/paged-window/use-page-visibility.d.ts +20 -0
- package/dist/types/lib/paged-window/use-paged-window.d.ts +61 -0
- package/dist/types/lib/paged-window/use-scroll-root.d.ts +18 -0
- package/dist/types/lib/persist.d.ts +57 -0
- package/dist/types/lib/preference-values.d.ts +72 -0
- package/dist/types/lib/preferences.d.ts +26 -0
- package/dist/types/lib/reads/hooks.d.ts +49 -0
- package/dist/types/lib/reads/index.d.ts +5 -0
- package/dist/types/lib/reads/optimistic.d.ts +119 -0
- package/dist/types/lib/reads/refetch.d.ts +83 -0
- package/dist/types/lib/reads/slots.d.ts +137 -0
- package/dist/types/lib/reads/types.d.ts +155 -0
- package/dist/types/lib/realtime/hooks.d.ts +38 -0
- package/dist/types/lib/realtime/index.d.ts +4 -0
- package/dist/types/lib/realtime/provider.d.ts +38 -0
- package/dist/types/lib/realtime/registry.d.ts +225 -0
- package/dist/types/lib/realtime/types.d.ts +242 -0
- package/dist/types/lib/records/define-record-type.d.ts +29 -0
- package/dist/types/lib/records/hooks.d.ts +46 -0
- package/dist/types/lib/records/index.d.ts +5 -0
- package/dist/types/lib/records/store.d.ts +289 -0
- package/dist/types/lib/records/types.d.ts +195 -0
- package/dist/types/lib/records/wire.d.ts +96 -0
- package/dist/types/lib/reduced-motion-help.d.ts +23 -0
- package/dist/types/lib/scroll-caret.d.ts +6 -0
- package/dist/types/lib/sim/createSimStore.d.ts +18 -0
- package/dist/types/lib/sim/index.d.ts +5 -0
- package/dist/types/lib/sim/latency.d.ts +10 -0
- package/dist/types/lib/sim/registry.d.ts +14 -0
- package/dist/types/lib/sim/settings.d.ts +11 -0
- package/dist/types/lib/sim/types.d.ts +3 -0
- package/dist/types/lib/submit-shortcut.d.ts +24 -0
- package/dist/types/lib/syntax/index.d.ts +16 -0
- package/dist/types/lib/syntax/languages/bash.d.ts +1 -0
- package/dist/types/lib/syntax/languages/css.d.ts +1 -0
- package/dist/types/lib/syntax/languages/html.d.ts +17 -0
- package/dist/types/lib/syntax/languages/index.d.ts +33 -0
- package/dist/types/lib/syntax/languages/javascript.d.ts +22 -0
- package/dist/types/lib/syntax/languages/json.d.ts +1 -0
- package/dist/types/lib/syntax/languages/mongodb.d.ts +1 -0
- package/dist/types/lib/syntax/languages/plain.d.ts +9 -0
- package/dist/types/lib/syntax/languages/sql.d.ts +4 -0
- package/dist/types/lib/syntax/languages/vue.d.ts +1 -0
- package/dist/types/lib/syntax/languages/yaml.d.ts +1 -0
- package/dist/types/lib/syntax/markdown/frames.d.ts +145 -0
- package/dist/types/lib/syntax/markdown/grammar.d.ts +1 -0
- package/dist/types/lib/syntax/markdown/index.d.ts +5 -0
- package/dist/types/lib/syntax/markdown/inline.d.ts +21 -0
- package/dist/types/lib/syntax/markdown/parse.d.ts +15 -0
- package/dist/types/lib/syntax/markdown/refs.d.ts +47 -0
- package/dist/types/lib/syntax/markdown/render.d.ts +25 -0
- package/dist/types/lib/syntax/markdown/spans.d.ts +84 -0
- package/dist/types/lib/syntax/markdown/types.d.ts +108 -0
- package/dist/types/lib/syntax/registry.d.ts +37 -0
- package/dist/types/lib/syntax/tokenize.d.ts +17 -0
- package/dist/types/lib/syntax/types.d.ts +119 -0
- package/dist/types/lib/time/index.d.ts +4 -0
- package/dist/types/lib/time/instant.d.ts +2 -0
- package/dist/types/lib/time/plain.d.ts +61 -0
- package/dist/types/lib/time/relativeAge.d.ts +18 -0
- package/dist/types/lib/time/relativeClock.d.ts +8 -0
- package/dist/types/lib/time/types.d.ts +87 -0
- package/dist/types/lib/time/zone.d.ts +106 -0
- package/dist/types/lib/use-controllable.d.ts +14 -0
- package/dist/types/lib/use-fill-height.d.ts +26 -0
- package/dist/types/lib/use-hydrated.d.ts +8 -0
- package/dist/types/lib/use-media-query.d.ts +29 -0
- package/dist/types/lib/use-relabel-base-ui-dismiss.d.ts +6 -0
- package/dist/types/lib/use-release-snap-drag.d.ts +25 -0
- package/dist/types/lib/use-roving-options.d.ts +10 -0
- package/dist/types/lib/values/absent.d.ts +7 -0
- package/dist/types/lib/values/boolean.d.ts +29 -0
- package/dist/types/lib/values/currency.d.ts +22 -0
- package/dist/types/lib/values/date.d.ts +30 -0
- package/dist/types/lib/values/datetime.d.ts +48 -0
- package/dist/types/lib/values/index.d.ts +5 -0
- package/dist/types/lib/values/locale-date.d.ts +34 -0
- package/dist/types/lib/values/number.d.ts +27 -0
- package/dist/types/pure.d.ts +48 -0
- package/package.json +136 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenize.js","sources":["../../../src/lib/syntax/tokenize.ts"],"sourcesContent":["import { getGrammar } from \"./registry\";\nimport type { Grammar, Rule, Token, TokenizeContext, TokenType } from \"./types\";\n\n/**\n * The scanner. Walks a string left to right, trying each rule of the current\n * state at the current position, and emits a flat token list that covers the\n * whole input.\n *\n * TWO MECHANISMS, DELIBERATELY DISTINCT, because conflating them is what makes\n * hand-rolled highlighters unable to nest:\n *\n * STATES (`push` / `pop`) are for a construct WITHIN one language — the body\n * of a string, a block comment, the inside of a tag. Same grammar, different\n * rules in force.\n *\n * EMBEDDING (`embed` + `until`) hands a REGION to a different language\n * entirely. The region is located first, tokenized by the inner grammar as if\n * it were a document of its own, and spliced back in with every offset\n * shifted. That indirection is what lets an embedded language have its own\n * states, its own embeds, and even its own parser — which is how a fenced\n * markdown block inside a Vue `<script>` block works without a single line of\n * code that knows about that combination.\n */\n\n/** Nothing sensible can nest this deep; a grammar embedding itself would. */\nconst MAX_DEPTH = 12;\n\n/**\n * Tokenizes `source` as `language`. An unknown or missing language yields one\n * `text` token spanning the input — never an error, never an empty result. A\n * code block labelled with a language nobody implemented still has to be\n * readable, and an editor still has to be editable.\n */\nexport function tokenize(source: string, language: string | null | undefined): Token[] {\n return run(source, getGrammar(language), 0, 0);\n}\n\nfunction run(source: string, grammar: Grammar | undefined, offset: number, depth: number): Token[] {\n if (!source) return [];\n if (!grammar || depth > MAX_DEPTH) {\n return [{ start: offset, end: offset + source.length, type: \"text\", lang: grammar?.name ?? \"text\" }];\n }\n\n if (grammar.tokenize) {\n const ctx: TokenizeContext = {\n sub: (inner, lang, at) => run(inner, getGrammar(lang), at, depth + 1),\n };\n return shift(grammar.tokenize(source, ctx), offset);\n }\n\n return scan(source, grammar, offset, depth);\n}\n\n/** Re-bases a token list produced against a substring. */\nfunction shift(tokens: Token[], offset: number): Token[] {\n if (offset === 0) return tokens;\n return tokens.map((t) => ({ ...t, start: t.start + offset, end: t.end + offset }));\n}\n\nfunction scan(source: string, grammar: Grammar, offset: number, depth: number): Token[] {\n const out: Token[] = [];\n const stack: string[] = [\"root\"];\n let pos = 0;\n\n /* Unmatched characters accumulate rather than emitting one token each: a\n token per character would make a 200kB file 200k objects, and the merge in\n `emit` also makes the output canonical, which is what lets tests compare\n token lists directly. */\n let textFrom = 0;\n\n const flushText = () => {\n if (pos > textFrom) emit(out, offset + textFrom, offset + pos, \"text\", grammar.name);\n textFrom = pos;\n };\n\n while (pos < source.length) {\n const state = stack[stack.length - 1];\n const rules = grammar.states[state] ?? [];\n let matched = false;\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n rule.match.lastIndex = pos;\n const m = rule.match.exec(source);\n if (!m || m.index !== pos) continue;\n\n if (m[0].length === 0) {\n /* A zero-width match would spin forever. Loud, with the address, is the\n only useful behaviour — this is always an authoring mistake. */\n throw new Error(`${grammar.name}.${state}[${i}] matched empty at ${pos}`);\n }\n\n flushText();\n emitMatch(out, m, rule, offset, grammar.name);\n pos += m[0].length;\n\n if (rule.embed) {\n pos = embed(source, m, rule, out, grammar, offset, depth, pos);\n } else if (rule.push) {\n stack.push(rule.push);\n } else if (rule.pop && stack.length > 1) {\n stack.pop();\n }\n\n textFrom = pos;\n matched = true;\n break;\n }\n\n if (!matched) pos += 1;\n }\n\n pos = source.length;\n flushText();\n return out;\n}\n\n/**\n * Runs an embedded region and returns the position after it.\n *\n * The terminator is located BEFORE the inner grammar sees anything. Letting the\n * inner grammar scan until something happens to stop it is how a `</script>`\n * inside a JavaScript string ends the block early — the region's extent is the\n * OUTER language's business, and only the outer language can decide it.\n */\nfunction embed(\n source: string,\n match: RegExpExecArray,\n rule: Rule,\n out: Token[],\n grammar: Grammar,\n offset: number,\n depth: number,\n from: number,\n): number {\n const language = typeof rule.embed === \"function\" ? rule.embed(match) : (rule.embed as string);\n\n const until = rule.until!;\n /* Searched, not sticky-tested: the terminator is somewhere ahead, and where\n it is decides the region. `sticky` in the registry forced `y` on, so it is\n rebuilt here as a plain search. */\n const search = new RegExp(until.source, until.flags.replace(\"y\", \"\") + \"g\");\n search.lastIndex = from;\n const stop = search.exec(source);\n\n const bodyEnd = stop ? stop.index : source.length;\n const body = source.slice(from, bodyEnd);\n\n if (body) {\n const inner = run(body, getGrammar(language), offset + from, depth + 1);\n for (const token of inner) out.push(token);\n }\n\n if (!stop) return source.length;\n\n emit(out, offset + stop.index, offset + stop.index + stop[0].length, rule.untilToken ?? \"punctuation\", grammar.name);\n return stop.index + stop[0].length;\n}\n\n/** Emits the parts of one rule match — whole-match, or per capture group. */\nfunction emitMatch(out: Token[], m: RegExpExecArray, rule: Rule, offset: number, lang: string): void {\n const start = m.index;\n const end = start + m[0].length;\n\n if (rule.token) {\n emit(out, offset + start, offset + end, rule.token, lang);\n return;\n }\n\n if (rule.groups) {\n const indices = m.indices;\n let cursor = start;\n\n for (let g = 0; g < rule.groups.length; g++) {\n const span = indices?.[g + 1];\n if (!span) continue;\n /* Anything between the previous group and this one is real source text\n and must still be emitted, or the coverage invariant breaks and the\n editor overlay drifts out of alignment with its textarea. */\n if (span[0] > cursor) emit(out, offset + cursor, offset + span[0], \"text\", lang);\n emit(out, offset + span[0], offset + span[1], rule.groups[g] ?? \"text\", lang);\n cursor = span[1];\n }\n\n if (cursor < end) emit(out, offset + cursor, offset + end, \"text\", lang);\n return;\n }\n\n emit(out, offset + start, offset + end, \"text\", lang);\n}\n\n/** Appends, merging into the previous token when it is the same run. */\nfunction emit(out: Token[], start: number, end: number, type: TokenType, lang: string): void {\n if (end <= start) return;\n const last = out[out.length - 1];\n if (last && last.end === start && last.type === type && last.lang === lang) {\n last.end = end;\n return;\n }\n out.push({ start, end, type, lang });\n}\n\n/**\n * Asserts what the whole design rests on: the tokens reproduce the source\n * exactly. Exported because it is used by every language's test rather than\n * re-derived in each one, and because a consumer building a grammar at runtime\n * should have the same check available.\n *\n * Returns a description of the first violation, or null when the list is sound.\n */\nexport function checkCoverage(source: string, tokens: Token[]): string | null {\n let cursor = 0;\n for (const t of tokens) {\n if (t.start !== cursor) {\n return t.start < cursor\n ? `token at ${t.start} overlaps the previous one, which ended at ${cursor}`\n : `gap in coverage from ${cursor} to ${t.start}`;\n }\n if (t.end <= t.start) return `empty or reversed token at ${t.start}`;\n cursor = t.end;\n }\n if (cursor !== source.length) return `coverage stops at ${cursor} of ${source.length}`;\n return null;\n}\n"],"names":["MAX_DEPTH","tokenize","source","language","run","getGrammar","grammar","offset","depth","ctx","inner","lang","at","shift","scan","tokens","out","stack","pos","textFrom","flushText","emit","state","rules","matched","i","rule","m","emitMatch","embed","match","from","until","search","stop","bodyEnd","body","token","start","end","indices","cursor","g","span","type","last","checkCoverage","t"],"mappings":";AAyBA,MAAMA,IAAY;AAQX,SAASC,EAASC,GAAgBC,GAA8C;AACrF,SAAOC,EAAIF,GAAQG,EAAWF,CAAQ,GAAG,GAAG,CAAC;AAC/C;AAEA,SAASC,EAAIF,GAAgBI,GAA8BC,GAAgBC,GAAwB;AACjG,MAAI,CAACN,EAAQ,QAAO,CAAA;AACpB,MAAI,CAACI,KAAWE,IAAQR;AACtB,WAAO,CAAC,EAAE,OAAOO,GAAQ,KAAKA,IAASL,EAAO,QAAQ,MA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C,GAAK,MAAAK,GAAM,MAAAjC,GAAM;AACrC;AAUO,SAASmC,EAAc5C,GAAgBa,GAAgC;AAC5E,MAAI0B,IAAS;AACb,aAAWM,KAAKhC,GAAQ;AACtB,QAAIgC,EAAE,UAAUN;AACd,aAAOM,EAAE,QAAQN,IACb,YAAYM,EAAE,KAAK,8CAA8CN,CAAM,KACvE,wBAAwBA,CAAM,OAAOM,EAAE,KAAK;AAElD,QAAIA,EAAE,OAAOA,EAAE,MAAO,QAAO,8BAA8BA,EAAE,KAAK;AAClE,IAAAN,IAASM,EAAE;AAAA,EACb;AACA,SAAIN,MAAWvC,EAAO,SAAe,qBAAqBuC,CAAM,OAAOvC,EAAO,MAAM,KAC7E;AACT;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instant.js","sources":["../../../src/lib/time/instant.ts"],"sourcesContent":["/** A moment as epoch millis, from the three shapes a caller holds (ISO string, epoch millis, `Date`). `NaN` when it does not parse. The one parser the time layer shares. DX-4797. */\nexport function toEpochMs(when: string | number | Date): number {\n return typeof when === \"number\" ? when : when instanceof Date ? when.getTime() : Date.parse(when);\n}\n"],"names":["toEpochMs","when"],"mappings":"AACO,SAASA,EAAUC,GAAsC;AAC9D,SAAO,OAAOA,KAAS,WAAWA,IAAOA,aAAgB,OAAOA,EAAK,QAAA,IAAY,KAAK,MAAMA,CAAI;AAClG;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
function u(t, n) {
|
|
2
|
+
const r = /* @__PURE__ */ new Date(0);
|
|
3
|
+
return r.setUTCFullYear(t, n, 0), r.getUTCDate();
|
|
4
|
+
}
|
|
5
|
+
function y(t) {
|
|
6
|
+
return { year: t.getUTCFullYear(), month: t.getUTCMonth() + 1, day: t.getUTCDate() };
|
|
7
|
+
}
|
|
8
|
+
function c(t) {
|
|
9
|
+
const n = /* @__PURE__ */ new Date(0);
|
|
10
|
+
return n.setUTCFullYear(t.year, t.month - 1, t.day), n;
|
|
11
|
+
}
|
|
12
|
+
function i(t, n) {
|
|
13
|
+
const r = c(t);
|
|
14
|
+
return r.setUTCDate(r.getUTCDate() + n), y(r);
|
|
15
|
+
}
|
|
16
|
+
function D(t, n) {
|
|
17
|
+
const r = t.year * 12 + (t.month - 1) + n, e = Math.floor(r / 12), o = r % 12 + 1;
|
|
18
|
+
return { year: e, month: o, day: Math.min(t.day, u(e, o)) };
|
|
19
|
+
}
|
|
20
|
+
function g(t, n) {
|
|
21
|
+
return Math.round((c(n).getTime() - c(t).getTime()) / 864e5);
|
|
22
|
+
}
|
|
23
|
+
function h(t, n) {
|
|
24
|
+
return t.year !== n.year ? t.year - n.year : t.month !== n.month ? t.month - n.month : t.day - n.day;
|
|
25
|
+
}
|
|
26
|
+
function M(t, n) {
|
|
27
|
+
return h(t, n) === 0;
|
|
28
|
+
}
|
|
29
|
+
function m(t) {
|
|
30
|
+
return c(t).getUTCDay();
|
|
31
|
+
}
|
|
32
|
+
function s(t, n) {
|
|
33
|
+
const r = (m(t) - n + 7) % 7;
|
|
34
|
+
return i(t, -r);
|
|
35
|
+
}
|
|
36
|
+
function d(t) {
|
|
37
|
+
return { year: t.year, month: t.month, day: 1 };
|
|
38
|
+
}
|
|
39
|
+
function l(t) {
|
|
40
|
+
return { year: t.year, month: t.month, day: u(t.year, t.month) };
|
|
41
|
+
}
|
|
42
|
+
function T(t, n) {
|
|
43
|
+
const r = s(d(t), n), e = l(t), o = i(s(e, n), 6), f = [];
|
|
44
|
+
for (let a = r; h(a, o) <= 0; a = i(a, 1)) f.push(a);
|
|
45
|
+
return f;
|
|
46
|
+
}
|
|
47
|
+
function U(t, n) {
|
|
48
|
+
const r = s(t, n);
|
|
49
|
+
return Array.from({ length: 7 }, (e, o) => i(r, o));
|
|
50
|
+
}
|
|
51
|
+
function w(t) {
|
|
52
|
+
const n = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t);
|
|
53
|
+
if (!n) throw new Error(`not an ISO date: ${JSON.stringify(t)} — expected YYYY-MM-DD`);
|
|
54
|
+
const r = Number(n[1]), e = Number(n[2]), o = Number(n[3]);
|
|
55
|
+
if (e < 1 || e > 12) throw new Error(`month out of range in ${t}`);
|
|
56
|
+
if (o < 1 || o > u(r, e))
|
|
57
|
+
throw new Error(`${t} is not a real date — ${r}-${e} has ${u(r, e)} days`);
|
|
58
|
+
return { year: r, month: e, day: o };
|
|
59
|
+
}
|
|
60
|
+
function C(t) {
|
|
61
|
+
return { ...t, hour: 0, minute: 0, second: 0, millisecond: 0 };
|
|
62
|
+
}
|
|
63
|
+
function Y(t, n, r = 0) {
|
|
64
|
+
return { ...t, hour: n, minute: r, second: 0, millisecond: 0 };
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
i as addDays,
|
|
68
|
+
D as addMonths,
|
|
69
|
+
C as atMidnight,
|
|
70
|
+
Y as atTime,
|
|
71
|
+
h as comparePlainDate,
|
|
72
|
+
m as dayOfWeek,
|
|
73
|
+
g as daysBetween,
|
|
74
|
+
u as daysInMonth,
|
|
75
|
+
l as endOfMonth,
|
|
76
|
+
M as isSameDate,
|
|
77
|
+
T as monthGridDays,
|
|
78
|
+
w as parsePlainDate,
|
|
79
|
+
d as startOfMonth,
|
|
80
|
+
s as startOfWeek,
|
|
81
|
+
U as weekDays
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=plain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plain.js","sources":["../../../src/lib/time/plain.ts"],"sourcesContent":["import { isoDateString, type PlainDate, type PlainDateTime } from \"./types\";\n\n/* ============================================================================\n CALENDAR ARITHMETIC — no zones, no instants, no offsets.\n\n A month grid is a question about the calendar, not about time: which squares\n does September have, which weekday does the 1st fall on, how many rows. None\n of that depends on a zone, and none of it should reach for one. Keeping this\n file zone-free is what stops a month grid quietly acquiring a dependency on\n the viewer's location.\n\n Every function here goes through UTC internally — NOT because these values\n are UTC (they are not; they have no zone at all) but because UTC is the only\n mode of `Date` with no transitions in it, so the arithmetic cannot be\n disturbed by one. A local-mode `Date` doing the same work would lose an hour\n twice a year and, at midnight-transition zones, land on the wrong DAY.\n ========================================================================= */\n\n/** Days in `month` of `year`, leap years included. */\nexport function daysInMonth(year: number, month: number): number {\n const d = new Date(0);\n d.setUTCFullYear(year, month, 0);\n return d.getUTCDate();\n}\n\nfunction fromUtc(d: Date): PlainDate {\n return { year: d.getUTCFullYear(), month: d.getUTCMonth() + 1, day: d.getUTCDate() };\n}\n\nfunction toUtc(date: PlainDate): Date {\n const d = new Date(0);\n d.setUTCFullYear(date.year, date.month - 1, date.day);\n return d;\n}\n\n/** `date` moved by `days`, which may be negative, rolling months and years. */\nexport function addDays(date: PlainDate, days: number): PlainDate {\n const d = toUtc(date);\n d.setUTCDate(d.getUTCDate() + days);\n return fromUtc(d);\n}\n\n/**\n * `date` moved by `months`, clamping the day to the target month's length.\n *\n * CLAMPING, NOT ROLLING: one month after the 31st of January is the 28th or\n * 29th of February, never the 3rd of March. Rolling is what `Date.setMonth`\n * does natively and it is why \"next month\" buttons skip February.\n */\nexport function addMonths(date: PlainDate, months: number): PlainDate {\n const total = date.year * 12 + (date.month - 1) + months;\n const year = Math.floor(total / 12);\n const month = (total % 12) + 1;\n return { year, month, day: Math.min(date.day, daysInMonth(year, month)) };\n}\n\n/** Whole days from `a` to `b`; negative when `b` is earlier. */\nexport function daysBetween(a: PlainDate, b: PlainDate): number {\n return Math.round((toUtc(b).getTime() - toUtc(a).getTime()) / 86_400_000);\n}\n\n/** Negative when `a` is earlier, 0 when equal, positive when later. */\nexport function comparePlainDate(a: PlainDate, b: PlainDate): number {\n if (a.year !== b.year) return a.year - b.year;\n if (a.month !== b.month) return a.month - b.month;\n return a.day - b.day;\n}\n\nexport function isSameDate(a: PlainDate, b: PlainDate): boolean {\n return comparePlainDate(a, b) === 0;\n}\n\n/** 0 = Sunday … 6 = Saturday, matching `Date.getUTCDay` and `Intl`'s weekday order. */\nexport function dayOfWeek(date: PlainDate): number {\n return toUtc(date).getUTCDay();\n}\n\n/**\n * The first day of the week `date` falls in.\n *\n * `weekStartsOn` IS A PARAMETER WITH NO DEFAULT ANYWHERE UP THE STACK, because\n * there is no correct global answer: Sunday in the US and Japan, Monday across\n * Europe and by ISO 8601, Saturday in much of the Middle East. A component that\n * picks one silently is wrong for most of the world, so the calendar surfaces\n * it and this function simply obeys.\n */\nexport function startOfWeek(date: PlainDate, weekStartsOn: number): PlainDate {\n const shift = (dayOfWeek(date) - weekStartsOn + 7) % 7;\n return addDays(date, -shift);\n}\n\n/** The 1st of `date`'s month. */\nexport function startOfMonth(date: PlainDate): PlainDate {\n return { year: date.year, month: date.month, day: 1 };\n}\n\n/** The last day of `date`'s month. */\nexport function endOfMonth(date: PlainDate): PlainDate {\n return { year: date.year, month: date.month, day: daysInMonth(date.year, date.month) };\n}\n\n/**\n * Every day a month grid shows, INCLUDING the leading and trailing days that\n * belong to the neighbouring months.\n *\n * Always whole weeks, so the result is a multiple of seven and the grid never\n * has a ragged edge. The count varies — a 28-day February beginning on the\n * week's first day needs four rows, and a 31-day month beginning on its last\n * day needs six. Callers that assume six rows draw an empty one eleven months\n * a year; callers that assume five are simply wrong twice a year.\n */\nexport function monthGridDays(date: PlainDate, weekStartsOn: number): PlainDate[] {\n const first = startOfWeek(startOfMonth(date), weekStartsOn);\n const lastOfMonth = endOfMonth(date);\n const last = addDays(startOfWeek(lastOfMonth, weekStartsOn), 6);\n const out: PlainDate[] = [];\n for (let d = first; comparePlainDate(d, last) <= 0; d = addDays(d, 1)) out.push(d);\n return out;\n}\n\n/** The seven days of the week `date` falls in. */\nexport function weekDays(date: PlainDate, weekStartsOn: number): PlainDate[] {\n const first = startOfWeek(date, weekStartsOn);\n return Array.from({ length: 7 }, (_, i) => addDays(first, i));\n}\n\n/**\n * Parse `YYYY-MM-DD`.\n *\n * FAILS LOUDLY on anything else, including the shapes `Date` accepts and\n * silently reinterprets. `new Date(\"2026-2-30\")` yields the 2nd of March, which\n * is a data error becoming a rendered event on the wrong day with nothing\n * anywhere reporting a problem.\n */\nexport function parsePlainDate(iso: string): PlainDate {\n const m = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(iso);\n if (!m) throw new Error(`not an ISO date: ${JSON.stringify(iso)} — expected YYYY-MM-DD`);\n const year = Number(m[1]);\n const month = Number(m[2]);\n const day = Number(m[3]);\n if (month < 1 || month > 12) throw new Error(`month out of range in ${iso}`);\n if (day < 1 || day > daysInMonth(year, month)) {\n throw new Error(`${iso} is not a real date — ${year}-${month} has ${daysInMonth(year, month)} days`);\n }\n return { year, month, day };\n}\n\nexport { isoDateString };\n\n/** A `PlainDateTime` at midnight on `date` — the wall reading, not an instant. */\nexport function atMidnight(date: PlainDate): PlainDateTime {\n return { ...date, hour: 0, minute: 0, second: 0, millisecond: 0 };\n}\n\n/** A `PlainDateTime` at `hour`:`minute` on `date`. */\nexport function atTime(date: PlainDate, hour: number, minute = 0): PlainDateTime {\n return { ...date, hour, minute, second: 0, millisecond: 0 };\n}\n"],"names":["daysInMonth","year","month","d","fromUtc","toUtc","date","addDays","days","addMonths","months","total","daysBetween","a","b","comparePlainDate","isSameDate","dayOfWeek","startOfWeek","weekStartsOn","shift","startOfMonth","endOfMonth","monthGridDays","first","lastOfMonth","last","out","weekDays","_","i","parsePlainDate","iso","m","day","atMidnight","atTime","hour","minute"],"mappings":"AAmBO,SAASA,EAAYC,GAAcC,GAAuB;AAC/D,QAAMC,IAAI,oBAAI,KAAK,CAAC;AACpB,SAAAA,EAAE,eAAeF,GAAMC,GAAO,CAAC,GACxBC,EAAE,WAAA;AACX;AAEA,SAASC,EAAQD,GAAoB;AACnC,SAAO,EAAE,MAAMA,EAAE,eAAA,GAAkB,OAAOA,EAAE,YAAA,IAAgB,GAAG,KAAKA,EAAE,aAAW;AACnF;AAEA,SAASE,EAAMC,GAAuB;AACpC,QAAMH,IAAI,oBAAI,KAAK,CAAC;AACpB,SAAAA,EAAE,eAAeG,EAAK,MAAMA,EAAK,QAAQ,GAAGA,EAAK,GAAG,GAC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GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,EAAA;AAChE;AAGO,SAAS8B,EAAO9B,GAAiB+B,GAAcC,IAAS,GAAkB;AAC/E,SAAO,EAAE,GAAGhC,GAAM,MAAA+B,GAAM,QAAAC,GAAQ,QAAQ,GAAG,aAAa,EAAA;AAC1D;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { numberFormat as d } from "../intl-cache.js";
|
|
2
|
+
import { toEpochMs as M } from "./instant.js";
|
|
3
|
+
function w(f, o, m, h = Date.now()) {
|
|
4
|
+
const t = d(m, {}).format, s = M(f);
|
|
5
|
+
if (Number.isNaN(s)) return o.unknown;
|
|
6
|
+
const e = Math.max(0, Math.round((h - s) / 1e3));
|
|
7
|
+
if (e < 45) return o.justNow;
|
|
8
|
+
const u = Math.round(e / 60);
|
|
9
|
+
if (u < 60) return o.minutesAgo(u, t(u));
|
|
10
|
+
const n = Math.round(e / 3600);
|
|
11
|
+
if (n < 24) return o.hoursAgo(n, t(n));
|
|
12
|
+
const r = Math.floor(n / 24), a = n % 24;
|
|
13
|
+
if (r < 7) return a > 0 ? o.daysHoursAgo(r, t(r), a, t(a)) : o.daysAgo(r, t(r));
|
|
14
|
+
const c = Math.round(r / 7);
|
|
15
|
+
return o.weeksAgo(c, t(c));
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
w as relativeAge
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=relativeAge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relativeAge.js","sources":["../../../src/lib/time/relativeAge.ts"],"sourcesContent":["/* ============================================================================\n RELATIVE AGE — \"how long ago\", in the chat-transcript shape.\n\n This is deliberately a THIRD implementation of \"time ago\" in the\n danxbot/gpt-manager world, not a fourth copy of an existing one — neither\n found an exact match:\n\n - `views/demands/src/domain/format.ts`'s `relativeTime` stops at ONE unit\n (\"4h ago\", never \"4h 12m ago\") and hands off to a calendar date past a\n week, by deliberate design (\"9 weeks ago is arithmetic a reader has to\n undo\").\n - danxbot's own dashboard frontend (`frontend/src/lib/time.ts`)'s `ago` /\n `agoShort` are `Intl.RelativeTimeFormat`-based and are ALSO single-unit\n (\"2 hours ago\" / \"2h ago\").\n\n The chat transcript wanted a two-unit form once the gap passes a day —\n \"1d 6h ago\", not \"1d ago\" — matching the density of a real conversation\n history (Claude Code's own transcript UI). Since no existing formatter in\n either app produces that shape, it lives here, in `@50arms/ui`, so BOTH\n consumers (`views/demands` and danxbot's own dashboard frontend) can share\n one implementation instead of a fourth copy growing somewhere else.\n ========================================================================= */\n\nimport type { RelativeAgeStrings } from \"../i18n/areas/formats\";\nimport { numberFormat } from \"../intl-cache\";\nimport { toEpochMs } from \"./instant\";\n\n/**\n * A moment's age in words (English shown; the words come from `strings`): \"just now\", \"4m ago\", \"4h ago\", \"1d 6h ago\",\n * \"2w ago\".\n *\n * Stays two-unit only in the day range (a message from earlier today reads\n * as \"6h ago\", not \"0d 6h ago\") — days-plus-hours is the one range where a\n * single unit throws away information a reader of a chat transcript actually\n * wants (\"this morning\" vs \"yesterday afternoon\" are different facts, and\n * \"1d ago\" collapses both). Beyond a week it drops to whole weeks, same as\n * every sibling formatter in this codebase — nobody needs \"9d ago\" instead\n * of \"1w 2d ago\", and nobody needs either instead of a calendar date, but a\n * chat message's hover row has no room for a calendar date, so weeks it is.\n *\n * `now` is the instant to measure against (default: the clock). `RelativeTime`'s shared ticker passes later instants to find\n * when this text next changes.\n */\nexport function relativeAge(when: string | number | Date, strings: RelativeAgeStrings, locale: string, now: number = Date.now()): string {\n const fmt = numberFormat(locale, {}).format;\n const at = toEpochMs(when);\n if (Number.isNaN(at)) return strings.unknown;\n\n const seconds = Math.max(0, Math.round((now - at) / 1000));\n if (seconds < 45) return strings.justNow;\n\n const totalMinutes = Math.round(seconds / 60);\n if (totalMinutes < 60) return strings.minutesAgo(totalMinutes, fmt(totalMinutes));\n\n /* One rounding pass on total hours, not two nested roundings (days, then a\n remainder re-rounded to hours) — a second rounding on top of the first\n is how a genuine 23h59m gap turns into \"1d 24h ago\". */\n const totalHours = Math.round(seconds / 3600);\n if (totalHours < 24) return strings.hoursAgo(totalHours, fmt(totalHours));\n\n const days = Math.floor(totalHours / 24);\n const hours = totalHours % 24;\n if (days < 7) return hours > 0 ? strings.daysHoursAgo(days, fmt(days), hours, fmt(hours)) : strings.daysAgo(days, fmt(days));\n\n const weeks = Math.round(days / 7);\n return strings.weeksAgo(weeks, fmt(weeks));\n}\n"],"names":["relativeAge","when","strings","locale","now","fmt","numberFormat","at","toEpochMs","seconds","totalMinutes","totalHours","days","hours","weeks"],"mappings":";;AA2CO,SAASA,EAAYC,GAA8BC,GAA6BC,GAAgBC,IAAc,KAAK,OAAe;AACvI,QAAMC,IAAMC,EAAaH,GAAQ,CAAA,CAAE,EAAE,QAC/BI,IAAKC,EAAUP,CAAI;AACzB,MAAI,OAAO,MAAMM,CAAE,UAAUL,EAAQ;AAErC,QAAMO,IAAU,KAAK,IAAI,GAAG,KAAK,OAAOL,IAAMG,KAAM,GAAI,CAAC;AACzD,MAAIE,IAAU,GAAI,QAAOP,EAAQ;AAEjC,QAAMQ,IAAe,KAAK,MAAMD,IAAU,EAAE;AAC5C,MAAIC,IAAe,GAAI,QAAOR,EAAQ,WAAWQ,GAAcL,EAAIK,CAAY,CAAC;AAKhF,QAAMC,IAAa,KAAK,MAAMF,IAAU,IAAI;AAC5C,MAAIE,IAAa,GAAI,QAAOT,EAAQ,SAASS,GAAYN,EAAIM,CAAU,CAAC;AAExE,QAAMC,IAAO,KAAK,MAAMD,IAAa,EAAE,GACjCE,IAAQF,IAAa;AAC3B,MAAIC,IAAO,EAAG,QAAOC,IAAQ,IAAIX,EAAQ,aAAaU,GAAMP,EAAIO,CAAI,GAAGC,GAAOR,EAAIQ,CAAK,CAAC,IAAIX,EAAQ,QAAQU,GAAMP,EAAIO,CAAI,CAAC;AAE3H,QAAME,IAAQ,KAAK,MAAMF,IAAO,CAAC;AACjC,SAAOV,EAAQ,SAASY,GAAOT,EAAIS,CAAK,CAAC;AAC3C;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const n = /* @__PURE__ */ new Set();
|
|
2
|
+
let a;
|
|
3
|
+
function b(e, t, o) {
|
|
4
|
+
const s = t(e, o);
|
|
5
|
+
let c = o, u = 1e3, r;
|
|
6
|
+
for (; ; ) {
|
|
7
|
+
const i = o + Math.min(u, 36e5);
|
|
8
|
+
if (t(e, i) !== s) {
|
|
9
|
+
r = i;
|
|
10
|
+
break;
|
|
11
|
+
}
|
|
12
|
+
if (c = i, u >= 36e5) break;
|
|
13
|
+
u *= 2;
|
|
14
|
+
}
|
|
15
|
+
if (r === void 0) return o + 36e5;
|
|
16
|
+
for (; r - c > 1; ) {
|
|
17
|
+
const i = Math.floor((c + r) / 2);
|
|
18
|
+
t(e, i) !== s ? r = i : c = i;
|
|
19
|
+
}
|
|
20
|
+
return r;
|
|
21
|
+
}
|
|
22
|
+
function d() {
|
|
23
|
+
a !== void 0 && clearTimeout(a), a = void 0;
|
|
24
|
+
}
|
|
25
|
+
function f() {
|
|
26
|
+
if (d(), n.size === 0 || document.visibilityState === "hidden") return;
|
|
27
|
+
let e = 1 / 0;
|
|
28
|
+
for (const { nextChangeAt: t } of n) e = Math.min(e, t);
|
|
29
|
+
a = setTimeout(m, Math.max(1, e - Date.now()));
|
|
30
|
+
}
|
|
31
|
+
function l(e) {
|
|
32
|
+
e.nextChangeAt = b(e.at, e.format, Date.now());
|
|
33
|
+
}
|
|
34
|
+
function m() {
|
|
35
|
+
const e = Date.now();
|
|
36
|
+
for (const t of [...n])
|
|
37
|
+
t.nextChangeAt > e || (t.onChange(), l(t));
|
|
38
|
+
f();
|
|
39
|
+
}
|
|
40
|
+
function h() {
|
|
41
|
+
if (document.visibilityState === "hidden") {
|
|
42
|
+
d();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
for (const e of [...n])
|
|
46
|
+
e.onChange(), l(e);
|
|
47
|
+
f();
|
|
48
|
+
}
|
|
49
|
+
function v(e, t, o) {
|
|
50
|
+
const s = { at: e, format: t, onChange: o, nextChangeAt: 0 };
|
|
51
|
+
return l(s), n.size === 0 && document.addEventListener("visibilitychange", h), n.add(s), f(), () => {
|
|
52
|
+
n.delete(s), n.size === 0 ? (d(), document.removeEventListener("visibilitychange", h)) : f();
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
b as nextTextChangeAt,
|
|
57
|
+
v as subscribeRelativeClock
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=relativeClock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relativeClock.js","sources":["../../../src/lib/time/relativeClock.ts"],"sourcesContent":["/* ============================================================================\n THE ONE CLIENT-SIDE CLOCK BEHIND EVERY LIVE RELATIVE TIME. DX-4797.\n\n \"1 second ago\" must keep counting while the screen sits open. One timer serves\n every mounted `RelativeTime` however many there are (a board of 200 tiles runs\n ONE `setTimeout`, not 200), and it sleeps until the soonest moment any\n subscriber's TEXT can change rather than ticking on a fixed beat, so a page of\n hour-old times wakes once an hour.\n\n THE WAKE TIME IS DERIVED FROM THE FORMAT, NOT ASSUMED. Each subscriber brings\n its own `format(at, now)`, and a format's rounding is its own business (\"45s\"\n flips `relativeAge` to minutes; `Intl` rounds a tie differently per sign).\n Baking those marks in here would be a second, silently drifting copy of every\n formatter. Instead the clock ASKS the format: it evaluates the text at later\n instants (doubling forward until the text differs, then bisecting to the\n millisecond) and sleeps to exactly that instant. The only assumption is that a\n relative age's text does not change and then change back inside one probe\n window: a count only grows as an age grows.\n\n A hidden tab clears the timer and a return to visible re-reads everything:\n browsers clamp hidden-tab timers, and a stale \"1 minute ago\" left on screen is\n confidently wrong.\n ========================================================================= */\n\n/** The text of a moment as of `now` (epoch ms). `relativeAge` is one. */\nexport type RelativeFormat = (at: string | number | Date, now?: number) => string;\n\nconst PROBE_START_MS = 1_000;\n/** No flip found this far ahead (a week-old \"1w ago\" is stable for days): look again after this long. */\nconst HORIZON_MS = 60 * 60 * 1000;\n\ninterface Subscriber {\n readonly at: number;\n readonly format: RelativeFormat;\n readonly onChange: () => void;\n /** Epoch ms at which `format(at)` next differs from what it reads now. */\n nextChangeAt: number;\n}\n\nconst subscribers = new Set<Subscriber>();\nlet timer: ReturnType<typeof setTimeout> | undefined;\n\n/** The first instant after `now` at which `format(at, instant)` differs from `format(at, now)`, within `HORIZON_MS`. */\nexport function nextTextChangeAt(at: number, format: RelativeFormat, now: number): number {\n const current = format(at, now);\n let same = now;\n let step = PROBE_START_MS;\n let different: number | undefined;\n for (;;) {\n /* The last probe lands exactly on the horizon, so a flip anywhere inside it is found, never stepped over. */\n const probe = now + Math.min(step, HORIZON_MS);\n if (format(at, probe) !== current) {\n different = probe;\n break;\n }\n same = probe;\n if (step >= HORIZON_MS) break;\n step *= 2;\n }\n if (different === undefined) return now + HORIZON_MS;\n while (different - same > 1) {\n const middle = Math.floor((same + different) / 2);\n if (format(at, middle) !== current) different = middle;\n else same = middle;\n }\n return different;\n}\n\nfunction disarm(): void {\n if (timer !== undefined) clearTimeout(timer);\n timer = undefined;\n}\n\nfunction arm(): void {\n disarm();\n if (subscribers.size === 0 || document.visibilityState === \"hidden\") return;\n let soonest = Infinity;\n for (const { nextChangeAt } of subscribers) soonest = Math.min(soonest, nextChangeAt);\n timer = setTimeout(wake, Math.max(1, soonest - Date.now()));\n}\n\nfunction reschedule(subscriber: Subscriber): void {\n subscriber.nextChangeAt = nextTextChangeAt(subscriber.at, subscriber.format, Date.now());\n}\n\nfunction wake(): void {\n const now = Date.now();\n for (const subscriber of [...subscribers]) {\n if (subscriber.nextChangeAt > now) continue;\n subscriber.onChange();\n reschedule(subscriber);\n }\n arm();\n}\n\nfunction onVisibilityChange(): void {\n if (document.visibilityState === \"hidden\") {\n disarm();\n return;\n }\n for (const subscriber of [...subscribers]) {\n subscriber.onChange();\n reschedule(subscriber);\n }\n arm();\n}\n\n/** Calls `onChange` whenever `format(at)` may now read differently. Returns the unsubscribe. The last unsubscribe stops the timer. */\nexport function subscribeRelativeClock(at: number, format: RelativeFormat, onChange: () => void): () => void {\n const subscriber: Subscriber = { at, format, onChange, nextChangeAt: 0 };\n reschedule(subscriber);\n if (subscribers.size === 0) document.addEventListener(\"visibilitychange\", onVisibilityChange);\n subscribers.add(subscriber);\n arm();\n return () => {\n subscribers.delete(subscriber);\n if (subscribers.size === 0) {\n disarm();\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n } else {\n arm();\n }\n };\n}\n\n/** Mounted subscribers right now; the tests pin that it returns to zero. */\nexport function relativeClockSubscriberCount(): number {\n return subscribers.size;\n}\n"],"names":["subscribers","timer","nextTextChangeAt","at","format","now","current","same","step","different","probe","middle","disarm","arm","soonest","nextChangeAt","wake","reschedule","subscriber","onVisibilityChange","subscribeRelativeClock","onChange"],"mappings":"AAuCA,MAAMA,wBAAkB,IAAA;AACxB,IAAIC;AAGG,SAASC,EAAiBC,GAAYC,GAAwBC,GAAqB;AACxF,QAAMC,IAAUF,EAAOD,GAAIE,CAAG;AAC9B,MAAIE,IAAOF,GACPG,IAAO,KACPC;AACJ,aAAS;AAEP,UAAMC,IAAQL,IAAM,KAAK,IAAIG,GAAM,IAAU;AAC7C,QAAIJ,EAAOD,GAAIO,CAAK,MAAMJ,GAAS;AACjC,MAAAG,IAAYC;AACZ;AAAA,IACF;AAEA,QADAH,IAAOG,GACHF,KAAQ,KAAY;AACxB,IAAAA,KAAQ;AAAA,EACV;AACA,MAAIC,MAAc,OAAW,QAAOJ,IAAM;AAC1C,SAAOI,IAAYF,IAAO,KAAG;AAC3B,UAAMI,IAAS,KAAK,OAAOJ,IAAOE,KAAa,CAAC;AAChD,IAAIL,EAAOD,GAAIQ,CAAM,MAAML,IAASG,IAAYE,IAC3CJ,IAAOI;AAAA,EACd;AACA,SAAOF;AACT;AAEA,SAASG,IAAe;AACtB,EAAIX,MAAU,UAAW,aAAaA,CAAK,GAC3CA,IAAQ;AAC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{
|
|
3
|
+
constructor(t, o, e) {
|
|
4
|
+
super(
|
|
5
|
+
e === "gap" ? `${n(t)} does not exist in ${o} — the clock skipped it.` : `${n(t)} happens twice in ${o}.`
|
|
6
|
+
), this.wall = t, this.zone = o, this.kind = e, this.name = "AmbiguousTimeError";
|
|
7
|
+
}
|
|
8
|
+
wall;
|
|
9
|
+
zone;
|
|
10
|
+
kind;
|
|
11
|
+
}
|
|
12
|
+
function n(i) {
|
|
13
|
+
return `${r(i.year, 4)}-${r(i.month)}-${r(i.day)}T${r(i.hour)}:${r(i.minute)}:${r(i.second)}.${r(i.millisecond, 3)}`;
|
|
14
|
+
}
|
|
15
|
+
function m(i) {
|
|
16
|
+
return `${r(i.year, 4)}-${r(i.month)}-${r(i.day)}`;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
$ as AmbiguousTimeError,
|
|
20
|
+
m as isoDateString,
|
|
21
|
+
n as isoDateTimeString
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/lib/time/types.ts"],"sourcesContent":["/* ============================================================================\n THE TIME LAYER'S VOCABULARY — deliberately `Temporal`'s, minus what we do\n not need.\n\n WHY WE HAVE OUR OWN AT ALL. `Temporal` is the right answer and it is not\n available: Chrome 144+, Firefox 139+, Node 26+, and **Safari has not shipped\n it in any stable version, desktop or iOS**. Every iOS browser is WebKit, so\n \"modern browsers only\" does not rescue us — global support is ~69% and the\n entire gap is Apple. The polyfill is 20.4 kB gzip and is a real option; it is\n priced on the tracker (CAL-TIME) so reversing this decision is one sentence.\n\n WHY THE SHAPES MIRROR `Temporal` ANYWAY. The day Safari ships it, the swap\n should be mechanical rather than a rewrite. So `PlainDate` has `year` /\n `month` / `day` with a ONE-BASED month, `PlainDateTime` extends it,\n `Instant` is a fixed point on the timeline, and the disambiguation modes are\n spelled exactly as `Temporal.ZonedDateTime.from` spells them. Anywhere a name\n here differs from `Temporal`'s, that is a bug in this file.\n\n WHAT IS DELIBERATELY ABSENT: calendars other than ISO 8601, nanosecond\n precision, `Temporal.Duration`'s full field set, and any notion of a\n `ZonedDateTime` object. A calendar needs an instant, a wall-clock reading, a\n calendar day, and a way to move between them; carrying more would be carrying\n a date library we did not choose to write.\n ========================================================================= */\n\nimport { pad } from \"../pad\";\n\n/**\n * A point on the timeline, as milliseconds since the epoch.\n *\n * NOT a `Date`. A `Date` is a mutable object that prints itself in the host's\n * local zone, and every calendar bug in the survey behind this component\n * involved someone reading a `Date`'s local fields when they meant a specific\n * zone's. A number cannot be misread that way — it has no fields to read.\n */\nexport type Instant = number;\n\n/** An IANA time zone identifier, e.g. `\"America/New_York\"`. */\nexport type TimeZone = string;\n\n/**\n * A calendar day. No time, no zone, no offset — just which square on the wall.\n *\n * `month` IS ONE-BASED, matching `Temporal` and matching how every human writes\n * a date. `Date`'s zero-based month is the single most common off-by-one in\n * date code and it is not reproduced here.\n */\nexport interface PlainDate {\n readonly year: number;\n /** 1–12. */\n readonly month: number;\n /** 1–31. */\n readonly day: number;\n}\n\n/**\n * A wall-clock reading. What a clock on the wall says, with no claim about\n * which wall.\n *\n * This is the type that makes the ambiguity explicit rather than accidental:\n * `2026-11-01T01:30` in New York happened TWICE, and `2026-03-08T02:30` never\n * happened at all. A `PlainDateTime` can represent both, which is precisely why\n * turning one into an `Instant` requires saying what to do about it.\n */\nexport interface PlainDateTime extends PlainDate {\n /** 0–23. */\n readonly hour: number;\n /** 0–59. */\n readonly minute: number;\n /** 0–59. */\n readonly second: number;\n /** 0–999. */\n readonly millisecond: number;\n}\n\n/**\n * How much to move, in CALENDAR units rather than elapsed time.\n *\n * THE DISTINCTION IS THE WHOLE POINT, and getting it wrong is the bug in every\n * library surveyed. \"One day later\" is not \"86,400,000 ms later\": across a\n * spring-forward boundary it is 23 hours, and across a fall-back it is 25. A\n * user dragging an event from Saturday to Sunday expects it to keep its\n * wall-clock time, so the move has to be expressed as `{ days: 1 }` and\n * resolved against the zone — never added as a number.\n *\n * `hours` and `minutes` ARE exact elapsed time, and that is correct: dragging\n * an event down by two hours means two hours of real duration.\n */\nexport interface CalendarDuration {\n readonly days?: number;\n readonly hours?: number;\n readonly minutes?: number;\n}\n\n/**\n * What to do when a wall-clock reading does not name exactly one instant.\n *\n * Spelled as `Temporal.ZonedDateTime.from`'s option of the same name, with the\n * same meanings, so this is one more thing that becomes a deletion later.\n *\n * - `compatible` — what every other date library does, and the default.\n * In a GAP (spring forward) move forward by the size of the gap; in an\n * OVERLAP (fall back) take the first of the two.\n * - `earlier` / `later` — take that side explicitly.\n * - `reject` — throw. For a parser or an import, where a time that never\n * existed is a fact about bad input rather than something to paper over.\n */\nexport type Disambiguation = \"compatible\" | \"earlier\" | \"later\" | \"reject\";\n\n/** Thrown by `reject` disambiguation, and never by anything else. */\nexport class AmbiguousTimeError extends Error {\n constructor(\n readonly wall: PlainDateTime,\n readonly zone: TimeZone,\n readonly kind: \"gap\" | \"overlap\",\n ) {\n super(\n kind === \"gap\"\n ? `${isoDateTimeString(wall)} does not exist in ${zone} — the clock skipped it.`\n : `${isoDateTimeString(wall)} happens twice in ${zone}.`,\n );\n this.name = \"AmbiguousTimeError\";\n }\n}\n\n/** `2026-03-08T02:30:00.000` — used in errors, and by the ISO helpers. */\nexport function isoDateTimeString(wall: PlainDateTime): string {\n return (\n `${pad(wall.year, 4)}-${pad(wall.month)}-${pad(wall.day)}` +\n `T${pad(wall.hour)}:${pad(wall.minute)}:${pad(wall.second)}.${pad(wall.millisecond, 3)}`\n );\n}\n\n/** `2026-03-08`. */\nexport function isoDateString(date: PlainDate): string {\n return `${pad(date.year, 4)}-${pad(date.month)}-${pad(date.day)}`;\n}\n"],"names":["AmbiguousTimeError","wall","zone","kind","isoDateTimeString","pad","isoDateString","date"],"mappings":";AA8GO,MAAMA,UAA2B,MAAM;AAAA,EAC5C,YACWC,GACAC,GACAC,GACT;AACA;AAAA,MACEA,MAAS,QACL,GAAGC,EAAkBH,CAAI,CAAC,sBAAsBC,CAAI,6BACpD,GAAGE,EAAkBH,CAAI,CAAC,qBAAqBC,CAAI;AAAA,IAAA,GAPhD,KAAA,OAAAD,GACA,KAAA,OAAAC,GACA,KAAA,OAAAC,GAOT,KAAK,OAAO;AAAA,EACd;AAAA,EAVW;AAAA,EACA;AAAA,EACA;AASb;AAGO,SAASC,EAAkBH,GAA6B;AAC7D,SACE,GAAGI,EAAIJ,EAAK,MAAM,CAAC,CAAC,IAAII,EAAIJ,EAAK,KAAK,CAAC,IAAII,EAAIJ,EAAK,GAAG,CAAC,IACpDI,EAAIJ,EAAK,IAAI,CAAC,IAAII,EAAIJ,EAAK,MAAM,CAAC,IAAII,EAAIJ,EAAK,MAAM,CAAC,IAAII,EAAIJ,EAAK,aAAa,CAAC,CAAC;AAE1F;AAGO,SAASK,EAAcC,GAAyB;AACrD,SAAO,GAAGF,EAAIE,EAAK,MAAM,CAAC,CAAC,IAAIF,EAAIE,EAAK,KAAK,CAAC,IAAIF,EAAIE,EAAK,GAAG,CAAC;AACjE;"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { AmbiguousTimeError as p } from "./types.js";
|
|
2
|
+
import { addDays as D } from "./plain.js";
|
|
3
|
+
import { dateFormat as U } from "../intl-cache.js";
|
|
4
|
+
const m = 36e5, M = 6e4;
|
|
5
|
+
function F(t) {
|
|
6
|
+
return U("en-US", {
|
|
7
|
+
timeZone: t,
|
|
8
|
+
year: "numeric",
|
|
9
|
+
month: "2-digit",
|
|
10
|
+
day: "2-digit",
|
|
11
|
+
hour: "2-digit",
|
|
12
|
+
minute: "2-digit",
|
|
13
|
+
second: "2-digit",
|
|
14
|
+
/* `h23` EXPLICITLY, not `hour12: false`. Several ICU versions render
|
|
15
|
+
midnight as hour "24" under `hour12: false`, which parses as a valid
|
|
16
|
+
number and silently lands the reading on the wrong day. */
|
|
17
|
+
hourCycle: "h23"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function d(t, e) {
|
|
21
|
+
const n = F(t).formatToParts(new Date(e));
|
|
22
|
+
let r = 0, o = 1, i = 1, u = 0, s = 0, c = 0;
|
|
23
|
+
for (const f of n)
|
|
24
|
+
switch (f.type) {
|
|
25
|
+
case "year":
|
|
26
|
+
r = Number(f.value);
|
|
27
|
+
break;
|
|
28
|
+
case "month":
|
|
29
|
+
o = Number(f.value);
|
|
30
|
+
break;
|
|
31
|
+
case "day":
|
|
32
|
+
i = Number(f.value);
|
|
33
|
+
break;
|
|
34
|
+
case "hour":
|
|
35
|
+
u = Number(f.value);
|
|
36
|
+
break;
|
|
37
|
+
case "minute":
|
|
38
|
+
s = Number(f.value);
|
|
39
|
+
break;
|
|
40
|
+
case "second":
|
|
41
|
+
c = Number(f.value);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
const a = (e % 1e3 + 1e3) % 1e3;
|
|
45
|
+
return { year: r, month: o, day: i, hour: u, minute: s, second: c, millisecond: a };
|
|
46
|
+
}
|
|
47
|
+
function g(t) {
|
|
48
|
+
const e = /* @__PURE__ */ new Date(0);
|
|
49
|
+
return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(t.hour, t.minute, t.second, t.millisecond), e.getTime();
|
|
50
|
+
}
|
|
51
|
+
function h(t, e) {
|
|
52
|
+
return g(d(t, e)) - e;
|
|
53
|
+
}
|
|
54
|
+
function v(t, e) {
|
|
55
|
+
return t.year === e.year && t.month === e.month && t.day === e.day && t.hour === e.hour && t.minute === e.minute && t.second === e.second && t.millisecond === e.millisecond;
|
|
56
|
+
}
|
|
57
|
+
function y(t, e) {
|
|
58
|
+
const n = g(e), r = h(t, n - 24 * m), o = h(t, n + 24 * m), i = [];
|
|
59
|
+
for (const u of r === o ? [r] : [r, o]) {
|
|
60
|
+
const s = n - u;
|
|
61
|
+
v(d(t, s), e) && i.push(s);
|
|
62
|
+
}
|
|
63
|
+
return i.sort((u, s) => u - s), i.filter((u, s) => s === 0 || u !== i[s - 1]);
|
|
64
|
+
}
|
|
65
|
+
function C(t, e, n = "compatible") {
|
|
66
|
+
const r = y(t, e);
|
|
67
|
+
if (r.length === 1) return r[0];
|
|
68
|
+
if (r.length > 1) {
|
|
69
|
+
if (n === "reject") throw new p(e, t, "overlap");
|
|
70
|
+
return n === "later" ? r[r.length - 1] : r[0];
|
|
71
|
+
}
|
|
72
|
+
if (n === "reject") throw new p(e, t, "gap");
|
|
73
|
+
const o = g(e), i = h(t, o - 24 * m), u = h(t, o + 24 * m), s = u - i, c = o - i, a = o - u;
|
|
74
|
+
return n === "earlier" ? Math.min(c, a) : s > 0 ? Math.max(c, a) : Math.min(c, a);
|
|
75
|
+
}
|
|
76
|
+
function x(t, e) {
|
|
77
|
+
const n = d(t, e);
|
|
78
|
+
return { year: n.year, month: n.month, day: n.day };
|
|
79
|
+
}
|
|
80
|
+
function l(t, e) {
|
|
81
|
+
const n = { ...e, hour: 0, minute: 0, second: 0, millisecond: 0 }, r = y(t, n);
|
|
82
|
+
if (r.length > 0) return r[0];
|
|
83
|
+
for (let o = 1; o <= 180; o++) {
|
|
84
|
+
const i = y(t, {
|
|
85
|
+
...e,
|
|
86
|
+
hour: Math.floor(o / 60),
|
|
87
|
+
minute: o % 60,
|
|
88
|
+
second: 0,
|
|
89
|
+
millisecond: 0
|
|
90
|
+
});
|
|
91
|
+
if (i.length > 0) return i[0];
|
|
92
|
+
}
|
|
93
|
+
throw new Error(
|
|
94
|
+
`startOfDay: no instant exists in the first three hours of ${e.year}-${e.month}-${e.day} in ${t}`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function N(t) {
|
|
98
|
+
return D(t, 1);
|
|
99
|
+
}
|
|
100
|
+
function T(t, e) {
|
|
101
|
+
return l(t, N(e)) - l(t, e);
|
|
102
|
+
}
|
|
103
|
+
function $(t, e) {
|
|
104
|
+
return T(t, e) / m;
|
|
105
|
+
}
|
|
106
|
+
function w(t, e, n) {
|
|
107
|
+
const r = l(t, e);
|
|
108
|
+
return (n - r) / T(t, e);
|
|
109
|
+
}
|
|
110
|
+
function E(t, e, n) {
|
|
111
|
+
return l(t, e) + n * T(t, e);
|
|
112
|
+
}
|
|
113
|
+
function I(t, e, n, r = "compatible") {
|
|
114
|
+
const { days: o = 0, hours: i = 0, minutes: u = 0 } = n;
|
|
115
|
+
let s = e;
|
|
116
|
+
if (o !== 0) {
|
|
117
|
+
const c = d(t, e), a = /* @__PURE__ */ new Date(0);
|
|
118
|
+
a.setUTCFullYear(c.year, c.month - 1, c.day + o), s = C(
|
|
119
|
+
t,
|
|
120
|
+
{
|
|
121
|
+
year: a.getUTCFullYear(),
|
|
122
|
+
month: a.getUTCMonth() + 1,
|
|
123
|
+
day: a.getUTCDate(),
|
|
124
|
+
hour: c.hour,
|
|
125
|
+
minute: c.minute,
|
|
126
|
+
second: c.second,
|
|
127
|
+
millisecond: c.millisecond
|
|
128
|
+
},
|
|
129
|
+
r
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
return s + i * m + u * M;
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
I as addDuration,
|
|
136
|
+
w as dayFraction,
|
|
137
|
+
T as dayLengthMs,
|
|
138
|
+
$ as hoursInDay,
|
|
139
|
+
E as instantAtFraction,
|
|
140
|
+
x as instantToPlainDate,
|
|
141
|
+
d as instantToPlainDateTime,
|
|
142
|
+
N as nextDay,
|
|
143
|
+
h as offsetAt,
|
|
144
|
+
C as plainDateTimeToInstant,
|
|
145
|
+
l as startOfDay,
|
|
146
|
+
g as wallAsUtcMs
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=zone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zone.js","sources":["../../../src/lib/time/zone.ts"],"sourcesContent":["import {\n AmbiguousTimeError,\n type Disambiguation,\n type Instant,\n type PlainDate,\n type PlainDateTime,\n type TimeZone,\n} from \"./types\";\nimport { addDays } from \"./plain\";\nimport { dateFormat } from \"@/lib/intl-cache\";\n\n/* ============================================================================\n MOVING BETWEEN A WALL CLOCK AND THE TIMELINE.\n\n Everything here rests on ONE primitive — `offsetAt(zone, instant)` — read out\n of `Intl.DateTimeFormat`, which is the only IANA database a browser exposes.\n Everything else is arithmetic on top of it, so there is exactly one place\n where the rules of a zone enter this package.\n\n THE RULE THIS FILE EXISTS TO ENFORCE: a day is not 24 hours. It is 23 in\n New York on 2026-03-08, 25 on 2026-11-01, 23.5 in Lord Howe on 2026-10-04\n (its shift is THIRTY MINUTES, so any branch on \"is the delta 3600000\" is\n already wrong), and in Santiago on 2026-09-06 it is 23 hours that begin at\n 01:00 — `startOfDay` is NOT always midnight. Every one of those was measured\n before this file was written, and all five are in the test corpus.\n\n Kendo's scheduler crashed because two of its own methods disagreed about how\n long a day was; Mozilla's calendar drew an event an hour out plus a phantom\n row; react-big-calendar still shifts an entire week's columns because it\n derives them by adding `n * 86400000`. The shape of all three is the same:\n somewhere, a day was assumed.\n ========================================================================= */\n\nconst HOUR_MS = 3_600_000;\nconst MINUTE_MS = 60_000;\n\nfunction formatterFor(zone: TimeZone): Intl.DateTimeFormat {\n /* I18N-ALLOW: this formatter is zone ARITHMETIC, never display — the parts are read back as Latin digits, so the tag must not vary with the viewer's locale. */\n return dateFormat(\"en-US\", {\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n /* `h23` EXPLICITLY, not `hour12: false`. Several ICU versions render\n midnight as hour \"24\" under `hour12: false`, which parses as a valid\n number and silently lands the reading on the wrong day. */\n hourCycle: \"h23\",\n });\n}\n\n/** The wall-clock reading in `zone` at `instant`. */\nexport function instantToPlainDateTime(zone: TimeZone, instant: Instant): PlainDateTime {\n const parts = formatterFor(zone).formatToParts(new Date(instant));\n let year = 0;\n let month = 1;\n let day = 1;\n let hour = 0;\n let minute = 0;\n let second = 0;\n for (const part of parts) {\n switch (part.type) {\n case \"year\":\n year = Number(part.value);\n break;\n case \"month\":\n month = Number(part.value);\n break;\n case \"day\":\n day = Number(part.value);\n break;\n case \"hour\":\n hour = Number(part.value);\n break;\n case \"minute\":\n minute = Number(part.value);\n break;\n case \"second\":\n second = Number(part.value);\n break;\n }\n }\n /* Sub-second precision passes straight through: every offset in the IANA\n database since 1972 is a whole number of minutes, so a zone shift can never\n move the millisecond field. */\n const millisecond = ((instant % 1000) + 1000) % 1000;\n return { year, month, day, hour, minute, second, millisecond };\n}\n\n/**\n * The same wall-clock fields, but as though they were UTC.\n *\n * `Date.UTC` is NOT used directly anywhere in this file: it maps years 0–99\n * onto 1900–1999, so a year-40 date silently becomes 1940. `setUTCFullYear` has\n * no such rule. The calendar will never render year 40, but a helper that is\n * wrong for an input it never receives is a trap left for whoever reuses it.\n */\nexport function wallAsUtcMs(wall: PlainDateTime): number {\n const d = new Date(0);\n d.setUTCFullYear(wall.year, wall.month - 1, wall.day);\n d.setUTCHours(wall.hour, wall.minute, wall.second, wall.millisecond);\n return d.getTime();\n}\n\n/**\n * `zone`'s offset from UTC at `instant`, in milliseconds. East is positive.\n *\n * THE ONE PRIMITIVE. Read by asking the browser what the wall clock says at\n * that instant and subtracting: if it is 07:00 UTC and the clock in New York\n * reads 02:00, the offset is −5 hours. No table, no parsing of a zone name, no\n * assumption that an offset is a whole number of hours — `Pacific/Chatham` sits\n * at +12:45, and `Asia/Kathmandu` at +5:45.\n */\nexport function offsetAt(zone: TimeZone, instant: Instant): number {\n return wallAsUtcMs(instantToPlainDateTime(zone, instant)) - instant;\n}\n\nfunction sameWall(a: PlainDateTime, b: PlainDateTime): boolean {\n return (\n a.year === b.year &&\n a.month === b.month &&\n a.day === b.day &&\n a.hour === b.hour &&\n a.minute === b.minute &&\n a.second === b.second &&\n a.millisecond === b.millisecond\n );\n}\n\n/**\n * Every instant at which `zone`'s clock reads exactly `wall` — zero, one, or\n * two of them, in ascending order.\n *\n * TWO CANDIDATES, BOTH VERIFIED, WHICH IS THE PART THAT IS EASY TO GET WRONG.\n * The naive method — take the offset at a guessed instant and subtract it — is\n * correct in the ordinary case and wrong at exactly the boundaries this\n * component exists to handle. So both plausible offsets are tried, and each\n * candidate is accepted ONLY if reading the clock back at it reproduces the\n * requested wall time. That round-trip is what distinguishes a real reading\n * from one the clock skipped.\n *\n * two results → an OVERLAP; the clock struck this time twice (fall back)\n * one result → the ordinary case\n * none → a GAP; the clock never struck it at all (spring forward)\n */\nfunction instantsFor(zone: TimeZone, wall: PlainDateTime): Instant[] {\n const asUtc = wallAsUtcMs(wall);\n const offsetBefore = offsetAt(zone, asUtc - 24 * HOUR_MS);\n const offsetAfter = offsetAt(zone, asUtc + 24 * HOUR_MS);\n\n const found: Instant[] = [];\n for (const offset of offsetBefore === offsetAfter ? [offsetBefore] : [offsetBefore, offsetAfter]) {\n const candidate = asUtc - offset;\n if (sameWall(instantToPlainDateTime(zone, candidate), wall)) found.push(candidate);\n }\n found.sort((a, b) => a - b);\n /* A zone can in principle be sampled twice at the same offset either side of\n a transition that returns to where it started; de-duplicate rather than\n report one instant as two. */\n return found.filter((t, i) => i === 0 || t !== found[i - 1]);\n}\n\n/**\n * The instant at which `zone`'s clock reads `wall`.\n *\n * See `Disambiguation` for what happens when that is not exactly one instant.\n * The default is `compatible`, which is what `Temporal` and every other date\n * library do, so the surprising cases are the ones you have to ask for.\n */\nexport function plainDateTimeToInstant(\n zone: TimeZone,\n wall: PlainDateTime,\n disambiguation: Disambiguation = \"compatible\",\n): Instant {\n const candidates = instantsFor(zone, wall);\n\n if (candidates.length === 1) return candidates[0];\n\n if (candidates.length > 1) {\n /* OVERLAP — the hour ran twice. */\n if (disambiguation === \"reject\") throw new AmbiguousTimeError(wall, zone, \"overlap\");\n if (disambiguation === \"later\") return candidates[candidates.length - 1];\n /* `compatible` takes the earlier, matching Temporal. */\n return candidates[0];\n }\n\n /* GAP — the clock skipped this reading entirely. */\n if (disambiguation === \"reject\") throw new AmbiguousTimeError(wall, zone, \"gap\");\n\n const asUtc = wallAsUtcMs(wall);\n const offsetBefore = offsetAt(zone, asUtc - 24 * HOUR_MS);\n const offsetAfter = offsetAt(zone, asUtc + 24 * HOUR_MS);\n const gap = offsetAfter - offsetBefore;\n\n /* Both of these are real instants; they differ by the size of the gap. Using\n the PRE-transition offset lands before the jump, the post-transition offset\n lands after it. `compatible` shifts FORWARD by the gap — the same choice\n Temporal makes, and the one that matches what a person means by \"07:30\" on\n a morning when 07:30 did not happen. */\n const earlier = asUtc - offsetBefore;\n const later = asUtc - offsetAfter;\n if (disambiguation === \"earlier\") return Math.min(earlier, later);\n return gap > 0 ? Math.max(earlier, later) : Math.min(earlier, later);\n}\n\n/** The calendar day `instant` falls on, in `zone`. */\nexport function instantToPlainDate(zone: TimeZone, instant: Instant): PlainDate {\n const wall = instantToPlainDateTime(zone, instant);\n return { year: wall.year, month: wall.month, day: wall.day };\n}\n\n/**\n * The first instant of `date` in `zone`.\n *\n * NOT \"midnight\". In `America/Santiago` on 2026-09-06 the clock jumps from\n * 00:00 to 01:00, so the day's first instant reads 01:00 — and a grid that\n * assumes its own origin is midnight puts every event on that day an hour out.\n * `America/Havana` and `Asia/Beirut` do the same thing on their own dates.\n *\n * Implemented by asking for midnight and, when the clock skipped it, walking\n * forward a minute at a time until a reading exists. The walk is bounded: no\n * transition in the IANA database exceeds two hours, so 180 iterations cannot\n * be reached by real data, and the bound exists to fail loudly rather than spin\n * if that ever stops being true.\n */\nexport function startOfDay(zone: TimeZone, date: PlainDate): Instant {\n const midnight: PlainDateTime = { ...date, hour: 0, minute: 0, second: 0, millisecond: 0 };\n const exact = instantsFor(zone, midnight);\n /* An OVERLAP at midnight means the day started twice; the day begins at the\n first of them, not the second. */\n if (exact.length > 0) return exact[0];\n\n for (let minutes = 1; minutes <= 180; minutes++) {\n const candidate = instantsFor(zone, {\n ...date,\n hour: Math.floor(minutes / 60),\n minute: minutes % 60,\n second: 0,\n millisecond: 0,\n });\n if (candidate.length > 0) return candidate[0];\n }\n throw new Error(\n `startOfDay: no instant exists in the first three hours of ${date.year}-${date.month}-${date.day} in ${zone}`,\n );\n}\n\n/** The day after `date` on the calendar, ignoring zones entirely. */\nexport function nextDay(date: PlainDate): PlainDate {\n return addDays(date, 1);\n}\n\n/**\n * How long `date` actually lasts in `zone`, in milliseconds.\n *\n * Measured as the distance between one day's first instant and the next day's,\n * which is true by construction for every case — 23 hours, 25 hours, the 30\n * minutes of Lord Howe, and a day that starts at 01:00 — with no special case\n * for any of them. That is the entire reason positions in the grid are a RATIO\n * of this number rather than `hour × rowHeight`.\n */\nexport function dayLengthMs(zone: TimeZone, date: PlainDate): number {\n return startOfDay(zone, nextDay(date)) - startOfDay(zone, date);\n}\n\n/**\n * How many hours `date` lasts in `zone` — 23, 24, 25, or 23.5.\n *\n * Fractional by design. `Australia/Lord_Howe` shifts by thirty minutes, so a\n * signature returning an integer would be lying about a real zone, and any\n * caller branching on `=== 23` is already broken.\n */\nexport function hoursInDay(zone: TimeZone, date: PlainDate): number {\n return dayLengthMs(zone, date) / HOUR_MS;\n}\n\n/**\n * Where `instant` sits within `date`, as a fraction from 0 to 1.\n *\n * THE LOAD-BEARING FUNCTION. A 23-hour day compresses and a 25-hour day\n * stretches with no branch anywhere, because the divisor is the day's real\n * length. Values outside 0–1 mean the instant is not on this day and are\n * returned rather than clamped — the layout core needs to know by how much in\n * order to clip a multi-day span.\n */\nexport function dayFraction(zone: TimeZone, date: PlainDate, instant: Instant): number {\n const from = startOfDay(zone, date);\n return (instant - from) / dayLengthMs(zone, date);\n}\n\n/**\n * The exact inverse of `dayFraction`.\n *\n * IT MUST BE EXACT, and that is not a stylistic preference. Rendering maps an\n * instant to a position and hit-testing maps a position back to an instant; if\n * the two disagree by even a rounding step, an event lands one slot away from\n * where it was dropped. FullCalendar's Australia selection bug is exactly this\n * pair drifting apart. `dayFraction(z, d, instantAtFraction(z, d, f)) === f`\n * for every zone in the corpus, and there is a test that says so.\n */\nexport function instantAtFraction(zone: TimeZone, date: PlainDate, fraction: number): Instant {\n return startOfDay(zone, date) + fraction * dayLengthMs(zone, date);\n}\n\n/**\n * Move `instant` by a CALENDAR duration.\n *\n * Days are applied on the calendar and then re-anchored to the same wall-clock\n * time, so an event dragged from Saturday to Sunday across a transition keeps\n * reading 09:00 rather than becoming 08:00 or 10:00. Hours and minutes are\n * applied afterwards as exact elapsed time, because dragging an event down the\n * grid by two hours does mean two hours.\n *\n * ORDER MATTERS AND IS FIXED: days first, then time. The other order makes\n * \"one day and two hours later\" depend on which side of a transition the\n * intermediate value happened to land on.\n */\nexport function addDuration(\n zone: TimeZone,\n instant: Instant,\n duration: { days?: number; hours?: number; minutes?: number },\n disambiguation: Disambiguation = \"compatible\",\n): Instant {\n const { days = 0, hours = 0, minutes = 0 } = duration;\n\n let result = instant;\n if (days !== 0) {\n const wall = instantToPlainDateTime(zone, instant);\n const shifted = new Date(0);\n shifted.setUTCFullYear(wall.year, wall.month - 1, wall.day + days);\n result = plainDateTimeToInstant(\n zone,\n {\n year: shifted.getUTCFullYear(),\n month: shifted.getUTCMonth() + 1,\n day: shifted.getUTCDate(),\n hour: wall.hour,\n minute: wall.minute,\n second: wall.second,\n millisecond: wall.millisecond,\n },\n disambiguation,\n );\n }\n return result + hours * HOUR_MS + minutes * MINUTE_MS;\n}\n"],"names":["HOUR_MS","MINUTE_MS","formatterFor","zone","dateFormat","instantToPlainDateTime","instant","parts","year","month","day","hour","minute","second","part","millisecond","wallAsUtcMs","wall","d","offsetAt","sameWall","a","b","instantsFor","asUtc","offsetBefore","offsetAfter","found","offset","candidate","t","i","plainDateTimeToInstant","disambiguation","candidates","AmbiguousTimeError","gap","earlier","later","instantToPlainDate","startOfDay","date","midnight","exact","minutes","nextDay","addDays","dayLengthMs","hoursInDay","dayFraction","from","instantAtFraction","fraction","addDuration","duration","days","hours","result","shifted"],"mappings":";;;AAiCA,MAAMA,IAAU,MACVC,IAAY;AAElB,SAASC,EAAaC,GAAqC;AAEzD,SAAOC,EAAW,SAAS;AAAA,IACzB,UAAUD;AAAA,IACV,MAAM;AAAA,IACN,OAAO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AID,EAAWrC,GAAMsC,CAAI;AAChE;AASO,SAASO,EAAW7C,GAAgBsC,GAAyB;AAClE,SAAOM,EAAY5C,GAAMsC,CAAI,IAAIzC;AACnC;AAWO,SAASiD,EAAY9C,GAAgBsC,GAAiBnC,GAA0B;AACrF,QAAM4C,IAAOV,EAAWrC,GAAMsC,CAAI;AAClC,UAAQnC,IAAU4C,KAAQH,EAAY5C,GAAMsC,CAAI;AAClD;AAYO,SAASU,EAAkBhD,GAAgBsC,GAAiBW,GAA2B;AAC5F,SAAOZ,EAAWrC,GAAMsC,CAAI,IAAIW,IAAWL,EAAY5C,GAAMsC,CAAI;AACnE;AAeO,SAASY,EACdlD,GACAG,GACAgD,GACArB,IAAiC,cACxB;AACT,QAAM,EAAE,MAAAsB,IAAO,GAAG,OAAAC,IAAQ,GAAG,SAAAZ,IAAU,MAAMU;AAE7C,MAAIG,IAASnD;AACb,MAAIiD,MAAS,GAAG;AACd,UAAMtC,IAAOZ,EAAuBF,GAAMG,CAAO,GAC3CoD,IAAU,oBAAI,KAAK,CAAC;AAC1B,IAAAA,EAAQ,eAAezC,EAAK,MAAMA,EAAK,QAAQ,GAAGA,EAAK,MAAMsC,CAAI,GACjEE,IAASzB;AAAA,MACP7B;AAAA,MACA;AAAA,QACE,MAAMuD,EAAQ,eAAA;AAAA,QACd,OAAOA,EAAQ,YAAA,IAAgB;AAAA,QAC/B,KAAKA,EAAQ,WAAA;AAAA,QACb,MAAMzC,EAAK;AAAA,QACX,QAAQA,EAAK;AAAA,QACb,QAAQA,EAAK;AAAA,QACb,aAAaA,EAAK;AAAA,MAAA;AAAA,MAEpBgB;AAAA,IAAA;AAAA,EAEJ;AACA,SAAOwB,IAASD,IAAQxD,IAAU4C,IAAU3C;AAC9C;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useState as a, useRef as i, useCallback as f } from "react";
|
|
2
|
+
function d(e, o, r) {
|
|
3
|
+
const [l, u] = a(o), t = e !== void 0, n = i(r);
|
|
4
|
+
n.current = r;
|
|
5
|
+
const c = f(
|
|
6
|
+
(s) => {
|
|
7
|
+
t || u(s), n.current?.(s);
|
|
8
|
+
},
|
|
9
|
+
[t]
|
|
10
|
+
);
|
|
11
|
+
return [t ? e : l, c];
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
d as useControllable
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=use-controllable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-controllable.js","sources":["../../src/lib/use-controllable.ts"],"sourcesContent":["import { useCallback, useRef, useState } from \"react\";\n\n/**\n * One value that may be driven from outside or kept here.\n *\n * WHY IT IS SHARED RATHER THAN WRITTEN FOUR TIMES: `CodeEditor` has four of\n * these (text, wrap, view, expanded) and the subtle half is identical in all\n * four — a controlled instance must NEVER write its own state, or it renders\n * the consumer's value for one frame and its own for the next, which shows up\n * as a control that flickers back after every change.\n *\n * `controlled === undefined` decides, once per render, exactly as React's own\n * inputs do. Switching a prop from undefined to a value mid-life is a consumer\n * bug everywhere in React and is not defended against here.\n */\nexport function useControllable<T>(\n controlled: T | undefined,\n initial: T,\n onChange?: (next: T) => void,\n): [T, (next: T) => void] {\n const [internal, setInternal] = useState(initial);\n const isControlled = controlled !== undefined;\n\n /* The handler is read from a ref so `set` keeps a stable identity. Without\n it every consumer passing an inline arrow re-creates `set` on each render,\n which invalidates every memo below it — on a component whose child renders\n a span per token, that is the difference between a keystroke costing one\n re-render and costing several. */\n const handler = useRef(onChange);\n handler.current = onChange;\n\n const set = useCallback(\n (next: T) => {\n if (!isControlled) setInternal(next);\n handler.current?.(next);\n },\n [isControlled],\n );\n\n return [isControlled ? (controlled as T) : internal, set];\n}\n"],"names":["useControllable","controlled","initial","onChange","internal","setInternal","useState","isControlled","handler","useRef","set","useCallback","next"],"mappings":";AAeO,SAASA,EACdC,GACAC,GACAC,GACwB;AACxB,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAASJ,CAAO,GAC1CK,IAAeN,MAAe,QAO9BO,IAAUC,EAAON,CAAQ;AAC/B,EAAAK,EAAQ,UAAUL;AAElB,QAAMO,IAAMC;AAAA,IACV,CAACC,MAAY;AACX,MAAKL,KAAcF,EAAYO,CAAI,GACnCJ,EAAQ,UAAUI,CAAI;AAAA,IACxB;AAAA,IACA,CAACL,CAAY;AAAA,EAAA;AAGf,SAAO,CAACA,IAAgBN,IAAmBG,GAAUM,CAAG;AAC1D;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useState as u, useLayoutEffect as f } from "react";
|
|
2
|
+
import { nearestScrollAncestor as p } from "./dom/scroll-ancestor.js";
|
|
3
|
+
const a = 200, c = (o) => p(o, { includeSelf: !1 });
|
|
4
|
+
function h(o) {
|
|
5
|
+
const e = o.getBoundingClientRect(), r = c(o);
|
|
6
|
+
if (r === null) {
|
|
7
|
+
const s = o.ownerDocument.defaultView;
|
|
8
|
+
return o.ownerDocument.documentElement.clientHeight - (e.top + (s?.scrollY ?? 0));
|
|
9
|
+
}
|
|
10
|
+
const n = r.getBoundingClientRect(), l = parseFloat(getComputedStyle(r).borderTopWidth) || 0, i = e.top - n.top - l + r.scrollTop;
|
|
11
|
+
return r.clientHeight - i;
|
|
12
|
+
}
|
|
13
|
+
function d(o = !0) {
|
|
14
|
+
const [e, r] = u(null);
|
|
15
|
+
return f(() => {
|
|
16
|
+
if (e === null) return;
|
|
17
|
+
const n = () => {
|
|
18
|
+
if (!o) {
|
|
19
|
+
e.style.removeProperty("height");
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const s = h(e);
|
|
23
|
+
if (!(s >= a)) {
|
|
24
|
+
e.style.removeProperty("height");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const t = `${Math.floor(s)}px`;
|
|
28
|
+
e.style.height !== t && (e.style.height = t);
|
|
29
|
+
};
|
|
30
|
+
if (n(), !o) return;
|
|
31
|
+
const l = e.ownerDocument.defaultView;
|
|
32
|
+
l?.addEventListener("resize", n);
|
|
33
|
+
const i = typeof ResizeObserver > "u" ? null : new ResizeObserver(n);
|
|
34
|
+
if (i) {
|
|
35
|
+
const s = c(e);
|
|
36
|
+
for (let t = e.parentElement; t && (i.observe(t), t !== s); t = t.parentElement)
|
|
37
|
+
;
|
|
38
|
+
for (const t of e.parentElement?.children ?? [])
|
|
39
|
+
t !== e && i.observe(t);
|
|
40
|
+
}
|
|
41
|
+
return () => {
|
|
42
|
+
l?.removeEventListener("resize", n), i?.disconnect(), e.style.removeProperty("height");
|
|
43
|
+
};
|
|
44
|
+
}, [e, o]), r;
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
d as useFillHeight
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=use-fill-height.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-fill-height.js","sources":["../../src/lib/use-fill-height.ts"],"sourcesContent":["import { useLayoutEffect, useState, type RefCallback } from \"react\";\nimport { nearestScrollAncestor } from \"./dom/scroll-ancestor\";\n\n/* ============================================================================\n FILL THE REST OF THE SCREEN — the height CSS cannot compute.\n\n THE DEFECT THIS EXISTS FOR, in the words it was reported in: \"the columns on\n the kanban board should fill to the full remaining height of the page. No\n scroll bar vertically. Only scroll vertically per column. Why is that not the\n default out of the box?\"\n\n IT WAS NOT THE DEFAULT BECAUSE NO ARRANGEMENT OF CLASSES CAN MAKE IT ONE. The\n documented shape — `flex-1 min-h-0` chained from a bounded ancestor down to\n the scroller — is correct, and it is correct only while EVERY element in that\n chain cooperates. `flex-1` against a block parent is inert; `h-full` against a\n parent with no definite height is `auto`; a percentage height resolves against\n nothing. One ordinary page wrapper anywhere above — `<div className=\"flex\n flex-col gap-10 py-10\">`, which is this package's own demo layout — and the\n whole chain silently degrades to content sizing. Measured in the demo with\n the fixture's own height removed: the board came out 473px tall, its lanes\n scrolled nothing at all (`scrollHeight` 404 against `clientHeight` 404), and\n the shell's content column took the overflow instead (1027 against 840).\n\n So the component that needs the height has to ask for it, and CSS has no\n question that means \"how far is it from my own top to the bottom of the box\n that scrolls me\". That distance is what this measures.\n\n THIS IS NOT THE ARITHMETIC `AppShell` BANS. Its header says: \"If a consumer is\n doing viewport arithmetic against one of our tokens, this component has not\n finished its job\" — and it is right, because `h-[calc(100dvh-var(--control-xl))]`\n is a CACHED COPY of a fact the DOM already knows, wrong the moment the header\n wraps or the token is retuned. Nothing is cached here. The number is read from\n live boxes, re-read whenever any box above it changes size, and never written\n by a consumer.\n\n THE MEASUREMENT IS SCROLL-INDEPENDENT, and getting that wrong is a feedback\n loop rather than an off-by-one. Taking `viewportHeight - rect.top` makes the\n answer grow as the page scrolls down, which grows the element, which lengthens\n the page. The offset is taken in the SCROLLPORT'S OWN CONTENT COORDINATES\n instead — `rect.top - portRect.top - borderTop + port.scrollTop` — which does\n not move when the scrollport scrolls, so the height is a fixed point.\n\n WHAT IT DELIBERATELY DOES NOT DO. It never sets a height it cannot justify:\n below `MIN_FILL` the property is removed and the element falls back to the\n `flex-1`/content behaviour it had before, because a board 40px from the bottom\n of a long document has no \"remaining height\" worth the name. And it writes\n `height` only — pair it with `max-h-full` at the call site so a genuinely\n bounded ancestor, which the caller may not know about, still wins.\n ========================================================================= */\n\n/**\n * The smallest height worth forcing — a lane header plus something to put under\n * it. Below this the element is far enough down a long page that \"fill the rest\n * of the screen\" describes a sliver nobody asked for, and the unmeasured\n * behaviour is the better answer.\n */\nconst MIN_FILL = 200;\n\n/* The scrollport is the nearest ANCESTOR that scrolls (never the element itself), or null for the viewport.\n `overflow: hidden` is not one: it is a clip box and often a content-sized one — a rounded card, a `Surface` —\n and measuring against it would hand back its own content height. A real bounded one still wins through the\n `max-h-full` the caller pairs with this. See `lib/dom/scroll-ancestor.ts`. */\nconst scrollportOf = (element: HTMLElement) => nearestScrollAncestor(element, { includeSelf: false });\n\n/**\n * Distance from the element's top to the bottom of the visible area of whatever\n * scrolls it — negative or tiny when it is below the fold.\n */\nfunction availableBelow(element: HTMLElement): number {\n const rect = element.getBoundingClientRect();\n const port = scrollportOf(element);\n if (port === null) {\n const view = element.ownerDocument.defaultView;\n const root = element.ownerDocument.documentElement;\n /* Document coordinates, for the same scroll-independence reason as below:\n `rect.top` alone moves with the page. */\n return root.clientHeight - (rect.top + (view?.scrollY ?? 0));\n }\n const portRect = port.getBoundingClientRect();\n const borderTop = parseFloat(getComputedStyle(port).borderTopWidth) || 0;\n const offsetInContent = rect.top - portRect.top - borderTop + port.scrollTop;\n /* `clientHeight`, not the rect: it is the visible CONTENT box, so a horizontal\n scrollbar along the bottom of the scrollport is already subtracted. */\n return port.clientHeight - offsetInContent;\n}\n\n/**\n * Size an element to the space between its own top and the bottom of the box\n * that scrolls it, and keep it sized as the page changes around it.\n *\n * Returns a ref callback for the element. The height is written as inline style\n * rather than returned as state on purpose — a returned number would re-render\n * the subtree on every resize frame, and the value is only ever consumed by one\n * property on one element.\n *\n * ```tsx\n * const fillRef = useFillHeight(fill);\n * <div ref={fillRef} className=\"max-h-full …\" />\n * ```\n *\n * WHAT IT WATCHES, and why that list rather than a global observer. The number\n * changes when a box ABOVE the element changes size: the scrollport itself, an\n * ancestor between the two, or a sibling laid out before it. All three are\n * observed. The element itself is deliberately NOT observed — it is the thing\n * being written, and observing it is the loop.\n *\n * A sibling ADDED after mount is the known gap: the observer set is built once\n * per attach. In practice the content above a filling element is a page header,\n * not a live list, and a `key`ed remount covers the rest.\n */\nexport function useFillHeight(enabled = true): RefCallback<HTMLElement> {\n /* State rather than a ref, so attaching the element re-runs the effect. A\n ref callback alone gives no signal that the element arrived. */\n const [element, setElement] = useState<HTMLElement | null>(null);\n\n useLayoutEffect(() => {\n if (element === null) return;\n\n const apply = () => {\n if (!enabled) {\n element.style.removeProperty(\"height\");\n return;\n }\n const available = availableBelow(element);\n if (!(available >= MIN_FILL)) {\n /* Includes the happy-dom case, where every rect is zero: nothing is\n written and the element keeps exactly the behaviour it has without\n this hook, which is what makes the unit suite meaningful. */\n element.style.removeProperty(\"height\");\n return;\n }\n /* FLOOR, NEVER ROUND. The element's own top is fractional far more often\n than not — 282.33px on the demo page, from a font-relative gap — and\n rounding UP puts the bottom edge a third of a pixel past the fold,\n which is enough to give the scrollport back the scrollbar this exists\n to remove. Losing a sub-pixel off the bottom of a lane costs nothing. */\n // I18N-ALLOW: CSS length written to a style property\n const next = `${Math.floor(available)}px`;\n if (element.style.height !== next) element.style.height = next;\n };\n\n apply();\n if (!enabled) return;\n\n const view = element.ownerDocument.defaultView;\n view?.addEventListener(\"resize\", apply);\n\n /* Guarded: happy-dom has no `ResizeObserver`, and a missing one costs the\n initial measurement above and nothing else. */\n const observer =\n typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(apply);\n if (observer) {\n const port = scrollportOf(element);\n for (let parent = element.parentElement; parent; parent = parent.parentElement) {\n observer.observe(parent);\n if (parent === port) break;\n }\n for (const sibling of element.parentElement?.children ?? []) {\n if (sibling !== element) observer.observe(sibling);\n }\n }\n\n return () => {\n view?.removeEventListener(\"resize\", apply);\n observer?.disconnect();\n element.style.removeProperty(\"height\");\n };\n }, [element, enabled]);\n\n return setElement;\n}\n"],"names":["MIN_FILL","scrollportOf","element","nearestScrollAncestor","availableBelow","rect","port","view","portRect","borderTop","offsetInContent","useFillHeight","enabled","setElement","useState","useLayoutEffect","apply","available","next","observer","parent","sibling"],"mappings":";;AAwDA,MAAMA,IAAW,KAMXC,IAAe,CAACC,MAAyBC,EAAsBD,GAAS,EAAE,aAAa,IAAO;AAMpG,SAASE,EAAeF,GAA8B;AACpD,QAAMG,IAAOH,EAAQ,sBAAA,GACfI,IAAOL,EAAaC,CAAO;AACjC,MAAII,MAAS,MAAM;AACjB,UAAMC,IAAOL,EAAQ,cAAc;AAInC,WAHaA,EAAQ,cAAc,gBAGvB,gBAAgBG,EAAK,OAAOE,GAAM,WAAW;AAAA,EAC3D;AACA,QAAMC,IAAWF,EAAK,sBAAA,GAChBG,IAAY,WAAW,iBAAiBH,CAAI,EAAE,cAAc,KAAK,GACjEI,IA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+
{"version":3,"file":"use-hydrated.js","sources":["../../src/lib/use-hydrated.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nconst noSubscription = () => () => {};\n\n/**\n * DX-5411 / DX-5425 — false on a server and during hydration, true once the client has taken over.\n *\n * A prerendered page's first client render must draw exactly what the server drew, so anything that reads the browser\n * (a stored choice, a share sheet) or must not act before the bundle runs (a submit, a write to storage) waits on this.\n * A client render that is not hydrating (no server HTML underneath) is true from its first render.\n */\nexport function useHydrated(): boolean {\n return useSyncExternalStore(\n noSubscription,\n () => true,\n () => false,\n );\n}\n"],"names":["noSubscription","useHydrated","useSyncExternalStore"],"mappings":";AAEA,MAAMA,IAAiB,MAAM,MAAM;AAAC;AAS7B,SAASC,IAAuB;AACrC,SAAOC;AAAA,IACLF;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAEV;"}
|