@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
|
@@ -1,28 +1,63 @@
|
|
|
1
1
|
import { FlowchartDiagram } from "./FlowchartDiagram.js";
|
|
2
2
|
import { parseFlowchart } from "./flowchartParser.js";
|
|
3
3
|
import { layoutFlowchart } from "./layoutFlowchart.js";
|
|
4
|
+
import { layoutSequence } from "./layoutSequence.js";
|
|
5
|
+
import { SequenceDiagram } from "./SequenceDiagram.js";
|
|
6
|
+
import { parseSequence } from "./sequenceParser.js";
|
|
4
7
|
import "react";
|
|
5
8
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
6
9
|
//#region src/components/markdown-view/diagram/MermaidFence.tsx
|
|
7
10
|
/**
|
|
8
|
-
* The lazy chunk's entry point
|
|
9
|
-
* fence
|
|
11
|
+
* The lazy chunk's entry point, and the dispatcher between the two
|
|
12
|
+
* pipelines: read the header, parse, lay out, draw - or hand back the fence
|
|
13
|
+
* untouched.
|
|
10
14
|
*
|
|
11
|
-
* This is the ONLY module that pulls in
|
|
15
|
+
* This is the ONLY module that pulls in either parser, `graphre` and either
|
|
12
16
|
* emitter, and it is imported through `lazy()` from `markdown-view.tsx`.
|
|
13
|
-
* That is the
|
|
14
|
-
* nothing at all.
|
|
17
|
+
* That is the whole constraint the diagram layer lives under: a document
|
|
18
|
+
* with no diagram must pay nothing at all.
|
|
15
19
|
*
|
|
16
|
-
* **
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
+
* **The two pipelines are parallel, not shared.** A flowchart ranks a node
|
|
21
|
+
* graph and needs a layout library; a sequence diagram has both axes
|
|
22
|
+
* decided by source order and needs none. Lifelines, ordered messages and
|
|
23
|
+
* fragment boxes have essentially nothing in common with nodes, edges and
|
|
24
|
+
* clusters, so one model type for both would make both halves worse. What
|
|
25
|
+
* they do share is the text metrics, the theming, the marker namespacing,
|
|
26
|
+
* the error boundary and the policy below.
|
|
27
|
+
*
|
|
28
|
+
* **Failure is always the code block, silently.** A parse failure, a
|
|
29
|
+
* refused construct, a diagram past its cap, and a `classDiagram` all land
|
|
30
|
+
* here identically. Agents write invalid mermaid, and a red error box in
|
|
31
|
+
* the middle of a folio is worse than a grey fence.
|
|
20
32
|
*/
|
|
21
33
|
const MermaidFence = (props) => {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
const kind = diagramKind(props.source);
|
|
35
|
+
if (kind === "sequence") {
|
|
36
|
+
const model = parseSequence(props.source);
|
|
37
|
+
const diagram = model ? layoutSequence(model) : void 0;
|
|
38
|
+
return diagram ? /* @__PURE__ */ jsx(SequenceDiagram, { diagram }) : /* @__PURE__ */ jsx(Fragment$1, { children: props.fallback });
|
|
39
|
+
}
|
|
40
|
+
if (kind === "flowchart") {
|
|
41
|
+
const model = parseFlowchart(props.source);
|
|
42
|
+
const graph = model ? layoutFlowchart(model) : void 0;
|
|
43
|
+
return graph ? /* @__PURE__ */ jsx(FlowchartDiagram, { graph }) : /* @__PURE__ */ jsx(Fragment$1, { children: props.fallback });
|
|
44
|
+
}
|
|
45
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: props.fallback });
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Which pipeline a fence belongs to, from its header line.
|
|
49
|
+
*
|
|
50
|
+
* The header is the first line that is not YAML frontmatter, a
|
|
51
|
+
* `%%{init: …}%%` directive or a `%%` comment - mermaid allows all three
|
|
52
|
+
* above it. Both parsers check their own header again, because both are
|
|
53
|
+
* independently callable; this exists so an unsupported diagram type never
|
|
54
|
+
* enters a parser at all.
|
|
55
|
+
*/
|
|
56
|
+
const diagramKind = (source) => {
|
|
57
|
+
const header = source.replace(/^\s*---\r?\n[\s\S]*?\r?\n---\r?\n/, "").replace(/%%\{[\s\S]*?\}%%/g, "").split(/\r?\n/).map((line) => line.replace(/%%.*$/, "").trim()).find(Boolean);
|
|
58
|
+
if (!header) return void 0;
|
|
59
|
+
if (/^sequenceDiagram\b/i.test(header)) return "sequence";
|
|
60
|
+
if (/^(?:flowchart|graph)\b/i.test(header)) return "flowchart";
|
|
26
61
|
};
|
|
27
62
|
//#endregion
|
|
28
63
|
export { MermaidFence, MermaidFence as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MermaidFence.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/MermaidFence.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport type { ReactNode } from \"react\";\n\nimport { FlowchartDiagram } from \"./FlowchartDiagram.tsx\";\nimport { parseFlowchart } from \"./flowchartParser.ts\";\nimport { layoutFlowchart } from \"./layoutFlowchart.ts\";\n\nexport interface MermaidFenceProps {\n /**\n * The raw text between the fence markers.\n */\n source: string;\n /**\n * What to render when the source is not a
|
|
1
|
+
{"version":3,"file":"MermaidFence.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/MermaidFence.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport type { ReactNode } from \"react\";\n\nimport { FlowchartDiagram } from \"./FlowchartDiagram.tsx\";\nimport { parseFlowchart } from \"./flowchartParser.ts\";\nimport { layoutFlowchart } from \"./layoutFlowchart.ts\";\nimport { layoutSequence } from \"./layoutSequence.ts\";\nimport { SequenceDiagram } from \"./SequenceDiagram.tsx\";\nimport { parseSequence } from \"./sequenceParser.ts\";\n\nexport interface MermaidFenceProps {\n /**\n * The raw text between the fence markers.\n */\n source: string;\n /**\n * What to render when the source is not a diagram we can draw. Always the\n * code block the fence would otherwise have produced.\n */\n fallback: ReactNode;\n}\n\n/**\n * The lazy chunk's entry point, and the dispatcher between the two\n * pipelines: read the header, parse, lay out, draw - or hand back the fence\n * untouched.\n *\n * This is the ONLY module that pulls in either parser, `graphre` and either\n * emitter, and it is imported through `lazy()` from `markdown-view.tsx`.\n * That is the whole constraint the diagram layer lives under: a document\n * with no diagram must pay nothing at all.\n *\n * **The two pipelines are parallel, not shared.** A flowchart ranks a node\n * graph and needs a layout library; a sequence diagram has both axes\n * decided by source order and needs none. Lifelines, ordered messages and\n * fragment boxes have essentially nothing in common with nodes, edges and\n * clusters, so one model type for both would make both halves worse. What\n * they do share is the text metrics, the theming, the marker namespacing,\n * the error boundary and the policy below.\n *\n * **Failure is always the code block, silently.** A parse failure, a\n * refused construct, a diagram past its cap, and a `classDiagram` all land\n * here identically. Agents write invalid mermaid, and a red error box in\n * the middle of a folio is worse than a grey fence.\n */\nexport const MermaidFence = (props: MermaidFenceProps) => {\n const kind = diagramKind(props.source);\n\n if (kind === \"sequence\") {\n const model = parseSequence(props.source);\n const diagram = model ? layoutSequence(model) : undefined;\n return diagram ? (\n <SequenceDiagram diagram={diagram} />\n ) : (\n <>{props.fallback}</>\n );\n }\n\n if (kind === \"flowchart\") {\n const model = parseFlowchart(props.source);\n const graph = model ? layoutFlowchart(model) : undefined;\n return graph ? <FlowchartDiagram graph={graph} /> : <>{props.fallback}</>;\n }\n\n return <>{props.fallback}</>;\n};\n\n/**\n * Which pipeline a fence belongs to, from its header line.\n *\n * The header is the first line that is not YAML frontmatter, a\n * `%%{init: …}%%` directive or a `%%` comment - mermaid allows all three\n * above it. Both parsers check their own header again, because both are\n * independently callable; this exists so an unsupported diagram type never\n * enters a parser at all.\n */\nconst diagramKind = (source: string): \"sequence\" | \"flowchart\" | undefined => {\n const header = source\n .replace(/^\\s*---\\r?\\n[\\s\\S]*?\\r?\\n---\\r?\\n/, \"\")\n .replace(/%%\\{[\\s\\S]*?\\}%%/g, \"\")\n .split(/\\r?\\n/)\n .map((line) => line.replace(/%%.*$/, \"\").trim())\n .find(Boolean);\n\n if (!header) return undefined;\n if (/^sequenceDiagram\\b/i.test(header)) return \"sequence\";\n if (/^(?:flowchart|graph)\\b/i.test(header)) return \"flowchart\";\n return undefined;\n};\n\n// Default export as well, so the `lazy()` call site stays a bare\n// `import(...)` with no `.then(m => ({ default: m.X }))` wrapper.\nexport default MermaidFence;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAa,gBAAgB,UAA6B;CACxD,MAAM,OAAO,YAAY,MAAM,MAAM;CAErC,IAAI,SAAS,YAAY;EACvB,MAAM,QAAQ,cAAc,MAAM,MAAM;EACxC,MAAM,UAAU,QAAQ,eAAe,KAAK,IAAI,KAAA;EAChD,OAAO,UACL,oBAAC,iBAAD,EAA0B,QAAU,CAAA,IAEpC,oBAAA,YAAA,EAAA,UAAG,MAAM,SAAW,CAAA;CAExB;CAEA,IAAI,SAAS,aAAa;EACxB,MAAM,QAAQ,eAAe,MAAM,MAAM;EACzC,MAAM,QAAQ,QAAQ,gBAAgB,KAAK,IAAI,KAAA;EAC/C,OAAO,QAAQ,oBAAC,kBAAD,EAAyB,MAAQ,CAAA,IAAI,oBAAA,YAAA,EAAA,UAAG,MAAM,SAAW,CAAA;CAC1E;CAEA,OAAO,oBAAA,YAAA,EAAA,UAAG,MAAM,SAAW,CAAA;AAC7B;;;;;;;;;;AAWA,MAAM,eAAe,WAAyD;CAC5E,MAAM,SAAS,OACZ,QAAQ,qCAAqC,EAAE,CAAC,CAChD,QAAQ,qBAAqB,EAAE,CAAC,CAChC,MAAM,OAAO,CAAC,CACd,KAAK,SAAS,KAAK,QAAQ,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAC/C,KAAK,OAAO;CAEf,IAAI,CAAC,QAAQ,OAAO,KAAA;CACpB,IAAI,sBAAsB,KAAK,MAAM,GAAG,OAAO;CAC/C,IAAI,0BAA0B,KAAK,MAAM,GAAG,OAAO;AAErD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PositionedSequence } from "./layoutSequence.ts";
|
|
3
|
+
export interface SequenceDiagramProps {
|
|
4
|
+
diagram: PositionedSequence;
|
|
5
|
+
/**
|
|
6
|
+
* Read out to assistive technology as the diagram's name.
|
|
7
|
+
*/
|
|
8
|
+
title?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Draw a laid-out sequence diagram as themed SVG.
|
|
12
|
+
*
|
|
13
|
+
* Everything the flowchart emitter settled applies here unchanged, and none
|
|
14
|
+
* of it is optional:
|
|
15
|
+
*
|
|
16
|
+
* ## React elements, not an HTML string
|
|
17
|
+
*
|
|
18
|
+
* `markdown-view.tsx` carries an explicit rule that no raw HTML is ever
|
|
19
|
+
* promoted to markup, because it renders one user's content to another.
|
|
20
|
+
* Emitting elements means labels are escaped by React itself and
|
|
21
|
+
* `dangerouslySetInnerHTML` never appears on this path.
|
|
22
|
+
*
|
|
23
|
+
* ## Theming is the point
|
|
24
|
+
*
|
|
25
|
+
* Colours come from `--primary`, `--border`, `--muted-foreground`, `--card`
|
|
26
|
+
* and `--muted` through `var(...)`, so dark mode works with no second
|
|
27
|
+
* palette and no theme prop. That is the thing mermaid can structurally
|
|
28
|
+
* never give us, and the whole reason drawing is our own code.
|
|
29
|
+
*
|
|
30
|
+
* ## The font is pinned, never inherited
|
|
31
|
+
*
|
|
32
|
+
* Folio view mode sets prose in Literata at 16.5px and lazy-loads it. The
|
|
33
|
+
* width table is generated against Inter at `DIAGRAM_FONT_SIZE`, so
|
|
34
|
+
* inheriting would make text and box disagree per surface and shift when
|
|
35
|
+
* the serif lands. `fontFamily` / `fontSize` are camelCase, not the
|
|
36
|
+
* hyphenated spelling: React renders the same SVG presentation attributes
|
|
37
|
+
* either way, but hyphenated logs `Invalid DOM property` on every render,
|
|
38
|
+
* from a component mounted on every markdown surface in the app.
|
|
39
|
+
*
|
|
40
|
+
* ## Unlike a flowchart, the width is natural rather than fitted
|
|
41
|
+
*
|
|
42
|
+
* A flowchart is roughly as tall as it is wide and scales into the prose
|
|
43
|
+
* column. A sequence diagram's width is driven by participant count with
|
|
44
|
+
* nothing to wrap, so scaling eight participants into a phone column puts
|
|
45
|
+
* the labels at around 5px with no way for the reader to recover. So the
|
|
46
|
+
* SVG takes its natural width and this component frames it in a scroll
|
|
47
|
+
* container, with the keyboard affordances that come with one.
|
|
48
|
+
*/
|
|
49
|
+
export declare const SequenceDiagram: (props: SequenceDiagramProps) => React.JSX.Element;
|
|
50
|
+
//# sourceMappingURL=SequenceDiagram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceDiagram.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/SequenceDiagram.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAO9D,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,kBAAkB,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,eAAe,UAAW,oBAAoB,sBA6I1D,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { DIAGRAM_FONT_FAMILY } from "./textMetrics.js";
|
|
2
|
+
import { round } from "./DiagramLabel.js";
|
|
3
|
+
import { SequenceDiagramFragment } from "./SequenceDiagramFragment.js";
|
|
4
|
+
import { SequenceDiagramMessage } from "./SequenceDiagramMessage.js";
|
|
5
|
+
import { SequenceDiagramNote } from "./SequenceDiagramNote.js";
|
|
6
|
+
import { SequenceDiagramParticipant } from "./SequenceDiagramParticipant.js";
|
|
7
|
+
import { useId } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/markdown-view/diagram/SequenceDiagram.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Draw a laid-out sequence diagram as themed SVG.
|
|
12
|
+
*
|
|
13
|
+
* Everything the flowchart emitter settled applies here unchanged, and none
|
|
14
|
+
* of it is optional:
|
|
15
|
+
*
|
|
16
|
+
* ## React elements, not an HTML string
|
|
17
|
+
*
|
|
18
|
+
* `markdown-view.tsx` carries an explicit rule that no raw HTML is ever
|
|
19
|
+
* promoted to markup, because it renders one user's content to another.
|
|
20
|
+
* Emitting elements means labels are escaped by React itself and
|
|
21
|
+
* `dangerouslySetInnerHTML` never appears on this path.
|
|
22
|
+
*
|
|
23
|
+
* ## Theming is the point
|
|
24
|
+
*
|
|
25
|
+
* Colours come from `--primary`, `--border`, `--muted-foreground`, `--card`
|
|
26
|
+
* and `--muted` through `var(...)`, so dark mode works with no second
|
|
27
|
+
* palette and no theme prop. That is the thing mermaid can structurally
|
|
28
|
+
* never give us, and the whole reason drawing is our own code.
|
|
29
|
+
*
|
|
30
|
+
* ## The font is pinned, never inherited
|
|
31
|
+
*
|
|
32
|
+
* Folio view mode sets prose in Literata at 16.5px and lazy-loads it. The
|
|
33
|
+
* width table is generated against Inter at `DIAGRAM_FONT_SIZE`, so
|
|
34
|
+
* inheriting would make text and box disagree per surface and shift when
|
|
35
|
+
* the serif lands. `fontFamily` / `fontSize` are camelCase, not the
|
|
36
|
+
* hyphenated spelling: React renders the same SVG presentation attributes
|
|
37
|
+
* either way, but hyphenated logs `Invalid DOM property` on every render,
|
|
38
|
+
* from a component mounted on every markdown surface in the app.
|
|
39
|
+
*
|
|
40
|
+
* ## Unlike a flowchart, the width is natural rather than fitted
|
|
41
|
+
*
|
|
42
|
+
* A flowchart is roughly as tall as it is wide and scales into the prose
|
|
43
|
+
* column. A sequence diagram's width is driven by participant count with
|
|
44
|
+
* nothing to wrap, so scaling eight participants into a phone column puts
|
|
45
|
+
* the labels at around 5px with no way for the reader to recover. So the
|
|
46
|
+
* SVG takes its natural width and this component frames it in a scroll
|
|
47
|
+
* container, with the keyboard affordances that come with one.
|
|
48
|
+
*/
|
|
49
|
+
const SequenceDiagram = (props) => {
|
|
50
|
+
const diagram = props.diagram;
|
|
51
|
+
const scope = useId().replace(/[^\w-]/g, "");
|
|
52
|
+
const title = props.title ?? "Sequence diagram";
|
|
53
|
+
return /* @__PURE__ */ jsx("div", {
|
|
54
|
+
className: "alepha-diagram-scroll my-4",
|
|
55
|
+
tabIndex: 0,
|
|
56
|
+
role: "region",
|
|
57
|
+
"aria-label": title,
|
|
58
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
59
|
+
role: "img",
|
|
60
|
+
viewBox: `0 0 ${round(diagram.width)} ${round(diagram.height)}`,
|
|
61
|
+
width: round(diagram.width),
|
|
62
|
+
height: round(diagram.height),
|
|
63
|
+
className: "block",
|
|
64
|
+
fontFamily: DIAGRAM_FONT_FAMILY,
|
|
65
|
+
fontSize: diagram.fontSize,
|
|
66
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx("title", { children: title }),
|
|
69
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
70
|
+
/* @__PURE__ */ jsx("marker", {
|
|
71
|
+
id: `${scope}-seq-arrow`,
|
|
72
|
+
markerWidth: "9",
|
|
73
|
+
markerHeight: "7",
|
|
74
|
+
refX: "8.5",
|
|
75
|
+
refY: "3.5",
|
|
76
|
+
orient: "auto",
|
|
77
|
+
markerUnits: "userSpaceOnUse",
|
|
78
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
79
|
+
d: "M0,0 L9,3.5 L0,7 z",
|
|
80
|
+
fill: "context-stroke"
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ jsx("marker", {
|
|
84
|
+
id: `${scope}-seq-open`,
|
|
85
|
+
markerWidth: "10",
|
|
86
|
+
markerHeight: "8",
|
|
87
|
+
refX: "9",
|
|
88
|
+
refY: "4",
|
|
89
|
+
orient: "auto",
|
|
90
|
+
markerUnits: "userSpaceOnUse",
|
|
91
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
92
|
+
d: "M1,0.5 L9,4 L1,7.5",
|
|
93
|
+
fill: "none",
|
|
94
|
+
stroke: "context-stroke",
|
|
95
|
+
strokeWidth: "1.3",
|
|
96
|
+
strokeLinecap: "round",
|
|
97
|
+
strokeLinejoin: "round"
|
|
98
|
+
})
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsx("marker", {
|
|
101
|
+
id: `${scope}-seq-cross`,
|
|
102
|
+
markerWidth: "9",
|
|
103
|
+
markerHeight: "9",
|
|
104
|
+
refX: "8",
|
|
105
|
+
refY: "4.5",
|
|
106
|
+
orient: "auto",
|
|
107
|
+
markerUnits: "userSpaceOnUse",
|
|
108
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
109
|
+
d: "M1.5,1.5 L7.5,7.5 M7.5,1.5 L1.5,7.5",
|
|
110
|
+
fill: "none",
|
|
111
|
+
stroke: "context-stroke",
|
|
112
|
+
strokeWidth: "1.4",
|
|
113
|
+
strokeLinecap: "round"
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
] }),
|
|
117
|
+
diagram.fragments.map((fragment, index) => /* @__PURE__ */ jsx(SequenceDiagramFragment, {
|
|
118
|
+
fragment,
|
|
119
|
+
fontSize: diagram.fontSize
|
|
120
|
+
}, `${fragment.kind}@${fragment.depth}#${index}`)),
|
|
121
|
+
diagram.participants.map((participant) => /* @__PURE__ */ jsx(SequenceDiagramParticipant, {
|
|
122
|
+
participant,
|
|
123
|
+
fontSize: diagram.fontSize
|
|
124
|
+
}, participant.id)),
|
|
125
|
+
diagram.messages.map((message, index) => /* @__PURE__ */ jsx(SequenceDiagramMessage, {
|
|
126
|
+
message,
|
|
127
|
+
scope,
|
|
128
|
+
fontSize: diagram.fontSize
|
|
129
|
+
}, `${message.from}->${message.to}#${index}`)),
|
|
130
|
+
diagram.notes.map((note, index) => /* @__PURE__ */ jsx(SequenceDiagramNote, {
|
|
131
|
+
note,
|
|
132
|
+
fontSize: diagram.fontSize
|
|
133
|
+
}, `note#${index}`))
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
//#endregion
|
|
139
|
+
export { SequenceDiagram };
|
|
140
|
+
|
|
141
|
+
//# sourceMappingURL=SequenceDiagram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceDiagram.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/SequenceDiagram.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { useId } from \"react\";\n\nimport { round } from \"./DiagramLabel.tsx\";\nimport type { PositionedSequence } from \"./layoutSequence.ts\";\nimport { SequenceDiagramFragment } from \"./SequenceDiagramFragment.tsx\";\nimport { SequenceDiagramMessage } from \"./SequenceDiagramMessage.tsx\";\nimport { SequenceDiagramNote } from \"./SequenceDiagramNote.tsx\";\nimport { SequenceDiagramParticipant } from \"./SequenceDiagramParticipant.tsx\";\nimport { DIAGRAM_FONT_FAMILY } from \"./textMetrics.ts\";\n\nexport interface SequenceDiagramProps {\n diagram: PositionedSequence;\n /**\n * Read out to assistive technology as the diagram's name.\n */\n title?: string;\n}\n\n/**\n * Draw a laid-out sequence diagram as themed SVG.\n *\n * Everything the flowchart emitter settled applies here unchanged, and none\n * of it is optional:\n *\n * ## React elements, not an HTML string\n *\n * `markdown-view.tsx` carries an explicit rule that no raw HTML is ever\n * promoted to markup, because it renders one user's content to another.\n * Emitting elements means labels are escaped by React itself and\n * `dangerouslySetInnerHTML` never appears on this path.\n *\n * ## Theming is the point\n *\n * Colours come from `--primary`, `--border`, `--muted-foreground`, `--card`\n * and `--muted` through `var(...)`, so dark mode works with no second\n * palette and no theme prop. That is the thing mermaid can structurally\n * never give us, and the whole reason drawing is our own code.\n *\n * ## The font is pinned, never inherited\n *\n * Folio view mode sets prose in Literata at 16.5px and lazy-loads it. The\n * width table is generated against Inter at `DIAGRAM_FONT_SIZE`, so\n * inheriting would make text and box disagree per surface and shift when\n * the serif lands. `fontFamily` / `fontSize` are camelCase, not the\n * hyphenated spelling: React renders the same SVG presentation attributes\n * either way, but hyphenated logs `Invalid DOM property` on every render,\n * from a component mounted on every markdown surface in the app.\n *\n * ## Unlike a flowchart, the width is natural rather than fitted\n *\n * A flowchart is roughly as tall as it is wide and scales into the prose\n * column. A sequence diagram's width is driven by participant count with\n * nothing to wrap, so scaling eight participants into a phone column puts\n * the labels at around 5px with no way for the reader to recover. So the\n * SVG takes its natural width and this component frames it in a scroll\n * container, with the keyboard affordances that come with one.\n */\nexport const SequenceDiagram = (props: SequenceDiagramProps) => {\n const diagram = props.diagram;\n // SVG marker ids are global to the DOCUMENT: two diagrams on one page\n // with the same arrowhead id fight, and the loser's arrows vanish.\n const scope = useId().replace(/[^\\w-]/g, \"\");\n const title = props.title ?? \"Sequence diagram\";\n\n return (\n <div\n // `tabIndex` and `role` are the a11y requirement, not decoration: a\n // scrollable region that cannot be focused cannot be scrolled from a\n // keyboard at all, so the part of the diagram past the fold would be\n // unreachable. The named region is what gives it an accessible name\n // to announce when focus lands there.\n //\n // This reopens the \"no interactivity\" line the design drew, scoped to\n // scrolling and nothing else. Pan, zoom and click-through stay out.\n className=\"alepha-diagram-scroll my-4\"\n // A scrollable region is the documented exception to\n // `no-noninteractive-tabindex`: WAI's own guidance is `tabindex=\"0\"`\n // plus a named `region`, because without focus the content past the\n // fold cannot be reached by keyboard at all. The rule's allowlist\n // covers `tabpanel` and not `region`, which is what it is flagging.\n // oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n role=\"region\"\n aria-label={title}\n >\n <svg\n role=\"img\"\n viewBox={`0 0 ${round(diagram.width)} ${round(diagram.height)}`}\n width={round(diagram.width)}\n height={round(diagram.height)}\n className=\"block\"\n fontFamily={DIAGRAM_FONT_FAMILY}\n fontSize={diagram.fontSize}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>{title}</title>\n <defs>\n {/*\n THREE head kinds, not one. Epic #5 shipped a single end marker,\n which is exactly why `--o` and `--x` silently draw the same\n arrowhead as `-->` in a flowchart. Here `->>`, `-x` and `-)` are\n three different statements about a message and each gets its own.\n\n `context-stroke` throughout, never `currentColor`: a marker lives\n in `<defs>`, so `currentColor` resolves against the MARKER's\n inherited colour rather than the referencing line's - the head\n came out `--foreground` while its line was `--muted-foreground`,\n and in a differently-themed container it was wrong outright.\n */}\n <marker\n id={`${scope}-seq-arrow`}\n markerWidth=\"9\"\n markerHeight=\"7\"\n refX=\"8.5\"\n refY=\"3.5\"\n orient=\"auto\"\n markerUnits=\"userSpaceOnUse\"\n >\n <path d=\"M0,0 L9,3.5 L0,7 z\" fill=\"context-stroke\" />\n </marker>\n <marker\n id={`${scope}-seq-open`}\n markerWidth=\"10\"\n markerHeight=\"8\"\n refX=\"9\"\n refY=\"4\"\n orient=\"auto\"\n markerUnits=\"userSpaceOnUse\"\n >\n {/* The async form: an open V rather than a filled head. */}\n <path\n d=\"M1,0.5 L9,4 L1,7.5\"\n fill=\"none\"\n stroke=\"context-stroke\"\n strokeWidth=\"1.3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </marker>\n <marker\n id={`${scope}-seq-cross`}\n markerWidth=\"9\"\n markerHeight=\"9\"\n refX=\"8\"\n refY=\"4.5\"\n orient=\"auto\"\n markerUnits=\"userSpaceOnUse\"\n >\n <path\n d=\"M1.5,1.5 L7.5,7.5 M7.5,1.5 L1.5,7.5\"\n fill=\"none\"\n stroke=\"context-stroke\"\n strokeWidth=\"1.4\"\n strokeLinecap=\"round\"\n />\n </marker>\n </defs>\n\n {/*\n Order IS z-order in SVG. Fragment boxes go down first (they are\n outlines, and the outermost is first in the list), then the\n lifelines, then the messages, and notes last because a note is an\n opaque box that has to cover the lifeline it sits on.\n */}\n {diagram.fragments.map((fragment, index) => (\n <SequenceDiagramFragment\n key={`${fragment.kind}@${fragment.depth}#${index}`}\n fragment={fragment}\n fontSize={diagram.fontSize}\n />\n ))}\n {diagram.participants.map((participant) => (\n <SequenceDiagramParticipant\n key={participant.id}\n participant={participant}\n fontSize={diagram.fontSize}\n />\n ))}\n {diagram.messages.map((message, index) => (\n <SequenceDiagramMessage\n key={`${message.from}->${message.to}#${index}`}\n message={message}\n scope={scope}\n fontSize={diagram.fontSize}\n />\n ))}\n {diagram.notes.map((note, index) => (\n <SequenceDiagramNote\n // Notes are positional and their text may legitimately repeat, so\n // the index is the identity here.\n key={`note#${index}`}\n note={note}\n fontSize={diagram.fontSize}\n />\n ))}\n </svg>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAa,mBAAmB,UAAgC;CAC9D,MAAM,UAAU,MAAM;CAGtB,MAAM,QAAQ,MAAM,CAAC,CAAC,QAAQ,WAAW,EAAE;CAC3C,MAAM,QAAQ,MAAM,SAAS;CAE7B,OACE,oBAAC,OAAD;EASE,WAAU;EAOV,UAAU;EACV,MAAK;EACL,cAAY;EAEZ,UAAA,qBAAC,OAAD;GACE,MAAK;GACL,SAAS,OAAO,MAAM,QAAQ,KAAK,EAAE,GAAG,MAAM,QAAQ,MAAM;GAC5D,OAAO,MAAM,QAAQ,KAAK;GAC1B,QAAQ,MAAM,QAAQ,MAAM;GAC5B,WAAU;GACV,YAAY;GACZ,UAAU,QAAQ;GAClB,OAAM;GARR,UAAA;IAUE,oBAAC,SAAD,EAAA,UAAQ,MAAa,CAAA;IACrB,qBAAC,QAAD,EAAA,UAAA;KAaE,oBAAC,UAAD;MACE,IAAI,GAAG,MAAM;MACb,aAAY;MACZ,cAAa;MACb,MAAK;MACL,MAAK;MACL,QAAO;MACP,aAAY;MAEZ,UAAA,oBAAC,QAAD;OAAM,GAAE;OAAqB,MAAK;MAAkB,CAAA;KAC9C,CAAA;KACR,oBAAC,UAAD;MACE,IAAI,GAAG,MAAM;MACb,aAAY;MACZ,cAAa;MACb,MAAK;MACL,MAAK;MACL,QAAO;MACP,aAAY;MAGZ,UAAA,oBAAC,QAAD;OACE,GAAE;OACF,MAAK;OACL,QAAO;OACP,aAAY;OACZ,eAAc;OACd,gBAAe;MAChB,CAAA;KACK,CAAA;KACR,oBAAC,UAAD;MACE,IAAI,GAAG,MAAM;MACb,aAAY;MACZ,cAAa;MACb,MAAK;MACL,MAAK;MACL,QAAO;MACP,aAAY;MAEZ,UAAA,oBAAC,QAAD;OACE,GAAE;OACF,MAAK;OACL,QAAO;OACP,aAAY;OACZ,eAAc;MACf,CAAA;KACK,CAAA;IACJ,EAAA,CAAA;IAQL,QAAQ,UAAU,KAAK,UAAU,UAChC,oBAAC,yBAAD;KAEY;KACV,UAAU,QAAQ;IACnB,GAHM,GAAG,SAAS,KAAK,GAAG,SAAS,MAAM,GAAG,OAG5C,CACF;IACA,QAAQ,aAAa,KAAK,gBACzB,oBAAC,4BAAD;KAEe;KACb,UAAU,QAAQ;IACnB,GAHM,YAAY,EAGlB,CACF;IACA,QAAQ,SAAS,KAAK,SAAS,UAC9B,oBAAC,wBAAD;KAEW;KACF;KACP,UAAU,QAAQ;IACnB,GAJM,GAAG,QAAQ,KAAK,IAAI,QAAQ,GAAG,GAAG,OAIxC,CACF;IACA,QAAQ,MAAM,KAAK,MAAM,UACxB,oBAAC,qBAAD;KAIQ;KACN,UAAU,QAAQ;IACnB,GAHM,QAAQ,OAGd,CACF;GACE;;CACF,CAAA;AAET"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PositionedFragment } from "./layoutSequence.ts";
|
|
3
|
+
export interface SequenceDiagramFragmentProps {
|
|
4
|
+
fragment: PositionedFragment;
|
|
5
|
+
fontSize: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The box around an `alt`, `opt` or `loop`, its corner tab, and a dashed
|
|
9
|
+
* divider at each `else`.
|
|
10
|
+
*
|
|
11
|
+
* ## Why fragments are drawn at all, when activation bars were cut
|
|
12
|
+
*
|
|
13
|
+
* Without them an `alt` block has two outcomes and both are bad: refuse the
|
|
14
|
+
* whole diagram, or draw the branches one under the other as though they
|
|
15
|
+
* all happen. The second is silently wrong output about a protocol, which
|
|
16
|
+
* is the one failure mode the design refuses to ship.
|
|
17
|
+
*
|
|
18
|
+
* The box is an outline with no fill, so it never hides a lifeline it
|
|
19
|
+
* spans and its z-order does not matter. Only the tab is filled, because
|
|
20
|
+
* it sits on top of the lifelines it crosses.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SequenceDiagramFragment: (props: SequenceDiagramFragmentProps) => React.JSX.Element;
|
|
23
|
+
//# sourceMappingURL=SequenceDiagramFragment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceDiagramFragment.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/SequenceDiagramFragment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB,UAC3B,4BAA4B,sBA2FpC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { round } from "./DiagramLabel.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/markdown-view/diagram/SequenceDiagramFragment.tsx
|
|
5
|
+
/**
|
|
6
|
+
* The box around an `alt`, `opt` or `loop`, its corner tab, and a dashed
|
|
7
|
+
* divider at each `else`.
|
|
8
|
+
*
|
|
9
|
+
* ## Why fragments are drawn at all, when activation bars were cut
|
|
10
|
+
*
|
|
11
|
+
* Without them an `alt` block has two outcomes and both are bad: refuse the
|
|
12
|
+
* whole diagram, or draw the branches one under the other as though they
|
|
13
|
+
* all happen. The second is silently wrong output about a protocol, which
|
|
14
|
+
* is the one failure mode the design refuses to ship.
|
|
15
|
+
*
|
|
16
|
+
* The box is an outline with no fill, so it never hides a lifeline it
|
|
17
|
+
* spans and its z-order does not matter. Only the tab is filled, because
|
|
18
|
+
* it sits on top of the lifelines it crosses.
|
|
19
|
+
*/
|
|
20
|
+
const SequenceDiagramFragment = (props) => {
|
|
21
|
+
const fragment = props.fragment;
|
|
22
|
+
const x = round(fragment.x);
|
|
23
|
+
const y = round(fragment.y);
|
|
24
|
+
const width = round(fragment.width);
|
|
25
|
+
const small = props.fontSize * .92;
|
|
26
|
+
const notch = 6;
|
|
27
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
28
|
+
"data-fragment": fragment.kind,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("rect", {
|
|
31
|
+
x,
|
|
32
|
+
y,
|
|
33
|
+
width,
|
|
34
|
+
height: round(fragment.height),
|
|
35
|
+
rx: 4,
|
|
36
|
+
ry: 4,
|
|
37
|
+
fill: "none",
|
|
38
|
+
stroke: "var(--border)",
|
|
39
|
+
strokeWidth: 1.25
|
|
40
|
+
}),
|
|
41
|
+
fragment.dividers.map((divider) => /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("line", {
|
|
42
|
+
x1: x,
|
|
43
|
+
y1: round(divider.y),
|
|
44
|
+
x2: round(fragment.x + fragment.width),
|
|
45
|
+
y2: round(divider.y),
|
|
46
|
+
stroke: "var(--border)",
|
|
47
|
+
strokeWidth: 1.25,
|
|
48
|
+
strokeDasharray: "5 4"
|
|
49
|
+
}), divider.label ? /* @__PURE__ */ jsxs("text", {
|
|
50
|
+
x: round(fragment.x + 8),
|
|
51
|
+
y: round(divider.y + small + 2),
|
|
52
|
+
textAnchor: "start",
|
|
53
|
+
fontSize: small,
|
|
54
|
+
fill: "var(--muted-foreground)",
|
|
55
|
+
children: [
|
|
56
|
+
"[",
|
|
57
|
+
divider.label,
|
|
58
|
+
"]"
|
|
59
|
+
]
|
|
60
|
+
}) : null] }, `${round(divider.y)}:${divider.label}`)),
|
|
61
|
+
/* @__PURE__ */ jsx("path", {
|
|
62
|
+
d: [
|
|
63
|
+
`M${x},${y}`,
|
|
64
|
+
`L${round(fragment.x + fragment.tabWidth)},${y}`,
|
|
65
|
+
`L${round(fragment.x + fragment.tabWidth)},${round(fragment.y + fragment.tabHeight - notch)}`,
|
|
66
|
+
`L${round(fragment.x + fragment.tabWidth - notch)},${round(fragment.y + fragment.tabHeight)}`,
|
|
67
|
+
`L${x},${round(fragment.y + fragment.tabHeight)}`,
|
|
68
|
+
"z"
|
|
69
|
+
].join(" "),
|
|
70
|
+
fill: "var(--muted)",
|
|
71
|
+
stroke: "var(--border)",
|
|
72
|
+
strokeWidth: 1.25
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ jsx("text", {
|
|
75
|
+
x: round(fragment.x + fragment.tabWidth / 2),
|
|
76
|
+
y: round(fragment.y + fragment.tabHeight / 2 + props.fontSize * .36),
|
|
77
|
+
textAnchor: "middle",
|
|
78
|
+
fontSize: small,
|
|
79
|
+
fontWeight: 600,
|
|
80
|
+
fill: "var(--muted-foreground)",
|
|
81
|
+
children: fragment.kind
|
|
82
|
+
}),
|
|
83
|
+
fragment.label ? /* @__PURE__ */ jsxs("text", {
|
|
84
|
+
x: round(fragment.x + fragment.tabWidth + 8),
|
|
85
|
+
y: round(fragment.y + fragment.tabHeight / 2 + props.fontSize * .36),
|
|
86
|
+
textAnchor: "start",
|
|
87
|
+
fontSize: small,
|
|
88
|
+
fill: "var(--muted-foreground)",
|
|
89
|
+
children: [
|
|
90
|
+
"[",
|
|
91
|
+
fragment.label,
|
|
92
|
+
"]"
|
|
93
|
+
]
|
|
94
|
+
}) : null
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
export { SequenceDiagramFragment };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=SequenceDiagramFragment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceDiagramFragment.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/SequenceDiagramFragment.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { round } from \"./DiagramLabel.tsx\";\nimport type { PositionedFragment } from \"./layoutSequence.ts\";\n\nexport interface SequenceDiagramFragmentProps {\n fragment: PositionedFragment;\n fontSize: number;\n}\n\n/**\n * The box around an `alt`, `opt` or `loop`, its corner tab, and a dashed\n * divider at each `else`.\n *\n * ## Why fragments are drawn at all, when activation bars were cut\n *\n * Without them an `alt` block has two outcomes and both are bad: refuse the\n * whole diagram, or draw the branches one under the other as though they\n * all happen. The second is silently wrong output about a protocol, which\n * is the one failure mode the design refuses to ship.\n *\n * The box is an outline with no fill, so it never hides a lifeline it\n * spans and its z-order does not matter. Only the tab is filled, because\n * it sits on top of the lifelines it crosses.\n */\nexport const SequenceDiagramFragment = (\n props: SequenceDiagramFragmentProps,\n) => {\n const fragment = props.fragment;\n const x = round(fragment.x);\n const y = round(fragment.y);\n const width = round(fragment.width);\n const small = props.fontSize * 0.92;\n const notch = 6;\n\n return (\n <g data-fragment={fragment.kind}>\n <rect\n x={x}\n y={y}\n width={width}\n height={round(fragment.height)}\n rx={4}\n ry={4}\n fill=\"none\"\n stroke=\"var(--border)\"\n strokeWidth={1.25}\n />\n {fragment.dividers.map((divider) => (\n <g key={`${round(divider.y)}:${divider.label}`}>\n <line\n x1={x}\n y1={round(divider.y)}\n x2={round(fragment.x + fragment.width)}\n y2={round(divider.y)}\n stroke=\"var(--border)\"\n strokeWidth={1.25}\n strokeDasharray=\"5 4\"\n />\n {divider.label ? (\n // BELOW the line, not above it. An `else` names the branch it\n // OPENS, so a label sitting over the divider reads as the last\n // word of the branch that just ended - which is the opposite of\n // what the author wrote.\n <text\n x={round(fragment.x + 8)}\n y={round(divider.y + small + 2)}\n textAnchor=\"start\"\n fontSize={small}\n fill=\"var(--muted-foreground)\"\n >\n [{divider.label}]\n </text>\n ) : null}\n </g>\n ))}\n {/*\n A rectangle with its bottom-right corner cut, which is how UML draws\n the fragment operator. One path rather than a rect plus a polygon,\n so the outline is continuous.\n */}\n <path\n d={[\n `M${x},${y}`,\n `L${round(fragment.x + fragment.tabWidth)},${y}`,\n `L${round(fragment.x + fragment.tabWidth)},${round(fragment.y + fragment.tabHeight - notch)}`,\n `L${round(fragment.x + fragment.tabWidth - notch)},${round(fragment.y + fragment.tabHeight)}`,\n `L${x},${round(fragment.y + fragment.tabHeight)}`,\n \"z\",\n ].join(\" \")}\n fill=\"var(--muted)\"\n stroke=\"var(--border)\"\n strokeWidth={1.25}\n />\n <text\n x={round(fragment.x + fragment.tabWidth / 2)}\n y={round(fragment.y + fragment.tabHeight / 2 + props.fontSize * 0.36)}\n textAnchor=\"middle\"\n fontSize={small}\n fontWeight={600}\n fill=\"var(--muted-foreground)\"\n >\n {fragment.kind}\n </text>\n {fragment.label ? (\n <text\n x={round(fragment.x + fragment.tabWidth + 8)}\n y={round(fragment.y + fragment.tabHeight / 2 + props.fontSize * 0.36)}\n textAnchor=\"start\"\n fontSize={small}\n fill=\"var(--muted-foreground)\"\n >\n [{fragment.label}]\n </text>\n ) : null}\n </g>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2BA,MAAa,2BACX,UACG;CACH,MAAM,WAAW,MAAM;CACvB,MAAM,IAAI,MAAM,SAAS,CAAC;CAC1B,MAAM,IAAI,MAAM,SAAS,CAAC;CAC1B,MAAM,QAAQ,MAAM,SAAS,KAAK;CAClC,MAAM,QAAQ,MAAM,WAAW;CAC/B,MAAM,QAAQ;CAEd,OACE,qBAAC,KAAD;EAAG,iBAAe,SAAS;EAA3B,UAAA;GACE,oBAAC,QAAD;IACK;IACA;IACI;IACP,QAAQ,MAAM,SAAS,MAAM;IAC7B,IAAI;IACJ,IAAI;IACJ,MAAK;IACL,QAAO;IACP,aAAa;GACd,CAAA;GACA,SAAS,SAAS,KAAK,YACtB,qBAAC,KAAD,EAAA,UAAA,CACE,oBAAC,QAAD;IACE,IAAI;IACJ,IAAI,MAAM,QAAQ,CAAC;IACnB,IAAI,MAAM,SAAS,IAAI,SAAS,KAAK;IACrC,IAAI,MAAM,QAAQ,CAAC;IACnB,QAAO;IACP,aAAa;IACb,iBAAgB;GACjB,CAAA,GACA,QAAQ,QAKP,qBAAC,QAAD;IACE,GAAG,MAAM,SAAS,IAAI,CAAC;IACvB,GAAG,MAAM,QAAQ,IAAI,QAAQ,CAAC;IAC9B,YAAW;IACX,UAAU;IACV,MAAK;IALP,UAAA;KAMC;KACG,QAAQ;KAAM;IACZ;GACJ,CAAA,IAAA,IACH,EAAA,GAzBK,GAAG,MAAM,QAAQ,CAAC,EAAE,GAAG,QAAQ,OAyBpC,CACJ;GAMD,oBAAC,QAAD;IACE,GAAG;KACD,IAAI,EAAE,GAAG;KACT,IAAI,MAAM,SAAS,IAAI,SAAS,QAAQ,EAAE,GAAG;KAC7C,IAAI,MAAM,SAAS,IAAI,SAAS,QAAQ,EAAE,GAAG,MAAM,SAAS,IAAI,SAAS,YAAY,KAAK;KAC1F,IAAI,MAAM,SAAS,IAAI,SAAS,WAAW,KAAK,EAAE,GAAG,MAAM,SAAS,IAAI,SAAS,SAAS;KAC1F,IAAI,EAAE,GAAG,MAAM,SAAS,IAAI,SAAS,SAAS;KAC9C;IACF,CAAC,CAAC,KAAK,GAAG;IACV,MAAK;IACL,QAAO;IACP,aAAa;GACd,CAAA;GACD,oBAAC,QAAD;IACE,GAAG,MAAM,SAAS,IAAI,SAAS,WAAW,CAAC;IAC3C,GAAG,MAAM,SAAS,IAAI,SAAS,YAAY,IAAI,MAAM,WAAW,GAAI;IACpE,YAAW;IACX,UAAU;IACV,YAAY;IACZ,MAAK;IAEJ,UAAA,SAAS;GACN,CAAA;GACL,SAAS,QACR,qBAAC,QAAD;IACE,GAAG,MAAM,SAAS,IAAI,SAAS,WAAW,CAAC;IAC3C,GAAG,MAAM,SAAS,IAAI,SAAS,YAAY,IAAI,MAAM,WAAW,GAAI;IACpE,YAAW;IACX,UAAU;IACV,MAAK;IALP,UAAA;KAMC;KACG,SAAS;KAAM;IACb;GACJ,CAAA,IAAA;EACH;;AAEP"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PositionedMessage } from "./layoutSequence.ts";
|
|
3
|
+
export interface SequenceDiagramMessageProps {
|
|
4
|
+
message: PositionedMessage;
|
|
5
|
+
/**
|
|
6
|
+
* Instance-unique prefix for the arrowhead marker ids.
|
|
7
|
+
*/
|
|
8
|
+
scope: string;
|
|
9
|
+
fontSize: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* One message: its line, its head and its label.
|
|
13
|
+
*
|
|
14
|
+
* `currentColor` on the path is what makes the head match. A marker
|
|
15
|
+
* inherits `context-stroke` from the element that references it, so one set
|
|
16
|
+
* of three markers serves every message without a set per colour.
|
|
17
|
+
*
|
|
18
|
+
* The label sits on a `--background` chip. A message spanning several
|
|
19
|
+
* lifelines draws its label over the ones in between, and without the chip
|
|
20
|
+
* the dashes run straight through the text.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SequenceDiagramMessage: (props: SequenceDiagramMessageProps) => React.JSX.Element;
|
|
23
|
+
//# sourceMappingURL=SequenceDiagramMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceDiagramMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/SequenceDiagramMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,iBAAiB,CAAC;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,UAAW,2BAA2B,sBAsCxE,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { DiagramLabel, round } from "./DiagramLabel.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/markdown-view/diagram/SequenceDiagramMessage.tsx
|
|
5
|
+
/**
|
|
6
|
+
* One message: its line, its head and its label.
|
|
7
|
+
*
|
|
8
|
+
* `currentColor` on the path is what makes the head match. A marker
|
|
9
|
+
* inherits `context-stroke` from the element that references it, so one set
|
|
10
|
+
* of three markers serves every message without a set per colour.
|
|
11
|
+
*
|
|
12
|
+
* The label sits on a `--background` chip. A message spanning several
|
|
13
|
+
* lifelines draws its label over the ones in between, and without the chip
|
|
14
|
+
* the dashes run straight through the text.
|
|
15
|
+
*/
|
|
16
|
+
const SequenceDiagramMessage = (props) => {
|
|
17
|
+
const message = props.message;
|
|
18
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
19
|
+
style: { color: "var(--muted-foreground)" },
|
|
20
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
21
|
+
"data-message": `${message.from}->${message.to}`,
|
|
22
|
+
d: pathOf(message.points),
|
|
23
|
+
fill: "none",
|
|
24
|
+
stroke: "currentColor",
|
|
25
|
+
strokeWidth: 1.4,
|
|
26
|
+
strokeDasharray: message.line === "dashed" ? "5 4" : void 0,
|
|
27
|
+
strokeLinecap: "round",
|
|
28
|
+
strokeLinejoin: "round",
|
|
29
|
+
markerEnd: markerOf(message, props.scope)
|
|
30
|
+
}), message.label.lines.some(Boolean) ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("rect", {
|
|
31
|
+
x: round(message.label.x - 3),
|
|
32
|
+
y: round(message.label.y),
|
|
33
|
+
width: round(message.label.width + 6),
|
|
34
|
+
height: round(message.label.height),
|
|
35
|
+
rx: 3,
|
|
36
|
+
ry: 3,
|
|
37
|
+
fill: "var(--background)"
|
|
38
|
+
}), /* @__PURE__ */ jsx(DiagramLabel, {
|
|
39
|
+
lines: message.label.lines,
|
|
40
|
+
centerX: message.label.x + message.label.width / 2,
|
|
41
|
+
centerY: message.label.y + message.label.height / 2,
|
|
42
|
+
fontSize: props.fontSize,
|
|
43
|
+
fill: "var(--foreground)"
|
|
44
|
+
})] }) : null]
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* `->` and `-->` carry no head at all in mermaid, which is a real
|
|
49
|
+
* distinction rather than a missing feature: an undecorated line is how a
|
|
50
|
+
* plain call is written.
|
|
51
|
+
*/
|
|
52
|
+
const markerOf = (message, scope) => {
|
|
53
|
+
if (message.head === "none") return void 0;
|
|
54
|
+
return `url(#${scope}-seq-${message.head})`;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Two points for a normal message; four for the loop of a self-message,
|
|
58
|
+
* with the corners rounded so the turn reads as one gesture.
|
|
59
|
+
*/
|
|
60
|
+
const pathOf = (points) => {
|
|
61
|
+
const at = (index) => `${round(points[index].x)},${round(points[index].y)}`;
|
|
62
|
+
if (points.length === 2) return `M${at(0)} L${at(1)}`;
|
|
63
|
+
const radius = 5;
|
|
64
|
+
const [, out, back] = points;
|
|
65
|
+
return [
|
|
66
|
+
`M${at(0)}`,
|
|
67
|
+
`L${round(out.x - radius)},${round(out.y)}`,
|
|
68
|
+
`Q${round(out.x)},${round(out.y)} ${round(out.x)},${round(out.y + radius)}`,
|
|
69
|
+
`L${round(back.x)},${round(back.y - radius)}`,
|
|
70
|
+
`Q${round(back.x)},${round(back.y)} ${round(back.x - radius)},${round(back.y)}`,
|
|
71
|
+
`L${at(3)}`
|
|
72
|
+
].join(" ");
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
export { SequenceDiagramMessage };
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=SequenceDiagramMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceDiagramMessage.js","names":[],"sources":["../../../../src/components/markdown-view/diagram/SequenceDiagramMessage.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { DiagramLabel, round } from \"./DiagramLabel.tsx\";\nimport type { PositionedMessage } from \"./layoutSequence.ts\";\n\nexport interface SequenceDiagramMessageProps {\n message: PositionedMessage;\n /**\n * Instance-unique prefix for the arrowhead marker ids.\n */\n scope: string;\n fontSize: number;\n}\n\n/**\n * One message: its line, its head and its label.\n *\n * `currentColor` on the path is what makes the head match. A marker\n * inherits `context-stroke` from the element that references it, so one set\n * of three markers serves every message without a set per colour.\n *\n * The label sits on a `--background` chip. A message spanning several\n * lifelines draws its label over the ones in between, and without the chip\n * the dashes run straight through the text.\n */\nexport const SequenceDiagramMessage = (props: SequenceDiagramMessageProps) => {\n const message = props.message;\n\n return (\n <g style={{ color: \"var(--muted-foreground)\" }}>\n <path\n data-message={`${message.from}->${message.to}`}\n d={pathOf(message.points)}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.4}\n strokeDasharray={message.line === \"dashed\" ? \"5 4\" : undefined}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n markerEnd={markerOf(message, props.scope)}\n />\n {message.label.lines.some(Boolean) ? (\n <>\n <rect\n x={round(message.label.x - 3)}\n y={round(message.label.y)}\n width={round(message.label.width + 6)}\n height={round(message.label.height)}\n rx={3}\n ry={3}\n fill=\"var(--background)\"\n />\n <DiagramLabel\n lines={message.label.lines}\n centerX={message.label.x + message.label.width / 2}\n centerY={message.label.y + message.label.height / 2}\n fontSize={props.fontSize}\n fill=\"var(--foreground)\"\n />\n </>\n ) : null}\n </g>\n );\n};\n\n/**\n * `->` and `-->` carry no head at all in mermaid, which is a real\n * distinction rather than a missing feature: an undecorated line is how a\n * plain call is written.\n */\nconst markerOf = (\n message: PositionedMessage,\n scope: string,\n): string | undefined => {\n if (message.head === \"none\") return undefined;\n return `url(#${scope}-seq-${message.head})`;\n};\n\n/**\n * Two points for a normal message; four for the loop of a self-message,\n * with the corners rounded so the turn reads as one gesture.\n */\nconst pathOf = (points: Array<{ x: number; y: number }>): string => {\n const at = (index: number) =>\n `${round(points[index].x)},${round(points[index].y)}`;\n if (points.length === 2) return `M${at(0)} L${at(1)}`;\n\n const radius = 5;\n const [, out, back] = points;\n return [\n `M${at(0)}`,\n `L${round(out.x - radius)},${round(out.y)}`,\n `Q${round(out.x)},${round(out.y)} ${round(out.x)},${round(out.y + radius)}`,\n `L${round(back.x)},${round(back.y - radius)}`,\n `Q${round(back.x)},${round(back.y)} ${round(back.x - radius)},${round(back.y)}`,\n `L${at(3)}`,\n ].join(\" \");\n};\n"],"mappings":";;;;;;;;;;;;;;;AA2BA,MAAa,0BAA0B,UAAuC;CAC5E,MAAM,UAAU,MAAM;CAEtB,OACE,qBAAC,KAAD;EAAG,OAAO,EAAE,OAAO,0BAA0B;EAA7C,UAAA,CACE,oBAAC,QAAD;GACE,gBAAc,GAAG,QAAQ,KAAK,IAAI,QAAQ;GAC1C,GAAG,OAAO,QAAQ,MAAM;GACxB,MAAK;GACL,QAAO;GACP,aAAa;GACb,iBAAiB,QAAQ,SAAS,WAAW,QAAQ,KAAA;GACrD,eAAc;GACd,gBAAe;GACf,WAAW,SAAS,SAAS,MAAM,KAAK;EACzC,CAAA,GACA,QAAQ,MAAM,MAAM,KAAK,OAAO,IAC/B,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GACE,GAAG,MAAM,QAAQ,MAAM,IAAI,CAAC;GAC5B,GAAG,MAAM,QAAQ,MAAM,CAAC;GACxB,OAAO,MAAM,QAAQ,MAAM,QAAQ,CAAC;GACpC,QAAQ,MAAM,QAAQ,MAAM,MAAM;GAClC,IAAI;GACJ,IAAI;GACJ,MAAK;EACN,CAAA,GACD,oBAAC,cAAD;GACE,OAAO,QAAQ,MAAM;GACrB,SAAS,QAAQ,MAAM,IAAI,QAAQ,MAAM,QAAQ;GACjD,SAAS,QAAQ,MAAM,IAAI,QAAQ,MAAM,SAAS;GAClD,UAAU,MAAM;GAChB,MAAK;EACN,CAAA,CACD,EAAA,CAAA,IACA,IACH;;AAEP;;;;;;AAOA,MAAM,YACJ,SACA,UACuB;CACvB,IAAI,QAAQ,SAAS,QAAQ,OAAO,KAAA;CACpC,OAAO,QAAQ,MAAM,OAAO,QAAQ,KAAK;AAC3C;;;;;AAMA,MAAM,UAAU,WAAoD;CAClE,MAAM,MAAM,UACV,GAAG,MAAM,OAAO,MAAM,CAAC,CAAC,EAAE,GAAG,MAAM,OAAO,MAAM,CAAC,CAAC;CACpD,IAAI,OAAO,WAAW,GAAG,OAAO,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC;CAElD,MAAM,SAAS;CACf,MAAM,GAAG,KAAK,QAAQ;CACtB,OAAO;EACL,IAAI,GAAG,CAAC;EACR,IAAI,MAAM,IAAI,IAAI,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC;EACxC,IAAI,MAAM,IAAI,CAAC,EAAE,GAAG,MAAM,IAAI,CAAC,EAAE,GAAG,MAAM,IAAI,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,MAAM;EACxE,IAAI,MAAM,KAAK,CAAC,EAAE,GAAG,MAAM,KAAK,IAAI,MAAM;EAC1C,IAAI,MAAM,KAAK,CAAC,EAAE,GAAG,MAAM,KAAK,CAAC,EAAE,GAAG,MAAM,KAAK,IAAI,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC;EAC5E,IAAI,GAAG,CAAC;CACV,CAAC,CAAC,KAAK,GAAG;AACZ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PositionedNoteBox } from "./layoutSequence.ts";
|
|
3
|
+
export interface SequenceDiagramNoteProps {
|
|
4
|
+
note: PositionedNoteBox;
|
|
5
|
+
fontSize: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* An annotation box with its text wrapped inside it.
|
|
9
|
+
*
|
|
10
|
+
* Filled in `--muted` rather than mermaid's yellow: the theme picks the
|
|
11
|
+
* colours here, which is the whole reason this renderer is our own code.
|
|
12
|
+
* The fill has to be opaque - a note sits ON a lifeline and has to cover
|
|
13
|
+
* it, which is why notes are drawn last of all.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SequenceDiagramNote: (props: SequenceDiagramNoteProps) => React.JSX.Element;
|
|
16
|
+
//# sourceMappingURL=SequenceDiagramNote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceDiagramNote.d.ts","sourceRoot":"","sources":["../../../../src/components/markdown-view/diagram/SequenceDiagramNote.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,UAAW,wBAAwB,sBAyBlE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DiagramLabel, round } from "./DiagramLabel.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/markdown-view/diagram/SequenceDiagramNote.tsx
|
|
5
|
+
/**
|
|
6
|
+
* An annotation box with its text wrapped inside it.
|
|
7
|
+
*
|
|
8
|
+
* Filled in `--muted` rather than mermaid's yellow: the theme picks the
|
|
9
|
+
* colours here, which is the whole reason this renderer is our own code.
|
|
10
|
+
* The fill has to be opaque - a note sits ON a lifeline and has to cover
|
|
11
|
+
* it, which is why notes are drawn last of all.
|
|
12
|
+
*/
|
|
13
|
+
const SequenceDiagramNote = (props) => {
|
|
14
|
+
const note = props.note;
|
|
15
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
16
|
+
"data-note": note.placement,
|
|
17
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
18
|
+
x: round(note.x),
|
|
19
|
+
y: round(note.y),
|
|
20
|
+
width: round(note.width),
|
|
21
|
+
height: round(note.height),
|
|
22
|
+
rx: 4,
|
|
23
|
+
ry: 4,
|
|
24
|
+
fill: "var(--muted)",
|
|
25
|
+
stroke: "var(--border)",
|
|
26
|
+
strokeWidth: 1.25
|
|
27
|
+
}), /* @__PURE__ */ jsx(DiagramLabel, {
|
|
28
|
+
lines: note.lines,
|
|
29
|
+
centerX: note.x + note.width / 2,
|
|
30
|
+
centerY: note.y + note.height / 2,
|
|
31
|
+
fontSize: props.fontSize,
|
|
32
|
+
fill: "var(--muted-foreground)"
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { SequenceDiagramNote };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=SequenceDiagramNote.js.map
|