@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,181 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { Button } from "@alepha/ui/components/ui/button";
|
|
6
|
+
import { Segmented } from "@alepha/ui/components/ui/segmented";
|
|
7
|
+
import { Skeleton } from "@alepha/ui/components/ui/skeleton";
|
|
8
|
+
import { ArrowLeft } from "lucide-react";
|
|
9
|
+
import type { ComponentType, SVGProps } from "react";
|
|
10
|
+
|
|
11
|
+
type IconType = ComponentType<SVGProps<SVGSVGElement>>;
|
|
12
|
+
|
|
13
|
+
export interface DetailTab {
|
|
14
|
+
value: string;
|
|
15
|
+
label: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Rendered at `size-4` before the label. Passed as a component rather than
|
|
18
|
+
* an element so callers hand over data — every detail page used to repeat
|
|
19
|
+
* the same `inline-flex items-center gap-1.5` wrapper by hand.
|
|
20
|
+
*/
|
|
21
|
+
icon?: IconType;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface DetailNotFound {
|
|
25
|
+
message: string;
|
|
26
|
+
backLabel: string;
|
|
27
|
+
onBack: () => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface DetailLayoutProps {
|
|
31
|
+
/**
|
|
32
|
+
* The identity panel. Usually an {@link DetailAside}.
|
|
33
|
+
*/
|
|
34
|
+
aside: React.ReactNode;
|
|
35
|
+
tabs: DetailTab[];
|
|
36
|
+
tab: string;
|
|
37
|
+
onTabChange: (value: string) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Buttons for the right end of the toolbar.
|
|
40
|
+
*
|
|
41
|
+
* Size them `lg`. `Segmented`'s size tokens are cut to match a `<Button>`
|
|
42
|
+
* of the same token exactly, the tab selector on the left of this bar is
|
|
43
|
+
* `lg`, and nothing here can size what a caller passes: a `sm` button
|
|
44
|
+
* beside it is 28px against 36px, both centred in a 56px bar, and the two
|
|
45
|
+
* ends of the toolbar stop lining up.
|
|
46
|
+
*/
|
|
47
|
+
actions?: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Replaces the whole shell with a skeleton. Pass it only for the first load —
|
|
50
|
+
* a refetch that blanks the page an operator is reading is a regression, so
|
|
51
|
+
* a caller should gate this on "loading **and** no data yet".
|
|
52
|
+
*/
|
|
53
|
+
loading?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Replaces the whole shell with a message and a way back.
|
|
56
|
+
*/
|
|
57
|
+
notFound?: DetailNotFound;
|
|
58
|
+
children?: React.ReactNode;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The shell every detail page shares: a full-height identity aside, and a
|
|
63
|
+
* right column whose toolbar carries tab selection on the left and actions on
|
|
64
|
+
* the right.
|
|
65
|
+
*
|
|
66
|
+
* It lived at `components/admin/admin-detail-layout` while admin pages were
|
|
67
|
+
* its only consumers, and moved here when Lore's Epic page became the first
|
|
68
|
+
* one outside admin. Nothing about it was ever admin-specific — it imports a
|
|
69
|
+
* button, a segmented control and a skeleton — so the old name described the
|
|
70
|
+
* callers rather than the component. There is deliberately **no re-export
|
|
71
|
+
* left behind at the old path**: an alias nobody is forced to notice is an
|
|
72
|
+
* alias nobody removes.
|
|
73
|
+
*
|
|
74
|
+
* It owns the chrome and nothing else. Data, forms and mutations stay in the
|
|
75
|
+
* page that composes it, and each tab body is its own component that renders
|
|
76
|
+
* what it is given — the split that keeps a detail page from growing into one
|
|
77
|
+
* unreadable file.
|
|
78
|
+
*
|
|
79
|
+
* The aside is hidden below `md`. A phone gets the tabs full width rather than
|
|
80
|
+
* a 288px column and a sliver of content; the same facts are reachable from
|
|
81
|
+
* the tab bodies.
|
|
82
|
+
*
|
|
83
|
+
* ```tsx
|
|
84
|
+
* const [tab, setTab] = useDetailTab<"overview" | "stock">("overview");
|
|
85
|
+
*
|
|
86
|
+
* <DetailLayout
|
|
87
|
+
* aside={<DetailAside title={product.name} rows={rows} />}
|
|
88
|
+
* tabs={[{ value: "overview", label: "Overview", icon: Package }]}
|
|
89
|
+
* tab={tab}
|
|
90
|
+
* onTabChange={(v) => setTab(v as typeof tab)}
|
|
91
|
+
* actions={<Button size="sm">Publish</Button>}
|
|
92
|
+
* >
|
|
93
|
+
* {tab === "overview" && <OverviewTab product={product} />}
|
|
94
|
+
* </DetailLayout>
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* Dialogs belong beside it, not inside `children` — they portal out anyway,
|
|
98
|
+
* and nesting them in the tab body unmounts them on a tab switch.
|
|
99
|
+
*/
|
|
100
|
+
export const DetailLayout = (props: DetailLayoutProps) => {
|
|
101
|
+
if (props.loading) {
|
|
102
|
+
return (
|
|
103
|
+
<div className="flex flex-col gap-4 p-6">
|
|
104
|
+
<Skeleton className="h-10 w-72" />
|
|
105
|
+
<Skeleton className="h-40 w-full" />
|
|
106
|
+
<Skeleton className="h-40 w-full" />
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (props.notFound) {
|
|
112
|
+
return (
|
|
113
|
+
<div className="flex flex-col items-start gap-3 p-6">
|
|
114
|
+
<p className="text-muted-foreground text-sm">
|
|
115
|
+
{props.notFound.message}
|
|
116
|
+
</p>
|
|
117
|
+
<Button variant="outline" onClick={props.notFound.onBack}>
|
|
118
|
+
<ArrowLeft className="size-4" />
|
|
119
|
+
{props.notFound.backLabel}
|
|
120
|
+
</Button>
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const options = props.tabs.map((entry) => {
|
|
126
|
+
const Icon = entry.icon;
|
|
127
|
+
return {
|
|
128
|
+
value: entry.value,
|
|
129
|
+
label: Icon ? (
|
|
130
|
+
<span className="inline-flex items-center gap-1.5">
|
|
131
|
+
<Icon className="size-4" />
|
|
132
|
+
{entry.label}
|
|
133
|
+
</span>
|
|
134
|
+
) : (
|
|
135
|
+
entry.label
|
|
136
|
+
),
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<div className="flex h-full min-h-0 flex-1 overflow-hidden">
|
|
142
|
+
{/* `p-4`, not `p-6`. The aside is a fixed 288px, so its padding comes
|
|
143
|
+
straight out of the identity panel's width: at 24px a side the
|
|
144
|
+
`DetailAside` card had 240px to fit a label, a value and sometimes
|
|
145
|
+
a copy button, and read as undersized in a column that had room to
|
|
146
|
+
spare. 16px gives it back 16px of card without letting the content
|
|
147
|
+
touch the border. */}
|
|
148
|
+
<aside className="border-border bg-background hidden w-72 shrink-0 flex-col gap-4 overflow-auto border-r p-4 md:flex">
|
|
149
|
+
{props.aside}
|
|
150
|
+
</aside>
|
|
151
|
+
|
|
152
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
153
|
+
<div className="bg-background flex h-14 shrink-0 items-center gap-2 border-b px-4">
|
|
154
|
+
{/* `lg` (h-9), not the `sm` (h-7) this started on. The toolbar is
|
|
155
|
+
`h-14`, so at 28px the control filled exactly half of it and
|
|
156
|
+
read as a small thing floating in a tall bar.
|
|
157
|
+
|
|
158
|
+
This does give up the pixel-for-pixel match with the toolbar's
|
|
159
|
+
action buttons: all three consumers pass `size="sm"`, so the
|
|
160
|
+
two were the same 28px before and are 28 vs 36 now. The match
|
|
161
|
+
only ever held because both happened to pick the same token,
|
|
162
|
+
and `actions` is caller JSX this component cannot size, so any
|
|
163
|
+
increase here breaks it. Both are centred in a 56px bar, which
|
|
164
|
+
is why 8px of difference does not show. */}
|
|
165
|
+
<Segmented
|
|
166
|
+
size="lg"
|
|
167
|
+
options={options}
|
|
168
|
+
value={props.tab}
|
|
169
|
+
onChange={props.onTabChange}
|
|
170
|
+
/>
|
|
171
|
+
{props.actions ? (
|
|
172
|
+
<div className="ml-auto flex items-center gap-2">
|
|
173
|
+
{props.actions}
|
|
174
|
+
</div>
|
|
175
|
+
) : null}
|
|
176
|
+
</div>
|
|
177
|
+
{props.children}
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "alepha";
|
|
2
|
+
import { useQueryParams } from "alepha/react/router";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `.tsx` despite holding no JSX, like `use-confirmed-action.tsx` beside it.
|
|
7
|
+
* This package's `exports` map resolves `./components/*` to `*.tsx` only, so a
|
|
8
|
+
* `.ts` file here is reachable by a relative import within `@alepha/ui` and by
|
|
9
|
+
* nothing outside it — and `@alepha/commerce` imports this hook.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Module scope so its identity stays stable across renders — `useQueryParams`
|
|
14
|
+
* anchors on it, and a fresh reference each render would re-decode for nothing.
|
|
15
|
+
*/
|
|
16
|
+
const tabSchema = z.object({ tab: z.string().optional() });
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Binds a detail page's selected tab to `?tab=<key>`.
|
|
20
|
+
*
|
|
21
|
+
* `format: "querystring"` makes `useQueryParams` write with `replaceState`, so
|
|
22
|
+
* clicking through four tabs does not bury the page the operator arrived from
|
|
23
|
+
* under four history entries. The URL still carries the tab, which is what
|
|
24
|
+
* makes a deep link to "that user's sessions" shareable.
|
|
25
|
+
*
|
|
26
|
+
* The generic is the union of valid keys, so a caller gets `"overview" |
|
|
27
|
+
* "stock"` back rather than `string`. An unknown `?tab=` value in the URL is
|
|
28
|
+
* not validated here — it falls through to whatever the page renders for an
|
|
29
|
+
* unmatched key, the same way a hand-edited query param always could.
|
|
30
|
+
*/
|
|
31
|
+
export const useDetailTab = <T extends string>(
|
|
32
|
+
defaultTab: T,
|
|
33
|
+
): [T, (next: T) => void] => {
|
|
34
|
+
const [query, setQuery] = useQueryParams(tabSchema, {
|
|
35
|
+
format: "querystring",
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const setTab = useCallback((next: T) => setQuery({ tab: next }), [setQuery]);
|
|
39
|
+
|
|
40
|
+
return [(query.tab as T | undefined) ?? defaultTab, setTab];
|
|
41
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode, useState } from "react";
|
|
2
2
|
|
|
3
|
-
export interface FileImageProps
|
|
4
|
-
|
|
3
|
+
export interface FileImageProps extends Omit<
|
|
4
|
+
ComponentProps<"img">,
|
|
5
|
+
"src" | "id"
|
|
6
|
+
> {
|
|
5
7
|
/**
|
|
6
8
|
* File id (uuid) served by the Alepha files module. Absent → renders
|
|
7
9
|
* `fallback`. (Repurposes the `id` slot — the raw HTML `id` attribute
|
|
@@ -31,7 +31,7 @@ const labelFor = (code: string) =>
|
|
|
31
31
|
* user switch. Reads the active language and the registered list directly from
|
|
32
32
|
* `useI18n()`, so it stays in sync without extra wiring.
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export const LanguageToggle = () => {
|
|
35
35
|
const i18n = useI18n();
|
|
36
36
|
const languages = i18n.languages;
|
|
37
37
|
|
|
@@ -63,4 +63,4 @@ export function LanguageToggle() {
|
|
|
63
63
|
</DropdownMenuContent>
|
|
64
64
|
</DropdownMenu>
|
|
65
65
|
);
|
|
66
|
-
}
|
|
66
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { render, screen, waitFor } from "@testing-library/react";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
import { MarkdownView } from "../markdown-view.tsx";
|
|
5
|
+
|
|
6
|
+
const fence = (language: string, body: string) =>
|
|
7
|
+
["```" + language, body, "```"].join("\n");
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The wiring, not the renderer: the three layers under `diagram/` have their
|
|
11
|
+
* own specs. What is pinned here is that a mermaid fence is CLAIMED before
|
|
12
|
+
* `rehype-highlight` sees it, that every way of failing lands back on the
|
|
13
|
+
* grey code block, and that no other fence changed.
|
|
14
|
+
*/
|
|
15
|
+
describe("MarkdownView - mermaid fences", () => {
|
|
16
|
+
it("renders a flowchart fence as an svg", async () => {
|
|
17
|
+
const { container } = render(
|
|
18
|
+
<MarkdownView
|
|
19
|
+
content={fence("mermaid", "flowchart TD\n A[Go] --> B")}
|
|
20
|
+
/>,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
await waitFor(() => expect(container.querySelector("svg")).not.toBeNull());
|
|
24
|
+
expect(container.textContent).toContain("Go");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("keeps the prose and the fence area occupied on the first paint", () => {
|
|
28
|
+
const { container } = render(
|
|
29
|
+
<MarkdownView
|
|
30
|
+
content={`# Title\n\n${fence("mermaid", "flowchart TD\n A --> B")}`}
|
|
31
|
+
/>,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
// Synchronously, before any chunk can have resolved. The Suspense
|
|
35
|
+
// boundary is around the one fence, not the document, so the heading is
|
|
36
|
+
// there; and its fallback IS the code block, so the fence area is
|
|
37
|
+
// occupied by either the `pre` or the `svg` - never a spinner, never a
|
|
38
|
+
// blank that would jump when the diagram arrives.
|
|
39
|
+
//
|
|
40
|
+
// Deliberately not asserting `pre` specifically: React's `lazy` caches
|
|
41
|
+
// the module, so after the first render in a process the diagram is
|
|
42
|
+
// there immediately, and pinning `pre` would make this pass or fail on
|
|
43
|
+
// test ORDER rather than on behaviour.
|
|
44
|
+
expect(container.querySelector("h1")).not.toBeNull();
|
|
45
|
+
expect(container.querySelector("pre, svg")).not.toBeNull();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("falls back to the code block for a malformed diagram", async () => {
|
|
49
|
+
const { container } = render(
|
|
50
|
+
<MarkdownView content={fence("mermaid", "flowchart TD\n ((((")} />,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
await waitFor(() => expect(container.querySelector("pre")).not.toBeNull());
|
|
54
|
+
expect(container.querySelector("svg")).toBeNull();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("falls back to the code block for a diagram type outside the subset", async () => {
|
|
58
|
+
const { container } = render(
|
|
59
|
+
<MarkdownView
|
|
60
|
+
content={fence("mermaid", "sequenceDiagram\n A ->> B: hi")}
|
|
61
|
+
/>,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
await waitFor(() => expect(container.querySelector("pre")).not.toBeNull());
|
|
65
|
+
expect(container.querySelector("svg")).toBeNull();
|
|
66
|
+
expect(container.textContent).toContain("sequenceDiagram");
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("keeps the diagram source readable in the fallback", async () => {
|
|
70
|
+
const { container } = render(
|
|
71
|
+
<MarkdownView content={fence("mermaid", "gantt\n title X")} />,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
await waitFor(() => expect(container.querySelector("pre")).not.toBeNull());
|
|
75
|
+
expect(container.textContent).toContain("title X");
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("leaves the mermaid fence unhighlighted", () => {
|
|
79
|
+
const { container } = render(
|
|
80
|
+
<MarkdownView content={fence("mermaid", "flowchart TD\n A --> B")} />,
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// `plainText: ["mermaid"]` - hljs must not tokenise the diagram source,
|
|
84
|
+
// or the fallback is a soup of spans instead of the text the author wrote.
|
|
85
|
+
expect(container.querySelector("code.hljs")).toBeNull();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("still highlights an ordinary code fence", () => {
|
|
89
|
+
const { container } = render(
|
|
90
|
+
<MarkdownView content={fence("ts", "const a: number = 1;")} />,
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
const code = container.querySelector("pre code");
|
|
94
|
+
expect(code?.className).toContain("language-ts");
|
|
95
|
+
expect(container.querySelectorAll("pre code span").length).toBeGreaterThan(
|
|
96
|
+
0,
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("still renders a fence with no language as a plain code block", () => {
|
|
101
|
+
const { container } = render(
|
|
102
|
+
<MarkdownView content={fence("", "just text")} />,
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
expect(container.querySelector("pre")).not.toBeNull();
|
|
106
|
+
expect(container.querySelector("svg")).toBeNull();
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("renders prose around the diagram", async () => {
|
|
110
|
+
const { container } = render(
|
|
111
|
+
<MarkdownView
|
|
112
|
+
content={`# Title\n\n${fence("mermaid", "flowchart TD\n A --> B")}\n\nAfter.`}
|
|
113
|
+
/>,
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
await waitFor(() => expect(container.querySelector("svg")).not.toBeNull());
|
|
117
|
+
expect(screen.getByRole("heading", { level: 1 }).textContent).toBe("Title");
|
|
118
|
+
expect(container.textContent).toContain("After.");
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("renders two diagrams on one page", async () => {
|
|
122
|
+
const { container } = render(
|
|
123
|
+
<MarkdownView
|
|
124
|
+
content={[
|
|
125
|
+
fence("mermaid", "flowchart TD\n A --> B"),
|
|
126
|
+
fence("mermaid", "flowchart LR\n C --> D"),
|
|
127
|
+
].join("\n\n")}
|
|
128
|
+
/>,
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
await waitFor(() =>
|
|
132
|
+
expect(container.querySelectorAll("svg")).toHaveLength(2),
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it("falls back rather than laying out a graph past the cap", async () => {
|
|
137
|
+
const huge = [
|
|
138
|
+
"flowchart TD",
|
|
139
|
+
...Array.from({ length: 400 }, (_, i) => ` n${i} --> n${i + 1}`),
|
|
140
|
+
].join("\n");
|
|
141
|
+
const { container } = render(
|
|
142
|
+
<MarkdownView content={fence("mermaid", huge)} />,
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
await waitFor(() => expect(container.querySelector("pre")).not.toBeNull());
|
|
146
|
+
expect(container.querySelector("svg")).toBeNull();
|
|
147
|
+
});
|
|
148
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { Component, type ReactNode } from "react";
|
|
6
|
+
|
|
7
|
+
export interface DiagramErrorBoundaryProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Rendered instead of the children once anything below has thrown.
|
|
11
|
+
*/
|
|
12
|
+
fallback: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface DiagramErrorBoundaryState {
|
|
16
|
+
failed: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Renders the code block instead of the diagram if anything below throws.
|
|
21
|
+
*
|
|
22
|
+
* The three layers all refuse rather than throw, so this should never fire,
|
|
23
|
+
* which is exactly why it exists. `MarkdownView` is mounted on every quest,
|
|
24
|
+
* epic, comment and folio in the app, and a bug in the emitter must cost the
|
|
25
|
+
* one fence it is drawing, never the page it sits on.
|
|
26
|
+
*
|
|
27
|
+
* A class is not a style choice here: `componentDidCatch` has no hook.
|
|
28
|
+
*/
|
|
29
|
+
export class DiagramErrorBoundary extends Component<
|
|
30
|
+
DiagramErrorBoundaryProps,
|
|
31
|
+
DiagramErrorBoundaryState
|
|
32
|
+
> {
|
|
33
|
+
state: DiagramErrorBoundaryState = { failed: false };
|
|
34
|
+
|
|
35
|
+
static getDerivedStateFromError(): DiagramErrorBoundaryState {
|
|
36
|
+
return { failed: true };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
render() {
|
|
40
|
+
return this.state.failed ? this.props.fallback : this.props.children;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { useId } from "react";
|
|
6
|
+
|
|
7
|
+
import { FlowchartDiagramCluster } from "./FlowchartDiagramCluster.tsx";
|
|
8
|
+
import { FlowchartDiagramEdge } from "./FlowchartDiagramEdge.tsx";
|
|
9
|
+
import { FlowchartDiagramNode } from "./FlowchartDiagramNode.tsx";
|
|
10
|
+
import type { PositionedGraph } from "./layoutFlowchart.ts";
|
|
11
|
+
import { DIAGRAM_FONT_FAMILY } from "./textMetrics.ts";
|
|
12
|
+
|
|
13
|
+
export interface FlowchartDiagramProps {
|
|
14
|
+
graph: PositionedGraph;
|
|
15
|
+
/**
|
|
16
|
+
* Read out to assistive technology as the diagram's name.
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Draw a laid-out flowchart as themed SVG.
|
|
23
|
+
*
|
|
24
|
+
* ## React elements, not an HTML string, and this is not negotiable
|
|
25
|
+
*
|
|
26
|
+
* `markdown-view.tsx` carries an explicit rule that no raw HTML is ever
|
|
27
|
+
* promoted to markup, because it renders one user's content to another and
|
|
28
|
+
* every raw tag would turn every markdown surface in every app into an
|
|
29
|
+
* injection point. Emitting React elements means labels are escaped by React
|
|
30
|
+
* itself and `dangerouslySetInnerHTML` never appears on this path. Read that
|
|
31
|
+
* comment before "optimising" this into a string.
|
|
32
|
+
*
|
|
33
|
+
* ## Theming is the point
|
|
34
|
+
*
|
|
35
|
+
* Colours come from `--primary`, `--border`, `--muted-foreground`, `--card`
|
|
36
|
+
* and `--muted` through `var(...)`, so dark mode works with no second
|
|
37
|
+
* palette and no theme prop. That is the thing mermaid can structurally
|
|
38
|
+
* never give us, and the whole reason drawing is our own code rather than a
|
|
39
|
+
* cost.
|
|
40
|
+
*
|
|
41
|
+
* ## The font is pinned, never inherited
|
|
42
|
+
*
|
|
43
|
+
* Folio view mode and the quest description set prose in Literata at 16.5px,
|
|
44
|
+
* lazy-loaded after first paint; every other surface is Inter. The width
|
|
45
|
+
* table in `textMetrics.ts` is generated against Inter at
|
|
46
|
+
* `DIAGRAM_FONT_SIZE`, so inheriting would make text and box disagree per
|
|
47
|
+
* surface and shift when the serif arrives.
|
|
48
|
+
*/
|
|
49
|
+
export const FlowchartDiagram = (props: FlowchartDiagramProps) => {
|
|
50
|
+
const graph = props.graph;
|
|
51
|
+
// SVG marker ids are global to the document: two diagrams on one page with
|
|
52
|
+
// the same arrowhead id fight, and the loser's arrows vanish.
|
|
53
|
+
const scope = useId().replace(/[^\w-]/g, "");
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<svg
|
|
57
|
+
role="img"
|
|
58
|
+
viewBox={`0 0 ${round(graph.width)} ${round(graph.height)}`}
|
|
59
|
+
// No `width`: the diagram scales to its container, and `max-width`
|
|
60
|
+
// stops a two-node graph being blown up to the full column.
|
|
61
|
+
style={{ maxWidth: `${round(graph.width)}px`, height: "auto" }}
|
|
62
|
+
className="my-4 block w-full"
|
|
63
|
+
// camelCase, not `font-family` / `font-size`: React renders these as
|
|
64
|
+
// the hyphenated SVG presentation attributes either way, but the
|
|
65
|
+
// hyphenated spelling is an "Invalid DOM property" warning on every
|
|
66
|
+
// render - noise in a component mounted on every markdown surface in
|
|
67
|
+
// the app.
|
|
68
|
+
fontFamily={DIAGRAM_FONT_FAMILY}
|
|
69
|
+
fontSize={graph.fontSize}
|
|
70
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
71
|
+
>
|
|
72
|
+
<title>{props.title ?? "Flowchart diagram"}</title>
|
|
73
|
+
<defs>
|
|
74
|
+
<marker
|
|
75
|
+
id={`${scope}-arrow-end`}
|
|
76
|
+
markerWidth="9"
|
|
77
|
+
markerHeight="7"
|
|
78
|
+
refX="8"
|
|
79
|
+
refY="3.5"
|
|
80
|
+
orient="auto"
|
|
81
|
+
markerUnits="userSpaceOnUse"
|
|
82
|
+
>
|
|
83
|
+
{/*
|
|
84
|
+
`context-stroke`, not `currentColor`. A marker lives in `<defs>`,
|
|
85
|
+
so `currentColor` resolves against the MARKER's inherited colour,
|
|
86
|
+
not the edge's - the arrowhead came out `--foreground` while its
|
|
87
|
+
line was `--muted-foreground`, and in a differently-themed
|
|
88
|
+
container it was the wrong colour outright.
|
|
89
|
+
*/}
|
|
90
|
+
<path d="M0,0 L9,3.5 L0,7 z" fill="context-stroke" />
|
|
91
|
+
</marker>
|
|
92
|
+
<marker
|
|
93
|
+
id={`${scope}-arrow-start`}
|
|
94
|
+
markerWidth="9"
|
|
95
|
+
markerHeight="7"
|
|
96
|
+
refX="1"
|
|
97
|
+
refY="3.5"
|
|
98
|
+
orient="auto-start-reverse"
|
|
99
|
+
markerUnits="userSpaceOnUse"
|
|
100
|
+
>
|
|
101
|
+
<path d="M0,0 L9,3.5 L0,7 z" fill="context-stroke" />
|
|
102
|
+
</marker>
|
|
103
|
+
</defs>
|
|
104
|
+
|
|
105
|
+
{/*
|
|
106
|
+
Order IS z-order in SVG, so clusters (sorted outermost first by the
|
|
107
|
+
layout adapter) go down first, then edges, then nodes on top. No
|
|
108
|
+
z-index anywhere, and nothing to keep in sync.
|
|
109
|
+
*/}
|
|
110
|
+
{graph.clusters.map((cluster) => (
|
|
111
|
+
<FlowchartDiagramCluster key={cluster.id} cluster={cluster} />
|
|
112
|
+
))}
|
|
113
|
+
{graph.edges.map((edge, index) => (
|
|
114
|
+
<FlowchartDiagramEdge
|
|
115
|
+
key={`${edge.from}->${edge.to}#${index}`}
|
|
116
|
+
edge={edge}
|
|
117
|
+
scope={scope}
|
|
118
|
+
fontSize={graph.fontSize}
|
|
119
|
+
/>
|
|
120
|
+
))}
|
|
121
|
+
{graph.nodes.map((node) => (
|
|
122
|
+
<FlowchartDiagramNode
|
|
123
|
+
key={node.id}
|
|
124
|
+
node={node}
|
|
125
|
+
fontSize={graph.fontSize}
|
|
126
|
+
/>
|
|
127
|
+
))}
|
|
128
|
+
</svg>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Two decimals is plenty for a diagram and keeps the emitted attributes
|
|
134
|
+
* readable; graphre's raw coordinates carry a dozen.
|
|
135
|
+
*/
|
|
136
|
+
export const round = (value: number): number => Math.round(value * 100) / 100;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { round } from "./FlowchartDiagram.tsx";
|
|
6
|
+
import type { PositionedCluster } from "./layoutFlowchart.ts";
|
|
7
|
+
import { DIAGRAM_FONT_SIZE } from "./textMetrics.ts";
|
|
8
|
+
|
|
9
|
+
export interface FlowchartDiagramClusterProps {
|
|
10
|
+
cluster: PositionedCluster;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* One `subgraph` box, drawn behind its members.
|
|
15
|
+
*
|
|
16
|
+
* The fill alpha grows with nesting depth so an inner cluster reads as
|
|
17
|
+
* inside its parent rather than beside it. `--muted` at a low alpha is dark
|
|
18
|
+
* on light and light on dark, so one value works in both themes.
|
|
19
|
+
*/
|
|
20
|
+
export const FlowchartDiagramCluster = (
|
|
21
|
+
props: FlowchartDiagramClusterProps,
|
|
22
|
+
) => {
|
|
23
|
+
const cluster = props.cluster;
|
|
24
|
+
const x = round(cluster.x);
|
|
25
|
+
const y = round(cluster.y);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<g data-cluster={cluster.id}>
|
|
29
|
+
<rect
|
|
30
|
+
data-cluster={cluster.id}
|
|
31
|
+
x={x}
|
|
32
|
+
y={y}
|
|
33
|
+
width={round(cluster.width)}
|
|
34
|
+
height={round(cluster.height)}
|
|
35
|
+
rx={8}
|
|
36
|
+
ry={8}
|
|
37
|
+
fill="var(--muted)"
|
|
38
|
+
fillOpacity={Math.min(0.35 + cluster.depth * 0.2, 0.8)}
|
|
39
|
+
stroke="var(--border)"
|
|
40
|
+
strokeWidth={1}
|
|
41
|
+
strokeDasharray="4 3"
|
|
42
|
+
/>
|
|
43
|
+
{/*
|
|
44
|
+
Top-left, just inside the box, on the same baseline arithmetic the
|
|
45
|
+
node labels use. A cluster title is a single line by construction:
|
|
46
|
+
the parser never splits it.
|
|
47
|
+
*/}
|
|
48
|
+
<text
|
|
49
|
+
x={round(x + 10)}
|
|
50
|
+
y={round(y + DIAGRAM_FONT_SIZE + 4)}
|
|
51
|
+
fill="var(--muted-foreground)"
|
|
52
|
+
fontSize={DIAGRAM_FONT_SIZE * 0.9}
|
|
53
|
+
fontWeight={500}
|
|
54
|
+
>
|
|
55
|
+
{cluster.label}
|
|
56
|
+
</text>
|
|
57
|
+
</g>
|
|
58
|
+
);
|
|
59
|
+
};
|