@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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { DiagramLabel, round } from "./DiagramLabel.tsx";
|
|
6
|
+
import type { PositionedMessage } from "./layoutSequence.ts";
|
|
7
|
+
|
|
8
|
+
export interface SequenceDiagramMessageProps {
|
|
9
|
+
message: PositionedMessage;
|
|
10
|
+
/**
|
|
11
|
+
* Instance-unique prefix for the arrowhead marker ids.
|
|
12
|
+
*/
|
|
13
|
+
scope: string;
|
|
14
|
+
fontSize: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* One message: its line, its head and its label.
|
|
19
|
+
*
|
|
20
|
+
* `currentColor` on the path is what makes the head match. A marker
|
|
21
|
+
* inherits `context-stroke` from the element that references it, so one set
|
|
22
|
+
* of three markers serves every message without a set per colour.
|
|
23
|
+
*
|
|
24
|
+
* The label sits on a `--background` chip. A message spanning several
|
|
25
|
+
* lifelines draws its label over the ones in between, and without the chip
|
|
26
|
+
* the dashes run straight through the text.
|
|
27
|
+
*/
|
|
28
|
+
export const SequenceDiagramMessage = (props: SequenceDiagramMessageProps) => {
|
|
29
|
+
const message = props.message;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<g style={{ color: "var(--muted-foreground)" }}>
|
|
33
|
+
<path
|
|
34
|
+
data-message={`${message.from}->${message.to}`}
|
|
35
|
+
d={pathOf(message.points)}
|
|
36
|
+
fill="none"
|
|
37
|
+
stroke="currentColor"
|
|
38
|
+
strokeWidth={1.4}
|
|
39
|
+
strokeDasharray={message.line === "dashed" ? "5 4" : undefined}
|
|
40
|
+
strokeLinecap="round"
|
|
41
|
+
strokeLinejoin="round"
|
|
42
|
+
markerEnd={markerOf(message, props.scope)}
|
|
43
|
+
/>
|
|
44
|
+
{message.label.lines.some(Boolean) ? (
|
|
45
|
+
<>
|
|
46
|
+
<rect
|
|
47
|
+
x={round(message.label.x - 3)}
|
|
48
|
+
y={round(message.label.y)}
|
|
49
|
+
width={round(message.label.width + 6)}
|
|
50
|
+
height={round(message.label.height)}
|
|
51
|
+
rx={3}
|
|
52
|
+
ry={3}
|
|
53
|
+
fill="var(--background)"
|
|
54
|
+
/>
|
|
55
|
+
<DiagramLabel
|
|
56
|
+
lines={message.label.lines}
|
|
57
|
+
centerX={message.label.x + message.label.width / 2}
|
|
58
|
+
centerY={message.label.y + message.label.height / 2}
|
|
59
|
+
fontSize={props.fontSize}
|
|
60
|
+
fill="var(--foreground)"
|
|
61
|
+
/>
|
|
62
|
+
</>
|
|
63
|
+
) : null}
|
|
64
|
+
</g>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* `->` and `-->` carry no head at all in mermaid, which is a real
|
|
70
|
+
* distinction rather than a missing feature: an undecorated line is how a
|
|
71
|
+
* plain call is written.
|
|
72
|
+
*/
|
|
73
|
+
const markerOf = (
|
|
74
|
+
message: PositionedMessage,
|
|
75
|
+
scope: string,
|
|
76
|
+
): string | undefined => {
|
|
77
|
+
if (message.head === "none") return undefined;
|
|
78
|
+
return `url(#${scope}-seq-${message.head})`;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Two points for a normal message; four for the loop of a self-message,
|
|
83
|
+
* with the corners rounded so the turn reads as one gesture.
|
|
84
|
+
*/
|
|
85
|
+
const pathOf = (points: Array<{ x: number; y: number }>): string => {
|
|
86
|
+
const at = (index: number) =>
|
|
87
|
+
`${round(points[index].x)},${round(points[index].y)}`;
|
|
88
|
+
if (points.length === 2) return `M${at(0)} L${at(1)}`;
|
|
89
|
+
|
|
90
|
+
const radius = 5;
|
|
91
|
+
const [, out, back] = points;
|
|
92
|
+
return [
|
|
93
|
+
`M${at(0)}`,
|
|
94
|
+
`L${round(out.x - radius)},${round(out.y)}`,
|
|
95
|
+
`Q${round(out.x)},${round(out.y)} ${round(out.x)},${round(out.y + radius)}`,
|
|
96
|
+
`L${round(back.x)},${round(back.y - radius)}`,
|
|
97
|
+
`Q${round(back.x)},${round(back.y)} ${round(back.x - radius)},${round(back.y)}`,
|
|
98
|
+
`L${at(3)}`,
|
|
99
|
+
].join(" ");
|
|
100
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { DiagramLabel, round } from "./DiagramLabel.tsx";
|
|
6
|
+
import type { PositionedNoteBox } from "./layoutSequence.ts";
|
|
7
|
+
|
|
8
|
+
export interface SequenceDiagramNoteProps {
|
|
9
|
+
note: PositionedNoteBox;
|
|
10
|
+
fontSize: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* An annotation box with its text wrapped inside it.
|
|
15
|
+
*
|
|
16
|
+
* Filled in `--muted` rather than mermaid's yellow: the theme picks the
|
|
17
|
+
* colours here, which is the whole reason this renderer is our own code.
|
|
18
|
+
* The fill has to be opaque - a note sits ON a lifeline and has to cover
|
|
19
|
+
* it, which is why notes are drawn last of all.
|
|
20
|
+
*/
|
|
21
|
+
export const SequenceDiagramNote = (props: SequenceDiagramNoteProps) => {
|
|
22
|
+
const note = props.note;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<g data-note={note.placement}>
|
|
26
|
+
<rect
|
|
27
|
+
x={round(note.x)}
|
|
28
|
+
y={round(note.y)}
|
|
29
|
+
width={round(note.width)}
|
|
30
|
+
height={round(note.height)}
|
|
31
|
+
rx={4}
|
|
32
|
+
ry={4}
|
|
33
|
+
fill="var(--muted)"
|
|
34
|
+
stroke="var(--border)"
|
|
35
|
+
strokeWidth={1.25}
|
|
36
|
+
/>
|
|
37
|
+
<DiagramLabel
|
|
38
|
+
lines={note.lines}
|
|
39
|
+
centerX={note.x + note.width / 2}
|
|
40
|
+
centerY={note.y + note.height / 2}
|
|
41
|
+
fontSize={props.fontSize}
|
|
42
|
+
fill="var(--muted-foreground)"
|
|
43
|
+
/>
|
|
44
|
+
</g>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { DiagramLabel, round } from "./DiagramLabel.tsx";
|
|
6
|
+
import type { PositionedParticipant } from "./layoutSequence.ts";
|
|
7
|
+
import { SequenceDiagramParticipantActor } from "./SequenceDiagramParticipantActor.tsx";
|
|
8
|
+
|
|
9
|
+
export interface SequenceDiagramParticipantProps {
|
|
10
|
+
participant: PositionedParticipant;
|
|
11
|
+
fontSize: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* One lifeline, with its header and footer.
|
|
16
|
+
*
|
|
17
|
+
* The header is repeated at the bottom, as mermaid does: a forty-message
|
|
18
|
+
* diagram is unreadable when the only thing naming the columns has scrolled
|
|
19
|
+
* off the top.
|
|
20
|
+
*
|
|
21
|
+
* A participant declared with `actor` draws a stick figure rather than a
|
|
22
|
+
* box. The parser keeps the two apart precisely so this component can, and
|
|
23
|
+
* the distinction carries real meaning in a protocol diagram - a person and
|
|
24
|
+
* a worker are not the same kind of thing.
|
|
25
|
+
*/
|
|
26
|
+
export const SequenceDiagramParticipant = (
|
|
27
|
+
props: SequenceDiagramParticipantProps,
|
|
28
|
+
) => {
|
|
29
|
+
const participant = props.participant;
|
|
30
|
+
const x = round(participant.x);
|
|
31
|
+
const width = round(participant.width);
|
|
32
|
+
const centerX = round(participant.centerX);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<g data-participant={participant.id}>
|
|
36
|
+
<line
|
|
37
|
+
x1={centerX}
|
|
38
|
+
y1={round(participant.lifelineTop)}
|
|
39
|
+
x2={centerX}
|
|
40
|
+
y2={round(participant.lifelineBottom)}
|
|
41
|
+
stroke="var(--border)"
|
|
42
|
+
strokeWidth={1.25}
|
|
43
|
+
strokeDasharray="4 4"
|
|
44
|
+
/>
|
|
45
|
+
{[participant.y, participant.bottomY].map((top) =>
|
|
46
|
+
participant.actor ? (
|
|
47
|
+
<SequenceDiagramParticipantActor
|
|
48
|
+
key={`actor@${round(top)}`}
|
|
49
|
+
centerX={participant.centerX}
|
|
50
|
+
top={top}
|
|
51
|
+
lines={participant.lines}
|
|
52
|
+
height={participant.height}
|
|
53
|
+
fontSize={props.fontSize}
|
|
54
|
+
/>
|
|
55
|
+
) : (
|
|
56
|
+
<g key={`box@${round(top)}`}>
|
|
57
|
+
<rect
|
|
58
|
+
x={x}
|
|
59
|
+
y={round(top)}
|
|
60
|
+
width={width}
|
|
61
|
+
height={round(participant.height)}
|
|
62
|
+
rx={5}
|
|
63
|
+
ry={5}
|
|
64
|
+
fill="var(--card)"
|
|
65
|
+
stroke="var(--border)"
|
|
66
|
+
strokeWidth={1.25}
|
|
67
|
+
/>
|
|
68
|
+
<DiagramLabel
|
|
69
|
+
lines={participant.lines}
|
|
70
|
+
centerX={participant.centerX}
|
|
71
|
+
centerY={top + participant.height / 2}
|
|
72
|
+
fontSize={props.fontSize}
|
|
73
|
+
fill="var(--card-foreground)"
|
|
74
|
+
/>
|
|
75
|
+
</g>
|
|
76
|
+
),
|
|
77
|
+
)}
|
|
78
|
+
</g>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { DiagramLabel, round } from "./DiagramLabel.tsx";
|
|
6
|
+
import { DIAGRAM_LINE_HEIGHT } from "./textMetrics.ts";
|
|
7
|
+
|
|
8
|
+
export interface SequenceDiagramParticipantActorProps {
|
|
9
|
+
centerX: number;
|
|
10
|
+
top: number;
|
|
11
|
+
lines: string[];
|
|
12
|
+
height: number;
|
|
13
|
+
fontSize: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Head, body, arms and legs, with the name underneath.
|
|
18
|
+
*
|
|
19
|
+
* Drawn from primitives rather than one path so the shape stays readable,
|
|
20
|
+
* the same call the flowchart node emitter made for its four shapes.
|
|
21
|
+
*
|
|
22
|
+
* ## The figure hangs from the label, not from the top of the box
|
|
23
|
+
*
|
|
24
|
+
* The layout sized this box as figure + gap + label. Redeclaring the
|
|
25
|
+
* figure's own height here to draw downward from the top would be two
|
|
26
|
+
* copies of one number in two files, which is precisely the text-and-box
|
|
27
|
+
* disagreement the whole metrics path exists to avoid. Instead the label
|
|
28
|
+
* height is recomputed from the lines the layout already measured - the
|
|
29
|
+
* same `lines.length * fontSize * DIAGRAM_LINE_HEIGHT` `measureLabel` used
|
|
30
|
+
* - and the figure is anchored just above it. If the box is ever given
|
|
31
|
+
* more room, the figure simply gets more air over its head.
|
|
32
|
+
*/
|
|
33
|
+
export const SequenceDiagramParticipantActor = (
|
|
34
|
+
props: SequenceDiagramParticipantActorProps,
|
|
35
|
+
) => {
|
|
36
|
+
const cx = round(props.centerX);
|
|
37
|
+
const labelHeight = props.lines.length * props.fontSize * DIAGRAM_LINE_HEIGHT;
|
|
38
|
+
const feet = props.top + props.height - labelHeight - ACTOR_LABEL_GAP;
|
|
39
|
+
const hips = feet - 8;
|
|
40
|
+
const shoulders = hips - 10;
|
|
41
|
+
const headRadius = 6;
|
|
42
|
+
const headY = shoulders - headRadius - 1;
|
|
43
|
+
const reach = 8;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<g>
|
|
47
|
+
<g stroke="var(--muted-foreground)" strokeWidth={1.3} fill="none">
|
|
48
|
+
<circle cx={cx} cy={round(headY)} r={headRadius} />
|
|
49
|
+
<path
|
|
50
|
+
d={[
|
|
51
|
+
`M${cx},${round(shoulders)} L${cx},${round(hips)}`,
|
|
52
|
+
`M${round(cx - reach)},${round(shoulders + 4)} L${round(cx + reach)},${round(shoulders + 4)}`,
|
|
53
|
+
`M${cx},${round(hips)} L${round(cx - reach)},${round(feet)}`,
|
|
54
|
+
`M${cx},${round(hips)} L${round(cx + reach)},${round(feet)}`,
|
|
55
|
+
].join(" ")}
|
|
56
|
+
strokeLinecap="round"
|
|
57
|
+
/>
|
|
58
|
+
</g>
|
|
59
|
+
<DiagramLabel
|
|
60
|
+
lines={props.lines}
|
|
61
|
+
centerX={props.centerX}
|
|
62
|
+
centerY={props.top + props.height - labelHeight / 2}
|
|
63
|
+
fontSize={props.fontSize}
|
|
64
|
+
fill="var(--foreground)"
|
|
65
|
+
/>
|
|
66
|
+
</g>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The one number this component and the layout do share: how far the name
|
|
72
|
+
* sits below the feet.
|
|
73
|
+
*/
|
|
74
|
+
const ACTOR_LABEL_GAP = 4;
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
import { layoutSequence } from "../layoutSequence.ts";
|
|
5
|
+
import { SequenceDiagram } from "../SequenceDiagram.tsx";
|
|
6
|
+
import { parseSequence } from "../sequenceParser.ts";
|
|
7
|
+
|
|
8
|
+
const diagramOf = (source: string) => {
|
|
9
|
+
const model = parseSequence(source);
|
|
10
|
+
if (!model) throw new Error("source did not parse");
|
|
11
|
+
const diagram = layoutSequence(model);
|
|
12
|
+
if (!diagram) throw new Error("source did not lay out");
|
|
13
|
+
return diagram;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const draw = (source: string) =>
|
|
17
|
+
render(<SequenceDiagram diagram={diagramOf(source)} />).container;
|
|
18
|
+
|
|
19
|
+
describe("SequenceDiagram - the SVG root", () => {
|
|
20
|
+
it("renders one svg sized by the layout's viewBox", () => {
|
|
21
|
+
const svg = draw("sequenceDiagram\n A ->> B: hi").querySelector("svg");
|
|
22
|
+
expect(svg).not.toBeNull();
|
|
23
|
+
expect(svg?.getAttribute("viewBox")).toMatch(/^0 0 [\d.]+ [\d.]+$/);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("takes its natural width rather than scaling to the column", () => {
|
|
27
|
+
// The opposite of the flowchart emitter, and deliberately so: a
|
|
28
|
+
// sequence diagram's width comes from participant count with nothing to
|
|
29
|
+
// wrap, so scaling it into a phone column puts labels at ~5px.
|
|
30
|
+
const svg = draw("sequenceDiagram\n A ->> B: hi").querySelector("svg");
|
|
31
|
+
expect(Number(svg?.getAttribute("width"))).toBeGreaterThan(0);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("pins its own font instead of inheriting the surrounding prose", () => {
|
|
35
|
+
const svg = draw("sequenceDiagram\n A ->> B: hi").querySelector("svg");
|
|
36
|
+
expect(svg?.getAttribute("font-family")).toContain("Inter");
|
|
37
|
+
expect(svg?.getAttribute("font-size")).toBe("13");
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("logs no invalid DOM property for the font attributes", () => {
|
|
41
|
+
// camelCase `fontFamily` / `fontSize` render the same SVG presentation
|
|
42
|
+
// attributes; the hyphenated spelling renders them AND warns, on every
|
|
43
|
+
// render, from a component mounted on every markdown surface.
|
|
44
|
+
const warnings: unknown[] = [];
|
|
45
|
+
const original = console.error;
|
|
46
|
+
console.error = (...args: unknown[]) => warnings.push(args);
|
|
47
|
+
try {
|
|
48
|
+
draw("sequenceDiagram\n A ->> B: hi");
|
|
49
|
+
} finally {
|
|
50
|
+
console.error = original;
|
|
51
|
+
}
|
|
52
|
+
expect(warnings).toEqual([]);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("carries an accessible name", () => {
|
|
56
|
+
const svg = draw("sequenceDiagram\n A ->> B: hi").querySelector("svg");
|
|
57
|
+
expect(svg?.getAttribute("role")).toBe("img");
|
|
58
|
+
expect(svg?.querySelector("title")?.textContent).toBeTruthy();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("namespaces its marker ids so two diagrams on a page do not fight", () => {
|
|
62
|
+
const first = draw("sequenceDiagram\n A ->> B: hi");
|
|
63
|
+
const second = draw("sequenceDiagram\n A ->> B: hi");
|
|
64
|
+
const idOf = (container: Element) =>
|
|
65
|
+
container.querySelector("marker")?.getAttribute("id");
|
|
66
|
+
expect(idOf(first)).toBeTruthy();
|
|
67
|
+
expect(idOf(first)).not.toBe(idOf(second));
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
describe("SequenceDiagram - participants", () => {
|
|
72
|
+
it("draws a lifeline per participant", () => {
|
|
73
|
+
const container = draw("sequenceDiagram\n A ->> B: hi\n B ->> C: bye");
|
|
74
|
+
expect(container.querySelectorAll("[data-participant]")).toHaveLength(3);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("repeats each header box at the bottom", () => {
|
|
78
|
+
const boxes = draw("sequenceDiagram\n A ->> B: hi").querySelectorAll(
|
|
79
|
+
"[data-participant] rect",
|
|
80
|
+
);
|
|
81
|
+
expect(boxes).toHaveLength(4);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("draws an actor as a stick figure rather than a box", () => {
|
|
85
|
+
const container = draw("sequenceDiagram\n actor U\n U ->> S: hi");
|
|
86
|
+
const actor = container.querySelector('[data-participant="U"]');
|
|
87
|
+
const service = container.querySelector('[data-participant="S"]');
|
|
88
|
+
expect(actor?.querySelectorAll("circle").length).toBe(2);
|
|
89
|
+
expect(actor?.querySelector("rect")).toBeNull();
|
|
90
|
+
expect(service?.querySelector("rect")).not.toBeNull();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("names the lifeline with the alias, not the id", () => {
|
|
94
|
+
const container = draw(
|
|
95
|
+
"sequenceDiagram\n participant A as Alice\n A ->> B: hi",
|
|
96
|
+
);
|
|
97
|
+
expect(
|
|
98
|
+
container.querySelector('[data-participant="A"]')?.textContent,
|
|
99
|
+
).toContain("Alice");
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe("SequenceDiagram - messages", () => {
|
|
104
|
+
it("draws a message as a path between two lifelines", () => {
|
|
105
|
+
const path = draw("sequenceDiagram\n A ->> B: hi").querySelector(
|
|
106
|
+
'[data-message="A->B"]',
|
|
107
|
+
);
|
|
108
|
+
expect(path?.getAttribute("d")).toMatch(/^M[\d.]+,[\d.]+ L[\d.]+,[\d.]+$/);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("dashes the -->> form and not the ->> one", () => {
|
|
112
|
+
const container = draw(
|
|
113
|
+
"sequenceDiagram\n A ->> B: solid\n B -->> A: dashed",
|
|
114
|
+
);
|
|
115
|
+
const [solid, dashed] = container.querySelectorAll("[data-message]");
|
|
116
|
+
expect(solid.getAttribute("stroke-dasharray")).toBeNull();
|
|
117
|
+
expect(dashed.getAttribute("stroke-dasharray")).toBeTruthy();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("gives the three head kinds three different markers", () => {
|
|
121
|
+
const container = draw(
|
|
122
|
+
[
|
|
123
|
+
"sequenceDiagram",
|
|
124
|
+
" A ->> B: filled",
|
|
125
|
+
" A -x B: cross",
|
|
126
|
+
" A -) B: open",
|
|
127
|
+
].join("\n"),
|
|
128
|
+
);
|
|
129
|
+
const markers = [...container.querySelectorAll("[data-message]")].map((m) =>
|
|
130
|
+
m.getAttribute("marker-end"),
|
|
131
|
+
);
|
|
132
|
+
expect(new Set(markers).size).toBe(3);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("draws no head at all for the plain -> form", () => {
|
|
136
|
+
const path = draw("sequenceDiagram\n A -> B: plain").querySelector(
|
|
137
|
+
"[data-message]",
|
|
138
|
+
);
|
|
139
|
+
expect(path?.getAttribute("marker-end")).toBeNull();
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it("paints every arrowhead with context-stroke, never currentColor", () => {
|
|
143
|
+
// A marker lives in `<defs>`, so `currentColor` resolves against the
|
|
144
|
+
// MARKER's inherited colour rather than the referencing line's: the
|
|
145
|
+
// head came out `--foreground` while its line was `--muted-foreground`.
|
|
146
|
+
const container = draw(
|
|
147
|
+
"sequenceDiagram\n A ->> B: a\n A -x B: b\n A -) B: c",
|
|
148
|
+
);
|
|
149
|
+
const painted = [...container.querySelectorAll("marker path")].flatMap(
|
|
150
|
+
(path) => [path.getAttribute("fill"), path.getAttribute("stroke")],
|
|
151
|
+
);
|
|
152
|
+
expect(painted.filter(Boolean)).not.toContain("currentColor");
|
|
153
|
+
expect(painted).toContain("context-stroke");
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it("draws a self-message as a loop with four corners", () => {
|
|
157
|
+
const path = draw("sequenceDiagram\n A ->> A: retry").querySelector(
|
|
158
|
+
"[data-message]",
|
|
159
|
+
);
|
|
160
|
+
expect(path?.getAttribute("d")).toContain("Q");
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it("writes the label, and the autonumber counter with it", () => {
|
|
164
|
+
const container = draw(
|
|
165
|
+
"sequenceDiagram\n autonumber\n A ->> B: signs the token",
|
|
166
|
+
);
|
|
167
|
+
expect(container.textContent).toContain("1. signs the token");
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it("draws no label chip for an empty label", () => {
|
|
171
|
+
// Four `text` nodes either way: two participants, each named twice
|
|
172
|
+
// (header and repeated footer). The fifth is the message's own label.
|
|
173
|
+
const empty = draw("sequenceDiagram\n A ->> B:");
|
|
174
|
+
const labelled = draw("sequenceDiagram\n A ->> B: hi");
|
|
175
|
+
expect(empty.querySelectorAll("text")).toHaveLength(4);
|
|
176
|
+
expect(labelled.querySelectorAll("text")).toHaveLength(5);
|
|
177
|
+
expect(empty.querySelectorAll("rect")).toHaveLength(4);
|
|
178
|
+
expect(labelled.querySelectorAll("rect")).toHaveLength(5);
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
describe("SequenceDiagram - notes and fragments", () => {
|
|
183
|
+
it("draws a note as a filled box with its text", () => {
|
|
184
|
+
const container = draw(
|
|
185
|
+
"sequenceDiagram\n A ->> B: hi\n Note over A,B: shared state",
|
|
186
|
+
);
|
|
187
|
+
const note = container.querySelector("[data-note]");
|
|
188
|
+
expect(note?.getAttribute("data-note")).toBe("over");
|
|
189
|
+
expect(note?.querySelector("rect")?.getAttribute("fill")).toBe(
|
|
190
|
+
"var(--muted)",
|
|
191
|
+
);
|
|
192
|
+
expect(note?.textContent).toContain("shared state");
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it("draws a fragment as an unfilled box with a tab", () => {
|
|
196
|
+
const container = draw(
|
|
197
|
+
"sequenceDiagram\n alt known\n A ->> B: yes\n end",
|
|
198
|
+
);
|
|
199
|
+
const fragment = container.querySelector("[data-fragment]");
|
|
200
|
+
expect(fragment?.getAttribute("data-fragment")).toBe("alt");
|
|
201
|
+
// An outline, so it never hides a lifeline it spans.
|
|
202
|
+
expect(fragment?.querySelector("rect")?.getAttribute("fill")).toBe("none");
|
|
203
|
+
expect(fragment?.textContent).toContain("alt");
|
|
204
|
+
expect(fragment?.textContent).toContain("[known]");
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it("draws a dashed divider per else, with its condition", () => {
|
|
208
|
+
const fragment = draw(
|
|
209
|
+
[
|
|
210
|
+
"sequenceDiagram",
|
|
211
|
+
" alt known",
|
|
212
|
+
" A ->> B: yes",
|
|
213
|
+
" else unknown",
|
|
214
|
+
" A ->> B: no",
|
|
215
|
+
" end",
|
|
216
|
+
].join("\n"),
|
|
217
|
+
).querySelector("[data-fragment]");
|
|
218
|
+
const dashed = [...(fragment?.querySelectorAll("line") ?? [])].filter(
|
|
219
|
+
(line) => line.getAttribute("stroke-dasharray"),
|
|
220
|
+
);
|
|
221
|
+
expect(dashed).toHaveLength(1);
|
|
222
|
+
expect(fragment?.textContent).toContain("[unknown]");
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it("draws nested fragments outermost first, so order is z-order", () => {
|
|
226
|
+
const fragments = draw(
|
|
227
|
+
[
|
|
228
|
+
"sequenceDiagram",
|
|
229
|
+
" loop retry",
|
|
230
|
+
" alt ok",
|
|
231
|
+
" A ->> B: one",
|
|
232
|
+
" end",
|
|
233
|
+
" end",
|
|
234
|
+
].join("\n"),
|
|
235
|
+
).querySelectorAll("[data-fragment]");
|
|
236
|
+
expect([...fragments].map((f) => f.getAttribute("data-fragment"))).toEqual([
|
|
237
|
+
"loop",
|
|
238
|
+
"alt",
|
|
239
|
+
]);
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
describe("SequenceDiagram - theming", () => {
|
|
244
|
+
it("takes every colour from a CSS variable", () => {
|
|
245
|
+
const container = draw(
|
|
246
|
+
[
|
|
247
|
+
"sequenceDiagram",
|
|
248
|
+
" actor U",
|
|
249
|
+
" U ->> S: hi",
|
|
250
|
+
" Note over S: think",
|
|
251
|
+
" alt yes",
|
|
252
|
+
" S -->> U: ok",
|
|
253
|
+
" end",
|
|
254
|
+
].join("\n"),
|
|
255
|
+
);
|
|
256
|
+
const colours = [...container.querySelectorAll("*")].flatMap((node) =>
|
|
257
|
+
["fill", "stroke"]
|
|
258
|
+
.map((attribute) => node.getAttribute(attribute))
|
|
259
|
+
.filter((value): value is string => Boolean(value)),
|
|
260
|
+
);
|
|
261
|
+
expect(colours.length).toBeGreaterThan(0);
|
|
262
|
+
for (const colour of colours)
|
|
263
|
+
expect(colour).toMatch(
|
|
264
|
+
/^(var\(--[\w-]+\)|none|currentColor|context-stroke)$/,
|
|
265
|
+
);
|
|
266
|
+
});
|
|
267
|
+
});
|