@asd20/ui 3.7.0 → 3.8.0

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asd20/ui",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -9,7 +9,9 @@
9
9
  <div class="asd20-site-search__viewport">
10
10
  <div class="asd20-site-search__options">
11
11
  <!-- Ask a Question -->
12
- <div class="asd20-site-search__field asd20-site-search__field--question">
12
+ <div
13
+ class="asd20-site-search__field asd20-site-search__field--question"
14
+ >
13
15
  <!-- <label class="asd20-site-search__label">Ask a question</label> -->
14
16
  <div class="asd20-site-search__question-row">
15
17
  <asd20-search-field
@@ -17,7 +19,7 @@
17
19
  ref="question"
18
20
  v-model="questionText"
19
21
  @keyup.enter.stop.prevent="onAskQuestion"
20
- placeholder="Ask a question"
22
+ placeholder="Ask a question (preview)"
21
23
  />
22
24
  <asd20-button
23
25
  class="asd20-site-search__ask-button"
@@ -34,7 +36,7 @@
34
36
  />
35
37
  </div>
36
38
  </div>
37
- <hr/>
39
+ <hr />
38
40
 
39
41
  <!-- Search by Keyword -->
40
42
  <div class="asd20-site-search__field asd20-site-search__field--keyword">
@@ -71,6 +73,13 @@
71
73
  title="Ask a Question, or Search by Keyword"
72
74
  description="Use the top input for plain-language questions, then press 'Ask'; or search by keyword in the lower input box."
73
75
  />
76
+ <div class="disclaimer">
77
+ <p>
78
+ AI generated answers can have errors. Please contact our
79
+ <a href="www.asd20.org/help-desk">Help Desk</a> if you need
80
+ additional information.
81
+ </p>
82
+ </div>
74
83
 
75
84
  <!-- Answers tab -->
76
85
  <div v-show="currentTab === 'Answers'" scrollable>
@@ -78,11 +87,15 @@
78
87
  <h3>Answer</h3>
79
88
  <div class="asd20-site-search__ai-answer" v-html="aiAnswer" />
80
89
 
81
- <div v-if="aiUiSources.length" class="asd20-site-search__ai-sources">
90
+ <div
91
+ v-if="aiUiSources.length"
92
+ class="asd20-site-search__ai-sources"
93
+ >
82
94
  <h4>Sources</h4>
83
95
  <ul>
84
96
  <li v-for="src in aiUiSources" :key="src.url || src.id">
85
- <strong>Content from: {{ src.hostLabel }}</strong><br />
97
+ <strong>Content from: {{ src.hostLabel }}</strong
98
+ ><br />
86
99
  <a :href="src.url" target="_blank" rel="noreferrer">
87
100
  {{ src.title }}
88
101
  </a>
@@ -97,7 +110,6 @@
97
110
 
98
111
  <!-- Pages tab -->
99
112
  <div v-show="currentTab === 'Pages'" scrollable>
100
-
101
113
  <!-- No results -->
102
114
  <asd20-notification
103
115
  v-if="keywords && _pages.length === 0 && !searchingPages"
@@ -134,7 +146,9 @@
134
146
 
135
147
  <div class="asd20-site-search__suggested" v-if="_groups.length > 0">
136
148
  <h3>
137
- {{ _groups.length > 1 ? 'Suggested Contacts:' : 'Suggested Contact:' }}
149
+ {{
150
+ _groups.length > 1 ? 'Suggested Contacts:' : 'Suggested Contact:'
151
+ }}
138
152
  </h3>
139
153
  <asd20-list-item
140
154
  v-for="g in _groups"
@@ -242,7 +256,10 @@ export default {
242
256
 
243
257
  props: {
244
258
  active: { type: Boolean, default: false },
245
- organization: { type: Object, default: () => ({ title: 'Academy District 20' }) },
259
+ organization: {
260
+ type: Object,
261
+ default: () => ({ title: 'Academy District 20' }),
262
+ },
246
263
  organizationOptions: { type: Array, default: () => [] },
247
264
  },
248
265
 
@@ -496,15 +513,7 @@ export default {
496
513
  // If no DOM (e.g., SSR), return raw; client will re-run and sanitize.
497
514
  if (typeof window === 'undefined' || !window.document) return rawHtml
498
515
 
499
- const allowedTags = new Set([
500
- 'P',
501
- 'UL',
502
- 'OL',
503
- 'LI',
504
- 'STRONG',
505
- 'EM',
506
- 'A',
507
- ])
516
+ const allowedTags = new Set(['P', 'UL', 'OL', 'LI', 'STRONG', 'EM', 'A'])
508
517
  const allowedAttrs = {
509
518
  A: ['href'],
510
519
  }
@@ -512,9 +521,9 @@ export default {
512
521
  const container = window.document.createElement('div')
513
522
  container.innerHTML = rawHtml
514
523
 
515
- const cleanNode = (node) => {
524
+ const cleanNode = node => {
516
525
  const children = Array.from(node.childNodes)
517
- children.forEach((child) => {
526
+ children.forEach(child => {
518
527
  if (child.nodeType === 1) {
519
528
  const tag = child.tagName.toUpperCase()
520
529
  if (!allowedTags.has(tag)) {
@@ -526,7 +535,7 @@ export default {
526
535
  }
527
536
 
528
537
  const allowed = allowedAttrs[tag] || []
529
- Array.from(child.attributes).forEach((attr) => {
538
+ Array.from(child.attributes).forEach(attr => {
530
539
  const name = attr.name.toLowerCase()
531
540
  if (!allowed.includes(attr.name)) {
532
541
  child.removeAttribute(attr.name)
@@ -628,6 +637,17 @@ export default {
628
637
 
629
638
  &__results {
630
639
  flex-grow: 1;
640
+ .disclaimer {
641
+ padding: space(0.5);
642
+ font-size: 0.85rem;
643
+ background: var(--website-page__alternate-background-t25);
644
+ border-bottom: 1px solid var(--color__tertiary);
645
+
646
+ a {
647
+ color: var(--color__primary);
648
+ text-decoration: underline;
649
+ }
650
+ }
631
651
  }
632
652
 
633
653
  &__ai-result {
@@ -94,7 +94,7 @@
94
94
  ul,
95
95
  ol {
96
96
  padding: 0;
97
- list-style-position: outside;
97
+ list-style-position: inside;
98
98
  margin: space(0.25) 0 space(1) 0;
99
99
  display: flex;
100
100
  flex-wrap: wrap;