@zenuml/core 2.0.8 → 2.0.10
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/dist/zenuml/core.common.js +242 -191
- package/dist/zenuml/core.common.js.map +1 -1
- package/dist/zenuml/core.css +2 -4
- package/dist/zenuml/core.umd.js +242 -191
- package/dist/zenuml/core.umd.js.map +1 -1
- package/dist/zenuml/core.umd.min.js +4 -4
- package/dist/zenuml/core.umd.min.js.map +1 -1
- package/docs/asciidoc/create-my-own-theme.adoc +83 -0
- package/docs/asciidoc/images/three-layer-info-arch.png +0 -0
- package/package.json +2 -1
- package/tailwind.config.js +56 -1
|
@@ -4,6 +4,89 @@ Since the elements on the rendered diagram is based on HTML Dom (and svg), it is
|
|
|
4
4
|
to create your own theme. There is a repository on GitHub that have some themes collected
|
|
5
5
|
by third party. You may be able to get some inspiration from there. https://github.com/abruzzi/zenuml-css-overrides
|
|
6
6
|
|
|
7
|
+
== The Information Architecture
|
|
8
|
+
image::./images/three-layer-info-arch.png[width=600]
|
|
9
|
+
|
|
10
|
+
The diagram is rendered in two layers. The back layer is the lifeline layer. The front layer
|
|
11
|
+
is the message layer.
|
|
12
|
+
|
|
13
|
+
Key information on the diagram can be grouped in the following structure:
|
|
14
|
+
|
|
15
|
+
Text messages are internally styled at four levels:
|
|
16
|
+
|
|
17
|
+
1. text-skin-base: used for all messages
|
|
18
|
+
2. text-skin-muted: used for comments
|
|
19
|
+
3. text-skin-link: used for links
|
|
20
|
+
4. text-skin-secondary: used for everything else, such as title, participant, divider notes, etc.
|
|
21
|
+
|
|
22
|
+
When it comes to branding, the following elements are the most important:
|
|
23
|
+
|
|
24
|
+
1. Canvas background, however, it can easily be overwhelming if you use high contrast color to the
|
|
25
|
+
overall page background.
|
|
26
|
+
2. Title background, participant background and fragment header background are the most attractive
|
|
27
|
+
elements to brand. These are where your brand color should be used.
|
|
28
|
+
3. The background of the occurrence (message bar) is also a good place to use your brand color, but
|
|
29
|
+
less attractive than the above three.
|
|
30
|
+
4. The borders of the frame, participant, fragment, occurrence and lifeline can add a bit
|
|
31
|
+
of color to the diagram.
|
|
32
|
+
5. The color of the message and the arrow are the most important information on
|
|
33
|
+
the diagram. Choose a striking and comfortable color for them. You can use the brand color here, but
|
|
34
|
+
they should not be the only elements that reflect your brand color. Same principles apply to the
|
|
35
|
+
background and text color for hover state.
|
|
36
|
+
6. Then is the color of link and control. They should avoid attracting too much attention
|
|
37
|
+
|
|
38
|
+
[%autowidth]
|
|
39
|
+
|===
|
|
40
|
+
|Category | Diagram Frame |Lifeline Layer | Message Layer
|
|
41
|
+
|
|
42
|
+
h|Text Info
|
|
43
|
+
a|* Title
|
|
44
|
+
* Brand
|
|
45
|
+
a|* Participant name
|
|
46
|
+
* Stereotype
|
|
47
|
+
* Comment
|
|
48
|
+
|
|
49
|
+
a|* Message name
|
|
50
|
+
* Fragment type
|
|
51
|
+
* Fragment condition
|
|
52
|
+
* Comment
|
|
53
|
+
* Divider name
|
|
54
|
+
|
|
55
|
+
h|Shapes
|
|
56
|
+
a|* Security (icon)
|
|
57
|
+
* Tips (icon)
|
|
58
|
+
a|* Participant box (rectangle)
|
|
59
|
+
* Lifeline (vertical line)
|
|
60
|
+
a|* Message arrow (line and head)
|
|
61
|
+
* Fragment (rectangle)
|
|
62
|
+
* Divider line (left and right)
|
|
63
|
+
|
|
64
|
+
|===
|
|
65
|
+
|
|
66
|
+
Each of the elements has a semantic selector that can be used to customize the appearance.
|
|
67
|
+
|
|
68
|
+
The component has basic styling in itself mostly to support layout and positioning. Then
|
|
69
|
+
the core renderer comes with a default theme that defines the appearance of the elements.
|
|
70
|
+
|
|
71
|
+
[source,css]
|
|
72
|
+
----
|
|
73
|
+
|
|
74
|
+
----
|
|
75
|
+
|
|
76
|
+
A typical custom theme will be like below:
|
|
77
|
+
|
|
78
|
+
[source,css]
|
|
79
|
+
----
|
|
80
|
+
----
|
|
81
|
+
|
|
82
|
+
== What can a theme change?
|
|
83
|
+
|
|
84
|
+
A theme can change two aspects of the diagram:
|
|
85
|
+
|
|
86
|
+
1. colors
|
|
87
|
+
2. slightly change the layout (e.g. padding, margin, etc.). For example, you can make the
|
|
88
|
+
diagram more compact by reducing the padding.
|
|
89
|
+
|
|
7
90
|
== where can I apply themes
|
|
8
91
|
|
|
9
92
|
You can apply themes on the follow products:
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenuml/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/ZenUml/core.git"
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"start": "vue-cli-service serve",
|
|
22
22
|
"git:branch:clean:gone": "git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d",
|
|
23
23
|
"git:branch:clean:merged": "git branch --merged|egrep -v \"(\\*|master|main|dev|skip_branch_name)\" | xargs git branch -d",
|
|
24
|
+
"git:branch:safe-delete": "echo '> git log --graph --left-right --cherry --oneline another-branch...main'",
|
|
24
25
|
"git:forget": "git rm -r --cached . && git add . && git commit -m \"Forget all ignored files\"",
|
|
25
26
|
"test:specs": "echo \"Error: test:specs is not supported\""
|
|
26
27
|
},
|
package/tailwind.config.js
CHANGED
|
@@ -3,7 +3,62 @@ module.exports = {
|
|
|
3
3
|
content: ['./public/**/*.html', './src/**/*.vue'],
|
|
4
4
|
darkMode: false, // or 'media' or 'class'
|
|
5
5
|
theme: {
|
|
6
|
-
extend: {
|
|
6
|
+
extend: {
|
|
7
|
+
textColor: {
|
|
8
|
+
skin: {
|
|
9
|
+
title: 'var(--color-text-title, var(--color-text-message, var(--color-text-base, #000)))',
|
|
10
|
+
participant: 'var(--color-text-participant)',
|
|
11
|
+
message: 'var(--color-text-message, var(--color-text-base, #000))',
|
|
12
|
+
"message-arrow": 'var(--color-message-arrow, var(--color-border-frame, var(--color-border-base, #000)))', // message arrow head
|
|
13
|
+
"message-hover": 'var(--color-text-message-hover, var(--color-bg-base, #fff))',
|
|
14
|
+
comment: 'var(--color-text-comment, var(--color-text-secondary, var(--color-text-base, #000)))',
|
|
15
|
+
"fragment-header": 'var(--color-text-fragment-header, var(--color-text-message, #000))',
|
|
16
|
+
fragment: 'var(--color-text-fragment, var(--color-text-message, #000))',
|
|
17
|
+
base: 'var(--color-text-base)',
|
|
18
|
+
header: 'var(--color-text-header)',
|
|
19
|
+
secondary: 'var(--color-text-secondary)',
|
|
20
|
+
control: 'var(--color-text-control, var(--color-text-secondary, var(--color-text-base, #000)))',
|
|
21
|
+
muted: 'var(--color-text-muted)',
|
|
22
|
+
hover: 'var(--color-text-hover)',
|
|
23
|
+
link: `var(--color-text-link, var(--color-text-secondary, var(--color-text-base, #000)))`,
|
|
24
|
+
fill: `var(--color-text-fill)`,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
backgroundColor: {
|
|
28
|
+
skin: {
|
|
29
|
+
canvas: 'var(--color-bg-canvas, var(--color-bg-base, #fff))',
|
|
30
|
+
frame: 'var(--color-bg-frame, var(--color-bg-canvas, var(--color-bg-base, #fff)))',
|
|
31
|
+
title: 'var(--color-bg-title, var(--color-bg-frame, var(--color-bg-canvas, var(--color-bg-base, #fff))))',
|
|
32
|
+
participant: 'var(--color-bg-participant, var(--color-bg-frame, var(--color-bg-canvas, var(--color-bg-base, #fff))))',
|
|
33
|
+
lifeline: 'var(--color-border-participant, var(--color-border-participant, var(--color-border-frame, var(--color-border-base, #000))))',
|
|
34
|
+
divider: 'var(--color-border-participant)',
|
|
35
|
+
"message-hover": 'var(--color-bg-message-hover, var(--color-text-base, #000))',
|
|
36
|
+
"fragment-header": 'var(--color-bg-fragment-header, transparent)',
|
|
37
|
+
occurrence: 'var(--color-bg-occurrence, var(--color-bg-participant, var(--color-bg-frame, var(--color-bg-canvas, var(--color-bg-base, #fff)))))',
|
|
38
|
+
base: 'var(--color-bg-base)',
|
|
39
|
+
secondary: 'var(--color-bg-secondary)',
|
|
40
|
+
hover: 'var(--color-bg-hover)',
|
|
41
|
+
fill: 'var(--color-bg-fill)',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
borderColor: {
|
|
45
|
+
skin: {
|
|
46
|
+
frame: 'var(--color-border-frame, var(--color-border-base, #000))',
|
|
47
|
+
participant: 'var(--color-border-participant, var(--color-border-frame, var(--color-border-base, #000)))',
|
|
48
|
+
"message-arrow": 'var(--color-message-arrow, var(--color-border-frame, var(--color-border-base, #000)))', // message arrow line
|
|
49
|
+
fragment: 'var(--color-border-fragment, var(--color-border-frame, var(--color-border-base, #000)))',
|
|
50
|
+
occurrence: 'var(--color-border-occurrence, var(--color-border-frame, var(--color-border-base, #000)))',
|
|
51
|
+
base: 'var(--color-border-base)',
|
|
52
|
+
secondary: 'var(--color-border-secondary)',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
gradientColorStops: {
|
|
56
|
+
skin: {
|
|
57
|
+
base: 'var(--color-bg-base)',
|
|
58
|
+
secondary: 'var(--color-bg-secondary)',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
7
62
|
},
|
|
8
63
|
variants: {
|
|
9
64
|
extend: {
|