Skip to content

Commit 77c4fe6

Browse files
authored
Merge pull request #43 from NeoUtils/release/v2.1.3
Release v2.1.3 - Web target hotfixes
2 parents ac333f1 + 0092cc4 commit 77c4fe6

File tree

5 files changed

+275
-124
lines changed

5 files changed

+275
-124
lines changed

build-logic/src/main/kotlin/extension/Project.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ val config = Config(
2727
version = Config.Version(
2828
major = 2,
2929
minor = 1,
30-
patch = 2,
30+
patch = 3,
3131
phase = Config.Phase.RELEASE
3232
),
3333
android = Config.Android(

core/shared-ui/src/androidMain/kotlin/com/neo/regex/core/sharedui/component/TextEditor.android.kt

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -229,87 +229,3 @@ actual fun TextEditor(
229229
}
230230
}
231231
}
232-
233-
@Composable
234-
private fun MatchDetails(
235-
match: Match,
236-
modifier: Modifier = Modifier,
237-
textStyle: TextStyle = typography.bodyLarge
238-
) = Surface(
239-
modifier = modifier,
240-
shape = RectangleShape,
241-
shadowElevation = dimensions.small
242-
) {
243-
Row(
244-
horizontalArrangement = Arrangement.SpaceAround,
245-
) {
246-
247-
Column(
248-
modifier = Modifier
249-
.padding(dimensions.default)
250-
.weight(weight = 1f)
251-
) {
252-
Text(
253-
text = "match ${match.number}",
254-
style = textStyle.copy(
255-
fontWeight = FontWeight.Bold
256-
)
257-
)
258-
259-
HorizontalDivider(
260-
modifier = Modifier.padding(
261-
vertical = dimensions.small,
262-
)
263-
)
264-
265-
Text(
266-
text = buildAnnotatedString {
267-
withStyle(SpanStyle(fontWeight = FontWeight.Bold)) {
268-
append("range: ")
269-
}
270-
withStyle(SpanStyle(fontWeight = FontWeight.Normal)) {
271-
append(match.range.toString())
272-
}
273-
},
274-
style = textStyle
275-
)
276-
}
277-
278-
if (match.groups.isNotEmpty()) {
279-
Column(
280-
modifier = Modifier
281-
.padding(dimensions.default)
282-
.weight(weight = 1f)
283-
) {
284-
Text(
285-
text = "groups",
286-
style = textStyle.copy(
287-
fontWeight = FontWeight.Bold
288-
)
289-
)
290-
291-
HorizontalDivider(
292-
modifier = Modifier.padding(
293-
vertical = dimensions.small,
294-
)
295-
)
296-
297-
match.groups.forEachIndexed { index, group ->
298-
Text(
299-
text = buildAnnotatedString {
300-
withStyle(SpanStyle(fontWeight = FontWeight.Bold)) {
301-
append("$index: ")
302-
}
303-
withStyle(SpanStyle(fontWeight = FontWeight.Normal)) {
304-
append(group)
305-
}
306-
},
307-
style = textStyle,
308-
overflow = TextOverflow.Ellipsis,
309-
maxLines = 1
310-
)
311-
}
312-
}
313-
}
314-
}
315-
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/*
2+
* NeoRegex.
3+
*
4+
* Copyright (C) 2024 Irineu A. Silva.
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
package com.neo.regex.core.sharedui.component
20+
21+
import androidx.compose.foundation.layout.Arrangement
22+
import androidx.compose.foundation.layout.Column
23+
import androidx.compose.foundation.layout.Row
24+
import androidx.compose.foundation.layout.padding
25+
import androidx.compose.material3.HorizontalDivider
26+
import androidx.compose.material3.MaterialTheme.typography
27+
import androidx.compose.material3.Surface
28+
import androidx.compose.material3.Text
29+
import androidx.compose.runtime.Composable
30+
import androidx.compose.ui.Modifier
31+
import androidx.compose.ui.graphics.RectangleShape
32+
import androidx.compose.ui.text.SpanStyle
33+
import androidx.compose.ui.text.TextStyle
34+
import androidx.compose.ui.text.buildAnnotatedString
35+
import androidx.compose.ui.text.font.FontWeight
36+
import androidx.compose.ui.text.style.TextOverflow
37+
import androidx.compose.ui.text.withStyle
38+
import com.neo.regex.core.designsystem.theme.NeoTheme.dimensions
39+
import com.neo.regex.core.sharedui.model.Match
40+
41+
@Composable
42+
fun MatchDetails(
43+
match: Match,
44+
modifier: Modifier = Modifier,
45+
textStyle: TextStyle = TextStyle()
46+
) = Surface(
47+
modifier = modifier,
48+
shape = RectangleShape,
49+
shadowElevation = dimensions.small
50+
) {
51+
52+
val mergedTextStyle = typography.bodyLarge.merge(textStyle)
53+
54+
Row(
55+
horizontalArrangement = Arrangement.SpaceAround,
56+
) {
57+
58+
Column(
59+
modifier = Modifier
60+
.padding(dimensions.default)
61+
.weight(weight = 1f)
62+
) {
63+
Text(
64+
text = "match ${match.number}",
65+
style = mergedTextStyle.copy(
66+
fontWeight = FontWeight.Bold
67+
)
68+
)
69+
70+
HorizontalDivider(
71+
modifier = Modifier.padding(
72+
vertical = dimensions.small,
73+
)
74+
)
75+
76+
Text(
77+
text = buildAnnotatedString {
78+
withStyle(SpanStyle(fontWeight = FontWeight.Bold)) {
79+
append("range: ")
80+
}
81+
withStyle(SpanStyle(fontWeight = FontWeight.Normal)) {
82+
append(match.range.toString())
83+
}
84+
},
85+
style = mergedTextStyle
86+
)
87+
}
88+
89+
if (match.groups.isNotEmpty()) {
90+
Column(
91+
modifier = Modifier
92+
.padding(dimensions.default)
93+
.weight(weight = 1f)
94+
) {
95+
Text(
96+
text = "groups",
97+
style = mergedTextStyle.copy(
98+
fontWeight = FontWeight.Bold
99+
)
100+
)
101+
102+
HorizontalDivider(
103+
modifier = Modifier.padding(
104+
vertical = dimensions.small,
105+
)
106+
)
107+
108+
match.groups.forEachIndexed { index, group ->
109+
Text(
110+
text = buildAnnotatedString {
111+
withStyle(SpanStyle(fontWeight = FontWeight.Bold)) {
112+
append("$index: ")
113+
}
114+
withStyle(SpanStyle(fontWeight = FontWeight.Normal)) {
115+
append(group)
116+
}
117+
},
118+
style = mergedTextStyle,
119+
overflow = TextOverflow.Ellipsis,
120+
maxLines = 1
121+
)
122+
}
123+
}
124+
}
125+
}
126+
}

0 commit comments

Comments
 (0)