@raystack/chronicle 0.1.0-canary.30bf0df → 0.1.0-canary.323385a
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/package.json
CHANGED
|
@@ -102,3 +102,10 @@
|
|
|
102
102
|
.item[data-selected="true"] .icon {
|
|
103
103
|
color: var(--rs-color-foreground-accent-primary-hover);
|
|
104
104
|
}
|
|
105
|
+
|
|
106
|
+
.pageText :global(mark),
|
|
107
|
+
.headingText :global(mark) {
|
|
108
|
+
background: transparent;
|
|
109
|
+
color: var(--rs-color-foreground-accent-primary);
|
|
110
|
+
font-weight: 600;
|
|
111
|
+
}
|
|
@@ -111,7 +111,7 @@ export function Search({ className }: SearchProps) {
|
|
|
111
111
|
<div className={styles.itemContent}>
|
|
112
112
|
{getResultIcon(result)}
|
|
113
113
|
<Text className={styles.pageText}>
|
|
114
|
-
{stripMethod(result.content)}
|
|
114
|
+
<HighlightedText html={stripMethod(result.content)} />
|
|
115
115
|
</Text>
|
|
116
116
|
</div>
|
|
117
117
|
</Command.Item>
|
|
@@ -132,7 +132,7 @@ export function Search({ className }: SearchProps) {
|
|
|
132
132
|
{result.type === "heading" ? (
|
|
133
133
|
<>
|
|
134
134
|
<Text className={styles.headingText}>
|
|
135
|
-
{stripMethod(result.content)}
|
|
135
|
+
<HighlightedText html={stripMethod(result.content)} />
|
|
136
136
|
</Text>
|
|
137
137
|
<Text className={styles.separator}>-</Text>
|
|
138
138
|
<Text className={styles.pageText}>
|
|
@@ -141,7 +141,7 @@ export function Search({ className }: SearchProps) {
|
|
|
141
141
|
</>
|
|
142
142
|
) : (
|
|
143
143
|
<Text className={styles.pageText}>
|
|
144
|
-
{stripMethod(result.content)}
|
|
144
|
+
<HighlightedText html={stripMethod(result.content)} />
|
|
145
145
|
</Text>
|
|
146
146
|
)}
|
|
147
147
|
</div>
|
|
@@ -178,6 +178,10 @@ function stripMethod(content: string): string {
|
|
|
178
178
|
return API_METHODS.has(first) ? content.slice(first.length + 1) : content;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
function HighlightedText({ html, className }: { html: string; className?: string }) {
|
|
182
|
+
return <span className={className} dangerouslySetInnerHTML={{ __html: html }} />;
|
|
183
|
+
}
|
|
184
|
+
|
|
181
185
|
function getResultIcon(result: SortedResult): React.ReactNode {
|
|
182
186
|
if (!result.url.startsWith("/apis/")) {
|
|
183
187
|
return result.type === "page" ? (
|