@asd20/ui-next 2.34.3 → 2.34.4
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.34.4](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.34.3...ui-next-v2.34.4) (2026-11-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* edits to related page links in search results ([01e82a9](https://github.com/academydistrict20/asd20-ui-next/commit/01e82a98caef6c5ca809714a67c59e944682fd16))
|
|
9
|
+
|
|
3
10
|
## [2.34.3](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.34.2...ui-next-v2.34.3) (2026-11-02)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
aria-label="Matching links on this page"
|
|
6
6
|
@click.stop
|
|
7
7
|
>
|
|
8
|
-
<p class="asd20-matching-search-links__heading">
|
|
9
|
-
{{ links.length === 1 ? 'Matching link' : 'Matching links' }}
|
|
10
|
-
</p>
|
|
11
8
|
<ul>
|
|
12
9
|
<li
|
|
13
10
|
v-for="link in visibleLinks"
|
|
@@ -19,11 +16,7 @@
|
|
|
19
16
|
:rel="link.newWindow ? 'noopener noreferrer' : undefined"
|
|
20
17
|
@click="$emit('navigate', $event)"
|
|
21
18
|
>
|
|
22
|
-
|
|
23
|
-
:is="part.matched ? 'mark' : 'span'"
|
|
24
|
-
v-for="(part, index) in highlight(link.title)"
|
|
25
|
-
:key="index"
|
|
26
|
-
>{{ part.text }}</component>
|
|
19
|
+
{{ link.title }}
|
|
27
20
|
<span
|
|
28
21
|
v-if="link.external"
|
|
29
22
|
class="asd20-matching-search-links__external"
|
|
@@ -34,16 +27,7 @@
|
|
|
34
27
|
v-if="link.description"
|
|
35
28
|
class="asd20-matching-search-links__description"
|
|
36
29
|
>
|
|
37
|
-
|
|
38
|
-
:is="part.matched ? 'mark' : 'span'"
|
|
39
|
-
v-for="(part, index) in highlight(link.description)"
|
|
40
|
-
:key="index"
|
|
41
|
-
>
|
|
42
|
-
{{ part.text }}
|
|
43
|
-
</component>
|
|
44
|
-
</p>
|
|
45
|
-
<p class="asd20-matching-search-links__destination">
|
|
46
|
-
{{ link.destination }}
|
|
30
|
+
{{ link.description }}
|
|
47
31
|
</p>
|
|
48
32
|
</li>
|
|
49
33
|
</ul>
|
|
@@ -68,31 +52,6 @@ import {
|
|
|
68
52
|
shouldShowExternalIcon,
|
|
69
53
|
} from '../../../helpers/linkPolicy'
|
|
70
54
|
|
|
71
|
-
const STOP_WORDS = new Set([
|
|
72
|
-
'a',
|
|
73
|
-
'an',
|
|
74
|
-
'and',
|
|
75
|
-
'are',
|
|
76
|
-
'as',
|
|
77
|
-
'at',
|
|
78
|
-
'be',
|
|
79
|
-
'by',
|
|
80
|
-
'can',
|
|
81
|
-
'do',
|
|
82
|
-
'for',
|
|
83
|
-
'how',
|
|
84
|
-
'i',
|
|
85
|
-
'in',
|
|
86
|
-
'is',
|
|
87
|
-
'it',
|
|
88
|
-
'of',
|
|
89
|
-
'on',
|
|
90
|
-
'or',
|
|
91
|
-
'the',
|
|
92
|
-
'to',
|
|
93
|
-
'with',
|
|
94
|
-
])
|
|
95
|
-
|
|
96
55
|
export default {
|
|
97
56
|
name: 'Asd20MatchingSearchLinks',
|
|
98
57
|
props: {
|
|
@@ -119,9 +78,6 @@ export default {
|
|
|
119
78
|
const url = new URL(link.url)
|
|
120
79
|
if (url.username || url.password || seen.has(url.href)) return []
|
|
121
80
|
seen.add(url.href)
|
|
122
|
-
const form = ['forms.cloud.microsoft', 'forms.office.com'].includes(
|
|
123
|
-
url.hostname
|
|
124
|
-
)
|
|
125
81
|
const pageHost = this.pageUrl
|
|
126
82
|
? new URL(this.pageUrl, 'https://www.asd20.org').hostname
|
|
127
83
|
: ''
|
|
@@ -131,9 +87,6 @@ export default {
|
|
|
131
87
|
url: url.href,
|
|
132
88
|
description:
|
|
133
89
|
typeof link.description === 'string' ? link.description : '',
|
|
134
|
-
destination: form
|
|
135
|
-
? 'Form · Microsoft Forms'
|
|
136
|
-
: url.hostname.replace(/^www\./, ''),
|
|
137
90
|
external: shouldShowExternalIcon(url.href, pageHost),
|
|
138
91
|
newWindow: shouldOpenInNewWindow(url.href),
|
|
139
92
|
},
|
|
@@ -156,25 +109,6 @@ export default {
|
|
|
156
109
|
this.expanded = false
|
|
157
110
|
},
|
|
158
111
|
},
|
|
159
|
-
methods: {
|
|
160
|
-
highlight(text) {
|
|
161
|
-
const tokens = [
|
|
162
|
-
...new Set(
|
|
163
|
-
this.keywords
|
|
164
|
-
.toLowerCase()
|
|
165
|
-
.split(/[^a-z0-9]+/)
|
|
166
|
-
.filter(token => token && !STOP_WORDS.has(token))
|
|
167
|
-
),
|
|
168
|
-
].slice(0, 8)
|
|
169
|
-
if (!tokens.length) return [{ text, matched: false }]
|
|
170
|
-
const pattern = tokens
|
|
171
|
-
.map(token => `\\b${token}${token.length >= 4 ? '[a-z0-9]*' : ''}\\b`)
|
|
172
|
-
.join('|')
|
|
173
|
-
return text
|
|
174
|
-
.split(new RegExp(`(${pattern})`, 'gi'))
|
|
175
|
-
.map((part, index) => ({ text: part, matched: index % 2 === 1 }))
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
112
|
}
|
|
179
113
|
</script>
|
|
180
114
|
|
|
@@ -185,11 +119,6 @@ export default {
|
|
|
185
119
|
min-width: 0;
|
|
186
120
|
overflow-wrap: anywhere;
|
|
187
121
|
}
|
|
188
|
-
.asd20-matching-search-links__heading {
|
|
189
|
-
margin: 0 0 0.5rem;
|
|
190
|
-
font-size: 0.875rem;
|
|
191
|
-
font-weight: 600;
|
|
192
|
-
}
|
|
193
122
|
ul {
|
|
194
123
|
list-style: none;
|
|
195
124
|
padding: 0;
|
|
@@ -205,7 +134,7 @@ li + li {
|
|
|
205
134
|
a {
|
|
206
135
|
color: var(--color__primary);
|
|
207
136
|
font-weight: 600;
|
|
208
|
-
text-
|
|
137
|
+
text-decoration: none;
|
|
209
138
|
}
|
|
210
139
|
a:focus-visible,
|
|
211
140
|
button:focus-visible {
|
|
@@ -216,18 +145,9 @@ button:focus-visible {
|
|
|
216
145
|
margin: 0.25rem 0;
|
|
217
146
|
font-size: 0.9375rem;
|
|
218
147
|
}
|
|
219
|
-
.asd20-matching-search-links__destination {
|
|
220
|
-
margin: 0.25rem 0 0;
|
|
221
|
-
font-size: 0.8125rem;
|
|
222
|
-
}
|
|
223
148
|
.asd20-matching-search-links__external {
|
|
224
149
|
margin-inline-start: 0.25rem;
|
|
225
150
|
}
|
|
226
|
-
mark {
|
|
227
|
-
background: transparent;
|
|
228
|
-
color: inherit;
|
|
229
|
-
font-weight: 700;
|
|
230
|
-
}
|
|
231
151
|
button {
|
|
232
152
|
margin-top: 0.75rem;
|
|
233
153
|
padding: 0.25rem 0;
|