@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,98 @@
|
|
|
1
|
+
import { DIAGRAM_FONT_FAMILY } from "./textMetrics.js";
|
|
2
|
+
import { FlowchartDiagramCluster } from "./FlowchartDiagramCluster.js";
|
|
3
|
+
import { FlowchartDiagramEdge } from "./FlowchartDiagramEdge.js";
|
|
4
|
+
import { FlowchartDiagramNode } from "./FlowchartDiagramNode.js";
|
|
5
|
+
import { useId } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/markdown-view/diagram/FlowchartDiagram.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Draw a laid-out flowchart as themed SVG.
|
|
10
|
+
*
|
|
11
|
+
* ## React elements, not an HTML string, and this is not negotiable
|
|
12
|
+
*
|
|
13
|
+
* `markdown-view.tsx` carries an explicit rule that no raw HTML is ever
|
|
14
|
+
* promoted to markup, because it renders one user's content to another and
|
|
15
|
+
* every raw tag would turn every markdown surface in every app into an
|
|
16
|
+
* injection point. Emitting React elements means labels are escaped by React
|
|
17
|
+
* itself and `dangerouslySetInnerHTML` never appears on this path. Read that
|
|
18
|
+
* comment before "optimising" this into a string.
|
|
19
|
+
*
|
|
20
|
+
* ## Theming is the point
|
|
21
|
+
*
|
|
22
|
+
* Colours come from `--primary`, `--border`, `--muted-foreground`, `--card`
|
|
23
|
+
* and `--muted` through `var(...)`, so dark mode works with no second
|
|
24
|
+
* palette and no theme prop. That is the thing mermaid can structurally
|
|
25
|
+
* never give us, and the whole reason drawing is our own code rather than a
|
|
26
|
+
* cost.
|
|
27
|
+
*
|
|
28
|
+
* ## The font is pinned, never inherited
|
|
29
|
+
*
|
|
30
|
+
* Folio view mode and the quest description set prose in Literata at 16.5px,
|
|
31
|
+
* lazy-loaded after first paint; every other surface is Inter. The width
|
|
32
|
+
* table in `textMetrics.ts` is generated against Inter at
|
|
33
|
+
* `DIAGRAM_FONT_SIZE`, so inheriting would make text and box disagree per
|
|
34
|
+
* surface and shift when the serif arrives.
|
|
35
|
+
*/
|
|
36
|
+
const FlowchartDiagram = (props) => {
|
|
37
|
+
const graph = props.graph;
|
|
38
|
+
const scope = useId().replace(/[^\w-]/g, "");
|
|
39
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
40
|
+
role: "img",
|
|
41
|
+
viewBox: `0 0 ${round(graph.width)} ${round(graph.height)}`,
|
|
42
|
+
style: {
|
|
43
|
+
maxWidth: `${round(graph.width)}px`,
|
|
44
|
+
height: "auto"
|
|
45
|
+
},
|
|
46
|
+
className: "my-4 block w-full",
|
|
47
|
+
fontFamily: DIAGRAM_FONT_FAMILY,
|
|
48
|
+
fontSize: graph.fontSize,
|
|
49
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx("title", { children: props.title ?? "Flowchart diagram" }),
|
|
52
|
+
/* @__PURE__ */ jsxs("defs", { children: [/* @__PURE__ */ jsx("marker", {
|
|
53
|
+
id: `${scope}-arrow-end`,
|
|
54
|
+
markerWidth: "9",
|
|
55
|
+
markerHeight: "7",
|
|
56
|
+
refX: "8",
|
|
57
|
+
refY: "3.5",
|
|
58
|
+
orient: "auto",
|
|
59
|
+
markerUnits: "userSpaceOnUse",
|
|
60
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
61
|
+
d: "M0,0 L9,3.5 L0,7 z",
|
|
62
|
+
fill: "context-stroke"
|
|
63
|
+
})
|
|
64
|
+
}), /* @__PURE__ */ jsx("marker", {
|
|
65
|
+
id: `${scope}-arrow-start`,
|
|
66
|
+
markerWidth: "9",
|
|
67
|
+
markerHeight: "7",
|
|
68
|
+
refX: "1",
|
|
69
|
+
refY: "3.5",
|
|
70
|
+
orient: "auto-start-reverse",
|
|
71
|
+
markerUnits: "userSpaceOnUse",
|
|
72
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
73
|
+
d: "M0,0 L9,3.5 L0,7 z",
|
|
74
|
+
fill: "context-stroke"
|
|
75
|
+
})
|
|
76
|
+
})] }),
|
|
77
|
+
graph.clusters.map((cluster) => /* @__PURE__ */ jsx(FlowchartDiagramCluster, { cluster }, cluster.id)),
|
|
78
|
+
graph.edges.map((edge, index) => /* @__PURE__ */ jsx(FlowchartDiagramEdge, {
|
|
79
|
+
edge,
|
|
80
|
+
scope,
|
|
81
|
+
fontSize: graph.fontSize
|
|
82
|
+
}, `${edge.from}->${edge.to}#${index}`)),
|
|
83
|
+
graph.nodes.map((node) => /* @__PURE__ */ jsx(FlowchartDiagramNode, {
|
|
84
|
+
node,
|
|
85
|
+
fontSize: graph.fontSize
|
|
86
|
+
}, node.id))
|
|
87
|
+
]
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Two decimals is plenty for a diagram and keeps the emitted attributes
|
|
92
|
+
* readable; graphre's raw coordinates carry a dozen.
|
|
93
|
+
*/
|
|
94
|
+
const round = (value) => Math.round(value * 100) / 100;
|
|
95
|
+
//#endregion
|
|
96
|
+
export { FlowchartDiagram, round };
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=FlowchartDiagram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowchartDiagram.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/FlowchartDiagram.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { useId } from \"react\";\n\nimport { FlowchartDiagramCluster } from \"./FlowchartDiagramCluster.tsx\";\nimport { FlowchartDiagramEdge } from \"./FlowchartDiagramEdge.tsx\";\nimport { FlowchartDiagramNode } from \"./FlowchartDiagramNode.tsx\";\nimport type { PositionedGraph } from \"./layoutFlowchart.ts\";\nimport { DIAGRAM_FONT_FAMILY } from \"./textMetrics.ts\";\n\nexport interface FlowchartDiagramProps {\n graph: PositionedGraph;\n /**\n * Read out to assistive technology as the diagram's name.\n */\n title?: string;\n}\n\n/**\n * Draw a laid-out flowchart as themed SVG.\n *\n * ## React elements, not an HTML string, and this is not negotiable\n *\n * `markdown-view.tsx` carries an explicit rule that no raw HTML is ever\n * promoted to markup, because it renders one user's content to another and\n * every raw tag would turn every markdown surface in every app into an\n * injection point. Emitting React elements means labels are escaped by React\n * itself and `dangerouslySetInnerHTML` never appears on this path. Read that\n * comment before \"optimising\" this into a string.\n *\n * ## Theming is the point\n *\n * Colours come from `--primary`, `--border`, `--muted-foreground`, `--card`\n * and `--muted` through `var(...)`, so dark mode works with no second\n * palette and no theme prop. That is the thing mermaid can structurally\n * never give us, and the whole reason drawing is our own code rather than a\n * cost.\n *\n * ## The font is pinned, never inherited\n *\n * Folio view mode and the quest description set prose in Literata at 16.5px,\n * lazy-loaded after first paint; every other surface is Inter. The width\n * table in `textMetrics.ts` is generated against Inter at\n * `DIAGRAM_FONT_SIZE`, so inheriting would make text and box disagree per\n * surface and shift when the serif arrives.\n */\nexport const FlowchartDiagram = (props: FlowchartDiagramProps) => {\n const graph = props.graph;\n // SVG marker ids are global to the document: two diagrams on one page with\n // the same arrowhead id fight, and the loser's arrows vanish.\n const scope = useId().replace(/[^\\w-]/g, \"\");\n\n return (\n <svg\n role=\"img\"\n viewBox={`0 0 ${round(graph.width)} ${round(graph.height)}`}\n // No `width`: the diagram scales to its container, and `max-width`\n // stops a two-node graph being blown up to the full column.\n style={{ maxWidth: `${round(graph.width)}px`, height: \"auto\" }}\n className=\"my-4 block w-full\"\n // camelCase, not `font-family` / `font-size`: React renders these as\n // the hyphenated SVG presentation attributes either way, but the\n // hyphenated spelling is an \"Invalid DOM property\" warning on every\n // render - noise in a component mounted on every markdown surface in\n // the app.\n fontFamily={DIAGRAM_FONT_FAMILY}\n fontSize={graph.fontSize}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>{props.title ?? \"Flowchart diagram\"}</title>\n <defs>\n <marker\n id={`${scope}-arrow-end`}\n markerWidth=\"9\"\n markerHeight=\"7\"\n refX=\"8\"\n refY=\"3.5\"\n orient=\"auto\"\n markerUnits=\"userSpaceOnUse\"\n >\n {/*\n `context-stroke`, not `currentColor`. A marker lives in `<defs>`,\n so `currentColor` resolves against the MARKER's inherited colour,\n not the edge's - the arrowhead came out `--foreground` while its\n line was `--muted-foreground`, and in a differently-themed\n container it was the wrong colour outright.\n */}\n <path d=\"M0,0 L9,3.5 L0,7 z\" fill=\"context-stroke\" />\n </marker>\n <marker\n id={`${scope}-arrow-start`}\n markerWidth=\"9\"\n markerHeight=\"7\"\n refX=\"1\"\n refY=\"3.5\"\n orient=\"auto-start-reverse\"\n markerUnits=\"userSpaceOnUse\"\n >\n <path d=\"M0,0 L9,3.5 L0,7 z\" fill=\"context-stroke\" />\n </marker>\n </defs>\n\n {/*\n Order IS z-order in SVG, so clusters (sorted outermost first by the\n layout adapter) go down first, then edges, then nodes on top. No\n z-index anywhere, and nothing to keep in sync.\n */}\n {graph.clusters.map((cluster) => (\n <FlowchartDiagramCluster key={cluster.id} cluster={cluster} />\n ))}\n {graph.edges.map((edge, index) => (\n <FlowchartDiagramEdge\n key={`${edge.from}->${edge.to}#${index}`}\n edge={edge}\n scope={scope}\n fontSize={graph.fontSize}\n />\n ))}\n {graph.nodes.map((node) => (\n <FlowchartDiagramNode\n key={node.id}\n node={node}\n fontSize={graph.fontSize}\n />\n ))}\n </svg>\n );\n};\n\n/**\n * Two decimals is plenty for a diagram and keeps the emitted attributes\n * readable; graphre's raw coordinates carry a dozen.\n */\nexport const round = (value: number): number => Math.round(value * 100) / 100;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAa,oBAAoB,UAAiC;CAChE,MAAM,QAAQ,MAAM;CAGpB,MAAM,QAAQ,MAAM,CAAC,CAAC,QAAQ,WAAW,EAAE;CAE3C,OACE,qBAAC,OAAD;EACE,MAAK;EACL,SAAS,OAAO,MAAM,MAAM,KAAK,EAAE,GAAG,MAAM,MAAM,MAAM;EAGxD,OAAO;GAAE,UAAU,GAAG,MAAM,MAAM,KAAK,EAAE;GAAK,QAAQ;EAAO;EAC7D,WAAU;EAMV,YAAY;EACZ,UAAU,MAAM;EAChB,OAAM;EAdR,UAAA;GAgBE,oBAAC,SAAD,EAAA,UAAQ,MAAM,SAAS,oBAA2B,CAAA;GAClD,qBAAC,QAAD,EAAA,UAAA,CACE,oBAAC,UAAD;IACE,IAAI,GAAG,MAAM;IACb,aAAY;IACZ,cAAa;IACb,MAAK;IACL,MAAK;IACL,QAAO;IACP,aAAY;IASZ,UAAA,oBAAC,QAAD;KAAM,GAAE;KAAqB,MAAK;IAAkB,CAAA;GAC9C,CAAA,GACR,oBAAC,UAAD;IACE,IAAI,GAAG,MAAM;IACb,aAAY;IACZ,cAAa;IACb,MAAK;IACL,MAAK;IACL,QAAO;IACP,aAAY;IAEZ,UAAA,oBAAC,QAAD;KAAM,GAAE;KAAqB,MAAK;IAAkB,CAAA;GAC9C,CAAA,CACJ,EAAA,CAAA;GAOL,MAAM,SAAS,KAAK,YACnB,oBAAC,yBAAD,EAAmD,QAAU,GAA/B,QAAQ,EAAuB,CAC9D;GACA,MAAM,MAAM,KAAK,MAAM,UACtB,oBAAC,sBAAD;IAEQ;IACC;IACP,UAAU,MAAM;GACjB,GAJM,GAAG,KAAK,KAAK,IAAI,KAAK,GAAG,GAAG,OAIlC,CACF;GACA,MAAM,MAAM,KAAK,SAChB,oBAAC,sBAAD;IAEQ;IACN,UAAU,MAAM;GACjB,GAHM,KAAK,EAGX,CACF;EACE;;AAET;;;;;AAMA,MAAa,SAAS,UAA0B,KAAK,MAAM,QAAQ,GAAG,IAAI"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PositionedCluster } from "./layoutFlowchart.ts";
|
|
3
|
+
export interface FlowchartDiagramClusterProps {
|
|
4
|
+
cluster: PositionedCluster;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* One `subgraph` box, drawn behind its members.
|
|
8
|
+
*
|
|
9
|
+
* The fill alpha grows with nesting depth so an inner cluster reads as
|
|
10
|
+
* inside its parent rather than beside it. `--muted` at a low alpha is dark
|
|
11
|
+
* on light and light on dark, so one value works in both themes.
|
|
12
|
+
*/
|
|
13
|
+
export declare const FlowchartDiagramCluster: (props: FlowchartDiagramClusterProps) => React.JSX.Element;
|
|
14
|
+
//# sourceMappingURL=FlowchartDiagramCluster.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowchartDiagramCluster.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,UAC3B,4BAA4B,sBAsCpC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "./textMetrics.js";
|
|
2
|
+
import { round } from "./FlowchartDiagram.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx
|
|
6
|
+
/**
|
|
7
|
+
* One `subgraph` box, drawn behind its members.
|
|
8
|
+
*
|
|
9
|
+
* The fill alpha grows with nesting depth so an inner cluster reads as
|
|
10
|
+
* inside its parent rather than beside it. `--muted` at a low alpha is dark
|
|
11
|
+
* on light and light on dark, so one value works in both themes.
|
|
12
|
+
*/
|
|
13
|
+
const FlowchartDiagramCluster = (props) => {
|
|
14
|
+
const cluster = props.cluster;
|
|
15
|
+
const x = round(cluster.x);
|
|
16
|
+
const y = round(cluster.y);
|
|
17
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
18
|
+
"data-cluster": cluster.id,
|
|
19
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
20
|
+
"data-cluster": cluster.id,
|
|
21
|
+
x,
|
|
22
|
+
y,
|
|
23
|
+
width: round(cluster.width),
|
|
24
|
+
height: round(cluster.height),
|
|
25
|
+
rx: 8,
|
|
26
|
+
ry: 8,
|
|
27
|
+
fill: "var(--muted)",
|
|
28
|
+
fillOpacity: Math.min(.35 + cluster.depth * .2, .8),
|
|
29
|
+
stroke: "var(--border)",
|
|
30
|
+
strokeWidth: 1,
|
|
31
|
+
strokeDasharray: "4 3"
|
|
32
|
+
}), /* @__PURE__ */ jsx("text", {
|
|
33
|
+
x: round(x + 10),
|
|
34
|
+
y: round(y + 13 + 4),
|
|
35
|
+
fill: "var(--muted-foreground)",
|
|
36
|
+
fontSize: 13 * .9,
|
|
37
|
+
fontWeight: 500,
|
|
38
|
+
children: cluster.label
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { FlowchartDiagramCluster };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=FlowchartDiagramCluster.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowchartDiagramCluster.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { round } from \"./FlowchartDiagram.tsx\";\nimport type { PositionedCluster } from \"./layoutFlowchart.ts\";\nimport { DIAGRAM_FONT_SIZE } from \"./textMetrics.ts\";\n\nexport interface FlowchartDiagramClusterProps {\n cluster: PositionedCluster;\n}\n\n/**\n * One `subgraph` box, drawn behind its members.\n *\n * The fill alpha grows with nesting depth so an inner cluster reads as\n * inside its parent rather than beside it. `--muted` at a low alpha is dark\n * on light and light on dark, so one value works in both themes.\n */\nexport const FlowchartDiagramCluster = (\n props: FlowchartDiagramClusterProps,\n) => {\n const cluster = props.cluster;\n const x = round(cluster.x);\n const y = round(cluster.y);\n\n return (\n <g data-cluster={cluster.id}>\n <rect\n data-cluster={cluster.id}\n x={x}\n y={y}\n width={round(cluster.width)}\n height={round(cluster.height)}\n rx={8}\n ry={8}\n fill=\"var(--muted)\"\n fillOpacity={Math.min(0.35 + cluster.depth * 0.2, 0.8)}\n stroke=\"var(--border)\"\n strokeWidth={1}\n strokeDasharray=\"4 3\"\n />\n {/*\n Top-left, just inside the box, on the same baseline arithmetic the\n node labels use. A cluster title is a single line by construction:\n the parser never splits it.\n */}\n <text\n x={round(x + 10)}\n y={round(y + DIAGRAM_FONT_SIZE + 4)}\n fill=\"var(--muted-foreground)\"\n fontSize={DIAGRAM_FONT_SIZE * 0.9}\n fontWeight={500}\n >\n {cluster.label}\n </text>\n </g>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,2BACX,UACG;CACH,MAAM,UAAU,MAAM;CACtB,MAAM,IAAI,MAAM,QAAQ,CAAC;CACzB,MAAM,IAAI,MAAM,QAAQ,CAAC;CAEzB,OACE,qBAAC,KAAD;EAAG,gBAAc,QAAQ;EAAzB,UAAA,CACE,oBAAC,QAAD;GACE,gBAAc,QAAQ;GACnB;GACA;GACH,OAAO,MAAM,QAAQ,KAAK;GAC1B,QAAQ,MAAM,QAAQ,MAAM;GAC5B,IAAI;GACJ,IAAI;GACJ,MAAK;GACL,aAAa,KAAK,IAAI,MAAO,QAAQ,QAAQ,IAAK,EAAG;GACrD,QAAO;GACP,aAAa;GACb,iBAAgB;EACjB,CAAA,GAMD,oBAAC,QAAD;GACE,GAAG,MAAM,IAAI,EAAE;GACf,GAAG,MAAM,IAAA,KAAwB,CAAC;GAClC,MAAK;GACL,UAAA,KAA8B;GAC9B,YAAY;GAEX,UAAA,QAAQ;EACL,CAAA,CACL;;AAEP"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PositionedEdge } from "./layoutFlowchart.ts";
|
|
3
|
+
export interface FlowchartDiagramEdgeProps {
|
|
4
|
+
edge: PositionedEdge;
|
|
5
|
+
/**
|
|
6
|
+
* Instance-unique prefix for the arrowhead marker ids.
|
|
7
|
+
*/
|
|
8
|
+
scope: string;
|
|
9
|
+
fontSize: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* One routed edge, its arrowheads and its label chip.
|
|
13
|
+
*
|
|
14
|
+
* `currentColor` on the path is what makes the arrowhead markers match: a
|
|
15
|
+
* marker inherits `currentColor` from the element that references it, so
|
|
16
|
+
* one pair of markers serves every edge colour without a marker per style.
|
|
17
|
+
*/
|
|
18
|
+
export declare const FlowchartDiagramEdge: (props: FlowchartDiagramEdgeProps) => React.JSX.Element;
|
|
19
|
+
//# sourceMappingURL=FlowchartDiagramEdge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowchartDiagramEdge.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,cAAc,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,UAAW,yBAAyB,sBA+CpE,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { FlowchartDiagramLabel } from "./FlowchartDiagramLabel.js";
|
|
2
|
+
import { round } from "./FlowchartDiagram.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx
|
|
6
|
+
/**
|
|
7
|
+
* One routed edge, its arrowheads and its label chip.
|
|
8
|
+
*
|
|
9
|
+
* `currentColor` on the path is what makes the arrowhead markers match: a
|
|
10
|
+
* marker inherits `currentColor` from the element that references it, so
|
|
11
|
+
* one pair of markers serves every edge colour without a marker per style.
|
|
12
|
+
*/
|
|
13
|
+
const FlowchartDiagramEdge = (props) => {
|
|
14
|
+
const edge = props.edge;
|
|
15
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
16
|
+
style: { color: "var(--muted-foreground)" },
|
|
17
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
18
|
+
"data-edge": `${edge.from}->${edge.to}`,
|
|
19
|
+
d: pathOf(edge.points),
|
|
20
|
+
fill: "none",
|
|
21
|
+
stroke: "currentColor",
|
|
22
|
+
strokeWidth: edge.style === "thick" ? 2.5 : 1.4,
|
|
23
|
+
strokeDasharray: edge.style === "dashed" ? "5 4" : void 0,
|
|
24
|
+
strokeLinecap: "round",
|
|
25
|
+
strokeLinejoin: "round",
|
|
26
|
+
markerEnd: edge.arrowEnd ? `url(#${props.scope}-arrow-end)` : void 0,
|
|
27
|
+
markerStart: edge.arrowStart ? `url(#${props.scope}-arrow-start)` : void 0
|
|
28
|
+
}), edge.label ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("rect", {
|
|
29
|
+
"data-edge-label": `${edge.from}->${edge.to}`,
|
|
30
|
+
x: round(edge.label.x),
|
|
31
|
+
y: round(edge.label.y),
|
|
32
|
+
width: round(edge.label.width),
|
|
33
|
+
height: round(edge.label.height),
|
|
34
|
+
rx: 4,
|
|
35
|
+
ry: 4,
|
|
36
|
+
fill: "var(--background)"
|
|
37
|
+
}), /* @__PURE__ */ jsx(FlowchartDiagramLabel, {
|
|
38
|
+
lines: edge.label.lines,
|
|
39
|
+
centerX: edge.label.x + edge.label.width / 2,
|
|
40
|
+
centerY: edge.label.y + edge.label.height / 2,
|
|
41
|
+
fontSize: props.fontSize * .92,
|
|
42
|
+
fill: "var(--muted-foreground)"
|
|
43
|
+
})] }) : null]
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* A rounded polyline through graphre's point list.
|
|
48
|
+
*
|
|
49
|
+
* Quadratic segments through the midpoints round every corner without any
|
|
50
|
+
* curve fitting: each control point is the original vertex, so the line
|
|
51
|
+
* still passes where the layout routed it.
|
|
52
|
+
*/
|
|
53
|
+
const pathOf = (points) => {
|
|
54
|
+
const at = (index) => `${round(points[index].x)},${round(points[index].y)}`;
|
|
55
|
+
if (points.length === 2) return `M${at(0)} L${at(1)}`;
|
|
56
|
+
let d = `M${at(0)}`;
|
|
57
|
+
for (let i = 1; i < points.length - 1; i++) {
|
|
58
|
+
const current = points[i];
|
|
59
|
+
const next = points[i + 1];
|
|
60
|
+
const midX = round((current.x + next.x) / 2);
|
|
61
|
+
const midY = round((current.y + next.y) / 2);
|
|
62
|
+
d += ` Q${round(current.x)},${round(current.y)} ${midX},${midY}`;
|
|
63
|
+
}
|
|
64
|
+
return `${d} L${at(points.length - 1)}`;
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
export { FlowchartDiagramEdge };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=FlowchartDiagramEdge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowchartDiagramEdge.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { round } from \"./FlowchartDiagram.tsx\";\nimport { FlowchartDiagramLabel } from \"./FlowchartDiagramLabel.tsx\";\nimport type { PositionedEdge } from \"./layoutFlowchart.ts\";\n\nexport interface FlowchartDiagramEdgeProps {\n edge: PositionedEdge;\n /**\n * Instance-unique prefix for the arrowhead marker ids.\n */\n scope: string;\n fontSize: number;\n}\n\n/**\n * One routed edge, its arrowheads and its label chip.\n *\n * `currentColor` on the path is what makes the arrowhead markers match: a\n * marker inherits `currentColor` from the element that references it, so\n * one pair of markers serves every edge colour without a marker per style.\n */\nexport const FlowchartDiagramEdge = (props: FlowchartDiagramEdgeProps) => {\n const edge = props.edge;\n\n return (\n <g style={{ color: \"var(--muted-foreground)\" }}>\n <path\n data-edge={`${edge.from}->${edge.to}`}\n d={pathOf(edge.points)}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={edge.style === \"thick\" ? 2.5 : 1.4}\n strokeDasharray={edge.style === \"dashed\" ? \"5 4\" : undefined}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n markerEnd={edge.arrowEnd ? `url(#${props.scope}-arrow-end)` : undefined}\n markerStart={\n edge.arrowStart ? `url(#${props.scope}-arrow-start)` : undefined\n }\n />\n {edge.label ? (\n <>\n {/*\n The chip is what stops the line running through the text. It is\n drawn in `--background` rather than `--card` so it reads as a\n hole in the edge rather than as a small node.\n */}\n <rect\n data-edge-label={`${edge.from}->${edge.to}`}\n x={round(edge.label.x)}\n y={round(edge.label.y)}\n width={round(edge.label.width)}\n height={round(edge.label.height)}\n rx={4}\n ry={4}\n fill=\"var(--background)\"\n />\n <FlowchartDiagramLabel\n lines={edge.label.lines}\n centerX={edge.label.x + edge.label.width / 2}\n centerY={edge.label.y + edge.label.height / 2}\n fontSize={props.fontSize * 0.92}\n fill=\"var(--muted-foreground)\"\n />\n </>\n ) : null}\n </g>\n );\n};\n\n/**\n * A rounded polyline through graphre's point list.\n *\n * Quadratic segments through the midpoints round every corner without any\n * curve fitting: each control point is the original vertex, so the line\n * still passes where the layout routed it.\n */\nconst pathOf = (points: Array<{ x: number; y: number }>): string => {\n const at = (index: number) =>\n `${round(points[index].x)},${round(points[index].y)}`;\n if (points.length === 2) return `M${at(0)} L${at(1)}`;\n\n let d = `M${at(0)}`;\n for (let i = 1; i < points.length - 1; i++) {\n const current = points[i];\n const next = points[i + 1];\n const midX = round((current.x + next.x) / 2);\n const midY = round((current.y + next.y) / 2);\n d += ` Q${round(current.x)},${round(current.y)} ${midX},${midY}`;\n }\n return `${d} L${at(points.length - 1)}`;\n};\n"],"mappings":";;;;;;;;;;;;AAwBA,MAAa,wBAAwB,UAAqC;CACxE,MAAM,OAAO,MAAM;CAEnB,OACE,qBAAC,KAAD;EAAG,OAAO,EAAE,OAAO,0BAA0B;EAA7C,UAAA,CACE,oBAAC,QAAD;GACE,aAAW,GAAG,KAAK,KAAK,IAAI,KAAK;GACjC,GAAG,OAAO,KAAK,MAAM;GACrB,MAAK;GACL,QAAO;GACP,aAAa,KAAK,UAAU,UAAU,MAAM;GAC5C,iBAAiB,KAAK,UAAU,WAAW,QAAQ,KAAA;GACnD,eAAc;GACd,gBAAe;GACf,WAAW,KAAK,WAAW,QAAQ,MAAM,MAAM,eAAe,KAAA;GAC9D,aACE,KAAK,aAAa,QAAQ,MAAM,MAAM,iBAAiB,KAAA;EAE1D,CAAA,GACA,KAAK,QACJ,qBAAA,YAAA,EAAA,UAAA,CAME,oBAAC,QAAD;GACE,mBAAiB,GAAG,KAAK,KAAK,IAAI,KAAK;GACvC,GAAG,MAAM,KAAK,MAAM,CAAC;GACrB,GAAG,MAAM,KAAK,MAAM,CAAC;GACrB,OAAO,MAAM,KAAK,MAAM,KAAK;GAC7B,QAAQ,MAAM,KAAK,MAAM,MAAM;GAC/B,IAAI;GACJ,IAAI;GACJ,MAAK;EACN,CAAA,GACD,oBAAC,uBAAD;GACE,OAAO,KAAK,MAAM;GAClB,SAAS,KAAK,MAAM,IAAI,KAAK,MAAM,QAAQ;GAC3C,SAAS,KAAK,MAAM,IAAI,KAAK,MAAM,SAAS;GAC5C,UAAU,MAAM,WAAW;GAC3B,MAAK;EACN,CAAA,CACD,EAAA,CAAA,IACA,IACH;;AAEP;;;;;;;;AASA,MAAM,UAAU,WAAoD;CAClE,MAAM,MAAM,UACV,GAAG,MAAM,OAAO,MAAM,CAAC,CAAC,EAAE,GAAG,MAAM,OAAO,MAAM,CAAC,CAAC;CACpD,IAAI,OAAO,WAAW,GAAG,OAAO,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC;CAElD,IAAI,IAAI,IAAI,GAAG,CAAC;CAChB,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,SAAS,GAAG,KAAK;EAC1C,MAAM,UAAU,OAAO;EACvB,MAAM,OAAO,OAAO,IAAI;EACxB,MAAM,OAAO,OAAO,QAAQ,IAAI,KAAK,KAAK,CAAC;EAC3C,MAAM,OAAO,OAAO,QAAQ,IAAI,KAAK,KAAK,CAAC;EAC3C,KAAK,KAAK,MAAM,QAAQ,CAAC,EAAE,GAAG,MAAM,QAAQ,CAAC,EAAE,GAAG,KAAK,GAAG;CAC5D;CACA,OAAO,GAAG,EAAE,IAAI,GAAG,OAAO,SAAS,CAAC;AACtC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface FlowchartDiagramLabelProps {
|
|
3
|
+
/**
|
|
4
|
+
* Already wrapped and capped by `measureLabel` - draw exactly these.
|
|
5
|
+
*/
|
|
6
|
+
lines: string[];
|
|
7
|
+
centerX: number;
|
|
8
|
+
centerY: number;
|
|
9
|
+
fontSize: number;
|
|
10
|
+
fill: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A centred, multi-line label, one `tspan` per line.
|
|
14
|
+
*
|
|
15
|
+
* The line box has to match `DIAGRAM_LINE_HEIGHT`, which is what
|
|
16
|
+
* `measureLabel` sized the box with: text and box disagreeing is the
|
|
17
|
+
* failure mode this whole metrics path exists to avoid.
|
|
18
|
+
*
|
|
19
|
+
* `dominant-baseline` is not used: jsdom and older Safari disagree about it,
|
|
20
|
+
* and shifting the first line by hand is arithmetic that works everywhere.
|
|
21
|
+
*/
|
|
22
|
+
export declare const FlowchartDiagramLabel: (props: FlowchartDiagramLabelProps) => React.JSX.Element;
|
|
23
|
+
//# sourceMappingURL=FlowchartDiagramLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowchartDiagramLabel.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/FlowchartDiagramLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,UAAW,0BAA0B,sBA6BtE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DIAGRAM_LINE_HEIGHT } from "./textMetrics.js";
|
|
2
|
+
import { round } from "./FlowchartDiagram.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/markdown-view/diagram/FlowchartDiagramLabel.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A centred, multi-line label, one `tspan` per line.
|
|
8
|
+
*
|
|
9
|
+
* The line box has to match `DIAGRAM_LINE_HEIGHT`, which is what
|
|
10
|
+
* `measureLabel` sized the box with: text and box disagreeing is the
|
|
11
|
+
* failure mode this whole metrics path exists to avoid.
|
|
12
|
+
*
|
|
13
|
+
* `dominant-baseline` is not used: jsdom and older Safari disagree about it,
|
|
14
|
+
* and shifting the first line by hand is arithmetic that works everywhere.
|
|
15
|
+
*/
|
|
16
|
+
const FlowchartDiagramLabel = (props) => {
|
|
17
|
+
const lineBox = props.fontSize * DIAGRAM_LINE_HEIGHT;
|
|
18
|
+
const firstBaseline = props.centerY - (props.lines.length - 1) * lineBox / 2 + props.fontSize * .36;
|
|
19
|
+
return /* @__PURE__ */ jsx("text", {
|
|
20
|
+
x: round(props.centerX),
|
|
21
|
+
y: round(firstBaseline),
|
|
22
|
+
textAnchor: "middle",
|
|
23
|
+
fill: props.fill,
|
|
24
|
+
children: props.lines.map((line, index) => /* @__PURE__ */ jsx("tspan", {
|
|
25
|
+
x: round(props.centerX),
|
|
26
|
+
dy: index === 0 ? 0 : round(lineBox),
|
|
27
|
+
children: line
|
|
28
|
+
}, `${index}:${line}`))
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { FlowchartDiagramLabel };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=FlowchartDiagramLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowchartDiagramLabel.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/FlowchartDiagramLabel.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { round } from \"./FlowchartDiagram.tsx\";\nimport { DIAGRAM_LINE_HEIGHT } from \"./textMetrics.ts\";\n\nexport interface FlowchartDiagramLabelProps {\n /**\n * Already wrapped and capped by `measureLabel` - draw exactly these.\n */\n lines: string[];\n centerX: number;\n centerY: number;\n fontSize: number;\n fill: string;\n}\n\n/**\n * A centred, multi-line label, one `tspan` per line.\n *\n * The line box has to match `DIAGRAM_LINE_HEIGHT`, which is what\n * `measureLabel` sized the box with: text and box disagreeing is the\n * failure mode this whole metrics path exists to avoid.\n *\n * `dominant-baseline` is not used: jsdom and older Safari disagree about it,\n * and shifting the first line by hand is arithmetic that works everywhere.\n */\nexport const FlowchartDiagramLabel = (props: FlowchartDiagramLabelProps) => {\n const lineBox = props.fontSize * DIAGRAM_LINE_HEIGHT;\n // The stack is centred on `centerY`, then each line sits on its own\n // baseline. `0.36em` is the optical centre of a lowercase run.\n const firstBaseline =\n props.centerY -\n ((props.lines.length - 1) * lineBox) / 2 +\n props.fontSize * 0.36;\n\n return (\n <text\n x={round(props.centerX)}\n y={round(firstBaseline)}\n textAnchor=\"middle\"\n fill={props.fill}\n >\n {props.lines.map((line, index) => (\n <tspan\n // Lines are positional and may legitimately repeat, so the index\n // is the identity here.\n key={`${index}:${line}`}\n x={round(props.centerX)}\n dy={index === 0 ? 0 : round(lineBox)}\n >\n {line}\n </tspan>\n ))}\n </text>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAa,yBAAyB,UAAsC;CAC1E,MAAM,UAAU,MAAM,WAAW;CAGjC,MAAM,gBACJ,MAAM,WACJ,MAAM,MAAM,SAAS,KAAK,UAAW,IACvC,MAAM,WAAW;CAEnB,OACE,oBAAC,QAAD;EACE,GAAG,MAAM,MAAM,OAAO;EACtB,GAAG,MAAM,aAAa;EACtB,YAAW;EACX,MAAM,MAAM;EAEX,UAAA,MAAM,MAAM,KAAK,MAAM,UACtB,oBAAC,SAAD;GAIE,GAAG,MAAM,MAAM,OAAO;GACtB,IAAI,UAAU,IAAI,IAAI,MAAM,OAAO;GAElC,UAAA;EACI,GALA,GAAG,MAAM,GAAG,MAKZ,CACR;CACG,CAAA;AAEV"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PositionedNode } from "./layoutFlowchart.ts";
|
|
3
|
+
export interface FlowchartDiagramNodeProps {
|
|
4
|
+
node: PositionedNode;
|
|
5
|
+
fontSize: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* One box and its label.
|
|
9
|
+
*
|
|
10
|
+
* The four shapes are drawn with four primitives rather than one `path`
|
|
11
|
+
* each, so the SVG stays readable and a rounded rect is literally a rect
|
|
12
|
+
* with an `rx`. Colours are CSS variables throughout: an element with no
|
|
13
|
+
* class at all survives being extracted, and dark mode needs no second
|
|
14
|
+
* palette.
|
|
15
|
+
*/
|
|
16
|
+
export declare const FlowchartDiagramNode: (props: FlowchartDiagramNodeProps) => React.JSX.Element;
|
|
17
|
+
//# sourceMappingURL=FlowchartDiagramNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowchartDiagramNode.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/FlowchartDiagramNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,UAAW,yBAAyB,sBAuDpE,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FlowchartDiagramLabel } from "./FlowchartDiagramLabel.js";
|
|
2
|
+
import { round } from "./FlowchartDiagram.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/markdown-view/diagram/FlowchartDiagramNode.tsx
|
|
6
|
+
/**
|
|
7
|
+
* One box and its label.
|
|
8
|
+
*
|
|
9
|
+
* The four shapes are drawn with four primitives rather than one `path`
|
|
10
|
+
* each, so the SVG stays readable and a rounded rect is literally a rect
|
|
11
|
+
* with an `rx`. Colours are CSS variables throughout: an element with no
|
|
12
|
+
* class at all survives being extracted, and dark mode needs no second
|
|
13
|
+
* palette.
|
|
14
|
+
*/
|
|
15
|
+
const FlowchartDiagramNode = (props) => {
|
|
16
|
+
const node = props.node;
|
|
17
|
+
const x = round(node.x);
|
|
18
|
+
const y = round(node.y);
|
|
19
|
+
const width = round(node.width);
|
|
20
|
+
const height = round(node.height);
|
|
21
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
22
|
+
"data-node": node.id,
|
|
23
|
+
children: [node.shape === "diamond" ? /* @__PURE__ */ jsx("polygon", {
|
|
24
|
+
points: [
|
|
25
|
+
`${round(x + width / 2)},${y}`,
|
|
26
|
+
`${round(x + width)},${round(y + height / 2)}`,
|
|
27
|
+
`${round(x + width / 2)},${round(y + height)}`,
|
|
28
|
+
`${x},${round(y + height / 2)}`
|
|
29
|
+
].join(" "),
|
|
30
|
+
fill: "var(--card)",
|
|
31
|
+
stroke: "var(--border)",
|
|
32
|
+
strokeWidth: 1.25
|
|
33
|
+
}) : node.shape === "circle" ? /* @__PURE__ */ jsx("ellipse", {
|
|
34
|
+
cx: round(x + width / 2),
|
|
35
|
+
cy: round(y + height / 2),
|
|
36
|
+
rx: round(width / 2),
|
|
37
|
+
ry: round(height / 2),
|
|
38
|
+
fill: "var(--card)",
|
|
39
|
+
stroke: "var(--border)",
|
|
40
|
+
strokeWidth: 1.25
|
|
41
|
+
}) : /* @__PURE__ */ jsx("rect", {
|
|
42
|
+
x,
|
|
43
|
+
y,
|
|
44
|
+
width,
|
|
45
|
+
height,
|
|
46
|
+
rx: node.shape === "rounded" ? round(height / 2) : 5,
|
|
47
|
+
ry: node.shape === "rounded" ? round(height / 2) : 5,
|
|
48
|
+
fill: "var(--card)",
|
|
49
|
+
stroke: "var(--border)",
|
|
50
|
+
strokeWidth: 1.25
|
|
51
|
+
}), /* @__PURE__ */ jsx(FlowchartDiagramLabel, {
|
|
52
|
+
lines: node.lines,
|
|
53
|
+
centerX: x + width / 2,
|
|
54
|
+
centerY: y + height / 2,
|
|
55
|
+
fontSize: props.fontSize,
|
|
56
|
+
fill: "var(--card-foreground)"
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { FlowchartDiagramNode };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=FlowchartDiagramNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowchartDiagramNode.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/FlowchartDiagramNode.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { round } from \"./FlowchartDiagram.tsx\";\nimport { FlowchartDiagramLabel } from \"./FlowchartDiagramLabel.tsx\";\nimport type { PositionedNode } from \"./layoutFlowchart.ts\";\n\nexport interface FlowchartDiagramNodeProps {\n node: PositionedNode;\n fontSize: number;\n}\n\n/**\n * One box and its label.\n *\n * The four shapes are drawn with four primitives rather than one `path`\n * each, so the SVG stays readable and a rounded rect is literally a rect\n * with an `rx`. Colours are CSS variables throughout: an element with no\n * class at all survives being extracted, and dark mode needs no second\n * palette.\n */\nexport const FlowchartDiagramNode = (props: FlowchartDiagramNodeProps) => {\n const node = props.node;\n const x = round(node.x);\n const y = round(node.y);\n const width = round(node.width);\n const height = round(node.height);\n\n return (\n <g data-node={node.id}>\n {node.shape === \"diamond\" ? (\n <polygon\n points={[\n `${round(x + width / 2)},${y}`,\n `${round(x + width)},${round(y + height / 2)}`,\n `${round(x + width / 2)},${round(y + height)}`,\n `${x},${round(y + height / 2)}`,\n ].join(\" \")}\n fill=\"var(--card)\"\n stroke=\"var(--border)\"\n strokeWidth={1.25}\n />\n ) : node.shape === \"circle\" ? (\n <ellipse\n cx={round(x + width / 2)}\n cy={round(y + height / 2)}\n rx={round(width / 2)}\n ry={round(height / 2)}\n fill=\"var(--card)\"\n stroke=\"var(--border)\"\n strokeWidth={1.25}\n />\n ) : (\n <rect\n x={x}\n y={y}\n width={width}\n height={height}\n // A \"rounded\" node is a stadium in mermaid, so the radius is half\n // the height rather than a fixed corner.\n rx={node.shape === \"rounded\" ? round(height / 2) : 5}\n ry={node.shape === \"rounded\" ? round(height / 2) : 5}\n fill=\"var(--card)\"\n stroke=\"var(--border)\"\n strokeWidth={1.25}\n />\n )}\n <FlowchartDiagramLabel\n lines={node.lines}\n centerX={x + width / 2}\n centerY={y + height / 2}\n fontSize={props.fontSize}\n fill=\"var(--card-foreground)\"\n />\n </g>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAsBA,MAAa,wBAAwB,UAAqC;CACxE,MAAM,OAAO,MAAM;CACnB,MAAM,IAAI,MAAM,KAAK,CAAC;CACtB,MAAM,IAAI,MAAM,KAAK,CAAC;CACtB,MAAM,QAAQ,MAAM,KAAK,KAAK;CAC9B,MAAM,SAAS,MAAM,KAAK,MAAM;CAEhC,OACE,qBAAC,KAAD;EAAG,aAAW,KAAK;EAAnB,UAAA,CACG,KAAK,UAAU,YACd,oBAAC,WAAD;GACE,QAAQ;IACN,GAAG,MAAM,IAAI,QAAQ,CAAC,EAAE,GAAG;IAC3B,GAAG,MAAM,IAAI,KAAK,EAAE,GAAG,MAAM,IAAI,SAAS,CAAC;IAC3C,GAAG,MAAM,IAAI,QAAQ,CAAC,EAAE,GAAG,MAAM,IAAI,MAAM;IAC3C,GAAG,EAAE,GAAG,MAAM,IAAI,SAAS,CAAC;GAC9B,CAAC,CAAC,KAAK,GAAG;GACV,MAAK;GACL,QAAO;GACP,aAAa;EACd,CAAA,IACC,KAAK,UAAU,WACjB,oBAAC,WAAD;GACE,IAAI,MAAM,IAAI,QAAQ,CAAC;GACvB,IAAI,MAAM,IAAI,SAAS,CAAC;GACxB,IAAI,MAAM,QAAQ,CAAC;GACnB,IAAI,MAAM,SAAS,CAAC;GACpB,MAAK;GACL,QAAO;GACP,aAAa;EACd,CAAA,IAED,oBAAC,QAAD;GACK;GACA;GACI;GACC;GAGR,IAAI,KAAK,UAAU,YAAY,MAAM,SAAS,CAAC,IAAI;GACnD,IAAI,KAAK,UAAU,YAAY,MAAM,SAAS,CAAC,IAAI;GACnD,MAAK;GACL,QAAO;GACP,aAAa;EACd,CAAA,GAEH,oBAAC,uBAAD;GACE,OAAO,KAAK;GACZ,SAAS,IAAI,QAAQ;GACrB,SAAS,IAAI,SAAS;GACtB,UAAU,MAAM;GAChB,MAAK;EACN,CAAA,CACA;;AAEP"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export interface MermaidFenceProps {
|
|
4
|
+
/**
|
|
5
|
+
* The raw text between the fence markers.
|
|
6
|
+
*/
|
|
7
|
+
source: string;
|
|
8
|
+
/**
|
|
9
|
+
* What to render when the source is not a flowchart we can draw. Always
|
|
10
|
+
* the code block the fence would otherwise have produced.
|
|
11
|
+
*/
|
|
12
|
+
fallback: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The lazy chunk's entry point: parse, lay out, draw - or hand back the
|
|
16
|
+
* fence untouched.
|
|
17
|
+
*
|
|
18
|
+
* This is the ONLY module that pulls in the parser, `graphre` and the
|
|
19
|
+
* emitter, and it is imported through `lazy()` from `markdown-view.tsx`.
|
|
20
|
+
* That is the epic's whole constraint: a document with no diagram must pay
|
|
21
|
+
* nothing at all.
|
|
22
|
+
*
|
|
23
|
+
* **Failure is always the code block, silently.** Agents write invalid
|
|
24
|
+
* mermaid, and a red error box in the middle of a folio is worse than a grey
|
|
25
|
+
* fence. A parse failure, a graph past the cap, and a `sequenceDiagram` all
|
|
26
|
+
* land here identically.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MermaidFence: (props: MermaidFenceProps) => React.JSX.Element;
|
|
29
|
+
export default MermaidFence;
|
|
30
|
+
//# sourceMappingURL=MermaidFence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MermaidFence.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/MermaidFence.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,UAAW,iBAAiB,sBAKpD,CAAC;eAIa,YAAY"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FlowchartDiagram } from "./FlowchartDiagram.js";
|
|
2
|
+
import { parseFlowchart } from "./flowchartParser.js";
|
|
3
|
+
import { layoutFlowchart } from "./layoutFlowchart.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/markdown-view/diagram/MermaidFence.tsx
|
|
7
|
+
/**
|
|
8
|
+
* The lazy chunk's entry point: parse, lay out, draw - or hand back the
|
|
9
|
+
* fence untouched.
|
|
10
|
+
*
|
|
11
|
+
* This is the ONLY module that pulls in the parser, `graphre` and the
|
|
12
|
+
* emitter, and it is imported through `lazy()` from `markdown-view.tsx`.
|
|
13
|
+
* That is the epic's whole constraint: a document with no diagram must pay
|
|
14
|
+
* nothing at all.
|
|
15
|
+
*
|
|
16
|
+
* **Failure is always the code block, silently.** Agents write invalid
|
|
17
|
+
* mermaid, and a red error box in the middle of a folio is worse than a grey
|
|
18
|
+
* fence. A parse failure, a graph past the cap, and a `sequenceDiagram` all
|
|
19
|
+
* land here identically.
|
|
20
|
+
*/
|
|
21
|
+
const MermaidFence = (props) => {
|
|
22
|
+
const model = parseFlowchart(props.source);
|
|
23
|
+
const graph = model ? layoutFlowchart(model) : void 0;
|
|
24
|
+
if (!graph) return /* @__PURE__ */ jsx(Fragment$1, { children: props.fallback });
|
|
25
|
+
return /* @__PURE__ */ jsx(FlowchartDiagram, { graph });
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { MermaidFence, MermaidFence as default };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=MermaidFence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MermaidFence.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/MermaidFence.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport type { ReactNode } from \"react\";\n\nimport { FlowchartDiagram } from \"./FlowchartDiagram.tsx\";\nimport { parseFlowchart } from \"./flowchartParser.ts\";\nimport { layoutFlowchart } from \"./layoutFlowchart.ts\";\n\nexport interface MermaidFenceProps {\n /**\n * The raw text between the fence markers.\n */\n source: string;\n /**\n * What to render when the source is not a flowchart we can draw. Always\n * the code block the fence would otherwise have produced.\n */\n fallback: ReactNode;\n}\n\n/**\n * The lazy chunk's entry point: parse, lay out, draw - or hand back the\n * fence untouched.\n *\n * This is the ONLY module that pulls in the parser, `graphre` and the\n * emitter, and it is imported through `lazy()` from `markdown-view.tsx`.\n * That is the epic's whole constraint: a document with no diagram must pay\n * nothing at all.\n *\n * **Failure is always the code block, silently.** Agents write invalid\n * mermaid, and a red error box in the middle of a folio is worse than a grey\n * fence. A parse failure, a graph past the cap, and a `sequenceDiagram` all\n * land here identically.\n */\nexport const MermaidFence = (props: MermaidFenceProps) => {\n const model = parseFlowchart(props.source);\n const graph = model ? layoutFlowchart(model) : undefined;\n if (!graph) return <>{props.fallback}</>;\n return <FlowchartDiagram graph={graph} />;\n};\n\n// Default export as well, so the `lazy()` call site stays a bare\n// `import(...)` with no `.then(m => ({ default: m.X }))` wrapper.\nexport default MermaidFence;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,gBAAgB,UAA6B;CACxD,MAAM,QAAQ,eAAe,MAAM,MAAM;CACzC,MAAM,QAAQ,QAAQ,gBAAgB,KAAK,IAAI,KAAA;CAC/C,IAAI,CAAC,OAAO,OAAO,oBAAA,YAAA,EAAA,UAAG,MAAM,SAAW,CAAA;CACvC,OAAO,oBAAC,kBAAD,EAAyB,MAAQ,CAAA;AAC1C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GraphModel } from "./graphModel.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Parse the text inside a ` ```mermaid ` fence into a `GraphModel`.
|
|
4
|
+
*
|
|
5
|
+
* Pure string in, data out: no layout knowledge, no DOM, no React. The
|
|
6
|
+
* subset is mermaid's `flowchart` as agents actually write it, not as the
|
|
7
|
+
* documentation leads with - inline node declarations, both label forms,
|
|
8
|
+
* chains, fans, `<br/>`, and every bracket pair mermaid has, mapped onto
|
|
9
|
+
* the four shapes the emitter draws.
|
|
10
|
+
*
|
|
11
|
+
* **It never throws and it never fails loudly.** The caller's fallback is
|
|
12
|
+
* the original code block, so an unreadable statement is skipped and an
|
|
13
|
+
* unreadable document returns `undefined`. Anything that is not a
|
|
14
|
+
* `flowchart` / `graph` (a `sequenceDiagram`, a `gantt`) returns
|
|
15
|
+
* `undefined` on the header line and degrades to the fence.
|
|
16
|
+
*/
|
|
17
|
+
export declare const parseFlowchart: (source: string) => GraphModel | undefined;
|
|
18
|
+
//# sourceMappingURL=flowchartParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowchartParser.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/flowchartParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,UAAU,EAGX,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,WAAY,MAAM,KAAG,UAAU,GAAG,SAO5D,CAAC"}
|