@momo-kits/foundation 0.169.7 → 0.169.8
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/Application/modalLayout.ts +3 -0
- package/Popup/PopupNotify.tsx +1 -1
- package/Popup/utils.ts +7 -4
- package/package.json +1 -1
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -150,7 +150,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
150
150
|
return text;
|
|
151
151
|
}
|
|
152
152
|
return segments.map((segment, index) => {
|
|
153
|
-
if (segment.
|
|
153
|
+
if (segment.isHighlighted) {
|
|
154
154
|
return (
|
|
155
155
|
<Text key={index} typography={'header_s_semibold'}>
|
|
156
156
|
{segment.text}
|
package/Popup/utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type HighlightSegment = { text: string;
|
|
1
|
+
type HighlightSegment = { text: string; isHighlighted: boolean };
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* True for cased-script letters, digits and `_`; caseless scripts (CJK, Thai)
|
|
@@ -46,12 +46,15 @@ const splitHighlightText = (
|
|
|
46
46
|
continue;
|
|
47
47
|
}
|
|
48
48
|
if (start > lastIndex) {
|
|
49
|
-
segments.push({
|
|
49
|
+
segments.push({
|
|
50
|
+
text: text.slice(lastIndex, start),
|
|
51
|
+
isHighlighted: false,
|
|
52
|
+
});
|
|
50
53
|
}
|
|
51
|
-
segments.push({ text: match[0],
|
|
54
|
+
segments.push({ text: match[0], isHighlighted: true });
|
|
52
55
|
lastIndex = end;
|
|
53
56
|
}
|
|
54
|
-
segments.push({ text: text.slice(lastIndex),
|
|
57
|
+
segments.push({ text: text.slice(lastIndex), isHighlighted: false });
|
|
55
58
|
return segments;
|
|
56
59
|
};
|
|
57
60
|
|