@50arms/ui 0.0.0-stage → 35.2.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 +169 -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 +332 -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 +22 -0
- package/dist/types/components/rbac/ApiKeysPanel.d.ts +26 -0
- package/dist/types/components/rbac/ApiKeysTable.d.ts +65 -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 +635 -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":"store.js","sources":["../../../src/lib/records/store.ts"],"sourcesContent":["import { devWarn } from \"../dev-warn\";\nimport { staleFieldsFor } from \"./define-record-type\";\nimport type {\n RecordPayload,\n RecordState,\n StalenessEntry,\n WriteAllResult,\n WriteOptions,\n WriteResult,\n WriteVerdict,\n} from \"./types\";\nimport {\n explicitlyUndeleted,\n isEnvelopeKey,\n isRecordRef,\n isStalePing,\n normalizeTimestamp,\n normalizeTypeName,\n payloadIdentity,\n recordKey,\n tombstoneAt,\n type PayloadIdentity,\n} from \"./wire\";\n\n/* ============================================================================\n THE RECORD STORE — a NORMALIZED identity map behind a per-key\n `useSyncExternalStore`.\n\n NORMALIZED means each record is stored FLAT and its relations are held as\n pointers, not copies: a demand stores `{id, name, files:[{__ref:\"StoredFile:9\"}]}`.\n Hydration is the read-time walk that swaps each `__ref` back for the record\n it points at, recursively, so a caller never has to know the store is\n normalized at all.\n\n WHY NORMALIZED, when denormalized snapshots make reads free. A denormalized\n store has to invalidate every ancestor that embedded a changed child, which\n means maintaining a reverse index — and a missed entry there is a parent\n that renders perfectly and is simply WRONG, with nothing on screen to\n indicate it. Normalization's three costs (a memo to keep, cycles to\n terminate, a walk per read) are each a bug that ANNOUNCES itself: an\n infinite loop, a hang, a slow render. A loud failure you fix once beats a\n silent one you never find. That asymmetry, not the read cost, is the whole\n argument.\n\n THE DECISIVE ARGUMENT IS TIMESTAMP GRANULARITY. A parent's `updated_at` does\n NOT move when a child's does. Under denormalized snapshots keyed on the\n PARENT's timestamp, a parent fetch and a child broadcast cannot be ordered\n against each other at all — the guard would be comparing a number that never\n changed. Only a per-record timestamp on the child can order those two\n sources, and on a busy screen that collision happens continuously.\n\n WHY THIS IS NOT `createSimStore`. That store is array-backed, notifies the\n WHOLE store on any write, and takes a caller-supplied `getId`. Per-key\n notification is the entire point of this one — a card must update without\n the list refetching — so that is the part being replaced rather than reused.\n The `useSyncExternalStore`-over-a-module-level-pub/sub idiom is the part\n that carries straight over.\n\n WHAT THIS MODULE DELIBERATELY DOES NOT DO. It never imports a transport. It\n is exercised by calling `write()` directly, with no socket, no server and no\n mocking framework — which is what makes a layer whose every failure mode is\n SILENCE testable at all.\n ========================================================================= */\n\n/* --- State ---------------------------------------------------------------- */\n\ninterface StoredRecord {\n /** The NORMALIZED type, re-emitted as `__type` on every hydrated read. */\n readonly type: string;\n /** Flat fields. Relations are `{__ref}` pointers, never embedded copies. */\n data: Record<string, unknown>;\n /**\n * False for a record that exists ONLY because an optimistic create put it here — no write has\n * ever landed on it. Such a record is dropped outright once its last layer goes, rather than\n * left behind as an empty husk that reads as `present`.\n */\n hasBase: boolean;\n /**\n * Optimistic layers, oldest first — see \"OPTIMISTIC LAYERS\" below. Never touched by `write()`,\n * which only ever changes the BASE underneath them.\n */\n layers: OptimisticLayer[];\n /** Bumps on an ACCEPTED AND CHANGED write. Never on a redelivered duplicate. */\n version: number;\n /** Bumps only on an accepted write that changed the BASE (DXUI-83): `version` also moves on every layer, so it cannot tell a commit from a rollback. */\n baseVersion: number;\n /** Milliseconds. `undefined` means \"cannot adjudicate\", not \"old\". */\n timestamp: number | undefined;\n /**\n * DXUI-96: per field, the newest version a write carried it at. `timestamp` alone cannot say\n * whether the base's value of one field is newer than a refused answer: a partial write raises\n * the record's version without touching the fields it does not carry. An unversioned write is\n * accepted as current, so it carries its fields at the version held.\n */\n fieldVersions: Record<string, number>;\n deletedAt: string | undefined;\n /** Opaque field-set names a FETCH has satisfied. */\n tags: Set<string>;\n /** Fields the last broadcast could not carry. */\n stale: Set<string>;\n}\n\ninterface MemoEntry {\n value: unknown;\n /**\n * Every key the walk VISITED and the version it saw — including keys that\n * were MISSING, at `MISSING_VERSION`.\n *\n * THE MISSING-KEY DEP IS THE SILENT ONE. A demand referencing a file that\n * has not arrived yet otherwise records no dep on it, so when the file DOES\n * arrive the parent's memo is still valid and the parent never re-renders.\n * That is a stale parent with nothing on screen to indicate it — the exact\n * failure normalization was chosen to avoid, re-entering through the door\n * normalization locked.\n */\n deps: Map<string, number>;\n atGlobal: number;\n}\n\nconst MISSING_VERSION = -1;\n\nconst records = new Map<string, StoredRecord>();\nconst memo = new Map<string, MemoEntry>();\nconst stateMemo = new Map<string, RecordState<unknown>>();\nconst listeners = new Map<string, Set<() => void>>();\nconst stalenessListeners = new Set<() => void>();\n/** DXUI-77: per record type, who wants to hear that a layer of that type changed (`subscribeToLayers`). */\nconst layerListeners = new Map<string, Set<() => void>>();\n/** DXUI-77: the types a layer changed on since the last flush. */\nlet pendingLayerTypes = new Set<string>();\nconst roots = new Map<string, number>();\n\n/**\n * Bumps on ANY accepted and changed write.\n *\n * THE FAST PATH IS A REQUIREMENT, NOT AN OPTIMISATION. The dep scan runs on\n * EVERY `getSnapshot` — every render of every subscriber, plus once per\n * subscriber per notification. A document with 434 pages broadcasting per row\n * during transcode is roughly 435 events x every mounted reader x 436 lookups.\n * This integer collapses the unchanged case to one comparison.\n */\nlet globalVersion = 0;\n\nlet currentTenant: string | number | undefined;\n\n/* --- Tenancy -------------------------------------------------------------- */\n\n/**\n * Declare which tenant this store is holding records for.\n *\n * Changing it CLEARS the store. The keys are `Type:id` with no tenant in them,\n * so team B's demand #7 would merge onto team A's demand #7 — in an app whose\n * read key is deliberately team-scoped precisely to prevent that. Clearing\n * handles what is already written; the `tenant` parameter on `write` handles\n * what is still in the air.\n */\nexport function setRecordStoreTenant(tenant: string | number | undefined): void {\n if (tenant === currentTenant) return;\n currentTenant = tenant;\n records.clear();\n memo.clear();\n stateMemo.clear();\n pendingDirty.clear();\n globalVersion += 1;\n notifyAll();\n for (const listener of [...tenantListeners]) listener();\n}\n\nconst tenantListeners = new Set<() => void>();\n\n/** DXUI-84: called when the store's tenant changes (and only then), for state kept outside the store. */\nexport function subscribeToTenant(listener: () => void): () => void {\n tenantListeners.add(listener);\n return () => tenantListeners.delete(listener);\n}\n\nexport function getRecordStoreTenant(): string | number | undefined {\n return currentTenant;\n}\n\n/**\n * Moves on every accepted change to what the store holds (a write, a layer, a clear). A listener that is called once per changed key in one\n * flush compares it to the version it last looked at, so a burst of N changed keys costs it one look, not N (DXUI-77).\n */\nexport function recordStoreVersion(): number {\n return globalVersion;\n}\n\n/* --- Writing -------------------------------------------------------------- */\n\nconst NO_KEYS: readonly string[] = Object.freeze([]);\n\ninterface WriteContext {\n readonly options: WriteOptions;\n readonly touched: Set<string>;\n /** Keys of nested records this write refused as strictly older than the stored version (DXUI-90). */\n readonly refusedNested: string[];\n /**\n * Payload objects currently being applied, so a payload that nests a\n * pointer back to one of its own ancestors emits a ref instead of\n * recursing forever.\n */\n readonly inFlight: Map<object, string>;\n}\n\n/**\n * The single writer. A fetch response, a mutation's returned item and a\n * broadcast all arrive here, so fetch-versus-broadcast reconciliation lives in\n * ONE place rather than split across two modules that would each hold half the\n * rule.\n */\nexport function write(payload: RecordPayload, options: WriteOptions): WriteResult {\n if (isStalePing(payload)) {\n return { verdict: \"rejected-shape\", keys: NO_KEYS, refusedNested: NO_KEYS, reason: \"a __stale ping carries no __type to key on\" };\n }\n\n const identity = payloadIdentity(payload);\n if (!identity) {\n return { verdict: \"rejected-shape\", keys: NO_KEYS, refusedNested: NO_KEYS, reason: \"missing __type or id\" };\n }\n\n if (currentTenant !== undefined && options.tenant !== currentTenant) {\n return {\n verdict: \"dropped-tenant\",\n keys: NO_KEYS,\n refusedNested: NO_KEYS,\n reason: `stamped for tenant ${String(options.tenant)}; this store now serves ${String(currentTenant)}`,\n };\n }\n if (currentTenant === undefined && options.tenant !== undefined) {\n devWarn(\n \"recordStore\",\n \"a write carried a tenant but the store has none — call setRecordStoreTenant() \" +\n \"or the cross-tenant guard is inert.\",\n );\n }\n if (options.source === \"broadcast\" && options.tag !== undefined) {\n devWarn(\n \"recordStore\",\n \"a broadcast supplied a field-set tag — ignored. A broadcast is partial by \" +\n \"whitelist and can never complete a record.\",\n );\n }\n\n const ctx: WriteContext = { options, touched: new Set(), refusedNested: [], inFlight: new Map() };\n const verdict = applyOne(payload, identity, ctx);\n\n if (verdict === \"dropped-older\") {\n return { verdict, keys: NO_KEYS, refusedNested: NO_KEYS, reason: `older than the stored ${identity.key}` };\n }\n return { verdict, keys: [...ctx.touched], refusedNested: ctx.refusedNested };\n}\n\n/**\n * The plural form — REQUIRED, not a convenience.\n *\n * A list page is fifty payloads, and fifty singular writes are fifty\n * notification passes and fifty render passes for one page load. Every write\n * in one call coalesces into a single notification.\n */\nexport function writeAll(payloads: readonly RecordPayload[], options: WriteOptions): WriteAllResult {\n const results: WriteResult[] = [];\n const keys = new Set<string>();\n for (const payload of payloads) {\n const result = write(payload, options);\n results.push(result);\n for (const key of result.keys) keys.add(key);\n }\n return { results, keys: [...keys] };\n}\n\nfunction applyOne(payload: RecordPayload, identity: PayloadIdentity, ctx: WriteContext): WriteVerdict {\n const { key, type } = identity;\n const incomingTimestamp = normalizeTimestamp(payload.__timestamp);\n const existing = records.get(key);\n\n /* THE GUARD COMPARES THE RECORD'S OWN TIMESTAMP ONLY, never a child's, and\n only a STRICTLY OLDER write is refused.\n\n An EQUAL-timestamp write MERGES. Equal is common and load-bearing: a\n partial broadcast and a fuller fetch derive both timestamps from the same\n `updated_at` column, so equality means the same row version rather than a\n coincidence — and merging is commutative for disjoint key sets. Dropping\n the fetch there would permanently lose the fields the broadcast could not\n carry, which is precisely the refetch this whole staleness mechanism\n exists to make work.\n\n The prior art this replaces walked the payload's keys recursively and\n accepted at the first key whose stored value had no timestamp of its own —\n and since every payload's first key is `id`, and a number has no\n timestamp, its reject branch was unreachable in both directions. That walk\n IS the bug; this is one comparison. */\n if (existing && existing.timestamp !== undefined && incomingTimestamp !== undefined) {\n if (incomingTimestamp < existing.timestamp) {\n devWarn(\"recordStore\", `refused a strictly older write for ${key}`);\n return \"dropped-older\";\n }\n }\n\n const record: StoredRecord = existing ?? createRecord(key, type);\n\n ctx.inFlight.set(payload as object, key);\n ctx.touched.add(key);\n\n const fields = normalizeFields(payload, ctx);\n const carriedAt = incomingTimestamp ?? record.timestamp;\n let changed = false;\n if (!record.hasBase) {\n record.hasBase = true;\n changed = true;\n }\n\n /* RUL: an ABSENT key keeps its previous value; a PRESENT null CLEARS it.\n The loop iterates the payload's keys and never tests truthiness — a\n truthiness test silently turns \"cleared\" into \"unchanged\", which is the\n same absent-versus-empty collapse this codebase refuses everywhere else.\n\n ARRAYS AND NESTED PLAIN OBJECTS ARE REPLACED WHOLESALE. The merge is\n SHALLOW at the top level, full stop. This needs saying out loud precisely\n because \"merge, never replace\" reads like it should recurse into arrays,\n and it must not: a present array key is authoritative and TRUNCATING.\n The consequence to design around is that any event whitelisting a to-many\n relation must publish it COMPLETE or not at all — a half-list is worse\n than no list, because the store cannot tell the difference. */\n for (const [field, value] of Object.entries(fields)) {\n if (!(field in record.data) || !deepEquals(record.data[field], value)) {\n record.data[field] = value;\n changed = true;\n }\n if (carriedAt !== undefined) record.fieldVersions[field] = carriedAt;\n }\n\n const tombstone = tombstoneAt(payload);\n if (tombstone !== undefined) {\n if (record.deletedAt !== tombstone) {\n record.deletedAt = tombstone;\n changed = true;\n }\n } else if (explicitlyUndeleted(payload) && record.deletedAt !== undefined) {\n record.deletedAt = undefined;\n changed = true;\n }\n\n /* ONLY A FETCH MAY SATISFY A TAG, and a tag landing IS a change a reader can\n observe: a key gated on `needs:\"card\"` flips from `unknown` to `present`\n the moment the tag arrives, even when no field value moved. */\n if (ctx.options.source === \"fetch\" && ctx.options.tag !== undefined && !record.tags.has(ctx.options.tag)) {\n record.tags.add(ctx.options.tag);\n changed = true;\n }\n\n if (applyStaleness(key, type, record, ctx.options.source, new Set(Object.keys(fields)))) changed = true;\n if (ctx.options.source === \"fetch\" && clearKeptLayers(record, new Set(Object.keys(fields)))) {\n changed = true;\n markLayersChanged(record);\n }\n\n if (incomingTimestamp !== undefined && (record.timestamp === undefined || incomingTimestamp > record.timestamp)) {\n record.timestamp = incomingTimestamp;\n }\n\n /* AN ACCEPTED WRITE NOTIFIES ONLY IF SOMETHING A READER CAN OBSERVE CHANGED.\n The backend's dedup lock prevents duplicate SENDS, not duplicate\n DELIVERIES. Without this check an identical redelivered payload bumps the\n version, invalidates every hydration memo that touched the key, and\n re-renders every subscriber — work proportional to the mounted tree, for\n nothing. */\n if (!changed) return \"unchanged\";\n\n record.baseVersion += 1;\n bump(key, record);\n return \"applied\";\n}\n\nfunction createRecord(key: string, type: string): StoredRecord {\n const created: StoredRecord = {\n type,\n data: {},\n hasBase: false,\n layers: [],\n version: 0,\n baseVersion: 0,\n timestamp: undefined,\n fieldVersions: {},\n deletedAt: undefined,\n tags: new Set(),\n stale: new Set(),\n };\n records.set(key, created);\n return created;\n}\n\n/* --- Optimistic layers ----------------------------------------------------- */\n\n/**\n * One optimistic write, held ON TOP of a record's base rather than merged into it.\n *\n * ==== WHY A LAYER AND NOT A WRITE ====\n *\n * The first optimistic writes built on this store merged the belief into the base with a\n * client-invented `__timestamp`, and each one then had to work around what that did:\n *\n * - the rollback had to be stamped NEWER than the belief, or the out-of-order guard dropped\n * it — and a same-millisecond apply-then-revert is not newer, so a local monotonic clock\n * was needed to get it through;\n * - once a client timestamp was stored, the SERVER's own later answer could lose to it, since\n * a browser clock and a database column are not the same clock;\n * - the rollback snapshot came from a read, which strips the envelope, so `__type` had to be\n * patched back in before the store would take it.\n *\n * A layer has none of those problems by construction. The base — the only thing the ordering\n * guard adjudicates — is never touched by the belief, so the belief can never outrank a server\n * answer and removing it is a removal, not a write that has to win anything.\n *\n * ==== ORDER ====\n *\n * Layers apply oldest first, so the newest belief about a field is the one a reader sees — a\n * set, clear, set, clear on one field shows the last clear the moment it is made, whatever\n * order the four answers come back in. Removing a layer from the middle leaves every later one\n * standing: undoing write 2 of 4 does not undo 3 and 4.\n */\nexport interface OptimisticLayer {\n /** Global and strictly increasing — also the issue order of the writes that made them. */\n readonly id: number;\n /** Data fields, stored as given — never normalized, so a patch cannot mint records. */\n fields: Record<string, unknown>;\n /**\n * When set, `fields` are KEYS OF THE MAP held in this one field (a record's `data_points`,\n * say), merged over whatever that map holds beneath — never a replacement of the whole field.\n * Two beliefs about two different keys of one map then stay independent: undoing one leaves the\n * other standing, and a read that rewrites the map underneath still shows through every key no\n * belief is about.\n */\n readonly at: string | undefined;\n /** An ISO time when this layer is a delete. */\n readonly tombstone: string | undefined;\n /** True when this layer IS the record — an optimistic create with no server row yet. */\n readonly created: boolean;\n /**\n * True when the write's answer was refused as older than the held version (DXUI-78). The layer\n * is no longer a write in flight: it holds the value the screen keeps showing until a fetch that\n * carries the field lands. It never pins a record against `sweepRecords` and never reads as saving.\n */\n kept: boolean;\n}\n\nlet nextLayerId = 0;\n\n/**\n * Put an optimistic layer on top of `Type:id`, creating a base-less record for a create.\n *\n * Notification is QUEUED here, like every other store change; the optimistic-write primitive\n * flushes synchronously afterwards, because a user-initiated write must never wait on an\n * animation frame (a hidden page never gets one).\n *\n * @returns the layer id, for `removeOptimisticLayer` / `trimOptimisticLayers`\n */\nexport function pushOptimisticLayer(\n type: string,\n id: string | number,\n layer: { fields?: Record<string, unknown>; at?: string; tombstone?: string; created?: boolean; kept?: boolean },\n): number {\n const key = recordKey(type, id);\n const record = records.get(key) ?? createRecord(key, normalizeTypeName(type));\n nextLayerId += 1;\n record.layers.push({\n id: nextLayerId,\n fields: { ...(layer.fields ?? {}) },\n at: layer.at,\n tombstone: layer.tombstone,\n created: layer.created === true,\n kept: layer.kept === true,\n });\n markLayersChanged(record);\n bump(key, record);\n return nextLayerId;\n}\n\n/**\n * A write's answer was refused as older than the held version, so the base cannot take it — but the\n * screen must not fall back to the value from before the write (DXUI-78, DEC-285). The layer stays,\n * becomes `kept`, and each field the answer carries replaces the client's guess (a server-set value\n * such as `signed_off_at`). For an `at` layer the keys come from the answer's map field. Values are\n * stored normalized (a nested record as `{__ref}`), the shape `write()` stores.\n *\n * @returns the layer's values now, which is what a later, older write's settling restores, or\n * `undefined` when it holds no field to keep: the layer is then the caller's to remove\n */\nexport function keepOptimisticLayer(\n key: string,\n layerId: number,\n answer: RecordPayload,\n tenant: string | number | undefined,\n): Record<string, unknown> | undefined {\n const record = records.get(key);\n const layer = record?.layers.find((each) => each.id === layerId);\n if (!record || !layer || Object.keys(layer.fields).length === 0) return undefined;\n const ctx = answerContext(answer, key, tenant);\n const carried = layer.at === undefined ? answer : answer[layer.at];\n if (typeof carried === \"object\" && carried !== null && !Array.isArray(carried)) {\n const source = carried as Record<string, unknown>;\n for (const field of Object.keys(layer.fields)) {\n if (field in source) layer.fields[field] = normalizeValue(source[field], ctx);\n }\n }\n layer.kept = true;\n markLayersChanged(record);\n bump(key, record);\n return { ...layer.fields };\n}\n\n/**\n * A rev-ordered write's answer, at `version`, was refused as older (DXUI-96): the layer gives up\n * every field the base holds at or above that version, as what the base holds there is the truth.\n * A field nothing newer carried stays for `keepOptimisticLayer`: the base never took the write's\n * value. For an `at` layer the map is the field.\n */\nexport function trimSupersededFields(key: string, layerId: number, version: number): void {\n const record = records.get(key);\n const layer = record?.layers.find((each) => each.id === layerId);\n if (!record || !layer) return;\n for (const field of Object.keys(layer.fields)) {\n if ((record.fieldVersions[layer.at ?? field] ?? 0) >= version) delete layer.fields[field];\n }\n}\n\n/**\n * A create's answer was refused as older than the real row already held: the row must not show\n * empty. A kept layer on the real key holds the answer's data fields the row lacks, never one it\n * holds, which may be newer than the answer (DXUI-78, DEC-285).\n */\nexport function pushKeptAnswerLayer(\n key: string,\n type: string,\n id: string | number,\n answer: RecordPayload,\n tenant: string | number | undefined,\n): void {\n const held = records.get(key)?.data ?? {};\n const fields: Record<string, unknown> = {};\n for (const [field, value] of Object.entries(normalizeFields(answer, answerContext(answer, key, tenant)))) {\n if (!(field in held)) fields[field] = value;\n }\n if (Object.keys(fields).length === 0) return;\n pushOptimisticLayer(type, id, { fields, kept: true });\n}\n\nfunction answerContext(answer: RecordPayload, key: string, tenant: string | number | undefined): WriteContext {\n return {\n options: { source: \"fetch\", tenant },\n touched: new Set(),\n refusedNested: [],\n inFlight: new Map<object, string>([[answer as object, key]]),\n };\n}\n\n/**\n * An accepted fetch that carries a field settles it: it is at or above the held version, which is\n * above the dropped answer's, so it already includes the write. Drop that field from every kept\n * layer (for an `at` layer, the map field empties it), and a layer left empty goes.\n */\nfunction clearKeptLayers(record: StoredRecord, carried: ReadonlySet<string>): boolean {\n let changed = false;\n for (const layer of record.layers) {\n if (!layer.kept) continue;\n if (layer.at !== undefined) {\n if (carried.has(layer.at)) {\n layer.fields = {};\n changed = true;\n }\n continue;\n }\n for (const field of carried) {\n if (field in layer.fields) {\n delete layer.fields[field];\n changed = true;\n }\n }\n }\n const remaining = record.layers.filter((layer) => !(layer.kept && Object.keys(layer.fields).length === 0));\n if (remaining.length !== record.layers.length) {\n record.layers = remaining;\n changed = true;\n }\n return changed;\n}\n\n/**\n * Take one layer off. A record that only ever existed as an optimistic create disappears with\n * its last layer — it reads `unknown` again, exactly as before the create.\n */\nexport function removeOptimisticLayer(key: string, layerId: number): void {\n const record = records.get(key);\n if (!record) return;\n const index = record.layers.findIndex((layer) => layer.id === layerId);\n if (index === -1) return;\n record.layers.splice(index, 1);\n markLayersChanged(record);\n\n if (!record.hasBase && record.layers.length === 0) {\n records.delete(key);\n memo.delete(key);\n stateMemo.delete(key);\n globalVersion += 1;\n markDirty(key);\n return;\n }\n bump(key, record);\n}\n\n/**\n * A later write's answer has landed: every OLDER layer's belief about the same fields is\n * superseded, whether or not that older request has answered yet. A layer left with nothing to\n * say is dropped. Without this, a set whose answer is still out would keep overlaying a field\n * the server has already confirmed was cleared after it.\n *\n * `at` scopes the trim to beliefs about keys of that one map field — the same granularity the\n * committing write had.\n */\nexport function trimOptimisticLayers(\n key: string,\n beforeLayerId: number,\n fields: readonly string[],\n at?: string,\n): void {\n const record = records.get(key);\n if (!record || fields.length === 0) return;\n let changed = false;\n for (const layer of record.layers) {\n if (layer.id >= beforeLayerId || layer.created || layer.tombstone !== undefined || layer.at !== at) continue;\n for (const field of fields) {\n if (field in layer.fields) {\n delete layer.fields[field];\n changed = true;\n }\n }\n }\n const kept = record.layers.filter(\n (layer) => layer.id >= beforeLayerId || layer.created || layer.tombstone !== undefined || Object.keys(layer.fields).length > 0,\n );\n if (kept.length !== record.layers.length) record.layers = kept;\n if (changed) {\n markLayersChanged(record);\n bump(key, record);\n }\n}\n\n/**\n * Whether the BASE is tombstoned — what a list slot prunes on. An optimistic delete hides the\n * row from every read but must not cost the slot its key, or a rollback would bring the record\n * back with no list left holding it.\n */\nexport function isBaseTombstoned(key: string): boolean {\n return records.get(key)?.deletedAt !== undefined;\n}\n\n/**\n * One field of the BASE, as stored (normalized: a nested record is a `{__ref}`). What a keyed\n * belief is folded into when its write succeeds without an answer to replace it — writing it back\n * through `write()` round-trips the refs untouched.\n */\nexport function readBaseField(key: string, field: string): unknown {\n return records.get(key)?.data[field];\n}\n\n/**\n * DXUI-83: a counter that moves only when a write changes the BASE of `key` (0 for a key the store does not hold). A layer going moves\n * `record.version`, not this, so a commit (the base is written, then the layer removed) and a refusal (the layer is only removed) differ.\n */\nexport function readBaseVersion(key: string): number {\n return records.get(key)?.baseVersion ?? 0;\n}\n\n/** DXUI-83: does `key` carry a `kept` layer, a save that succeeded but whose answer was older than the held version (DXUI-78)? */\nexport function hasKeptLayer(key: string): boolean {\n return records.get(key)?.layers.some((layer) => layer.kept) ?? false;\n}\n\n/**\n * DXUI-83: what `key` reads as WITHOUT the writes in flight: the base, with `kept` layers on it (they are the value on screen). `no-base` is an\n * optimistic create with no server row yet; `unknown` is a base no fetch has satisfied `needs` for. Hydrated fresh each call, never memoized: a\n * window asks it only for a layered record that no page holds.\n */\nexport function readBaseState(key: string, needs: string): { status: \"present\"; record: unknown } | { status: \"no-base\" | \"deleted\" | \"unknown\" } {\n const record = records.get(key);\n if (!record || !record.hasBase) return { status: \"no-base\" };\n if (record.deletedAt !== undefined) return { status: \"deleted\" };\n if (!record.tags.has(needs)) return { status: \"unknown\" };\n const deps = new Map<string, number>();\n return { status: \"present\", record: foldRecord(key, record, deps, new Map(), (layer) => layer.kept === true) };\n}\n\n/** Does `key` carry a write in flight right now? A kept layer (DXUI-78) is not one. */\nexport function hasOptimisticLayers(key: string): boolean {\n return records.get(key)?.layers.some((layer) => !layer.kept) ?? false;\n}\n\n/**\n * DXUI-77: the keys of `type` that carry at least one layer that is not `kept` - a write in flight, an optimistic create included. Read-only;\n * a window that must find a record it does not hold (a card moved INTO it) asks here, because the store has no other way to list records by\n * type.\n */\nexport function layeredKeys(type: string): readonly string[] {\n const normalized = normalizeTypeName(type);\n const keys: string[] = [];\n for (const [key, record] of records) {\n if (record.type === normalized && record.layers.some((layer) => !layer.kept)) keys.push(key);\n }\n return keys;\n}\n\n/**\n * DXUI-77: hear that a layer changed on a record of `type`: pushed, kept, trimmed, removed, or cleared by the fetch that settled it (a layer that\n * IS the record, `created`, included). Delivered with the store's other notifications, once per flush however many layers moved; the listener\n * asks `layeredKeys` what is layered now. Nothing is stored beyond the listener.\n *\n * @returns unsubscribe\n */\nexport function subscribeToLayers(type: string, listener: () => void): () => void {\n const normalized = normalizeTypeName(type);\n let set = layerListeners.get(normalized);\n if (!set) {\n set = new Set();\n layerListeners.set(normalized, set);\n }\n set.add(listener);\n return () => {\n const current = layerListeners.get(normalized);\n if (!current) return;\n current.delete(listener);\n if (current.size === 0) layerListeners.delete(normalized);\n };\n}\n\nfunction markLayersChanged(record: StoredRecord): void {\n if (!layerListeners.has(record.type)) return;\n pendingLayerTypes.add(record.type);\n armFlush();\n}\n\nfunction effectiveDeletedAt(record: StoredRecord): string | undefined {\n for (let index = record.layers.length - 1; index >= 0; index -= 1) {\n const tombstone = record.layers[index].tombstone;\n if (tombstone !== undefined) return tombstone;\n }\n return record.deletedAt;\n}\n\nfunction isOptimisticCreate(record: StoredRecord): boolean {\n return record.layers.some((layer) => layer.created);\n}\n\nfunction bump(key: string, record: StoredRecord): void {\n record.version += 1;\n globalVersion += 1;\n markDirty(key);\n}\n\n/**\n * ONLY A BROADCAST MARKS A FIELD STALE. A FETCH CLEARS, and clearing is\n * UNCONDITIONAL — including when the refetched value is identical to what was\n * already there, which is what makes the refetch loop terminate by\n * construction rather than by luck.\n *\n * The clear is SCOPED TO THE FIELDS THE FETCH ACTUALLY CARRIED, never\n * unconditional across the record. Otherwise a card-fields refetch clears\n * staleness on a field it never requested and the reader is told something is\n * fresh that was never fetched. Nothing exercises that guard today — the field\n * sets in the app that motivated this all happen to carry both stale fields —\n * which is exactly why it is written down: a guard nothing exercises is the one\n * a later field-set change removes without anyone noticing.\n *\n * @returns whether the stale set changed, which counts as a change for\n * notification purposes. Without that, an invalidation-only payload — whose\n * whole point is that it changes no VALUE — would notify nobody, and the\n * invalidation would never be delivered.\n */\nfunction applyStaleness(\n key: string,\n type: string,\n record: StoredRecord,\n source: WriteOptions[\"source\"],\n present: Set<string>,\n): boolean {\n let changed = false;\n\n if (source === \"fetch\") {\n for (const field of present) {\n if (record.stale.delete(field)) changed = true;\n }\n return changed;\n }\n\n /* THE EVENT IS A SIGNAL OF ITS OWN (DXUI-78, DEC-284). A field already stale cannot change the\n stale set, and a record holding nothing has no field to add, so without this an event that\n lands during a read says nothing and the read never runs again. It changes no value, so it\n bumps nothing: it only arms a flush that reaches the staleness listeners. */\n const declared = staleFieldsFor(type);\n /* DXUI-88: a type's events may carry fields (no `staleFields`), so no re-read would follow an event that reaches a kept layer, and\n the kept value would outrank every later event (DEC-285). An event carrying a field a kept layer holds signals whatever the type\n declares; the read it starts clears the layer. */\n if (declared === \"*\" || declared.length > 0 || carriesKeptField(record, present)) {\n staleEvents.add(key);\n armFlush();\n }\n\n for (const field of resolveStaleFields(type, record, present)) {\n if (!record.stale.has(field)) {\n record.stale.add(field);\n changed = true;\n }\n }\n return changed;\n}\n\nfunction carriesKeptField(record: StoredRecord, present: ReadonlySet<string>): boolean {\n return record.layers.some(\n (layer) => layer.kept && (layer.at !== undefined ? present.has(layer.at) : Object.keys(layer.fields).some((field) => present.has(field))),\n );\n}\n\n/**\n * `\"*\"` — \"every data field\" — resolves against the keys the record ACTUALLY\n * HOLDS, minus its identity and minus whatever this payload carried.\n *\n * The alternative reading, a wildcard sentinel in the stale set, was rejected\n * because clearing it would be undefined: a fetch clears the fields it carried,\n * and \"the fields it carried\" cannot be subtracted from a wildcard. The cost of\n * this reading is that a record that exists ONLY because a broadcast created it\n * has nothing to mark stale — correct, if unobvious: there is no known value\n * for a reader to distrust, and such a record reports `unknown` for any `needs`\n * tag anyway, so the read binding fetches it rather than refetching it.\n */\nfunction resolveStaleFields(type: string, record: StoredRecord, present: Set<string>): string[] {\n const declared = staleFieldsFor(type);\n if (declared === \"*\") {\n return Object.keys(record.data).filter((field) => field !== \"id\" && !present.has(field));\n }\n return declared.filter((field) => !present.has(field));\n}\n\n/* --- Normalization -------------------------------------------------------- */\n\n/**\n * The payload's DATA fields, with every nested record extracted into its own\n * key and replaced by a ref.\n *\n * A nested child MAY OR MAY NOT carry `__type`. One without it — or without an\n * `id` — is DATA, not a record: it stays inline. Trying to store it would\n * invent an identity the wire format never gave it.\n *\n * Every object and array is rebuilt rather than referenced, so the store never\n * aliases or mutates the caller's payload. The prior art mutates the incoming\n * object in place, which makes a payload unsafe to reuse after handing it over.\n */\nfunction normalizeFields(payload: RecordPayload, ctx: WriteContext): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [field, value] of Object.entries(payload)) {\n if (isEnvelopeKey(field)) continue;\n out[field] = normalizeValue(value, ctx);\n }\n return out;\n}\n\nfunction normalizeValue(value: unknown, ctx: WriteContext): unknown {\n return refValue(value, (nested, identity) => {\n const inFlight = ctx.inFlight.get(nested as object);\n if (inFlight !== undefined) return inFlight;\n if (applyOne(nested, identity, ctx) === \"dropped-older\") ctx.refusedNested.push(identity.key);\n return identity.key;\n });\n}\n\n/**\n * `value` in the shape `normalizeValue` stores it — a nested record as `{__ref: key}` — without\n * writing anything, so a raw answer can be compared with what the base holds (DXUI-89).\n */\nexport function storedShape(value: unknown): unknown {\n return refValue(value, (_nested, identity) => identity.key);\n}\n\n/**\n * The one walk from a payload value to its stored shape: arrays and plain objects recurse, a nested\n * record (not a stale ping) becomes `{__ref: keyOf(...)}`. `keyOf` decides what reaching a record\n * costs — `normalizeValue` writes it, `storedShape` writes nothing.\n */\nfunction refValue(\n value: unknown,\n keyOf: (nested: RecordPayload, identity: NonNullable<ReturnType<typeof payloadIdentity>>) => string,\n): unknown {\n if (Array.isArray(value)) return value.map((element) => refValue(element, keyOf));\n\n if (isPlainObject(value)) {\n const nested = value as RecordPayload;\n if (!isStalePing(nested)) {\n const identity = payloadIdentity(nested);\n if (identity) return { __ref: keyOf(nested, identity) };\n }\n const out: Record<string, unknown> = {};\n for (const [key, nestedValue] of Object.entries(value)) out[key] = refValue(nestedValue, keyOf);\n return out;\n }\n\n return value;\n}\n\n/* --- Hydration ------------------------------------------------------------ */\n\n/**\n * Build the usable object for one key, memoized.\n *\n * ONE SLOT PER KEY, NEVER PER CALLER. Two components hydrating the same key get\n * the same walk and the same object — which is what makes the reference stable\n * across consumers and what lets a multi-key read share work with a single-key\n * one.\n *\n * The memo is valid when `atGlobal` matches (nothing anywhere changed), or when\n * every dep's version still matches (nothing THIS key can see changed). The\n * second case refreshes `atGlobal` and returns the SAME reference, because\n * `getSnapshot` must return the identical object when nothing changed or React\n * throws and loops.\n */\nfunction hydrate(key: string): unknown {\n const entry = memo.get(key);\n if (entry) {\n if (entry.atGlobal === globalVersion) return entry.value;\n if (depsUnchanged(entry.deps)) {\n entry.atGlobal = globalVersion;\n return entry.value;\n }\n }\n\n const deps = new Map<string, number>();\n const seen = new Map<string, unknown>();\n const value = hydrateKey(key, deps, seen);\n memo.set(key, { value, deps, atGlobal: globalVersion });\n return value;\n}\n\nfunction depsUnchanged(deps: Map<string, number>): boolean {\n for (const [key, version] of deps) {\n const record = records.get(key);\n if ((record ? record.version : MISSING_VERSION) !== version) return false;\n }\n return true;\n}\n\nfunction hydrateKey(key: string, deps: Map<string, number>, seen: Map<string, unknown>): unknown {\n if (seen.has(key)) return seen.get(key);\n\n const record = records.get(key);\n deps.set(key, record ? record.version : MISSING_VERSION);\n\n /* A ref can point at a record that has not arrived YET as well as one that\n has gone. Both render as ABSENT, and both recorded a dep above, so both\n re-render this key's readers the moment the situation changes. */\n if (!record || effectiveDeletedAt(record) !== undefined) {\n seen.set(key, undefined);\n return undefined;\n }\n\n return foldRecord(key, record, deps, seen, () => true);\n}\n\n/**\n * One record as its hydrated object: `__type` first, the base fields, then the layers `includeLayer` admits, oldest first. The one fold both a\n * record's value on screen (every layer) and its base (`kept` layers only, DXUI-83) go through.\n */\nfunction foldRecord(\n key: string,\n record: StoredRecord,\n deps: Map<string, number>,\n seen: Map<string, unknown>,\n includeLayer: (layer: OptimisticLayer) => boolean,\n): Record<string, unknown> {\n /* `__type` FIRST, and always. A hydrated record is a record, so it carries its identity: a\n caller can hand it straight back to `write()`, and a screen can tell two rows of different\n types apart, without patching the envelope back in. It is the NORMALIZED name — the one the\n store keys on — never the wire's `…Resource` spelling. */\n const out: Record<string, unknown> = { __type: record.type };\n /* INSERT BEFORE FILLING. The other order is an infinite loop on the first\n cyclic record — a parent referencing a child that references the parent. */\n seen.set(key, out);\n for (const [field, value] of Object.entries(record.data)) out[field] = hydrateValue(value, deps, seen);\n /* Optimistic layers last, oldest first, so the newest belief about a field wins. */\n for (const layer of record.layers) {\n if (!includeLayer(layer)) continue;\n if (layer.at === undefined) {\n for (const [field, value] of Object.entries(layer.fields)) out[field] = hydrateValue(value, deps, seen);\n continue;\n }\n const beneath = out[layer.at];\n const map: Record<string, unknown> = isPlainObject(beneath) ? { ...beneath } : {};\n for (const [field, value] of Object.entries(layer.fields)) map[field] = hydrateValue(value, deps, seen);\n out[layer.at] = map;\n }\n return out;\n}\n\nfunction hydrateValue(value: unknown, deps: Map<string, number>, seen: Map<string, unknown>): unknown {\n if (isRecordRef(value)) return hydrateKey(value.__ref, deps, seen);\n\n if (Array.isArray(value)) {\n const out: unknown[] = [];\n for (const element of value) {\n if (isRecordRef(element)) {\n /* A tombstoned or not-yet-arrived member is DROPPED from the array\n rather than left as an `undefined` hole. A tombstone removes the row\n everywhere, immediately — that is mechanically what it means — and a\n consumer mapping over a relation must never have to test each member\n for existence. */\n const hydrated = hydrateKey(element.__ref, deps, seen);\n if (hydrated !== undefined) out.push(hydrated);\n continue;\n }\n out.push(hydrateValue(element, deps, seen));\n }\n return out;\n }\n\n if (isPlainObject(value)) {\n const out: Record<string, unknown> = {};\n for (const [key, nested] of Object.entries(value)) out[key] = hydrateValue(nested, deps, seen);\n return out;\n }\n\n return value;\n}\n\n/* --- Reading -------------------------------------------------------------- */\n\n/**\n * The `unknown` state, as ONE module-level frozen constant.\n *\n * `getServerSnapshot` returns this. A fresh literal there throws under the only\n * condition it exists for.\n */\nexport const UNKNOWN_STATE: RecordState<never> = Object.freeze({ status: \"unknown\" as const });\n\nexport function getUnknownState(): RecordState<never> {\n return UNKNOWN_STATE;\n}\n\n/**\n * What a reader is told about one key, gated on the field set it declared it\n * needs.\n *\n * The gate is what stops a record seeded ONLY by a broadcast from reaching a\n * projection function that assumes absent means empty — which renders a\n * confident \"0 documents\" for a record with hundreds.\n */\nexport function readState(key: string, needs: string): RecordState<unknown> {\n const state = readRecordState(key);\n if (state.status !== \"present\") return state;\n const record = records.get(key);\n /* An optimistic create satisfies every tag: it is the complete record the caller means to\n create, and gating it would hide it from the very list it was created in. */\n return record && (record.tags.has(needs) || isOptimisticCreate(record)) ? state : UNKNOWN_STATE;\n}\n\nfunction readRecordState(key: string): RecordState<unknown> {\n const record = records.get(key);\n if (!record) {\n stateMemo.delete(key);\n return UNKNOWN_STATE;\n }\n\n const cached = stateMemo.get(key);\n\n const deletedAt = effectiveDeletedAt(record);\n if (deletedAt !== undefined) {\n if (cached && cached.status === \"deleted\" && cached.at === deletedAt) return cached;\n const next: RecordState<unknown> = Object.freeze({ status: \"deleted\" as const, at: deletedAt });\n stateMemo.set(key, next);\n return next;\n }\n\n const hydrated = hydrate(key);\n /* Both halves are needed. `version` alone misses a CHILD changing, which\n leaves this record's own version untouched while its hydrated tree is a new\n object; `record` identity alone misses a stale-set or tag change, which\n produces a new snapshot the hydration walk cannot see. */\n if (cached && cached.status === \"present\" && cached.record === hydrated && cached.version === record.version) {\n return cached;\n }\n\n const next: RecordState<unknown> = Object.freeze({\n status: \"present\" as const,\n record: hydrated,\n version: record.version,\n stale: Object.freeze([...record.stale].sort()),\n });\n stateMemo.set(key, next);\n return next;\n}\n\n/** Non-reactive read, for callers outside a component. */\nexport function peekRecord(type: string, id: string | number, needs: string): RecordState<unknown> {\n return readState(recordKey(type, id), needs);\n}\n\n/* --- Notification --------------------------------------------------------- */\n\nlet pendingDirty = new Set<string>();\n/** Keys a non-fetch write reached since the last `takeStaleEvents()`. See `applyStaleness`. */\nconst staleEvents = new Set<string>();\nconst NO_STALE_EVENTS: ReadonlySet<string> = new Set();\nlet scheduled: ReturnType<typeof setTimeout> | number | null = null;\n\nconst hasAnimationFrame = typeof requestAnimationFrame === \"function\";\nconst hasDocument = typeof document !== \"undefined\";\n\n/**\n * `requestAnimationFrame` NEVER FIRES FOR A HIDDEN DOCUMENT — not throttled,\n * not delayed, simply never called, for as long as the tab stays backgrounded.\n * `markDirty` scheduled every flush through it unconditionally, so a write\n * that landed while the reader had switched tabs (an extraction's own toast\n * being the reproducing case: a broadcast merges a fresh `active_workers_count`\n * into the store, `pendingDirty` gets the key, `schedule()` calls `rAF`, and\n * that callback is queued but never runs) sat in `pendingDirty` and never\n * reached a single listener — not \"eventually, once the frame comes due,\" but\n * NEVER, because a hidden document schedules no frames at all. The store kept\n * accepting and merging every subsequent broadcast the entire time; nothing\n * was lost, it just never got announced. The tab looked frozen at whatever it\n * last flushed, and only a hard reload (a fresh fetch, bypassing this\n * pipeline entirely) ever showed the current value again — confirmed directly\n * in this environment: `requestAnimationFrame` did not fire within 4s of a\n * `document.hidden === true` page, and reproducing a live extraction's toast\n * with the pane backgrounded showed exactly this — the store's own polled\n * `active_workers_count` moved repeatedly server-side while the mounted\n * reader stayed on its first value the whole time it was hidden.\n *\n * The fix is visibility-aware scheduling, not abandoning `rAF`: a visible tab\n * keeps getting per-frame coalescing (the reason `rAF` was chosen — batching\n * a page-by-page transcode burst into one notification), and a hidden one\n * falls back to a macrotask that fires unconditionally. The one gap that\n * leaves is a flush ALREADY queued via `rAF` at the moment the tab goes\n * hidden — that queued callback still never runs — so `armVisibilityRecovery`\n * below listens for the hidden transition and re-arms any such pending flush\n * through the macrotask path instead of leaving it stranded.\n */\nfunction isHidden(): boolean {\n return hasDocument && document.hidden;\n}\n\nfunction schedule(callback: () => void): ReturnType<typeof setTimeout> | number {\n return hasAnimationFrame && !isHidden() ? requestAnimationFrame(callback) : setTimeout(callback, 0);\n}\n\n/**\n * Cancels through BOTH APIs rather than tracking which one scheduled the\n * handle. `cancelAnimationFrame` and `clearTimeout` each silently no-op on an\n * id from the other's numbering, in every real environment, so calling both\n * is always safe — and it is the only way to reliably cancel a handle whose\n * origin (`rAF` vs `setTimeout`) may have been decided by visibility at\n * schedule time and could differ from the environment's CURRENT visibility by\n * the time this runs.\n */\nfunction unschedule(handle: ReturnType<typeof setTimeout> | number): void {\n if (hasAnimationFrame) cancelAnimationFrame(handle as number);\n clearTimeout(handle as ReturnType<typeof setTimeout>);\n}\n\nfunction markDirty(key: string): void {\n pendingDirty.add(key);\n armFlush();\n}\n\nfunction armFlush(): void {\n if (scheduled !== null) return;\n scheduled = schedule(() => {\n scheduled = null;\n flushRecordNotifications();\n });\n}\n\n/**\n * The transition `schedule()` cannot see coming: a flush queued via `rAF`\n * while the tab was visible, followed by the tab going hidden BEFORE that\n * frame ever came due. That queued callback is now permanently stranded — a\n * hidden document schedules no more frames, so nothing will ever call it.\n * Re-arm it through the macrotask path the instant the tab goes hidden, so a\n * write that was already in flight when the reader looked away still reaches\n * its listeners instead of waiting for a reload.\n */\nfunction armVisibilityRecovery(): void {\n if (!hasDocument || !hasAnimationFrame) return;\n document.addEventListener(\"visibilitychange\", () => {\n if (!document.hidden || scheduled === null) return;\n unschedule(scheduled);\n scheduled = setTimeout(() => {\n scheduled = null;\n flushRecordNotifications();\n }, 0);\n });\n}\narmVisibilityRecovery();\n\n/**\n * NOTIFICATION IS COALESCED PER ANIMATION FRAME, and that is a requirement.\n *\n * A document transcoding page by page broadcasts once per row. Un-coalesced,\n * every one of those is a separate notification, a separate dep scan per\n * subscriber and a separate render pass. Coalescing collapses a burst into a\n * handful.\n *\n * Exported so a caller that must observe the effect of a write synchronously —\n * a test, or a measurement taken immediately after a write — can flush rather\n * than wait for a frame. The optimistic write (`reads/optimistic.ts`) flushes\n * after every step: a reader's own action is one change, not a burst, and it\n * must reach the screen in the same tick even on a page that gets no frames.\n */\nexport function flushRecordNotifications(): void {\n if (scheduled !== null) {\n unschedule(scheduled);\n scheduled = null;\n }\n if (pendingDirty.size === 0 && staleEvents.size === 0 && pendingLayerTypes.size === 0) return;\n\n const dirty = pendingDirty;\n pendingDirty = new Set();\n const layerTypes = pendingLayerTypes;\n pendingLayerTypes = new Set();\n\n /* PER-KEY NOTIFICATION IS THE ENTIRE POINT, so an unrelated record changing\n must reach nobody. A change to a NESTED key still has to reach the readers\n that hydrated THROUGH it, and the hydration memo's deps map is exactly that\n lookup — rebuilt by the same walk that reads it, so unlike a maintained\n reverse index there is no separate step to get wrong. */\n const affected = new Set(dirty);\n for (const [rootKey, entry] of memo) {\n if (affected.has(rootKey)) continue;\n for (const key of dirty) {\n if (entry.deps.has(key)) {\n affected.add(rootKey);\n break;\n }\n }\n }\n\n for (const key of affected) {\n const set = listeners.get(key);\n if (!set) continue;\n for (const listener of [...set]) listener();\n }\n for (const listener of [...stalenessListeners]) listener();\n for (const type of layerTypes) for (const listener of [...(layerListeners.get(type) ?? [])]) listener();\n}\n\nfunction notifyAll(): void {\n for (const set of [...listeners.values()]) {\n for (const listener of [...set]) listener();\n }\n for (const listener of [...stalenessListeners]) listener();\n /* DXUI-77: a clear takes every layer with it. */\n for (const set of [...layerListeners.values()]) for (const listener of [...set]) listener();\n}\n\nexport function subscribeToKey(key: string, listener: () => void): () => void {\n let set = listeners.get(key);\n if (!set) {\n set = new Set();\n listeners.set(key, set);\n }\n set.add(listener);\n return () => {\n const current = listeners.get(key);\n if (!current) return;\n current.delete(listener);\n if (current.size === 0) listeners.delete(key);\n };\n}\n\nexport function subscribeToStaleness(listener: () => void): () => void {\n stalenessListeners.add(listener);\n return () => stalenessListeners.delete(listener);\n}\n\n/* --- The staleness signal ------------------------------------------------- */\n\nconst NO_STALENESS: readonly StalenessEntry[] = Object.freeze([]);\nlet stalenessSnapshot: readonly StalenessEntry[] = NO_STALENESS;\n\n/**\n * Affected ROOTS and their now-stale field sets.\n *\n * The signal names ROOTS rather than the key that went stale, because the key\n * that goes stale is often a nested one — a run under a demand — and a list of\n * demands can never match a run's key. Roots come from the hydration memo's\n * deps map, so a root is by definition something a mounted read or a list slot\n * is already holding.\n *\n * The library names no type it understands and no endpoint: the layer that\n * performed the original fetch re-issues it, because it is the only layer that\n * knows which field set it asked for.\n */\nexport function readStaleness(): readonly StalenessEntry[] {\n const next = computeStaleness();\n if (sameStaleness(stalenessSnapshot, next)) return stalenessSnapshot;\n stalenessSnapshot = Object.freeze(next);\n return stalenessSnapshot;\n}\n\n/**\n * The roots reached by a stale event since the last call (each key itself, plus every memo root\n * whose deps hold it), and the set emptied. A read holding one of them must run again even when\n * the staleness snapshot did not move: an event during a read is otherwise lost (DXUI-78, DEC-284).\n */\nexport function takeStaleEvents(): ReadonlySet<string> {\n if (staleEvents.size === 0) return NO_STALE_EVENTS;\n const roots = new Set(staleEvents);\n for (const [rootKey, entry] of memo) {\n if (roots.has(rootKey)) continue;\n for (const key of staleEvents) {\n if (entry.deps.has(key)) {\n roots.add(rootKey);\n break;\n }\n }\n }\n staleEvents.clear();\n return roots;\n}\n\nexport function getEmptyStaleness(): readonly StalenessEntry[] {\n return NO_STALENESS;\n}\n\nfunction computeStaleness(): StalenessEntry[] {\n const byRoot = new Map<string, Set<string>>();\n\n for (const [key, record] of records) {\n if (record.stale.size === 0) continue;\n for (const [rootKey, entry] of memo) {\n if (!entry.deps.has(key)) continue;\n let fields = byRoot.get(rootKey);\n if (!fields) {\n fields = new Set();\n byRoot.set(rootKey, fields);\n }\n for (const field of record.stale) fields.add(field);\n }\n }\n\n return [...byRoot]\n .map(([key, fields]) => ({ key, fields: Object.freeze([...fields].sort()) }))\n .sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));\n}\n\nfunction sameStaleness(a: readonly StalenessEntry[], b: readonly StalenessEntry[]): boolean {\n if (a.length !== b.length) return false;\n return a.every((entry, index) => {\n const other = b[index];\n return (\n entry.key === other.key &&\n entry.fields.length === other.fields.length &&\n entry.fields.every((field, i) => field === other.fields[i])\n );\n });\n}\n\n/* --- Retention and eviction ----------------------------------------------- */\n\n/**\n * Pin keys as ROOTS for the duration of the returned release.\n *\n * A key is retained if it is REACHABLE from a root, never if it is itself\n * pinned: a file is never independently subscribed — it is reached only by\n * hydrating its demand — so evicting by direct subscription would evict exactly\n * what hydration walks and leave dangling refs everywhere.\n *\n * Release is IDEMPOTENT and exactly paired with acquire, which is what makes\n * StrictMode's mount / unmount / mount survivable. A subscription whose\n * teardown is not idempotent tears down the one it just created — and it\n * misbehaves only in development, which is the worst place for that to live,\n * because that is where it is being debugged.\n */\nexport function retainKeys(keys: readonly string[]): () => void {\n for (const key of keys) roots.set(key, (roots.get(key) ?? 0) + 1);\n let released = false;\n return () => {\n if (released) return;\n released = true;\n for (const key of keys) {\n const next = (roots.get(key) ?? 0) - 1;\n if (next <= 0) roots.delete(key);\n else roots.set(key, next);\n }\n };\n}\n\n/**\n * Mark from the roots, then sweep everything unreachable.\n *\n * AN IDENTITY MAP THAT ONLY GROWS IS A LEAK, and the failure mode is a tab that\n * gets slower over an afternoon with nobody connecting it to this. Browsing ten\n * documents at 435 rows each is roughly 4,000 entries nothing releases.\n *\n * WHEN TO CALL IT IS THE CALLER'S DECISION, and it needs to be more than a\n * navigation boundary: a broadcast can CREATE a key no root reaches, and on a\n * screen nobody navigates away from — a long extraction, say — those accumulate\n * for as long as the tab is open. A navigation boundary AND a bounded schedule.\n * This module deliberately installs no timer of its own; a design-system module\n * that starts an interval on import is a worse defect than the leak.\n *\n * @returns how many keys were dropped\n */\nexport function sweepRecords(): number {\n const marked = new Set<string>();\n const queue: string[] = [...roots.keys()];\n /* A key with live listeners is a root even before its retain effect has run —\n between render and effect there is a window where the two disagree, and\n sweeping there would evict what is on screen right now. */\n for (const key of listeners.keys()) queue.push(key);\n /* A record carrying an optimistic layer has a write in flight, whose answer and whose\n rollback both need it still here. */\n for (const [key, record] of records) if (record.layers.some((layer) => !layer.kept)) queue.push(key);\n\n while (queue.length > 0) {\n const key = queue.pop() as string;\n if (marked.has(key)) continue;\n marked.add(key);\n const record = records.get(key);\n if (!record) continue;\n for (const value of Object.values(record.data)) collectRefs(value, queue);\n }\n\n let swept = 0;\n for (const key of [...records.keys()]) {\n if (marked.has(key)) continue;\n records.delete(key);\n memo.delete(key);\n stateMemo.delete(key);\n staleEvents.delete(key);\n swept += 1;\n }\n for (const key of [...memo.keys()]) {\n if (marked.has(key)) {\n continue;\n }\n memo.delete(key);\n stateMemo.delete(key);\n }\n return swept;\n}\n\nfunction collectRefs(value: unknown, out: string[]): void {\n if (isRecordRef(value)) {\n out.push(value.__ref);\n return;\n }\n if (Array.isArray(value)) {\n for (const element of value) collectRefs(element, out);\n return;\n }\n if (isPlainObject(value)) {\n for (const nested of Object.values(value)) collectRefs(nested, out);\n }\n}\n\n/* --- Test seam ------------------------------------------------------------ */\n\n/** Wipes everything, including listeners, roots and the tenant. */\nexport function resetRecordStore(): void {\n if (scheduled !== null) {\n unschedule(scheduled);\n scheduled = null;\n }\n records.clear();\n memo.clear();\n stateMemo.clear();\n listeners.clear();\n stalenessListeners.clear();\n layerListeners.clear();\n pendingLayerTypes = new Set();\n roots.clear();\n pendingDirty = new Set();\n staleEvents.clear();\n stalenessSnapshot = NO_STALENESS;\n globalVersion = 0;\n currentTenant = undefined;\n}\n\n/** What the store holds right now, for a devtools panel or a test. */\nexport function recordStoreStats(): { records: number; memos: number; roots: number; listeners: number } {\n return { records: records.size, memos: memo.size, roots: roots.size, listeners: listeners.size };\n}\n\n/* --- Small helpers -------------------------------------------------------- */\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n const proto = Object.getPrototypeOf(value) as unknown;\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * Structural equality, used to decide whether an accepted write actually\n * changed anything.\n *\n * IT HAS TO BE STRUCTURAL. Normalization rebuilds every object and array on\n * every write, so identity comparison would report \"changed\" for a byte-\n * identical redelivery — which is the notification storm the changed-check\n * exists to prevent. Depth is bounded because relations are refs, not trees.\n */\nfunction deepEquals(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n\n if (Array.isArray(a) || Array.isArray(b)) {\n if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;\n return a.every((element, index) => deepEquals(element, b[index]));\n }\n\n if (isPlainObject(a) && isPlainObject(b)) {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) return false;\n return aKeys.every((key) => key in b && deepEquals(a[key], b[key]));\n }\n\n return false;\n}\n"],"names":["MISSING_VERSION","records","memo","stateMemo","listeners","stalenessListeners","layerListeners","pendingLayerTypes","roots","globalVersion","currentTenant","setRecordStoreTenant","tenant","pendingDirty","notifyAll","listener","tenantListeners","subscribeToTenant","getRecordStoreTenant","recordStoreVersion","NO_KEYS","write","payload","options","isStalePing","identity","payloadIdentity","devWarn","ctx","verdict","applyOne","writeAll","payloads","results","keys","result","key","type","incomingTimestamp","normalizeTimestamp","existing","record","createRecord","fields","normalizeFields","carriedAt","changed","field","value","deepEquals","tombstone","tombstoneAt","explicitlyUndeleted","applyStaleness","clearKeptLayers","markLayersChanged","bump","created","nextLayerId","pushOptimisticLayer","id","layer","recordKey","normalizeTypeName","keepOptimisticLayer","layerId","answer","each","answerContext","carried","source","normalizeValue","trimSupersededFields","version","pushKeptAnswerLayer","held","remaining","removeOptimisticLayer","index","markDirty","trimOptimisticLayers","beforeLayerId","at","kept","isBaseTombstoned","readBaseField","readBaseVersion","hasKeptLayer","readBaseState","needs","foldRecord","layeredKeys","normalized","subscribeToLayers","set","current","armFlush","effectiveDeletedAt","isOptimisticCreate","present","declared","staleFieldsFor","carriesKeptField","staleEvents","resolveStaleFields","out","isEnvelopeKey","refValue","nested","inFlight","storedShape","_nested","keyOf","element","isPlainObject","nestedValue","hydrate","entry","depsUnchanged","deps","hydrateKey","seen","includeLayer","hydrateValue","beneath","map","isRecordRef","hydrated","UNKNOWN_STATE","getUnknownState","readState","state","readRecordState","cached","deletedAt","next","peekRecord","NO_STALE_EVENTS","scheduled","hasAnimationFrame","hasDocument","isHidden","schedule","callback","unschedule","handle","flushRecordNotifications","armVisibilityRecovery","dirty","layerTypes","affected","rootKey","subscribeToKey","subscribeToStaleness","NO_STALENESS","stalenessSnapshot","readStaleness","computeStaleness","sameStaleness","takeStaleEvents","getEmptyStaleness","byRoot","a","b","other","i","retainKeys","released","sweepRecords","marked","queue","collectRefs","swept","resetRecordStore","recordStoreStats","proto","aKeys","bKeys"],"mappings":";;;AAuHA,MAAMA,IAAkB,IAElBC,wBAAc,IAAA,GACdC,wBAA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,SAAS9H,EAAWiH,GAAYC,GAAqB;AACnD,MAAI,OAAO,GAAGD,GAAGC,CAAC,EAAG,QAAO;AAE5B,MAAI,MAAM,QAAQD,CAAC,KAAK,MAAM,QAAQC,CAAC;AACrC,WAAI,CAAC,MAAM,QAAQD,CAAC,KAAK,CAAC,MAAM,QAAQC,CAAC,KAAKD,EAAE,WAAWC,EAAE,SAAe,KACrED,EAAE,MAAM,CAACjD,GAASnC,MAAU7B,EAAWgE,GAASkD,EAAErF,CAAK,CAAC,CAAC;AAGlE,MAAIoC,EAAcgD,CAAC,KAAKhD,EAAciD,CAAC,GAAG;AACxC,UAAMa,IAAQ,OAAO,KAAKd,CAAC,GACrBe,IAAQ,OAAO,KAAKd,CAAC;AAC3B,WAAIa,EAAM,WAAWC,EAAM,SAAe,KACnCD,EAAM,MAAM,CAAC5I,MAAQA,KAAO+H,KAAKlH,EAAWiH,EAAE9H,CAAG,GAAG+H,EAAE/H,CAAG,CAAC,CAAC;AAAA,EACpE;AAEA,SAAO;AACT;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { devWarn as s } from "../dev-warn.js";
|
|
2
|
+
function c(e) {
|
|
3
|
+
return typeof e == "object" && e !== null && typeof e.__ref == "string";
|
|
4
|
+
}
|
|
5
|
+
const i = "Resource";
|
|
6
|
+
function u(e) {
|
|
7
|
+
return e.length > i.length && e.endsWith(i) ? e.slice(0, -i.length) : e;
|
|
8
|
+
}
|
|
9
|
+
function _(e, t) {
|
|
10
|
+
return `${u(e)}:${String(t)}`;
|
|
11
|
+
}
|
|
12
|
+
function p(e) {
|
|
13
|
+
const t = e.__type, n = e.id;
|
|
14
|
+
if (typeof t != "string" || t === "" || typeof n != "string" && typeof n != "number" || n === "") return;
|
|
15
|
+
const r = u(t), o = String(n);
|
|
16
|
+
return { key: `${r}:${o}`, type: r, id: o };
|
|
17
|
+
}
|
|
18
|
+
function m(e) {
|
|
19
|
+
return e.__stale === !0;
|
|
20
|
+
}
|
|
21
|
+
function g(e) {
|
|
22
|
+
const t = e.deleted_at ?? e.__deleted_at;
|
|
23
|
+
if (t != null)
|
|
24
|
+
return typeof t == "string" ? t : String(t);
|
|
25
|
+
}
|
|
26
|
+
function y(e) {
|
|
27
|
+
return e.__deleted_at === null || e.deleted_at === null;
|
|
28
|
+
}
|
|
29
|
+
const d = 1e11, l = 1e8;
|
|
30
|
+
function S(e) {
|
|
31
|
+
if (e == null) return;
|
|
32
|
+
let t = typeof e == "number" ? e : Number(e);
|
|
33
|
+
if (!Number.isFinite(t) && typeof e == "string" && (t = Date.parse(e)), !Number.isFinite(t) || t <= 0) {
|
|
34
|
+
s("recordStore", `ignoring an unreadable __timestamp: ${String(e)}`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (t >= d) return t;
|
|
38
|
+
if (t >= l) return t * 1e3;
|
|
39
|
+
s(
|
|
40
|
+
"recordStore",
|
|
41
|
+
`__timestamp ${String(e)} is implausible in seconds OR milliseconds — ordering is disabled for this write rather than guessed at`
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
function a(e) {
|
|
45
|
+
return e.startsWith("__") || e === "deleted_at";
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
y as explicitlyUndeleted,
|
|
49
|
+
a as isEnvelopeKey,
|
|
50
|
+
c as isRecordRef,
|
|
51
|
+
m as isStalePing,
|
|
52
|
+
S as normalizeTimestamp,
|
|
53
|
+
u as normalizeTypeName,
|
|
54
|
+
p as payloadIdentity,
|
|
55
|
+
_ as recordKey,
|
|
56
|
+
g as tombstoneAt
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=wire.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.js","sources":["../../../src/lib/records/wire.ts"],"sourcesContent":["import { devWarn } from \"../dev-warn\";\nimport type { RecordPayload } from \"./types\";\n\n/* ============================================================================\n THE PAYLOAD CONTRACT — five real wire shapes, and the two that break the\n obvious reading of it.\n\n The store requires `__type` and `id`. IT DOES NOT REQUIRE A TIMESTAMP: a\n delete payload carries none, so \"reject a payload with no timestamp\" would\n silently drop every tombstone and leave deleted rows on screen forever. A\n timestamp is required only to ADJUDICATE a conflicting write, never to\n accept one.\n\n THE FIVE SHAPES, and what this file does with each:\n\n 1. created / updated — id, __type, __timestamp, __deleted_at, plus the\n whitelisted fields. Full contract. ACCEPT.\n 2. deleted — {id, __type, deleted_at} and NOTHING else. No __timestamp, and\n the key is `deleted_at`, NOT `__deleted_at`. Recognised BY NAME as a\n tombstone, before anything else looks at it.\n 3. {__stale:true, id, __model} — no __type, no timestamp, and it arrives\n under the normal event name. DROPPED BY NAME and never keyed.\n 4. a nested child — may or may not carry __type. One without it is data, not\n a record: it stays inline (see `store.ts`).\n 5. an invalidation-only payload — identity and a timestamp and no useful\n fields. Accepted as a signal, never as data; the staleness machinery in\n `store.ts` is what turns it into something a reader can act on.\n ========================================================================= */\n\n/** A relation, once normalized: a pointer to another record's key. */\nexport interface RecordRef {\n readonly __ref: string;\n}\n\nexport function isRecordRef(value: unknown): value is RecordRef {\n return typeof value === \"object\" && value !== null && typeof (value as RecordRef).__ref === \"string\";\n}\n\n// I18N-ALLOW: a wire-format type-name suffix, not a word a person reads\nconst RESOURCE_SUFFIX = \"Resource\";\n\n/**\n * Strip a trailing `Resource` so a delete and the record it deletes land on\n * the same key.\n *\n * CREATED AND DELETED PAYLOADS DISAGREE ABOUT `__type`, verified in the\n * backend twice: created/updated take it from a resource class name that no\n * resource overrides, so it keeps the suffix (`\"WorkflowRunResource\"`), while\n * deletes take it from a helper that strips the suffix (`\"WorkflowRun\"`).\n *\n * A store keyed on the raw string files a delete under a different key than\n * the record it is deleting, so the tombstone never lands and the row stays on\n * screen forever. One line, and without it a whole class of update silently\n * does nothing.\n */\nexport function normalizeTypeName(raw: string): string {\n return raw.length > RESOURCE_SUFFIX.length && raw.endsWith(RESOURCE_SUFFIX)\n ? raw.slice(0, -RESOURCE_SUFFIX.length)\n : raw;\n}\n\n/**\n * `Type:id`, with the id COERCED TO A STRING.\n *\n * Ids are not uniformly numeric — a file's id is a UUID while a run's is an\n * integer — and a Map keyed on the raw value would file `7` and `\"7\"`\n * separately. There is deliberately NO `id || name` fallback: that is a quirk\n * of one prior implementation, not part of any contract, and a record keyed on\n * a name silently merges two different rows the day two of them share one.\n */\nexport function recordKey(type: string, id: string | number): string {\n return `${normalizeTypeName(type)}:${String(id)}`;\n}\n\n/** The identity a payload carries, or `undefined` if it is not a record. */\nexport interface PayloadIdentity {\n readonly key: string;\n readonly type: string;\n readonly id: string;\n}\n\nexport function payloadIdentity(payload: RecordPayload): PayloadIdentity | undefined {\n const rawType = payload.__type;\n const rawId = payload.id;\n if (typeof rawType !== \"string\" || rawType === \"\") return undefined;\n if (typeof rawId !== \"string\" && typeof rawId !== \"number\") return undefined;\n if (rawId === \"\") return undefined;\n const type = normalizeTypeName(rawType);\n const id = String(rawId);\n return { key: `${type}:${id}`, type, id };\n}\n\n/**\n * A `{__stale:true, id, __model}` ping: an invalidation the backend sends\n * under the normal event name with NO `__type` at all.\n *\n * Recognised by name and dropped, because keying it would need a type it does\n * not have — and guessing one from `__model` (a PHP class name) is exactly the\n * sort of inference that produces a store full of records nothing reads.\n */\nexport function isStalePing(payload: RecordPayload): boolean {\n return payload.__stale === true;\n}\n\n/**\n * The tombstone marker, or `undefined`.\n *\n * BOTH SPELLINGS, deliberately. A `deleted` event carries `deleted_at`; a\n * soft-delete arriving as an `updated` event carries `__deleted_at`. The prior\n * art in this codebase checks only the second, so its delete handling has never\n * run once — the payload says `deleted_at` and the store asks for\n * `__deleted_at`.\n */\nexport function tombstoneAt(payload: RecordPayload): string | undefined {\n const explicit = payload.deleted_at ?? payload.__deleted_at;\n if (explicit === null || explicit === undefined) return undefined;\n return typeof explicit === \"string\" ? explicit : String(explicit);\n}\n\n/**\n * True when the payload says, in so many words, that the record is NOT\n * deleted — which is what un-deletes a tombstoned record.\n *\n * Needed because absent keeps the previous value: without this, a record that\n * was tombstoned could never come back, even when the server says it has.\n */\nexport function explicitlyUndeleted(payload: RecordPayload): boolean {\n return payload.__deleted_at === null || payload.deleted_at === null;\n}\n\n/* MILLISECONDS SINCE EPOCH, roughly 1973 onwards. Every real millisecond\n timestamp this decade is ~1.7e12; every real SECONDS timestamp is ~1.7e9.\n The two windows are three orders of magnitude apart, so the split is not a\n heuristic that can drift. */\nconst MILLISECONDS_FLOOR = 1e11;\nconst SECONDS_FLOOR = 1e8;\n\n/**\n * Normalize `__timestamp` to milliseconds.\n *\n * IT ARRIVES IN TWO UNITS, 1000x APART, and this is verified rather than\n * theoretical: the backend reads the model's `updated_at` in MILLISECONDS when\n * the model has that column, and falls back to a SECONDS-resolution wall clock\n * when it does not. At least one real model has no `updated_at` column at all.\n *\n * A comparison across the two units is not merely wrong, it is CONSISTENTLY\n * wrong in one direction: a seconds value is ~1000x smaller, so it always\n * loses to a milliseconds value and such a record would never update again.\n *\n * An implausible magnitude — below either window — is a contract violation,\n * and it is surfaced rather than coerced. It returns `undefined`, which means\n * \"cannot adjudicate\": the write is still ACCEPTED (a bogus tiny number must\n * not be allowed to make a record permanently un-writable), it just cannot\n * refuse anything.\n */\nexport function normalizeTimestamp(raw: unknown): number | undefined {\n if (raw === null || raw === undefined) return undefined;\n\n let value = typeof raw === \"number\" ? raw : Number(raw);\n\n /* An ISO string is not part of the contract, but reading one as NaN would\n silently disable ordering for every record in a store fed them. */\n if (!Number.isFinite(value) && typeof raw === \"string\") value = Date.parse(raw);\n\n if (!Number.isFinite(value) || value <= 0) {\n devWarn(\"recordStore\", `ignoring an unreadable __timestamp: ${String(raw)}`);\n return undefined;\n }\n if (value >= MILLISECONDS_FLOOR) return value;\n if (value >= SECONDS_FLOOR) return value * 1000;\n\n devWarn(\n \"recordStore\",\n `__timestamp ${String(raw)} is implausible in seconds OR milliseconds — ` +\n \"ordering is disabled for this write rather than guessed at\",\n );\n return undefined;\n}\n\n/**\n * Keys the store INTERPRETS rather than stores.\n *\n * Everything `__`-prefixed is envelope by this wire format's own convention,\n * and two of them would actively break the store if kept as data:\n * `__broadcasted_at` moves on every delivery, so storing it would make an\n * identical redelivered payload look like a change and re-render the world —\n * which is the exact cost the notify-only-if-changed rule exists to avoid.\n *\n * `deleted_at` is here because it is the tombstone marker, not a field.\n */\nexport function isEnvelopeKey(key: string): boolean {\n return key.startsWith(\"__\") || key === \"deleted_at\";\n}\n"],"names":["isRecordRef","value","RESOURCE_SUFFIX","normalizeTypeName","raw","recordKey","type","id","payloadIdentity","payload","rawType","rawId","isStalePing","tombstoneAt","explicit","explicitlyUndeleted","MILLISECONDS_FLOOR","SECONDS_FLOOR","normalizeTimestamp","devWarn","isEnvelopeKey","key"],"mappings":";AAkCO,SAASA,EAAYC,GAAoC;AAC9D,SAAO,OAAOA,KAAU,YAAYA,MAAU,QAAQ,OAAQA,EAAoB,SAAU;AAC9F;AAGA,MAAMC,IAAkB;AAgBjB,SAASC,EAAkBC,GAAqB;AACrD,SAAOA,EAAI,SAASF,EAAgB,UAAUE,EAAI,SAASF,CAAe,IACtEE,EAAI,MAAM,GAAG,CAACF,EAAgB,MAAM,IACpCE;AACN;AAWO,SAASC,EAAUC,GAAcC,GAA6B;AACnE,SAAO,GAAGJ,EAAkBG,CAAI,CAAC,IAAI,OAAOC,CAAE,CAAC;AACjD;AASO,SAASC,EAAgBC,GAAqD;AACnF,QAAMC,IAAUD,EAAQ,QAClBE,IAAQF,EAAQ;AAGtB,MAFI,OAAOC,KAAY,YAAYA,MAAY,MAC3C,OAAOC,KAAU,YAAY,OAAOA,KAAU,YAC9CA,MAAU,GAAI;AAClB,QAAML,IAAOH,EAAkBO,CAAO,GAChCH,IAAK,OAAOI,CAAK;AACvB,SAAO,EAAE,KAAK,GAAGL,CAAI,IAAIC,CAAE,IAAI,MAAAD,GAAM,IAAAC,EAAA;AACvC;AAUO,SAASK,EAAYH,GAAiC;AAC3D,SAAOA,EAAQ,YAAY;AAC7B;AAWO,SAASI,EAAYJ,GAA4C;AACtE,QAAMK,IAAWL,EAAQ,cAAcA,EAAQ;AAC/C,MAAIK,KAAa;AACjB,WAAO,OAAOA,KAAa,WAAWA,IAAW,OAAOA,CAAQ;AAClE;AASO,SAASC,EAAoBN,GAAiC;AACnE,SAAOA,EAAQ,iBAAiB,QAAQA,EAAQ,eAAe;AACjE;AAMA,MAAMO,IAAqB,MACrBC,IAAgB;AAoBf,SAASC,EAAmBd,GAAkC;AACnE,MAAIA,KAAQ,KAA2B;AAEvC,MAAIH,IAAQ,OAAOG,KAAQ,WAAWA,IAAM,OAAOA,CAAG;AAMtD,MAFI,CAAC,OAAO,SAASH,CAAK,KAAK,OAAOG,KAAQ,aAAUH,IAAQ,KAAK,MAAMG,CAAG,IAE1E,CAAC,OAAO,SAASH,CAAK,KAAKA,KAAS,GAAG;AACzC,IAAAkB,EAAQ,eAAe,uCAAuC,OAAOf,CAAG,CAAC,EAAE;AAC3E;AAAA,EACF;AACA,MAAIH,KAASe,EAAoB,QAAOf;AACxC,MAAIA,KAASgB,EAAe,QAAOhB,IAAQ;AAE3C,EAAAkB;AAAA,IACE;AAAA,IACA,eAAe,OAAOf,CAAG,CAAC;AAAA,EAAA;AAI9B;AAaO,SAASgB,EAAcC,GAAsB;AAClD,SAAOA,EAAI,WAAW,IAAI,KAAKA,MAAQ;AACzC;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function e(n) {
|
|
2
|
+
const t = n.userAgentData?.platform?.toLowerCase();
|
|
3
|
+
if (t) {
|
|
4
|
+
if (t === "windows") return "windows";
|
|
5
|
+
if (t === "macos") return (n.maxTouchPoints ?? 0) > 1 ? "ios" : "macos";
|
|
6
|
+
if (t === "ios") return "ios";
|
|
7
|
+
if (t === "android") return "android";
|
|
8
|
+
}
|
|
9
|
+
const i = n.userAgent;
|
|
10
|
+
return /iPhone|iPad|iPod/.test(i) ? "ios" : /Android/.test(i) ? "android" : /Windows/.test(i) ? "windows" : /Macintosh|Mac OS X/.test(i) ? (n.maxTouchPoints ?? 0) > 1 ? "ios" : "macos" : "unknown";
|
|
11
|
+
}
|
|
12
|
+
function s(n, t) {
|
|
13
|
+
return n === "windows" ? { platform: n, steps: t.windows, href: "ms-settings:easeofaccess-visualeffects" } : { platform: n, steps: t[n] };
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
e as detectPlatform,
|
|
17
|
+
s as reducedMotionHelp
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=reduced-motion-help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reduced-motion-help.js","sources":["../../src/lib/reduced-motion-help.ts"],"sourcesContent":["/* ============================================================================\n REDUCED-MOTION HELP (DX-4504) - where to switch the OS \"reduce motion\"\n setting back off, for the OS this page is running on.\n\n The Appearance menu warns when the system asks for reduced motion, because a\n person who never knowingly turned it on (Windows' \"Animation effects\" is easy\n to switch off by accident, and some tuning tools do it for you) otherwise\n sees every animation silently replaced by its static fallback and concludes\n the app is broken. A warning without the way out is half a warning, so it\n names the exact setting.\n\n Pure, so the detection and the wording are pinned without a browser.\n ========================================================================= */\n\nexport type HostPlatform = \"windows\" | \"macos\" | \"ios\" | \"android\" | \"unknown\";\n\n/** The parts of `navigator` the detection reads. `userAgentData` is Chromium-only; everything else has `userAgent`. */\nexport interface PlatformSource {\n userAgent: string;\n maxTouchPoints?: number;\n userAgentData?: { platform?: string };\n}\n\n/**\n * Which OS the page runs on: the client-hints platform where the browser has it, else the user-agent string.\n * iPadOS reports a Mac user agent; a \"Mac\" with a touch screen is an iPad.\n */\nexport function detectPlatform(source: PlatformSource): HostPlatform {\n const hinted = source.userAgentData?.platform?.toLowerCase();\n if (hinted) {\n if (hinted === \"windows\") return \"windows\";\n if (hinted === \"macos\") return (source.maxTouchPoints ?? 0) > 1 ? \"ios\" : \"macos\";\n if (hinted === \"ios\") return \"ios\";\n if (hinted === \"android\") return \"android\";\n }\n const ua = source.userAgent;\n if (/iPhone|iPad|iPod/.test(ua)) return \"ios\";\n if (/Android/.test(ua)) return \"android\";\n if (/Windows/.test(ua)) return \"windows\";\n if (/Macintosh|Mac OS X/.test(ua)) return (source.maxTouchPoints ?? 0) > 1 ? \"ios\" : \"macos\";\n return \"unknown\";\n}\n\nexport interface ReducedMotionHelp {\n platform: HostPlatform;\n /** Where the setting is, in that OS's own words. */\n steps: string;\n /** A link that opens the setting directly, where the OS has one. */\n href?: string;\n}\n\n/** `steps` is the wording per OS (the active `UiLocaleProvider`'s `themeMenu.osSteps`); this picks the one for `platform` and its settings link. */\nexport function reducedMotionHelp(platform: HostPlatform, steps: Record<HostPlatform, string>): ReducedMotionHelp {\n if (platform === \"windows\") return { platform, steps: steps.windows, href: \"ms-settings:easeofaccess-visualeffects\" };\n return { platform, steps: steps[platform] };\n}\n"],"names":["detectPlatform","source","hinted","ua","reducedMotionHelp","platform","steps"],"mappings":"AA2BO,SAASA,EAAeC,GAAsC;AACnE,QAAMC,IAASD,EAAO,eAAe,UAAU,YAAA;AAC/C,MAAIC,GAAQ;AACV,QAAIA,MAAW,UAAW,QAAO;AACjC,QAAIA,MAAW,QAAS,SAAQD,EAAO,kBAAkB,KAAK,IAAI,QAAQ;AAC1E,QAAIC,MAAW,MAAO,QAAO;AAC7B,QAAIA,MAAW,UAAW,QAAO;AAAA,EACnC;AACA,QAAMC,IAAKF,EAAO;AAClB,SAAI,mBAAmB,KAAKE,CAAE,IAAU,QACpC,UAAU,KAAKA,CAAE,IAAU,YAC3B,UAAU,KAAKA,CAAE,IAAU,YAC3B,qBAAqB,KAAKA,CAAE,KAAWF,EAAO,kBAAkB,KAAK,IAAI,QAAQ,UAC9E;AACT;AAWO,SAASG,EAAkBC,GAAwBC,GAAwD;AAChH,SAAID,MAAa,YAAkB,EAAE,UAAAA,GAAU,OAAOC,EAAM,SAAS,MAAM,yCAAA,IACpE,EAAE,UAAAD,GAAU,OAAOC,EAAMD,CAAQ,EAAA;AAC1C;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function c(t) {
|
|
2
|
+
if (t.rangeCount === 0) return;
|
|
3
|
+
const o = t.getRangeAt(0), e = o.getClientRects()[0] ?? o.getBoundingClientRect();
|
|
4
|
+
if (e.height > 0) return e;
|
|
5
|
+
const n = o.startContainer, i = (n instanceof Element ? n : n.parentElement)?.getBoundingClientRect();
|
|
6
|
+
return i && i.height > 0 ? i : void 0;
|
|
7
|
+
}
|
|
8
|
+
function l(t, o = window.getSelection()) {
|
|
9
|
+
if (!o || t.scrollHeight <= t.clientHeight) return;
|
|
10
|
+
const e = c(o);
|
|
11
|
+
if (!e) return;
|
|
12
|
+
const n = t.getBoundingClientRect();
|
|
13
|
+
e.bottom > n.bottom ? t.scrollTop += e.bottom - n.bottom : e.top < n.top && (t.scrollTop -= n.top - e.top);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
l as scrollCaretIntoView
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=scroll-caret.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-caret.js","sources":["../../src/lib/scroll-caret.ts"],"sourcesContent":["/** DXUI-33: the caret's box, as the part of the selection that has a size. */\nfunction caretRect(selection: Selection): { top: number; bottom: number } | undefined {\n if (selection.rangeCount === 0) return undefined;\n const range = selection.getRangeAt(0);\n const rect = range.getClientRects()[0] ?? range.getBoundingClientRect();\n if (rect.height > 0) return rect;\n /* A caret on an empty line has no rect of its own; the line's element does. */\n const node = range.startContainer;\n const element = node instanceof Element ? node : node.parentElement;\n const fallback = element?.getBoundingClientRect();\n return fallback && fallback.height > 0 ? fallback : undefined;\n}\n\n/**\n * DXUI-33: scrolls `frame` just far enough that the caret is fully inside it. Does nothing when the frame does not\n * scroll (the draft fits), when there is no caret, or when the caret is already in view. `getSelection` is passed in\n * so a test can stub it.\n */\nexport function scrollCaretIntoView(frame: HTMLElement, selection: Selection | null = window.getSelection()): void {\n if (!selection || frame.scrollHeight <= frame.clientHeight) return;\n const caret = caretRect(selection);\n if (!caret) return;\n const box = frame.getBoundingClientRect();\n if (caret.bottom > box.bottom) frame.scrollTop += caret.bottom - box.bottom;\n else if (caret.top < box.top) frame.scrollTop -= box.top - caret.top;\n}\n"],"names":["caretRect","selection","range","rect","node","fallback","scrollCaretIntoView","frame","caret","box"],"mappings":"AACA,SAASA,EAAUC,GAAmE;AACpF,MAAIA,EAAU,eAAe,EAAG;AAChC,QAAMC,IAAQD,EAAU,WAAW,CAAC,GAC9BE,IAAOD,EAAM,eAAA,EAAiB,CAAC,KAAKA,EAAM,sBAAA;AAChD,MAAIC,EAAK,SAAS,EAAG,QAAOA;AAE5B,QAAMC,IAAOF,EAAM,gBAEbG,KADUD,aAAgB,UAAUA,IAAOA,EAAK,gBAC5B,sBAAA;AAC1B,SAAOC,KAAYA,EAAS,SAAS,IAAIA,IAAW;AACtD;AAOO,SAASC,EAAoBC,GAAoBN,IAA8B,OAAO,gBAAsB;AACjH,MAAI,CAACA,KAAaM,EAAM,gBAAgBA,EAAM,aAAc;AAC5D,QAAMC,IAAQR,EAAUC,CAAS;AACjC,MAAI,CAACO,EAAO;AACZ,QAAMC,IAAMF,EAAM,sBAAA;AAClB,EAAIC,EAAM,SAASC,EAAI,WAAc,aAAaD,EAAM,SAASC,EAAI,SAC5DD,EAAM,MAAMC,EAAI,UAAW,aAAaA,EAAI,MAAMD,EAAM;AACnE;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useSyncExternalStore as A } from "react";
|
|
2
|
+
import { readStored as $, writeStored as b } from "../persist.js";
|
|
3
|
+
import { simulateLatency as i } from "./latency.js";
|
|
4
|
+
import { registerSimStore as g } from "./registry.js";
|
|
5
|
+
function L(m, n, o, w = {}) {
|
|
6
|
+
const f = w.namespace ?? "demo", S = `${f}:${m}`;
|
|
7
|
+
let r = $(S, (t) => Array.isArray(t)) ?? n;
|
|
8
|
+
const c = /* @__PURE__ */ new Set();
|
|
9
|
+
function a() {
|
|
10
|
+
b(S, r), c.forEach((t) => t());
|
|
11
|
+
}
|
|
12
|
+
function y(t) {
|
|
13
|
+
return c.add(t), () => c.delete(t);
|
|
14
|
+
}
|
|
15
|
+
function d() {
|
|
16
|
+
return r;
|
|
17
|
+
}
|
|
18
|
+
function h() {
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
const u = {
|
|
22
|
+
useAll() {
|
|
23
|
+
return A(y, d, h);
|
|
24
|
+
},
|
|
25
|
+
useById(t) {
|
|
26
|
+
return u.useAll().find((e) => o(e) === t);
|
|
27
|
+
},
|
|
28
|
+
getAll() {
|
|
29
|
+
return r;
|
|
30
|
+
},
|
|
31
|
+
async create(t) {
|
|
32
|
+
return await i(1), r = [...r, t], a(), t;
|
|
33
|
+
},
|
|
34
|
+
async update(t, e) {
|
|
35
|
+
const p = r.find((s) => o(s) === t);
|
|
36
|
+
if (!p)
|
|
37
|
+
throw new Error(`createSimStore("${m}"): no item with id "${t}" to update.`);
|
|
38
|
+
await i(1);
|
|
39
|
+
const l = { ...p, ...e };
|
|
40
|
+
return r = r.map((s) => o(s) === t ? l : s), a(), l;
|
|
41
|
+
},
|
|
42
|
+
async remove(t) {
|
|
43
|
+
await i(1), r = r.filter((e) => o(e) !== t), a();
|
|
44
|
+
},
|
|
45
|
+
async reset() {
|
|
46
|
+
await i(n.length), r = n, a();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return g({ namespace: f, reset: u.reset }), u;
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
L as createSimStore
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=createSimStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSimStore.js","sources":["../../../src/lib/sim/createSimStore.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\nimport { readStored, writeStored } from \"../persist\";\nimport { simulateLatency } from \"./latency\";\nimport { registerSimStore } from \"./registry\";\nimport type { SimNamespace } from \"./types\";\n\n/* ============================================================================\n createSimStore — a reactive, LocalStorage-backed CRUD store for one entity\n type. The building block every simulated pitch-deck backend is made of.\n\n GENERIC OVER ANY ENTITY, RBAC/ROADMAP-SPECIFIC OR NOT. This has no idea\n whether `T` is a Role, a UseCase, or a future vertical's Invoice —\n `getId` is the one thing it needs from a caller to tell entities apart,\n because this library's OWN entities don't even agree on an id field name\n (`Role.id`, `Permission.key`, `UseCase.ref`, a `TeamMembership`'s composite\n `userId:teamId`). Every call site decides its own key; the store never\n assumes a field called `\"id\"` exists.\n\n `namespace` IS THE \"regenerate demo data can't erase the ledger\" GUARANTEE.\n `resetSimStores(\"demo\")` — wired to the Dev popover's \"Regenerate demo\n data\" — only touches stores registered under `\"demo\"`. A pitch deck's own\n use-case ledger registers under `\"ledger\"` so a mid-pitch demo-data reset\n can never wipe the product's own decision history. See `registry.ts`.\n\n REACTIVITY IS `useSyncExternalStore` OVER A MODULE-LEVEL PUB/SUB — no state\n library, matching this package's existing stance (`lib/persist.ts`,\n `demo/router.ts` both do the same three-piece shape: LocalStorage\n persistence, a `Set<listener>`, `useSyncExternalStore`). A write here\n notifies every subscriber, so an item edited in one component updates\n every OTHER component reading this store, anywhere on the page, with no\n prop drilling and no manual refetch.\n\n WHAT THIS DELIBERATELY DOES NOT SIMULATE: latency on a store's first read.\n `useSyncExternalStore` needs a synchronous snapshot, so faking \"initial\n load\" would mean a second loading-state contract nothing in this package\n consumes yet. Latency lives on the four calls that return a `Promise` —\n `create`/`update`/`remove`/`reset` — which is also where a demo's own\n buttons already have somewhere natural to show a pending state.\n ========================================================================= */\n\nexport interface SimStoreOptions {\n /** @default \"demo\" */\n namespace?: SimNamespace;\n}\n\nexport interface SimStore<T> {\n /** Reactive — re-renders on ANY write to this store, anywhere. */\n useAll(): T[];\n useById(id: string): T | undefined;\n /** Non-reactive escape hatch — reading outside a component, e.g. a seeder. */\n getAll(): T[];\n create(item: T): Promise<T>;\n update(id: string, patch: Partial<T>): Promise<T>;\n remove(id: string): Promise<void>;\n /** Back to `seed`. What \"Regenerate demo data\" calls, via `resetSimStores`. */\n reset(): Promise<void>;\n}\n\nexport function createSimStore<T>(\n key: string,\n seed: T[],\n getId: (item: T) => string,\n options: SimStoreOptions = {},\n): SimStore<T> {\n const namespace = options.namespace ?? \"demo\";\n const storageName = `${namespace}:${key}`;\n\n let state: T[] = readStored(storageName, (value): value is T[] => Array.isArray(value)) ?? seed;\n const listeners = new Set<() => void>();\n\n function notify() {\n writeStored(storageName, state);\n listeners.forEach((listener) => listener());\n }\n\n function subscribe(listener: () => void) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n\n function getSnapshot() {\n return state;\n }\n\n function getServerSnapshot() {\n return seed;\n }\n\n const store: SimStore<T> = {\n useAll() {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n },\n useById(id) {\n return store.useAll().find((item) => getId(item) === id);\n },\n getAll() {\n return state;\n },\n async create(item) {\n await simulateLatency(1);\n state = [...state, item];\n notify();\n return item;\n },\n async update(id, patch) {\n const before = state.find((item) => getId(item) === id);\n if (!before) {\n throw new Error(`createSimStore(\"${key}\"): no item with id \"${id}\" to update.`);\n }\n await simulateLatency(1);\n const updated = { ...before, ...patch };\n state = state.map((item) => (getId(item) === id ? updated : item));\n notify();\n return updated;\n },\n async remove(id) {\n await simulateLatency(1);\n state = state.filter((item) => getId(item) !== id);\n notify();\n },\n async reset() {\n await simulateLatency(seed.length);\n state = seed;\n notify();\n },\n };\n\n registerSimStore({ namespace, reset: store.reset });\n return store;\n}\n"],"names":["createSimStore","key","seed","getId","options","namespace","storageName","state","readStored","value","listeners","notify","writeStored","listener","subscribe","getSnapshot","getServerSnapshot","store","useSyncExternalStore","id","item","simulateLatency","patch","before","updated","registerSimStore"],"mappings":";;;;AA0DO,SAASA,EACdC,GACAC,GACAC,GACAC,IAA2B,CAAA,GACd;AACb,QAAMC,IAAYD,EAAQ,aAAa,QACjCE,IAAc,GAAGD,CAAS,IAAIJ,CAAG;AAEvC,MAAIM,IAAaC,EAAWF,GAAa,CAACG,MAAwB,MAAM,QAAQA,C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E,GACjDR,EAAA;AAAA,IACF;AAAA,IACA,MAAM,QAAQ;AACZ,YAAMU,EAAgBnB,EAAK,MAAM,GACjCK,IAAQL,GACRS,EAAA;AAAA,IACF;AAAA,EAAA;AAGF,SAAAc,EAAiB,EAAE,WAAApB,GAAW,OAAOY,EAAM,OAAO,GAC3CA;AACT;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getNetworkSpeed as a } from "./settings.js";
|
|
2
|
+
const i = {
|
|
3
|
+
instant: 0,
|
|
4
|
+
fast: 0.4,
|
|
5
|
+
typical: 1,
|
|
6
|
+
flaky: 1.6
|
|
7
|
+
}, c = 120, m = 0.4, E = 0.2, l = 0.12;
|
|
8
|
+
class u extends Error {
|
|
9
|
+
constructor(t) {
|
|
10
|
+
super(t), this.name = "SimNetworkError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function n(e) {
|
|
14
|
+
return new Promise((t) => setTimeout(t, e));
|
|
15
|
+
}
|
|
16
|
+
async function w(e) {
|
|
17
|
+
const t = a(), r = i[t];
|
|
18
|
+
if (r === 0) return;
|
|
19
|
+
const s = 1 + (Math.random() * 2 - 1) * E, o = (c + m * e) * r * s;
|
|
20
|
+
if (t === "flaky" && Math.random() < l)
|
|
21
|
+
throw await n(o), new u("Simulated network failure (Flaky mode).");
|
|
22
|
+
await n(o);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
u as SimNetworkError,
|
|
26
|
+
w as simulateLatency
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=latency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latency.js","sources":["../../../src/lib/sim/latency.ts"],"sourcesContent":["import { getNetworkSpeed } from \"./settings\";\nimport type { NetworkSpeed } from \"./types\";\n\n/* ============================================================================\n FAKE LATENCY — an instant response on every screen is the single biggest\n tell that a demo isn't real. This is cheap enough to fake that there is no\n excuse not to.\n\n delay = (base + perRecord * recordsTouched) * speedMultiplier * jitter\n\n `Flaky` additionally has a chance to reject instead of resolve, so\n empty/error-state UI gets exercised without hand-authoring a fixture for\n it. Every `createSimStore` write (`create`/`update`/`remove`/`reset`) goes\n through this — see the block comment there for what is deliberately NOT\n covered (a store's first read).\n ========================================================================= */\n\nconst SPEED_MULTIPLIER: Record<NetworkSpeed, number> = {\n instant: 0,\n fast: 0.4,\n typical: 1,\n flaky: 1.6,\n};\n\nconst BASE_MS = 120;\nconst PER_RECORD_MS = 0.4;\nconst JITTER_RATIO = 0.2;\nconst FLAKY_FAILURE_RATE = 0.12;\n\nexport class SimNetworkError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"SimNetworkError\";\n }\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Awaits a delay scaled to `recordsTouched` and the Dev popover's current\n * network-speed setting. `Instant` returns immediately rather than awaiting a\n * zero-length timer — the difference between \"no perceptible delay\" and\n * \"every store call pays for a microtask it gets nothing from.\"\n */\nexport async function simulateLatency(recordsTouched: number): Promise<void> {\n const speed = getNetworkSpeed();\n const multiplier = SPEED_MULTIPLIER[speed];\n if (multiplier === 0) return;\n\n const jitter = 1 + (Math.random() * 2 - 1) * JITTER_RATIO;\n const ms = (BASE_MS + PER_RECORD_MS * recordsTouched) * multiplier * jitter;\n\n if (speed === \"flaky\" && Math.random() < FLAKY_FAILURE_RATE) {\n await sleep(ms);\n throw new SimNetworkError(\"Simulated network failure (Flaky mode).\");\n }\n\n await sleep(ms);\n}\n"],"names":["SPEED_MULTIPLIER","BASE_MS","PER_RECORD_MS","JITTER_RATIO","FLAKY_FAILURE_RATE","SimNetworkError","message","sleep","ms","resolve","simulateLatency","recordsTouched","speed","getNetworkSpeed","multiplier","jitter"],"mappings":";AAiBA,MAAMA,IAAiD;AAAA,EACrD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AACT,GAEMC,IAAU,KACVC,IAAgB,KAChBC,IAAe,KACfC,IAAqB;AAEpB,MAAMC,UAAwB,MAAM;AAAA,EACzC,YAAYC,GAAiB;AAC3B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACd;AACF;AAEA,SAASC,EAAMC,GAA2B;AACxC,SAAO,IAAI,QAAQ,CAACC,MAAY,WAAWA,GAASD,CAAE,CAAC;AACzD;AAQA,eAAsBE,EAAgBC,GAAuC;AAC3E,QAAMC,IAAQC,EAAA,GACRC,IAAad,EAAiBY,CAAK;AACzC,MAAIE,MAAe,EAAG;AAEtB,QAAMC,IAAS,KAAK,KAAK,WAAW,IAAI,KAAKZ,GACvCK,KAAMP,IAAUC,IAAgBS,KAAkBG,IAAaC;AAErE,MAAIH,MAAU,WAAW,KAAK,OAAA,IAAWR;AACvC,gBAAMG,EAAMC,CAAE,GACR,IAAIH,EAAgB,yCAAyC;AAGrE,QAAME,EAAMC,CAAE;AAChB;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const r = /* @__PURE__ */ new Set();
|
|
2
|
+
function i(e) {
|
|
3
|
+
return r.add(e), () => r.delete(e);
|
|
4
|
+
}
|
|
5
|
+
async function n(e) {
|
|
6
|
+
const s = [...r].filter((t) => !e || t.namespace === e);
|
|
7
|
+
await Promise.all(s.map((t) => t.reset()));
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
i as registerSimStore,
|
|
11
|
+
n as resetSimStores
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sources":["../../../src/lib/sim/registry.ts"],"sourcesContent":["import type { SimNamespace } from \"./types\";\n\n/* ============================================================================\n STORE REGISTRY — how \"Regenerate demo data\" resets every store without\n knowing any of them exist.\n\n `DevToolsPopover` is a domain-agnostic RBAC component; it must not import a\n Roadmap-specific store (or a future vertical's) just to offer a \"reset\n everything\" button. Every `createSimStore` call registers itself here on\n creation, so `resetSimStores()` can reach all of them through one generic\n call — the same arm's-length relationship this library keeps everywhere\n else between a generic mechanism and the concrete data poured into it.\n ========================================================================= */\n\ninterface RegisteredStore {\n namespace: SimNamespace;\n reset: () => Promise<void>;\n}\n\nconst registry = new Set<RegisteredStore>();\n\n/** Called once by `createSimStore` itself — not a public store-authoring API. */\nexport function registerSimStore(entry: RegisteredStore): () => void {\n registry.add(entry);\n return () => registry.delete(entry);\n}\n\n/**\n * Resets every registered store in `namespace`, or every store at all when\n * omitted. Resolves once every reset has actually written back to\n * LocalStorage and notified its subscribers.\n */\nexport async function resetSimStores(namespace?: SimNamespace): Promise<void> {\n const targets = [...registry].filter((entry) => !namespace || entry.namespace === namespace);\n await Promise.all(targets.map((entry) => entry.reset()));\n}\n"],"names":["registry","registerSimStore","entry","resetSimStores","namespace","targets"],"mappings":"AAmBA,MAAMA,wBAAe,IAAA;AAGd,SAASC,EAAiBC,GAAoC;AACnE,SAAAF,EAAS,IAAIE,CAAK,GACX,MAAMF,EAAS,OAAOE,CAAK;AACpC;AAOA,eAAsBC,EAAeC,GAAyC;AAC5E,QAAMC,IAAU,CAAC,GAAGL,CAAQ,EAAE,OAAO,CAACE,MAAU,CAACE,KAAaF,EAAM,cAAcE,CAAS;AAC3F,QAAM,QAAQ,IAAIC,EAAQ,IAAI,CAACH,MAAUA,EAAM,MAAA,CAAO,CAAC;AACzD;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useSyncExternalStore as u } from "react";
|
|
2
|
+
import { readStored as S, writeStored as a } from "../persist.js";
|
|
3
|
+
const s = "demo:settings", c = { networkSpeed: "typical", dataSource: "simulated" };
|
|
4
|
+
function d(t) {
|
|
5
|
+
if (typeof t != "object" || t === null) return !1;
|
|
6
|
+
const o = t, n = o.networkSpeed, i = o.dataSource;
|
|
7
|
+
return (n === "instant" || n === "fast" || n === "typical" || n === "flaky") && (i === "simulated" || i === "live");
|
|
8
|
+
}
|
|
9
|
+
let e = S(s, d) ?? c;
|
|
10
|
+
const r = /* @__PURE__ */ new Set();
|
|
11
|
+
function f() {
|
|
12
|
+
a(s, e), r.forEach((t) => t());
|
|
13
|
+
}
|
|
14
|
+
function p(t) {
|
|
15
|
+
return r.add(t), () => r.delete(t);
|
|
16
|
+
}
|
|
17
|
+
function l() {
|
|
18
|
+
return e;
|
|
19
|
+
}
|
|
20
|
+
function m() {
|
|
21
|
+
return c;
|
|
22
|
+
}
|
|
23
|
+
function y() {
|
|
24
|
+
return u(p, l, m);
|
|
25
|
+
}
|
|
26
|
+
function E(t) {
|
|
27
|
+
e = { ...e, ...t }, f();
|
|
28
|
+
}
|
|
29
|
+
function k() {
|
|
30
|
+
return e.networkSpeed;
|
|
31
|
+
}
|
|
32
|
+
function T() {
|
|
33
|
+
return e.dataSource;
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
T as getDataSource,
|
|
37
|
+
k as getNetworkSpeed,
|
|
38
|
+
E as setSimSettings,
|
|
39
|
+
y as useSimSettings
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sources":["../../../src/lib/sim/settings.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\nimport { readStored, writeStored } from \"../persist\";\nimport type { DataSource, NetworkSpeed } from \"./types\";\n\n/* ============================================================================\n SIM SETTINGS — the Dev popover's \"Network speed\" and \"Data source\" controls,\n as one small reactive singleton.\n\n NOT A `createSimStore` — that factory is shaped for a COLLECTION (`T[]`,\n `getId`), and forcing a single settings object through it would mean a\n fake one-element array just to reuse an API that does not fit. This file\n is the same three ingredients (LocalStorage persistence, module-level\n pub/sub, `useSyncExternalStore`) applied directly to the one shape that\n actually needs them here.\n ========================================================================= */\n\nexport interface SimSettings {\n networkSpeed: NetworkSpeed;\n dataSource: DataSource;\n}\n\nconst STORAGE_NAME = \"demo:settings\";\n\nconst DEFAULT_SETTINGS: SimSettings = { networkSpeed: \"typical\", dataSource: \"simulated\" };\n\nfunction isSimSettings(value: unknown): value is SimSettings {\n if (typeof value !== \"object\" || value === null) return false;\n const candidate = value as Record<string, unknown>;\n const speed = candidate.networkSpeed;\n const source = candidate.dataSource;\n return (\n (speed === \"instant\" || speed === \"fast\" || speed === \"typical\" || speed === \"flaky\") &&\n (source === \"simulated\" || source === \"live\")\n );\n}\n\nlet settings: SimSettings = readStored(STORAGE_NAME, isSimSettings) ?? DEFAULT_SETTINGS;\nconst listeners = new Set<() => void>();\n\nfunction notify() {\n writeStored(STORAGE_NAME, settings);\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n\nfunction getSnapshot() {\n return settings;\n}\n\nfunction getServerSnapshot() {\n return DEFAULT_SETTINGS;\n}\n\nexport function useSimSettings(): SimSettings {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\nexport function setSimSettings(patch: Partial<SimSettings>): void {\n settings = { ...settings, ...patch };\n notify();\n}\n\n/** Read outside React — `latency.ts` needs the current speed synchronously,\n inside a plain async function with no hook rules to follow. */\nexport function getNetworkSpeed(): NetworkSpeed {\n return settings.networkSpeed;\n}\n\nexport function getDataSource(): DataSource {\n return settings.dataSource;\n}\n"],"names":["STORAGE_NAME","DEFAULT_SETTINGS","isSimSettings","value","candidate","speed","source","settings","readStored","listeners","notify","writeStored","listener","subscribe","getSnapshot","getServerSnapshot","useSimSettings","useSyncExternalStore","setSimSettings","patch","getNetworkSpeed","getDataSource"],"mappings":";;AAqBA,MAAMA,IAAe,iBAEfC,IAAgC,EAAE,cAAc,WAAW,YAAY,YAAA;AAE7E,SAASC,EAAcC,GAAsC;AAC3D,MAAI,OAAOA,KAAU,YAAYA,MAAU,KAAM,QAAO;AACxD,QAAMC,IAAYD,GACZE,IAAQD,EAAU,cAClBE,IAASF,EAAU;AACzB,UACGC,MAAU,aAAaA,MAAU,UAAUA,MAAU,aAAaA,MAAU,aAC5EC,MAAW,eAAeA,MAAW;AAE1C;AAEA,IAAIC,IAAwBC,EAAWR,GAAcE,CAAa,KAAKD;AACvE,MAAMQ,wBAAgB,IAAA;AAEtB,SAASC,IAAS;AAChB,EAAAC,EAAYX,GAAcO,CAAQ,GAClCE,EAAU,QAAQ,CAACG,MAAaA,EAAA,CAAU;AAC5C;AAEA,SAASC,EAAUD,GAAsB;AACvC,SAAAH,EAAU,IAAIG,CAAQ,GACf,MAAMH,EAAU,OAAOG,CAAQ;AACxC;AAEA,SAASE,IAAc;AACrB,SAAOP;AACT;AAEA,SAASQ,IAAoB;AAC3B,SAAOd;AACT;AAEO,SAASe,IAA8B;AAC5C,SAAOC,EAAqBJ,GAAWC,GAAaC,CAAiB;AACvE;AAEO,SAASG,EAAeC,GAAmC;AAChE,EAAAZ,IAAW,EAAE,GAAGA,GAAU,GAAGY,EAAA,GAC7BT,EAAA;AACF;AAIO,SAASU,IAAgC;AAC9C,SAAOb,EAAS;AAClB;AAEO,SAASc,IAA4B;AAC1C,SAAOd,EAAS;AAClB;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as s, useEffect as a } from "react";
|
|
3
|
+
import { detectPlatform as m } from "./reduced-motion-help.js";
|
|
4
|
+
import { useUiStrings as c } from "./i18n/provider.js";
|
|
5
|
+
import { chordLabel as f } from "./i18n/areas/keys.js";
|
|
6
|
+
function u() {
|
|
7
|
+
const [t, r] = s("ctrl+enter");
|
|
8
|
+
return a(() => {
|
|
9
|
+
const e = m(navigator);
|
|
10
|
+
(e === "macos" || e === "ios") && r("cmd+enter");
|
|
11
|
+
}, []), t;
|
|
12
|
+
}
|
|
13
|
+
function g(t, r) {
|
|
14
|
+
!r || t.defaultPrevented || t.nativeEvent.isComposing || t.currentTarget.contains(t.target) && (t.key !== "Enter" || !(t.metaKey || t.ctrlKey) || (t.preventDefault(), r.disabled || r.onSubmit()));
|
|
15
|
+
}
|
|
16
|
+
function S({ submit: t, className: r }) {
|
|
17
|
+
const { markdownEditor: e, keyNames: o } = c(), i = u();
|
|
18
|
+
return /* @__PURE__ */ n("span", { className: r ?? "text-xs text-tertiary", children: e.submitAdvisement(f(i, o), t.label) });
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
S as SubmitHint,
|
|
22
|
+
g as handleSubmitChord,
|
|
23
|
+
u as useSubmitChord
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=submit-shortcut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-shortcut.js","sources":["../../src/lib/submit-shortcut.tsx"],"sourcesContent":["import { useEffect, useState, type KeyboardEvent } from \"react\";\nimport { chordLabel, useUiStrings } from \"./i18n\";\nimport { detectPlatform } from \"./reduced-motion-help\";\n\n/**\n * DX-5596: the one submit contract every multi-line input shares (`MarkdownEditor`, `Textarea`).\n * Ctrl+Enter (Cmd+Enter on a Mac) calls `onSubmit`; `label` is the verb the hint names (\"post\",\n * translated by the caller); `disabled` is the caller's own can't-submit rule, the same one its\n * button follows. While disabled the chord calls nothing but is still swallowed, so it does not\n * insert a line break. Plain Enter keeps its meaning.\n */\nexport interface SubmitAction {\n onSubmit: () => void;\n label: string;\n disabled?: boolean;\n}\n\ntype Chord = \"ctrl+enter\" | \"cmd+enter\";\n\n/** Ctrl+Enter everywhere; Cmd+Enter in the hint on a Mac or iPad. Read after mount so SSR and hydration agree. */\nexport function useSubmitChord(): Chord {\n const [chord, setChord] = useState<Chord>(\"ctrl+enter\");\n useEffect(() => {\n const platform = detectPlatform(navigator as Navigator & { userAgentData?: { platform?: string } });\n if (platform === \"macos\" || platform === \"ios\") setChord(\"cmd+enter\");\n }, []);\n return chord;\n}\n\n/** Runs `submit` on Ctrl/Cmd+Enter (either modifier on every platform, as `InlineMarkdownEdit` does). True when it took the key. */\nexport function handleSubmitChord(event: KeyboardEvent<HTMLElement>, submit: SubmitAction | undefined): void {\n if (!submit || event.defaultPrevented || event.nativeEvent.isComposing) return;\n /* A key in a portalled layer (a menu, a popover) bubbles here through React but is that layer's. */\n if (!event.currentTarget.contains(event.target as Node)) return;\n if (event.key !== \"Enter\" || !(event.metaKey || event.ctrlKey)) return;\n event.preventDefault();\n if (!submit.disabled) submit.onSubmit();\n}\n\n/** The permanent hint line naming the chord and its action: \"Ctrl+Enter to post\". */\nexport function SubmitHint({ submit, className }: { submit: SubmitAction; className?: string }) {\n const { markdownEditor: strings, keyNames } = useUiStrings();\n const chord = useSubmitChord();\n return <span className={className ?? \"text-xs text-tertiary\"}>{strings.submitAdvisement(chordLabel(chord, keyNames), submit.label)}</span>;\n}\n"],"names":["useSubmitChord","chord","setChord","useState","useEffect","platform","detectPlatform","handleSubmitChord","event","submit","SubmitHint","className","strings","keyNames","useUiStrings","jsx","chordLabel"],"mappings":";;;;;AAoBO,SAASA,IAAwB;AACtC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAgB,YAAY;AACtD,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAWC,EAAe,SAAkE;AAClG,KAAID,MAAa,WAAWA,MAAa,YAAgB,WAAW;AAAA,EACtE,GAAG,CAAA,CAAE,GACEJ;AACT;AAGO,SAASM,EAAkBC,GAAmCC,GAAwC;AAC3G,EAAI,CAACA,KAAUD,EAAM,oBAAoBA,EAAM,YAAY,eAEtDA,EAAM,cAAc,SAASA,EAAM,MAAc,MAClDA,EAAM,QAAQ,WAAW,EAAEA,EAAM,WAAWA,EAAM,aACtDA,EAAM,eAAA,GACDC,EAAO,YAAUA,EAAO,SAAA;AAC/B;AAGO,SAASC,EAAW,EAAE,QAAAD,GAAQ,WAAAE,KAA2D;AAC9F,QAAM,EAAE,gBAAgBC,GAAS,UAAAC,EAAA,IAAaC,EAAA,GACxCb,IAAQD,EAAA;AACd,SAAO,gBAAAe,EAAC,QAAA,EAAK,WAAWJ,KAAa,yBAA0B,UAAAC,EAAQ,iBAAiBI,EAAWf,GAAOY,CAAQ,GAAGJ,EAAO,KAAK,GAAE;AACrI;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LANGUAGES as o } from "./languages/index.js";
|
|
2
|
+
import { listLanguages as s, registerGrammar as t, resolveLanguage as i } from "./registry.js";
|
|
3
|
+
import { defineGrammar as k } from "./registry.js";
|
|
4
|
+
import { tokenize as m } from "./tokenize.js";
|
|
5
|
+
import { checkCoverage as $ } from "./tokenize.js";
|
|
6
|
+
let a = !1;
|
|
7
|
+
function r() {
|
|
8
|
+
if (!a) {
|
|
9
|
+
a = !0;
|
|
10
|
+
for (const e of o) t(e);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function c(e, n) {
|
|
14
|
+
return r(), m(e, n);
|
|
15
|
+
}
|
|
16
|
+
function l() {
|
|
17
|
+
return r(), s();
|
|
18
|
+
}
|
|
19
|
+
function L(e) {
|
|
20
|
+
return r(), i(e);
|
|
21
|
+
}
|
|
22
|
+
function p(e) {
|
|
23
|
+
r(), t(e);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
$ as checkCoverage,
|
|
27
|
+
k as defineGrammar,
|
|
28
|
+
l as listLanguages,
|
|
29
|
+
p as registerGrammar,
|
|
30
|
+
L as resolveLanguage,
|
|
31
|
+
c as tokenize
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=index.js.map
|