@alepha/ui 0.26.0 → 0.27.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/README.md +86 -12
- package/dist/components/account/account-connections.js +5 -5
- package/dist/components/account/account-connections.js.map +1 -1
- package/dist/components/account/account-delete-dialog.js +4 -4
- package/dist/components/account/account-header.d.ts.map +1 -1
- package/dist/components/account/account-header.js +3 -1
- package/dist/components/account/account-header.js.map +1 -1
- package/dist/components/account/account-keys.js +7 -7
- package/dist/components/account/account-keys.js.map +1 -1
- package/dist/components/account/account-layout.d.ts.map +1 -1
- package/dist/components/account/account-layout.js +7 -4
- package/dist/components/account/account-layout.js.map +1 -1
- package/dist/components/account/account-password-dialog.js +3 -3
- package/dist/components/account/account-profile.js +8 -8
- package/dist/components/account/account-profile.js.map +1 -1
- package/dist/components/account/account-router-options.d.ts.map +1 -1
- package/dist/components/account/account-router-options.js.map +1 -1
- package/dist/components/account/account-router-page.d.ts.map +1 -1
- package/dist/components/account/account-router-page.js.map +1 -1
- package/dist/components/account/account-router.d.ts +3 -2
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +4 -3
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/account/account-security.d.ts.map +1 -1
- package/dist/components/account/account-security.js +6 -6
- package/dist/components/account/account-security.js.map +1 -1
- package/dist/components/account/account-sessions.d.ts.map +1 -1
- package/dist/components/account/account-sessions.js +19 -6
- package/dist/components/account/account-sessions.js.map +1 -1
- package/dist/components/admin/admin-analytics-query-panel.d.ts +1 -1
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics-query-panel.js +5 -5
- package/dist/components/admin/admin-analytics-query-panel.js.map +1 -1
- package/dist/components/admin/admin-analytics-results.d.ts +1 -1
- package/dist/components/admin/admin-analytics-results.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics-results.js +2 -2
- package/dist/components/admin/admin-analytics-results.js.map +1 -1
- package/dist/components/admin/admin-analytics.d.ts +1 -1
- package/dist/components/admin/admin-analytics.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics.js +3 -3
- package/dist/components/admin/admin-analytics.js.map +1 -1
- package/dist/components/admin/admin-audits.d.ts +1 -1
- package/dist/components/admin/admin-audits.d.ts.map +1 -1
- package/dist/components/admin/admin-audits.js +4 -4
- package/dist/components/admin/admin-audits.js.map +1 -1
- package/dist/components/admin/admin-dashboard-card.d.ts +42 -0
- package/dist/components/admin/admin-dashboard-card.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard-card.js +0 -0
- package/dist/components/admin/admin-dashboard-count-card.d.ts +34 -0
- package/dist/components/admin/admin-dashboard-count-card.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard-count-card.js +42 -0
- package/dist/components/admin/admin-dashboard-count-card.js.map +1 -0
- package/dist/components/admin/admin-dashboard.d.ts +20 -0
- package/dist/components/admin/admin-dashboard.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard.js +32 -0
- package/dist/components/admin/admin-dashboard.js.map +1 -0
- package/dist/components/admin/admin-files.d.ts +1 -1
- package/dist/components/admin/admin-files.d.ts.map +1 -1
- package/dist/components/admin/admin-files.js +3 -3
- package/dist/components/admin/admin-files.js.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.d.ts +2 -2
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.js +16 -31
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.d.ts +2 -2
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.js +2 -2
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -1
- package/dist/components/admin/admin-jobs.d.ts +1 -1
- package/dist/components/admin/admin-jobs.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs.js +5 -5
- package/dist/components/admin/admin-jobs.js.map +1 -1
- package/dist/components/admin/admin-keys-token-dialog.js +3 -3
- package/dist/components/admin/admin-keys-token-dialog.js.map +1 -1
- package/dist/components/admin/admin-keys.d.ts +1 -1
- package/dist/components/admin/admin-keys.d.ts.map +1 -1
- package/dist/components/admin/admin-keys.js +4 -4
- package/dist/components/admin/admin-keys.js.map +1 -1
- package/dist/components/admin/admin-layout.d.ts.map +1 -1
- package/dist/components/admin/admin-layout.js +1 -3
- package/dist/components/admin/admin-layout.js.map +1 -1
- package/dist/components/admin/admin-notifications.d.ts +1 -1
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +3 -3
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-parameters.d.ts +1 -1
- package/dist/components/admin/admin-parameters.d.ts.map +1 -1
- package/dist/components/admin/admin-parameters.js +10 -10
- package/dist/components/admin/admin-parameters.js.map +1 -1
- package/dist/components/admin/admin-payments.d.ts +1 -1
- package/dist/components/admin/admin-payments.d.ts.map +1 -1
- package/dist/components/admin/admin-payments.js +3 -3
- package/dist/components/admin/admin-payments.js.map +1 -1
- package/dist/components/admin/admin-router-options.d.ts +13 -10
- package/dist/components/admin/admin-router-options.d.ts.map +1 -1
- package/dist/components/admin/admin-router-options.js.map +1 -1
- package/dist/components/admin/admin-router-page.d.ts +7 -5
- package/dist/components/admin/admin-router-page.d.ts.map +1 -1
- package/dist/components/admin/admin-router-page.js +7 -5
- package/dist/components/admin/admin-router-page.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +72 -27
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +103 -40
- package/dist/components/admin/admin-router.js.map +1 -1
- package/dist/components/admin/admin-sessions.d.ts +1 -1
- package/dist/components/admin/admin-sessions.d.ts.map +1 -1
- package/dist/components/admin/admin-sessions.js +12 -4
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts +2 -2
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts +4 -3
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-identity-aside.js +13 -69
- package/dist/components/admin/admin-user-detail-identity-aside.js.map +1 -1
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-overview-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-password-dialog.js.map +1 -1
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-profile-policy.js.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.js +2 -2
- package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts +2 -2
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail.js +68 -111
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts +6 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.js +11 -8
- package/dist/components/admin/admin-users-roles-picker.js.map +1 -1
- package/dist/components/admin/admin-users.d.ts.map +1 -1
- package/dist/components/admin/admin-users.js +9 -12
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +2 -2
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-execution-sheet.js +10 -10
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +2 -2
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +20 -44
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts +2 -2
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.js +2 -2
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -1
- package/dist/components/admin/admin-workflows.d.ts +1 -1
- package/dist/components/admin/admin-workflows.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows.js +5 -5
- package/dist/components/admin/admin-workflows.js.map +1 -1
- package/dist/components/admin/diff-lines.js +1 -1
- package/dist/components/admin/diff-lines.js.map +1 -1
- package/dist/components/admin/parameter-diff-dialog.d.ts.map +1 -1
- package/dist/components/admin/parameter-diff-dialog.js +1 -1
- package/dist/components/admin/parameter-diff-dialog.js.map +1 -1
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -1
- package/dist/components/admin/parameter-history-item.js +4 -4
- package/dist/components/admin/parameter-history-item.js.map +1 -1
- package/dist/components/admin/parameter-json-dialog.js +1 -1
- package/dist/components/admin/parameter-save-dialog.js +2 -2
- package/dist/components/admin/use-confirmed-action.js +1 -1
- package/dist/components/alepha-table/alepha-table.d.ts +103 -8
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +128 -26
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/alepha-table/paginate-local.d.ts +43 -0
- package/dist/components/alepha-table/paginate-local.d.ts.map +1 -0
- package/dist/components/alepha-table/paginate-local.js +84 -0
- package/dist/components/alepha-table/paginate-local.js.map +1 -0
- package/dist/components/app-actions/app-actions.js +1 -1
- package/dist/components/app-shell/app-shell.d.ts +10 -1
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +27 -20
- package/dist/components/app-shell/app-shell.js.map +1 -1
- package/dist/components/auth/auth-login.d.ts +1 -1
- package/dist/components/auth/auth-login.d.ts.map +1 -1
- package/dist/components/auth/auth-login.js +7 -18
- package/dist/components/auth/auth-login.js.map +1 -1
- package/dist/components/auth/auth-register.d.ts +1 -1
- package/dist/components/auth/auth-register.d.ts.map +1 -1
- package/dist/components/auth/auth-register.js +20 -21
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auth/auth-reset-password.d.ts +1 -1
- package/dist/components/auth/auth-reset-password.d.ts.map +1 -1
- package/dist/components/auth/auth-reset-password.js +16 -13
- package/dist/components/auth/auth-reset-password.js.map +1 -1
- package/dist/components/auth/auth-router.d.ts +3 -3
- package/dist/components/auth/auth-router.d.ts.map +1 -1
- package/dist/components/auth/auth-router.js +3 -3
- package/dist/components/auth/auth-router.js.map +1 -1
- package/dist/components/auth/auth-verify-email.d.ts +1 -1
- package/dist/components/auth/auth-verify-email.d.ts.map +1 -1
- package/dist/components/auth/auth-verify-email.js +8 -8
- package/dist/components/auth/auth-verify-email.js.map +1 -1
- package/dist/components/auth/safe-redirect.d.ts +9 -0
- package/dist/components/auth/safe-redirect.d.ts.map +1 -0
- package/dist/components/auth/safe-redirect.js +19 -0
- package/dist/components/auth/safe-redirect.js.map +1 -0
- package/dist/components/auto-form/auto-form.d.ts.map +1 -1
- package/dist/components/auto-form/auto-form.js +32 -32
- package/dist/components/auto-form/auto-form.js.map +1 -1
- package/dist/components/brand-icon/brand-icon.d.ts +1 -1
- package/dist/components/brand-icon/brand-icon.d.ts.map +1 -1
- package/dist/components/brand-icon/brand-icon.js +2 -2
- package/dist/components/brand-icon/brand-icon.js.map +1 -1
- package/dist/components/button-dark/button-dark.d.ts +1 -1
- package/dist/components/button-dark/button-dark.d.ts.map +1 -1
- package/dist/components/button-dark/button-dark.js +2 -2
- package/dist/components/button-dark/button-dark.js.map +1 -1
- package/dist/components/button-language/button-language.d.ts +1 -1
- package/dist/components/button-language/button-language.d.ts.map +1 -1
- package/dist/components/button-language/button-language.js +2 -2
- package/dist/components/button-language/button-language.js.map +1 -1
- package/dist/components/button-theme/button-theme.d.ts +1 -1
- package/dist/components/button-theme/button-theme.d.ts.map +1 -1
- package/dist/components/button-theme/button-theme.js +3 -3
- package/dist/components/button-theme/button-theme.js.map +1 -1
- package/dist/components/button-user/button-user.d.ts +2 -20
- package/dist/components/button-user/button-user.d.ts.map +1 -1
- package/dist/components/button-user/button-user.js +3 -3
- package/dist/components/button-user/button-user.js.map +1 -1
- package/dist/components/captcha/turnstile-widget.d.ts +2 -2
- package/dist/components/captcha/turnstile-widget.d.ts.map +1 -1
- package/dist/components/captcha/turnstile-widget.js +5 -4
- package/dist/components/captcha/turnstile-widget.js.map +1 -1
- package/dist/components/control/control.d.ts +1 -1
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +8 -11
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.d.ts +1 -1
- package/dist/components/control-array/control-array.d.ts.map +1 -1
- package/dist/components/control-array/control-array.js +23 -16
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-base/field-i18n.d.ts +5 -3
- package/dist/components/control-base/field-i18n.d.ts.map +1 -1
- package/dist/components/control-base/field-i18n.js +4 -2
- package/dist/components/control-base/field-i18n.js.map +1 -1
- package/dist/components/control-base/form-field.d.ts +7 -7
- package/dist/components/control-base/form-field.d.ts.map +1 -1
- package/dist/components/control-base/form-field.js +10 -10
- package/dist/components/control-base/form-field.js.map +1 -1
- package/dist/components/control-base/icon-hint.d.ts +1 -1
- package/dist/components/control-base/icon-hint.d.ts.map +1 -1
- package/dist/components/control-base/icon-hint.js.map +1 -1
- package/dist/components/control-date/control-date.d.ts +1 -1
- package/dist/components/control-date/control-date.d.ts.map +1 -1
- package/dist/components/control-date/control-date.js +23 -7
- package/dist/components/control-date/control-date.js.map +1 -1
- package/dist/components/control-number/control-number.d.ts +2 -2
- package/dist/components/control-number/control-number.d.ts.map +1 -1
- package/dist/components/control-number/control-number.js +3 -3
- package/dist/components/control-number/control-number.js.map +1 -1
- package/dist/components/control-object/control-object.d.ts +4 -2
- package/dist/components/control-object/control-object.d.ts.map +1 -1
- package/dist/components/control-object/control-object.js +8 -8
- package/dist/components/control-object/control-object.js.map +1 -1
- package/dist/components/control-password/control-password.js +2 -3
- package/dist/components/control-password/control-password.js.map +1 -1
- package/dist/components/control-select/control-select.d.ts +2 -2
- package/dist/components/control-select/control-select.d.ts.map +1 -1
- package/dist/components/control-select/control-select.js +17 -17
- package/dist/components/control-select/control-select.js.map +1 -1
- package/dist/components/control-upload/control-upload.d.ts +1 -1
- package/dist/components/control-upload/control-upload.d.ts.map +1 -1
- package/dist/components/control-upload/control-upload.js +11 -11
- package/dist/components/control-upload/control-upload.js.map +1 -1
- package/dist/components/detail/detail-aside.d.ts +58 -0
- package/dist/components/detail/detail-aside.d.ts.map +1 -0
- package/dist/components/detail/detail-aside.js +95 -0
- package/dist/components/detail/detail-aside.js.map +1 -0
- package/dist/components/detail/detail-layout.d.ts +90 -0
- package/dist/components/detail/detail-layout.d.ts.map +1 -0
- package/dist/components/detail/detail-layout.js +102 -0
- package/dist/components/detail/detail-layout.js.map +1 -0
- package/dist/components/detail/use-detail-tab.d.ts +15 -0
- package/dist/components/detail/use-detail-tab.d.ts.map +1 -0
- package/dist/components/detail/use-detail-tab.js +37 -0
- package/dist/components/detail/use-detail-tab.js.map +1 -0
- package/dist/components/file-image/file-image.d.ts.map +1 -1
- package/dist/components/file-image/file-image.js.map +1 -1
- package/dist/components/language-toggle/language-toggle.d.ts +1 -1
- package/dist/components/language-toggle/language-toggle.d.ts.map +1 -1
- package/dist/components/language-toggle/language-toggle.js +2 -2
- package/dist/components/language-toggle/language-toggle.js.map +1 -1
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.d.ts +28 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.js +25 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts +44 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js +98 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.d.ts +14 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js +45 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts +19 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js +69 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts +23 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js +34 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts +17 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js +63 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js.map +1 -0
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts +30 -0
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/MermaidFence.js +30 -0
- package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -0
- package/dist/components/markdown-view/diagram/flowchartParser.d.ts +18 -0
- package/dist/components/markdown-view/diagram/flowchartParser.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/flowchartParser.js +370 -0
- package/dist/components/markdown-view/diagram/flowchartParser.js.map +1 -0
- package/dist/components/markdown-view/diagram/graphModel.d.ts +67 -0
- package/dist/components/markdown-view/diagram/graphModel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/graphModel.js +0 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.d.ts +109 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.js +185 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.js.map +1 -0
- package/dist/components/markdown-view/diagram/textMetrics.d.ts +63 -0
- package/dist/components/markdown-view/diagram/textMetrics.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/textMetrics.js +228 -0
- package/dist/components/markdown-view/diagram/textMetrics.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.d.ts +32 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +85 -9
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/nav-shell/nav-shell.d.ts +1 -1
- package/dist/components/nav-shell/nav-shell.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-shell.js +1 -1
- package/dist/components/nav-shell/nav-shell.js.map +1 -1
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -1
- package/dist/components/nav-shell/spotlight.js.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.d.ts +15 -5
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.js +1 -1
- package/dist/components/nav-shell/use-nav-entries.js.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -1
- package/dist/components/settings/settings-card-edge.d.ts +25 -0
- package/dist/components/settings/settings-card-edge.d.ts.map +1 -0
- package/dist/components/settings/settings-card-edge.js +29 -0
- package/dist/components/settings/settings-card-edge.js.map +1 -0
- package/dist/components/settings/settings-danger-section.d.ts.map +1 -1
- package/dist/components/settings/settings-danger-section.js +2 -1
- package/dist/components/settings/settings-danger-section.js.map +1 -1
- package/dist/components/settings/settings-layout.d.ts.map +1 -1
- package/dist/components/settings/settings-layout.js +1 -1
- package/dist/components/settings/settings-layout.js.map +1 -1
- package/dist/components/settings/settings-nav.d.ts.map +1 -1
- package/dist/components/settings/settings-nav.js +3 -3
- package/dist/components/settings/settings-nav.js.map +1 -1
- package/dist/components/settings/settings-row.js +2 -2
- package/dist/components/settings/settings-row.js.map +1 -1
- package/dist/components/settings/settings-section.d.ts.map +1 -1
- package/dist/components/settings/settings-section.js +3 -2
- package/dist/components/settings/settings-section.js.map +1 -1
- package/dist/components/ui/accordion.js +3 -3
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.js +5 -5
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.js +2 -2
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +13 -2
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +51 -12
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.js +3 -3
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button-group.js +2 -2
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +8 -8
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +20 -10
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +7 -6
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js +8 -8
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +6 -6
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.js +8 -8
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.js +4 -4
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.js +4 -4
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js +9 -9
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.js +2 -2
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +3 -3
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.js +3 -3
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.js +3 -3
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/kbd.js +1 -1
- package/dist/components/ui/kbd.js.map +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.js +9 -9
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.js +7 -7
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.js +3 -3
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js +2 -2
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.js +2 -2
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.js +2 -2
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +1 -1
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select.js +8 -8
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.js +3 -3
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.js +17 -17
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.js +2 -2
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.js +1 -1
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +5 -5
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +13 -7
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.js +2 -2
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -3
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/use-dialog/use-dialog.d.ts +2 -2
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/use-dialog/use-dialog.js +10 -6
- package/dist/components/use-dialog/use-dialog.js.map +1 -1
- package/dist/components/use-toast/use-toast.d.ts +9 -3
- package/dist/components/use-toast/use-toast.d.ts.map +1 -1
- package/dist/components/use-toast/use-toast.js +23 -22
- package/dist/components/use-toast/use-toast.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +10 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +19 -12
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts +3 -3
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +13 -8
- package/dist/lib/i18n-fr.js.map +1 -1
- package/dist/styles.css +5 -5
- package/package.json +46 -45
- package/src/components/account/__tests__/account-router.spec.ts +4 -2
- package/src/components/account/account-connections.tsx +1 -1
- package/src/components/account/account-header.tsx +6 -1
- package/src/components/account/account-keys.tsx +1 -1
- package/src/components/account/account-layout.tsx +8 -1
- package/src/components/account/account-profile.tsx +3 -3
- package/src/components/account/account-router-options.tsx +1 -0
- package/src/components/account/account-router-page.tsx +1 -0
- package/src/components/account/account-router.tsx +4 -2
- package/src/components/account/account-security.tsx +1 -0
- package/src/components/account/account-sessions.tsx +21 -4
- package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +1 -0
- package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +2 -1
- package/src/components/admin/__tests__/admin-router-page.spec.ts +2 -1
- package/src/components/admin/__tests__/admin-router.spec.ts +57 -1
- package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +1 -0
- package/src/components/admin/__tests__/admin-user-detail.spec.ts +1 -0
- package/src/components/admin/admin-analytics-query-panel.tsx +4 -3
- package/src/components/admin/admin-analytics-results.tsx +2 -2
- package/src/components/admin/admin-analytics.tsx +3 -3
- package/src/components/admin/admin-audits.tsx +3 -3
- package/src/components/admin/admin-dashboard-card.tsx +45 -0
- package/src/components/admin/admin-dashboard-count-card.tsx +89 -0
- package/src/components/admin/admin-dashboard.tsx +60 -0
- package/src/components/admin/admin-files.tsx +2 -2
- package/src/components/admin/admin-jobs-executions-panel.tsx +19 -12
- package/src/components/admin/admin-jobs-status-badge.tsx +2 -2
- package/src/components/admin/admin-jobs.tsx +4 -4
- package/src/components/admin/admin-keys-token-dialog.tsx +2 -2
- package/src/components/admin/admin-keys.tsx +2 -2
- package/src/components/admin/admin-layout.tsx +1 -2
- package/src/components/admin/admin-notifications.tsx +2 -2
- package/src/components/admin/admin-parameters.tsx +16 -9
- package/src/components/admin/admin-payments.tsx +2 -2
- package/src/components/admin/admin-router-options.tsx +14 -10
- package/src/components/admin/admin-router-page.tsx +8 -5
- package/src/components/admin/admin-router.tsx +112 -40
- package/src/components/admin/admin-sessions.tsx +13 -2
- package/src/components/admin/admin-user-detail-audits-tab.tsx +5 -2
- package/src/components/admin/admin-user-detail-identity-aside.tsx +16 -93
- package/src/components/admin/admin-user-detail-overview-tab.tsx +1 -0
- package/src/components/admin/admin-user-detail-password-dialog.tsx +1 -0
- package/src/components/admin/admin-user-detail-profile-policy.spec.ts +1 -0
- package/src/components/admin/admin-user-detail-profile-policy.ts +1 -0
- package/src/components/admin/admin-user-detail-security-tab.tsx +1 -0
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +5 -2
- package/src/components/admin/admin-user-detail.tsx +49 -87
- package/src/components/admin/admin-users-roles-picker.tsx +22 -15
- package/src/components/admin/admin-users.tsx +8 -14
- package/src/components/admin/admin-workflows-execution-sheet.tsx +18 -10
- package/src/components/admin/admin-workflows-executions-panel.tsx +24 -17
- package/src/components/admin/admin-workflows-status-badge.tsx +4 -2
- package/src/components/admin/admin-workflows.tsx +6 -4
- package/src/components/admin/diff-lines.spec.ts +1 -0
- package/src/components/admin/diff-lines.ts +1 -1
- package/src/components/admin/parameter-diff-dialog.tsx +3 -2
- package/src/components/admin/parameter-history-item.tsx +6 -5
- package/src/components/alepha-table/__tests__/alepha-table-static.browser.spec.tsx +190 -0
- package/src/components/alepha-table/__tests__/paginate-local.spec.ts +286 -0
- package/src/components/alepha-table/__tests__/use-table-selection.browser.spec.tsx +1 -0
- package/src/components/alepha-table/alepha-table.tsx +362 -79
- package/src/components/alepha-table/paginate-local.ts +174 -0
- package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +1 -0
- package/src/components/app-shell/app-shell.tsx +42 -19
- package/src/components/auth/__tests__/auth-router.spec.ts +2 -1
- package/src/components/auth/auth-login.tsx +5 -16
- package/src/components/auth/auth-register.tsx +26 -25
- package/src/components/auth/auth-reset-password.tsx +24 -17
- package/src/components/auth/auth-router.tsx +4 -3
- package/src/components/auth/auth-verify-email.tsx +7 -7
- package/src/components/auth/safe-redirect.ts +14 -0
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +1 -0
- package/src/components/auto-form/auto-form.tsx +60 -39
- package/src/components/brand-icon/brand-icon.tsx +2 -2
- package/src/components/button-dark/button-dark.tsx +2 -2
- package/src/components/button-language/button-language.tsx +2 -2
- package/src/components/button-theme/button-theme.tsx +2 -2
- package/src/components/button-user/button-user.tsx +4 -4
- package/src/components/captcha/turnstile-widget.tsx +6 -5
- package/src/components/control/control.tsx +6 -6
- package/src/components/control-array/control-array.tsx +28 -15
- package/src/components/control-base/__tests__/form-field-a11y.browser.spec.tsx +1 -0
- package/src/components/control-base/field-i18n.ts +5 -3
- package/src/components/control-base/form-field.tsx +13 -13
- package/src/components/control-base/icon-hint.tsx +1 -1
- package/src/components/control-date/control-date.tsx +29 -6
- package/src/components/control-number/control-number.tsx +3 -3
- package/src/components/control-object/control-object.tsx +11 -8
- package/src/components/control-password/control-password.tsx +2 -2
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +1 -0
- package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +1 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +1 -0
- package/src/components/control-select/control-select.tsx +32 -18
- package/src/components/control-upload/control-upload.tsx +16 -10
- package/src/components/detail/__tests__/detail-aside.browser.spec.tsx +135 -0
- package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +151 -0
- package/src/components/detail/detail-aside.tsx +198 -0
- package/src/components/detail/detail-layout.tsx +181 -0
- package/src/components/detail/use-detail-tab.tsx +41 -0
- package/src/components/file-image/file-image.tsx +4 -2
- package/src/components/language-toggle/language-toggle.tsx +2 -2
- package/src/components/markdown-view/__tests__/markdown-view-mermaid.browser.spec.tsx +148 -0
- package/src/components/markdown-view/__tests__/markdown-view-raw-html.browser.spec.tsx +1 -0
- package/src/components/markdown-view/diagram/DiagramErrorBoundary.tsx +42 -0
- package/src/components/markdown-view/diagram/FlowchartDiagram.tsx +136 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx +59 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx +95 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramLabel.tsx +58 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramNode.tsx +78 -0
- package/src/components/markdown-view/diagram/MermaidFence.tsx +46 -0
- package/src/components/markdown-view/diagram/__tests__/flowchart-diagram.browser.spec.tsx +210 -0
- package/src/components/markdown-view/diagram/flowchartParser.spec.ts +379 -0
- package/src/components/markdown-view/diagram/flowchartParser.ts +475 -0
- package/src/components/markdown-view/diagram/graphModel.ts +72 -0
- package/src/components/markdown-view/diagram/layoutFlowchart.spec.ts +235 -0
- package/src/components/markdown-view/diagram/layoutFlowchart.ts +324 -0
- package/src/components/markdown-view/diagram/textMetrics.spec.ts +128 -0
- package/src/components/markdown-view/diagram/textMetrics.ts +296 -0
- package/src/components/markdown-view/markdown-view.tsx +128 -9
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +1 -0
- package/src/components/nav-shell/nav-shell.tsx +6 -3
- package/src/components/nav-shell/spotlight.tsx +2 -1
- package/src/components/nav-shell/use-nav-breadcrumbs.ts +1 -0
- package/src/components/nav-shell/use-nav-entries.ts +16 -5
- package/src/components/nav-shell/use-nav-tree.ts +1 -0
- package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +1 -0
- package/src/components/settings/__tests__/settings-section.browser.spec.tsx +1 -0
- package/src/components/settings/settings-card-edge.ts +24 -0
- package/src/components/settings/settings-danger-section.tsx +7 -1
- package/src/components/settings/settings-layout.tsx +16 -1
- package/src/components/settings/settings-nav.tsx +12 -3
- package/src/components/settings/settings-row.tsx +2 -2
- package/src/components/settings/settings-section.tsx +2 -1
- package/src/components/ui/accordion.tsx +3 -3
- package/src/components/ui/alert-dialog.tsx +5 -5
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +5 -5
- package/src/components/ui/badge.tsx +48 -2
- package/src/components/ui/breadcrumb.tsx +3 -3
- package/src/components/ui/button-group.tsx +2 -2
- package/src/components/ui/button.tsx +2 -2
- package/src/components/ui/calendar.tsx +8 -8
- package/src/components/ui/card.tsx +3 -3
- package/src/components/ui/carousel.tsx +30 -13
- package/src/components/ui/chart.tsx +18 -6
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/combobox.tsx +8 -9
- package/src/components/ui/command.tsx +6 -7
- package/src/components/ui/context-menu.tsx +8 -8
- package/src/components/ui/dialog.tsx +4 -4
- package/src/components/ui/drawer.tsx +4 -4
- package/src/components/ui/dropdown-menu.tsx +9 -9
- package/src/components/ui/empty.tsx +2 -2
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-group.tsx +6 -3
- package/src/components/ui/input-otp.tsx +3 -3
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/item.tsx +3 -3
- package/src/components/ui/kbd.tsx +1 -1
- package/src/components/ui/label.tsx +3 -0
- package/src/components/ui/menubar.tsx +9 -9
- package/src/components/ui/navigation-menu.tsx +7 -7
- package/src/components/ui/pagination.tsx +0 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +3 -3
- package/src/components/ui/radio-group.tsx +2 -2
- package/src/components/ui/resizable.tsx +2 -2
- package/src/components/ui/scroll-area.tsx +2 -2
- package/src/components/ui/segmented.tsx +8 -3
- package/src/components/ui/select.tsx +8 -8
- package/src/components/ui/separator.tsx +1 -1
- package/src/components/ui/sheet.tsx +3 -3
- package/src/components/ui/sidebar.tsx +20 -20
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +2 -2
- package/src/components/ui/switch.tsx +2 -2
- package/src/components/ui/table.tsx +10 -5
- package/src/components/ui/tabs.tsx +3 -3
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle-group.tsx +9 -4
- package/src/components/ui/toggle.tsx +2 -2
- package/src/components/ui/tooltip.tsx +13 -3
- package/src/components/use-dialog/use-dialog.tsx +19 -6
- package/src/components/use-toast/__tests__/use-toast.browser.spec.tsx +19 -0
- package/src/components/use-toast/use-toast.tsx +38 -26
- package/src/hooks/use-mobile.ts +27 -14
- package/src/lib/__tests__/i18n-fr.spec.ts +5 -1
- package/src/lib/i18n-fr.ts +18 -10
- package/src/styles.css +5 -5
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import type { GraphNode } from "./graphModel.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The font the diagram pins, and never inherits.
|
|
5
|
+
*
|
|
6
|
+
* Inheriting is the trap: folio view mode and the quest description set
|
|
7
|
+
* prose in Literata at 16.5px and load it lazily after first paint, while
|
|
8
|
+
* every other surface is Inter at `text-sm`. An SVG that inherits would
|
|
9
|
+
* measure against one face and render in another, differently per surface,
|
|
10
|
+
* and shift when the font file lands. So the emitter sets both explicitly
|
|
11
|
+
* and the table below is generated against exactly this face and size.
|
|
12
|
+
*
|
|
13
|
+
* `@alepha/ui` ships Inter through `@fontsource-variable/inter`; the stack
|
|
14
|
+
* degrades to the platform UI sans if it has not loaded.
|
|
15
|
+
*/
|
|
16
|
+
export const DIAGRAM_FONT_FAMILY =
|
|
17
|
+
'"Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The one size every diagram label is drawn at.
|
|
21
|
+
*/
|
|
22
|
+
export const DIAGRAM_FONT_SIZE = 13;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Baseline-to-baseline distance, as a multiple of the font size.
|
|
26
|
+
*/
|
|
27
|
+
export const DIAGRAM_LINE_HEIGHT = 1.35;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The widest a label may measure before it wraps, in pixels at
|
|
31
|
+
* `DIAGRAM_FONT_SIZE`. Without a clamp a 400-character label produces a
|
|
32
|
+
* 4000px box and every other node in the diagram becomes a speck.
|
|
33
|
+
*/
|
|
34
|
+
export const MAX_LABEL_WIDTH = 220;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* How many lines a label keeps before the rest is cut with an ellipsis.
|
|
38
|
+
*/
|
|
39
|
+
export const MAX_LABEL_LINES = 8;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Per-character advance widths for Inter, as a RATIO of the font size, so
|
|
43
|
+
* the table scales to any size.
|
|
44
|
+
*
|
|
45
|
+
* ## How this was produced, and how to reproduce it
|
|
46
|
+
*
|
|
47
|
+
* `scripts/measure-font.mjs` loads the real `@fontsource-variable/inter`
|
|
48
|
+
* woff2 into Chromium via Playwright, waits for `document.fonts.ready` and
|
|
49
|
+
* calls `canvas.measureText` on every character below, then buckets them by
|
|
50
|
+
* rounded ratio. Run it from the repo root and paste the output back here:
|
|
51
|
+
*
|
|
52
|
+
* node packages/@alepha/ui/scripts/measure-font.mjs
|
|
53
|
+
*
|
|
54
|
+
* The numbers are NOT magic and NOT hand-tuned. If the pinned face or size
|
|
55
|
+
* ever changes, regenerate rather than nudging a value.
|
|
56
|
+
*
|
|
57
|
+
* ## Why a table at all
|
|
58
|
+
*
|
|
59
|
+
* Layout needs node sizes before it can place anything, and node width comes
|
|
60
|
+
* from the label. Mermaid gets this by rendering into a hidden DOM node,
|
|
61
|
+
* which is precisely why mermaid cannot run without a browser. Arithmetic
|
|
62
|
+
* keeps the layout core a pure function. It is an approximation: 5% off on a
|
|
63
|
+
* box width is invisible in a boxes-and-arrows diagram, and it is the
|
|
64
|
+
* concrete reason v1 is flowcharts rather than sequence diagrams, whose
|
|
65
|
+
* layout is far more sensitive to text metrics.
|
|
66
|
+
*/
|
|
67
|
+
const WIDTH_BUCKETS: Array<[ratio: number, chars: string]> = [
|
|
68
|
+
[0.242, "ijl"],
|
|
69
|
+
[0.261, "’"],
|
|
70
|
+
[0.269, "I"],
|
|
71
|
+
[0.281, " "],
|
|
72
|
+
[0.288, "!,.:·"],
|
|
73
|
+
[0.3, "'"],
|
|
74
|
+
[0.302, ";"],
|
|
75
|
+
[0.323, "`"],
|
|
76
|
+
[0.327, "t"],
|
|
77
|
+
[0.333, "|"],
|
|
78
|
+
[0.36, "/\\"],
|
|
79
|
+
[0.365, "()[]"],
|
|
80
|
+
[0.37, "f"],
|
|
81
|
+
[0.376, "r"],
|
|
82
|
+
[0.407, "1"],
|
|
83
|
+
[0.426, "{}"],
|
|
84
|
+
[0.44, "“”"],
|
|
85
|
+
[0.456, "_"],
|
|
86
|
+
[0.46, "-"],
|
|
87
|
+
[0.466, '"'],
|
|
88
|
+
[0.471, "^"],
|
|
89
|
+
[0.501, "*"],
|
|
90
|
+
[0.511, "?"],
|
|
91
|
+
[0.528, "s"],
|
|
92
|
+
[0.546, "x"],
|
|
93
|
+
[0.549, "k"],
|
|
94
|
+
[0.552, "z"],
|
|
95
|
+
[0.562, "avyà"],
|
|
96
|
+
[0.565, "L"],
|
|
97
|
+
[0.566, "7"],
|
|
98
|
+
[0.571, "Jcç"],
|
|
99
|
+
[0.583, "eéè"],
|
|
100
|
+
[0.59, "F"],
|
|
101
|
+
[0.591, "hnuüñ"],
|
|
102
|
+
[0.593, "5"],
|
|
103
|
+
[0.6, "oö"],
|
|
104
|
+
[0.601, "E"],
|
|
105
|
+
[0.61, "2"],
|
|
106
|
+
[0.612, "bdpq"],
|
|
107
|
+
[0.613, "g"],
|
|
108
|
+
[0.618, "3"],
|
|
109
|
+
[0.619, "8"],
|
|
110
|
+
[0.62, "69"],
|
|
111
|
+
[0.629, "Z"],
|
|
112
|
+
[0.631, "0"],
|
|
113
|
+
[0.633, "#"],
|
|
114
|
+
[0.639, "P"],
|
|
115
|
+
[0.642, "$S"],
|
|
116
|
+
[0.644, "&R"],
|
|
117
|
+
[0.646, "4T"],
|
|
118
|
+
[0.654, "B"],
|
|
119
|
+
[0.662, "+<=>~"],
|
|
120
|
+
[0.672, "K"],
|
|
121
|
+
[0.679, "Y"],
|
|
122
|
+
[0.682, "X"],
|
|
123
|
+
[0.69, "AV"],
|
|
124
|
+
[0.722, "D"],
|
|
125
|
+
[0.73, "C"],
|
|
126
|
+
[0.743, "H"],
|
|
127
|
+
[0.744, "U"],
|
|
128
|
+
[0.746, "G"],
|
|
129
|
+
[0.753, "N"],
|
|
130
|
+
[0.765, "OQ"],
|
|
131
|
+
[0.818, "w"],
|
|
132
|
+
[0.864, "…"],
|
|
133
|
+
[0.876, "m"],
|
|
134
|
+
[0.903, "M"],
|
|
135
|
+
[0.966, "@"],
|
|
136
|
+
[0.982, "%"],
|
|
137
|
+
[0.985, "W"],
|
|
138
|
+
[1, "→←—"],
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Anything unlisted (CJK, emoji, the rest of Unicode) measures at the
|
|
143
|
+
* average of the table. Wrong, but bounded, which is the whole contract.
|
|
144
|
+
*/
|
|
145
|
+
const FALLBACK_RATIO = 0.57;
|
|
146
|
+
|
|
147
|
+
const RATIOS: Map<string, number> = new Map(
|
|
148
|
+
WIDTH_BUCKETS.flatMap(([ratio, chars]) =>
|
|
149
|
+
// Width buckets are ASCII characters; there is nothing multi-unit to split.
|
|
150
|
+
// oxlint-disable-next-line typescript/no-misused-spread
|
|
151
|
+
[...chars].map((char) => [char, ratio] as [string, number]),
|
|
152
|
+
),
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The rendered width of one line, in pixels, at `fontSize`.
|
|
157
|
+
*/
|
|
158
|
+
export const measureLine = (line: string, fontSize: number): number => {
|
|
159
|
+
let ratio = 0;
|
|
160
|
+
for (const char of line) ratio += RATIOS.get(char) ?? FALLBACK_RATIO;
|
|
161
|
+
return ratio * fontSize;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export interface LabelMetrics {
|
|
165
|
+
/**
|
|
166
|
+
* The widest line, in pixels.
|
|
167
|
+
*/
|
|
168
|
+
width: number;
|
|
169
|
+
/**
|
|
170
|
+
* Total height of the line box stack, in pixels.
|
|
171
|
+
*/
|
|
172
|
+
height: number;
|
|
173
|
+
/**
|
|
174
|
+
* The lines as measured - wrapped and capped, so the emitter draws these.
|
|
175
|
+
*/
|
|
176
|
+
lines: string[];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Measure a node or cluster label, wrapping and clamping it first.
|
|
181
|
+
*
|
|
182
|
+
* Returns the lines it actually measured, not the ones it was given: the
|
|
183
|
+
* emitter must draw exactly what was measured, or text and box disagree.
|
|
184
|
+
*/
|
|
185
|
+
export const measureLabel = (
|
|
186
|
+
lines: string[],
|
|
187
|
+
fontSize: number = DIAGRAM_FONT_SIZE,
|
|
188
|
+
): LabelMetrics => {
|
|
189
|
+
const wrapped: string[] = [];
|
|
190
|
+
for (const line of lines) {
|
|
191
|
+
for (const piece of wrapLine(line, fontSize)) {
|
|
192
|
+
wrapped.push(piece);
|
|
193
|
+
if (wrapped.length >= MAX_LABEL_LINES) break;
|
|
194
|
+
}
|
|
195
|
+
if (wrapped.length >= MAX_LABEL_LINES) break;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const cut =
|
|
199
|
+
wrapped.length >= MAX_LABEL_LINES &&
|
|
200
|
+
countWrapped(lines, fontSize) > MAX_LABEL_LINES;
|
|
201
|
+
if (cut)
|
|
202
|
+
wrapped[MAX_LABEL_LINES - 1] = truncate(
|
|
203
|
+
wrapped[MAX_LABEL_LINES - 1],
|
|
204
|
+
fontSize,
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
const measured = wrapped.length > 0 ? wrapped : [""];
|
|
208
|
+
return {
|
|
209
|
+
width: Math.max(
|
|
210
|
+
...measured.map((line) => measureLine(line, fontSize)),
|
|
211
|
+
fontSize,
|
|
212
|
+
),
|
|
213
|
+
height: measured.length * fontSize * DIAGRAM_LINE_HEIGHT,
|
|
214
|
+
lines: measured,
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* The box a node needs: its label plus padding, per shape.
|
|
220
|
+
*/
|
|
221
|
+
export const measureNode = (
|
|
222
|
+
node: Pick<GraphNode, "lines" | "shape">,
|
|
223
|
+
fontSize: number = DIAGRAM_FONT_SIZE,
|
|
224
|
+
): LabelMetrics => {
|
|
225
|
+
const label = measureLabel(node.lines, fontSize);
|
|
226
|
+
|
|
227
|
+
if (node.shape === "circle") {
|
|
228
|
+
// An axis-aligned w x h box fits an ellipse exactly when
|
|
229
|
+
// (w/2 / rx)^2 + (h/2 / ry)^2 <= 1, and rx = (w/2)·√2, ry = (h/2)·√2 is
|
|
230
|
+
// the solution that touches all four corners. Forcing width === height
|
|
231
|
+
// instead is what turned a two-word label into an enormous disc that
|
|
232
|
+
// made every other node in the diagram a speck.
|
|
233
|
+
const width = label.width * Math.SQRT2 + 12;
|
|
234
|
+
const height = label.height * Math.SQRT2 + 12;
|
|
235
|
+
return {
|
|
236
|
+
// A one-line label is far wider than it is tall, so without a floor
|
|
237
|
+
// the "circle" degenerates into a flat sliver.
|
|
238
|
+
width,
|
|
239
|
+
height: Math.max(height, width * 0.55),
|
|
240
|
+
lines: label.lines,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// A diamond has to be wide enough that its slanted sides clear the text.
|
|
245
|
+
const padX = node.shape === "diamond" ? 34 : 16;
|
|
246
|
+
const padY = node.shape === "diamond" ? 20 : 10;
|
|
247
|
+
return {
|
|
248
|
+
width: label.width + padX * 2,
|
|
249
|
+
height: label.height + padY * 2,
|
|
250
|
+
lines: label.lines,
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Break one line to fit `MAX_LABEL_WIDTH`, at spaces where there are any.
|
|
256
|
+
*/
|
|
257
|
+
const wrapLine = (line: string, fontSize: number): string[] => {
|
|
258
|
+
if (measureLine(line, fontSize) <= MAX_LABEL_WIDTH) return [line];
|
|
259
|
+
|
|
260
|
+
const out: string[] = [];
|
|
261
|
+
let current = "";
|
|
262
|
+
for (const word of line.split(/\s+/).filter(Boolean)) {
|
|
263
|
+
const candidate = current ? `${current} ${word}` : word;
|
|
264
|
+
if (current && measureLine(candidate, fontSize) > MAX_LABEL_WIDTH) {
|
|
265
|
+
out.push(current);
|
|
266
|
+
current = word;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
current = candidate;
|
|
270
|
+
}
|
|
271
|
+
if (current) out.push(current);
|
|
272
|
+
|
|
273
|
+
// A single word wider than the cap cannot be wrapped, only cut.
|
|
274
|
+
return out.map((piece) =>
|
|
275
|
+
measureLine(piece, fontSize) > MAX_LABEL_WIDTH
|
|
276
|
+
? truncate(piece, fontSize)
|
|
277
|
+
: piece,
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* How many lines the label WOULD take unwrapped-capped, so a label that
|
|
283
|
+
* exactly fills the cap is not marked as cut.
|
|
284
|
+
*/
|
|
285
|
+
const countWrapped = (lines: string[], fontSize: number): number =>
|
|
286
|
+
lines.reduce((total, line) => total + wrapLine(line, fontSize).length, 0);
|
|
287
|
+
|
|
288
|
+
const truncate = (line: string, fontSize: number): string => {
|
|
289
|
+
const ellipsis = measureLine("\u2026", fontSize);
|
|
290
|
+
let out = "";
|
|
291
|
+
for (const char of line) {
|
|
292
|
+
if (measureLine(out + char, fontSize) + ellipsis > MAX_LABEL_WIDTH) break;
|
|
293
|
+
out += char;
|
|
294
|
+
}
|
|
295
|
+
return `${out}\u2026`;
|
|
296
|
+
};
|
|
@@ -3,17 +3,69 @@ import * as React from "react";
|
|
|
3
3
|
void React;
|
|
4
4
|
|
|
5
5
|
import "./markdown-view.css";
|
|
6
|
+
import { lazy, Suspense } from "react";
|
|
6
7
|
import ReactMarkdown from "react-markdown";
|
|
7
8
|
import rehypeHighlight from "rehype-highlight";
|
|
8
9
|
import remarkGfm from "remark-gfm";
|
|
9
10
|
|
|
11
|
+
import { DiagramErrorBoundary } from "./diagram/DiagramErrorBoundary.tsx";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Parser + `graphre` + emitter, pulled in ONLY when a document actually
|
|
15
|
+
* contains a mermaid fence.
|
|
16
|
+
*
|
|
17
|
+
* This is the constraint the whole diagram layer exists under: a document
|
|
18
|
+
* with no diagram must pay nothing at all. One with a diagram pays roughly
|
|
19
|
+
* 20-25 kB gzip once, then it is cached.
|
|
20
|
+
*
|
|
21
|
+
* ⚠️ A lazy import a bundler decides to inline fails silently: the feature
|
|
22
|
+
* still works and the cost moves into the entry chunk. After changing this,
|
|
23
|
+
* build and confirm `graphre` is in a chunk of its own:
|
|
24
|
+
*
|
|
25
|
+
* yarn w lore build
|
|
26
|
+
* grep -rl addBorderSegments apps/lore/dist/
|
|
27
|
+
*/
|
|
28
|
+
const MermaidFence = lazy(() => import("./diagram/MermaidFence.tsx"));
|
|
29
|
+
|
|
10
30
|
export interface MarkdownViewProps {
|
|
11
31
|
content: string;
|
|
32
|
+
/**
|
|
33
|
+
* Extra classes for the prose root, merged after the defaults so a caller
|
|
34
|
+
* can set its own reading face or measure. The defaults it overrides are
|
|
35
|
+
* `text-sm leading-relaxed` — a surface that sets prose in a display serif
|
|
36
|
+
* needs both, and no parent wrapper can supply them, since they sit on
|
|
37
|
+
* this element rather than being inherited.
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
12
40
|
}
|
|
13
41
|
|
|
14
42
|
/**
|
|
15
43
|
* Renders markdown as formatted prose.
|
|
16
44
|
*
|
|
45
|
+
* ## Diagrams
|
|
46
|
+
*
|
|
47
|
+
* A ` ```mermaid ` fence containing a **`flowchart`** is drawn as an SVG
|
|
48
|
+
* diagram instead of a code block, themed from the app's own CSS variables
|
|
49
|
+
* so dark mode needs no second palette. The renderer is in-house: only
|
|
50
|
+
* layout is imported (`graphre`, dagre in TypeScript, ~15.5 kB gzip), and
|
|
51
|
+
* the whole thing is one lazy chunk pulled in only when a document actually
|
|
52
|
+
* contains a fence, so a document with no diagram pays nothing.
|
|
53
|
+
*
|
|
54
|
+
* The drawn subset is `flowchart TD|TB|LR|RL|BT`; the four node shapes
|
|
55
|
+
* `[rect]` `(rounded)` `{diamond}` `((circle))`, with every other mermaid
|
|
56
|
+
* bracket pair consumed and mapped onto them; edges `-->` `---` `-.->`
|
|
57
|
+
* `==>` `<-->` with labels in both the `-->|text|` and `-- text -->` forms;
|
|
58
|
+
* chains, `&` fans, `<br/>` line breaks and nested `subgraph`.
|
|
59
|
+
*
|
|
60
|
+
* **Everything else degrades to the code block, silently.**
|
|
61
|
+
* `sequenceDiagram`, `classDiagram`, `gantt` and mindmaps are not drawn,
|
|
62
|
+
* `style` / `classDef` are ignored, and a parse failure or a graph past the
|
|
63
|
+
* node cap renders the plain fence rather than an error. Agents write
|
|
64
|
+
* invalid mermaid, and a red box in the middle of a document is worse than
|
|
65
|
+
* a grey fence. See `packages/@alepha/ui/DOC.md` for the full table.
|
|
66
|
+
*
|
|
67
|
+
* ## Raw HTML
|
|
68
|
+
*
|
|
17
69
|
* No raw HTML is ever rendered as markup: react-markdown's default is to
|
|
18
70
|
* escape a raw node to text, and this component deliberately mounts no
|
|
19
71
|
* plugin that changes that. A narrow `rehypeSafeImg` plugin used to promote
|
|
@@ -27,11 +79,20 @@ export interface MarkdownViewProps {
|
|
|
27
79
|
*/
|
|
28
80
|
export const MarkdownView = (props: MarkdownViewProps) => {
|
|
29
81
|
return (
|
|
30
|
-
<div
|
|
82
|
+
<div
|
|
83
|
+
className={`max-w-none text-sm leading-relaxed ${props.className ?? ""}`}
|
|
84
|
+
>
|
|
31
85
|
<ReactMarkdown
|
|
32
86
|
remarkPlugins={[remarkGfm]}
|
|
33
87
|
rehypePlugins={[
|
|
34
|
-
|
|
88
|
+
// `plainText` claims the fence BEFORE highlighting runs: hljs would
|
|
89
|
+
// otherwise tokenise the diagram source, and the fallback would be a
|
|
90
|
+
// soup of spans instead of the text the author wrote.
|
|
91
|
+
//
|
|
92
|
+
// `ignoreMissing` is gone: it no longer exists in v7, where an
|
|
93
|
+
// unknown language already produces a vfile message rather than a
|
|
94
|
+
// throw.
|
|
95
|
+
[rehypeHighlight, { detect: true, plainText: ["mermaid"] }],
|
|
35
96
|
]}
|
|
36
97
|
components={{
|
|
37
98
|
h1: ({ children }) => (
|
|
@@ -58,7 +119,7 @@ export const MarkdownView = (props: MarkdownViewProps) => {
|
|
|
58
119
|
a: ({ href, children }) => (
|
|
59
120
|
<a
|
|
60
121
|
href={href}
|
|
61
|
-
className="text-primary
|
|
122
|
+
className="text-primary decoration-primary/50 hover:decoration-primary underline underline-offset-4"
|
|
62
123
|
>
|
|
63
124
|
{children}
|
|
64
125
|
</a>
|
|
@@ -70,16 +131,32 @@ export const MarkdownView = (props: MarkdownViewProps) => {
|
|
|
70
131
|
return <code className={`${className} text-xs`}>{children}</code>;
|
|
71
132
|
}
|
|
72
133
|
return (
|
|
73
|
-
<code className="bg-muted rounded px-1.5 py-0.5 text-[0.85em]
|
|
134
|
+
<code className="bg-muted rounded px-1.5 py-0.5 font-mono text-[0.85em]">
|
|
74
135
|
{children}
|
|
75
136
|
</code>
|
|
76
137
|
);
|
|
77
138
|
},
|
|
78
|
-
pre: ({ children }) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
139
|
+
pre: ({ children, node }) => {
|
|
140
|
+
const block = (
|
|
141
|
+
<pre className="border-border my-4 overflow-auto rounded-md border bg-transparent p-3 text-xs">
|
|
142
|
+
{children}
|
|
143
|
+
</pre>
|
|
144
|
+
);
|
|
145
|
+
const source = mermaidSource(node);
|
|
146
|
+
if (!source) return block;
|
|
147
|
+
return (
|
|
148
|
+
<DiagramErrorBoundary fallback={block}>
|
|
149
|
+
{/*
|
|
150
|
+
The loading state IS the code block: the fence is already on
|
|
151
|
+
screen, and swapping it for the diagram when the chunk lands
|
|
152
|
+
costs no spinner and no second layout.
|
|
153
|
+
*/}
|
|
154
|
+
<Suspense fallback={block}>
|
|
155
|
+
<MermaidFence source={source} fallback={block} />
|
|
156
|
+
</Suspense>
|
|
157
|
+
</DiagramErrorBoundary>
|
|
158
|
+
);
|
|
159
|
+
},
|
|
83
160
|
blockquote: ({ children }) => (
|
|
84
161
|
<blockquote className="border-muted-foreground/30 my-3 border-l-2 pl-4 italic">
|
|
85
162
|
{children}
|
|
@@ -104,3 +181,45 @@ export const MarkdownView = (props: MarkdownViewProps) => {
|
|
|
104
181
|
</div>
|
|
105
182
|
);
|
|
106
183
|
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The text of a ` ```mermaid ` fence, or `undefined` for every other `<pre>`.
|
|
187
|
+
*
|
|
188
|
+
* Reads the hast node rather than the rendered children because the source
|
|
189
|
+
* has to arrive at the parser exactly as the author typed it, and walking React
|
|
190
|
+
* children would mean reassembling it from whatever the renderer produced.
|
|
191
|
+
*
|
|
192
|
+
* The alternative wiring, a remark plugin, is more code for the same result:
|
|
193
|
+
* `mdast-util-to-hast` applies `data.hName` to the `<code>` element BEFORE
|
|
194
|
+
* wrapping it in `<pre>`, so renaming the code node still leaves the diagram
|
|
195
|
+
* inside this bordered box. Going that way needs a custom node type and a
|
|
196
|
+
* cast into `components`, whose type is keyed on intrinsic elements.
|
|
197
|
+
*/
|
|
198
|
+
const mermaidSource = (node: unknown): string | undefined => {
|
|
199
|
+
const pre = node as
|
|
200
|
+
| {
|
|
201
|
+
children?: Array<{
|
|
202
|
+
type?: string;
|
|
203
|
+
tagName?: string;
|
|
204
|
+
properties?: { className?: unknown };
|
|
205
|
+
children?: Array<{ type?: string; value?: string }>;
|
|
206
|
+
}>;
|
|
207
|
+
}
|
|
208
|
+
| undefined;
|
|
209
|
+
const code = pre?.children?.[0];
|
|
210
|
+
if (code?.type !== "element" || code.tagName !== "code") return undefined;
|
|
211
|
+
|
|
212
|
+
const className = code.properties?.className;
|
|
213
|
+
const names = Array.isArray(className)
|
|
214
|
+
? className.map(String)
|
|
215
|
+
: typeof className === "string"
|
|
216
|
+
? className.split(/\s+/)
|
|
217
|
+
: [];
|
|
218
|
+
if (!names.includes("language-mermaid")) return undefined;
|
|
219
|
+
|
|
220
|
+
const text = code.children
|
|
221
|
+
?.filter((child) => child.type === "text")
|
|
222
|
+
.map((child) => child.value ?? "")
|
|
223
|
+
.join("");
|
|
224
|
+
return text?.trim() ? text : undefined;
|
|
225
|
+
};
|
|
@@ -6,12 +6,15 @@ import {
|
|
|
6
6
|
} from "@alepha/ui/components/app-shell/app-shell";
|
|
7
7
|
import { useRouterState } from "alepha/react/router";
|
|
8
8
|
import { useMemo } from "react";
|
|
9
|
+
|
|
9
10
|
import { isActivePath } from "./nav-tree-util.ts";
|
|
10
11
|
import { useNavBreadcrumbs } from "./use-nav-breadcrumbs.ts";
|
|
11
12
|
import { useNavTree } from "./use-nav-tree.ts";
|
|
12
13
|
|
|
13
|
-
export interface NavShellProps
|
|
14
|
-
|
|
14
|
+
export interface NavShellProps extends Omit<
|
|
15
|
+
AppShellProps,
|
|
16
|
+
"nav" | "breadcrumbs"
|
|
17
|
+
> {
|
|
15
18
|
/**
|
|
16
19
|
* Route name that anchors this shell — typically the layout `$page` mounted
|
|
17
20
|
* at the shell's base path (e.g. `/admin`). The sidebar and breadcrumbs are
|
|
@@ -20,7 +23,7 @@ export interface NavShellProps
|
|
|
20
23
|
*/
|
|
21
24
|
root: string;
|
|
22
25
|
/**
|
|
23
|
-
*
|
|
26
|
+
* Extra nav groups appended after the route-derived ones, for entries that
|
|
24
27
|
* don't map to routes (external links, grouped sub-menus). Their `active`
|
|
25
28
|
* state is computed from the current path (matching `href`), so callers only
|
|
26
29
|
* supply structure. Most shells won't need this.
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
useMemo,
|
|
16
16
|
useState,
|
|
17
17
|
} from "react";
|
|
18
|
+
|
|
18
19
|
import { type NavEntry, useNavEntries } from "./use-nav-entries.ts";
|
|
19
20
|
|
|
20
21
|
export interface SpotlightProps {
|
|
@@ -102,7 +103,7 @@ export const Spotlight = (props: SpotlightProps) => {
|
|
|
102
103
|
(entry: NavEntry) => {
|
|
103
104
|
if (entry.disabled) return;
|
|
104
105
|
setOpen(false);
|
|
105
|
-
router.push(entry.name);
|
|
106
|
+
void router.push(entry.name);
|
|
106
107
|
},
|
|
107
108
|
[router, setOpen],
|
|
108
109
|
);
|
|
@@ -2,6 +2,7 @@ import { useAuth } from "alepha/react/auth";
|
|
|
2
2
|
import { useRouter, useRouterState } from "alepha/react/router";
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
|
+
|
|
5
6
|
import {
|
|
6
7
|
hasNavPermission,
|
|
7
8
|
isActivePath,
|
|
@@ -24,21 +25,31 @@ export interface UseNavEntriesOptions {
|
|
|
24
25
|
* ({@link Spotlight}) so both stay in sync from one source.
|
|
25
26
|
*/
|
|
26
27
|
export interface NavEntry {
|
|
27
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Route name — used for navigation (`router.push(name)`) and as a stable key.
|
|
30
|
+
*/
|
|
28
31
|
name: string;
|
|
29
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Resolved pathname (the page's full `match`).
|
|
34
|
+
*/
|
|
30
35
|
href: string;
|
|
31
36
|
label: ReactNode;
|
|
32
37
|
icon?: ReactNode;
|
|
33
38
|
group?: string;
|
|
34
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* `nav.order` within the group.
|
|
41
|
+
*/
|
|
35
42
|
order: number;
|
|
36
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Smallest `order` in this entry's group — drives group ordering.
|
|
45
|
+
*/
|
|
37
46
|
groupOrder: number;
|
|
38
47
|
keywords?: string[];
|
|
39
48
|
description?: ReactNode;
|
|
40
49
|
badge?: ReactNode;
|
|
41
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* `can()` returned `"disabled"` — show muted, block navigation.
|
|
52
|
+
*/
|
|
42
53
|
disabled: boolean;
|
|
43
54
|
/**
|
|
44
55
|
* The current route is on or under this entry, and no sibling entry matched
|
|
@@ -4,6 +4,7 @@ import { AlephaContext } from "alepha/react";
|
|
|
4
4
|
import { AlephaReactRouter } from "alepha/react/router";
|
|
5
5
|
import { setupJsdomMocks } from "alepha/react/testing";
|
|
6
6
|
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
7
|
+
|
|
7
8
|
import { SettingsNav, type SettingsNavItem } from "../settings-nav.tsx";
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { render, screen } from "@testing-library/react";
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
3
4
|
import { SettingsDangerSection } from "../settings-danger-section.tsx";
|
|
4
5
|
import { SettingsRow } from "../settings-row.tsx";
|
|
5
6
|
import { SettingsSection } from "../settings-section.tsx";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The edge every settings card wears: a single 1px border, a 10px radius and
|
|
3
|
+
* the soft drop shadow. Padding is deliberately NOT in here: a row card, a
|
|
4
|
+
* table card and a form card each carry their own, and only the edge has to
|
|
5
|
+
* agree.
|
|
6
|
+
*
|
|
7
|
+
* It is a shared constant because the hand-written version had already drifted
|
|
8
|
+
* four ways across ten call sites: `py-4 shadow`, `py-3 shadow`, bare `shadow`
|
|
9
|
+
* and bare `<Card>`, so a settings page could show two cards side by side with
|
|
10
|
+
* visibly different edges (`/settings/kanban` had a 1px-bordered card directly
|
|
11
|
+
* above a borderless 14px-radius one).
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ **`ring-0` is the load-bearing part.** `Card` draws its own edge with
|
|
14
|
+
* `ring-1 ring-foreground/10` and no border at all. Adding `border` without
|
|
15
|
+
* cancelling that ring does not replace the edge, it stacks a second one
|
|
16
|
+
* outside the first, and the card reads a pixel heavier than everything built
|
|
17
|
+
* the other way. Every historical variant here got that wrong in one direction
|
|
18
|
+
* or the other.
|
|
19
|
+
*
|
|
20
|
+
* `Card` itself cannot carry this: it lives in `components/ui/`, which
|
|
21
|
+
* `yarn w @alepha/ui sync` overwrites wholesale from the upstream registry, so
|
|
22
|
+
* a patch there vanishes on the next refresh.
|
|
23
|
+
*/
|
|
24
|
+
export const settingsCardEdge = "bg-card rounded-lg border shadow-sm ring-0";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { settingsCardEdge } from "@alepha/ui/components/settings/settings-card-edge.ts";
|
|
1
2
|
import { Card } from "@alepha/ui/components/ui/card";
|
|
2
3
|
import { cn } from "@alepha/ui/lib/utils";
|
|
3
4
|
import type { ReactNode } from "react";
|
|
@@ -51,7 +52,12 @@ export const SettingsDangerSection = (props: SettingsDangerSectionProps) => {
|
|
|
51
52
|
</span>
|
|
52
53
|
) : null}
|
|
53
54
|
</div>
|
|
54
|
-
<Card
|
|
55
|
+
<Card
|
|
56
|
+
className={cn(
|
|
57
|
+
settingsCardEdge,
|
|
58
|
+
"divide-destructive/20 border-destructive/30 gap-0 divide-y py-0",
|
|
59
|
+
)}
|
|
60
|
+
>
|
|
55
61
|
{props.children}
|
|
56
62
|
</Card>
|
|
57
63
|
</div>
|
|
@@ -104,7 +104,22 @@ export const SettingsLayout = (props: SettingsLayoutProps) => {
|
|
|
104
104
|
<div
|
|
105
105
|
className={cn(
|
|
106
106
|
"flex min-w-0 flex-1 flex-col gap-8",
|
|
107
|
-
|
|
107
|
+
// `md:px-2 md:-mx-2` is not spacing, it is clip headroom, and it
|
|
108
|
+
// only exists because of the `overflow-y-auto` on the same line.
|
|
109
|
+
//
|
|
110
|
+
// An element with `overflow-y: auto` cannot keep `overflow-x:
|
|
111
|
+
// visible`, CSS computes the visible axis to `auto`, so this
|
|
112
|
+
// column becomes a horizontal clipping box too. The cards inside
|
|
113
|
+
// are exactly as wide as it is, which puts their edges on the clip
|
|
114
|
+
// boundary; a border survives that (it is inside the border box)
|
|
115
|
+
// but a ring or a `shadow-sm` does not, and the cards came out
|
|
116
|
+
// looking shaved down both sides.
|
|
117
|
+
//
|
|
118
|
+
// The padding moves the boundary out from under the cards and the
|
|
119
|
+
// equal negative margin takes the width straight back, so nothing
|
|
120
|
+
// moves and nothing narrows. Plain padding would have fixed the
|
|
121
|
+
// clipping by making every card 16px narrower instead.
|
|
122
|
+
props.fill && "md:-mx-2 md:min-h-0 md:overflow-y-auto md:px-2",
|
|
108
123
|
)}
|
|
109
124
|
>
|
|
110
125
|
{props.children}
|