Skip to content

Commit 2882a46

Browse files
authored
Merge pull request #172 from ssshooter/v2.0.2
V2.0.2
2 parents 59571d5 + d246970 commit 2882a46

File tree

8 files changed

+138
-127
lines changed

8 files changed

+138
-127
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mind-elixir",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Mind elixir is a free open source mind map core.",
55
"main": "dist/MindElixir.js",
66
"scripts": {

src/index.less

Lines changed: 117 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
--root-bgcolor: #4c4f69;
99
--main-color: #444446;
1010
--main-bgcolor: #ffffff;
11+
--topic-padding: 3px;
1112
--color: #777777;
1213
--bgcolor: #f6f6f6;
1314
// ---
@@ -31,6 +32,15 @@
3132
width: 0px;
3233
height: 0px;
3334
}
35+
.selected {
36+
box-shadow: 0 0 0 2px #4dc4ff;
37+
}
38+
.lhs {
39+
direction: rtl;
40+
me-tpc {
41+
direction: ltr;
42+
}
43+
}
3444
.map-canvas {
3545
height: 20000px;
3646
width: 20000px;
@@ -39,9 +49,6 @@
3949
transition: all 0.3s;
4050
transform: scale(1);
4151
background-color: var(--bgcolor);
42-
.selected {
43-
outline: 2px solid #4dc4ff;
44-
}
4552
me-root {
4653
position: absolute;
4754
padding: 10px var(--gap);
@@ -59,118 +66,119 @@
5966
}
6067
}
6168
.box {
69+
// main node
6270
& > me-wrapper {
63-
// for main node
6471
position: absolute;
6572
& > me-parent {
6673
margin: var(--gap);
6774
background-color: var(--main-bgcolor);
6875
border: 1px solid var(--main-color);
69-
padding: 8px var(--gap);
7076
border-radius: var(--main-radius);
77+
padding: 0;
7178
& > me-tpc {
79+
border-radius: var(--main-radius);
7280
color: var(--main-color);
81+
padding: 8px var(--gap);
82+
#input-box {
83+
padding: 8px var(--gap);
84+
}
7385
}
7486
}
7587
}
76-
.lhs {
77-
direction: rtl;
78-
me-tpc {
79-
direction: ltr;
80-
}
81-
}
82-
me-wrapper {
83-
display: block;
84-
pointer-events: none;
85-
}
86-
me-children,
87-
me-parent {
88-
display: inline-block;
89-
vertical-align: middle;
90-
}
91-
me-parent {
88+
}
89+
me-wrapper {
90+
display: block;
91+
pointer-events: none;
92+
}
93+
me-children,
94+
me-parent {
95+
display: inline-block;
96+
vertical-align: middle;
97+
}
98+
me-parent {
99+
position: relative;
100+
cursor: pointer;
101+
padding: 6px var(--gap);
102+
margin-top: 10px;
103+
me-tpc {
92104
position: relative;
93-
cursor: pointer;
94-
padding: 6px var(--gap);
95-
margin-top: 10px;
96-
me-tpc {
97-
position: relative;
98-
display: block;
99-
border-radius: 3px;
100-
color: var(--color);
101-
pointer-events: all;
102-
max-width: 800px;
103-
white-space: pre-wrap;
104-
line-height: 1.2; // assure the line-height consistency between different languages
105-
.tags {
106-
direction: ltr;
107-
span {
108-
display: inline-block;
109-
border-radius: 3px;
110-
padding: 2px 4px;
111-
background: #d6f0f8;
112-
color: #276f86;
113-
margin: 0px;
114-
font-size: 12px;
115-
height: 16px;
116-
line-height: 16px;
117-
margin-right: 3px;
118-
margin-top: 2px;
119-
}
120-
}
121-
.icons {
105+
display: block;
106+
border-radius: 3px;
107+
color: var(--color);
108+
pointer-events: all;
109+
max-width: 800px;
110+
white-space: pre-wrap;
111+
padding: var(--topic-padding);
112+
line-height: 1.2; // assure the line-height consistency between different languages
113+
.tags {
114+
direction: ltr;
115+
span {
122116
display: inline-block;
123-
direction: ltr;
124-
margin-right: 10px;
125-
}
126-
// drag preview
127-
.insert-preview {
128-
position: absolute;
129-
width: 100%;
130-
left: 0px;
131-
z-index: 9;
132-
}
133-
.show {
134-
background: #7ad5ff;
135-
pointer-events: none; // 不加会识别为不可移动
136-
opacity: 0.7;
137-
}
138-
.before {
139-
height: 14px;
140-
top: -14px;
141-
}
142-
.in {
143-
height: 100%;
144-
top: 0px;
145-
}
146-
.after {
147-
height: 14px;
148-
bottom: -14px;
117+
border-radius: 3px;
118+
padding: 2px 4px;
119+
background: #d6f0f8;
120+
color: #276f86;
121+
margin: 0px;
122+
font-size: 12px;
123+
height: 16px;
124+
line-height: 16px;
125+
margin-right: 3px;
126+
margin-top: 2px;
149127
}
150128
}
151-
me-epd {
129+
.icons {
130+
display: inline-block;
131+
direction: ltr;
132+
margin-right: 10px;
133+
}
134+
// drag preview
135+
.insert-preview {
152136
position: absolute;
153-
height: 18px;
154-
width: 18px;
155-
opacity: 0.8;
156-
background-image: url('./icons/add-circle.svg');
157-
background-repeat: no-repeat;
158-
background-size: contain;
159-
background-position: center;
160-
161-
pointer-events: all;
137+
width: 100%;
138+
left: 0px;
162139
z-index: 9;
163-
&.minus {
164-
background-image: url('./icons/minus-circle.svg') !important;
165-
transition: all 0.3s;
166-
opacity: 0;
167-
&:hover {
168-
opacity: 0.8;
169-
}
140+
}
141+
.show {
142+
background: #7ad5ff;
143+
pointer-events: none; // 不加会识别为不可移动
144+
opacity: 0.7;
145+
}
146+
.before {
147+
height: 14px;
148+
top: -14px;
149+
}
150+
.in {
151+
height: 100%;
152+
top: 0px;
153+
}
154+
.after {
155+
height: 14px;
156+
bottom: -14px;
157+
}
158+
}
159+
me-epd {
160+
position: absolute;
161+
height: 18px;
162+
width: 18px;
163+
opacity: 0.8;
164+
background-image: url('./icons/add-circle.svg');
165+
background-repeat: no-repeat;
166+
background-size: contain;
167+
background-position: center;
168+
169+
pointer-events: all;
170+
z-index: 9;
171+
&.minus {
172+
background-image: url('./icons/minus-circle.svg') !important;
173+
transition: all 0.3s;
174+
opacity: 0;
175+
&:hover {
176+
opacity: 0.8;
170177
}
171178
}
172179
}
173180
}
181+
174182
// iconfont
175183
.icon {
176184
width: 1em;
@@ -217,6 +225,7 @@
217225
position: absolute;
218226
top: 0;
219227
left: 0;
228+
padding: var(--topic-padding);
220229
background-color: #fff;
221230
color: #666666;
222231
width: max-content; // let words expand the div and keep max length at the same time
@@ -225,20 +234,21 @@
225234
direction: ltr;
226235
user-select: auto;
227236
}
228-
}
229237

230-
me-tpc > img {
231-
pointer-events: none;
232-
display: block;
233-
}
238+
me-tpc > img {
239+
pointer-events: none;
240+
display: block;
241+
margin-top: 8px;
242+
}
234243

235-
.circle {
236-
position: absolute;
237-
height: 10px;
238-
width: 10px;
239-
margin-top: -5px;
240-
margin-left: -5px;
241-
border-radius: 100%;
242-
background: #aaa;
243-
cursor: pointer;
244+
.circle {
245+
position: absolute;
246+
height: 10px;
247+
width: 10px;
248+
margin-top: -5px;
249+
margin-left: -5px;
250+
border-radius: 100%;
251+
background: #aaa;
252+
cursor: pointer;
253+
}
244254
}

src/index.lite.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ function MindElixir(
9090
this.mindElixirBox.appendChild(this.container)
9191
this.root = $d.createElement('me-root')
9292

93-
this.box = $d.createElement('me-children')
94-
this.box.className = 'box'
93+
this.mainNodes = $d.createElement('me-children')
94+
this.mainNodes.className = 'box'
9595

9696
// infrastructure
9797

@@ -109,7 +109,7 @@ function MindElixir(
109109
this.linkSvgGroup = createLinkSvg('topiclinks') // storage user custom link svg
110110

111111
this.map.appendChild(this.root)
112-
this.map.appendChild(this.box)
112+
this.map.appendChild(this.mainNodes)
113113
this.map.appendChild(this.lines)
114114
this.map.appendChild(this.linkController)
115115
this.map.appendChild(this.linkSvgGroup)
@@ -192,7 +192,7 @@ MindElixir.SIDE = SIDE
192192
* @memberof MindElixir
193193
* @static
194194
*/
195-
MindElixir.version = '0.19.4'
195+
MindElixir.version = '2.0.2'
196196
MindElixir.E = findEle
197197

198198
export default MindElixir

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ function MindElixir(
194194
this.mindElixirBox.appendChild(this.container)
195195
this.root = $d.createElement('me-root')
196196

197-
this.box = $d.createElement('me-children')
198-
this.box.className = 'box'
197+
this.mainNodes = $d.createElement('me-children')
198+
this.mainNodes.className = 'box'
199199

200200
// infrastructure
201201

@@ -213,7 +213,7 @@ function MindElixir(
213213
this.linkSvgGroup = createLinkSvg('topiclinks') // storage user custom link svg
214214

215215
this.map.appendChild(this.root)
216-
this.map.appendChild(this.box)
216+
this.map.appendChild(this.mainNodes)
217217
this.map.appendChild(this.lines)
218218
this.map.appendChild(this.linkController)
219219
this.map.appendChild(this.linkSvgGroup)
@@ -337,7 +337,7 @@ MindElixir.SIDE = SIDE
337337
* @memberof MindElixir
338338
* @static
339339
*/
340-
MindElixir.version = '2.0.0'
340+
MindElixir.version = '2.0.2'
341341
MindElixir.E = findEle
342342

343343
/**

0 commit comments

Comments
 (0)