@k2b/ui 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.css +14 -1
- package/dist/browser/actions/ContextMenu.js +13 -0
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +173 -102
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/FilterChip.js +113 -56
- package/dist/browser/actions/FilterChip.js.map +1 -1
- package/dist/browser/actions/SelectionToolbar.js +129 -0
- package/dist/browser/actions/SelectionToolbar.js.map +1 -0
- package/dist/browser/actions/filter-messages.js +26 -2
- package/dist/browser/actions/filter-messages.js.map +1 -1
- package/dist/browser/actions/index.js +1 -0
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/menu-rows.js +23 -3
- package/dist/browser/actions/menu-rows.js.map +1 -1
- package/dist/browser/actions/menu-sheet.js +2 -7
- package/dist/browser/actions/menu-sheet.js.map +1 -1
- package/dist/browser/charts.js +6 -0
- package/dist/browser/charts.js.map +1 -0
- package/dist/browser/chat/ChatComposer.js +616 -421
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/chat-messages.js +18 -0
- package/dist/browser/chat/chat-messages.js.map +1 -1
- package/dist/browser/chat/composer-document.js +19 -0
- package/dist/browser/chat/composer-document.js.map +1 -1
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/content/Calendar.js +39 -29
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +159 -165
- package/dist/browser/content/CalendarDayView.js.map +1 -1
- package/dist/browser/content/Chart.js +8 -0
- package/dist/browser/content/Chart.js.map +1 -1
- package/dist/browser/content/FileGrid.js +231 -9
- package/dist/browser/content/FileGrid.js.map +1 -1
- package/dist/browser/content/FileTypeIcon.js +15 -0
- package/dist/browser/content/FileTypeIcon.js.map +1 -1
- package/dist/browser/content/FileView.js +11 -4
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/MessageRow.js +627 -343
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/ReactionBar.js +20 -1
- package/dist/browser/content/ReactionBar.js.map +1 -1
- package/dist/browser/content/calendar-day-scroll.js +4 -3
- package/dist/browser/content/calendar-day-scroll.js.map +1 -1
- package/dist/browser/content/chart-bar.js +476 -0
- package/dist/browser/content/chart-bar.js.map +1 -0
- package/dist/browser/content/file-list-messages.js +52 -0
- package/dist/browser/content/file-list-messages.js.map +1 -0
- package/dist/browser/content/index.js +2 -2
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/Tooltip.js +31 -14
- package/dist/browser/feedback/Tooltip.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +6 -0
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/inputs/ChoiceList.js +178 -0
- package/dist/browser/inputs/ChoiceList.js.map +1 -0
- package/dist/browser/inputs/ChoiceSlider.js +314 -0
- package/dist/browser/inputs/ChoiceSlider.js.map +1 -0
- package/dist/browser/inputs/ChoiceTiles.js +135 -0
- package/dist/browser/inputs/ChoiceTiles.js.map +1 -0
- package/dist/browser/inputs/ColorChoices.js +120 -0
- package/dist/browser/inputs/ColorChoices.js.map +1 -0
- package/dist/browser/inputs/QrScanner.js +95 -13
- package/dist/browser/inputs/QrScanner.js.map +1 -1
- package/dist/browser/inputs/TextInput.js +19 -14
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/inputs/index.js +4 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/qr-messages.js +2 -0
- package/dist/browser/inputs/qr-messages.js.map +1 -1
- package/dist/browser/internal/radio-keys.js +13 -0
- package/dist/browser/internal/radio-keys.js.map +1 -0
- package/dist/browser/intl/shortcut-messages.js +4 -0
- package/dist/browser/intl/shortcut-messages.js.map +1 -1
- package/dist/browser/intl/shortcut.js +4 -0
- package/dist/browser/intl/shortcut.js.map +1 -1
- package/dist/browser/layout/AnchoredPopover.js +180 -0
- package/dist/browser/layout/AnchoredPopover.js.map +1 -0
- package/dist/browser/layout/AppWorkspace.js +684 -532
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +443 -333
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/MobileShell.js +231 -42
- package/dist/browser/layout/MobileShell.js.map +1 -1
- package/dist/browser/layout/Settings.js +283 -175
- package/dist/browser/layout/Settings.js.map +1 -1
- package/dist/browser/layout/SidebarRailHint.js +79 -0
- package/dist/browser/layout/SidebarRailHint.js.map +1 -0
- package/dist/browser/layout/SidebarSwitcher.js +79 -66
- package/dist/browser/layout/SidebarSwitcher.js.map +1 -1
- package/dist/browser/layout/TabBar.js +18 -4
- package/dist/browser/layout/TabBar.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +11 -4
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/detail-panel-messages.js +4 -2
- package/dist/browser/layout/detail-panel-messages.js.map +1 -1
- package/dist/browser/layout/index.js +3 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/scroll-fade.js +32 -5
- package/dist/browser/layout/scroll-fade.js.map +1 -1
- package/dist/browser/layout/settings-messages.js +26 -2
- package/dist/browser/layout/settings-messages.js.map +1 -1
- package/dist/browser/surfaces/Avatar.js +2 -14
- package/dist/browser/surfaces/Avatar.js.map +1 -1
- package/dist/browser/surfaces/DotStrip.js +70 -0
- package/dist/browser/surfaces/DotStrip.js.map +1 -0
- package/dist/browser/surfaces/NoticeCard.js +46 -30
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/browser/surfaces/ProgressRing.js +3 -0
- package/dist/browser/surfaces/ProgressRing.js.map +1 -1
- package/dist/browser/surfaces/ResourceCard.js +125 -68
- package/dist/browser/surfaces/ResourceCard.js.map +1 -1
- package/dist/browser/surfaces/index.js +2 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/browser/surfaces/person-color.js +18 -0
- package/dist/browser/surfaces/person-color.js.map +1 -0
- package/dist/browser/surfaces/resource-messages.js +8 -4
- package/dist/browser/surfaces/resource-messages.js.map +1 -1
- package/dist/browser/widgets/Widget.js +3 -2
- package/dist/browser/widgets/Widget.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +9 -0
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +65 -31
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/FilterChip.js +67 -16
- package/dist/ssr/actions/FilterChip.js.map +1 -1
- package/dist/ssr/actions/SelectionToolbar.js +104 -0
- package/dist/ssr/actions/SelectionToolbar.js.map +1 -0
- package/dist/ssr/actions/filter-messages.js +26 -2
- package/dist/ssr/actions/filter-messages.js.map +1 -1
- package/dist/ssr/actions/index.js +1 -0
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/menu-rows.js +23 -3
- package/dist/ssr/actions/menu-rows.js.map +1 -1
- package/dist/ssr/actions/menu-sheet.js +2 -7
- package/dist/ssr/actions/menu-sheet.js.map +1 -1
- package/dist/ssr/charts.js +6 -0
- package/dist/ssr/charts.js.map +1 -0
- package/dist/ssr/chat/ChatComposer.js +184 -76
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/chat-messages.js +18 -0
- package/dist/ssr/chat/chat-messages.js.map +1 -1
- package/dist/ssr/chat/composer-document.js +19 -0
- package/dist/ssr/chat/composer-document.js.map +1 -1
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/content/Calendar.js +40 -31
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +40 -48
- package/dist/ssr/content/CalendarDayView.js.map +1 -1
- package/dist/ssr/content/Chart.js +8 -0
- package/dist/ssr/content/Chart.js.map +1 -1
- package/dist/ssr/content/FileGrid.js +132 -5
- package/dist/ssr/content/FileGrid.js.map +1 -1
- package/dist/ssr/content/FileTypeIcon.js +15 -0
- package/dist/ssr/content/FileTypeIcon.js.map +1 -1
- package/dist/ssr/content/FileView.js +11 -4
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/MessageRow.js +274 -91
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/ReactionBar.js +20 -1
- package/dist/ssr/content/ReactionBar.js.map +1 -1
- package/dist/ssr/content/calendar-day-scroll.js +4 -3
- package/dist/ssr/content/calendar-day-scroll.js.map +1 -1
- package/dist/ssr/content/chart-bar.js +476 -0
- package/dist/ssr/content/chart-bar.js.map +1 -0
- package/dist/ssr/content/file-list-messages.js +52 -0
- package/dist/ssr/content/file-list-messages.js.map +1 -0
- package/dist/ssr/content/index.js +2 -2
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/Tooltip.js +31 -14
- package/dist/ssr/feedback/Tooltip.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +6 -0
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/inputs/ChoiceList.js +95 -0
- package/dist/ssr/inputs/ChoiceList.js.map +1 -0
- package/dist/ssr/inputs/ChoiceSlider.js +191 -0
- package/dist/ssr/inputs/ChoiceSlider.js.map +1 -0
- package/dist/ssr/inputs/ChoiceTiles.js +61 -0
- package/dist/ssr/inputs/ChoiceTiles.js.map +1 -0
- package/dist/ssr/inputs/ColorChoices.js +60 -0
- package/dist/ssr/inputs/ColorChoices.js.map +1 -0
- package/dist/ssr/inputs/QrScanner.js +89 -10
- package/dist/ssr/inputs/QrScanner.js.map +1 -1
- package/dist/ssr/inputs/TextInput.js +17 -2
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/inputs/index.js +4 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/qr-messages.js +2 -0
- package/dist/ssr/inputs/qr-messages.js.map +1 -1
- package/dist/ssr/internal/radio-keys.js +13 -0
- package/dist/ssr/internal/radio-keys.js.map +1 -0
- package/dist/ssr/intl/shortcut-messages.js +4 -0
- package/dist/ssr/intl/shortcut-messages.js.map +1 -1
- package/dist/ssr/intl/shortcut.js +4 -0
- package/dist/ssr/intl/shortcut.js.map +1 -1
- package/dist/ssr/layout/AnchoredPopover.js +142 -0
- package/dist/ssr/layout/AnchoredPopover.js.map +1 -0
- package/dist/ssr/layout/AppWorkspace.js +287 -141
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +181 -108
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/MobileShell.js +118 -24
- package/dist/ssr/layout/MobileShell.js.map +1 -1
- package/dist/ssr/layout/Settings.js +122 -45
- package/dist/ssr/layout/Settings.js.map +1 -1
- package/dist/ssr/layout/SidebarRailHint.js +79 -0
- package/dist/ssr/layout/SidebarRailHint.js.map +1 -0
- package/dist/ssr/layout/SidebarSwitcher.js +13 -3
- package/dist/ssr/layout/SidebarSwitcher.js.map +1 -1
- package/dist/ssr/layout/TabBar.js +11 -3
- package/dist/ssr/layout/TabBar.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +11 -4
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/detail-panel-messages.js +4 -2
- package/dist/ssr/layout/detail-panel-messages.js.map +1 -1
- package/dist/ssr/layout/index.js +3 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/scroll-fade.js +32 -5
- package/dist/ssr/layout/scroll-fade.js.map +1 -1
- package/dist/ssr/layout/settings-messages.js +26 -2
- package/dist/ssr/layout/settings-messages.js.map +1 -1
- package/dist/ssr/surfaces/Avatar.js +2 -14
- package/dist/ssr/surfaces/Avatar.js.map +1 -1
- package/dist/ssr/surfaces/DotStrip.js +31 -0
- package/dist/ssr/surfaces/DotStrip.js.map +1 -0
- package/dist/ssr/surfaces/NoticeCard.js +21 -12
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/surfaces/ProgressRing.js +3 -0
- package/dist/ssr/surfaces/ProgressRing.js.map +1 -1
- package/dist/ssr/surfaces/ResourceCard.js +40 -15
- package/dist/ssr/surfaces/ResourceCard.js.map +1 -1
- package/dist/ssr/surfaces/index.js +2 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/ssr/surfaces/person-color.js +18 -0
- package/dist/ssr/surfaces/person-color.js.map +1 -0
- package/dist/ssr/surfaces/resource-messages.js +8 -4
- package/dist/ssr/surfaces/resource-messages.js.map +1 -1
- package/dist/ssr/widgets/Widget.js +3 -2
- package/dist/ssr/widgets/Widget.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/ContextMenu.d.ts +5 -0
- package/dist/types/actions/Dropdown.d.ts +19 -0
- package/dist/types/actions/FilterChip.d.ts +11 -0
- package/dist/types/actions/SelectionToolbar.d.ts +38 -0
- package/dist/types/actions/filter-messages.d.ts +12 -0
- package/dist/types/actions/index.d.ts +2 -0
- package/dist/types/actions/menu-rows.d.ts +7 -2
- package/dist/types/charts.d.ts +5 -0
- package/dist/types/chat/ChatComposer.d.ts +28 -0
- package/dist/types/chat/chat-messages.d.ts +9 -0
- package/dist/types/chat/composer-document.d.ts +5 -0
- package/dist/types/chat/index.d.ts +1 -1
- package/dist/types/content/Calendar.d.ts +7 -0
- package/dist/types/content/Chart.d.ts +2 -1
- package/dist/types/content/FileGrid.d.ts +43 -3
- package/dist/types/content/FileTypeIcon.d.ts +10 -0
- package/dist/types/content/FileView.d.ts +5 -1
- package/dist/types/content/MessageRow.d.ts +66 -2
- package/dist/types/content/calendar-day-scroll.d.ts +2 -1
- package/dist/types/content/chart-bar.d.ts +60 -0
- package/dist/types/content/file-list-messages.d.ts +24 -0
- package/dist/types/content/index.d.ts +4 -4
- package/dist/types/feedback/Tooltip.d.ts +8 -2
- package/dist/types/feedback/dialog-core.d.ts +3 -0
- package/dist/types/inputs/ChoiceList.d.ts +28 -0
- package/dist/types/inputs/ChoiceSlider.d.ts +36 -0
- package/dist/types/inputs/ChoiceTiles.d.ts +25 -0
- package/dist/types/inputs/ColorChoices.d.ts +19 -0
- package/dist/types/inputs/index.d.ts +8 -0
- package/dist/types/inputs/qr-messages.d.ts +1 -0
- package/dist/types/internal/radio-keys.d.ts +5 -0
- package/dist/types/intl/shortcut-messages.d.ts +2 -0
- package/dist/types/layout/AnchoredPopover.d.ts +31 -0
- package/dist/types/layout/AppWorkspace.d.ts +12 -0
- package/dist/types/layout/DetailPanel.d.ts +17 -0
- package/dist/types/layout/MobileShell.d.ts +55 -5
- package/dist/types/layout/Settings.d.ts +22 -0
- package/dist/types/layout/SidebarRailHint.d.ts +26 -0
- package/dist/types/layout/TabBar.d.ts +5 -0
- package/dist/types/layout/detail-panel-messages.d.ts +1 -0
- package/dist/types/layout/index.d.ts +5 -3
- package/dist/types/layout/scroll-fade.d.ts +5 -0
- package/dist/types/layout/settings-messages.d.ts +12 -0
- package/dist/types/surfaces/DotStrip.d.ts +22 -0
- package/dist/types/surfaces/NoticeCard.d.ts +3 -0
- package/dist/types/surfaces/ProgressRing.d.ts +2 -1
- package/dist/types/surfaces/ResourceCard.d.ts +9 -0
- package/dist/types/surfaces/index.d.ts +4 -1
- package/dist/types/surfaces/person-color.d.ts +10 -0
- package/dist/types/surfaces/resource-messages.d.ts +2 -0
- package/dist/types/widgets/Widget.d.ts +3 -2
- package/package.json +7 -2
|
@@ -15,7 +15,7 @@ export { DocCode, DocConceptGrid, DocInlineCode, DocLead, DocNote, DocPage, DocR
|
|
|
15
15
|
export { FileBrowserPanel, openFileBrowser } from "./FileBrowser";
|
|
16
16
|
export { FileGrid } from "./FileGrid";
|
|
17
17
|
export { default as FileTree } from "./FileTree";
|
|
18
|
-
export { FileTypeIcon, fileTypeOf } from "./FileTypeIcon";
|
|
18
|
+
export { FileTypeIcon, fileKindLabel, fileTypeOf } from "./FileTypeIcon";
|
|
19
19
|
export { canPreviewFile, default as FileView, formatFileViewSize, getFileViewPreviewKind } from "./FileView";
|
|
20
20
|
export { Kbd } from "./Kbd";
|
|
21
21
|
export { LabelChip } from "./LabelChip";
|
|
@@ -25,7 +25,7 @@ export { MapAttribution } from "./MapAttribution";
|
|
|
25
25
|
export { MapView } from "./MapView";
|
|
26
26
|
export { MapViewFrame } from "./MapViewFrame";
|
|
27
27
|
export { default as MarkdownView, renderSafeMarkdown } from "./MarkdownView";
|
|
28
|
-
export { MessageRow, MessageSystemRow, startsMessageGroup } from "./MessageRow";
|
|
28
|
+
export { MessageEventGroup, MessageEventRow, MessageRow, MessageSystemRow, startsMessageGroup } from "./MessageRow";
|
|
29
29
|
export { mapPalette } from "./map-palette";
|
|
30
30
|
export { mapAttribution, mapStyle } from "./map-style";
|
|
31
31
|
export { MARKDOWN_CALLOUT_CLASSES, MARKDOWN_CALLOUT_ICON_ATTRIBUTES, markdownInfoBlocks, renderMarkdownInfoBlock, scanMarkdownInfoBlock } from "./markdown-info-blocks";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["content/index.ts"],"sourcesContent":["export type {\n CalendarAttendee,\n CalendarCommand,\n CalendarController,\n CalendarCustomView,\n CalendarDayBadge,\n CalendarEvent,\n CalendarEventColor,\n CalendarEventRenderContext,\n CalendarEventTimeChange,\n CalendarExternalDrag,\n CalendarLabels,\n CalendarProps,\n CalendarQuickCreateControls,\n CalendarRange,\n CalendarRecurrence,\n CalendarResource,\n CalendarSelectionControls,\n CalendarView,\n} from \"./Calendar\";\nexport { default as Calendar } from \"./Calendar\";\n\nexport type { ChartKind, ChartLabels, ChartProps, ChartRenderOptions } from \"./Chart\";\nexport { default as Chart } from \"./Chart\";\nexport type { ChartExplorerColumn, ChartExplorerProps, ChartLegendEntry } from \"./ChartExplorer\";\nexport { ChartExplorer } from \"./ChartExplorer\";\nexport type { ChartExplorerControlsProps } from \"./ChartExplorerControls\";\nexport { ChartExplorerControls } from \"./ChartExplorerControls\";\nexport { ChartFilterControls, type ChartFilterControlsProps } from \"./ChartFilterControls\";\nexport { ChartSnapshotView } from \"./ChartSnapshotView\";\nexport type { CodeDisplayLanguage, CodeDisplayProps } from \"./CodeDisplay\";\nexport { default as CodeDisplay } from \"./CodeDisplay\";\nexport { type ChartCursor, createChartCursor } from \"./chart-cursor\";\nexport type {\n ChartExplorerCharts,\n ChartExplorerController,\n ChartExplorerData,\n ChartExplorerOptions,\n ChartExplorerRequest,\n ChartExplorerRow,\n ChartExplorerSnapshot,\n} from \"./chart-explorer\";\nexport { createChartExplorer } from \"./chart-explorer\";\nexport type { ChartDatumRef, ChartSelection, ChartTooltip, ChartTooltipFormatter } from \"./chart-inspection-core\";\nexport type { ChartSnapshot } from \"./chart-snapshot\";\nexport { prepareChartSnapshot } from \"./chart-snapshot\";\nexport type {\n StateTimelineChartOptions,\n StateTimelineDomain,\n StateTimelineInterval,\n StateTimelineRow,\n StateTimelineState,\n} from \"./chart-state-timeline\";\nexport { highlightSql } from \"./code-highlight\";\nexport { type CollectionSelection, createCollectionSelection, type SelectionModifiers } from \"./collection-selection\";\nexport type {\n DataTableColumn,\n DataTableControlsProps,\n DataTableFooter,\n DataTableHeaderProps,\n DataTablePanelFooterProps,\n DataTablePanelProps,\n DataTableProps,\n DataTableRenderCell,\n DataTableRenderHeader,\n DataTableSort,\n} from \"./DataTable\";\nexport { default as DataTable } from \"./DataTable\";\nexport type { DocCodeHighlighter, DocCodeProps, DocConcept, DocNoteVariant, DocRow } from \"./Docs\";\nexport { DocCode, DocConceptGrid, DocInlineCode, DocLead, DocNote, DocPage, DocRows, DocSection } from \"./Docs\";\nexport { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFileBrowser } from \"./FileBrowser\";\nexport { FileGrid, type FileGridProps } from \"./FileGrid\";\nexport { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from \"./FileTree\";\nexport { type FileType, FileTypeIcon, type FileTypeIconProps, fileTypeOf } from \"./FileTypeIcon\";\nexport {\n canPreviewFile,\n default as FileView,\n type FileViewContent,\n type FileViewFile,\n type FileViewPreviewKind,\n type FileViewProps,\n type FileViewRenderer,\n type FileViewRendererProps,\n formatFileViewSize,\n getFileViewPreviewKind,\n} from \"./FileView\";\nexport type { KbdProps } from \"./Kbd\";\nexport { Kbd } from \"./Kbd\";\nexport type { LabelChipProps } from \"./LabelChip\";\nexport { LabelChip } from \"./LabelChip\";\nexport type { LightboxAction, LightboxImage } from \"./Lightbox\";\nexport { default as Lightbox } from \"./Lightbox\";\nexport type { LogTableEntry } from \"./LogEntriesTable\";\nexport { default as LogEntriesTable } from \"./LogEntriesTable\";\nexport { MapAttribution } from \"./MapAttribution\";\nexport { MapView } from \"./MapView\";\nexport { MapViewFrame } from \"./MapViewFrame\";\nexport { default as MarkdownView, type MarkdownRenderOptions, type MarkdownViewProps, renderSafeMarkdown } from \"./MarkdownView\";\nexport type {\n MessageGroupEntry,\n MessageRowAction,\n MessageRowAttachment,\n MessageRowAuthor,\n MessageRowFile,\n MessageRowMedia,\n MessageRowProgress,\n MessageRowProps,\n MessageRowQuote,\n MessageRowReaction,\n MessageRowStatus,\n MessageRowThread,\n MessageSystemRowProps,\n} from \"./MessageRow\";\nexport { MessageRow, MessageSystemRow, startsMessageGroup } from \"./MessageRow\";\nexport { type MapPaletteColors, type MapTheme, mapPalette } from \"./map-palette\";\nexport { type MapStyleOptions, mapAttribution, mapStyle } from \"./map-style\";\nexport type {\n MapViewArea,\n MapViewFit,\n MapViewFrameProps,\n MapViewLine,\n MapViewLineTone,\n MapViewMarker,\n MapViewOwnLocation,\n MapViewPoint,\n MapViewProps,\n MapViewStyle,\n MapViewStyleSource,\n MapViewTone,\n} from \"./map-view-types\";\nexport {\n MARKDOWN_CALLOUT_CLASSES,\n MARKDOWN_CALLOUT_ICON_ATTRIBUTES,\n type MarkdownInfoBlock,\n type MarkdownInfoBlockRenderInput,\n type MarkdownInfoBlockType,\n markdownInfoBlocks,\n renderMarkdownInfoBlock,\n scanMarkdownInfoBlock,\n} from \"./markdown-info-blocks\";\nexport {\n type MarkdownLinkInput,\n type MarkdownReference,\n type MarkdownReferenceKind,\n type MarkdownReferenceType,\n markdownLinkReference,\n markdownReferenceIcon,\n markdownReferenceType,\n markdownReferenceTypeLabel,\n markStandaloneLinks,\n renderMarkdownLink,\n} from \"./markdown-links\";\nexport { Pagination, type PaginationProps } from \"./Pagination\";\nexport type { PdfPreviewProps, PdfPreviewRequest } from \"./PdfPreview\";\nexport { default as PdfPreview } from \"./PdfPreview\";\nexport type { RangeOption, RangePickerProps } from \"./RangePicker\";\nexport { default as RangePicker } from \"./RangePicker\";\nexport { ReactionBar, type ReactionBarItem, type ReactionBarProps } from \"./ReactionBar\";\nexport type {\n ReferenceChipObjectProps,\n ReferenceChipPersonProps,\n ReferenceChipProps,\n ReferenceChipTimeProps,\n} from \"./ReferenceChip\";\nexport { REFERENCE_CHIP_MAX_CHARACTERS, ReferenceChip, truncateMiddle } from \"./ReferenceChip\";\nexport type { StepsProps } from \"./Steps\";\nexport { Steps } from \"./Steps\";\nexport type { StructuredDataPreviewMode, StructuredDataPreviewProps, StructuredDataValue } from \"./StructuredDataPreview\";\nexport { default as StructuredDataPreview, isStructuredDataValue } from \"./StructuredDataPreview\";\nexport type { TimelineColor, TimelineController, TimelineItem, TimelineProps } from \"./Timeline\";\nexport { default as Timeline } from \"./Timeline\";\nexport { VideoPlayer, type VideoPlayerProps } from \"./VideoPlayer\";\nexport type { VirtualFeedController, VirtualFeedProps, VirtualFeedScrollOptions } from \"./VirtualFeed\";\nexport { VirtualFeed } from \"./VirtualFeed\";\nexport type { ZoomPanAction, ZoomPanFullscreen, ZoomPanViewportProps } from \"./ZoomPanViewport\";\nexport { ZoomPanViewport } from \"./ZoomPanViewport\";\n"],"mappings":"AAoBA,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAGhD,SAAS,OAAO,IAAI,KAAK,QAAQ,SAAS;AAE1C,SAAS,aAAa,QAAQ,iBAAiB;AAE/C,SAAS,qBAAqB,QAAQ,yBAAyB;AAC/D,SAAS,mBAAmB,QAAuC,uBAAuB;AAC1F,SAAS,iBAAiB,QAAQ,qBAAqB;AAEvD,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AACtD,SAA2B,iBAAiB,QAAQ,gBAAgB;AAUpE,SAAS,mBAAmB,QAAQ,kBAAkB;AAGtD,SAAS,oBAAoB,QAAQ,kBAAkB;AAQvD,SAAS,YAAY,QAAQ,kBAAkB;AAC/C,SAAmC,yBAAyB,QAAiC,wBAAwB;AAarH,SAAS,OAAO,IAAI,SAAS,QAAQ,aAAa;AAElD,SAAS,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,QAAQ,QAAQ;AAC/G,SAAS,gBAAgB,EAA+C,eAAe,QAAQ,eAAe;AAC9G,SAAS,QAAQ,
|
|
1
|
+
{"version":3,"names":[],"sources":["content/index.ts"],"sourcesContent":["export type {\n CalendarAttendee,\n CalendarCommand,\n CalendarController,\n CalendarCustomView,\n CalendarDayBadge,\n CalendarEvent,\n CalendarEventColor,\n CalendarEventRenderContext,\n CalendarEventTimeChange,\n CalendarExternalDrag,\n CalendarLabels,\n CalendarProps,\n CalendarQuickCreateControls,\n CalendarRange,\n CalendarRecurrence,\n CalendarResource,\n CalendarSelectionControls,\n CalendarView,\n} from \"./Calendar\";\nexport { default as Calendar } from \"./Calendar\";\n\nexport type { ChartKind, ChartLabels, ChartProps, ChartRenderOptions } from \"./Chart\";\nexport { default as Chart } from \"./Chart\";\nexport type { ChartExplorerColumn, ChartExplorerProps, ChartLegendEntry } from \"./ChartExplorer\";\nexport { ChartExplorer } from \"./ChartExplorer\";\nexport type { ChartExplorerControlsProps } from \"./ChartExplorerControls\";\nexport { ChartExplorerControls } from \"./ChartExplorerControls\";\nexport { ChartFilterControls, type ChartFilterControlsProps } from \"./ChartFilterControls\";\nexport { ChartSnapshotView } from \"./ChartSnapshotView\";\nexport type { CodeDisplayLanguage, CodeDisplayProps } from \"./CodeDisplay\";\nexport { default as CodeDisplay } from \"./CodeDisplay\";\nexport { type ChartCursor, createChartCursor } from \"./chart-cursor\";\nexport type {\n ChartExplorerCharts,\n ChartExplorerController,\n ChartExplorerData,\n ChartExplorerOptions,\n ChartExplorerRequest,\n ChartExplorerRow,\n ChartExplorerSnapshot,\n} from \"./chart-explorer\";\nexport { createChartExplorer } from \"./chart-explorer\";\nexport type { ChartDatumRef, ChartSelection, ChartTooltip, ChartTooltipFormatter } from \"./chart-inspection-core\";\nexport type { ChartSnapshot } from \"./chart-snapshot\";\nexport { prepareChartSnapshot } from \"./chart-snapshot\";\nexport type {\n StateTimelineChartOptions,\n StateTimelineDomain,\n StateTimelineInterval,\n StateTimelineRow,\n StateTimelineState,\n} from \"./chart-state-timeline\";\nexport { highlightSql } from \"./code-highlight\";\nexport { type CollectionSelection, createCollectionSelection, type SelectionModifiers } from \"./collection-selection\";\nexport type {\n DataTableColumn,\n DataTableControlsProps,\n DataTableFooter,\n DataTableHeaderProps,\n DataTablePanelFooterProps,\n DataTablePanelProps,\n DataTableProps,\n DataTableRenderCell,\n DataTableRenderHeader,\n DataTableSort,\n} from \"./DataTable\";\nexport { default as DataTable } from \"./DataTable\";\nexport type { DocCodeHighlighter, DocCodeProps, DocConcept, DocNoteVariant, DocRow } from \"./Docs\";\nexport { DocCode, DocConceptGrid, DocInlineCode, DocLead, DocNote, DocPage, DocRows, DocSection } from \"./Docs\";\nexport { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFileBrowser } from \"./FileBrowser\";\nexport { FileGrid, type FileGridGroup, type FileGridOpenProps, type FileGridProps, type FileGridSelectableProps } from \"./FileGrid\";\nexport { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from \"./FileTree\";\nexport { type FileType, FileTypeIcon, type FileTypeIconProps, fileKindLabel, fileTypeOf } from \"./FileTypeIcon\";\nexport {\n canPreviewFile,\n default as FileView,\n type FileViewContent,\n type FileViewFile,\n type FileViewPreviewKind,\n type FileViewProps,\n type FileViewRenderer,\n type FileViewRendererProps,\n formatFileViewSize,\n getFileViewPreviewKind,\n} from \"./FileView\";\nexport type { KbdProps } from \"./Kbd\";\nexport { Kbd } from \"./Kbd\";\nexport type { LabelChipProps } from \"./LabelChip\";\nexport { LabelChip } from \"./LabelChip\";\nexport type { LightboxAction, LightboxImage } from \"./Lightbox\";\nexport { default as Lightbox } from \"./Lightbox\";\nexport type { LogTableEntry } from \"./LogEntriesTable\";\nexport { default as LogEntriesTable } from \"./LogEntriesTable\";\nexport { MapAttribution } from \"./MapAttribution\";\nexport { MapView } from \"./MapView\";\nexport { MapViewFrame } from \"./MapViewFrame\";\nexport { default as MarkdownView, type MarkdownRenderOptions, type MarkdownViewProps, renderSafeMarkdown } from \"./MarkdownView\";\nexport type {\n MessageEventGroupProps,\n MessageEventRowProps,\n MessageGroupEntry,\n MessageRowAction,\n MessageRowAttachment,\n MessageRowAuthor,\n MessageRowFile,\n MessageRowMedia,\n MessageRowOrigin,\n MessageRowProgress,\n MessageRowProps,\n MessageRowQuote,\n MessageRowReaction,\n MessageRowStatus,\n MessageRowThread,\n MessageSystemRowProps,\n} from \"./MessageRow\";\nexport { MessageEventGroup, MessageEventRow, MessageRow, MessageSystemRow, startsMessageGroup } from \"./MessageRow\";\nexport { type MapPaletteColors, type MapTheme, mapPalette } from \"./map-palette\";\nexport { type MapStyleOptions, mapAttribution, mapStyle } from \"./map-style\";\nexport type {\n MapViewArea,\n MapViewFit,\n MapViewFrameProps,\n MapViewLine,\n MapViewLineTone,\n MapViewMarker,\n MapViewOwnLocation,\n MapViewPoint,\n MapViewProps,\n MapViewStyle,\n MapViewStyleSource,\n MapViewTone,\n} from \"./map-view-types\";\nexport {\n MARKDOWN_CALLOUT_CLASSES,\n MARKDOWN_CALLOUT_ICON_ATTRIBUTES,\n type MarkdownInfoBlock,\n type MarkdownInfoBlockRenderInput,\n type MarkdownInfoBlockType,\n markdownInfoBlocks,\n renderMarkdownInfoBlock,\n scanMarkdownInfoBlock,\n} from \"./markdown-info-blocks\";\nexport {\n type MarkdownLinkInput,\n type MarkdownReference,\n type MarkdownReferenceKind,\n type MarkdownReferenceType,\n markdownLinkReference,\n markdownReferenceIcon,\n markdownReferenceType,\n markdownReferenceTypeLabel,\n markStandaloneLinks,\n renderMarkdownLink,\n} from \"./markdown-links\";\nexport { Pagination, type PaginationProps } from \"./Pagination\";\nexport type { PdfPreviewProps, PdfPreviewRequest } from \"./PdfPreview\";\nexport { default as PdfPreview } from \"./PdfPreview\";\nexport type { RangeOption, RangePickerProps } from \"./RangePicker\";\nexport { default as RangePicker } from \"./RangePicker\";\nexport { ReactionBar, type ReactionBarItem, type ReactionBarProps } from \"./ReactionBar\";\nexport type {\n ReferenceChipObjectProps,\n ReferenceChipPersonProps,\n ReferenceChipProps,\n ReferenceChipTimeProps,\n} from \"./ReferenceChip\";\nexport { REFERENCE_CHIP_MAX_CHARACTERS, ReferenceChip, truncateMiddle } from \"./ReferenceChip\";\nexport type { StepsProps } from \"./Steps\";\nexport { Steps } from \"./Steps\";\nexport type { StructuredDataPreviewMode, StructuredDataPreviewProps, StructuredDataValue } from \"./StructuredDataPreview\";\nexport { default as StructuredDataPreview, isStructuredDataValue } from \"./StructuredDataPreview\";\nexport type { TimelineColor, TimelineController, TimelineItem, TimelineProps } from \"./Timeline\";\nexport { default as Timeline } from \"./Timeline\";\nexport { VideoPlayer, type VideoPlayerProps } from \"./VideoPlayer\";\nexport type { VirtualFeedController, VirtualFeedProps, VirtualFeedScrollOptions } from \"./VirtualFeed\";\nexport { VirtualFeed } from \"./VirtualFeed\";\nexport type { ZoomPanAction, ZoomPanFullscreen, ZoomPanViewportProps } from \"./ZoomPanViewport\";\nexport { ZoomPanViewport } from \"./ZoomPanViewport\";\n"],"mappings":"AAoBA,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAGhD,SAAS,OAAO,IAAI,KAAK,QAAQ,SAAS;AAE1C,SAAS,aA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e;AAChF,SAA+B,cAAc,EAAE,QAAQ,QAAQ,aAAa;AAe5E,SACE,wBAAwB,EACxB,gCAAgC,EAIhC,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,QAChB,wBAAwB;AAC/B,SAKE,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,QACb,kBAAkB;AACzB,SAAS,UAAU,QAA8B,cAAc;AAE/D,SAAS,OAAO,IAAI,UAAU,QAAQ,cAAc;AAEpD,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AACtD,SAAS,WAAW,QAAqD,eAAe;AAOxF,SAAS,6BAA6B,EAAE,aAAa,EAAE,cAAc,QAAQ,iBAAiB;AAE9F,SAAS,KAAK,QAAQ,SAAS;AAE/B,SAAS,OAAO,IAAI,qBAAqB,EAAE,qBAAqB,QAAQ,yBAAyB;AAEjG,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAChD,SAAS,WAAW,QAA+B,eAAe;AAElE,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,eAAe,QAAQ,mBAAmB","ignoreList":[]}
|
|
@@ -41,6 +41,7 @@ function TooltipSurface(props) {
|
|
|
41
41
|
};
|
|
42
42
|
function dismissOnEscape(event) {
|
|
43
43
|
if (event.key !== "Escape" || !surface?.matches(":popover-open")) return;
|
|
44
|
+
event.preventDefault();
|
|
44
45
|
dismissedUntilLeave = true;
|
|
45
46
|
close();
|
|
46
47
|
}
|
|
@@ -82,18 +83,25 @@ function TooltipSurface(props) {
|
|
|
82
83
|
onMount(() => {
|
|
83
84
|
target = props.target();
|
|
84
85
|
if (!target) return;
|
|
86
|
+
const focusHost = props.focusTarget?.() ?? target;
|
|
85
87
|
|
|
86
88
|
// Server HTML may carry a native title as the no-JavaScript hint; once
|
|
87
89
|
// hydrated, this surface replaces it so the hint does not appear twice.
|
|
88
90
|
const originalTitle = target.getAttribute("title");
|
|
89
91
|
target.removeAttribute("title");
|
|
90
92
|
// A hint that only repeats the control's accessible name adds nothing for
|
|
91
|
-
// assistive technology, so it does not become a description.
|
|
92
|
-
|
|
93
|
-
const
|
|
93
|
+
// assistive technology, so it does not become a description. A focus
|
|
94
|
+
// container without an aria-label is named by the target's own label text.
|
|
95
|
+
const hint = surface?.textContent?.trim();
|
|
96
|
+
const label = focusHost.getAttribute("aria-label");
|
|
97
|
+
const repeatsName = label !== null ? hint === label.trim() : Boolean(props.focusTarget && hint && target.textContent?.includes(hint));
|
|
98
|
+
const originalDescription = focusHost.getAttribute("aria-describedby");
|
|
94
99
|
const descriptions = new Set(originalDescription?.split(/\s+/).filter(Boolean) ?? []);
|
|
95
100
|
if (!repeatsName) descriptions.add(tooltipId);
|
|
96
|
-
|
|
101
|
+
// A focus container named by its content, such as a tree item, would read
|
|
102
|
+
// the open hint as part of its name; a description still reads it.
|
|
103
|
+
if (surface && focusHost !== target && focusHost.contains(surface)) surface.setAttribute("aria-hidden", "true");
|
|
104
|
+
if (descriptions.size > 0) focusHost.setAttribute("aria-describedby", [...descriptions].join(" "));
|
|
97
105
|
|
|
98
106
|
// Touch has no hover, so a tap never opens the hint; the label stays the
|
|
99
107
|
// accessible name.
|
|
@@ -103,33 +111,42 @@ function TooltipSurface(props) {
|
|
|
103
111
|
// Only visible focus, as from the keyboard, opens the hint. Focus that a
|
|
104
112
|
// click or tap gives, or that a closing overlay returns silently, does not.
|
|
105
113
|
const focusIn = event => {
|
|
106
|
-
|
|
114
|
+
const focused = event.target;
|
|
115
|
+
if ((focusHost === target || focused === focusHost) && focused?.matches?.(":focus-visible")) open();
|
|
107
116
|
};
|
|
108
117
|
const leave = () => {
|
|
109
118
|
dismissedUntilLeave = false;
|
|
110
119
|
close();
|
|
111
120
|
};
|
|
112
121
|
const focusOut = event => {
|
|
113
|
-
if (!target
|
|
122
|
+
if (focusHost === target ? !target.contains(event.relatedTarget) : event.target === focusHost) leave();
|
|
114
123
|
};
|
|
115
|
-
const
|
|
124
|
+
const dismissForUse = () => {
|
|
116
125
|
dismissedUntilLeave = true;
|
|
117
126
|
close();
|
|
118
127
|
};
|
|
128
|
+
|
|
129
|
+
// Keyboard activation uses the control just as a pointer press does. Capture it before
|
|
130
|
+
// a local handler (for example drag pickup) stops propagation.
|
|
131
|
+
const keyDown = event => {
|
|
132
|
+
if (event.key === " " || event.key === "Enter") dismissForUse();
|
|
133
|
+
};
|
|
134
|
+
focusHost.addEventListener("keydown", keyDown, true);
|
|
119
135
|
target.addEventListener("pointerenter", enter);
|
|
120
136
|
target.addEventListener("pointerleave", leave);
|
|
121
|
-
target.addEventListener("pointerdown",
|
|
122
|
-
|
|
123
|
-
|
|
137
|
+
target.addEventListener("pointerdown", dismissForUse);
|
|
138
|
+
focusHost.addEventListener("focusin", focusIn);
|
|
139
|
+
focusHost.addEventListener("focusout", focusOut);
|
|
124
140
|
onCleanup(() => {
|
|
125
141
|
close();
|
|
126
142
|
if (originalTitle !== null) target?.setAttribute("title", originalTitle);
|
|
127
|
-
if (originalDescription)
|
|
143
|
+
if (originalDescription) focusHost.setAttribute("aria-describedby", originalDescription);else focusHost.removeAttribute("aria-describedby");
|
|
144
|
+
focusHost.removeEventListener("keydown", keyDown, true);
|
|
128
145
|
target?.removeEventListener("pointerenter", enter);
|
|
129
146
|
target?.removeEventListener("pointerleave", leave);
|
|
130
|
-
target?.removeEventListener("pointerdown",
|
|
131
|
-
|
|
132
|
-
|
|
147
|
+
target?.removeEventListener("pointerdown", dismissForUse);
|
|
148
|
+
focusHost.removeEventListener("focusin", focusIn);
|
|
149
|
+
focusHost.removeEventListener("focusout", focusOut);
|
|
133
150
|
});
|
|
134
151
|
});
|
|
135
152
|
return _$ssr(_tmpl$, _$ssrAttribute("id", _$escape(tooltipId, true), false), _$ssrAttribute("data-instant", props.delay !== undefined && props.delay <= 0 ? "true" : _$escape(undefined, true), false), _$escape(props.content));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["feedback/Tooltip.tsx"],"sourcesContent":["import { createContext, createEffect, createUniqueId, type JSX, onCleanup, onMount, splitProps, useContext } from \"solid-js\";\nimport { positionTooltipSurface, type TooltipPlacement } from \"./tooltip-position\";\n\nexport type TooltipProps = {\n content: JSX.Element;\n target: () => HTMLElement | undefined;\n placement?: TooltipPlacement;\n delay?: number;\n disabled?: boolean;\n};\n\nexport type TooltipAnchorProps = Omit<JSX.HTMLAttributes<HTMLSpanElement>, \"content\"> & Omit<TooltipProps, \"target\">;\n\nexport type TooltipTriggerProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, \"content\"> & Omit<TooltipProps, \"target\">;\n\n/** True below a Tooltip.Anchor, whose hint already covers the controls inside it. */\nconst AnchorContext = createContext(false);\n\n/**\n * The hint an icon-only control shows by default: its label, unless the caller\n * passes its own `tooltip` (or `false`) or an enclosing Tooltip.Anchor already\n * owns the hint.\n */\nexport const useLabelTooltip = (tooltip: () => JSX.Element | false | undefined, label: () => string | undefined) => {\n const anchored = useContext(AnchorContext);\n return (): JSX.Element | false | undefined => {\n const explicit = tooltip();\n if (explicit !== undefined) return explicit;\n return anchored ? false : label();\n };\n};\n\n/**\n * Low-level tooltip surface for components that already own their target DOM\n * element. Most callers should use Button.tooltip, IconButton.tooltip, or\n * Tooltip.Anchor instead.\n */\nfunction TooltipSurface(props: TooltipProps): JSX.Element {\n const tooltipId = `k2b-tooltip-${createUniqueId()}`;\n let surface: HTMLSpanElement | undefined;\n let target: HTMLElement | undefined;\n let openTimer: ReturnType<typeof setTimeout> | undefined;\n let dismissedUntilLeave = false;\n\n const clearTimer = () => {\n if (openTimer) clearTimeout(openTimer);\n openTimer = undefined;\n };\n\n function dismissOnEscape(event: KeyboardEvent) {\n if (event.key !== \"Escape\" || !surface?.matches(\":popover-open\")) return;\n dismissedUntilLeave = true;\n close();\n }\n\n function close() {\n clearTimer();\n if (surface?.matches(\":popover-open\")) {\n try {\n surface.hidePopover();\n } catch {\n // The surface may disconnect during cleanup.\n }\n }\n document.removeEventListener(\"keydown\", dismissOnEscape);\n window.removeEventListener(\"scroll\", close, true);\n window.removeEventListener(\"resize\", close);\n }\n\n const open = () => {\n clearTimer();\n if (props.disabled || dismissedUntilLeave || !surface || !target || surface.matches(\":popover-open\")) return;\n const show = () => {\n openTimer = undefined;\n if (props.disabled || !surface?.isConnected || !target) return;\n try {\n surface.showPopover();\n } catch {\n return;\n }\n positionTooltipSurface(surface, target, props.placement);\n document.addEventListener(\"keydown\", dismissOnEscape);\n window.addEventListener(\"scroll\", close, true);\n window.addEventListener(\"resize\", close);\n };\n const delay = props.delay ?? 250;\n if (delay <= 0) show();\n else openTimer = setTimeout(show, delay);\n };\n\n createEffect(() => {\n if (props.disabled) close();\n });\n\n onMount(() => {\n target = props.target();\n if (!target) return;\n\n // Server HTML may carry a native title as the no-JavaScript hint; once\n // hydrated, this surface replaces it so the hint does not appear twice.\n const originalTitle = target.getAttribute(\"title\");\n target.removeAttribute(\"title\");\n // A hint that only repeats the control's accessible name adds nothing for\n // assistive technology, so it does not become a description.\n const repeatsName = surface?.textContent?.trim() === target.getAttribute(\"aria-label\")?.trim();\n const originalDescription = target.getAttribute(\"aria-describedby\");\n const descriptions = new Set(originalDescription?.split(/\\s+/).filter(Boolean) ?? []);\n if (!repeatsName) descriptions.add(tooltipId);\n if (descriptions.size > 0) target.setAttribute(\"aria-describedby\", [...descriptions].join(\" \"));\n\n // Touch has no hover, so a tap never opens the hint; the label stays the\n // accessible name.\n const enter = (event: PointerEvent) => {\n if (event.pointerType !== \"touch\") open();\n };\n // Only visible focus, as from the keyboard, opens the hint. Focus that a\n // click or tap gives, or that a closing overlay returns silently, does not.\n const focusIn = (event: FocusEvent) => {\n if ((event.target as Element | null)?.matches?.(\":focus-visible\")) open();\n };\n const leave = () => {\n dismissedUntilLeave = false;\n close();\n };\n const focusOut = (event: FocusEvent) => {\n if (!target?.contains(event.relatedTarget as Node | null)) leave();\n };\n const pointerDown = () => {\n dismissedUntilLeave = true;\n close();\n };\n\n target.addEventListener(\"pointerenter\", enter);\n target.addEventListener(\"pointerleave\", leave);\n target.addEventListener(\"pointerdown\", pointerDown);\n target.addEventListener(\"focusin\", focusIn);\n target.addEventListener(\"focusout\", focusOut);\n\n onCleanup(() => {\n close();\n if (originalTitle !== null) target?.setAttribute(\"title\", originalTitle);\n if (originalDescription) target?.setAttribute(\"aria-describedby\", originalDescription);\n else target?.removeAttribute(\"aria-describedby\");\n target?.removeEventListener(\"pointerenter\", enter);\n target?.removeEventListener(\"pointerleave\", leave);\n target?.removeEventListener(\"pointerdown\", pointerDown);\n target?.removeEventListener(\"focusin\", focusIn);\n target?.removeEventListener(\"focusout\", focusOut);\n });\n });\n\n return (\n <span\n ref={surface}\n id={tooltipId}\n role=\"tooltip\"\n popover=\"manual\"\n class=\"k2b-tooltip\"\n data-instant={props.delay !== undefined && props.delay <= 0 ? \"true\" : undefined}\n >\n {props.content}\n </span>\n );\n}\n\n/** Explicit tooltip target for non-button content. */\nfunction TooltipAnchor(props: TooltipAnchorProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"children\", \"class\", \"content\", \"delay\", \"disabled\", \"placement\"]);\n let target: HTMLSpanElement | undefined;\n\n return (\n <span {...rest} ref={target} class={`k2b-tooltip-wrapper ${local.class ?? \"\"}`}>\n <AnchorContext.Provider value={true}>{local.children}</AnchorContext.Provider>\n <TooltipSurface\n content={local.content}\n target={() => target}\n delay={local.delay}\n disabled={local.disabled}\n placement={local.placement}\n />\n </span>\n );\n}\n\n/** Native button target for specialized controls that do not use Button. */\nfunction TooltipTrigger(props: TooltipTriggerProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"children\", \"content\", \"delay\", \"disabled\", \"placement\", \"ref\"]);\n let target: HTMLButtonElement | undefined;\n const register = (element: HTMLButtonElement) => {\n target = element;\n if (typeof local.ref === \"function\") local.ref(element);\n };\n\n return (\n <>\n <button {...rest} ref={register} disabled={local.disabled}>\n {local.children}\n </button>\n <TooltipSurface\n content={local.content}\n target={() => target}\n delay={local.delay}\n disabled={local.disabled}\n placement={local.placement}\n />\n </>\n );\n}\n\ntype TooltipComponent = ((props: TooltipProps) => JSX.Element) & {\n Anchor: (props: TooltipAnchorProps) => JSX.Element;\n Trigger: (props: TooltipTriggerProps) => JSX.Element;\n};\n\nexport const Tooltip = TooltipSurface as TooltipComponent;\nTooltip.Anchor = TooltipAnchor;\nTooltip.Trigger = TooltipTrigger;\n\nexport type { TooltipPlacement } from \"./tooltip-position\";\n\nexport default Tooltip;\n"],"mappings":";;;;;;;AAAA,SAAS,aAAa,EAAE,YAAY,EAAE,cAAc,EAAY,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,QAAQ,UAAU;AAC5H,SAAS,sBAAsB,QAA+B,oBAAoB;AAclF;AACA,MAAM,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,eAAe,GAAG,CAAC,OAA8C,EAAE,KAA+B,KAAK;EAClH,MAAM,QAAQ,GAAG,UAAU,CAAC,aAAa,CAAC;EAC1C,OAAO,MAAuC;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC;IAC1B,IAAI,QAAQ,KAAK,SAAS,EAAE,OAAO,QAAQ;IAC3C,OAAO,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC;EACnC,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,KAAmB,EAAe;EACxD,MAAM,SAAS,GAAG,eAAe,cAAc,CAAC,CAAC,EAAE;EACnD,IAAI,OAAoC;EACxC,IAAI,MAA+B;EACnC,IAAI,SAAoD;EACxD,IAAI,mBAAmB,GAAG,KAAK;EAE/B,MAAM,UAAU,GAAG,MAAM;IACvB,IAAI,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC;IACtC,SAAS,GAAG,SAAS;EACvB,CAAC;EAED,SAAS,eAAe,CAAC,KAAoB,EAAE;IAC7C,IAAI,KAAK,CAAC,GAAG,KAAK,Q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AAI;IAAA,IAAiB,QAAQ;MAAA,OAAE,KAAK,CAAC,QAAQ;IAAA;EAAA,aACtD,KAAK,CAAC,QAAQ,6BAEhB,cAAc;IAAA,IACb,OAAO;MAAA,OAAE,KAAK,CAAC,OAAO;IAAA;IACtB,MAAM,EAAE,MAAM,MAAM;IAAA,IACpB,KAAK;MAAA,OAAE,KAAK,CAAC,KAAK;IAAA;IAAA,IAClB,QAAQ;MAAA,OAAE,KAAK,CAAC,QAAQ;IAAA;IAAA,IACxB,SAAS;MAAA,OAAE,KAAK,CAAC,SAAS;IAAA;EAAA;AAIlC;AAOA,OAAO,MAAM,OAAO,GAAG,cAAkC;AACzD,OAAO,CAAC,MAAM,GAAG,aAAa;AAC9B,OAAO,CAAC,OAAO,GAAG,cAAc;AAIhC,eAAe,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["feedback/Tooltip.tsx"],"sourcesContent":["import { createContext, createEffect, createUniqueId, type JSX, onCleanup, onMount, splitProps, useContext } from \"solid-js\";\nimport { positionTooltipSurface, type TooltipPlacement } from \"./tooltip-position\";\n\nexport type TooltipProps = {\n content: JSX.Element;\n target: () => HTMLElement | undefined;\n placement?: TooltipPlacement;\n delay?: number;\n disabled?: boolean;\n /**\n * The element whose keyboard focus opens the hint, when a container holds\n * the focus instead of `target` (a tree item around its row). Defaults to\n * `target`.\n */\n focusTarget?: () => HTMLElement | undefined;\n};\n\nexport type TooltipAnchorProps = Omit<JSX.HTMLAttributes<HTMLSpanElement>, \"content\"> & Omit<TooltipProps, \"target\" | \"focusTarget\">;\n\nexport type TooltipTriggerProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, \"content\"> &\n Omit<TooltipProps, \"target\" | \"focusTarget\">;\n\n/** True below a Tooltip.Anchor, whose hint already covers the controls inside it. */\nconst AnchorContext = createContext(false);\n\n/**\n * The hint an icon-only control shows by default: its label, unless the caller\n * passes its own `tooltip` (or `false`) or an enclosing Tooltip.Anchor already\n * owns the hint.\n */\nexport const useLabelTooltip = (tooltip: () => JSX.Element | false | undefined, label: () => string | undefined) => {\n const anchored = useContext(AnchorContext);\n return (): JSX.Element | false | undefined => {\n const explicit = tooltip();\n if (explicit !== undefined) return explicit;\n return anchored ? false : label();\n };\n};\n\n/**\n * Low-level tooltip surface for components that already own their target DOM\n * element. Most callers should use Button.tooltip, IconButton.tooltip, or\n * Tooltip.Anchor instead.\n */\nfunction TooltipSurface(props: TooltipProps): JSX.Element {\n const tooltipId = `k2b-tooltip-${createUniqueId()}`;\n let surface: HTMLSpanElement | undefined;\n let target: HTMLElement | undefined;\n let openTimer: ReturnType<typeof setTimeout> | undefined;\n let dismissedUntilLeave = false;\n\n const clearTimer = () => {\n if (openTimer) clearTimeout(openTimer);\n openTimer = undefined;\n };\n\n function dismissOnEscape(event: KeyboardEvent) {\n if (event.key !== \"Escape\" || !surface?.matches(\":popover-open\")) return;\n event.preventDefault();\n dismissedUntilLeave = true;\n close();\n }\n\n function close() {\n clearTimer();\n if (surface?.matches(\":popover-open\")) {\n try {\n surface.hidePopover();\n } catch {\n // The surface may disconnect during cleanup.\n }\n }\n document.removeEventListener(\"keydown\", dismissOnEscape);\n window.removeEventListener(\"scroll\", close, true);\n window.removeEventListener(\"resize\", close);\n }\n\n const open = () => {\n clearTimer();\n if (props.disabled || dismissedUntilLeave || !surface || !target || surface.matches(\":popover-open\")) return;\n const show = () => {\n openTimer = undefined;\n if (props.disabled || !surface?.isConnected || !target) return;\n try {\n surface.showPopover();\n } catch {\n return;\n }\n positionTooltipSurface(surface, target, props.placement);\n document.addEventListener(\"keydown\", dismissOnEscape);\n window.addEventListener(\"scroll\", close, true);\n window.addEventListener(\"resize\", close);\n };\n const delay = props.delay ?? 250;\n if (delay <= 0) show();\n else openTimer = setTimeout(show, delay);\n };\n\n createEffect(() => {\n if (props.disabled) close();\n });\n\n onMount(() => {\n target = props.target();\n if (!target) return;\n const focusHost = props.focusTarget?.() ?? target;\n\n // Server HTML may carry a native title as the no-JavaScript hint; once\n // hydrated, this surface replaces it so the hint does not appear twice.\n const originalTitle = target.getAttribute(\"title\");\n target.removeAttribute(\"title\");\n // A hint that only repeats the control's accessible name adds nothing for\n // assistive technology, so it does not become a description. A focus\n // container without an aria-label is named by the target's own label text.\n const hint = surface?.textContent?.trim();\n const label = focusHost.getAttribute(\"aria-label\");\n const repeatsName = label !== null ? hint === label.trim() : Boolean(props.focusTarget && hint && target.textContent?.includes(hint));\n const originalDescription = focusHost.getAttribute(\"aria-describedby\");\n const descriptions = new Set(originalDescription?.split(/\\s+/).filter(Boolean) ?? []);\n if (!repeatsName) descriptions.add(tooltipId);\n // A focus container named by its content, such as a tree item, would read\n // the open hint as part of its name; a description still reads it.\n if (surface && focusHost !== target && focusHost.contains(surface)) surface.setAttribute(\"aria-hidden\", \"true\");\n if (descriptions.size > 0) focusHost.setAttribute(\"aria-describedby\", [...descriptions].join(\" \"));\n\n // Touch has no hover, so a tap never opens the hint; the label stays the\n // accessible name.\n const enter = (event: PointerEvent) => {\n if (event.pointerType !== \"touch\") open();\n };\n // Only visible focus, as from the keyboard, opens the hint. Focus that a\n // click or tap gives, or that a closing overlay returns silently, does not.\n const focusIn = (event: FocusEvent) => {\n const focused = event.target as Element | null;\n if ((focusHost === target || focused === focusHost) && focused?.matches?.(\":focus-visible\")) open();\n };\n const leave = () => {\n dismissedUntilLeave = false;\n close();\n };\n const focusOut = (event: FocusEvent) => {\n if (focusHost === target ? !target.contains(event.relatedTarget as Node | null) : event.target === focusHost) leave();\n };\n const dismissForUse = () => {\n dismissedUntilLeave = true;\n close();\n };\n\n // Keyboard activation uses the control just as a pointer press does. Capture it before\n // a local handler (for example drag pickup) stops propagation.\n const keyDown = (event: KeyboardEvent) => {\n if (event.key === \" \" || event.key === \"Enter\") dismissForUse();\n };\n\n focusHost.addEventListener(\"keydown\", keyDown, true);\n target.addEventListener(\"pointerenter\", enter);\n target.addEventListener(\"pointerleave\", leave);\n target.addEventListener(\"pointerdown\", dismissForUse);\n focusHost.addEventListener(\"focusin\", focusIn);\n focusHost.addEventListener(\"focusout\", focusOut);\n\n onCleanup(() => {\n close();\n if (originalTitle !== null) target?.setAttribute(\"title\", originalTitle);\n if (originalDescription) focusHost.setAttribute(\"aria-describedby\", originalDescription);\n else focusHost.removeAttribute(\"aria-describedby\");\n focusHost.removeEventListener(\"keydown\", keyDown, true);\n target?.removeEventListener(\"pointerenter\", enter);\n target?.removeEventListener(\"pointerleave\", leave);\n target?.removeEventListener(\"pointerdown\", dismissForUse);\n focusHost.removeEventListener(\"focusin\", focusIn);\n focusHost.removeEventListener(\"focusout\", focusOut);\n });\n });\n\n return (\n <span\n ref={surface}\n id={tooltipId}\n role=\"tooltip\"\n popover=\"manual\"\n class=\"k2b-tooltip\"\n data-instant={props.delay !== undefined && props.delay <= 0 ? \"true\" : undefined}\n >\n {props.content}\n </span>\n );\n}\n\n/** Explicit tooltip target for non-button content. */\nfunction TooltipAnchor(props: TooltipAnchorProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"children\", \"class\", \"content\", \"delay\", \"disabled\", \"placement\"]);\n let target: HTMLSpanElement | undefined;\n\n return (\n <span {...rest} ref={target} class={`k2b-tooltip-wrapper ${local.class ?? \"\"}`}>\n <AnchorContext.Provider value={true}>{local.children}</AnchorContext.Provider>\n <TooltipSurface\n content={local.content}\n target={() => target}\n delay={local.delay}\n disabled={local.disabled}\n placement={local.placement}\n />\n </span>\n );\n}\n\n/** Native button target for specialized controls that do not use Button. */\nfunction TooltipTrigger(props: TooltipTriggerProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"children\", \"content\", \"delay\", \"disabled\", \"placement\", \"ref\"]);\n let target: HTMLButtonElement | undefined;\n const register = (element: HTMLButtonElement) => {\n target = element;\n if (typeof local.ref === \"function\") local.ref(element);\n };\n\n return (\n <>\n <button {...rest} ref={register} disabled={local.disabled}>\n {local.children}\n </button>\n <TooltipSurface\n content={local.content}\n target={() => target}\n delay={local.delay}\n disabled={local.disabled}\n placement={local.placement}\n />\n </>\n );\n}\n\ntype TooltipComponent = ((props: TooltipProps) => JSX.Element) & {\n Anchor: (props: TooltipAnchorProps) => JSX.Element;\n Trigger: (props: TooltipTriggerProps) => JSX.Element;\n};\n\nexport const Tooltip = TooltipSurface as TooltipComponent;\nTooltip.Anchor = TooltipAnchor;\nTooltip.Trigger = TooltipTrigger;\n\nexport type { TooltipPlacement } from \"./tooltip-position\";\n\nexport default Tooltip;\n"],"mappings":";;;;;;;AAAA,SAAS,aAAa,EAAE,YAAY,EAAE,cAAc,EAAY,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,QAAQ,UAAU;AAC5H,SAAS,sBAAsB,QAA+B,oBAAoB;AAqBlF;AACA,MAAM,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,eAAe,GAAG,CAAC,OAA8C,EAAE,KAA+B,KAAK;EAClH,MAAM,QAAQ,GAAG,UAAU,CAAC,aAAa,CAAC;EAC1C,OAAO,MAAuC;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC;IAC1B,IAAI,QAAQ,KAAK,SAAS,EAAE,OAAO,QAAQ;IAC3C,OAAO,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC;EACnC,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,KAAmB,EAAe;EACxD,MAAM,SAAS,GAAG,eAAe,cAAc,CAAC,CAAC,EAAE;EACnD,IAAI,OAAoC;EACxC,IAAI,MAA+B;EACnC,IAAI,SAAoD;EACxD,IAAI,mBAAmB,GAAG,KAAK;EAE/B,MAAM,UAAU,GAAG,MAAM;IACvB,IAAI,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC;IACtC,SAAS,GAAG,SAAS;EACvB,CAAC;EAED,SAAS,eAAe,CAAC,KAAoB,EAAE;IAC7C,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,OAAO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AIlC;AAOA,OAAO,MAAM,OAAO,GAAG,cAAkC;AACzD,OAAO,CAAC,MAAM,GAAG,aAAa;AAC9B,OAAO,CAAC,OAAO,GAAG,cAAc;AAIhC,eAAe,OAAO","ignoreList":[]}
|
|
@@ -31,8 +31,11 @@ const resolveInitialFocusTarget = (entry, dialog) => {
|
|
|
31
31
|
return input ?? entry.container.querySelector("input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), a[href], [tabindex]:not([tabindex='-1'])");
|
|
32
32
|
};
|
|
33
33
|
const applyAccessibleName = (dialog, entry) => {
|
|
34
|
+
dialog.setAttribute("role", entry.role);
|
|
34
35
|
dialog.removeAttribute("aria-label");
|
|
35
36
|
dialog.removeAttribute("aria-labelledby");
|
|
37
|
+
dialog.removeAttribute("aria-describedby");
|
|
38
|
+
if (entry.ariaDescribedBy) dialog.setAttribute("aria-describedby", entry.ariaDescribedBy);
|
|
36
39
|
if (entry.ariaLabel) {
|
|
37
40
|
dialog.setAttribute("aria-label", entry.ariaLabel);
|
|
38
41
|
return;
|
|
@@ -416,6 +419,7 @@ export const createDialogCore = () => {
|
|
|
416
419
|
dialog.onclick = null;
|
|
417
420
|
dialog.removeAttribute("aria-label");
|
|
418
421
|
dialog.removeAttribute("aria-labelledby");
|
|
422
|
+
dialog.removeAttribute("aria-describedby");
|
|
419
423
|
if (dialog.open && typeof dialog.close === "function") dialog.close();else dialog.removeAttribute("open");
|
|
420
424
|
dialog.remove();
|
|
421
425
|
state.element = undefined;
|
|
@@ -485,6 +489,8 @@ export const createDialogCore = () => {
|
|
|
485
489
|
opener: activeElement instanceof HTMLElement ? activeElement : undefined,
|
|
486
490
|
openerRing: ringOnReturn(activeElement),
|
|
487
491
|
ariaLabel: options.ariaLabel,
|
|
492
|
+
ariaDescribedBy: options.ariaDescribedBy,
|
|
493
|
+
role: options.role ?? "dialog",
|
|
488
494
|
modal: true
|
|
489
495
|
};
|
|
490
496
|
return new Promise((resolve, reject) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["feedback/dialog-core.ts"],"sourcesContent":["import { createComponent, type JSX } from \"solid-js\";\nimport { render } from \"solid-js/web\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\nimport { getK2bPortalRoot } from \"../internal/portal\";\nimport { RenderErrorBoundary } from \"../internal/render-error\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport { isPointInsideToast } from \"./toast\";\n\nexport type DialogClose<T> = (result?: T) => void;\n\nexport type OpenDialogOptions = {\n /** Close only this dialog when its owning operation is cancelled. */\n signal?: AbortSignal;\n panelClassName?: string;\n contentClassName?: string;\n initialFocus?: \"first-input\" | \"none\" | ((dialog: HTMLDialogElement) => HTMLElement | null);\n cancelBehavior?: \"resolve-undefined\" | \"ignore\";\n ariaLabel?: string;\n /**\n * Add a same-URL history entry while the dialog is open, so the browser's or the phone's Back closes the dialog\n * instead of leaving the page. Normally closing the dialog removes the entry again; the returned promise settles after that.\n * With the Navigation API, same-URL traversals between this core's entries and the page do not reach application popstate listeners.\n * Without it, only the synthetic Back on close is suppressed.\n * Island disposal closes every open dialog immediately and forgets its marker without traversing history.\n * The same-URL entry remains for the router to replace and counts as a page entry for later dialogs.\n * A traversal that `@k2b/ssr/nav` hides from popstate listeners reaches this core through `ssr:nav-popstate`.\n */\n history?: boolean;\n};\n\nexport type DialogRender<T> = (\n close: DialogClose<T>,\n context: {\n dialog: HTMLDialogElement;\n /** Switch this entry between a modal and a modeless window without remounting. */\n setModal: (modal: boolean) => void;\n /** Set viewport coordinates, or restore the panel stylesheet position with null. */\n setPosition: (position: { x: number; y: number } | null) => void;\n /** Route Escape/backdrop through the same guarded handler as Cancel and X. */\n setDismissHandler: (handler: () => void | Promise<void>) => void;\n /** Request dismissal through this entry's cancellation policy and guard. */\n requestDismiss: () => Promise<void>;\n },\n) => JSX.Element;\n\nexport type DialogCore = {\n open: <T>(view: DialogRender<T>, options?: OpenDialogOptions) => Promise<T | undefined>;\n close: (result?: unknown) => void;\n isOpen: () => boolean;\n};\n\ntype DialogStackEntry = {\n container: HTMLDivElement;\n dispose?: () => void;\n resolve?: (value: unknown) => void;\n panelClassName: string;\n cancelBehavior: NonNullable<OpenDialogOptions[\"cancelBehavior\"]>;\n initialFocus: NonNullable<OpenDialogOptions[\"initialFocus\"]>;\n opener?: HTMLElement;\n openerRing: boolean;\n ariaLabel?: string;\n dismissHandler?: () => void | Promise<void>;\n dismissPending?: boolean;\n modal: boolean;\n position?: { x: number; y: number } | null;\n /** The marker of this dialog's history entry, for dialogs opened with `history`. */\n historyId?: number;\n};\n\ntype DialogState = {\n element?: HTMLDialogElement;\n modal?: boolean;\n stack: DialogStackEntry[];\n scrollLocked?: boolean;\n previousBodyOverflow?: string;\n previousHtmlOverflow?: string;\n mouseDownOnDialog?: boolean;\n connectionObserver?: MutationObserver;\n};\n\nconst DEFAULT_PANEL_CLASS = \"k2b-dialog\";\nconst DEFAULT_CONTENT_CLASS = \"k2b-dialog__viewport\";\n/** The frame of a dialog whose content could not render: a custom or bare surface may draw no frame of its own. */\nconst RENDER_ERROR_PANEL_CLASS = \"k2b-dialog k2b-dialog--small\";\nlet nextDialogTitleId = 0;\nlet nextHistoryId = 0;\n/** The history state key that marks a dialog's same-URL entry. */\nconst HISTORY_MARKER = \"k2bDialog\";\n\nconst historyRecord = (): Record<string, unknown> =>\n typeof history.state === \"object\" && history.state !== null ? { ...history.state } : {};\nconst historyMarker = (): unknown => historyRecord()[HISTORY_MARKER];\nconst historySnapshot = () => ({ href: location.href, length: history.length });\n\nconst resolveInitialFocusTarget = (entry: DialogStackEntry, dialog: HTMLDialogElement): HTMLElement | null => {\n const { initialFocus } = entry;\n if (initialFocus === \"none\") return null;\n if (typeof initialFocus === \"function\") return initialFocus(dialog);\n const input = entry.container.querySelector<HTMLElement>(\n \"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), [role='combobox']:not([disabled]):not([aria-disabled='true'])\",\n );\n return (\n input ??\n entry.container.querySelector<HTMLElement>(\n \"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), a[href], [tabindex]:not([tabindex='-1'])\",\n )\n );\n};\n\nconst applyAccessibleName = (dialog: HTMLDialogElement, entry: DialogStackEntry): void => {\n dialog.removeAttribute(\"aria-label\");\n dialog.removeAttribute(\"aria-labelledby\");\n if (entry.ariaLabel) {\n dialog.setAttribute(\"aria-label\", entry.ariaLabel);\n return;\n }\n const heading = entry.container.querySelector<HTMLElement>(\"h1, h2, h3\");\n if (!heading) {\n dialog.setAttribute(\"aria-label\", resolveUiMessages().dialog);\n return;\n }\n heading.id ||= `k2b-dialog-title-${++nextDialogTitleId}`;\n dialog.setAttribute(\"aria-labelledby\", heading.id);\n};\n\nconst schedule = (callback: () => void): void => {\n if (typeof requestAnimationFrame === \"function\") requestAnimationFrame(callback);\n else queueMicrotask(callback);\n};\n\n/**\n * Whether focus is still where closing a level left it, on the page or the\n * dialog: nothing took it before the next frame, neither a close handler nor a\n * Tab pressed right after Escape.\n */\nconst focusUnclaimed = (dialog: HTMLDialogElement): boolean => {\n const active = document.activeElement;\n return !active || active === document.body || active === dialog;\n};\n\n/** Checked by shape: a test harness or an iframe may create the event in another realm. */\nconst isPopState = (value: unknown): value is PopStateEvent =>\n typeof value === \"object\" && value !== null && \"type\" in value && value.type === \"popstate\" && \"state\" in value;\n\ntype HistoryEntry = { historyId?: number };\ntype HistoryHolder = HistoryEntry & { onBack: () => void };\n\nexport const createDialogCore = () => {\n const state: DialogState = { stack: [] };\n /** Markers of this core's entries in the browser history, oldest first. */\n let historyIds: number[] = [];\n const issued = new Set<number>();\n /**\n * Markers forgotten during island disposal. Their entries stay in `historyIds` as barriers: a synthetic Back never\n * crosses one, because the router may have replaced that entry with another page.\n */\n const forgotten = new Set<number>();\n const deadMarker = (marker: unknown): marker is number => typeof marker === \"number\" && forgotten.has(marker);\n /** How often islands were disposed, so a dialog that waits to open notices that a content swap happened meanwhile. */\n let disposals = 0;\n const ownMarker = (marker: unknown): marker is number => typeof marker === \"number\" && issued.has(marker);\n let seen: ReturnType<typeof historySnapshot> | undefined;\n let traversalFrom: { href: string; marker: unknown } | undefined;\n let syntheticFrom: { href: string; marker: unknown } | undefined;\n const historyHolders = new Set<HistoryHolder>();\n let historySyncScheduled = false;\n let disposingIslands = false;\n /** Settles when the synthetic Back that removes closed dialogs' entries has arrived. */\n let returning: Promise<void> | undefined;\n let resolveReturning: (() => void) | undefined;\n\n /** Outside island disposal, closed entries leave with one Back to the newest live dialog or holder, or to the page. */\n const syncHistory = () => {\n if (returning) {\n void returning.then(() => {\n if (historySyncScheduled) syncHistory();\n });\n return;\n }\n historySyncScheduled = false;\n const openIds = new Set([...state.stack, ...historyHolders].map((entry) => entry.historyId));\n const current = historyIds.at(-1);\n let steps = 0;\n while (historyIds.length > 0 && !openIds.has(historyIds.at(-1)) && !deadMarker(historyIds.at(-1))) {\n historyIds.pop();\n steps++;\n }\n // Someone else moved the history meanwhile; leave it alone.\n if (steps === 0 || historyMarker() !== current || location.href !== seen?.href || history.length !== seen?.length) return;\n const back = new Promise<void>((resolve) => {\n resolveReturning = resolve;\n });\n returning = back;\n void back.then(() => {\n if (returning === back) returning = undefined;\n });\n syntheticFrom = { href: location.href, marker: current };\n history.go(-steps);\n };\n\n const releaseHistory = (entry: HistoryEntry) => {\n if (entry.historyId === undefined) return;\n // During a content swap the router owns history. Forget the marker without moving history; its entry stays a\n // barrier for later synthetic Backs and is left for the router to replace.\n if (disposingIslands) {\n issued.delete(entry.historyId);\n forgotten.add(entry.historyId);\n entry.historyId = undefined;\n return;\n }\n if (historySyncScheduled) return;\n historySyncScheduled = true;\n queueMicrotask(syncHistory);\n };\n\n /** Traversals this core already handled: a page swap router also reports the ones it hides from listeners. */\n const handled = new WeakSet<PopStateEvent>();\n /** Back or Forward moved to another entry: close dialogs and holders opened after the one it shows. */\n const onPopState = (event: PopStateEvent) => {\n if (handled.has(event)) return;\n handled.add(event);\n const resolveBack = resolveReturning;\n // Without the Navigation API, only our synthetic Back has a known departure.\n const from = typeof navigation !== \"undefined\" ? traversalFrom : resolveBack ? syntheticFrom : undefined;\n traversalFrom = undefined;\n syntheticFrom = undefined;\n resolveReturning = undefined;\n try {\n const marker = historyMarker();\n if (from && from.href === location.href && from.marker !== marker && (ownMarker(from.marker) || ownMarker(marker))) {\n event.stopImmediatePropagation();\n }\n // Own entries are ordered by id. A retired entry reached by Forward stays tracked, so closing the dialogs\n // beneath it also removes it. A forgotten entry keeps the holders opened before it and stays a barrier.\n historyIds = ownMarker(marker) || deadMarker(marker) ? [...historyIds.filter((id) => id < marker), marker] : [];\n const gone = (entry: DialogStackEntry) => entry.historyId !== undefined && !historyIds.includes(entry.historyId);\n while (state.stack.some(gone)) popTop(undefined);\n for (const holder of [...historyHolders].reverse()) {\n if (holder.historyId === undefined || historyIds.includes(holder.historyId)) continue;\n historyHolders.delete(holder);\n releaseHistory(holder);\n holder.onBack();\n }\n } finally {\n seen = historySnapshot();\n resolveBack?.();\n }\n };\n\n /**\n * Island disposal means the page content changes, as a document load would. Every dialog closes, top first, whichever\n * code opened it: which island calls open() is not knowable after an await, in onMount or from a timer, and a modal\n * left over the new content would block it.\n */\n const onIslandDispose = () => {\n if (!disposingIslands) {\n disposingIslands = true;\n queueMicrotask(() => {\n disposingIslands = false;\n });\n // Entries released just before, whose Back has not started yet, stay as well: the router owns history now.\n // A Back already on its way still settles through `returning`.\n historySyncScheduled = false;\n const live = new Set([...state.stack, ...historyHolders].map((entry) => entry.historyId));\n for (const id of historyIds) {\n if (live.has(id) || !issued.delete(id)) continue;\n forgotten.add(id);\n }\n }\n disposals++;\n while (state.stack.length > 0) popTop(undefined);\n };\n\n /** `@k2b/ssr/nav` stops a traversal to another server page before later listeners and reports it here. */\n const onHiddenPopState = (event: Event) => {\n const detail: unknown = \"detail\" in event ? event.detail : undefined;\n if (isPopState(detail)) onPopState(detail);\n };\n const onNavigate = (event: NavigateEvent) => {\n if (event.navigationType === \"traverse\") traversalFrom = { href: location.href, marker: historyMarker() };\n };\n /** The window whose history this core listens to; a test harness may replace the window between dialogs. */\n let listening: { window: Window; navigation?: Navigation } | undefined;\n const listen = () => {\n if (listening?.window === window) return;\n listening?.window.removeEventListener(\"popstate\", onPopState, { capture: true });\n listening?.window.removeEventListener(\"ssr:nav-popstate\", onHiddenPopState, { capture: true });\n listening?.window.removeEventListener(\"ssr:island-dispose\", onIslandDispose, { capture: true });\n listening?.navigation?.removeEventListener(\"navigate\", onNavigate);\n window.addEventListener(\"popstate\", onPopState, { capture: true });\n window.addEventListener(\"ssr:nav-popstate\", onHiddenPopState, { capture: true });\n // Capture opens the disposal window before target listeners can release history holders.\n window.addEventListener(\"ssr:island-dispose\", onIslandDispose, { capture: true });\n const current = typeof navigation !== \"undefined\" ? navigation : undefined;\n current?.addEventListener(\"navigate\", onNavigate);\n listening = { window, navigation: current };\n };\n // Chromium runs a window's popstate listeners in the order they were added, capture or not. The shared core is\n // created before islands mount and add their navigation listeners, so it listens from the start.\n if (typeof window !== \"undefined\") listen();\n\n const pushHistory = (entry: HistoryEntry) => {\n listen();\n const previous = historyRecord();\n // A reload or Forward never brings back a dialog or its sensitive transient state.\n if (historyIds.length === 0 && previous[HISTORY_MARKER] !== undefined) {\n delete previous[HISTORY_MARKER];\n history.replaceState(previous, \"\");\n }\n entry.historyId = ++nextHistoryId;\n issued.add(entry.historyId);\n historyIds.push(entry.historyId);\n history.pushState({ ...previous, [HISTORY_MARKER]: entry.historyId }, \"\");\n seen = historySnapshot();\n };\n\n /** Internal non-dialog participation in the same history stack. Releasing never calls onBack. */\n const holdHistory = (onBack: () => void): (() => void) => {\n const holder: HistoryHolder = { onBack };\n historyHolders.add(holder);\n const pushWhenReady = () => {\n if (!historyHolders.has(holder)) return;\n // Just like open(): remove closed entries before adding another one.\n if (historySyncScheduled) syncHistory();\n if (returning) void returning.then(pushWhenReady);\n else pushHistory(holder);\n };\n pushWhenReady();\n return () => {\n if (!historyHolders.delete(holder)) return;\n releaseHistory(holder);\n };\n };\n\n /**\n * Settles once released entries have left history or were forgotten during island disposal. A caller that navigates waits\n * for it, as a dialog's result waits: a Back still on its way would otherwise land behind the new entry.\n */\n const historySettled = async (): Promise<void> => {\n while (historySyncScheduled || returning) {\n if (!returning) syncHistory();\n if (returning) await returning;\n }\n };\n\n const ensureDialogElement = () => {\n if (typeof document === \"undefined\") throw new Error(\"@k2b/ui dialogs can only be opened in the browser\");\n // Reuse the shared element whenever it is still in the document. Resolving\n // the portal root first would create a second <dialog> when focus has moved\n // into another `.k2b-ui` scope, orphaning the levels already on the stack.\n if (state.element?.isConnected) return state.element;\n\n const element = document.createElement(\"dialog\");\n element.onclose = () => {\n // Repeated Escape can force a non-cancelable native close. A retained\n // entry (ignore, an async guard, or a parent) still owns the modal.\n const top = state.stack[state.stack.length - 1];\n if (state.element !== element || element.open || !top) return;\n if (top.modal) element.showModal();\n else element.show();\n resolveInitialFocusTarget(top, element)?.focus();\n };\n getK2bPortalRoot().appendChild(element);\n state.element = element;\n return element;\n };\n\n const lockPageScroll = () => {\n if (typeof document === \"undefined\" || state.scrollLocked) return;\n state.previousBodyOverflow = document.body.style.overflow;\n state.previousHtmlOverflow = document.documentElement.style.overflow;\n document.body.style.overflow = \"hidden\";\n document.documentElement.style.overflow = \"hidden\";\n state.scrollLocked = true;\n };\n\n const unlockPageScroll = () => {\n if (typeof document === \"undefined\" || !state.scrollLocked) return;\n document.body.style.overflow = state.previousBodyOverflow ?? \"\";\n document.documentElement.style.overflow = state.previousHtmlOverflow ?? \"\";\n state.scrollLocked = false;\n state.previousBodyOverflow = undefined;\n state.previousHtmlOverflow = undefined;\n };\n\n const applyPresentation = (entry: DialogStackEntry) => {\n const dialog = state.element;\n if (!dialog || state.stack[state.stack.length - 1] !== entry) return;\n const position = entry.position;\n dialog.style.position = position ? \"fixed\" : \"\";\n dialog.style.inset = position ? `${position.y}px auto auto ${position.x}px` : \"\";\n dialog.style.margin = position ? \"0\" : \"\";\n dialog.style.transform = position ? \"none\" : \"\";\n dialog.dataset.modeless = String(!entry.modal);\n dialog.setAttribute(\"aria-modal\", String(entry.modal));\n if (dialog.open && state.modal !== entry.modal) {\n const active = document.activeElement;\n dialog.close();\n if (entry.modal) dialog.showModal();\n else dialog.show();\n if (active instanceof HTMLElement && active.isConnected && (!entry.modal || dialog.contains(active))) {\n active.focus({ preventScroll: true });\n } else resolveInitialFocusTarget(entry, dialog)?.focus({ preventScroll: true });\n }\n state.modal = entry.modal;\n if (entry.modal) lockPageScroll();\n else unlockPageScroll();\n };\n\n const modelessEscape = (event: KeyboardEvent) => {\n const top = state.stack[state.stack.length - 1];\n if (!top || top.modal || event.key !== \"Escape\" || event.defaultPrevented || event.isComposing) return;\n event.preventDefault();\n void requestDismiss(top);\n };\n\n const stopConnectionObserver = () => {\n document.removeEventListener(\"keydown\", modelessEscape);\n state.connectionObserver?.disconnect();\n state.connectionObserver = undefined;\n };\n\n const applyCancelBehavior = (\n dialog: HTMLDialogElement,\n close: () => void,\n behavior: NonNullable<OpenDialogOptions[\"cancelBehavior\"]>,\n ) => {\n dialog.oncancel = (event) => {\n if (behavior === \"ignore\") {\n event.preventDefault();\n return;\n }\n event.preventDefault();\n close();\n };\n dialog.onmousedown = (event) => {\n state.mouseDownOnDialog = event.target === dialog;\n };\n dialog.onclick = (event) => {\n const realBackdropClick = state.mouseDownOnDialog === true;\n state.mouseDownOnDialog = false;\n if (event.target !== dialog || !state.modal) return;\n if (!realBackdropClick) return;\n if (behavior === \"ignore\") return;\n if (isPointInsideToast(event.clientX, event.clientY)) return;\n close();\n };\n };\n\n const requestDismiss = async (entry: DialogStackEntry) => {\n if (state.stack[state.stack.length - 1] !== entry || entry.dismissPending || entry.cancelBehavior === \"ignore\") return;\n if (!entry.dismissHandler) {\n popTop(undefined);\n return;\n }\n entry.dismissPending = true;\n try {\n await entry.dismissHandler();\n } catch (error) {\n // A failed guard must never discard the dialog's state.\n console.error(\"Dialog dismissal failed\", error);\n } finally {\n entry.dismissPending = false;\n }\n };\n\n const popTop = (result?: unknown) => {\n const top = state.stack.pop();\n if (!top) return;\n releaseHistory(top);\n top.dispose?.();\n top.container.remove();\n\n const dialog = state.element;\n const previous = state.stack[state.stack.length - 1];\n if (previous && dialog) {\n previous.container.style.display = \"\";\n dialog.className = previous.panelClassName;\n applyPresentation(previous);\n applyAccessibleName(dialog, previous);\n applyCancelBehavior(dialog, () => void requestDismiss(previous), previous.cancelBehavior);\n schedule(() => {\n if (!focusUnclaimed(dialog)) return;\n if (top.opener?.isConnected) returnFocus(top.opener, top.openerRing);\n else resolveInitialFocusTarget(previous, dialog)?.focus();\n });\n } else if (dialog) {\n dialog.oncancel = null;\n dialog.onmousedown = null;\n dialog.onclick = null;\n dialog.removeAttribute(\"aria-label\");\n dialog.removeAttribute(\"aria-labelledby\");\n if (dialog.open && typeof dialog.close === \"function\") dialog.close();\n else dialog.removeAttribute(\"open\");\n dialog.remove();\n state.element = undefined;\n stopConnectionObserver();\n unlockPageScroll();\n // After the Escape that closed it: WebKit lights the ring of whatever\n // that key press leaves focused.\n schedule(() => {\n if (top.opener?.isConnected && focusUnclaimed(dialog)) returnFocus(top.opener, top.openerRing);\n });\n }\n\n top.resolve?.(result);\n };\n\n const resetDisconnectedDialog = () => {\n if (state.stack.length === 0 || state.element?.isConnected) return;\n const entries = state.stack.splice(0);\n const dialog = state.element;\n state.element = undefined;\n stopConnectionObserver();\n dialog?.remove();\n unlockPageScroll();\n for (const entry of entries.reverse()) {\n releaseHistory(entry);\n entry.dispose?.();\n entry.container.remove();\n entry.resolve?.(undefined);\n }\n };\n\n const observeConnection = () => {\n if (state.connectionObserver || typeof MutationObserver === \"undefined\") return;\n document.addEventListener(\"keydown\", modelessEscape);\n state.connectionObserver = new MutationObserver(resetDisconnectedDialog);\n state.connectionObserver.observe(document.documentElement, { childList: true, subtree: true });\n };\n\n const open = <T>(view: DialogRender<T>, options: OpenDialogOptions = {}): Promise<T | undefined> => {\n return openAfter(view, options, disposals);\n };\n\n const openAfter = <T>(view: DialogRender<T>, options: OpenDialogOptions, requested: number): Promise<T | undefined> => {\n if (options.signal?.aborted) return Promise.resolve(undefined);\n if (options.history) {\n // Dialogs closed just now leave the history first, or this dialog's entry would be the one removed.\n if (historySyncScheduled) syncHistory();\n if (returning) return returning.then(() => openAfter(view, options, requested));\n }\n // A dialog that waited for history while islands were disposed would open over content it was never meant for.\n if (disposals !== requested) return Promise.resolve(undefined);\n const dialog = ensureDialogElement();\n listen();\n const previousTop = state.stack[state.stack.length - 1];\n if (previousTop) previousTop.container.style.display = \"none\";\n const activeElement = document.activeElement;\n\n const panelClassName = options.panelClassName ?? DEFAULT_PANEL_CLASS;\n const cancelBehavior = options.cancelBehavior ?? \"resolve-undefined\";\n const initialFocus = options.initialFocus ?? \"first-input\";\n dialog.className = panelClassName;\n\n const container = document.createElement(\"div\");\n container.className = options.contentClassName ?? DEFAULT_CONTENT_CLASS;\n dialog.appendChild(container);\n\n const entry: DialogStackEntry = {\n container,\n panelClassName,\n cancelBehavior,\n initialFocus,\n opener: activeElement instanceof HTMLElement ? activeElement : undefined,\n openerRing: ringOnReturn(activeElement),\n ariaLabel: options.ariaLabel,\n modal: true,\n };\n\n return new Promise((resolve, reject) => {\n const abort = () => {\n const index = state.stack.indexOf(entry);\n if (index < 0) return;\n if (index === state.stack.length - 1) popTop(undefined);\n else {\n state.stack.splice(index, 1);\n releaseHistory(entry);\n entry.dispose?.();\n entry.container.remove();\n entry.resolve?.(undefined);\n }\n };\n entry.resolve = (value) => {\n options.signal?.removeEventListener(\"abort\", abort);\n if (!options.history) {\n resolve(value as T | undefined);\n return;\n }\n // After every pending history sync, so a caller that navigates or opens the next dialog finds the history settled.\n // This holds for a marker forgotten during island disposal too, while an earlier synthetic Back is on its way.\n queueMicrotask(() => void historySettled().then(() => resolve(value as T | undefined)));\n };\n const closeTyped: DialogClose<T> = (result) => {\n if (state.stack[state.stack.length - 1] !== entry) return;\n popTop(result);\n };\n\n if (options.history) pushHistory(entry);\n state.stack.push(entry);\n try {\n entry.dispose = render(\n () =>\n createComponent(RenderErrorBoundary, {\n content: () =>\n view(closeTyped, {\n dialog,\n setModal: (modal) => {\n entry.modal = modal;\n applyPresentation(entry);\n },\n setPosition: (position) => {\n if (position && (!Number.isFinite(position.x) || !Number.isFinite(position.y))) return;\n entry.position = position;\n applyPresentation(entry);\n },\n requestDismiss: () => requestDismiss(entry),\n setDismissHandler: (handler) => {\n entry.dismissHandler = handler;\n },\n }),\n onClose: () => closeTyped(undefined),\n onError: () => {\n entry.panelClassName = RENDER_ERROR_PANEL_CLASS;\n container.className = DEFAULT_CONTENT_CLASS;\n if (state.stack[state.stack.length - 1] === entry) dialog.className = RENDER_ERROR_PANEL_CLASS;\n },\n }),\n container,\n );\n applyPresentation(entry);\n applyAccessibleName(dialog, entry);\n applyCancelBehavior(dialog, () => void requestDismiss(entry), cancelBehavior);\n\n if (state.stack.length === 1) {\n // The native dialog returns focus to the element focused when it\n // opened, with a ring of the browser's choosing. Opening from a\n // blurred document leaves the return to popTop and its opener ring.\n if (activeElement instanceof HTMLElement) activeElement.blur();\n if (typeof dialog.showModal === \"function\") {\n if (entry.modal) dialog.showModal();\n else dialog.show();\n } else dialog.setAttribute(\"open\", \"\");\n observeConnection();\n }\n options.signal?.addEventListener(\"abort\", abort, { once: true });\n if (options.signal?.aborted) abort();\n // Where opening left focus, the native dialog's own pick included. Focus that the content or a person moved\n // before the next frame stays: a browser can hold that frame back while keys already arrive.\n const opened = document.activeElement;\n schedule(() => {\n if (state.stack[state.stack.length - 1] !== entry) return;\n if (document.activeElement !== opened && !focusUnclaimed(dialog)) return;\n resolveInitialFocusTarget(entry, dialog)?.focus();\n });\n } catch (error) {\n entry.resolve = undefined;\n if (state.stack[state.stack.length - 1] === entry) popTop(undefined);\n reject(error);\n }\n });\n };\n\n const close: DialogCore[\"close\"] = (result) => {\n let first = true;\n while (state.stack.length > 0) {\n popTop(first ? result : undefined);\n first = false;\n }\n };\n\n return {\n open,\n close,\n isOpen: () => state.stack.length > 0,\n holdHistory,\n historySettled,\n };\n};\n\nconst { holdHistory, historySettled, ...publicDialogCore } = createDialogCore();\nexport const dialogCore: DialogCore = publicDialogCore;\n\n/**\n * Internal: transient UI shares dialogs' Back handling without exposing another public dialog capability.\n * Same-URL traversals are suppressed with the Navigation API; without it, only the synthetic Back on release is suppressed.\n * Release during island disposal forgets the marker without traversing; the router may replace the remaining entry.\n */\nexport const holdDialogHistory = holdHistory;\n/** Internal: waits until released holders have left history or were forgotten during island disposal. */\nexport const dialogHistorySettled = historySettled;\n"],"mappings":"AAAA,SAAS,eAAe,QAAkB,UAAU;AACpD,SAAS,MAAM,QAAQ,cAAc;AACrC,SAAS,WAAW,EAAE,YAAY,QAAQ,0BAA0B;AACpE,SAAS,gBAAgB,QAAQ,oBAAoB;AACrD,SAAS,mBAAmB,QAAQ,0BAA0B;AAC9D,SAAS,iBAAiB,QAAQ,kBAAkB;AACpD,SAAS,kBAAkB,QAAQ,SAAS;AA0E5C,MAAM,mBAAmB,GAAG,YAAY;AACxC,MAAM,qBAAqB,GAAG,sBAAsB;AACpD;AACA,MAAM,wBAAwB,GAAG,8BAA8B;AAC/D,IAAI,iBAAiB,GAAG,CAAC;AACzB,IAAI,aAAa,GAAG,CAAC;AACrB;AACA,MAAM,cAAc,GAAG,WAAW;AAElC,MAAM,aAAa,GAAG,MACpB,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,GAAG;EAAE,GAAG,OAAO,CAAC;AAAM,CAAC,GAAG,CAAC,CAAC;AACzF,MAAM,aAAa,GAAG,MAAe,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC;AACpE,MAAM,eAAe,GAAG,OAAO;EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI;EAAE,MAAM,EAAE,OAAO,CAAC;AAAO,CAAC,CAAC;AAE/E,MAAM,yBAAyB,GAAG,CAAC,KAAuB,EAAE,MAAyB,KAAyB;EAC5G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MAAM,oBAAoB,GAAG,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["feedback/dialog-core.ts"],"sourcesContent":["import { createComponent, type JSX } from \"solid-js\";\nimport { render } from \"solid-js/web\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\nimport { getK2bPortalRoot } from \"../internal/portal\";\nimport { RenderErrorBoundary } from \"../internal/render-error\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport { isPointInsideToast } from \"./toast\";\n\nexport type DialogClose<T> = (result?: T) => void;\n\nexport type OpenDialogOptions = {\n /** Close only this dialog when its owning operation is cancelled. */\n signal?: AbortSignal;\n panelClassName?: string;\n contentClassName?: string;\n initialFocus?: \"first-input\" | \"none\" | ((dialog: HTMLDialogElement) => HTMLElement | null);\n cancelBehavior?: \"resolve-undefined\" | \"ignore\";\n ariaLabel?: string;\n ariaDescribedBy?: string;\n /** Use for a consequential confirmation that requires a response. Defaults to dialog. */\n role?: \"dialog\" | \"alertdialog\";\n /**\n * Add a same-URL history entry while the dialog is open, so the browser's or the phone's Back closes the dialog\n * instead of leaving the page. Normally closing the dialog removes the entry again; the returned promise settles after that.\n * With the Navigation API, same-URL traversals between this core's entries and the page do not reach application popstate listeners.\n * Without it, only the synthetic Back on close is suppressed.\n * Island disposal closes every open dialog immediately and forgets its marker without traversing history.\n * The same-URL entry remains for the router to replace and counts as a page entry for later dialogs.\n * A traversal that `@k2b/ssr/nav` hides from popstate listeners reaches this core through `ssr:nav-popstate`.\n */\n history?: boolean;\n};\n\nexport type DialogRender<T> = (\n close: DialogClose<T>,\n context: {\n dialog: HTMLDialogElement;\n /** Switch this entry between a modal and a modeless window without remounting. */\n setModal: (modal: boolean) => void;\n /** Set viewport coordinates, or restore the panel stylesheet position with null. */\n setPosition: (position: { x: number; y: number } | null) => void;\n /** Route Escape/backdrop through the same guarded handler as Cancel and X. */\n setDismissHandler: (handler: () => void | Promise<void>) => void;\n /** Request dismissal through this entry's cancellation policy and guard. */\n requestDismiss: () => Promise<void>;\n },\n) => JSX.Element;\n\nexport type DialogCore = {\n open: <T>(view: DialogRender<T>, options?: OpenDialogOptions) => Promise<T | undefined>;\n close: (result?: unknown) => void;\n isOpen: () => boolean;\n};\n\ntype DialogStackEntry = {\n container: HTMLDivElement;\n dispose?: () => void;\n resolve?: (value: unknown) => void;\n panelClassName: string;\n cancelBehavior: NonNullable<OpenDialogOptions[\"cancelBehavior\"]>;\n initialFocus: NonNullable<OpenDialogOptions[\"initialFocus\"]>;\n opener?: HTMLElement;\n openerRing: boolean;\n ariaLabel?: string;\n ariaDescribedBy?: string;\n role: \"dialog\" | \"alertdialog\";\n dismissHandler?: () => void | Promise<void>;\n dismissPending?: boolean;\n modal: boolean;\n position?: { x: number; y: number } | null;\n /** The marker of this dialog's history entry, for dialogs opened with `history`. */\n historyId?: number;\n};\n\ntype DialogState = {\n element?: HTMLDialogElement;\n modal?: boolean;\n stack: DialogStackEntry[];\n scrollLocked?: boolean;\n previousBodyOverflow?: string;\n previousHtmlOverflow?: string;\n mouseDownOnDialog?: boolean;\n connectionObserver?: MutationObserver;\n};\n\nconst DEFAULT_PANEL_CLASS = \"k2b-dialog\";\nconst DEFAULT_CONTENT_CLASS = \"k2b-dialog__viewport\";\n/** The frame of a dialog whose content could not render: a custom or bare surface may draw no frame of its own. */\nconst RENDER_ERROR_PANEL_CLASS = \"k2b-dialog k2b-dialog--small\";\nlet nextDialogTitleId = 0;\nlet nextHistoryId = 0;\n/** The history state key that marks a dialog's same-URL entry. */\nconst HISTORY_MARKER = \"k2bDialog\";\n\nconst historyRecord = (): Record<string, unknown> =>\n typeof history.state === \"object\" && history.state !== null ? { ...history.state } : {};\nconst historyMarker = (): unknown => historyRecord()[HISTORY_MARKER];\nconst historySnapshot = () => ({ href: location.href, length: history.length });\n\nconst resolveInitialFocusTarget = (entry: DialogStackEntry, dialog: HTMLDialogElement): HTMLElement | null => {\n const { initialFocus } = entry;\n if (initialFocus === \"none\") return null;\n if (typeof initialFocus === \"function\") return initialFocus(dialog);\n const input = entry.container.querySelector<HTMLElement>(\n \"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), [role='combobox']:not([disabled]):not([aria-disabled='true'])\",\n );\n return (\n input ??\n entry.container.querySelector<HTMLElement>(\n \"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), a[href], [tabindex]:not([tabindex='-1'])\",\n )\n );\n};\n\nconst applyAccessibleName = (dialog: HTMLDialogElement, entry: DialogStackEntry): void => {\n dialog.setAttribute(\"role\", entry.role);\n dialog.removeAttribute(\"aria-label\");\n dialog.removeAttribute(\"aria-labelledby\");\n dialog.removeAttribute(\"aria-describedby\");\n if (entry.ariaDescribedBy) dialog.setAttribute(\"aria-describedby\", entry.ariaDescribedBy);\n if (entry.ariaLabel) {\n dialog.setAttribute(\"aria-label\", entry.ariaLabel);\n return;\n }\n const heading = entry.container.querySelector<HTMLElement>(\"h1, h2, h3\");\n if (!heading) {\n dialog.setAttribute(\"aria-label\", resolveUiMessages().dialog);\n return;\n }\n heading.id ||= `k2b-dialog-title-${++nextDialogTitleId}`;\n dialog.setAttribute(\"aria-labelledby\", heading.id);\n};\n\nconst schedule = (callback: () => void): void => {\n if (typeof requestAnimationFrame === \"function\") requestAnimationFrame(callback);\n else queueMicrotask(callback);\n};\n\n/**\n * Whether focus is still where closing a level left it, on the page or the\n * dialog: nothing took it before the next frame, neither a close handler nor a\n * Tab pressed right after Escape.\n */\nconst focusUnclaimed = (dialog: HTMLDialogElement): boolean => {\n const active = document.activeElement;\n return !active || active === document.body || active === dialog;\n};\n\n/** Checked by shape: a test harness or an iframe may create the event in another realm. */\nconst isPopState = (value: unknown): value is PopStateEvent =>\n typeof value === \"object\" && value !== null && \"type\" in value && value.type === \"popstate\" && \"state\" in value;\n\ntype HistoryEntry = { historyId?: number };\ntype HistoryHolder = HistoryEntry & { onBack: () => void };\n\nexport const createDialogCore = () => {\n const state: DialogState = { stack: [] };\n /** Markers of this core's entries in the browser history, oldest first. */\n let historyIds: number[] = [];\n const issued = new Set<number>();\n /**\n * Markers forgotten during island disposal. Their entries stay in `historyIds` as barriers: a synthetic Back never\n * crosses one, because the router may have replaced that entry with another page.\n */\n const forgotten = new Set<number>();\n const deadMarker = (marker: unknown): marker is number => typeof marker === \"number\" && forgotten.has(marker);\n /** How often islands were disposed, so a dialog that waits to open notices that a content swap happened meanwhile. */\n let disposals = 0;\n const ownMarker = (marker: unknown): marker is number => typeof marker === \"number\" && issued.has(marker);\n let seen: ReturnType<typeof historySnapshot> | undefined;\n let traversalFrom: { href: string; marker: unknown } | undefined;\n let syntheticFrom: { href: string; marker: unknown } | undefined;\n const historyHolders = new Set<HistoryHolder>();\n let historySyncScheduled = false;\n let disposingIslands = false;\n /** Settles when the synthetic Back that removes closed dialogs' entries has arrived. */\n let returning: Promise<void> | undefined;\n let resolveReturning: (() => void) | undefined;\n\n /** Outside island disposal, closed entries leave with one Back to the newest live dialog or holder, or to the page. */\n const syncHistory = () => {\n if (returning) {\n void returning.then(() => {\n if (historySyncScheduled) syncHistory();\n });\n return;\n }\n historySyncScheduled = false;\n const openIds = new Set([...state.stack, ...historyHolders].map((entry) => entry.historyId));\n const current = historyIds.at(-1);\n let steps = 0;\n while (historyIds.length > 0 && !openIds.has(historyIds.at(-1)) && !deadMarker(historyIds.at(-1))) {\n historyIds.pop();\n steps++;\n }\n // Someone else moved the history meanwhile; leave it alone.\n if (steps === 0 || historyMarker() !== current || location.href !== seen?.href || history.length !== seen?.length) return;\n const back = new Promise<void>((resolve) => {\n resolveReturning = resolve;\n });\n returning = back;\n void back.then(() => {\n if (returning === back) returning = undefined;\n });\n syntheticFrom = { href: location.href, marker: current };\n history.go(-steps);\n };\n\n const releaseHistory = (entry: HistoryEntry) => {\n if (entry.historyId === undefined) return;\n // During a content swap the router owns history. Forget the marker without moving history; its entry stays a\n // barrier for later synthetic Backs and is left for the router to replace.\n if (disposingIslands) {\n issued.delete(entry.historyId);\n forgotten.add(entry.historyId);\n entry.historyId = undefined;\n return;\n }\n if (historySyncScheduled) return;\n historySyncScheduled = true;\n queueMicrotask(syncHistory);\n };\n\n /** Traversals this core already handled: a page swap router also reports the ones it hides from listeners. */\n const handled = new WeakSet<PopStateEvent>();\n /** Back or Forward moved to another entry: close dialogs and holders opened after the one it shows. */\n const onPopState = (event: PopStateEvent) => {\n if (handled.has(event)) return;\n handled.add(event);\n const resolveBack = resolveReturning;\n // Without the Navigation API, only our synthetic Back has a known departure.\n const from = typeof navigation !== \"undefined\" ? traversalFrom : resolveBack ? syntheticFrom : undefined;\n traversalFrom = undefined;\n syntheticFrom = undefined;\n resolveReturning = undefined;\n try {\n const marker = historyMarker();\n if (from && from.href === location.href && from.marker !== marker && (ownMarker(from.marker) || ownMarker(marker))) {\n event.stopImmediatePropagation();\n }\n // Own entries are ordered by id. A retired entry reached by Forward stays tracked, so closing the dialogs\n // beneath it also removes it. A forgotten entry keeps the holders opened before it and stays a barrier.\n historyIds = ownMarker(marker) || deadMarker(marker) ? [...historyIds.filter((id) => id < marker), marker] : [];\n const gone = (entry: DialogStackEntry) => entry.historyId !== undefined && !historyIds.includes(entry.historyId);\n while (state.stack.some(gone)) popTop(undefined);\n for (const holder of [...historyHolders].reverse()) {\n if (holder.historyId === undefined || historyIds.includes(holder.historyId)) continue;\n historyHolders.delete(holder);\n releaseHistory(holder);\n holder.onBack();\n }\n } finally {\n seen = historySnapshot();\n resolveBack?.();\n }\n };\n\n /**\n * Island disposal means the page content changes, as a document load would. Every dialog closes, top first, whichever\n * code opened it: which island calls open() is not knowable after an await, in onMount or from a timer, and a modal\n * left over the new content would block it.\n */\n const onIslandDispose = () => {\n if (!disposingIslands) {\n disposingIslands = true;\n queueMicrotask(() => {\n disposingIslands = false;\n });\n // Entries released just before, whose Back has not started yet, stay as well: the router owns history now.\n // A Back already on its way still settles through `returning`.\n historySyncScheduled = false;\n const live = new Set([...state.stack, ...historyHolders].map((entry) => entry.historyId));\n for (const id of historyIds) {\n if (live.has(id) || !issued.delete(id)) continue;\n forgotten.add(id);\n }\n }\n disposals++;\n while (state.stack.length > 0) popTop(undefined);\n };\n\n /** `@k2b/ssr/nav` stops a traversal to another server page before later listeners and reports it here. */\n const onHiddenPopState = (event: Event) => {\n const detail: unknown = \"detail\" in event ? event.detail : undefined;\n if (isPopState(detail)) onPopState(detail);\n };\n const onNavigate = (event: NavigateEvent) => {\n if (event.navigationType === \"traverse\") traversalFrom = { href: location.href, marker: historyMarker() };\n };\n /** The window whose history this core listens to; a test harness may replace the window between dialogs. */\n let listening: { window: Window; navigation?: Navigation } | undefined;\n const listen = () => {\n if (listening?.window === window) return;\n listening?.window.removeEventListener(\"popstate\", onPopState, { capture: true });\n listening?.window.removeEventListener(\"ssr:nav-popstate\", onHiddenPopState, { capture: true });\n listening?.window.removeEventListener(\"ssr:island-dispose\", onIslandDispose, { capture: true });\n listening?.navigation?.removeEventListener(\"navigate\", onNavigate);\n window.addEventListener(\"popstate\", onPopState, { capture: true });\n window.addEventListener(\"ssr:nav-popstate\", onHiddenPopState, { capture: true });\n // Capture opens the disposal window before target listeners can release history holders.\n window.addEventListener(\"ssr:island-dispose\", onIslandDispose, { capture: true });\n const current = typeof navigation !== \"undefined\" ? navigation : undefined;\n current?.addEventListener(\"navigate\", onNavigate);\n listening = { window, navigation: current };\n };\n // Chromium runs a window's popstate listeners in the order they were added, capture or not. The shared core is\n // created before islands mount and add their navigation listeners, so it listens from the start.\n if (typeof window !== \"undefined\") listen();\n\n const pushHistory = (entry: HistoryEntry) => {\n listen();\n const previous = historyRecord();\n // A reload or Forward never brings back a dialog or its sensitive transient state.\n if (historyIds.length === 0 && previous[HISTORY_MARKER] !== undefined) {\n delete previous[HISTORY_MARKER];\n history.replaceState(previous, \"\");\n }\n entry.historyId = ++nextHistoryId;\n issued.add(entry.historyId);\n historyIds.push(entry.historyId);\n history.pushState({ ...previous, [HISTORY_MARKER]: entry.historyId }, \"\");\n seen = historySnapshot();\n };\n\n /** Internal non-dialog participation in the same history stack. Releasing never calls onBack. */\n const holdHistory = (onBack: () => void): (() => void) => {\n const holder: HistoryHolder = { onBack };\n historyHolders.add(holder);\n const pushWhenReady = () => {\n if (!historyHolders.has(holder)) return;\n // Just like open(): remove closed entries before adding another one.\n if (historySyncScheduled) syncHistory();\n if (returning) void returning.then(pushWhenReady);\n else pushHistory(holder);\n };\n pushWhenReady();\n return () => {\n if (!historyHolders.delete(holder)) return;\n releaseHistory(holder);\n };\n };\n\n /**\n * Settles once released entries have left history or were forgotten during island disposal. A caller that navigates waits\n * for it, as a dialog's result waits: a Back still on its way would otherwise land behind the new entry.\n */\n const historySettled = async (): Promise<void> => {\n while (historySyncScheduled || returning) {\n if (!returning) syncHistory();\n if (returning) await returning;\n }\n };\n\n const ensureDialogElement = () => {\n if (typeof document === \"undefined\") throw new Error(\"@k2b/ui dialogs can only be opened in the browser\");\n // Reuse the shared element whenever it is still in the document. Resolving\n // the portal root first would create a second <dialog> when focus has moved\n // into another `.k2b-ui` scope, orphaning the levels already on the stack.\n if (state.element?.isConnected) return state.element;\n\n const element = document.createElement(\"dialog\");\n element.onclose = () => {\n // Repeated Escape can force a non-cancelable native close. A retained\n // entry (ignore, an async guard, or a parent) still owns the modal.\n const top = state.stack[state.stack.length - 1];\n if (state.element !== element || element.open || !top) return;\n if (top.modal) element.showModal();\n else element.show();\n resolveInitialFocusTarget(top, element)?.focus();\n };\n getK2bPortalRoot().appendChild(element);\n state.element = element;\n return element;\n };\n\n const lockPageScroll = () => {\n if (typeof document === \"undefined\" || state.scrollLocked) return;\n state.previousBodyOverflow = document.body.style.overflow;\n state.previousHtmlOverflow = document.documentElement.style.overflow;\n document.body.style.overflow = \"hidden\";\n document.documentElement.style.overflow = \"hidden\";\n state.scrollLocked = true;\n };\n\n const unlockPageScroll = () => {\n if (typeof document === \"undefined\" || !state.scrollLocked) return;\n document.body.style.overflow = state.previousBodyOverflow ?? \"\";\n document.documentElement.style.overflow = state.previousHtmlOverflow ?? \"\";\n state.scrollLocked = false;\n state.previousBodyOverflow = undefined;\n state.previousHtmlOverflow = undefined;\n };\n\n const applyPresentation = (entry: DialogStackEntry) => {\n const dialog = state.element;\n if (!dialog || state.stack[state.stack.length - 1] !== entry) return;\n const position = entry.position;\n dialog.style.position = position ? \"fixed\" : \"\";\n dialog.style.inset = position ? `${position.y}px auto auto ${position.x}px` : \"\";\n dialog.style.margin = position ? \"0\" : \"\";\n dialog.style.transform = position ? \"none\" : \"\";\n dialog.dataset.modeless = String(!entry.modal);\n dialog.setAttribute(\"aria-modal\", String(entry.modal));\n if (dialog.open && state.modal !== entry.modal) {\n const active = document.activeElement;\n dialog.close();\n if (entry.modal) dialog.showModal();\n else dialog.show();\n if (active instanceof HTMLElement && active.isConnected && (!entry.modal || dialog.contains(active))) {\n active.focus({ preventScroll: true });\n } else resolveInitialFocusTarget(entry, dialog)?.focus({ preventScroll: true });\n }\n state.modal = entry.modal;\n if (entry.modal) lockPageScroll();\n else unlockPageScroll();\n };\n\n const modelessEscape = (event: KeyboardEvent) => {\n const top = state.stack[state.stack.length - 1];\n if (!top || top.modal || event.key !== \"Escape\" || event.defaultPrevented || event.isComposing) return;\n event.preventDefault();\n void requestDismiss(top);\n };\n\n const stopConnectionObserver = () => {\n document.removeEventListener(\"keydown\", modelessEscape);\n state.connectionObserver?.disconnect();\n state.connectionObserver = undefined;\n };\n\n const applyCancelBehavior = (\n dialog: HTMLDialogElement,\n close: () => void,\n behavior: NonNullable<OpenDialogOptions[\"cancelBehavior\"]>,\n ) => {\n dialog.oncancel = (event) => {\n if (behavior === \"ignore\") {\n event.preventDefault();\n return;\n }\n event.preventDefault();\n close();\n };\n dialog.onmousedown = (event) => {\n state.mouseDownOnDialog = event.target === dialog;\n };\n dialog.onclick = (event) => {\n const realBackdropClick = state.mouseDownOnDialog === true;\n state.mouseDownOnDialog = false;\n if (event.target !== dialog || !state.modal) return;\n if (!realBackdropClick) return;\n if (behavior === \"ignore\") return;\n if (isPointInsideToast(event.clientX, event.clientY)) return;\n close();\n };\n };\n\n const requestDismiss = async (entry: DialogStackEntry) => {\n if (state.stack[state.stack.length - 1] !== entry || entry.dismissPending || entry.cancelBehavior === \"ignore\") return;\n if (!entry.dismissHandler) {\n popTop(undefined);\n return;\n }\n entry.dismissPending = true;\n try {\n await entry.dismissHandler();\n } catch (error) {\n // A failed guard must never discard the dialog's state.\n console.error(\"Dialog dismissal failed\", error);\n } finally {\n entry.dismissPending = false;\n }\n };\n\n const popTop = (result?: unknown) => {\n const top = state.stack.pop();\n if (!top) return;\n releaseHistory(top);\n top.dispose?.();\n top.container.remove();\n\n const dialog = state.element;\n const previous = state.stack[state.stack.length - 1];\n if (previous && dialog) {\n previous.container.style.display = \"\";\n dialog.className = previous.panelClassName;\n applyPresentation(previous);\n applyAccessibleName(dialog, previous);\n applyCancelBehavior(dialog, () => void requestDismiss(previous), previous.cancelBehavior);\n schedule(() => {\n if (!focusUnclaimed(dialog)) return;\n if (top.opener?.isConnected) returnFocus(top.opener, top.openerRing);\n else resolveInitialFocusTarget(previous, dialog)?.focus();\n });\n } else if (dialog) {\n dialog.oncancel = null;\n dialog.onmousedown = null;\n dialog.onclick = null;\n dialog.removeAttribute(\"aria-label\");\n dialog.removeAttribute(\"aria-labelledby\");\n dialog.removeAttribute(\"aria-describedby\");\n if (dialog.open && typeof dialog.close === \"function\") dialog.close();\n else dialog.removeAttribute(\"open\");\n dialog.remove();\n state.element = undefined;\n stopConnectionObserver();\n unlockPageScroll();\n // After the Escape that closed it: WebKit lights the ring of whatever\n // that key press leaves focused.\n schedule(() => {\n if (top.opener?.isConnected && focusUnclaimed(dialog)) returnFocus(top.opener, top.openerRing);\n });\n }\n\n top.resolve?.(result);\n };\n\n const resetDisconnectedDialog = () => {\n if (state.stack.length === 0 || state.element?.isConnected) return;\n const entries = state.stack.splice(0);\n const dialog = state.element;\n state.element = undefined;\n stopConnectionObserver();\n dialog?.remove();\n unlockPageScroll();\n for (const entry of entries.reverse()) {\n releaseHistory(entry);\n entry.dispose?.();\n entry.container.remove();\n entry.resolve?.(undefined);\n }\n };\n\n const observeConnection = () => {\n if (state.connectionObserver || typeof MutationObserver === \"undefined\") return;\n document.addEventListener(\"keydown\", modelessEscape);\n state.connectionObserver = new MutationObserver(resetDisconnectedDialog);\n state.connectionObserver.observe(document.documentElement, { childList: true, subtree: true });\n };\n\n const open = <T>(view: DialogRender<T>, options: OpenDialogOptions = {}): Promise<T | undefined> => {\n return openAfter(view, options, disposals);\n };\n\n const openAfter = <T>(view: DialogRender<T>, options: OpenDialogOptions, requested: number): Promise<T | undefined> => {\n if (options.signal?.aborted) return Promise.resolve(undefined);\n if (options.history) {\n // Dialogs closed just now leave the history first, or this dialog's entry would be the one removed.\n if (historySyncScheduled) syncHistory();\n if (returning) return returning.then(() => openAfter(view, options, requested));\n }\n // A dialog that waited for history while islands were disposed would open over content it was never meant for.\n if (disposals !== requested) return Promise.resolve(undefined);\n const dialog = ensureDialogElement();\n listen();\n const previousTop = state.stack[state.stack.length - 1];\n if (previousTop) previousTop.container.style.display = \"none\";\n const activeElement = document.activeElement;\n\n const panelClassName = options.panelClassName ?? DEFAULT_PANEL_CLASS;\n const cancelBehavior = options.cancelBehavior ?? \"resolve-undefined\";\n const initialFocus = options.initialFocus ?? \"first-input\";\n dialog.className = panelClassName;\n\n const container = document.createElement(\"div\");\n container.className = options.contentClassName ?? DEFAULT_CONTENT_CLASS;\n dialog.appendChild(container);\n\n const entry: DialogStackEntry = {\n container,\n panelClassName,\n cancelBehavior,\n initialFocus,\n opener: activeElement instanceof HTMLElement ? activeElement : undefined,\n openerRing: ringOnReturn(activeElement),\n ariaLabel: options.ariaLabel,\n ariaDescribedBy: options.ariaDescribedBy,\n role: options.role ?? \"dialog\",\n modal: true,\n };\n\n return new Promise((resolve, reject) => {\n const abort = () => {\n const index = state.stack.indexOf(entry);\n if (index < 0) return;\n if (index === state.stack.length - 1) popTop(undefined);\n else {\n state.stack.splice(index, 1);\n releaseHistory(entry);\n entry.dispose?.();\n entry.container.remove();\n entry.resolve?.(undefined);\n }\n };\n entry.resolve = (value) => {\n options.signal?.removeEventListener(\"abort\", abort);\n if (!options.history) {\n resolve(value as T | undefined);\n return;\n }\n // After every pending history sync, so a caller that navigates or opens the next dialog finds the history settled.\n // This holds for a marker forgotten during island disposal too, while an earlier synthetic Back is on its way.\n queueMicrotask(() => void historySettled().then(() => resolve(value as T | undefined)));\n };\n const closeTyped: DialogClose<T> = (result) => {\n if (state.stack[state.stack.length - 1] !== entry) return;\n popTop(result);\n };\n\n if (options.history) pushHistory(entry);\n state.stack.push(entry);\n try {\n entry.dispose = render(\n () =>\n createComponent(RenderErrorBoundary, {\n content: () =>\n view(closeTyped, {\n dialog,\n setModal: (modal) => {\n entry.modal = modal;\n applyPresentation(entry);\n },\n setPosition: (position) => {\n if (position && (!Number.isFinite(position.x) || !Number.isFinite(position.y))) return;\n entry.position = position;\n applyPresentation(entry);\n },\n requestDismiss: () => requestDismiss(entry),\n setDismissHandler: (handler) => {\n entry.dismissHandler = handler;\n },\n }),\n onClose: () => closeTyped(undefined),\n onError: () => {\n entry.panelClassName = RENDER_ERROR_PANEL_CLASS;\n container.className = DEFAULT_CONTENT_CLASS;\n if (state.stack[state.stack.length - 1] === entry) dialog.className = RENDER_ERROR_PANEL_CLASS;\n },\n }),\n container,\n );\n applyPresentation(entry);\n applyAccessibleName(dialog, entry);\n applyCancelBehavior(dialog, () => void requestDismiss(entry), cancelBehavior);\n\n if (state.stack.length === 1) {\n // The native dialog returns focus to the element focused when it\n // opened, with a ring of the browser's choosing. Opening from a\n // blurred document leaves the return to popTop and its opener ring.\n if (activeElement instanceof HTMLElement) activeElement.blur();\n if (typeof dialog.showModal === \"function\") {\n if (entry.modal) dialog.showModal();\n else dialog.show();\n } else dialog.setAttribute(\"open\", \"\");\n observeConnection();\n }\n options.signal?.addEventListener(\"abort\", abort, { once: true });\n if (options.signal?.aborted) abort();\n // Where opening left focus, the native dialog's own pick included. Focus that the content or a person moved\n // before the next frame stays: a browser can hold that frame back while keys already arrive.\n const opened = document.activeElement;\n schedule(() => {\n if (state.stack[state.stack.length - 1] !== entry) return;\n if (document.activeElement !== opened && !focusUnclaimed(dialog)) return;\n resolveInitialFocusTarget(entry, dialog)?.focus();\n });\n } catch (error) {\n entry.resolve = undefined;\n if (state.stack[state.stack.length - 1] === entry) popTop(undefined);\n reject(error);\n }\n });\n };\n\n const close: DialogCore[\"close\"] = (result) => {\n let first = true;\n while (state.stack.length > 0) {\n popTop(first ? result : undefined);\n first = false;\n }\n };\n\n return {\n open,\n close,\n isOpen: () => state.stack.length > 0,\n holdHistory,\n historySettled,\n };\n};\n\nconst { holdHistory, historySettled, ...publicDialogCore } = createDialogCore();\nexport const dialogCore: DialogCore = publicDialogCore;\n\n/**\n * Internal: transient UI shares dialogs' Back handling without exposing another public dialog capability.\n * Same-URL traversals are suppressed with the Navigation API; without it, only the synthetic Back on release is suppressed.\n * Release during island disposal forgets the marker without traversing; the router may replace the remaining entry.\n */\nexport const holdDialogHistory = holdHistory;\n/** Internal: waits until released holders have left history or were forgotten during island disposal. */\nexport const dialogHistorySettled = historySettled;\n"],"mappings":"AAAA,SAAS,eAAe,QAAkB,UAAU;AACpD,SAAS,MAAM,QAAQ,cAAc;AACrC,SAAS,WAAW,EAAE,YAAY,QAAQ,0BAA0B;AACpE,SAAS,gBAAgB,QAAQ,oBAAoB;AACrD,SAAS,mBAAmB,QAAQ,0BAA0B;AAC9D,SAAS,iBAAiB,QAAQ,kBAAkB;AACpD,SAAS,kBAAkB,QAAQ,SAAS;AA+E5C,MAAM,mBAAmB,GAAG,YAAY;AACxC,MAAM,qBAAqB,GAAG,sBAAsB;AACpD;AACA,MAAM,wBAAwB,GAAG,8BAA8B;AAC/D,IAAI,iBAAiB,GAAG,CAAC;AACzB,IAAI,aAAa,GAAG,CAAC;AACrB;AACA,MAAM,cAAc,GAAG,WAAW;AAElC,MAAM,aAAa,GAAG,MACpB,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,OAA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C,KAAK,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC;QACpE,MAAM,CAAC,KAAK,CAAC;MACf;IACF,CAAC,CAAC;EACJ,CAAC;EAED,MAAM,KAA0B,GAAI,MAAM,IAAK;IAC7C,IAAI,KAAK,GAAG,IAAI;IAChB,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;MAC7B,MAAM,CAAC,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;MAClC,KAAK,GAAG,KAAK;IACf;EACF,CAAC;EAED,OAAO;IACL,IAAI;IACJ,KAAK;IACL,MAAM,EAAE,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;IACpC,WAAW;IACX;EACF,CAAC;AACH,CAAC;AAED,MAAM;EAAE,WAAW;EAAE,cAAc;EAAE,GAAG;AAAiB,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC/E,OAAO,MAAM,UAAsB,GAAG,gBAAgB;;AAEtD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,iBAAiB,GAAG,WAAW;AAC5C;AACA,OAAO,MAAM,oBAAoB,GAAG,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { memo as _$memo } from "solid-js/web";
|
|
2
|
+
import { ssr as _$ssr } from "solid-js/web";
|
|
3
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
4
|
+
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
5
|
+
import { escape as _$escape } from "solid-js/web";
|
|
6
|
+
var _tmpl$ = ["<div class=\"k2b-choice-list\" role=\"radiogroup\"", ">", "</div>"],
|
|
7
|
+
_tmpl$2 = ["<i class=\"ti ti-loader-2 k2b-spin\" role=\"img\"", "></i>"],
|
|
8
|
+
_tmpl$3 = ["<span class=\"k2b-choice-list__description\"", ">", "</span>"],
|
|
9
|
+
_tmpl$4 = ["<button type=\"button\" role=\"radio\" class=\"k2b-choice-list__option\"", "", "><span class=\"k2b-choice-list__radio\" aria-hidden=\"true\"></span><span class=\"k2b-choice-list__text\"><span class=\"k2b-choice-list__label\">", "", "<span class=\"k2b-choice-list__busy\">", "</span></span>", "</span></button>"],
|
|
10
|
+
_tmpl$5 = ["<div class=\"k2b-choice-list__details\">", "</div>"],
|
|
11
|
+
_tmpl$6 = ["<span class=\"k2b-choice-list__marker\">", "</span>"];
|
|
12
|
+
import { Index, Show } from "solid-js";
|
|
13
|
+
import { createFieldMeta, Field, fieldDescribedBy } from "../internal/field";
|
|
14
|
+
import { radioKeyTarget } from "../internal/radio-keys";
|
|
15
|
+
import { resolveMaybeAccessor } from "./field-contract";
|
|
16
|
+
/**
|
|
17
|
+
* A labeled single choice shown as a short list of rows, each with a radio, a label and one sentence on what it
|
|
18
|
+
* means, for a few choices whose consequences need words. Choosing changes only paint, so no row moves; `details`
|
|
19
|
+
* opens under the chosen row. Use `ChoiceChips` for quick picks without explanation, `RichSelect` for longer lists
|
|
20
|
+
* in a dropdown, and `ChoiceTiles` when a preview decides.
|
|
21
|
+
*/
|
|
22
|
+
export function ChoiceList(props) {
|
|
23
|
+
const meta = createFieldMeta(props.id);
|
|
24
|
+
let group;
|
|
25
|
+
const value = () => resolveMaybeAccessor(props.value) ?? null;
|
|
26
|
+
const tabStop = (option, index) => value() === option.value || index === 0 && !props.options.some(candidate => candidate.value === value());
|
|
27
|
+
const choose = (index, focus = false) => {
|
|
28
|
+
const option = props.options[index];
|
|
29
|
+
if (!option || props.disabled) return;
|
|
30
|
+
props.onValueChange?.(option.value);
|
|
31
|
+
props.onValueCommit?.(option.value);
|
|
32
|
+
if (focus) queueMicrotask(() => group?.querySelectorAll('[role="radio"]')[index]?.focus());
|
|
33
|
+
};
|
|
34
|
+
return _$createComponent(Field, {
|
|
35
|
+
meta: meta,
|
|
36
|
+
labelFor: false,
|
|
37
|
+
get ["class"]() {
|
|
38
|
+
return props.class;
|
|
39
|
+
},
|
|
40
|
+
get label() {
|
|
41
|
+
return props.label;
|
|
42
|
+
},
|
|
43
|
+
get description() {
|
|
44
|
+
return props.description;
|
|
45
|
+
},
|
|
46
|
+
get error() {
|
|
47
|
+
return props.error;
|
|
48
|
+
},
|
|
49
|
+
get required() {
|
|
50
|
+
return props.required;
|
|
51
|
+
},
|
|
52
|
+
get disabled() {
|
|
53
|
+
return props.disabled;
|
|
54
|
+
},
|
|
55
|
+
get children() {
|
|
56
|
+
return _$ssr(_tmpl$, _$ssrAttribute("aria-label", props.label ? _$escape(undefined, true) : _$escape(props["aria-label"], true), false) + _$ssrAttribute("aria-labelledby", props.label ? _$escape(meta.labelId, true) : _$escape(undefined, true), false) + _$ssrAttribute("aria-describedby", _$escape(fieldDescribedBy(meta, props), true), false) + _$ssrAttribute("aria-disabled", props.disabled ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-busy", props.busy ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(Index, {
|
|
57
|
+
get each() {
|
|
58
|
+
return props.options;
|
|
59
|
+
},
|
|
60
|
+
children: (option, index) => {
|
|
61
|
+
const checked = () => value() === option().value;
|
|
62
|
+
const descriptionId = `${meta.controlId}-option-${index}`;
|
|
63
|
+
return [_$ssr(_tmpl$4, _$ssrAttribute("aria-checked", _$escape(checked(), true), false) + _$ssrAttribute("aria-describedby", option().description ? _$escape(descriptionId, true) : _$escape(undefined, true), false), _$ssrAttribute("disabled", props.disabled, true) + _$ssrAttribute("tabindex", tabStop(option(), index) ? 0 : -1, false), _$escape(option().label), _$escape(_$createComponent(Show, {
|
|
64
|
+
get when() {
|
|
65
|
+
return option().marker;
|
|
66
|
+
},
|
|
67
|
+
children: marker => _$ssr(_tmpl$6, _$escape(marker()))
|
|
68
|
+
})), _$escape(_$createComponent(Show, {
|
|
69
|
+
get when() {
|
|
70
|
+
return _$memo(() => !!checked())() && props.busy;
|
|
71
|
+
},
|
|
72
|
+
get children() {
|
|
73
|
+
return _$ssr(_tmpl$2, _$ssrAttribute("aria-label", _$escape(props.busyLabel, true), false));
|
|
74
|
+
}
|
|
75
|
+
})), _$escape(_$createComponent(Show, {
|
|
76
|
+
get when() {
|
|
77
|
+
return option().description;
|
|
78
|
+
},
|
|
79
|
+
get children() {
|
|
80
|
+
return _$ssr(_tmpl$3, _$ssrAttribute("id", _$escape(descriptionId, true), false), _$escape(option().description));
|
|
81
|
+
}
|
|
82
|
+
}))), _$createComponent(Show, {
|
|
83
|
+
get when() {
|
|
84
|
+
return _$memo(() => !!checked())() && props.details;
|
|
85
|
+
},
|
|
86
|
+
get children() {
|
|
87
|
+
return _$ssr(_tmpl$5, _$escape(props.details));
|
|
88
|
+
}
|
|
89
|
+
})];
|
|
90
|
+
}
|
|
91
|
+
})));
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=ChoiceList.js.map
|