Skip to content

Commit

Permalink
feat: [sequence] add participantBorderColor param (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
hikerpig authored Jun 12, 2024
1 parent d9da848 commit 3082c5c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/short-tomatoes-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pintora/diagrams': patch
---

feat: [sequence] add `participantBorderColor` param
2 changes: 1 addition & 1 deletion packages/pintora-diagrams/src/sequence/artist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ function drawParticipantBoxes(context: SequenceArtistContext) {
width,
height: modelBounds.stopy - modelBounds.starty,
fill: participantBox.background || conf.participantBackground,
stroke: conf.actorTextColor,
stroke: conf.participantBorderColor,
})
boxesGroup.children.push(rect)
if (participantBox.text) {
Expand Down
5 changes: 5 additions & 0 deletions packages/pintora-diagrams/src/sequence/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ export type SequenceConf = {
actorTextColor: string
actorLineColor: string

// for participant boxes
participantBoxPadding: number
participantBackground: string
participantBorderColor: string

noteTextColor: string

Expand Down Expand Up @@ -86,6 +88,7 @@ export const defaultConfig: SequenceConf = {

participantBoxPadding: 10,
participantBackground: 'transparent',
participantBorderColor: PALETTE.normalDark,

noteTextColor: PALETTE.normalDark,

Expand Down Expand Up @@ -120,6 +123,7 @@ export const SEQUENCE_PARAM_DIRECTIVE_RULES = {
actorBorderColor: { valueType: 'color' },
actorTextColor: { valueType: 'color' },
actorLineColor: { valueType: 'color' },
participantBorderColor: { valueType: 'color' },
noteTextColor: { valueType: 'color' },
activationBackground: { valueType: 'color' },
dividerTextColor: { valueType: 'color' },
Expand Down Expand Up @@ -151,6 +155,7 @@ const configurator = makeConfigurator<SequenceConf>({
noteTextColor: t.noteTextColor || t.textColor,
activationBackground: t.background1,
dividerTextColor: t.secondaryTextColor,
participantBorderColor: t.textColor,
}
},
})
Expand Down
2 changes: 2 additions & 0 deletions website/docs/configuration/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ export type SequenceConf = {
actorTextColor: string
actorLineColor: string

// for participant boxes
participantBoxPadding: number
participantBackground: string
participantBorderColor: string

noteTextColor: string

Expand Down

0 comments on commit 3082c5c

Please sign in to comment.