@alepha/ui 0.27.0 → 0.27.1
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 +56 -15
- package/dist/components/account/account-connections.d.ts.map +1 -1
- package/dist/components/account/account-connections.js +24 -13
- package/dist/components/account/account-connections.js.map +1 -1
- package/dist/components/account/account-delete-dialog.d.ts.map +1 -1
- package/dist/components/account/account-delete-dialog.js +12 -8
- package/dist/components/account/account-delete-dialog.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/components/account/account-keys.js +35 -21
- package/dist/components/account/account-keys.js.map +1 -1
- package/dist/components/account/account-mfa-dialog.d.ts +20 -0
- package/dist/components/account/account-mfa-dialog.d.ts.map +1 -0
- package/dist/components/account/account-mfa-dialog.js +149 -0
- package/dist/components/account/account-mfa-dialog.js.map +1 -0
- package/dist/components/account/account-password-dialog.d.ts.map +1 -1
- package/dist/components/account/account-password-dialog.js +15 -10
- package/dist/components/account/account-password-dialog.js.map +1 -1
- package/dist/components/account/account-profile.d.ts.map +1 -1
- package/dist/components/account/account-profile.js +25 -25
- package/dist/components/account/account-profile.js.map +1 -1
- package/dist/components/account/account-router.d.ts +76 -2
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +44 -4
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/account/account-security.d.ts +11 -1
- package/dist/components/account/account-security.d.ts.map +1 -1
- package/dist/components/account/account-security.js +119 -32
- 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 +46 -24
- package/dist/components/account/account-sessions.js.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.js +4 -9
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.js +3 -3
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-labels.d.ts +26 -0
- package/dist/components/admin/admin-jobs-status-labels.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-status-labels.js +46 -0
- package/dist/components/admin/admin-jobs-status-labels.js.map +1 -0
- package/dist/components/admin/admin-layout.d.ts.map +1 -1
- package/dist/components/admin/admin-layout.js +5 -3
- package/dist/components/admin/admin-layout.js.map +1 -1
- package/dist/components/admin/admin-notifications-detail-tabs.d.ts +21 -0
- package/dist/components/admin/admin-notifications-detail-tabs.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-detail-tabs.js +122 -0
- package/dist/components/admin/admin-notifications-detail-tabs.js.map +1 -0
- package/dist/components/admin/admin-notifications-detail.d.ts +23 -0
- package/dist/components/admin/admin-notifications-detail.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-detail.js +48 -0
- package/dist/components/admin/admin-notifications-detail.js.map +1 -0
- package/dist/components/admin/admin-notifications-preview-body.d.ts +13 -0
- package/dist/components/admin/admin-notifications-preview-body.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-preview-body.js +64 -0
- package/dist/components/admin/admin-notifications-preview-body.js.map +1 -0
- package/dist/components/admin/admin-notifications-preview-tab.d.ts +24 -0
- package/dist/components/admin/admin-notifications-preview-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-preview-tab.js +35 -0
- package/dist/components/admin/admin-notifications-preview-tab.js.map +1 -0
- package/dist/components/admin/admin-notifications-raw-tab.d.ts +18 -0
- package/dist/components/admin/admin-notifications-raw-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-raw-tab.js +53 -0
- package/dist/components/admin/admin-notifications-raw-tab.js.map +1 -0
- package/dist/components/admin/admin-notifications-status-badge.d.ts +17 -0
- package/dist/components/admin/admin-notifications-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-status-badge.js +32 -0
- package/dist/components/admin/admin-notifications-status-badge.js.map +1 -0
- package/dist/components/admin/admin-notifications-status-labels.d.ts +17 -0
- package/dist/components/admin/admin-notifications-status-labels.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-status-labels.js +33 -0
- package/dist/components/admin/admin-notifications-status-labels.js.map +1 -0
- package/dist/components/admin/admin-notifications-status-tones.d.ts +44 -0
- package/dist/components/admin/admin-notifications-status-tones.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-status-tones.js +64 -0
- package/dist/components/admin/admin-notifications-status-tones.js.map +1 -0
- package/dist/components/admin/admin-notifications-template-label.d.ts +16 -0
- package/dist/components/admin/admin-notifications-template-label.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-template-label.js +24 -0
- package/dist/components/admin/admin-notifications-template-label.js.map +1 -0
- package/dist/components/admin/admin-notifications.d.ts +13 -2
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +264 -29
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +29 -2
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +68 -8
- package/dist/components/admin/admin-router.js.map +1 -1
- package/dist/components/admin/admin-sessions.d.ts.map +1 -1
- package/dist/components/admin/admin-sessions.js +1 -1
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.d.ts +12 -2
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.js +63 -44
- package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.js +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 +20 -15
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users.js +1 -1
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +4 -12
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.js +3 -3
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-labels.d.ts +19 -0
- package/dist/components/admin/admin-workflows-status-labels.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-status-labels.js +48 -0
- package/dist/components/admin/admin-workflows-status-labels.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +6 -0
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +33 -5
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/auth/auth-login.d.ts.map +1 -1
- package/dist/components/auth/auth-login.js +27 -17
- package/dist/components/auth/auth-login.js.map +1 -1
- package/dist/components/auth/auth-mfa-step.d.ts +25 -0
- package/dist/components/auth/auth-mfa-step.d.ts.map +1 -0
- package/dist/components/auth/auth-mfa-step.js +122 -0
- package/dist/components/auth/auth-mfa-step.js.map +1 -0
- package/dist/components/auth/auth-register.js +2 -2
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auth/auth-reset-password.js +2 -2
- package/dist/components/auth/auth-router.d.ts +20 -0
- package/dist/components/auth/auth-router.d.ts.map +1 -1
- package/dist/components/auth/provider-labels.d.ts.map +1 -1
- package/dist/components/auth/provider-labels.js +1 -0
- package/dist/components/auth/provider-labels.js.map +1 -1
- package/dist/components/control/control.d.ts +11 -2
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +7 -2
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.d.ts.map +1 -1
- package/dist/components/control-array/control-array.js +55 -10
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-number/control-number.d.ts +5 -0
- package/dist/components/control-number/control-number.d.ts.map +1 -1
- package/dist/components/control-number/control-number.js +1 -0
- package/dist/components/control-number/control-number.js.map +1 -1
- package/dist/components/control-object/control-object.d.ts +12 -1
- package/dist/components/control-object/control-object.d.ts.map +1 -1
- package/dist/components/control-object/control-object.js +2 -1
- package/dist/components/control-object/control-object.js.map +1 -1
- package/dist/components/control-password/control-password.d.ts.map +1 -1
- package/dist/components/control-password/control-password.js +1 -0
- package/dist/components/control-password/control-password.js.map +1 -1
- package/dist/components/detail/detail-layout.d.ts +6 -0
- package/dist/components/detail/detail-layout.d.ts.map +1 -1
- package/dist/components/detail/detail-layout.js +2 -1
- package/dist/components/detail/detail-layout.js.map +1 -1
- package/dist/components/email-body-frame/email-body-frame.d.ts +37 -0
- package/dist/components/email-body-frame/email-body-frame.d.ts.map +1 -0
- package/dist/components/email-body-frame/email-body-frame.js +44 -0
- package/dist/components/email-body-frame/email-body-frame.js.map +1 -0
- package/dist/components/markdown-view/diagram/DiagramLabel.d.ts +33 -0
- package/dist/components/markdown-view/diagram/DiagramLabel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/{FlowchartDiagramLabel.js → DiagramLabel.js} +15 -6
- package/dist/components/markdown-view/diagram/DiagramLabel.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts +0 -5
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js +2 -6
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js +2 -3
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js +2 -3
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js.map +1 -1
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts +20 -11
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/MermaidFence.js +48 -13
- package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -1
- package/dist/components/markdown-view/diagram/SequenceDiagram.d.ts +50 -0
- package/dist/components/markdown-view/diagram/SequenceDiagram.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagram.js +141 -0
- package/dist/components/markdown-view/diagram/SequenceDiagram.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.d.ts +23 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.js +101 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.d.ts +23 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.js +77 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.d.ts +16 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.js +39 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.d.ts +20 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.js +61 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.d.ts +27 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.js +65 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.js.map +1 -0
- package/dist/components/markdown-view/diagram/layoutSequence.d.ts +155 -0
- package/dist/components/markdown-view/diagram/layoutSequence.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/layoutSequence.js +478 -0
- package/dist/components/markdown-view/diagram/layoutSequence.js.map +1 -0
- package/dist/components/markdown-view/diagram/sequenceModel.d.ts +132 -0
- package/dist/components/markdown-view/diagram/sequenceModel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/sequenceModel.js +0 -0
- package/dist/components/markdown-view/diagram/sequenceParser.d.ts +32 -0
- package/dist/components/markdown-view/diagram/sequenceParser.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/sequenceParser.js +312 -0
- package/dist/components/markdown-view/diagram/sequenceParser.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.css +65 -0
- package/dist/components/markdown-view/markdown-view.d.ts +18 -11
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +30 -16
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/nav-shell/nav-page.d.ts +7 -0
- package/dist/components/nav-shell/nav-page.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-page.js.map +1 -1
- package/dist/components/nav-shell/nav-tree-util.d.ts +64 -2
- package/dist/components/nav-shell/nav-tree-util.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-tree-util.js +29 -6
- package/dist/components/nav-shell/nav-tree-util.js.map +1 -1
- package/dist/components/nav-shell/spotlight.d.ts +3 -2
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -1
- package/dist/components/nav-shell/spotlight.js +9 -6
- 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 +9 -2
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.d.ts +6 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.js +8 -3
- 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 +1 -1
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +1 -1
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +2 -2
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +1 -0
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +2 -2
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +1 -0
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +2 -2
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +1 -0
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/card.d.ts +2 -2
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +1 -0
- package/dist/components/ui/card.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 +1 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.d.ts +2 -2
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +1 -0
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +2 -2
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +1 -0
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.d.ts +1 -1
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +2 -2
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +1 -0
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.d.ts +1 -1
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +1 -0
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.d.ts +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +1 -0
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +2 -2
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +1 -0
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +1 -1
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +1 -0
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -0
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/segmented.d.ts +11 -0
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +6 -2
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select.d.ts +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +1 -0
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +2 -2
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +1 -0
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +2 -2
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +1 -0
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +1 -0
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +1 -11
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +0 -10
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +252 -2
- package/dist/lib/i18n-fr.js.map +1 -1
- package/package.json +5 -5
- package/src/components/account/__tests__/account-router.spec.ts +25 -0
- package/src/components/account/__tests__/account-security-mfa-gate.browser.spec.tsx +76 -0
- package/src/components/account/account-connections.tsx +50 -18
- package/src/components/account/account-delete-dialog.tsx +24 -9
- package/src/components/account/account-header.tsx +4 -1
- package/src/components/account/account-keys.tsx +73 -29
- package/src/components/account/account-mfa-dialog.tsx +233 -0
- package/src/components/account/account-password-dialog.tsx +42 -12
- package/src/components/account/account-profile.tsx +66 -25
- package/src/components/account/account-router.tsx +47 -6
- package/src/components/account/account-security.tsx +209 -22
- package/src/components/account/account-sessions.tsx +87 -22
- package/src/components/action-error-toaster/__tests__/action-error-toaster.browser.spec.tsx +114 -0
- package/src/components/admin/__tests__/admin-nav-i18n.browser.spec.tsx +152 -0
- package/src/components/admin/__tests__/admin-notifications-preview-body.browser.spec.tsx +128 -0
- package/src/components/admin/__tests__/admin-notifications-raw-tab.browser.spec.tsx +76 -0
- package/src/components/admin/__tests__/admin-notifications-status-badge.browser.spec.tsx +121 -0
- package/src/components/admin/__tests__/admin-router.spec.ts +27 -0
- package/src/components/admin/__tests__/admin-status-labels.browser.spec.tsx +152 -0
- package/src/components/admin/__tests__/admin-user-detail-security-tab.browser.spec.tsx +92 -0
- package/src/components/admin/admin-jobs-executions-panel.tsx +8 -11
- package/src/components/admin/admin-jobs-status-badge.tsx +4 -5
- package/src/components/admin/admin-jobs-status-labels.ts +46 -0
- package/src/components/admin/admin-layout.tsx +9 -3
- package/src/components/admin/admin-notifications-detail-tabs.tsx +167 -0
- package/src/components/admin/admin-notifications-detail.tsx +100 -0
- package/src/components/admin/admin-notifications-preview-body.tsx +104 -0
- package/src/components/admin/admin-notifications-preview-tab.tsx +55 -0
- package/src/components/admin/admin-notifications-raw-tab.tsx +76 -0
- package/src/components/admin/admin-notifications-status-badge.tsx +44 -0
- package/src/components/admin/admin-notifications-status-labels.ts +42 -0
- package/src/components/admin/admin-notifications-status-tones.ts +85 -0
- package/src/components/admin/admin-notifications-template-label.ts +22 -0
- package/src/components/admin/admin-notifications.tsx +398 -31
- package/src/components/admin/admin-router.tsx +65 -8
- package/src/components/admin/admin-sessions.tsx +10 -3
- package/src/components/admin/admin-user-detail-security-tab.tsx +70 -5
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +10 -3
- package/src/components/admin/admin-user-detail.tsx +92 -23
- package/src/components/admin/admin-users.tsx +1 -1
- package/src/components/admin/admin-workflows-executions-panel.tsx +8 -16
- package/src/components/admin/admin-workflows-status-badge.tsx +4 -5
- package/src/components/admin/admin-workflows-status-labels.ts +51 -0
- package/src/components/alepha-table/__tests__/alepha-table-row-key.browser.spec.tsx +106 -0
- package/src/components/alepha-table/alepha-table.tsx +50 -10
- package/src/components/auth/auth-login.tsx +37 -18
- package/src/components/auth/auth-mfa-step.tsx +177 -0
- package/src/components/auth/auth-register.tsx +1 -1
- package/src/components/auth/provider-labels.ts +4 -0
- package/src/components/control/__tests__/control-autofocus.browser.spec.tsx +107 -0
- package/src/components/control/control.tsx +20 -5
- package/src/components/control-array/__tests__/control-array-child-change.browser.spec.tsx +90 -0
- package/src/components/control-array/control-array.tsx +85 -13
- package/src/components/control-number/control-number.tsx +7 -0
- package/src/components/control-object/__tests__/control-object-clear.browser.spec.tsx +100 -0
- package/src/components/control-object/control-object.tsx +21 -2
- package/src/components/control-password/control-password.tsx +2 -1
- package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +36 -0
- package/src/components/detail/detail-layout.tsx +20 -1
- package/src/components/email-body-frame/__tests__/email-body-frame.browser.spec.tsx +52 -0
- package/src/components/email-body-frame/email-body-frame.tsx +81 -0
- package/src/components/markdown-view/__tests__/markdown-view-mermaid.browser.spec.tsx +65 -2
- package/src/components/markdown-view/diagram/{FlowchartDiagramLabel.tsx → DiagramLabel.tsx} +14 -4
- package/src/components/markdown-view/diagram/FlowchartDiagram.tsx +1 -6
- package/src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx +1 -1
- package/src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx +2 -3
- package/src/components/markdown-view/diagram/FlowchartDiagramNode.tsx +2 -3
- package/src/components/markdown-view/diagram/MermaidFence.tsx +65 -15
- package/src/components/markdown-view/diagram/SequenceDiagram.tsx +203 -0
- package/src/components/markdown-view/diagram/SequenceDiagramFragment.tsx +120 -0
- package/src/components/markdown-view/diagram/SequenceDiagramMessage.tsx +100 -0
- package/src/components/markdown-view/diagram/SequenceDiagramNote.tsx +46 -0
- package/src/components/markdown-view/diagram/SequenceDiagramParticipant.tsx +80 -0
- package/src/components/markdown-view/diagram/SequenceDiagramParticipantActor.tsx +74 -0
- package/src/components/markdown-view/diagram/__tests__/sequence-diagram.browser.spec.tsx +267 -0
- package/src/components/markdown-view/diagram/layoutSequence.spec.ts +535 -0
- package/src/components/markdown-view/diagram/layoutSequence.ts +764 -0
- package/src/components/markdown-view/diagram/sequenceModel.ts +141 -0
- package/src/components/markdown-view/diagram/sequenceParser.spec.ts +495 -0
- package/src/components/markdown-view/diagram/sequenceParser.ts +443 -0
- package/src/components/markdown-view/markdown-view.css +65 -0
- package/src/components/markdown-view/markdown-view.tsx +34 -16
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +107 -1
- package/src/components/nav-shell/nav-page.tsx +8 -0
- package/src/components/nav-shell/nav-tree-util.ts +95 -2
- package/src/components/nav-shell/spotlight.tsx +22 -8
- package/src/components/nav-shell/use-nav-breadcrumbs.ts +9 -2
- package/src/components/nav-shell/use-nav-entries.ts +18 -2
- package/src/components/nav-shell/use-nav-tree.ts +4 -1
- package/src/components/ui/alert-dialog.tsx +1 -1
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +3 -3
- package/src/components/ui/breadcrumb.tsx +3 -3
- package/src/components/ui/card.tsx +5 -5
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/combobox.tsx +8 -8
- package/src/components/ui/command.tsx +4 -4
- package/src/components/ui/context-menu.tsx +7 -7
- package/src/components/ui/dialog.tsx +1 -1
- package/src/components/ui/drawer.tsx +6 -6
- package/src/components/ui/dropdown-menu.tsx +8 -14
- package/src/components/ui/empty.tsx +3 -3
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-group.tsx +2 -2
- package/src/components/ui/input-otp.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/menubar.tsx +9 -9
- package/src/components/ui/pagination.tsx +1 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +1 -1
- package/src/components/ui/segmented.tsx +28 -0
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/sheet.tsx +4 -4
- package/src/components/ui/switch.tsx +1 -1
- package/src/components/ui/table.tsx +6 -9
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/tooltip.tsx +3 -11
- package/src/components/use-dialog/__tests__/use-dialog-providers.browser.spec.tsx +61 -0
- package/src/hooks/use-mobile.ts +1 -1
- package/src/lib/__tests__/i18n-fr.spec.ts +27 -5
- package/src/lib/i18n-fr.ts +308 -1
- package/dist/components/language-toggle/language-toggle.d.ts +0 -8
- package/dist/components/language-toggle/language-toggle.d.ts.map +0 -1
- package/dist/components/language-toggle/language-toggle.js +0 -49
- package/dist/components/language-toggle/language-toggle.js.map +0 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts +0 -23
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts.map +0 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js.map +0 -1
- package/dist/components/ui/accordion.d.ts +0 -7
- package/dist/components/ui/accordion.d.ts.map +0 -1
- package/dist/components/ui/accordion.js +0 -55
- package/dist/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/aspect-ratio.d.ts +0 -5
- package/dist/components/ui/aspect-ratio.d.ts.map +0 -1
- package/dist/components/ui/aspect-ratio.js +0 -15
- package/dist/components/ui/aspect-ratio.js.map +0 -1
- package/dist/components/ui/carousel.d.ts +0 -29
- package/dist/components/ui/carousel.d.ts.map +0 -1
- package/dist/components/ui/carousel.js +0 -144
- package/dist/components/ui/carousel.js.map +0 -1
- package/dist/components/ui/collapsible.d.ts +0 -6
- package/dist/components/ui/collapsible.d.ts.map +0 -1
- package/dist/components/ui/collapsible.js +0 -26
- package/dist/components/ui/collapsible.js.map +0 -1
- package/dist/components/ui/direction.d.ts +0 -2
- package/dist/components/ui/direction.d.ts.map +0 -1
- package/dist/components/ui/direction.js +0 -3
- package/dist/components/ui/item.d.ts +0 -23
- package/dist/components/ui/item.d.ts.map +0 -1
- package/dist/components/ui/item.js +0 -122
- package/dist/components/ui/item.js.map +0 -1
- package/dist/components/ui/navigation-menu.d.ts +0 -12
- package/dist/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/components/ui/navigation-menu.js +0 -84
- package/dist/components/ui/navigation-menu.js.map +0 -1
- package/dist/components/ui/radio-group.d.ts +0 -6
- package/dist/components/ui/radio-group.d.ts.map +0 -1
- package/dist/components/ui/radio-group.js +0 -29
- package/dist/components/ui/radio-group.js.map +0 -1
- package/dist/components/ui/scroll-area.d.ts +0 -5
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.js +0 -38
- package/dist/components/ui/scroll-area.js.map +0 -1
- package/dist/components/ui/toggle-group.d.ts +0 -12
- package/dist/components/ui/toggle-group.d.ts.map +0 -1
- package/dist/components/ui/toggle-group.js +0 -60
- package/dist/components/ui/toggle-group.js.map +0 -1
- package/dist/components/ui/toggle.d.ts +0 -9
- package/dist/components/ui/toggle.d.ts.map +0 -1
- package/dist/components/ui/toggle.js +0 -38
- package/dist/components/ui/toggle.js.map +0 -1
- package/src/components/language-toggle/language-toggle.tsx +0 -66
- package/src/components/ui/accordion.tsx +0 -77
- package/src/components/ui/aspect-ratio.tsx +0 -22
- package/src/components/ui/carousel.tsx +0 -258
- package/src/components/ui/collapsible.tsx +0 -21
- package/src/components/ui/direction.tsx +0 -6
- package/src/components/ui/item.tsx +0 -200
- package/src/components/ui/navigation-menu.tsx +0 -170
- package/src/components/ui/radio-group.tsx +0 -37
- package/src/components/ui/scroll-area.tsx +0 -53
- package/src/components/ui/toggle-group.tsx +0 -93
- package/src/components/ui/toggle.tsx +0 -44
|
@@ -54,16 +54,79 @@ describe("MarkdownView - mermaid fences", () => {
|
|
|
54
54
|
expect(container.querySelector("svg")).toBeNull();
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
+
it("renders a sequenceDiagram fence as an svg", async () => {
|
|
58
|
+
const { container } = render(
|
|
59
|
+
<MarkdownView
|
|
60
|
+
content={fence("mermaid", "sequenceDiagram\n A ->> B: hello")}
|
|
61
|
+
/>,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
await waitFor(() => expect(container.querySelector("svg")).not.toBeNull());
|
|
65
|
+
expect(container.textContent).toContain("hello");
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("dispatches on the header, not on what happens to parse", async () => {
|
|
69
|
+
const { container } = render(
|
|
70
|
+
<MarkdownView
|
|
71
|
+
content={[
|
|
72
|
+
fence("mermaid", "flowchart LR\n A[Node] --> B"),
|
|
73
|
+
fence("mermaid", "sequenceDiagram\n A ->> B: msg"),
|
|
74
|
+
].join("\n\n")}
|
|
75
|
+
/>,
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
await waitFor(() =>
|
|
79
|
+
expect(container.querySelectorAll("svg")).toHaveLength(2),
|
|
80
|
+
);
|
|
81
|
+
// The flowchart scales into the column and has no scroll frame; the
|
|
82
|
+
// sequence diagram takes its natural width inside one.
|
|
83
|
+
expect(container.querySelectorAll('[role="region"]')).toHaveLength(1);
|
|
84
|
+
expect(container.textContent).toContain("Node");
|
|
85
|
+
expect(container.textContent).toContain("msg");
|
|
86
|
+
});
|
|
87
|
+
|
|
57
88
|
it("falls back to the code block for a diagram type outside the subset", async () => {
|
|
58
89
|
const { container } = render(
|
|
59
90
|
<MarkdownView
|
|
60
|
-
content={fence("mermaid", "
|
|
91
|
+
content={fence("mermaid", "classDiagram\n Animal <|-- Duck")}
|
|
92
|
+
/>,
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
await waitFor(() => expect(container.querySelector("pre")).not.toBeNull());
|
|
96
|
+
expect(container.querySelector("svg")).toBeNull();
|
|
97
|
+
expect(container.textContent).toContain("classDiagram");
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("falls back to the code block for a refused sequence construct", async () => {
|
|
101
|
+
const { container } = render(
|
|
102
|
+
<MarkdownView
|
|
103
|
+
content={fence(
|
|
104
|
+
"mermaid",
|
|
105
|
+
"sequenceDiagram\n par both at once\n A ->> B: one\n end",
|
|
106
|
+
)}
|
|
61
107
|
/>,
|
|
62
108
|
);
|
|
63
109
|
|
|
110
|
+
// `par` refuses rather than drawing its branches one under the other,
|
|
111
|
+
// which would assert an ordering that is false.
|
|
64
112
|
await waitFor(() => expect(container.querySelector("pre")).not.toBeNull());
|
|
65
113
|
expect(container.querySelector("svg")).toBeNull();
|
|
66
|
-
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("frames a sequence diagram so a wide one can be scrolled", async () => {
|
|
117
|
+
const { container } = render(
|
|
118
|
+
<MarkdownView
|
|
119
|
+
content={fence("mermaid", "sequenceDiagram\n A ->> B: hi")}
|
|
120
|
+
/>,
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
await waitFor(() => expect(container.querySelector("svg")).not.toBeNull());
|
|
124
|
+
const frame = container.querySelector('[role="region"]');
|
|
125
|
+
// A scrollable region that cannot take focus cannot be scrolled from a
|
|
126
|
+
// keyboard, so whatever is past the fold is simply unreachable.
|
|
127
|
+
expect(frame?.getAttribute("tabindex")).toBe("0");
|
|
128
|
+
expect(frame?.getAttribute("aria-label")).toBeTruthy();
|
|
129
|
+
expect(frame?.className).toContain("alepha-diagram-scroll");
|
|
67
130
|
});
|
|
68
131
|
|
|
69
132
|
it("keeps the diagram source readable in the fallback", async () => {
|
|
@@ -2,10 +2,18 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
void React;
|
|
4
4
|
|
|
5
|
-
import { round } from "./FlowchartDiagram.tsx";
|
|
6
5
|
import { DIAGRAM_LINE_HEIGHT } from "./textMetrics.ts";
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Two decimals is plenty for a diagram and keeps the emitted attributes
|
|
9
|
+
* readable; a layout's raw coordinates carry a dozen.
|
|
10
|
+
*
|
|
11
|
+
* It lives here rather than in either emitter because both of them draw
|
|
12
|
+
* with it, the same way both measure with `textMetrics.ts`.
|
|
13
|
+
*/
|
|
14
|
+
export const round = (value: number): number => Math.round(value * 100) / 100;
|
|
15
|
+
|
|
16
|
+
export interface DiagramLabelProps {
|
|
9
17
|
/**
|
|
10
18
|
* Already wrapped and capped by `measureLabel` - draw exactly these.
|
|
11
19
|
*/
|
|
@@ -17,7 +25,9 @@ export interface FlowchartDiagramLabelProps {
|
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
/**
|
|
20
|
-
* A centred, multi-line label, one `tspan` per line.
|
|
28
|
+
* A centred, multi-line label, one `tspan` per line. Shared by both
|
|
29
|
+
* diagram pipelines: a flowchart node label and a sequence message label
|
|
30
|
+
* are the same drawing problem.
|
|
21
31
|
*
|
|
22
32
|
* The line box has to match `DIAGRAM_LINE_HEIGHT`, which is what
|
|
23
33
|
* `measureLabel` sized the box with: text and box disagreeing is the
|
|
@@ -26,7 +36,7 @@ export interface FlowchartDiagramLabelProps {
|
|
|
26
36
|
* `dominant-baseline` is not used: jsdom and older Safari disagree about it,
|
|
27
37
|
* and shifting the first line by hand is arithmetic that works everywhere.
|
|
28
38
|
*/
|
|
29
|
-
export const
|
|
39
|
+
export const DiagramLabel = (props: DiagramLabelProps) => {
|
|
30
40
|
const lineBox = props.fontSize * DIAGRAM_LINE_HEIGHT;
|
|
31
41
|
// The stack is centred on `centerY`, then each line sits on its own
|
|
32
42
|
// baseline. `0.36em` is the optical centre of a lowercase run.
|
|
@@ -4,6 +4,7 @@ void React;
|
|
|
4
4
|
|
|
5
5
|
import { useId } from "react";
|
|
6
6
|
|
|
7
|
+
import { round } from "./DiagramLabel.tsx";
|
|
7
8
|
import { FlowchartDiagramCluster } from "./FlowchartDiagramCluster.tsx";
|
|
8
9
|
import { FlowchartDiagramEdge } from "./FlowchartDiagramEdge.tsx";
|
|
9
10
|
import { FlowchartDiagramNode } from "./FlowchartDiagramNode.tsx";
|
|
@@ -128,9 +129,3 @@ export const FlowchartDiagram = (props: FlowchartDiagramProps) => {
|
|
|
128
129
|
</svg>
|
|
129
130
|
);
|
|
130
131
|
};
|
|
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;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
void React;
|
|
4
4
|
|
|
5
|
-
import { round } from "./
|
|
5
|
+
import { round } from "./DiagramLabel.tsx";
|
|
6
6
|
import type { PositionedCluster } from "./layoutFlowchart.ts";
|
|
7
7
|
import { DIAGRAM_FONT_SIZE } from "./textMetrics.ts";
|
|
8
8
|
|
|
@@ -2,8 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
void React;
|
|
4
4
|
|
|
5
|
-
import { round } from "./
|
|
6
|
-
import { FlowchartDiagramLabel } from "./FlowchartDiagramLabel.tsx";
|
|
5
|
+
import { DiagramLabel, round } from "./DiagramLabel.tsx";
|
|
7
6
|
import type { PositionedEdge } from "./layoutFlowchart.ts";
|
|
8
7
|
|
|
9
8
|
export interface FlowchartDiagramEdgeProps {
|
|
@@ -58,7 +57,7 @@ export const FlowchartDiagramEdge = (props: FlowchartDiagramEdgeProps) => {
|
|
|
58
57
|
ry={4}
|
|
59
58
|
fill="var(--background)"
|
|
60
59
|
/>
|
|
61
|
-
<
|
|
60
|
+
<DiagramLabel
|
|
62
61
|
lines={edge.label.lines}
|
|
63
62
|
centerX={edge.label.x + edge.label.width / 2}
|
|
64
63
|
centerY={edge.label.y + edge.label.height / 2}
|
|
@@ -2,8 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
void React;
|
|
4
4
|
|
|
5
|
-
import { round } from "./
|
|
6
|
-
import { FlowchartDiagramLabel } from "./FlowchartDiagramLabel.tsx";
|
|
5
|
+
import { DiagramLabel, round } from "./DiagramLabel.tsx";
|
|
7
6
|
import type { PositionedNode } from "./layoutFlowchart.ts";
|
|
8
7
|
|
|
9
8
|
export interface FlowchartDiagramNodeProps {
|
|
@@ -66,7 +65,7 @@ export const FlowchartDiagramNode = (props: FlowchartDiagramNodeProps) => {
|
|
|
66
65
|
strokeWidth={1.25}
|
|
67
66
|
/>
|
|
68
67
|
)}
|
|
69
|
-
<
|
|
68
|
+
<DiagramLabel
|
|
70
69
|
lines={node.lines}
|
|
71
70
|
centerX={x + width / 2}
|
|
72
71
|
centerY={y + height / 2}
|
|
@@ -7,6 +7,9 @@ import type { ReactNode } from "react";
|
|
|
7
7
|
import { FlowchartDiagram } from "./FlowchartDiagram.tsx";
|
|
8
8
|
import { parseFlowchart } from "./flowchartParser.ts";
|
|
9
9
|
import { layoutFlowchart } from "./layoutFlowchart.ts";
|
|
10
|
+
import { layoutSequence } from "./layoutSequence.ts";
|
|
11
|
+
import { SequenceDiagram } from "./SequenceDiagram.tsx";
|
|
12
|
+
import { parseSequence } from "./sequenceParser.ts";
|
|
10
13
|
|
|
11
14
|
export interface MermaidFenceProps {
|
|
12
15
|
/**
|
|
@@ -14,31 +17,78 @@ export interface MermaidFenceProps {
|
|
|
14
17
|
*/
|
|
15
18
|
source: string;
|
|
16
19
|
/**
|
|
17
|
-
* What to render when the source is not a
|
|
18
|
-
*
|
|
20
|
+
* What to render when the source is not a diagram we can draw. Always the
|
|
21
|
+
* code block the fence would otherwise have produced.
|
|
19
22
|
*/
|
|
20
23
|
fallback: ReactNode;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
/**
|
|
24
|
-
* The lazy chunk's entry point
|
|
25
|
-
* fence
|
|
27
|
+
* The lazy chunk's entry point, and the dispatcher between the two
|
|
28
|
+
* pipelines: read the header, parse, lay out, draw - or hand back the fence
|
|
29
|
+
* untouched.
|
|
26
30
|
*
|
|
27
|
-
* This is the ONLY module that pulls in
|
|
31
|
+
* This is the ONLY module that pulls in either parser, `graphre` and either
|
|
28
32
|
* emitter, and it is imported through `lazy()` from `markdown-view.tsx`.
|
|
29
|
-
* That is the
|
|
30
|
-
* nothing at all.
|
|
33
|
+
* That is the whole constraint the diagram layer lives under: a document
|
|
34
|
+
* with no diagram must pay nothing at all.
|
|
31
35
|
*
|
|
32
|
-
* **
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
+
* **The two pipelines are parallel, not shared.** A flowchart ranks a node
|
|
37
|
+
* graph and needs a layout library; a sequence diagram has both axes
|
|
38
|
+
* decided by source order and needs none. Lifelines, ordered messages and
|
|
39
|
+
* fragment boxes have essentially nothing in common with nodes, edges and
|
|
40
|
+
* clusters, so one model type for both would make both halves worse. What
|
|
41
|
+
* they do share is the text metrics, the theming, the marker namespacing,
|
|
42
|
+
* the error boundary and the policy below.
|
|
43
|
+
*
|
|
44
|
+
* **Failure is always the code block, silently.** A parse failure, a
|
|
45
|
+
* refused construct, a diagram past its cap, and a `classDiagram` all land
|
|
46
|
+
* here identically. Agents write invalid mermaid, and a red error box in
|
|
47
|
+
* the middle of a folio is worse than a grey fence.
|
|
36
48
|
*/
|
|
37
49
|
export const MermaidFence = (props: MermaidFenceProps) => {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
if (
|
|
41
|
-
|
|
50
|
+
const kind = diagramKind(props.source);
|
|
51
|
+
|
|
52
|
+
if (kind === "sequence") {
|
|
53
|
+
const model = parseSequence(props.source);
|
|
54
|
+
const diagram = model ? layoutSequence(model) : undefined;
|
|
55
|
+
return diagram ? (
|
|
56
|
+
<SequenceDiagram diagram={diagram} />
|
|
57
|
+
) : (
|
|
58
|
+
<>{props.fallback}</>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (kind === "flowchart") {
|
|
63
|
+
const model = parseFlowchart(props.source);
|
|
64
|
+
const graph = model ? layoutFlowchart(model) : undefined;
|
|
65
|
+
return graph ? <FlowchartDiagram graph={graph} /> : <>{props.fallback}</>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return <>{props.fallback}</>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Which pipeline a fence belongs to, from its header line.
|
|
73
|
+
*
|
|
74
|
+
* The header is the first line that is not YAML frontmatter, a
|
|
75
|
+
* `%%{init: …}%%` directive or a `%%` comment - mermaid allows all three
|
|
76
|
+
* above it. Both parsers check their own header again, because both are
|
|
77
|
+
* independently callable; this exists so an unsupported diagram type never
|
|
78
|
+
* enters a parser at all.
|
|
79
|
+
*/
|
|
80
|
+
const diagramKind = (source: string): "sequence" | "flowchart" | undefined => {
|
|
81
|
+
const header = source
|
|
82
|
+
.replace(/^\s*---\r?\n[\s\S]*?\r?\n---\r?\n/, "")
|
|
83
|
+
.replace(/%%\{[\s\S]*?\}%%/g, "")
|
|
84
|
+
.split(/\r?\n/)
|
|
85
|
+
.map((line) => line.replace(/%%.*$/, "").trim())
|
|
86
|
+
.find(Boolean);
|
|
87
|
+
|
|
88
|
+
if (!header) return undefined;
|
|
89
|
+
if (/^sequenceDiagram\b/i.test(header)) return "sequence";
|
|
90
|
+
if (/^(?:flowchart|graph)\b/i.test(header)) return "flowchart";
|
|
91
|
+
return undefined;
|
|
42
92
|
};
|
|
43
93
|
|
|
44
94
|
// Default export as well, so the `lazy()` call site stays a bare
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { useId } from "react";
|
|
6
|
+
|
|
7
|
+
import { round } from "./DiagramLabel.tsx";
|
|
8
|
+
import type { PositionedSequence } from "./layoutSequence.ts";
|
|
9
|
+
import { SequenceDiagramFragment } from "./SequenceDiagramFragment.tsx";
|
|
10
|
+
import { SequenceDiagramMessage } from "./SequenceDiagramMessage.tsx";
|
|
11
|
+
import { SequenceDiagramNote } from "./SequenceDiagramNote.tsx";
|
|
12
|
+
import { SequenceDiagramParticipant } from "./SequenceDiagramParticipant.tsx";
|
|
13
|
+
import { DIAGRAM_FONT_FAMILY } from "./textMetrics.ts";
|
|
14
|
+
|
|
15
|
+
export interface SequenceDiagramProps {
|
|
16
|
+
diagram: PositionedSequence;
|
|
17
|
+
/**
|
|
18
|
+
* Read out to assistive technology as the diagram's name.
|
|
19
|
+
*/
|
|
20
|
+
title?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Draw a laid-out sequence diagram as themed SVG.
|
|
25
|
+
*
|
|
26
|
+
* Everything the flowchart emitter settled applies here unchanged, and none
|
|
27
|
+
* of it is optional:
|
|
28
|
+
*
|
|
29
|
+
* ## React elements, not an HTML string
|
|
30
|
+
*
|
|
31
|
+
* `markdown-view.tsx` carries an explicit rule that no raw HTML is ever
|
|
32
|
+
* promoted to markup, because it renders one user's content to another.
|
|
33
|
+
* Emitting elements means labels are escaped by React itself and
|
|
34
|
+
* `dangerouslySetInnerHTML` never appears on this path.
|
|
35
|
+
*
|
|
36
|
+
* ## Theming is the point
|
|
37
|
+
*
|
|
38
|
+
* Colours come from `--primary`, `--border`, `--muted-foreground`, `--card`
|
|
39
|
+
* and `--muted` through `var(...)`, so dark mode works with no second
|
|
40
|
+
* palette and no theme prop. That is the thing mermaid can structurally
|
|
41
|
+
* never give us, and the whole reason drawing is our own code.
|
|
42
|
+
*
|
|
43
|
+
* ## The font is pinned, never inherited
|
|
44
|
+
*
|
|
45
|
+
* Folio view mode sets prose in Literata at 16.5px and lazy-loads it. The
|
|
46
|
+
* width table is generated against Inter at `DIAGRAM_FONT_SIZE`, so
|
|
47
|
+
* inheriting would make text and box disagree per surface and shift when
|
|
48
|
+
* the serif lands. `fontFamily` / `fontSize` are camelCase, not the
|
|
49
|
+
* hyphenated spelling: React renders the same SVG presentation attributes
|
|
50
|
+
* either way, but hyphenated logs `Invalid DOM property` on every render,
|
|
51
|
+
* from a component mounted on every markdown surface in the app.
|
|
52
|
+
*
|
|
53
|
+
* ## Unlike a flowchart, the width is natural rather than fitted
|
|
54
|
+
*
|
|
55
|
+
* A flowchart is roughly as tall as it is wide and scales into the prose
|
|
56
|
+
* column. A sequence diagram's width is driven by participant count with
|
|
57
|
+
* nothing to wrap, so scaling eight participants into a phone column puts
|
|
58
|
+
* the labels at around 5px with no way for the reader to recover. So the
|
|
59
|
+
* SVG takes its natural width and this component frames it in a scroll
|
|
60
|
+
* container, with the keyboard affordances that come with one.
|
|
61
|
+
*/
|
|
62
|
+
export const SequenceDiagram = (props: SequenceDiagramProps) => {
|
|
63
|
+
const diagram = props.diagram;
|
|
64
|
+
// SVG marker ids are global to the DOCUMENT: two diagrams on one page
|
|
65
|
+
// with the same arrowhead id fight, and the loser's arrows vanish.
|
|
66
|
+
const scope = useId().replace(/[^\w-]/g, "");
|
|
67
|
+
const title = props.title ?? "Sequence diagram";
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<div
|
|
71
|
+
// `tabIndex` and `role` are the a11y requirement, not decoration: a
|
|
72
|
+
// scrollable region that cannot be focused cannot be scrolled from a
|
|
73
|
+
// keyboard at all, so the part of the diagram past the fold would be
|
|
74
|
+
// unreachable. The named region is what gives it an accessible name
|
|
75
|
+
// to announce when focus lands there.
|
|
76
|
+
//
|
|
77
|
+
// This reopens the "no interactivity" line the design drew, scoped to
|
|
78
|
+
// scrolling and nothing else. Pan, zoom and click-through stay out.
|
|
79
|
+
className="alepha-diagram-scroll my-4"
|
|
80
|
+
// A scrollable region is the documented exception to
|
|
81
|
+
// `no-noninteractive-tabindex`: WAI's own guidance is `tabindex="0"`
|
|
82
|
+
// plus a named `region`, because without focus the content past the
|
|
83
|
+
// fold cannot be reached by keyboard at all. The rule's allowlist
|
|
84
|
+
// covers `tabpanel` and not `region`, which is what it is flagging.
|
|
85
|
+
// oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
86
|
+
tabIndex={0}
|
|
87
|
+
role="region"
|
|
88
|
+
aria-label={title}
|
|
89
|
+
>
|
|
90
|
+
<svg
|
|
91
|
+
role="img"
|
|
92
|
+
viewBox={`0 0 ${round(diagram.width)} ${round(diagram.height)}`}
|
|
93
|
+
width={round(diagram.width)}
|
|
94
|
+
height={round(diagram.height)}
|
|
95
|
+
className="block"
|
|
96
|
+
fontFamily={DIAGRAM_FONT_FAMILY}
|
|
97
|
+
fontSize={diagram.fontSize}
|
|
98
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
99
|
+
>
|
|
100
|
+
<title>{title}</title>
|
|
101
|
+
<defs>
|
|
102
|
+
{/*
|
|
103
|
+
THREE head kinds, not one. Epic #5 shipped a single end marker,
|
|
104
|
+
which is exactly why `--o` and `--x` silently draw the same
|
|
105
|
+
arrowhead as `-->` in a flowchart. Here `->>`, `-x` and `-)` are
|
|
106
|
+
three different statements about a message and each gets its own.
|
|
107
|
+
|
|
108
|
+
`context-stroke` throughout, never `currentColor`: a marker lives
|
|
109
|
+
in `<defs>`, so `currentColor` resolves against the MARKER's
|
|
110
|
+
inherited colour rather than the referencing line's - the head
|
|
111
|
+
came out `--foreground` while its line was `--muted-foreground`,
|
|
112
|
+
and in a differently-themed container it was wrong outright.
|
|
113
|
+
*/}
|
|
114
|
+
<marker
|
|
115
|
+
id={`${scope}-seq-arrow`}
|
|
116
|
+
markerWidth="9"
|
|
117
|
+
markerHeight="7"
|
|
118
|
+
refX="8.5"
|
|
119
|
+
refY="3.5"
|
|
120
|
+
orient="auto"
|
|
121
|
+
markerUnits="userSpaceOnUse"
|
|
122
|
+
>
|
|
123
|
+
<path d="M0,0 L9,3.5 L0,7 z" fill="context-stroke" />
|
|
124
|
+
</marker>
|
|
125
|
+
<marker
|
|
126
|
+
id={`${scope}-seq-open`}
|
|
127
|
+
markerWidth="10"
|
|
128
|
+
markerHeight="8"
|
|
129
|
+
refX="9"
|
|
130
|
+
refY="4"
|
|
131
|
+
orient="auto"
|
|
132
|
+
markerUnits="userSpaceOnUse"
|
|
133
|
+
>
|
|
134
|
+
{/* The async form: an open V rather than a filled head. */}
|
|
135
|
+
<path
|
|
136
|
+
d="M1,0.5 L9,4 L1,7.5"
|
|
137
|
+
fill="none"
|
|
138
|
+
stroke="context-stroke"
|
|
139
|
+
strokeWidth="1.3"
|
|
140
|
+
strokeLinecap="round"
|
|
141
|
+
strokeLinejoin="round"
|
|
142
|
+
/>
|
|
143
|
+
</marker>
|
|
144
|
+
<marker
|
|
145
|
+
id={`${scope}-seq-cross`}
|
|
146
|
+
markerWidth="9"
|
|
147
|
+
markerHeight="9"
|
|
148
|
+
refX="8"
|
|
149
|
+
refY="4.5"
|
|
150
|
+
orient="auto"
|
|
151
|
+
markerUnits="userSpaceOnUse"
|
|
152
|
+
>
|
|
153
|
+
<path
|
|
154
|
+
d="M1.5,1.5 L7.5,7.5 M7.5,1.5 L1.5,7.5"
|
|
155
|
+
fill="none"
|
|
156
|
+
stroke="context-stroke"
|
|
157
|
+
strokeWidth="1.4"
|
|
158
|
+
strokeLinecap="round"
|
|
159
|
+
/>
|
|
160
|
+
</marker>
|
|
161
|
+
</defs>
|
|
162
|
+
|
|
163
|
+
{/*
|
|
164
|
+
Order IS z-order in SVG. Fragment boxes go down first (they are
|
|
165
|
+
outlines, and the outermost is first in the list), then the
|
|
166
|
+
lifelines, then the messages, and notes last because a note is an
|
|
167
|
+
opaque box that has to cover the lifeline it sits on.
|
|
168
|
+
*/}
|
|
169
|
+
{diagram.fragments.map((fragment, index) => (
|
|
170
|
+
<SequenceDiagramFragment
|
|
171
|
+
key={`${fragment.kind}@${fragment.depth}#${index}`}
|
|
172
|
+
fragment={fragment}
|
|
173
|
+
fontSize={diagram.fontSize}
|
|
174
|
+
/>
|
|
175
|
+
))}
|
|
176
|
+
{diagram.participants.map((participant) => (
|
|
177
|
+
<SequenceDiagramParticipant
|
|
178
|
+
key={participant.id}
|
|
179
|
+
participant={participant}
|
|
180
|
+
fontSize={diagram.fontSize}
|
|
181
|
+
/>
|
|
182
|
+
))}
|
|
183
|
+
{diagram.messages.map((message, index) => (
|
|
184
|
+
<SequenceDiagramMessage
|
|
185
|
+
key={`${message.from}->${message.to}#${index}`}
|
|
186
|
+
message={message}
|
|
187
|
+
scope={scope}
|
|
188
|
+
fontSize={diagram.fontSize}
|
|
189
|
+
/>
|
|
190
|
+
))}
|
|
191
|
+
{diagram.notes.map((note, index) => (
|
|
192
|
+
<SequenceDiagramNote
|
|
193
|
+
// Notes are positional and their text may legitimately repeat, so
|
|
194
|
+
// the index is the identity here.
|
|
195
|
+
key={`note#${index}`}
|
|
196
|
+
note={note}
|
|
197
|
+
fontSize={diagram.fontSize}
|
|
198
|
+
/>
|
|
199
|
+
))}
|
|
200
|
+
</svg>
|
|
201
|
+
</div>
|
|
202
|
+
);
|
|
203
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { round } from "./DiagramLabel.tsx";
|
|
6
|
+
import type { PositionedFragment } from "./layoutSequence.ts";
|
|
7
|
+
|
|
8
|
+
export interface SequenceDiagramFragmentProps {
|
|
9
|
+
fragment: PositionedFragment;
|
|
10
|
+
fontSize: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The box around an `alt`, `opt` or `loop`, its corner tab, and a dashed
|
|
15
|
+
* divider at each `else`.
|
|
16
|
+
*
|
|
17
|
+
* ## Why fragments are drawn at all, when activation bars were cut
|
|
18
|
+
*
|
|
19
|
+
* Without them an `alt` block has two outcomes and both are bad: refuse the
|
|
20
|
+
* whole diagram, or draw the branches one under the other as though they
|
|
21
|
+
* all happen. The second is silently wrong output about a protocol, which
|
|
22
|
+
* is the one failure mode the design refuses to ship.
|
|
23
|
+
*
|
|
24
|
+
* The box is an outline with no fill, so it never hides a lifeline it
|
|
25
|
+
* spans and its z-order does not matter. Only the tab is filled, because
|
|
26
|
+
* it sits on top of the lifelines it crosses.
|
|
27
|
+
*/
|
|
28
|
+
export const SequenceDiagramFragment = (
|
|
29
|
+
props: SequenceDiagramFragmentProps,
|
|
30
|
+
) => {
|
|
31
|
+
const fragment = props.fragment;
|
|
32
|
+
const x = round(fragment.x);
|
|
33
|
+
const y = round(fragment.y);
|
|
34
|
+
const width = round(fragment.width);
|
|
35
|
+
const small = props.fontSize * 0.92;
|
|
36
|
+
const notch = 6;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<g data-fragment={fragment.kind}>
|
|
40
|
+
<rect
|
|
41
|
+
x={x}
|
|
42
|
+
y={y}
|
|
43
|
+
width={width}
|
|
44
|
+
height={round(fragment.height)}
|
|
45
|
+
rx={4}
|
|
46
|
+
ry={4}
|
|
47
|
+
fill="none"
|
|
48
|
+
stroke="var(--border)"
|
|
49
|
+
strokeWidth={1.25}
|
|
50
|
+
/>
|
|
51
|
+
{fragment.dividers.map((divider) => (
|
|
52
|
+
<g key={`${round(divider.y)}:${divider.label}`}>
|
|
53
|
+
<line
|
|
54
|
+
x1={x}
|
|
55
|
+
y1={round(divider.y)}
|
|
56
|
+
x2={round(fragment.x + fragment.width)}
|
|
57
|
+
y2={round(divider.y)}
|
|
58
|
+
stroke="var(--border)"
|
|
59
|
+
strokeWidth={1.25}
|
|
60
|
+
strokeDasharray="5 4"
|
|
61
|
+
/>
|
|
62
|
+
{divider.label ? (
|
|
63
|
+
// BELOW the line, not above it. An `else` names the branch it
|
|
64
|
+
// OPENS, so a label sitting over the divider reads as the last
|
|
65
|
+
// word of the branch that just ended - which is the opposite of
|
|
66
|
+
// what the author wrote.
|
|
67
|
+
<text
|
|
68
|
+
x={round(fragment.x + 8)}
|
|
69
|
+
y={round(divider.y + small + 2)}
|
|
70
|
+
textAnchor="start"
|
|
71
|
+
fontSize={small}
|
|
72
|
+
fill="var(--muted-foreground)"
|
|
73
|
+
>
|
|
74
|
+
[{divider.label}]
|
|
75
|
+
</text>
|
|
76
|
+
) : null}
|
|
77
|
+
</g>
|
|
78
|
+
))}
|
|
79
|
+
{/*
|
|
80
|
+
A rectangle with its bottom-right corner cut, which is how UML draws
|
|
81
|
+
the fragment operator. One path rather than a rect plus a polygon,
|
|
82
|
+
so the outline is continuous.
|
|
83
|
+
*/}
|
|
84
|
+
<path
|
|
85
|
+
d={[
|
|
86
|
+
`M${x},${y}`,
|
|
87
|
+
`L${round(fragment.x + fragment.tabWidth)},${y}`,
|
|
88
|
+
`L${round(fragment.x + fragment.tabWidth)},${round(fragment.y + fragment.tabHeight - notch)}`,
|
|
89
|
+
`L${round(fragment.x + fragment.tabWidth - notch)},${round(fragment.y + fragment.tabHeight)}`,
|
|
90
|
+
`L${x},${round(fragment.y + fragment.tabHeight)}`,
|
|
91
|
+
"z",
|
|
92
|
+
].join(" ")}
|
|
93
|
+
fill="var(--muted)"
|
|
94
|
+
stroke="var(--border)"
|
|
95
|
+
strokeWidth={1.25}
|
|
96
|
+
/>
|
|
97
|
+
<text
|
|
98
|
+
x={round(fragment.x + fragment.tabWidth / 2)}
|
|
99
|
+
y={round(fragment.y + fragment.tabHeight / 2 + props.fontSize * 0.36)}
|
|
100
|
+
textAnchor="middle"
|
|
101
|
+
fontSize={small}
|
|
102
|
+
fontWeight={600}
|
|
103
|
+
fill="var(--muted-foreground)"
|
|
104
|
+
>
|
|
105
|
+
{fragment.kind}
|
|
106
|
+
</text>
|
|
107
|
+
{fragment.label ? (
|
|
108
|
+
<text
|
|
109
|
+
x={round(fragment.x + fragment.tabWidth + 8)}
|
|
110
|
+
y={round(fragment.y + fragment.tabHeight / 2 + props.fontSize * 0.36)}
|
|
111
|
+
textAnchor="start"
|
|
112
|
+
fontSize={small}
|
|
113
|
+
fill="var(--muted-foreground)"
|
|
114
|
+
>
|
|
115
|
+
[{fragment.label}]
|
|
116
|
+
</text>
|
|
117
|
+
) : null}
|
|
118
|
+
</g>
|
|
119
|
+
);
|
|
120
|
+
};
|