@k2b/ui 0.52.0 → 0.54.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 +120 -0
- package/dist/browser/actions/SortableList.js +174 -0
- package/dist/browser/actions/SortableList.js.map +1 -0
- package/dist/browser/actions/SplitButton.js +10 -1
- package/dist/browser/actions/SplitButton.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +213 -96
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/actions/drag-and-drop.js +2 -1
- package/dist/browser/actions/drag-and-drop.js.map +1 -1
- package/dist/browser/actions/index.js +2 -1
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/sortable-list-messages.js +35 -0
- package/dist/browser/actions/sortable-list-messages.js.map +1 -0
- package/dist/browser/chart-inspection.js +2 -1
- package/dist/browser/chart-inspection.js.map +1 -1
- package/dist/browser/charts/core/area.js +1 -1
- package/dist/browser/charts/core/area.js.map +1 -1
- package/dist/browser/charts/core/balance-flow-data.js +93 -0
- package/dist/browser/charts/core/balance-flow-data.js.map +1 -0
- package/dist/browser/charts/core/balance-flow-fields.js +19 -0
- package/dist/browser/charts/core/balance-flow-fields.js.map +1 -0
- package/dist/browser/charts/core/balance-flow-frame.js +44 -0
- package/dist/browser/charts/core/balance-flow-frame.js.map +1 -0
- package/dist/browser/charts/core/balance-flow-messages.js +49 -0
- package/dist/browser/charts/core/balance-flow-messages.js.map +1 -0
- package/dist/browser/charts/core/balance-flow-size.js +42 -0
- package/dist/browser/charts/core/balance-flow-size.js.map +1 -0
- package/dist/browser/charts/core/balance-flow.js +195 -0
- package/dist/browser/charts/core/balance-flow.js.map +1 -0
- package/dist/browser/charts/core/bar-base-render.js +10 -0
- package/dist/browser/charts/core/bar-base-render.js.map +1 -0
- package/dist/browser/charts/core/bar-common.js +63 -0
- package/dist/browser/charts/core/bar-common.js.map +1 -0
- package/dist/browser/charts/core/bar-labels.js +12 -0
- package/dist/browser/charts/core/bar-labels.js.map +1 -1
- package/dist/browser/charts/core/bar-render.js +10 -0
- package/dist/browser/charts/core/bar-render.js.map +1 -0
- package/dist/browser/charts/core/bar-series.js +112 -0
- package/dist/browser/charts/core/bar-series.js.map +1 -0
- package/dist/browser/charts/core/calendar-layout.js +105 -0
- package/dist/browser/charts/core/calendar-layout.js.map +1 -0
- package/dist/browser/charts/core/calendar.js +48 -134
- package/dist/browser/charts/core/calendar.js.map +1 -1
- package/dist/browser/charts/core/dot-options.js +28 -0
- package/dist/browser/charts/core/dot-options.js.map +1 -0
- package/dist/browser/charts/core/dots.js +12 -0
- package/dist/browser/charts/core/dots.js.map +1 -0
- package/dist/browser/charts/core/index.js +23 -3
- package/dist/browser/charts/core/index.js.map +1 -1
- package/dist/browser/charts/core/inspection.js +2 -1
- package/dist/browser/charts/core/inspection.js.map +1 -1
- package/dist/browser/charts/core/line-base.js +102 -0
- package/dist/browser/charts/core/line-base.js.map +1 -0
- package/dist/browser/charts/core/line-details.js +264 -0
- package/dist/browser/charts/core/line-details.js.map +1 -0
- package/dist/browser/charts/core/line-options.js +32 -0
- package/dist/browser/charts/core/line-options.js.map +1 -0
- package/dist/browser/charts/core/line-paths.js +60 -0
- package/dist/browser/charts/core/line-paths.js.map +1 -0
- package/dist/browser/charts/core/line.js +15 -0
- package/dist/browser/charts/core/line.js.map +1 -0
- package/dist/browser/charts/core/number-format.js +53 -0
- package/dist/browser/charts/core/number-format.js.map +1 -0
- package/dist/browser/charts/core/palette.js +11 -0
- package/dist/browser/charts/core/palette.js.map +1 -0
- package/dist/browser/charts/core/pareto.js +23 -5
- package/dist/browser/charts/core/pareto.js.map +1 -1
- package/dist/browser/charts/core/registry.js +6 -2
- package/dist/browser/charts/core/registry.js.map +1 -1
- package/dist/browser/charts/core/render-size.js +6 -1
- package/dist/browser/charts/core/render-size.js.map +1 -1
- package/dist/browser/charts/core/render.js +30 -7
- package/dist/browser/charts/core/render.js.map +1 -1
- package/dist/browser/charts/core/sankey-size.js +105 -0
- package/dist/browser/charts/core/sankey-size.js.map +1 -0
- package/dist/browser/charts/core/sankey.js +280 -0
- package/dist/browser/charts/core/sankey.js.map +1 -0
- package/dist/browser/charts/core/snapshot.js +7 -5
- package/dist/browser/charts/core/snapshot.js.map +1 -1
- package/dist/browser/charts/core/svg-common.js +5 -67
- package/dist/browser/charts/core/svg-common.js.map +1 -1
- package/dist/browser/charts/core/svg-format.js +7 -0
- package/dist/browser/charts/core/svg-format.js.map +1 -0
- package/dist/browser/charts/core/svg-renderers.js +10 -108
- package/dist/browser/charts/core/svg-renderers.js.map +1 -1
- package/dist/browser/charts/core/treemap.js +1 -1
- package/dist/browser/charts/core/treemap.js.map +1 -1
- package/dist/browser/charts/core/types.js.map +1 -1
- package/dist/browser/charts/description.js.map +1 -1
- package/dist/browser/charts.js +4 -1
- package/dist/browser/charts.js.map +1 -1
- package/dist/browser/content/Chart.js +3 -1
- package/dist/browser/content/Chart.js.map +1 -1
- package/dist/browser/content/ChartBalanceFlow.js +90 -0
- package/dist/browser/content/ChartBalanceFlow.js.map +1 -0
- package/dist/browser/content/ChartExplorer.js +22 -7
- package/dist/browser/content/ChartExplorer.js.map +1 -1
- package/dist/browser/content/ChartRoot.js +70 -53
- package/dist/browser/content/ChartRoot.js.map +1 -1
- package/dist/browser/content/ChartSnapshotView.js +18 -11
- package/dist/browser/content/ChartSnapshotView.js.map +1 -1
- package/dist/browser/content/DataTable.js +212 -261
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/FileView.js +70 -99
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/LoadMore.js +185 -0
- package/dist/browser/content/LoadMore.js.map +1 -0
- package/dist/browser/content/PdfPages.js +638 -0
- package/dist/browser/content/PdfPages.js.map +1 -0
- package/dist/browser/content/PdfViewer.js +264 -553
- package/dist/browser/content/PdfViewer.js.map +1 -1
- package/dist/browser/content/VirtualFeed.js +379 -89
- package/dist/browser/content/VirtualFeed.js.map +1 -1
- package/dist/browser/content/chart-balance-flow-controller.js +184 -0
- package/dist/browser/content/chart-balance-flow-controller.js.map +1 -0
- package/dist/browser/content/chart-balance-flow.js +6 -0
- package/dist/browser/content/chart-balance-flow.js.map +1 -0
- package/dist/browser/content/chart-bar.js +50 -200
- package/dist/browser/content/chart-bar.js.map +1 -1
- package/dist/browser/content/chart-calendar.js +30 -14
- package/dist/browser/content/chart-calendar.js.map +1 -1
- package/dist/browser/content/chart-inspection-core.js +14 -79
- package/dist/browser/content/chart-inspection-core.js.map +1 -1
- package/dist/browser/content/chart-inspection-mount.js +75 -0
- package/dist/browser/content/chart-inspection-mount.js.map +1 -0
- package/dist/browser/content/chart-message-catalog.js +8 -0
- package/dist/browser/content/chart-message-catalog.js.map +1 -1
- package/dist/browser/content/chart-sankey.js +13 -0
- package/dist/browser/content/chart-sankey.js.map +1 -0
- package/dist/browser/content/chart-svg.js +2 -2
- package/dist/browser/content/chart-svg.js.map +1 -1
- package/dist/browser/content/chart-time-axis.js +10 -108
- package/dist/browser/content/chart-time-axis.js.map +1 -1
- package/dist/browser/content/chart-time-calendar.js +108 -0
- package/dist/browser/content/chart-time-calendar.js.map +1 -0
- package/dist/browser/content/feed-messages.js +22 -2
- package/dist/browser/content/feed-messages.js.map +1 -1
- package/dist/browser/content/index.js +1 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/pdf-messages.js +8 -8
- package/dist/browser/content/pdf-messages.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +1 -1
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/feedback/index.js.map +1 -1
- package/dist/browser/feedback/prompt-confirm.js +25 -14
- package/dist/browser/feedback/prompt-confirm.js.map +1 -1
- package/dist/browser/feedback/prompts.js +46 -38
- package/dist/browser/feedback/prompts.js.map +1 -1
- package/dist/browser/feedback/success-check.js +60 -0
- package/dist/browser/feedback/success-check.js.map +1 -0
- package/dist/browser/feedback/toast-hit.js +16 -0
- package/dist/browser/feedback/toast-hit.js.map +1 -0
- package/dist/browser/feedback/toast-messages.js +6 -2
- package/dist/browser/feedback/toast-messages.js.map +1 -1
- package/dist/browser/feedback/toast.js +609 -98
- package/dist/browser/feedback/toast.js.map +1 -1
- package/dist/browser/inputs/DatePicker.js +30 -21
- package/dist/browser/inputs/DatePicker.js.map +1 -1
- package/dist/browser/inputs/NumberInput.js +188 -160
- package/dist/browser/inputs/NumberInput.js.map +1 -1
- package/dist/browser/inputs/Select.js +433 -400
- package/dist/browser/inputs/Select.js.map +1 -1
- package/dist/browser/inputs/Switch.js +203 -77
- package/dist/browser/inputs/Switch.js.map +1 -1
- package/dist/browser/inputs/TextInput.js +212 -188
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/inputs/field-contract.js.map +1 -1
- package/dist/browser/inputs/field-suggestion-slot.js +21 -0
- package/dist/browser/inputs/field-suggestion-slot.js.map +1 -0
- package/dist/browser/inputs/field-suggestion-types.js +2 -0
- package/dist/browser/inputs/field-suggestion-types.js.map +1 -0
- package/dist/browser/inputs/field-suggestion.js +502 -0
- package/dist/browser/inputs/field-suggestion.js.map +1 -0
- package/dist/browser/inputs/index.js +1 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/suggestion-messages.js +160 -0
- package/dist/browser/inputs/suggestion-messages.js.map +1 -0
- package/dist/browser/intl/messages.js +4 -0
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AppOverview.js +15 -5
- package/dist/browser/layout/AppOverview.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +58 -21
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/BottomSheet.js +58 -40
- package/dist/browser/layout/BottomSheet.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +93 -438
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/DetailSections.js +8 -7
- package/dist/browser/layout/DetailSections.js.map +1 -1
- package/dist/browser/layout/Discussion.js +198 -291
- package/dist/browser/layout/Discussion.js.map +1 -1
- package/dist/browser/layout/PanelDialog.js +130 -116
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/detail-panel-messages.js +1 -1
- package/dist/browser/layout/detail-panel-messages.js.map +1 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/sheet-motion.js +479 -0
- package/dist/browser/layout/sheet-motion.js.map +1 -0
- package/dist/browser/surfaces/Field.js +102 -0
- package/dist/browser/surfaces/Field.js.map +1 -0
- package/dist/browser/surfaces/LinkCard.js +70 -21
- package/dist/browser/surfaces/LinkCard.js.map +1 -1
- package/dist/browser/surfaces/NoticeCard.js +68 -47
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/browser/surfaces/NoticeRow.js +75 -0
- package/dist/browser/surfaces/NoticeRow.js.map +1 -0
- package/dist/browser/surfaces/Section.js +441 -0
- package/dist/browser/surfaces/Section.js.map +1 -0
- package/dist/browser/surfaces/index.js +3 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/browser/surfaces/section-messages.js +25 -0
- package/dist/browser/surfaces/section-messages.js.map +1 -0
- package/dist/browser/text-editor/TextEditor.js +7 -3
- package/dist/browser/text-editor/TextEditor.js.map +1 -1
- package/dist/browser/text-editor/clipboard-html.js +62 -26
- package/dist/browser/text-editor/clipboard-html.js.map +1 -1
- package/dist/browser/text-editor/clipboard-loading.js +44 -15
- package/dist/browser/text-editor/clipboard-loading.js.map +1 -1
- package/dist/browser/text-editor/engine.js +9 -4
- package/dist/browser/text-editor/engine.js.map +1 -1
- package/dist/browser/text-editor/format.js +37 -1
- package/dist/browser/text-editor/format.js.map +1 -1
- package/dist/browser/text-editor/paste.js +2 -1
- package/dist/browser/text-editor/paste.js.map +1 -1
- package/dist/ssr/actions/SortableList.js +116 -0
- package/dist/ssr/actions/SortableList.js.map +1 -0
- package/dist/ssr/actions/SplitButton.js +10 -1
- package/dist/ssr/actions/SplitButton.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +111 -33
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/actions/drag-and-drop.js +2 -1
- package/dist/ssr/actions/drag-and-drop.js.map +1 -1
- package/dist/ssr/actions/index.js +2 -1
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/sortable-list-messages.js +35 -0
- package/dist/ssr/actions/sortable-list-messages.js.map +1 -0
- package/dist/ssr/chart-inspection.js +2 -1
- package/dist/ssr/chart-inspection.js.map +1 -1
- package/dist/ssr/charts/core/area.js +1 -1
- package/dist/ssr/charts/core/area.js.map +1 -1
- package/dist/ssr/charts/core/balance-flow-data.js +93 -0
- package/dist/ssr/charts/core/balance-flow-data.js.map +1 -0
- package/dist/ssr/charts/core/balance-flow-fields.js +19 -0
- package/dist/ssr/charts/core/balance-flow-fields.js.map +1 -0
- package/dist/ssr/charts/core/balance-flow-frame.js +44 -0
- package/dist/ssr/charts/core/balance-flow-frame.js.map +1 -0
- package/dist/ssr/charts/core/balance-flow-messages.js +49 -0
- package/dist/ssr/charts/core/balance-flow-messages.js.map +1 -0
- package/dist/ssr/charts/core/balance-flow-size.js +42 -0
- package/dist/ssr/charts/core/balance-flow-size.js.map +1 -0
- package/dist/ssr/charts/core/balance-flow.js +195 -0
- package/dist/ssr/charts/core/balance-flow.js.map +1 -0
- package/dist/ssr/charts/core/bar-base-render.js +10 -0
- package/dist/ssr/charts/core/bar-base-render.js.map +1 -0
- package/dist/ssr/charts/core/bar-common.js +63 -0
- package/dist/ssr/charts/core/bar-common.js.map +1 -0
- package/dist/ssr/charts/core/bar-labels.js +12 -0
- package/dist/ssr/charts/core/bar-labels.js.map +1 -1
- package/dist/ssr/charts/core/bar-render.js +10 -0
- package/dist/ssr/charts/core/bar-render.js.map +1 -0
- package/dist/ssr/charts/core/bar-series.js +112 -0
- package/dist/ssr/charts/core/bar-series.js.map +1 -0
- package/dist/ssr/charts/core/calendar-layout.js +105 -0
- package/dist/ssr/charts/core/calendar-layout.js.map +1 -0
- package/dist/ssr/charts/core/calendar.js +48 -134
- package/dist/ssr/charts/core/calendar.js.map +1 -1
- package/dist/ssr/charts/core/dot-options.js +28 -0
- package/dist/ssr/charts/core/dot-options.js.map +1 -0
- package/dist/ssr/charts/core/dots.js +12 -0
- package/dist/ssr/charts/core/dots.js.map +1 -0
- package/dist/ssr/charts/core/index.js +23 -3
- package/dist/ssr/charts/core/index.js.map +1 -1
- package/dist/ssr/charts/core/inspection.js +2 -1
- package/dist/ssr/charts/core/inspection.js.map +1 -1
- package/dist/ssr/charts/core/line-base.js +102 -0
- package/dist/ssr/charts/core/line-base.js.map +1 -0
- package/dist/ssr/charts/core/line-details.js +264 -0
- package/dist/ssr/charts/core/line-details.js.map +1 -0
- package/dist/ssr/charts/core/line-options.js +32 -0
- package/dist/ssr/charts/core/line-options.js.map +1 -0
- package/dist/ssr/charts/core/line-paths.js +60 -0
- package/dist/ssr/charts/core/line-paths.js.map +1 -0
- package/dist/ssr/charts/core/line.js +15 -0
- package/dist/ssr/charts/core/line.js.map +1 -0
- package/dist/ssr/charts/core/number-format.js +53 -0
- package/dist/ssr/charts/core/number-format.js.map +1 -0
- package/dist/ssr/charts/core/palette.js +11 -0
- package/dist/ssr/charts/core/palette.js.map +1 -0
- package/dist/ssr/charts/core/pareto.js +23 -5
- package/dist/ssr/charts/core/pareto.js.map +1 -1
- package/dist/ssr/charts/core/registry.js +6 -2
- package/dist/ssr/charts/core/registry.js.map +1 -1
- package/dist/ssr/charts/core/render-size.js +6 -1
- package/dist/ssr/charts/core/render-size.js.map +1 -1
- package/dist/ssr/charts/core/render.js +30 -7
- package/dist/ssr/charts/core/render.js.map +1 -1
- package/dist/ssr/charts/core/sankey-size.js +105 -0
- package/dist/ssr/charts/core/sankey-size.js.map +1 -0
- package/dist/ssr/charts/core/sankey.js +280 -0
- package/dist/ssr/charts/core/sankey.js.map +1 -0
- package/dist/ssr/charts/core/snapshot.js +7 -5
- package/dist/ssr/charts/core/snapshot.js.map +1 -1
- package/dist/ssr/charts/core/svg-common.js +5 -67
- package/dist/ssr/charts/core/svg-common.js.map +1 -1
- package/dist/ssr/charts/core/svg-format.js +7 -0
- package/dist/ssr/charts/core/svg-format.js.map +1 -0
- package/dist/ssr/charts/core/svg-renderers.js +10 -108
- package/dist/ssr/charts/core/svg-renderers.js.map +1 -1
- package/dist/ssr/charts/core/treemap.js +1 -1
- package/dist/ssr/charts/core/treemap.js.map +1 -1
- package/dist/ssr/charts/core/types.js.map +1 -1
- package/dist/ssr/charts/description.js.map +1 -1
- package/dist/ssr/charts.js +4 -1
- package/dist/ssr/charts.js.map +1 -1
- package/dist/ssr/content/Chart.js +3 -1
- package/dist/ssr/content/Chart.js.map +1 -1
- package/dist/ssr/content/ChartBalanceFlow.js +69 -0
- package/dist/ssr/content/ChartBalanceFlow.js.map +1 -0
- package/dist/ssr/content/ChartExplorer.js +16 -4
- package/dist/ssr/content/ChartExplorer.js.map +1 -1
- package/dist/ssr/content/ChartRoot.js +25 -13
- package/dist/ssr/content/ChartRoot.js.map +1 -1
- package/dist/ssr/content/ChartSnapshotView.js +6 -2
- package/dist/ssr/content/ChartSnapshotView.js.map +1 -1
- package/dist/ssr/content/DataTable.js +72 -118
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/FileView.js +39 -50
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/LoadMore.js +146 -0
- package/dist/ssr/content/LoadMore.js.map +1 -0
- package/dist/ssr/content/PdfPages.js +538 -0
- package/dist/ssr/content/PdfPages.js.map +1 -0
- package/dist/ssr/content/PdfViewer.js +226 -457
- package/dist/ssr/content/PdfViewer.js.map +1 -1
- package/dist/ssr/content/VirtualFeed.js +292 -44
- package/dist/ssr/content/VirtualFeed.js.map +1 -1
- package/dist/ssr/content/chart-balance-flow-controller.js +184 -0
- package/dist/ssr/content/chart-balance-flow-controller.js.map +1 -0
- package/dist/ssr/content/chart-balance-flow.js +6 -0
- package/dist/ssr/content/chart-balance-flow.js.map +1 -0
- package/dist/ssr/content/chart-bar.js +50 -200
- package/dist/ssr/content/chart-bar.js.map +1 -1
- package/dist/ssr/content/chart-calendar.js +30 -14
- package/dist/ssr/content/chart-calendar.js.map +1 -1
- package/dist/ssr/content/chart-inspection-core.js +14 -79
- package/dist/ssr/content/chart-inspection-core.js.map +1 -1
- package/dist/ssr/content/chart-inspection-mount.js +75 -0
- package/dist/ssr/content/chart-inspection-mount.js.map +1 -0
- package/dist/ssr/content/chart-message-catalog.js +8 -0
- package/dist/ssr/content/chart-message-catalog.js.map +1 -1
- package/dist/ssr/content/chart-sankey.js +13 -0
- package/dist/ssr/content/chart-sankey.js.map +1 -0
- package/dist/ssr/content/chart-svg.js +2 -2
- package/dist/ssr/content/chart-svg.js.map +1 -1
- package/dist/ssr/content/chart-time-axis.js +10 -108
- package/dist/ssr/content/chart-time-axis.js.map +1 -1
- package/dist/ssr/content/chart-time-calendar.js +108 -0
- package/dist/ssr/content/chart-time-calendar.js.map +1 -0
- package/dist/ssr/content/feed-messages.js +22 -2
- package/dist/ssr/content/feed-messages.js.map +1 -1
- package/dist/ssr/content/index.js +1 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/pdf-messages.js +8 -8
- package/dist/ssr/content/pdf-messages.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +1 -1
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/feedback/index.js.map +1 -1
- package/dist/ssr/feedback/prompt-confirm.js +13 -2
- package/dist/ssr/feedback/prompt-confirm.js.map +1 -1
- package/dist/ssr/feedback/prompts.js +32 -24
- package/dist/ssr/feedback/prompts.js.map +1 -1
- package/dist/ssr/feedback/success-check.js +47 -0
- package/dist/ssr/feedback/success-check.js.map +1 -0
- package/dist/ssr/feedback/toast-hit.js +16 -0
- package/dist/ssr/feedback/toast-hit.js.map +1 -0
- package/dist/ssr/feedback/toast-messages.js +6 -2
- package/dist/ssr/feedback/toast-messages.js.map +1 -1
- package/dist/ssr/feedback/toast.js +609 -98
- package/dist/ssr/feedback/toast.js.map +1 -1
- package/dist/ssr/inputs/DatePicker.js +30 -21
- package/dist/ssr/inputs/DatePicker.js.map +1 -1
- package/dist/ssr/inputs/NumberInput.js +33 -7
- package/dist/ssr/inputs/NumberInput.js.map +1 -1
- package/dist/ssr/inputs/Select.js +38 -7
- package/dist/ssr/inputs/Select.js.map +1 -1
- package/dist/ssr/inputs/Switch.js +79 -18
- package/dist/ssr/inputs/Switch.js.map +1 -1
- package/dist/ssr/inputs/TextInput.js +31 -7
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/inputs/field-contract.js.map +1 -1
- package/dist/ssr/inputs/field-suggestion-slot.js +21 -0
- package/dist/ssr/inputs/field-suggestion-slot.js.map +1 -0
- package/dist/ssr/inputs/field-suggestion-types.js +2 -0
- package/dist/ssr/inputs/field-suggestion-types.js.map +1 -0
- package/dist/ssr/inputs/field-suggestion.js +402 -0
- package/dist/ssr/inputs/field-suggestion.js.map +1 -0
- package/dist/ssr/inputs/index.js +1 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/suggestion-messages.js +160 -0
- package/dist/ssr/inputs/suggestion-messages.js.map +1 -0
- package/dist/ssr/intl/messages.js +4 -0
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AppOverview.js +3 -3
- package/dist/ssr/layout/AppOverview.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +39 -5
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/BottomSheet.js +32 -4
- package/dist/ssr/layout/BottomSheet.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +34 -230
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/DetailSections.js +8 -7
- package/dist/ssr/layout/DetailSections.js.map +1 -1
- package/dist/ssr/layout/Discussion.js +72 -118
- package/dist/ssr/layout/Discussion.js.map +1 -1
- package/dist/ssr/layout/PanelDialog.js +54 -35
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/detail-panel-messages.js +1 -1
- package/dist/ssr/layout/detail-panel-messages.js.map +1 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/sheet-motion.js +479 -0
- package/dist/ssr/layout/sheet-motion.js.map +1 -0
- package/dist/ssr/surfaces/Field.js +58 -0
- package/dist/ssr/surfaces/Field.js.map +1 -0
- package/dist/ssr/surfaces/LinkCard.js +38 -5
- package/dist/ssr/surfaces/LinkCard.js.map +1 -1
- package/dist/ssr/surfaces/NoticeCard.js +33 -17
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/surfaces/NoticeRow.js +39 -0
- package/dist/ssr/surfaces/NoticeRow.js.map +1 -0
- package/dist/ssr/surfaces/Section.js +295 -0
- package/dist/ssr/surfaces/Section.js.map +1 -0
- package/dist/ssr/surfaces/index.js +3 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/ssr/surfaces/section-messages.js +25 -0
- package/dist/ssr/surfaces/section-messages.js.map +1 -0
- package/dist/ssr/text-editor/TextEditor.js +7 -3
- package/dist/ssr/text-editor/TextEditor.js.map +1 -1
- package/dist/ssr/text-editor/clipboard-html.js +62 -26
- package/dist/ssr/text-editor/clipboard-html.js.map +1 -1
- package/dist/ssr/text-editor/clipboard-loading.js +44 -15
- package/dist/ssr/text-editor/clipboard-loading.js.map +1 -1
- package/dist/ssr/text-editor/engine.js +9 -4
- package/dist/ssr/text-editor/engine.js.map +1 -1
- package/dist/ssr/text-editor/format.js +37 -1
- package/dist/ssr/text-editor/format.js.map +1 -1
- package/dist/ssr/text-editor/paste.js +2 -1
- package/dist/ssr/text-editor/paste.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tabler.css +2 -1
- package/dist/types/actions/SortableList.d.ts +26 -0
- package/dist/types/actions/SplitButton.d.ts +5 -1
- package/dist/types/actions/Toolbar.d.ts +29 -1
- package/dist/types/actions/drag-and-drop.d.ts +2 -0
- package/dist/types/actions/index.d.ts +4 -2
- package/dist/types/actions/sortable-list-messages.d.ts +15 -0
- package/dist/types/chart-inspection.d.ts +2 -1
- package/dist/types/charts/core/balance-flow-data.d.ts +37 -0
- package/dist/types/charts/core/balance-flow-fields.d.ts +13 -0
- package/dist/types/charts/core/balance-flow-frame.d.ts +4 -0
- package/dist/types/charts/core/balance-flow-messages.d.ts +97 -0
- package/dist/types/charts/core/balance-flow-size.d.ts +21 -0
- package/dist/types/charts/core/balance-flow.d.ts +70 -0
- package/dist/types/charts/core/bar-base-render.d.ts +7 -0
- package/dist/types/charts/core/bar-common.d.ts +13 -0
- package/dist/types/charts/core/bar-labels.d.ts +1 -0
- package/dist/types/charts/core/bar-render.d.ts +7 -0
- package/dist/types/charts/core/bar-series.d.ts +7 -0
- package/dist/types/charts/core/calendar-layout.d.ts +67 -0
- package/dist/types/charts/core/calendar.d.ts +2 -55
- package/dist/types/charts/core/dot-options.d.ts +27 -0
- package/dist/types/charts/core/dots.d.ts +7 -0
- package/dist/types/charts/core/index.d.ts +23 -3
- package/dist/types/charts/core/line-base.d.ts +3 -0
- package/dist/types/charts/core/line-details.d.ts +30 -0
- package/dist/types/charts/core/line-options.d.ts +25 -0
- package/dist/types/charts/core/line-paths.d.ts +16 -0
- package/dist/types/charts/core/line.d.ts +2 -0
- package/dist/types/charts/core/number-format.d.ts +28 -0
- package/dist/types/charts/core/palette.d.ts +5 -0
- package/dist/types/charts/core/pareto.d.ts +2 -0
- package/dist/types/charts/core/registry.d.ts +5 -1
- package/dist/types/charts/core/render.d.ts +4 -1
- package/dist/types/charts/core/sankey-size.d.ts +38 -0
- package/dist/types/charts/core/sankey.d.ts +106 -0
- package/dist/types/charts/core/snapshot.d.ts +2 -0
- package/dist/types/charts/core/svg-common.d.ts +23 -16
- package/dist/types/charts/core/svg-format.d.ts +1 -0
- package/dist/types/charts/core/svg-renderers.d.ts +9 -9
- package/dist/types/charts/core/types.d.ts +1 -0
- package/dist/types/charts/description.d.ts +56 -1
- package/dist/types/charts.d.ts +4 -1
- package/dist/types/content/ChartBalanceFlow.d.ts +17 -0
- package/dist/types/content/ChartExplorer.d.ts +2 -0
- package/dist/types/content/ChartRoot.d.ts +2 -1
- package/dist/types/content/DataTable.d.ts +7 -1
- package/dist/types/content/LoadMore.d.ts +41 -0
- package/dist/types/content/PdfPages.d.ts +57 -0
- package/dist/types/content/PdfViewer.d.ts +35 -19
- package/dist/types/content/VirtualFeed.d.ts +57 -18
- package/dist/types/content/chart-balance-flow-controller.d.ts +12 -0
- package/dist/types/content/chart-balance-flow.d.ts +4 -0
- package/dist/types/content/chart-bar.d.ts +27 -19
- package/dist/types/content/chart-inspection-core.d.ts +4 -18
- package/dist/types/content/chart-inspection-mount.d.ts +21 -0
- package/dist/types/content/chart-sankey.d.ts +3 -0
- package/dist/types/content/chart-svg.d.ts +1 -1
- package/dist/types/content/chart-time-axis.d.ts +3 -19
- package/dist/types/content/chart-time-calendar.d.ts +24 -0
- package/dist/types/content/feed-messages.d.ts +10 -0
- package/dist/types/content/index.d.ts +3 -3
- package/dist/types/content/pdf-messages.d.ts +2 -2
- package/dist/types/feedback/index.d.ts +2 -2
- package/dist/types/feedback/prompt-confirm.d.ts +2 -0
- package/dist/types/feedback/prompts.d.ts +5 -1
- package/dist/types/feedback/success-check.d.ts +4 -0
- package/dist/types/feedback/toast-hit.d.ts +5 -0
- package/dist/types/feedback/toast-messages.d.ts +3 -1
- package/dist/types/feedback/toast.d.ts +42 -5
- package/dist/types/inputs/DatePicker.d.ts +4 -2
- package/dist/types/inputs/NumberInput.d.ts +2 -2
- package/dist/types/inputs/Select.d.ts +2 -2
- package/dist/types/inputs/Switch.d.ts +8 -2
- package/dist/types/inputs/TextInput.d.ts +4 -2
- package/dist/types/inputs/field-contract.d.ts +1 -0
- package/dist/types/inputs/field-suggestion-slot.d.ts +3 -0
- package/dist/types/inputs/field-suggestion-types.d.ts +103 -0
- package/dist/types/inputs/field-suggestion.d.ts +26 -0
- package/dist/types/inputs/index.d.ts +3 -1
- package/dist/types/inputs/suggestion-messages.d.ts +67 -0
- package/dist/types/intl/messages.d.ts +2 -0
- package/dist/types/layout/AppOverview.d.ts +2 -0
- package/dist/types/layout/AppWorkspace.d.ts +10 -0
- package/dist/types/layout/BottomSheet.d.ts +6 -0
- package/dist/types/layout/DetailPanel.d.ts +8 -38
- package/dist/types/layout/PanelDialog.d.ts +5 -0
- package/dist/types/layout/detail-panel-messages.d.ts +1 -1
- package/dist/types/layout/index.d.ts +2 -2
- package/dist/types/layout/sheet-motion.d.ts +32 -0
- package/dist/types/surfaces/Field.d.ts +20 -0
- package/dist/types/surfaces/LinkCard.d.ts +9 -1
- package/dist/types/surfaces/NoticeCard.d.ts +14 -1
- package/dist/types/surfaces/NoticeRow.d.ts +23 -0
- package/dist/types/surfaces/Section.d.ts +74 -0
- package/dist/types/surfaces/index.d.ts +6 -0
- package/dist/types/surfaces/section-messages.d.ts +10 -0
- package/dist/types/text-editor/TextEditor.d.ts +5 -0
- package/dist/types/text-editor/clipboard-loading.d.ts +2 -3
- package/dist/types/text-editor/engine.d.ts +6 -1
- package/dist/types/text-editor/format.d.ts +3 -1
- package/package.json +2 -2
- package/dist/browser/content/PdfPreview.js +0 -448
- package/dist/browser/content/PdfPreview.js.map +0 -1
- package/dist/ssr/content/PdfPreview.js +0 -300
- package/dist/ssr/content/PdfPreview.js.map +0 -1
- package/dist/types/content/PdfPreview.d.ts +0 -26
- /package/dist/{tabler-icons-15sezdfp.woff2 → tabler-icons-dafbdda4cb0cdcb2.woff2} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["content/FileView.tsx"],"sourcesContent":["import { useMarkdownEditorMessages } from \"../inputs/markdown/editor-messages\";\nimport { useDataTableMessages } from \"./data-table-messages\";\nimport { useFileViewMessages } from \"./file-view-messages\";\n/**\n * FileView — renders one file through a small renderer registry keyed by\n * media type / path. Editing is enabled purely by the presence of `save`;\n * without it every renderer is read-only. IDE-style chrome: editors reuse\n * the markdown editor's surface (toolbar with an in-toolbar save, Ctrl/Cmd+S),\n * previews are quiet paper panels with icon-only actions overlaid top-right.\n * A plain preview drops the panel and sits on its host's surface instead.\n * Custom renderers are passed per instance, which keeps SSR requests and\n * independently mounted applications isolated.\n */\n\nimport { mutation } from \"@k2b/stdlib/solid\";\nimport {\n type Component,\n createContext,\n createEffect,\n createMemo,\n createResource,\n createSignal,\n For,\n type JSX,\n Match,\n onCleanup,\n onMount,\n Show,\n Switch,\n untrack,\n useContext,\n} from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { prompts } from \"../feedback/prompts\";\nimport { Tooltip } from \"../feedback/Tooltip\";\nimport { toast } from \"../feedback/toast\";\nimport { MarkdownEditor } from \"../inputs/markdown/MarkdownEditor\";\nimport { Select } from \"../inputs/Select\";\nimport { useUiMessages } from \"../intl/messages\";\nimport Placeholder from \"../surfaces/Placeholder\";\nimport CodeDisplay, { type CodeDisplayLanguage } from \"./CodeDisplay\";\nimport { type DelimitedPreferences, decodeDelimitedContent, readDelimitedPreferences } from \"./delimited-preferences\";\nimport { type FileViewFile, fileViewExtension, getFileViewPreviewKind, parseDelimitedText } from \"./file-view-preview\";\nimport MarkdownView from \"./MarkdownView\";\nimport { leadingMarkdownTitle } from \"./markdown-title\";\nimport PdfPreview from \"./PdfPreview\";\nimport StructuredDataPreview, { type StructuredDataValue } from \"./StructuredDataPreview\";\nimport VideoPlayer from \"./VideoPlayer\";\n\nexport type { FileViewFile, FileViewPreviewKind } from \"./file-view-preview\";\nexport { canPreviewFile, getFileViewPreviewKind } from \"./file-view-preview\";\nexport type FileViewContent = { encoding: \"utf8\" | \"base64\"; content: string; mediaType: string };\n\nexport type FileViewProps = {\n /**\n * Plain previews inherit the surrounding surface without a frame or inset padding. They keep their natural height,\n * so the host scrolls them and owns the actions around them; a host that stretches one gets its scrolling back.\n */\n variant?: \"default\" | \"plain\";\n /**\n * Lifts a leading Markdown level-one heading into the host, for example a dialog title. Reports its plain text and\n * leaves that heading out of the preview, or reports null when the shown file has none, the heading holds a link or\n * image or is the whole document, or the file fails to load.\n */\n onDocumentTitle?: (title: string | null) => void;\n /** Read-only excerpt limit; omitted renders the complete preview. */\n previewLines?: number;\n onExpandPreview?: () => void;\n headingScale?: \"compact\" | \"normal\" | \"large\";\n /** Optional browser-local preference scope, owned by the host. */\n previewPreferencesKey?: string;\n file: FileViewFile;\n load: () => Promise<FileViewContent>;\n /** Refetch the current path when this host-owned revision changes. */\n revision?: unknown;\n /** Register an awaitable refresh for the currently visible preview. */\n registerRefresh?: (refresh: () => Promise<void>) => void | (() => void);\n /** Presence enables editing for text-based renderers. */\n save?: (content: string) => Promise<void>;\n /** Authenticated inline URL used by browser-native image, PDF, audio, and video previews. */\n previewHref?: string | null;\n /** CORS mode for native image/audio/video previews. Omit to preserve browser defaults. */\n crossOrigin?: \"anonymous\" | \"use-credentials\";\n /** Native media failed to load; the host can renew a signed URL and offer retry. */\n onPreviewError?: () => void;\n /** Download actions only; never a preview source, because an attachment response does not render inline. */\n downloadHref?: string | null;\n /** App-specific renderers matched before the built-ins for this instance. */\n renderers?: readonly FileViewRenderer[];\n /** Reports local edit state so a parent browser can guard navigation. */\n onDirtyChange?: (dirty: boolean) => void;\n class?: string;\n};\n\nexport type FileViewRendererProps = {\n /** Read-only excerpt limit; omitted renders the complete preview. */\n previewLines?: number;\n onExpandPreview?: () => void;\n headingScale?: \"compact\" | \"normal\" | \"large\";\n /** Optional browser-local preference scope, owned by the host. */\n previewPreferencesKey?: string;\n file: FileViewFile;\n content: FileViewContent;\n previewHref: string | null;\n crossOrigin?: \"anonymous\" | \"use-credentials\";\n onPreviewError?: () => void;\n downloadHref: string | null;\n /** Null when the file is read-only. */\n editor: {\n draft: () => string;\n setDraft: (value: string) => void;\n dirty: () => boolean;\n saving: () => boolean;\n save: () => Promise<void>;\n } | null;\n};\n\nexport type FileViewRenderer = {\n id: string;\n match: (file: FileViewFile, content: FileViewContent) => boolean;\n component: Component<FileViewRendererProps>;\n /** Text renderers that support the edit affordance when `save` is present. */\n editable?: boolean;\n};\n\n/** Instance options that reach the built-in renderers without widening the public renderer props. */\nconst FileViewHost = createContext({ plain: false, liftTitle: false });\n\nconst codeLanguage = (path: string): CodeDisplayLanguage => {\n const extension = fileViewExtension(path);\n if (extension === \"ts\" || extension === \"mts\" || extension === \"cts\") return \"ts\";\n if (extension === \"tsx\") return \"tsx\";\n if (extension === \"js\" || extension === \"mjs\" || extension === \"cjs\") return \"js\";\n if (extension === \"jsx\") return \"jsx\";\n if (extension === \"md\" || extension === \"markdown\") return \"md\";\n return \"text\";\n};\n\nconst isMarkdown = (file: FileViewFile, content: FileViewContent) =>\n content.encoding === \"utf8\" && getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"markdown\";\n\n/** Rendered previews hide a leading YAML frontmatter block — it's metadata, not content. */\nconst stripFrontmatter = (text: string): string => {\n const match = /^---\\r?\\n[\\s\\S]*?\\r?\\n---\\r?\\n?/.exec(text.trimStart());\n return match ? text.trimStart().slice(match[0].length) : text;\n};\n\n/** Icon-only download link with the shared tooltip, for toolbars that style their own controls. */\nfunction DownloadLink(props: { class: string; href: string; download: string; label: string; icon: string }) {\n let link: HTMLAnchorElement | undefined;\n return (\n <>\n <a ref={link} class={props.class} href={props.href} download={props.download} aria-label={props.label}>\n <i class={props.icon} aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{props.label}</span>\n </a>\n <Tooltip content={props.label} target={() => link} />\n </>\n );\n}\n\n/** Icon-only action, IDE style — sits in the floating top-right cluster of previews. */\nfunction OverlayAction(props: { icon: string; title: string; onClick?: () => void; href?: string; download?: string }) {\n const classes = \"k2b-content-file-view__action\";\n return (\n <Show\n when={props.href}\n fallback={\n <Tooltip.Trigger type=\"button\" class={classes} content={props.title} aria-label={props.title} onClick={props.onClick}>\n <i class={`ti ${props.icon}`} aria-hidden=\"true\" />\n </Tooltip.Trigger>\n }\n >\n {(href) => (\n <DownloadLink class={classes} href={href()} download={props.download ?? \"\"} label={props.title} icon={`ti ${props.icon}`} />\n )}\n </Show>\n );\n}\n\n/**\n * Scrollable preview panel with the floating action cluster overlaid top-right. Over a picture or a video the\n * cluster is glass; over text, tables, and documents it stays solid, because blurred text reads as a fault.\n */\nfunction OverlayPanel(props: { actions?: JSX.Element; overMedia?: boolean; children: JSX.Element }) {\n return (\n <div class=\"k2b-content-file-view__panel\">\n <div class=\"k2b-content-file-view__preview\">{props.children}</div>\n <Show when={props.actions}>\n <div class={`k2b-content-file-view__overlay${props.overMedia ? \" k2b-overlay-surface\" : \"\"}`}>{props.actions}</div>\n </Show>\n </div>\n );\n}\n\nconst DownloadAction = (props: FileViewRendererProps): JSX.Element => {\n const messages = useUiMessages();\n return (\n <Show when={props.downloadHref}>\n {(href) => (\n <OverlayAction\n icon=\"ti-download\"\n title={messages().download}\n href={href()}\n download={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n />\n )}\n </Show>\n );\n};\n\n/** Toolbar-styled icon button — reuses the package markdown-editor tool primitive. */\nfunction EditorToolButton(props: { icon: string; title: string; onClick: () => void; disabled?: boolean }) {\n return (\n <Tooltip.Trigger\n type=\"button\"\n class=\"k2b-markdown-editor__tool\"\n content={props.title}\n aria-label={props.title}\n tabIndex={-1}\n disabled={props.disabled}\n onMouseDown={(e) => e.preventDefault()}\n onClick={props.onClick}\n >\n <i class={props.icon} aria-hidden=\"true\" />\n </Tooltip.Trigger>\n );\n}\n\n// ── Built-in renderers ──────────────────────────────────────────────────────\n\nfunction MoreLines(props: { count: number; onClick?: () => void }) {\n const fileViewMessages = useFileViewMessages();\n return (\n <Show when={props.count > 0}>\n <div class=\"k2b-content-file-view__truncated\">\n <Show when={props.onClick} fallback={<span>{fileViewMessages().previewMoreLines(props.count)}</span>}>\n <Button size=\"sm\" variant=\"ghost\" onClick={props.onClick}>\n {fileViewMessages().previewMoreLines(props.count)}\n </Button>\n </Show>\n </div>\n </Show>\n );\n}\nfunction TextExcerpt(props: { renderer: FileViewRendererProps; text: string; markdown?: boolean }) {\n const lines = createMemo(() => props.text.replace(/\\r\\n?/g, \"\\n\").replace(/\\n$/, \"\").split(\"\\n\"));\n const limit = () => (props.renderer.previewLines === undefined ? lines().length : Math.max(1, props.renderer.previewLines));\n const text = () => lines().slice(0, limit()).join(\"\\n\");\n const host = useContext(FileViewHost);\n // A plain preview has no code box: the host frames the file and owns its copy action.\n const content = () => (\n <Show\n when={props.markdown}\n fallback={<CodeDisplay code={text()} language={codeLanguage(props.renderer.file.path)} copy={host.plain ? false : undefined} />}\n >\n <MarkdownView markdown={text()} headingScale={props.renderer.headingScale ?? \"compact\"} />\n </Show>\n );\n // Only an excerpt needs a clipping box; a complete preview keeps its content\n // a direct child of the preview frame, which the frame's styles expect.\n return (\n <>\n <Show when={props.renderer.previewLines !== undefined} fallback={content()}>\n <div class=\"k2b-content-file-view__excerpt\">{content()}</div>\n </Show>\n <MoreLines count={lines().length - limit()} onClick={props.renderer.onExpandPreview} />\n </>\n );\n}\n\nfunction MarkdownRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const host = useContext(FileViewHost);\n const [editing, setEditing] = createSignal(false);\n const markdown = () => {\n const text = stripFrontmatter(props.editor?.draft() ?? props.content.content);\n return host.liftTitle ? (leadingMarkdownTitle(text)?.body ?? text) : text;\n };\n return (\n <Show\n when={props.editor && editing()}\n fallback={\n <OverlayPanel\n actions={\n <>\n <Show when={props.editor}>\n <OverlayAction icon=\"ti-pencil\" title={messages().edit} onClick={() => setEditing(true)} />\n </Show>\n <DownloadAction {...props} />\n </>\n }\n >\n <div class=\"k2b-content-file-view__document\">\n <TextExcerpt renderer={props} text={markdown()} markdown />\n </div>\n </OverlayPanel>\n }\n >\n {(_) => {\n const editor = props.editor!;\n return (\n <div class=\"k2b-content-file-view__editor\">\n <MarkdownEditor\n class=\"k2b-content-file-view__markdown-field\"\n aria-label={`Edit ${props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}`}\n fill\n value={editor.draft()}\n onValueChange={editor.setDraft}\n showStats={false}\n onSave={() => void editor.save()}\n saveDisabled={!editor.dirty()}\n saving={editor.saving()}\n toolbarTrailing={<EditorToolButton icon=\"ti ti-eye\" title={messages().preview} onClick={() => setEditing(false)} />}\n />\n </div>\n );\n }}\n </Show>\n );\n}\n\nfunction TextRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const markdownEditorMessages = useMarkdownEditorMessages();\n return (\n <Show\n when={props.editor}\n fallback={\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <TextExcerpt renderer={props} text={props.content.content} />\n </OverlayPanel>\n }\n >\n {(editor) => (\n // Same chrome as the markdown editor — literally the same classes, so\n // border, radius, focus ring, toolbar height and text metrics cannot drift.\n <div class=\"k2b-content-file-view__editor\">\n <div\n class=\"k2b-markdown-editor\"\n data-fill=\"true\"\n role=\"group\"\n aria-label={fileViewMessages().textEditor}\n onKeyDown={(event) => {\n if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === \"s\") {\n event.preventDefault();\n if (editor().dirty() && !editor().saving()) void editor().save();\n }\n }}\n >\n {/* No formatting tools here — the divider under an actions-only bar reads lost. */}\n <div class=\"k2b-markdown-editor__toolbar k2b-content-file-view__code-toolbar\">\n <span class=\"k2b-content-file-view__code-language\">{codeLanguage(props.file.path)}</span>\n <span class=\"k2b-markdown-editor__trailing\">\n <Show when={props.downloadHref}>\n {(href) => (\n <DownloadLink\n class=\"k2b-markdown-editor__tool\"\n href={href()}\n download={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n label={messages().download}\n icon=\"ti ti-download\"\n />\n )}\n </Show>\n <EditorToolButton\n icon={editor().saving() ? \"ti ti-loader-2 k2b-spin\" : \"ti ti-device-floppy\"}\n title={markdownEditorMessages().saveShortcut}\n disabled={!editor().dirty() || editor().saving()}\n onClick={() => void editor().save()}\n />\n </span>\n </div>\n <div class=\"k2b-markdown-editor__surface\">\n <textarea\n class=\"k2b-content-file-view__code-input\"\n value={editor().draft()}\n spellcheck={false}\n onInput={(event) => editor().setDraft(event.currentTarget.value)}\n />\n </div>\n </div>\n </div>\n )}\n </Show>\n );\n}\n\nfunction JsonRenderer(props: FileViewRendererProps) {\n const parsed = createMemo(() => {\n try {\n return { ok: true as const, value: JSON.parse(props.content.content) as StructuredDataValue };\n } catch {\n return { ok: false as const };\n }\n });\n const parsedValue = (): StructuredDataValue => {\n const result = parsed();\n return result.ok ? result.value : null;\n };\n\n return (\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__document\">\n <Show when={parsed().ok} fallback={<TextExcerpt renderer={props} text={props.content.content} />}>\n <Show\n when={props.previewLines === undefined}\n fallback={<TextExcerpt renderer={props} text={JSON.stringify(parsedValue(), null, 2)} />}\n >\n <StructuredDataPreview data={parsedValue()} maxRows={200} />\n </Show>\n </Show>\n </div>\n </OverlayPanel>\n );\n}\n\nfunction DelimitedTextRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const dataTableMessages = useDataTableMessages();\n const [preferences, setPreferences] = createSignal<DelimitedPreferences>({ encoding: \"utf-8\", delimiter: \"auto\", view: \"table\" });\n onMount(() => {\n if (!props.previewPreferencesKey) return;\n try {\n setPreferences(readDelimitedPreferences(localStorage.getItem(props.previewPreferencesKey)));\n } catch {\n /* Storage may be disabled. */\n }\n });\n const update = (patch: Partial<DelimitedPreferences>) => {\n const next = { ...preferences(), ...patch };\n setPreferences(next);\n if (props.previewPreferencesKey) {\n try {\n localStorage.setItem(props.previewPreferencesKey, JSON.stringify(next));\n } catch {\n /* Keep the local selection. */\n }\n }\n };\n const text = createMemo(() => decodeDelimitedContent(props.content, preferences().encoding));\n const delimiter = () =>\n preferences().delimiter === \"auto\"\n ? fileViewExtension(props.file.path) === \"tsv\" || props.content.mediaType === \"text/tab-separated-values\"\n ? \"\\t\"\n : \",\"\n : preferences().delimiter;\n const [page, setPage] = createSignal(0);\n createEffect(() => {\n text();\n delimiter();\n props.previewLines;\n setPage(0);\n });\n const pageSize = () => (props.previewLines === undefined ? 200 : Math.max(1, props.previewLines));\n const preview = createMemo(() => parseDelimitedText(text(), delimiter(), { rows: pageSize() + 1, offset: page() * pageSize() }));\n const settings = () =>\n prompts.dialog(\n () => (\n <div class=\"k2b-content-file-view__settings\">\n <Select\n label={fileViewMessages().csvEncoding}\n value={preferences().encoding}\n disabled={props.content.encoding !== \"base64\"}\n options={[\"utf-8\", \"windows-1252\", \"utf-16le\", \"utf-16be\"]}\n onValueChange={(value) => {\n if (value) update({ encoding: value });\n }}\n />\n <Select\n label={fileViewMessages().csvSeparator}\n value={preferences().delimiter}\n options={[\n { value: \"auto\", label: fileViewMessages().csvDefaultSeparator },\n { value: \",\", label: fileViewMessages().csvComma },\n { value: \";\", label: fileViewMessages().csvSemicolon },\n { value: \"\\t\", label: fileViewMessages().csvTab },\n { value: \"|\", label: \"|\" },\n ]}\n onValueChange={(value) => {\n if (value) update({ delimiter: value });\n }}\n />\n <Select\n label={fileViewMessages().csvView}\n value={preferences().view}\n options={[\n { value: \"table\", label: dataTableMessages().dataTable },\n { value: \"raw\", label: fileViewMessages().csvRaw },\n ]}\n onValueChange={(value) => {\n if (value === \"table\" || value === \"raw\") update({ view: value });\n }}\n />\n </div>\n ),\n { title: fileViewMessages().csvSettings },\n );\n const headers = createMemo(() => preview().rows[0] ?? []);\n const rows = createMemo(() => preview().rows.slice(1));\n\n return (\n <OverlayPanel\n actions={\n <>\n <OverlayAction icon=\"ti-adjustments-horizontal\" title={fileViewMessages().csvSettings} onClick={() => void settings()} />\n <DownloadAction {...props} />\n </>\n }\n >\n <Show when={preferences().view === \"table\"} fallback={<TextExcerpt renderer={props} text={text()} />}>\n <Show\n when={headers().length > 0}\n fallback={\n <Placeholder icon=\"ti ti-table\" title={fileViewMessages().emptyFile} description={fileViewMessages().delimitedFileEmpty} />\n }\n >\n <div class=\"k2b-content-file-view__sheet\">\n <table class=\"k2b-content-file-view__table\">\n <thead>\n <tr>\n <For each={headers()}>\n {(header, index) => (\n <th scope=\"col\">\n <span>{header || fileViewMessages().column({ number: index() + 1 })}</span>\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={rows()}>\n {(row) => (\n <tr>\n <For each={headers()}>{(_, index) => <td>{row[index()] ?? \"\"}</td>}</For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n <Show when={preview().columnsTruncated}>\n <div class=\"k2b-content-file-view__truncated\">{fileViewMessages().previewColumnsLimited}</div>\n </Show>\n <Show\n when={props.previewLines !== undefined}\n fallback={\n <Show when={preview().totalRows > 201}>\n <div class=\"k2b-content-file-view__pagination\">\n <Button size=\"sm\" variant=\"ghost\" disabled={page() === 0} onClick={() => setPage(page() - 1)}>\n {messages().previous}\n </Button>\n <span>\n {page() * pageSize() + 1}–{Math.min((page() + 1) * pageSize(), preview().totalRows - 1)} / {preview().totalRows - 1}\n </span>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n disabled={(page() + 1) * pageSize() >= preview().totalRows - 1}\n onClick={() => setPage(page() + 1)}\n >\n {messages().next}\n </Button>\n </div>\n </Show>\n }\n >\n <MoreLines count={preview().totalRows - rows().length - 1} onClick={props.onExpandPreview} />\n </Show>\n </div>\n </Show>\n </Show>\n </OverlayPanel>\n );\n}\n\nconst mediaSource = (props: FileViewRendererProps): string =>\n props.previewHref ?? `data:${props.content.mediaType};base64,${props.content.content}`;\n\nfunction ImageRenderer(props: FileViewRendererProps) {\n return (\n <OverlayPanel overMedia actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\">\n <img crossOrigin={props.crossOrigin} onError={props.onPreviewError} src={mediaSource(props)} alt={props.file.path} />\n </div>\n </OverlayPanel>\n );\n}\n\nconst pdfBlob = (content: FileViewContent): Blob => {\n if (content.encoding === \"utf8\") return new Blob([content.content], { type: \"application/pdf\" });\n const binary = atob(content.content);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);\n return new Blob([bytes], { type: \"application/pdf\" });\n};\n\n/**\n * Both ways end in `PdfPreview`, which draws with pdf.js and falls back to the browser's viewer. A host inline URL is\n * fetched from there and stays the address the open action shows. Without one, the loaded bytes become a local PDF\n * Blob: a download URL is an attachment and would leave a viewer empty.\n */\nconst sameOrigin = (href: string): boolean => {\n if (typeof location === \"undefined\") return true;\n try {\n return new URL(href, location.href).origin === location.origin;\n } catch {\n return false;\n }\n};\n\nfunction PdfRenderer(props: FileViewRendererProps) {\n const fileViewMessages = useFileViewMessages();\n // A new Blob remounts the preview, so changed bytes show the new file. A revision refetch\n // often returns the same bytes (the Assistant refetches on every tool step); keeping the\n // Blob then keeps the reader's page instead of reloading the viewer.\n const bytes = createMemo(() => props.content, undefined, {\n equals: (previous, next) => previous.encoding === next.encoding && previous.content === next.content,\n });\n const blob = createMemo(() => (props.previewHref || !bytes().content ? null : pdfBlob(bytes())));\n return (\n <Show\n when={props.previewHref}\n fallback={\n <Show\n keyed\n when={blob()}\n fallback={<Placeholder icon=\"ti ti-file-type-pdf\" title=\"PDF\" description={fileViewMessages().noInlinePreview} />}\n >\n {(pdf) => (\n // Composed without the standalone heading: the host already names the file, and the frame keeps the\n // file name as its accessible title.\n <PdfPreview autoLoad title={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)} request={async () => pdf}>\n {(parts) => (\n <div class=\"k2b-content-file-view__pdf-viewer\">\n {parts.actions}\n {parts.content}\n </div>\n )}\n </PdfPreview>\n )}\n </Show>\n }\n >\n {(href) => (\n // Keyed by the address: a new revision of the file loads the new document.\n <Show keyed when={href()}>\n {(current) => {\n // Closing the preview or a new revision stops a running download.\n const abort = new AbortController();\n onCleanup(() => abort.abort());\n return (\n // A page may fetch only its own origin's PDFs without CORS; another origin's address stays with the\n // browser's viewer, which embeds it as before.\n <Show\n when={sameOrigin(current)}\n fallback={<object data={current} type=\"application/pdf\" class=\"k2b-content-file-view__pdf\" aria-label={props.file.path} />}\n >\n <PdfPreview\n autoLoad\n title={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n openHref={current}\n request={() => fetch(current, { credentials: \"same-origin\", signal: abort.signal })}\n >\n {(parts) => (\n <div class=\"k2b-content-file-view__pdf-viewer\">\n {parts.actions}\n {parts.content}\n </div>\n )}\n </PdfPreview>\n </Show>\n );\n }}\n </Show>\n )}\n </Show>\n );\n}\n\nfunction AudioRenderer(props: FileViewRendererProps) {\n const fileViewMessages = useFileViewMessages();\n return (\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\" data-kind=\"audio\">\n <audio\n crossOrigin={props.crossOrigin}\n onError={props.onPreviewError}\n controls\n preload=\"metadata\"\n src={mediaSource(props)}\n aria-label={props.file.path}\n >\n {fileViewMessages().audioUnsupported}\n </audio>\n </div>\n </OverlayPanel>\n );\n}\n\nfunction VideoRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const name = () => props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1);\n return (\n <OverlayPanel overMedia actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\" data-kind=\"video\">\n <VideoPlayer\n src={mediaSource(props)}\n label={name()}\n crossOrigin={props.crossOrigin}\n onFallback={props.onPreviewError}\n fallbackAction={\n <Show when={props.downloadHref}>\n {(href) => (\n <a class=\"k2b-button\" data-variant=\"secondary\" data-size=\"sm\" href={href()} download={name()}>\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n {messages().download}\n </a>\n )}\n </Show>\n }\n />\n </div>\n </OverlayPanel>\n );\n}\n\nfunction BinaryRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n return (\n <Placeholder\n icon=\"ti ti-file-unknown\"\n title={fileViewMessages().noPreview}\n description={props.content.mediaType || fileViewMessages().binaryFile}\n action={\n <Show when={props.downloadHref}>\n {(href) => (\n <a class=\"k2b-button\" data-variant=\"secondary\" data-size=\"sm\" href={href()} download=\"\">\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n {messages().download}\n </a>\n )}\n </Show>\n }\n />\n );\n}\n\nconst BUILTIN_RENDERERS: FileViewRenderer[] = [\n { id: \"markdown\", match: isMarkdown, component: MarkdownRenderer, editable: true },\n {\n id: \"image\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"image\",\n component: ImageRenderer,\n },\n {\n id: \"pdf\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"pdf\",\n component: PdfRenderer,\n },\n {\n id: \"json\",\n match: (file, content) =>\n content.encoding === \"utf8\" && getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"json\",\n component: JsonRenderer,\n },\n {\n id: \"delimited-text\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"delimited-text\",\n component: DelimitedTextRenderer,\n },\n {\n id: \"audio\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"audio\",\n component: AudioRenderer,\n },\n {\n id: \"video\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"video\",\n component: VideoRenderer,\n },\n { id: \"text\", match: (_file, content) => content.encoding === \"utf8\", component: TextRenderer, editable: true },\n { id: \"binary\", match: () => true, component: BinaryRenderer },\n];\n\n// ── Component ───────────────────────────────────────────────────────────────\n\n/**\n * A file size such as \"4.2 MB\". With `locale`, the number follows that language (\"4,2 MB\") and drops a trailing\n * zero (\"64 KB\"); without it, the output stays as before.\n */\nexport const formatFileViewSize = (bytes: number, locale?: string): string => {\n const [value, unit] = bytes < 1024 ? [bytes, \"B\"] : bytes < 1024 * 1024 ? [bytes / 1024, \"KB\"] : [bytes / (1024 * 1024), \"MB\"];\n if (unit === \"B\") return `${bytes} B`;\n if (!locale) return `${value.toFixed(1)} ${unit}`;\n return `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(value)} ${unit}`;\n};\n\nexport default function FileView(props: FileViewProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const [draft, setDraft] = createSignal(\"\");\n const [savedDraft, setSavedDraft] = createSignal(\"\");\n const [nativeRevision, setNativeRevision] = createSignal(0);\n const dirty = createMemo(() => draft() !== savedDraft());\n const instanceRenderers = () => props.renderers ?? [];\n const saveMutation = mutation.create<{ path: string; content: string }, { path: string; content: string }>({\n mutation: async (input) => {\n await props.save!(input.content);\n return input;\n },\n onSuccess: (saved) => {\n if (props.file.path === saved.path) setSavedDraft(saved.content);\n toast.success(fileViewMessages().fileSaved);\n },\n onError: (error) => toast.error(error.message),\n });\n const nativePreviewHref = createMemo(() => {\n const href = props.previewHref;\n if (!href) return null;\n const separator = href.includes(\"?\") ? \"&\" : \"?\";\n return `${href}${separator}preview-revision=${nativeRevision()}`;\n });\n const browserPreviewContent = createMemo<FileViewContent | null>(() => {\n const kind = getFileViewPreviewKind(props.file);\n if (kind !== \"image\" && kind !== \"pdf\" && kind !== \"audio\" && kind !== \"video\") return null;\n const href = nativePreviewHref();\n if (!href) return null;\n\n const candidate: FileViewContent = {\n encoding: \"base64\",\n content: \"\",\n mediaType: props.file.mediaType ?? \"application/octet-stream\",\n };\n return instanceRenderers().some((renderer) => renderer.match(props.file, candidate)) ? null : candidate;\n });\n const [content, { refetch }] = createResource(\n () => (browserPreviewContent() ? null : { path: props.file.path, revision: props.revision }),\n async () => {\n saveMutation.abort();\n // `load` is an imperative source adapter. Host signal reads inside it\n // must not turn this resource into a hidden reactive feedback loop.\n const loaded = await untrack(() => props.load());\n const loadedDraft = loaded.encoding === \"utf8\" ? loaded.content : \"\";\n setDraft(loadedDraft);\n setSavedDraft(loadedDraft);\n return loaded;\n },\n );\n createEffect(() => {\n if (!props.registerRefresh) return;\n const unregister = props.registerRefresh(async () => {\n if (browserPreviewContent()) setNativeRevision((value) => value + 1);\n else await refetch();\n });\n if (unregister) onCleanup(unregister);\n });\n // An errored resource throws when read; the error state below shows it instead.\n const resolvedContent = createMemo(() => browserPreviewContent() ?? (content.error ? undefined : content()));\n\n const renderer = createMemo(() => {\n const loaded = resolvedContent();\n if (!loaded) return null;\n return [...instanceRenderers(), ...BUILTIN_RENDERERS].find((candidate) => candidate.match(props.file, loaded)) ?? null;\n });\n\n createEffect(() => {\n props.onDirtyChange?.(dirty());\n });\n\n const save = async () => {\n if (!props.save || saveMutation.loading()) return;\n await saveMutation.mutate({ path: props.file.path, content: draft() });\n };\n\n const editor = () =>\n props.save && renderer()?.editable && resolvedContent()?.encoding === \"utf8\"\n ? {\n draft,\n setDraft,\n dirty,\n saving: saveMutation.loading,\n save,\n }\n : null;\n\n // Undefined while loading; the host keeps its own placeholder until the shown file decides.\n const documentTitle = createMemo<string | null | undefined>(() => {\n if (!props.onDocumentTitle) return undefined;\n if (content.error) return null;\n const loaded = resolvedContent();\n if (!loaded) return undefined;\n if (renderer()?.component !== MarkdownRenderer) return null;\n return leadingMarkdownTitle(stripFrontmatter(editor()?.draft() ?? loaded.content))?.title ?? null;\n });\n createEffect(() => {\n const title = documentTitle();\n if (title !== undefined) props.onDocumentTitle?.(title);\n });\n\n return (\n <div\n class={`k2b-content-file-view ${props.class ?? \"\"}`}\n data-variant={props.variant}\n data-excerpt={props.previewLines !== undefined ? \"true\" : undefined}\n >\n <FileViewHost.Provider\n value={{\n get plain() {\n return props.variant === \"plain\";\n },\n get liftTitle() {\n return Boolean(props.onDocumentTitle);\n },\n }}\n >\n <Switch>\n <Match when={content.loading && content() === undefined}>\n <Placeholder state=\"loading\" title={messages().loading} />\n </Match>\n <Match when={content.error}>\n <Placeholder state=\"error\" title={fileViewMessages().failedLoadFile} description={String(content.error?.message ?? \"\")} />\n </Match>\n <Match when={resolvedContent() && renderer()}>\n {(active) => {\n const Renderer = active().component;\n return (\n <Renderer\n previewLines={props.previewLines}\n onExpandPreview={props.onExpandPreview}\n headingScale={props.headingScale}\n previewPreferencesKey={props.previewPreferencesKey}\n file={props.file}\n content={resolvedContent()!}\n previewHref={nativePreviewHref()}\n crossOrigin={props.crossOrigin}\n onPreviewError={props.onPreviewError}\n downloadHref={props.downloadHref ?? null}\n editor={editor()}\n />\n );\n }}\n </Match>\n </Switch>\n </FileViewHost.Provider>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,yBAAyB,QAAQ,oCAAoC;AAC9E,SAAS,oBAAoB,QAAQ,uBAAuB;AAC5D,SAAS,mBAAmB,QAAQ,sBAAsB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,QAAQ,QAAQ,mBAAmB;AAC5C,SAEE,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,GAAG,EAEH,KAAK,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,MAAM,EACN,OAAO,EACP,UAAU,QACL,UAAU;AACjB,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAAS,OAAO,QAAQ,qBAAqB;AAC7C,SAAS,KAAK,QAAQ,mBAAmB;AACzC,SAAS,cAAc,QAAQ,mCAAmC;AAClE,SAAS,MAAM,QAAQ,kBAAkB;AACzC,SAAS,aAAa,QAAQ,kBAAkB;AAChD,OAAO,WAAW,MAAM,yBAAyB;AACjD,OAAO,WAAW,MAAoC,eAAe;AACrE,SAAoC,sBAAsB,EAAE,wBAAwB,QAAQ,yBAAyB;AACrH,SAA4B,iBAAiB,EAAE,sBAAsB,EAAE,kBAAkB,QAAQ,qBAAqB;AACtH,OAAO,YAAY,MAAM,gBAAgB;AACzC,SAAS,oBAAoB,QAAQ,kBAAkB;AACvD,OAAO,UAAU,MAAM,cAAc;AACrC,OAAO,qBAAqB,MAAoC,yBAAyB;AACzF,OAAO,WAAW,MAAM,eAAe;AAGvC,SAAS,cAAc,EAAE,sBAAsB,QA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AI;cAAA,OAAE,8BAAe,CAAC,CAAC,OAAI,QAAQ,CAAC,CAAC;YAAA;YAAA,UACxC,MAAM,IAAK;cACX,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS;cACnC,yBACG,QAAQ;gBAAA,IACP,YAAY;kBAAA,OAAE,KAAK,CAAC,YAAY;gBAAA;gBAAA,IAChC,eAAe;kBAAA,OAAE,KAAK,CAAC,eAAe;gBAAA;gBAAA,IACtC,YAAY;kBAAA,OAAE,KAAK,CAAC,YAAY;gBAAA;gBAAA,IAChC,qBAAqB;kBAAA,OAAE,KAAK,CAAC,qBAAqB;gBAAA;gBAAA,IAClD,IAAI;kBAAA,OAAE,KAAK,CAAC,IAAI;gBAAA;gBAAA,IAChB,OAAO;kBAAA,OAAE,eAAe,CAAC,CAAC;gBAAA;gBAAA,IAC1B,WAAW;kBAAA,OAAE,iBAAiB,CAAC,CAAC;gBAAA;gBAAA,IAChC,WAAW;kBAAA,OAAE,KAAK,CAAC,WAAW;gBAAA;gBAAA,IAC9B,cAAc;kBAAA,OAAE,KAAK,CAAC,cAAc;gBAAA;gBAAA,IACpC,YAAY;kBAAA,OAAE,KAAK,CAAC,YAAY,IAAI,IAAI;gBAAA;gBAAA,IACxC,MAAM;kBAAA,OAAE,MAAM,CAAC,CAAC;gBAAA;cAAA;YAGtB;UAAC;QAAA;MAAA;IAAA;EAAA;AAMb","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["content/FileView.tsx"],"sourcesContent":["import { useMarkdownEditorMessages } from \"../inputs/markdown/editor-messages\";\nimport { useDataTableMessages } from \"./data-table-messages\";\nimport { useFileViewMessages } from \"./file-view-messages\";\n/**\n * FileView — renders one file through a small renderer registry keyed by\n * media type / path. Editing is enabled purely by the presence of `save`;\n * without it every renderer is read-only. IDE-style chrome: editors reuse\n * the markdown editor's surface (toolbar with an in-toolbar save, Ctrl/Cmd+S),\n * previews are quiet paper panels with icon-only actions overlaid top-right.\n * A plain preview drops the panel and sits on its host's surface instead.\n * Custom renderers are passed per instance, which keeps SSR requests and\n * independently mounted applications isolated.\n */\n\nimport { mutation } from \"@k2b/stdlib/solid\";\nimport {\n type Component,\n createContext,\n createEffect,\n createMemo,\n createResource,\n createSignal,\n For,\n type JSX,\n Match,\n onCleanup,\n onMount,\n Show,\n Switch,\n untrack,\n useContext,\n} from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { prompts } from \"../feedback/prompts\";\nimport { Tooltip } from \"../feedback/Tooltip\";\nimport { toast } from \"../feedback/toast\";\nimport { MarkdownEditor } from \"../inputs/markdown/MarkdownEditor\";\nimport { Select } from \"../inputs/Select\";\nimport { useUiMessages } from \"../intl/messages\";\nimport Placeholder from \"../surfaces/Placeholder\";\nimport CodeDisplay, { type CodeDisplayLanguage } from \"./CodeDisplay\";\nimport { type DelimitedPreferences, decodeDelimitedContent, readDelimitedPreferences } from \"./delimited-preferences\";\nimport { type FileViewFile, fileViewExtension, getFileViewPreviewKind, parseDelimitedText } from \"./file-view-preview\";\nimport MarkdownView from \"./MarkdownView\";\nimport { leadingMarkdownTitle } from \"./markdown-title\";\nimport PdfViewer from \"./PdfViewer\";\nimport StructuredDataPreview, { type StructuredDataValue } from \"./StructuredDataPreview\";\nimport VideoPlayer from \"./VideoPlayer\";\n\nexport type { FileViewFile, FileViewPreviewKind } from \"./file-view-preview\";\nexport { canPreviewFile, getFileViewPreviewKind } from \"./file-view-preview\";\nexport type FileViewContent = { encoding: \"utf8\" | \"base64\"; content: string; mediaType: string };\n\nexport type FileViewProps = {\n /**\n * Plain previews inherit the surrounding surface without a frame or inset padding. They keep their natural height,\n * so the host scrolls them and owns the actions around them; a host that stretches one gets its scrolling back.\n */\n variant?: \"default\" | \"plain\";\n /**\n * Lifts a leading Markdown level-one heading into the host, for example a dialog title. Reports its plain text and\n * leaves that heading out of the preview, or reports null when the shown file has none, the heading holds a link or\n * image or is the whole document, or the file fails to load.\n */\n onDocumentTitle?: (title: string | null) => void;\n /** Read-only excerpt limit; omitted renders the complete preview. */\n previewLines?: number;\n onExpandPreview?: () => void;\n headingScale?: \"compact\" | \"normal\" | \"large\";\n /** Optional browser-local preference scope, owned by the host. */\n previewPreferencesKey?: string;\n file: FileViewFile;\n load: () => Promise<FileViewContent>;\n /** Refetch the current path when this host-owned revision changes. */\n revision?: unknown;\n /** Register an awaitable refresh for the currently visible preview. */\n registerRefresh?: (refresh: () => Promise<void>) => void | (() => void);\n /** Presence enables editing for text-based renderers. */\n save?: (content: string) => Promise<void>;\n /** Authenticated inline URL used by browser-native image, PDF, audio, and video previews. */\n previewHref?: string | null;\n /** CORS mode for native image/audio/video previews. Omit to preserve browser defaults. */\n crossOrigin?: \"anonymous\" | \"use-credentials\";\n /** Native media failed to load; the host can renew a signed URL and offer retry. */\n onPreviewError?: () => void;\n /** Download actions only; never a preview source, because an attachment response does not render inline. */\n downloadHref?: string | null;\n /** App-specific renderers matched before the built-ins for this instance. */\n renderers?: readonly FileViewRenderer[];\n /** Reports local edit state so a parent browser can guard navigation. */\n onDirtyChange?: (dirty: boolean) => void;\n class?: string;\n};\n\nexport type FileViewRendererProps = {\n /** Read-only excerpt limit; omitted renders the complete preview. */\n previewLines?: number;\n onExpandPreview?: () => void;\n headingScale?: \"compact\" | \"normal\" | \"large\";\n /** Optional browser-local preference scope, owned by the host. */\n previewPreferencesKey?: string;\n file: FileViewFile;\n content: FileViewContent;\n previewHref: string | null;\n crossOrigin?: \"anonymous\" | \"use-credentials\";\n onPreviewError?: () => void;\n downloadHref: string | null;\n /** Null when the file is read-only. */\n editor: {\n draft: () => string;\n setDraft: (value: string) => void;\n dirty: () => boolean;\n saving: () => boolean;\n save: () => Promise<void>;\n } | null;\n};\n\nexport type FileViewRenderer = {\n id: string;\n match: (file: FileViewFile, content: FileViewContent) => boolean;\n component: Component<FileViewRendererProps>;\n /** Text renderers that support the edit affordance when `save` is present. */\n editable?: boolean;\n};\n\n/** Instance options that reach the built-in renderers without widening the public renderer props. */\nconst FileViewHost = createContext({ plain: false, liftTitle: false });\n\nconst codeLanguage = (path: string): CodeDisplayLanguage => {\n const extension = fileViewExtension(path);\n if (extension === \"ts\" || extension === \"mts\" || extension === \"cts\") return \"ts\";\n if (extension === \"tsx\") return \"tsx\";\n if (extension === \"js\" || extension === \"mjs\" || extension === \"cjs\") return \"js\";\n if (extension === \"jsx\") return \"jsx\";\n if (extension === \"md\" || extension === \"markdown\") return \"md\";\n return \"text\";\n};\n\nconst isMarkdown = (file: FileViewFile, content: FileViewContent) =>\n content.encoding === \"utf8\" && getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"markdown\";\n\n/** Rendered previews hide a leading YAML frontmatter block — it's metadata, not content. */\nconst stripFrontmatter = (text: string): string => {\n const match = /^---\\r?\\n[\\s\\S]*?\\r?\\n---\\r?\\n?/.exec(text.trimStart());\n return match ? text.trimStart().slice(match[0].length) : text;\n};\n\n/** Icon-only download link with the shared tooltip, for toolbars that style their own controls. */\nfunction DownloadLink(props: { class: string; href: string; download: string; label: string; icon: string }) {\n let link: HTMLAnchorElement | undefined;\n return (\n <>\n <a ref={link} class={props.class} href={props.href} download={props.download} aria-label={props.label}>\n <i class={props.icon} aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{props.label}</span>\n </a>\n <Tooltip content={props.label} target={() => link} />\n </>\n );\n}\n\n/** Icon-only action, IDE style — sits in the floating top-right cluster of previews. */\nfunction OverlayAction(props: { icon: string; title: string; onClick?: () => void; href?: string; download?: string }) {\n const classes = \"k2b-content-file-view__action\";\n return (\n <Show\n when={props.href}\n fallback={\n <Tooltip.Trigger type=\"button\" class={classes} content={props.title} aria-label={props.title} onClick={props.onClick}>\n <i class={`ti ${props.icon}`} aria-hidden=\"true\" />\n </Tooltip.Trigger>\n }\n >\n {(href) => (\n <DownloadLink class={classes} href={href()} download={props.download ?? \"\"} label={props.title} icon={`ti ${props.icon}`} />\n )}\n </Show>\n );\n}\n\n/**\n * Scrollable preview panel with the floating action cluster overlaid top-right. Over a picture or a video the\n * cluster is glass; over text, tables, and documents it stays solid, because blurred text reads as a fault.\n */\nfunction OverlayPanel(props: { actions?: JSX.Element; overMedia?: boolean; children: JSX.Element }) {\n return (\n <div class=\"k2b-content-file-view__panel\">\n <div class=\"k2b-content-file-view__preview\">{props.children}</div>\n <Show when={props.actions}>\n <div class={`k2b-content-file-view__overlay${props.overMedia ? \" k2b-overlay-surface\" : \"\"}`}>{props.actions}</div>\n </Show>\n </div>\n );\n}\n\nconst DownloadAction = (props: FileViewRendererProps): JSX.Element => {\n const messages = useUiMessages();\n return (\n <Show when={props.downloadHref}>\n {(href) => (\n <OverlayAction\n icon=\"ti-download\"\n title={messages().download}\n href={href()}\n download={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n />\n )}\n </Show>\n );\n};\n\n/** Toolbar-styled icon button — reuses the package markdown-editor tool primitive. */\nfunction EditorToolButton(props: { icon: string; title: string; onClick: () => void; disabled?: boolean }) {\n return (\n <Tooltip.Trigger\n type=\"button\"\n class=\"k2b-markdown-editor__tool\"\n content={props.title}\n aria-label={props.title}\n tabIndex={-1}\n disabled={props.disabled}\n onMouseDown={(e) => e.preventDefault()}\n onClick={props.onClick}\n >\n <i class={props.icon} aria-hidden=\"true\" />\n </Tooltip.Trigger>\n );\n}\n\n// ── Built-in renderers ──────────────────────────────────────────────────────\n\nfunction MoreLines(props: { count: number; onClick?: () => void }) {\n const fileViewMessages = useFileViewMessages();\n return (\n <Show when={props.count > 0}>\n <div class=\"k2b-content-file-view__truncated\">\n <Show when={props.onClick} fallback={<span>{fileViewMessages().previewMoreLines(props.count)}</span>}>\n <Button size=\"sm\" variant=\"ghost\" onClick={props.onClick}>\n {fileViewMessages().previewMoreLines(props.count)}\n </Button>\n </Show>\n </div>\n </Show>\n );\n}\nfunction TextExcerpt(props: { renderer: FileViewRendererProps; text: string; markdown?: boolean }) {\n const lines = createMemo(() => props.text.replace(/\\r\\n?/g, \"\\n\").replace(/\\n$/, \"\").split(\"\\n\"));\n const limit = () => (props.renderer.previewLines === undefined ? lines().length : Math.max(1, props.renderer.previewLines));\n const text = () => lines().slice(0, limit()).join(\"\\n\");\n const host = useContext(FileViewHost);\n // A plain preview has no code box: the host frames the file and owns its copy action.\n const content = () => (\n <Show\n when={props.markdown}\n fallback={<CodeDisplay code={text()} language={codeLanguage(props.renderer.file.path)} copy={host.plain ? false : undefined} />}\n >\n <MarkdownView markdown={text()} headingScale={props.renderer.headingScale ?? \"compact\"} />\n </Show>\n );\n // Only an excerpt needs a clipping box; a complete preview keeps its content\n // a direct child of the preview frame, which the frame's styles expect.\n return (\n <>\n <Show when={props.renderer.previewLines !== undefined} fallback={content()}>\n <div class=\"k2b-content-file-view__excerpt\">{content()}</div>\n </Show>\n <MoreLines count={lines().length - limit()} onClick={props.renderer.onExpandPreview} />\n </>\n );\n}\n\nfunction MarkdownRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const host = useContext(FileViewHost);\n const [editing, setEditing] = createSignal(false);\n const markdown = () => {\n const text = stripFrontmatter(props.editor?.draft() ?? props.content.content);\n return host.liftTitle ? (leadingMarkdownTitle(text)?.body ?? text) : text;\n };\n return (\n <Show\n when={props.editor && editing()}\n fallback={\n <OverlayPanel\n actions={\n <>\n <Show when={props.editor}>\n <OverlayAction icon=\"ti-pencil\" title={messages().edit} onClick={() => setEditing(true)} />\n </Show>\n <DownloadAction {...props} />\n </>\n }\n >\n <div class=\"k2b-content-file-view__document\">\n <TextExcerpt renderer={props} text={markdown()} markdown />\n </div>\n </OverlayPanel>\n }\n >\n {(_) => {\n const editor = props.editor!;\n return (\n <div class=\"k2b-content-file-view__editor\">\n <MarkdownEditor\n class=\"k2b-content-file-view__markdown-field\"\n aria-label={`Edit ${props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}`}\n fill\n value={editor.draft()}\n onValueChange={editor.setDraft}\n showStats={false}\n onSave={() => void editor.save()}\n saveDisabled={!editor.dirty()}\n saving={editor.saving()}\n toolbarTrailing={<EditorToolButton icon=\"ti ti-eye\" title={messages().preview} onClick={() => setEditing(false)} />}\n />\n </div>\n );\n }}\n </Show>\n );\n}\n\nfunction TextRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const markdownEditorMessages = useMarkdownEditorMessages();\n return (\n <Show\n when={props.editor}\n fallback={\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <TextExcerpt renderer={props} text={props.content.content} />\n </OverlayPanel>\n }\n >\n {(editor) => (\n // Same chrome as the markdown editor — literally the same classes, so\n // border, radius, focus ring, toolbar height and text metrics cannot drift.\n <div class=\"k2b-content-file-view__editor\">\n <div\n class=\"k2b-markdown-editor\"\n data-fill=\"true\"\n role=\"group\"\n aria-label={fileViewMessages().textEditor}\n onKeyDown={(event) => {\n if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === \"s\") {\n event.preventDefault();\n if (editor().dirty() && !editor().saving()) void editor().save();\n }\n }}\n >\n {/* No formatting tools here — the divider under an actions-only bar reads lost. */}\n <div class=\"k2b-markdown-editor__toolbar k2b-content-file-view__code-toolbar\">\n <span class=\"k2b-content-file-view__code-language\">{codeLanguage(props.file.path)}</span>\n <span class=\"k2b-markdown-editor__trailing\">\n <Show when={props.downloadHref}>\n {(href) => (\n <DownloadLink\n class=\"k2b-markdown-editor__tool\"\n href={href()}\n download={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n label={messages().download}\n icon=\"ti ti-download\"\n />\n )}\n </Show>\n <EditorToolButton\n icon={editor().saving() ? \"ti ti-loader-2 k2b-spin\" : \"ti ti-device-floppy\"}\n title={markdownEditorMessages().saveShortcut}\n disabled={!editor().dirty() || editor().saving()}\n onClick={() => void editor().save()}\n />\n </span>\n </div>\n <div class=\"k2b-markdown-editor__surface\">\n <textarea\n class=\"k2b-content-file-view__code-input\"\n value={editor().draft()}\n spellcheck={false}\n onInput={(event) => editor().setDraft(event.currentTarget.value)}\n />\n </div>\n </div>\n </div>\n )}\n </Show>\n );\n}\n\nfunction JsonRenderer(props: FileViewRendererProps) {\n const parsed = createMemo(() => {\n try {\n return { ok: true as const, value: JSON.parse(props.content.content) as StructuredDataValue };\n } catch {\n return { ok: false as const };\n }\n });\n const parsedValue = (): StructuredDataValue => {\n const result = parsed();\n return result.ok ? result.value : null;\n };\n\n return (\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__document\">\n <Show when={parsed().ok} fallback={<TextExcerpt renderer={props} text={props.content.content} />}>\n <Show\n when={props.previewLines === undefined}\n fallback={<TextExcerpt renderer={props} text={JSON.stringify(parsedValue(), null, 2)} />}\n >\n <StructuredDataPreview data={parsedValue()} maxRows={200} />\n </Show>\n </Show>\n </div>\n </OverlayPanel>\n );\n}\n\nfunction DelimitedTextRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const dataTableMessages = useDataTableMessages();\n const [preferences, setPreferences] = createSignal<DelimitedPreferences>({ encoding: \"utf-8\", delimiter: \"auto\", view: \"table\" });\n onMount(() => {\n if (!props.previewPreferencesKey) return;\n try {\n setPreferences(readDelimitedPreferences(localStorage.getItem(props.previewPreferencesKey)));\n } catch {\n /* Storage may be disabled. */\n }\n });\n const update = (patch: Partial<DelimitedPreferences>) => {\n const next = { ...preferences(), ...patch };\n setPreferences(next);\n if (props.previewPreferencesKey) {\n try {\n localStorage.setItem(props.previewPreferencesKey, JSON.stringify(next));\n } catch {\n /* Keep the local selection. */\n }\n }\n };\n const text = createMemo(() => decodeDelimitedContent(props.content, preferences().encoding));\n const delimiter = () =>\n preferences().delimiter === \"auto\"\n ? fileViewExtension(props.file.path) === \"tsv\" || props.content.mediaType === \"text/tab-separated-values\"\n ? \"\\t\"\n : \",\"\n : preferences().delimiter;\n const [page, setPage] = createSignal(0);\n createEffect(() => {\n text();\n delimiter();\n props.previewLines;\n setPage(0);\n });\n const pageSize = () => (props.previewLines === undefined ? 200 : Math.max(1, props.previewLines));\n const preview = createMemo(() => parseDelimitedText(text(), delimiter(), { rows: pageSize() + 1, offset: page() * pageSize() }));\n const settings = () =>\n prompts.dialog(\n () => (\n <div class=\"k2b-content-file-view__settings\">\n <Select\n label={fileViewMessages().csvEncoding}\n value={preferences().encoding}\n disabled={props.content.encoding !== \"base64\"}\n options={[\"utf-8\", \"windows-1252\", \"utf-16le\", \"utf-16be\"]}\n onValueChange={(value) => {\n if (value) update({ encoding: value });\n }}\n />\n <Select\n label={fileViewMessages().csvSeparator}\n value={preferences().delimiter}\n options={[\n { value: \"auto\", label: fileViewMessages().csvDefaultSeparator },\n { value: \",\", label: fileViewMessages().csvComma },\n { value: \";\", label: fileViewMessages().csvSemicolon },\n { value: \"\\t\", label: fileViewMessages().csvTab },\n { value: \"|\", label: \"|\" },\n ]}\n onValueChange={(value) => {\n if (value) update({ delimiter: value });\n }}\n />\n <Select\n label={fileViewMessages().csvView}\n value={preferences().view}\n options={[\n { value: \"table\", label: dataTableMessages().dataTable },\n { value: \"raw\", label: fileViewMessages().csvRaw },\n ]}\n onValueChange={(value) => {\n if (value === \"table\" || value === \"raw\") update({ view: value });\n }}\n />\n </div>\n ),\n { title: fileViewMessages().csvSettings },\n );\n const headers = createMemo(() => preview().rows[0] ?? []);\n const rows = createMemo(() => preview().rows.slice(1));\n\n return (\n <OverlayPanel\n actions={\n <>\n <OverlayAction icon=\"ti-adjustments-horizontal\" title={fileViewMessages().csvSettings} onClick={() => void settings()} />\n <DownloadAction {...props} />\n </>\n }\n >\n <Show when={preferences().view === \"table\"} fallback={<TextExcerpt renderer={props} text={text()} />}>\n <Show\n when={headers().length > 0}\n fallback={\n <Placeholder icon=\"ti ti-table\" title={fileViewMessages().emptyFile} description={fileViewMessages().delimitedFileEmpty} />\n }\n >\n <div class=\"k2b-content-file-view__sheet\">\n <table class=\"k2b-content-file-view__table\">\n <thead>\n <tr>\n <For each={headers()}>\n {(header, index) => (\n <th scope=\"col\">\n <span>{header || fileViewMessages().column({ number: index() + 1 })}</span>\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <For each={rows()}>\n {(row) => (\n <tr>\n <For each={headers()}>{(_, index) => <td>{row[index()] ?? \"\"}</td>}</For>\n </tr>\n )}\n </For>\n </tbody>\n </table>\n <Show when={preview().columnsTruncated}>\n <div class=\"k2b-content-file-view__truncated\">{fileViewMessages().previewColumnsLimited}</div>\n </Show>\n <Show\n when={props.previewLines !== undefined}\n fallback={\n <Show when={preview().totalRows > 201}>\n <div class=\"k2b-content-file-view__pagination\">\n <Button size=\"sm\" variant=\"ghost\" disabled={page() === 0} onClick={() => setPage(page() - 1)}>\n {messages().previous}\n </Button>\n <span>\n {page() * pageSize() + 1}–{Math.min((page() + 1) * pageSize(), preview().totalRows - 1)} / {preview().totalRows - 1}\n </span>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n disabled={(page() + 1) * pageSize() >= preview().totalRows - 1}\n onClick={() => setPage(page() + 1)}\n >\n {messages().next}\n </Button>\n </div>\n </Show>\n }\n >\n <MoreLines count={preview().totalRows - rows().length - 1} onClick={props.onExpandPreview} />\n </Show>\n </div>\n </Show>\n </Show>\n </OverlayPanel>\n );\n}\n\nconst mediaSource = (props: FileViewRendererProps): string =>\n props.previewHref ?? `data:${props.content.mediaType};base64,${props.content.content}`;\n\nfunction ImageRenderer(props: FileViewRendererProps) {\n return (\n <OverlayPanel overMedia actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\">\n <img crossOrigin={props.crossOrigin} onError={props.onPreviewError} src={mediaSource(props)} alt={props.file.path} />\n </div>\n </OverlayPanel>\n );\n}\n\nconst pdfBlob = (content: FileViewContent): Blob => {\n if (content.encoding === \"utf8\") return new Blob([content.content], { type: \"application/pdf\" });\n const binary = atob(content.content);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);\n return new Blob([bytes], { type: \"application/pdf\" });\n};\n\n/**\n * Both ways end in `PdfViewer`, which draws with pdf.js. A host inline URL is fetched from there and stays the address\n * the pill's open action shows. Without one, the loaded bytes become a local PDF\n * Blob: a download URL is an attachment and would leave a viewer empty.\n */\nconst sameOrigin = (href: string): boolean => {\n if (typeof location === \"undefined\") return true;\n try {\n return new URL(href, location.href).origin === location.origin;\n } catch {\n return false;\n }\n};\n\nfunction PdfRenderer(props: FileViewRendererProps) {\n const fileViewMessages = useFileViewMessages();\n // A new Blob remounts the preview, so changed bytes show the new file. A revision refetch\n // often returns the same bytes (the Assistant refetches on every tool step); keeping the\n // Blob then keeps the reader's page instead of reloading the viewer.\n const bytes = createMemo(() => props.content, undefined, {\n equals: (previous, next) => previous.encoding === next.encoding && previous.content === next.content,\n });\n const blob = createMemo(() => (props.previewHref || !bytes().content ? null : pdfBlob(bytes())));\n return (\n <Show\n when={props.previewHref}\n fallback={\n <Show\n keyed\n when={blob()}\n fallback={<Placeholder icon=\"ti ti-file-type-pdf\" title=\"PDF\" description={fileViewMessages().noInlinePreview} />}\n >\n {(pdf) => (\n // The host already names the file; the viewer keeps the file name as its accessible title.\n <PdfViewer\n class=\"k2b-content-file-view__pdf-viewer\"\n open\n title={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n data={pdf}\n />\n )}\n </Show>\n }\n >\n {(href) => (\n // Keyed by the address: a new revision of the file loads the new document.\n <Show keyed when={href()}>\n {(current) => (\n // A page may fetch only its own origin's PDFs without CORS; another origin's address stays with the\n // browser's viewer, which embeds it as before. The viewer fetches a same-origin address itself and stops\n // when the preview closes or a new revision arrives.\n <Show\n when={sameOrigin(current)}\n fallback={<object data={current} type=\"application/pdf\" class=\"k2b-content-file-view__pdf\" aria-label={props.file.path} />}\n >\n <PdfViewer\n class=\"k2b-content-file-view__pdf-viewer\"\n title={props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1)}\n open={current}\n data={current}\n />\n </Show>\n )}\n </Show>\n )}\n </Show>\n );\n}\n\nfunction AudioRenderer(props: FileViewRendererProps) {\n const fileViewMessages = useFileViewMessages();\n return (\n <OverlayPanel actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\" data-kind=\"audio\">\n <audio\n crossOrigin={props.crossOrigin}\n onError={props.onPreviewError}\n controls\n preload=\"metadata\"\n src={mediaSource(props)}\n aria-label={props.file.path}\n >\n {fileViewMessages().audioUnsupported}\n </audio>\n </div>\n </OverlayPanel>\n );\n}\n\nfunction VideoRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const name = () => props.file.path.slice(props.file.path.lastIndexOf(\"/\") + 1);\n return (\n <OverlayPanel overMedia actions={<DownloadAction {...props} />}>\n <div class=\"k2b-content-file-view__media\" data-kind=\"video\">\n <VideoPlayer\n src={mediaSource(props)}\n label={name()}\n crossOrigin={props.crossOrigin}\n onFallback={props.onPreviewError}\n fallbackAction={\n <Show when={props.downloadHref}>\n {(href) => (\n <a class=\"k2b-button\" data-variant=\"secondary\" data-size=\"sm\" href={href()} download={name()}>\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n {messages().download}\n </a>\n )}\n </Show>\n }\n />\n </div>\n </OverlayPanel>\n );\n}\n\nfunction BinaryRenderer(props: FileViewRendererProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n return (\n <Placeholder\n icon=\"ti ti-file-unknown\"\n title={fileViewMessages().noPreview}\n description={props.content.mediaType || fileViewMessages().binaryFile}\n action={\n <Show when={props.downloadHref}>\n {(href) => (\n <a class=\"k2b-button\" data-variant=\"secondary\" data-size=\"sm\" href={href()} download=\"\">\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n {messages().download}\n </a>\n )}\n </Show>\n }\n />\n );\n}\n\nconst BUILTIN_RENDERERS: FileViewRenderer[] = [\n { id: \"markdown\", match: isMarkdown, component: MarkdownRenderer, editable: true },\n {\n id: \"image\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"image\",\n component: ImageRenderer,\n },\n {\n id: \"pdf\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"pdf\",\n component: PdfRenderer,\n },\n {\n id: \"json\",\n match: (file, content) =>\n content.encoding === \"utf8\" && getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"json\",\n component: JsonRenderer,\n },\n {\n id: \"delimited-text\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"delimited-text\",\n component: DelimitedTextRenderer,\n },\n {\n id: \"audio\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"audio\",\n component: AudioRenderer,\n },\n {\n id: \"video\",\n match: (file, content) => getFileViewPreviewKind({ ...file, mediaType: content.mediaType || file.mediaType }) === \"video\",\n component: VideoRenderer,\n },\n { id: \"text\", match: (_file, content) => content.encoding === \"utf8\", component: TextRenderer, editable: true },\n { id: \"binary\", match: () => true, component: BinaryRenderer },\n];\n\n// ── Component ───────────────────────────────────────────────────────────────\n\n/**\n * A file size such as \"4.2 MB\". With `locale`, the number follows that language (\"4,2 MB\") and drops a trailing\n * zero (\"64 KB\"); without it, the output stays as before.\n */\nexport const formatFileViewSize = (bytes: number, locale?: string): string => {\n const [value, unit] = bytes < 1024 ? [bytes, \"B\"] : bytes < 1024 * 1024 ? [bytes / 1024, \"KB\"] : [bytes / (1024 * 1024), \"MB\"];\n if (unit === \"B\") return `${bytes} B`;\n if (!locale) return `${value.toFixed(1)} ${unit}`;\n return `${new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(value)} ${unit}`;\n};\n\nexport default function FileView(props: FileViewProps) {\n const messages = useUiMessages();\n const fileViewMessages = useFileViewMessages();\n const [draft, setDraft] = createSignal(\"\");\n const [savedDraft, setSavedDraft] = createSignal(\"\");\n const [nativeRevision, setNativeRevision] = createSignal(0);\n const dirty = createMemo(() => draft() !== savedDraft());\n const instanceRenderers = () => props.renderers ?? [];\n const saveMutation = mutation.create<{ path: string; content: string }, { path: string; content: string }>({\n mutation: async (input) => {\n await props.save!(input.content);\n return input;\n },\n onSuccess: (saved) => {\n if (props.file.path === saved.path) setSavedDraft(saved.content);\n toast.success(fileViewMessages().fileSaved);\n },\n onError: (error) => toast.error(error.message),\n });\n const nativePreviewHref = createMemo(() => {\n const href = props.previewHref;\n if (!href) return null;\n const separator = href.includes(\"?\") ? \"&\" : \"?\";\n return `${href}${separator}preview-revision=${nativeRevision()}`;\n });\n const browserPreviewContent = createMemo<FileViewContent | null>(() => {\n const kind = getFileViewPreviewKind(props.file);\n if (kind !== \"image\" && kind !== \"pdf\" && kind !== \"audio\" && kind !== \"video\") return null;\n const href = nativePreviewHref();\n if (!href) return null;\n\n const candidate: FileViewContent = {\n encoding: \"base64\",\n content: \"\",\n mediaType: props.file.mediaType ?? \"application/octet-stream\",\n };\n return instanceRenderers().some((renderer) => renderer.match(props.file, candidate)) ? null : candidate;\n });\n const [content, { refetch }] = createResource(\n () => (browserPreviewContent() ? null : { path: props.file.path, revision: props.revision }),\n async () => {\n saveMutation.abort();\n // `load` is an imperative source adapter. Host signal reads inside it\n // must not turn this resource into a hidden reactive feedback loop.\n const loaded = await untrack(() => props.load());\n const loadedDraft = loaded.encoding === \"utf8\" ? loaded.content : \"\";\n setDraft(loadedDraft);\n setSavedDraft(loadedDraft);\n return loaded;\n },\n );\n createEffect(() => {\n if (!props.registerRefresh) return;\n const unregister = props.registerRefresh(async () => {\n if (browserPreviewContent()) setNativeRevision((value) => value + 1);\n else await refetch();\n });\n if (unregister) onCleanup(unregister);\n });\n // An errored resource throws when read; the error state below shows it instead.\n const resolvedContent = createMemo(() => browserPreviewContent() ?? (content.error ? undefined : content()));\n\n const renderer = createMemo(() => {\n const loaded = resolvedContent();\n if (!loaded) return null;\n return [...instanceRenderers(), ...BUILTIN_RENDERERS].find((candidate) => candidate.match(props.file, loaded)) ?? null;\n });\n\n createEffect(() => {\n props.onDirtyChange?.(dirty());\n });\n\n const save = async () => {\n if (!props.save || saveMutation.loading()) return;\n await saveMutation.mutate({ path: props.file.path, content: draft() });\n };\n\n const editor = () =>\n props.save && renderer()?.editable && resolvedContent()?.encoding === \"utf8\"\n ? {\n draft,\n setDraft,\n dirty,\n saving: saveMutation.loading,\n save,\n }\n : null;\n\n // Undefined while loading; the host keeps its own placeholder until the shown file decides.\n const documentTitle = createMemo<string | null | undefined>(() => {\n if (!props.onDocumentTitle) return undefined;\n if (content.error) return null;\n const loaded = resolvedContent();\n if (!loaded) return undefined;\n if (renderer()?.component !== MarkdownRenderer) return null;\n return leadingMarkdownTitle(stripFrontmatter(editor()?.draft() ?? loaded.content))?.title ?? null;\n });\n createEffect(() => {\n const title = documentTitle();\n if (title !== undefined) props.onDocumentTitle?.(title);\n });\n\n return (\n <div\n class={`k2b-content-file-view ${props.class ?? \"\"}`}\n data-variant={props.variant}\n data-excerpt={props.previewLines !== undefined ? \"true\" : undefined}\n >\n <FileViewHost.Provider\n value={{\n get plain() {\n return props.variant === \"plain\";\n },\n get liftTitle() {\n return Boolean(props.onDocumentTitle);\n },\n }}\n >\n <Switch>\n <Match when={content.loading && content() === undefined}>\n <Placeholder state=\"loading\" title={messages().loading} />\n </Match>\n <Match when={content.error}>\n <Placeholder state=\"error\" title={fileViewMessages().failedLoadFile} description={String(content.error?.message ?? \"\")} />\n </Match>\n <Match when={resolvedContent() && renderer()}>\n {(active) => {\n const Renderer = active().component;\n return (\n <Renderer\n previewLines={props.previewLines}\n onExpandPreview={props.onExpandPreview}\n headingScale={props.headingScale}\n previewPreferencesKey={props.previewPreferencesKey}\n file={props.file}\n content={resolvedContent()!}\n previewHref={nativePreviewHref()}\n crossOrigin={props.crossOrigin}\n onPreviewError={props.onPreviewError}\n downloadHref={props.downloadHref ?? null}\n editor={editor()}\n />\n );\n }}\n </Match>\n </Switch>\n </FileViewHost.Provider>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,yBAAyB,QAAQ,oCAAoC;AAC9E,SAAS,oBAAoB,QAAQ,uBAAuB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AAK,CAAC,YAAY,IAAI,IAAI;gBAAA;gBAAA,IACxC,MAAM;kBAAA,OAAE,MAAM,CAAC,CAAC;gBAAA;cAAA;YAGtB;UAAC;QAAA;MAAA;IAAA;EAAA;AAMb","ignoreList":[]}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { ssr as _$ssr } from "solid-js/web";
|
|
2
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
3
|
+
import { memo as _$memo } from "solid-js/web";
|
|
4
|
+
import { ssrStyleProperty as _$ssrStyleProperty } from "solid-js/web";
|
|
5
|
+
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
6
|
+
import { escape as _$escape } from "solid-js/web";
|
|
7
|
+
var _tmpl$ = ["<i", " aria-hidden=\"true\"></i>"],
|
|
8
|
+
_tmpl$2 = ["<div", "><span class=\"k2b-load-more__reach\" style=\"", "\" aria-hidden=\"true\"></span>", "</div>"],
|
|
9
|
+
_tmpl$3 = ["<span class=\"k2b-load-more__error\" role=\"alert\"><i class=\"ti ti-alert-circle\" aria-hidden=\"true\"></i>", "</span>"];
|
|
10
|
+
import { createEffect, createSignal, on, onCleanup, onMount, Show } from "solid-js";
|
|
11
|
+
import { Button } from "../actions/Button";
|
|
12
|
+
import { useUiMessages } from "../intl/messages";
|
|
13
|
+
import { useFeedMessages } from "./feed-messages";
|
|
14
|
+
|
|
15
|
+
/** Distance in px before the edge comes into view at which the next page is requested. */
|
|
16
|
+
const REACH = 240;
|
|
17
|
+
const isPromise = value => typeof value === "object" && value !== null && typeof value.then === "function";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The edge of a list that loads more: one row of fixed height that reads "Load more", "Loading more…", or the error
|
|
21
|
+
* with "Try again", so the list around it never moves. It loads by itself when it comes within reach, once per
|
|
22
|
+
* approach: a page that arrives while the edge is still in reach asks for the next one, a declined or failed request
|
|
23
|
+
* waits for the reader.
|
|
24
|
+
*/
|
|
25
|
+
export function LoadMore(props) {
|
|
26
|
+
const messages = useFeedMessages();
|
|
27
|
+
const uiMessages = useUiMessages();
|
|
28
|
+
const [pending, setPending] = createSignal(false);
|
|
29
|
+
const [failure, setFailure] = createSignal(null);
|
|
30
|
+
let root;
|
|
31
|
+
let reach;
|
|
32
|
+
let observer;
|
|
33
|
+
/** A request the owner has not answered yet. It holds until the owner answers or the edge leaves reach. */
|
|
34
|
+
let requested = false;
|
|
35
|
+
/** The list's progress when the last request went out. */
|
|
36
|
+
let progressAtRequest = -1;
|
|
37
|
+
let disposed = false;
|
|
38
|
+
const loading = () => Boolean(props.loading) || pending();
|
|
39
|
+
const error = () => failure() ?? props.error ?? null;
|
|
40
|
+
const reasonOf = cause => cause instanceof Error && cause.message ? cause.message : null;
|
|
41
|
+
/** The item count, or else where the edge sits plus how tall its parent's content is: both grow with the list. */
|
|
42
|
+
const progress = () => props.count ?? (root ? root.offsetTop + (root.parentElement?.scrollHeight ?? 0) : 0);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Asks the observer again, so an edge that is still in reach loads once more. Only after the list grew: a page that
|
|
46
|
+
* brought nothing waits for the reader, so an owner that keeps answering empty pages is not asked in a loop.
|
|
47
|
+
*/
|
|
48
|
+
const recheck = () => {
|
|
49
|
+
if (!observer || !reach || progress() === progressAtRequest) return;
|
|
50
|
+
requested = false;
|
|
51
|
+
// The observer watches only this strip; observing it anew delivers its current state. Only `observe` and
|
|
52
|
+
// `disconnect` are used, the part of the observer that every engine and every test double offers.
|
|
53
|
+
observer.disconnect();
|
|
54
|
+
observer.observe(reach);
|
|
55
|
+
};
|
|
56
|
+
const load = byReader => {
|
|
57
|
+
if (disposed || !props.hasMore || loading()) return;
|
|
58
|
+
if (!byReader && (requested || error())) return;
|
|
59
|
+
requested = true;
|
|
60
|
+
progressAtRequest = progress();
|
|
61
|
+
setFailure(null);
|
|
62
|
+
let result;
|
|
63
|
+
try {
|
|
64
|
+
result = props.onLoadMore();
|
|
65
|
+
} catch (cause) {
|
|
66
|
+
requested = false;
|
|
67
|
+
setFailure(reasonOf(cause) ?? props.errorLabel ?? messages().loadMoreFailed);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
// Without a promise the owner answers through `loading`, `hasMore`, or the reader leaving the edge.
|
|
71
|
+
if (!isPromise(result)) return;
|
|
72
|
+
setPending(true);
|
|
73
|
+
result.then(value => {
|
|
74
|
+
if (disposed) return;
|
|
75
|
+
setPending(false);
|
|
76
|
+
if (value !== false) recheck();
|
|
77
|
+
}, cause => {
|
|
78
|
+
if (disposed) return;
|
|
79
|
+
setPending(false);
|
|
80
|
+
requested = false;
|
|
81
|
+
setFailure(reasonOf(cause) ?? props.errorLabel ?? messages().loadMoreFailed);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// The owner finished a load it reports through `loading`, or found more again: the edge may ask once more.
|
|
86
|
+
createEffect(on([() => Boolean(props.loading), () => props.hasMore], ([busy, more], previous) => {
|
|
87
|
+
if (!previous) return;
|
|
88
|
+
if (previous[0] && !busy) recheck();
|
|
89
|
+
// More items again, for example after the list was replaced: a new approach.
|
|
90
|
+
else if (!previous[1] && more) {
|
|
91
|
+
progressAtRequest = -1;
|
|
92
|
+
recheck();
|
|
93
|
+
}
|
|
94
|
+
}));
|
|
95
|
+
|
|
96
|
+
// New items answer a request that returned nothing, also when the owner reports no loading state.
|
|
97
|
+
createEffect(on(() => props.count, recheck, {
|
|
98
|
+
defer: true
|
|
99
|
+
}));
|
|
100
|
+
onMount(() => {
|
|
101
|
+
if (props.auto === false || typeof IntersectionObserver === "undefined" || !reach) return;
|
|
102
|
+
// The viewport root sees the edge through every scroll area around it. The reach strip reaches ahead of the edge
|
|
103
|
+
// inside a scroll area; the margin does the same for the window.
|
|
104
|
+
observer = new IntersectionObserver(entries => {
|
|
105
|
+
const entry = entries[entries.length - 1];
|
|
106
|
+
if (!entry) return;
|
|
107
|
+
if (entry.isIntersecting) load(false);
|
|
108
|
+
// Leaving reach re-arms a request the owner declined.
|
|
109
|
+
else requested = false;
|
|
110
|
+
}, {
|
|
111
|
+
rootMargin: `${REACH}px 0px`
|
|
112
|
+
});
|
|
113
|
+
observer.observe(reach);
|
|
114
|
+
});
|
|
115
|
+
onCleanup(() => {
|
|
116
|
+
disposed = true;
|
|
117
|
+
observer?.disconnect();
|
|
118
|
+
});
|
|
119
|
+
return _$ssr(_tmpl$2, _$ssrAttribute("class", props.class ? `k2b-load-more ${_$escape(props.class, true)}` : "k2b-load-more", false) + _$ssrAttribute("data-side", _$escape(props.side ?? "end", true), false) + _$ssrAttribute("data-state", !props.hasMore ? "done" : loading() ? "loading" : error() ? "error" : "idle", false), _$ssrStyleProperty("--k2b-load-more-reach:", "240px"), _$escape(_$createComponent(Show, {
|
|
120
|
+
get when() {
|
|
121
|
+
return props.hasMore;
|
|
122
|
+
},
|
|
123
|
+
get children() {
|
|
124
|
+
return [_$createComponent(Show, {
|
|
125
|
+
get when() {
|
|
126
|
+
return _$memo(() => !!!loading())() && error();
|
|
127
|
+
},
|
|
128
|
+
children: message => _$ssr(_tmpl$3, _$escape(message()))
|
|
129
|
+
}), _$createComponent(Button, {
|
|
130
|
+
type: "button",
|
|
131
|
+
variant: "ghost",
|
|
132
|
+
size: "sm",
|
|
133
|
+
"class": "k2b-load-more__button",
|
|
134
|
+
get ["aria-disabled"]() {
|
|
135
|
+
return loading() ? "true" : undefined;
|
|
136
|
+
},
|
|
137
|
+
onClick: () => load(true),
|
|
138
|
+
get children() {
|
|
139
|
+
return [_$ssr(_tmpl$, _$ssrAttribute("class", loading() ? "ti ti-loader-2 k2b-spin" : error() ? "ti ti-refresh" : props.side === "start" ? "ti ti-chevron-up" : "ti ti-chevron-down", false)), loading() ? props.loadingLabel ?? messages().loadingMore : error() ? uiMessages().retry : props.label ?? messages().loadMore];
|
|
140
|
+
}
|
|
141
|
+
})];
|
|
142
|
+
}
|
|
143
|
+
})));
|
|
144
|
+
}
|
|
145
|
+
export default LoadMore;
|
|
146
|
+
//# sourceMappingURL=LoadMore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["content/LoadMore.tsx"],"sourcesContent":["import { createEffect, createSignal, type JSX, on, onCleanup, onMount, Show } from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { useFeedMessages } from \"./feed-messages\";\n\n/** Distance in px before the edge comes into view at which the next page is requested. */\nconst REACH = 240;\n\nexport type LoadMoreProps = {\n /** More items follow the loaded ones. Without it, the edge shows nothing. */\n hasMore: boolean;\n /**\n * Loads the next page. A returned promise keeps the edge busy until it settles, and a rejection shows its message\n * with \"Try again\". Resolve to `false` when nothing loaded; the edge then waits until the reader comes back to it.\n */\n onLoadMore: () => unknown;\n /** The owner loads the next page right now, also one it started itself. */\n loading?: boolean;\n /** The owner's last load failed with this message. \"Try again\" calls `onLoadMore`. */\n error?: string | null;\n /**\n * Loads by itself when the edge comes within reach of the visible area, in its own scroll area or in the window.\n * Defaults to true. With false, the owner decides when to load, and the button stays.\n */\n auto?: boolean;\n /** Where the next items appear: below the edge's list (`\"end\"`, the default) or above it (`\"start\"`). */\n side?: \"end\" | \"start\";\n /**\n * Number of loaded items. A page counts as arrived when it changed; without it, when the list grew in its parent\n * element. Pass it when new items can fit into space the list already takes, such as a table that fills its height.\n */\n count?: number;\n /** Text of the button. Defaults to \"Load more\". */\n label?: string;\n /** Text while loading. Defaults to \"Loading more…\". */\n loadingLabel?: string;\n /** Text when a load failed without its own message. Defaults to \"Could not load more.\". */\n errorLabel?: string;\n class?: string;\n};\n\nconst isPromise = (value: unknown): value is PromiseLike<unknown> =>\n typeof value === \"object\" && value !== null && typeof (value as PromiseLike<unknown>).then === \"function\";\n\n/**\n * The edge of a list that loads more: one row of fixed height that reads \"Load more\", \"Loading more…\", or the error\n * with \"Try again\", so the list around it never moves. It loads by itself when it comes within reach, once per\n * approach: a page that arrives while the edge is still in reach asks for the next one, a declined or failed request\n * waits for the reader.\n */\nexport function LoadMore(props: LoadMoreProps): JSX.Element {\n const messages = useFeedMessages();\n const uiMessages = useUiMessages();\n const [pending, setPending] = createSignal(false);\n const [failure, setFailure] = createSignal<string | null>(null);\n let root: HTMLDivElement | undefined;\n let reach: HTMLSpanElement | undefined;\n let observer: IntersectionObserver | undefined;\n /** A request the owner has not answered yet. It holds until the owner answers or the edge leaves reach. */\n let requested = false;\n /** The list's progress when the last request went out. */\n let progressAtRequest = -1;\n let disposed = false;\n\n const loading = () => Boolean(props.loading) || pending();\n const error = () => failure() ?? props.error ?? null;\n const reasonOf = (cause: unknown) => (cause instanceof Error && cause.message ? cause.message : null);\n /** The item count, or else where the edge sits plus how tall its parent's content is: both grow with the list. */\n const progress = () => props.count ?? (root ? root.offsetTop + (root.parentElement?.scrollHeight ?? 0) : 0);\n\n /**\n * Asks the observer again, so an edge that is still in reach loads once more. Only after the list grew: a page that\n * brought nothing waits for the reader, so an owner that keeps answering empty pages is not asked in a loop.\n */\n const recheck = () => {\n if (!observer || !reach || progress() === progressAtRequest) return;\n requested = false;\n // The observer watches only this strip; observing it anew delivers its current state. Only `observe` and\n // `disconnect` are used, the part of the observer that every engine and every test double offers.\n observer.disconnect();\n observer.observe(reach);\n };\n\n const load = (byReader: boolean) => {\n if (disposed || !props.hasMore || loading()) return;\n if (!byReader && (requested || error())) return;\n requested = true;\n progressAtRequest = progress();\n setFailure(null);\n let result: unknown;\n try {\n result = props.onLoadMore();\n } catch (cause) {\n requested = false;\n setFailure(reasonOf(cause) ?? props.errorLabel ?? messages().loadMoreFailed);\n return;\n }\n // Without a promise the owner answers through `loading`, `hasMore`, or the reader leaving the edge.\n if (!isPromise(result)) return;\n setPending(true);\n result.then(\n (value) => {\n if (disposed) return;\n setPending(false);\n if (value !== false) recheck();\n },\n (cause: unknown) => {\n if (disposed) return;\n setPending(false);\n requested = false;\n setFailure(reasonOf(cause) ?? props.errorLabel ?? messages().loadMoreFailed);\n },\n );\n };\n\n // The owner finished a load it reports through `loading`, or found more again: the edge may ask once more.\n createEffect(\n on([() => Boolean(props.loading), () => props.hasMore], ([busy, more], previous) => {\n if (!previous) return;\n if (previous[0] && !busy) recheck();\n // More items again, for example after the list was replaced: a new approach.\n else if (!previous[1] && more) {\n progressAtRequest = -1;\n recheck();\n }\n }),\n );\n\n // New items answer a request that returned nothing, also when the owner reports no loading state.\n createEffect(on(() => props.count, recheck, { defer: true }));\n\n onMount(() => {\n if (props.auto === false || typeof IntersectionObserver === \"undefined\" || !reach) return;\n // The viewport root sees the edge through every scroll area around it. The reach strip reaches ahead of the edge\n // inside a scroll area; the margin does the same for the window.\n observer = new IntersectionObserver(\n (entries) => {\n const entry = entries[entries.length - 1];\n if (!entry) return;\n if (entry.isIntersecting) load(false);\n // Leaving reach re-arms a request the owner declined.\n else requested = false;\n },\n { rootMargin: `${REACH}px 0px` },\n );\n observer.observe(reach);\n });\n\n onCleanup(() => {\n disposed = true;\n observer?.disconnect();\n });\n\n return (\n <div\n ref={root}\n class={props.class ? `k2b-load-more ${props.class}` : \"k2b-load-more\"}\n data-side={props.side ?? \"end\"}\n data-state={!props.hasMore ? \"done\" : loading() ? \"loading\" : error() ? \"error\" : \"idle\"}\n >\n <span ref={reach} class=\"k2b-load-more__reach\" style={{ \"--k2b-load-more-reach\": `${REACH}px` }} aria-hidden=\"true\" />\n <Show when={props.hasMore}>\n <Show when={!loading() && error()}>\n {(message) => (\n <span class=\"k2b-load-more__error\" role=\"alert\">\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n {message()}\n </span>\n )}\n </Show>\n {/* One button in every state keeps focus where it is while the page loads. */}\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n class=\"k2b-load-more__button\"\n aria-disabled={loading() ? \"true\" : undefined}\n onClick={() => load(true)}\n >\n <i\n class={\n loading()\n ? \"ti ti-loader-2 k2b-spin\"\n : error()\n ? \"ti ti-refresh\"\n : props.side === \"start\"\n ? \"ti ti-chevron-up\"\n : \"ti ti-chevron-down\"\n }\n aria-hidden=\"true\"\n />\n {loading() ? (props.loadingLabel ?? messages().loadingMore) : error() ? uiMessages().retry : (props.label ?? messages().loadMore)}\n </Button>\n </Show>\n </div>\n );\n}\n\nexport default LoadMore;\n"],"mappings":";;;;;;;;;AAAA,SAAS,YAAY,EAAE,YAAY,EAAY,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AAC7F,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,eAAe,QAAQ,iBAAiB;;AAEjD;AACA,MAAM,KAAK,GAAG,GAAG;AAmCjB,MAAM,SAAS,GAAI,KAAc,IAC/B,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAQ,KAAK,CAA0B,IAAI,KAAK,UAAU;;AAE3G;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,QAAQ,CAAC,KAAoB,EAAe;EAC1D,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC;EAClC,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC;EAClC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC;EACjD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,YAAY,CAAgB,IAAI,CAAC;EAC/D,IAAI,IAAgC;EACpC,IAAI,KAAkC;EACtC,IAAI,QAA0C;EAC9C;EACA,IAAI,SAAS,GAAG,KAAK;EACrB;EACA,IAAI,iBAAiB,GAAG,CAAC,CAAC;EAC1B,IAAI,QAAQ,GAAG,KAAK;EAEpB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC;EACzD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,IAAI,IAAI;EACpD,MAAM,QAAQ,GAAI,KAAc,IAAM,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,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