@asd20/ui 3.2.1031 → 3.2.1032

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
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.1031",
8
+ "version": "3.2.1032",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -28,9 +28,14 @@
28
28
  class="long-description"
29
29
  v-html="longDescription"
30
30
  />
31
- <div v-if="bodyContent" class="asd20-messaging__body-content">
31
+ <!-- <div v-if="bodyContent" class="asd20-messaging__body-content">
32
32
  <component :is="dynamicComponent"></component>
33
- </div>
33
+ </div> -->
34
+ <div
35
+ v-if="bodyContent"
36
+ class="asd20-messaging__body-content"
37
+ v-html="bodyContent"
38
+ />
34
39
 
35
40
  <div
36
41
  v-if="callsToAction && callsToAction.length > 0"
@@ -55,6 +60,7 @@ import Asd20Icon from '../Asd20Icon'
55
60
 
56
61
  export default {
57
62
  name: 'Asd20Messaging',
63
+ inheritAttrs: false,
58
64
  components: { Asd20Button, Asd20Icon },
59
65
  props: {
60
66
  images: { type: Array, default: () => [] },
@@ -81,11 +87,11 @@ export default {
81
87
  'asd20-messaging--padded': this.padded,
82
88
  }
83
89
  },
84
- dynamicComponent() {
85
- return {
86
- template: `<div>${this.bodyContent}</div>`,
87
- }
88
- },
90
+ // dynamicComponent() {
91
+ // return {
92
+ // template: `<div>${this.bodyContent}</div>`,
93
+ // }
94
+ // },
89
95
  messageImage() {
90
96
  // Get full image
91
97
  const messageImages = Array.isArray(this.images) ? this.images : []
@@ -22,20 +22,27 @@
22
22
  </component>
23
23
  </div>
24
24
 
25
- <p class="asd20-card__date" v-if="date && !emphasizedDate">
25
+ <div
26
+ class="asd20-card__date"
27
+ v-if="!emphasizedDate && (date || (modifiedDate && showModifiedDate))"
28
+ >
26
29
  <asd20-icon name="calendar" size="sm" />
27
- <span v-if="modifiedDate && showModifiedDate" class="date-meta">
28
- <span>Updated: </span>
29
- <span
30
+
31
+ <div class="asd20-card__date-lines">
32
+ <div class="asd20-card__date-line" v-if="date">
33
+ <span class="label">Published:&nbsp;</span>
34
+ <time>{{ date }}</time>
35
+ </div>
36
+
37
+ <div
38
+ class="asd20-card__date-line"
30
39
  v-if="modifiedDate && showModifiedDate"
31
- v-html="modifiedDate"
32
- ></span>
33
- </span>
34
- <span v-else class="date-meta">
35
- <span>Published: </span>
36
- <span v-if="date && !emphasizedDate" v-html="date"></span>
37
- </span>
38
- </p>
40
+ >
41
+ <span class="label">Updated:&nbsp;</span>
42
+ <time>{{ modifiedDate }}</time>
43
+ </div>
44
+ </div>
45
+ </div>
39
46
  <p v-if="time" class="asd20-card__time">
40
47
  <asd20-icon name="hours-alt" size="sm" />
41
48
  <span v-html="time"></span>
@@ -156,8 +163,8 @@ export default {
156
163
  const strippedDescription = this.description
157
164
  //remove anchor tags but leave anchor text description
158
165
  .replace(/<a[^>]*>(.*?)<\/a>/g, '$1')
159
- // remove other html tags
160
- // .replace(/<[^>]+>/g, '')
166
+ // remove other html tags
167
+ // .replace(/<[^>]+>/g, '')
161
168
  return truncate(strippedDescription, { length: 150, separator: /,? +/ })
162
169
  },
163
170
  classes() {
@@ -341,9 +348,10 @@ export default {
341
348
  font-size: 0.85rem !important;
342
349
  font-weight: bold;
343
350
  font-family: var(--website-typography__font-family-headlines);
351
+ line-height: 1.2;
344
352
  display: flex;
345
353
  align-items: flex-start;
346
- margin-top: space(0.25);
354
+ margin-top: space(0.5);
347
355
  margin-bottom: space(0.25);
348
356
  align-items: center;
349
357
  .asd20-icon {
@@ -351,17 +359,11 @@ export default {
351
359
  margin-left: -0.125em;
352
360
  margin-right: space(0.25);
353
361
  }
354
- .date-meta {
355
- font-size: 0.85rem !important;
356
- }
357
362
  }
358
363
  &__time + &__location {
359
364
  margin-top: space(0);
360
365
  margin-bottom: space(0.25);
361
366
  }
362
- // &__date {
363
- // margin-right: space(0.5);
364
- // }
365
367
 
366
368
  &--emphasized-date {
367
369
  .asd20-card__header {
@@ -425,6 +427,9 @@ export default {
425
427
  display: flex;
426
428
  flex-wrap: wrap;
427
429
  margin-left: space(-0.25);
430
+ .asd20-tag {
431
+ padding: 0 space(0.25);
432
+ }
428
433
  }
429
434
 
430
435
  &__indicators {
@@ -526,18 +531,7 @@ export default {
526
531
 
527
532
  .asd20-card__header {
528
533
  position: relative;
529
- // left: 0;
530
- // right: 0;
531
- // bottom: 100%;
532
- // padding: space(1) space(1);
533
- // margin-bottom: space(0.5);
534
534
  color: var(--website-card__foreground-color);
535
-
536
- // background: linear-gradient(
537
- // 0deg,
538
- // rgba(0, 0, 0, 0.5) 70%,
539
- // rgba(0, 0, 0, 0) 100%
540
- // );
541
535
  }
542
536
 
543
537
  .asd20-card__date-time,
@@ -555,9 +549,6 @@ export default {
555
549
  .asd20-card__title {
556
550
  color: var(--website-card__reverse-foreground-color);
557
551
  }
558
- .asd20-card__link {
559
- // color: var(--website-card__reverse-foreground-color) !important;
560
- }
561
552
  }
562
553
 
563
554
  &--with-image:not(.asd20-card--seperate-image) {
@@ -574,17 +565,10 @@ export default {
574
565
  &--reversed,
575
566
  &--with-image:not(.asd20-card--seperate-image) {
576
567
  color: var(--website-card__reverse-foreground-color);
577
- // .asd20-card__date-time,
578
- // .asd20-card__location {
579
- // .asd20-icon {
580
- // --line-color: var(--website-icon__fill-color-reverse);
581
- // }
582
- // }
583
568
  }
584
569
  &--reversed {
585
570
  background: var(--website-card__reverse-background-color)
586
571
  var(--website-card__reverse-background-style);
587
- // box-shadow: none;
588
572
  &:hover {
589
573
  box-shadow: 0 0 0 0 transparent, var(--website-card__hover-shadow);
590
574
  background: var(--website-card__hover-reverse-background-color);
@@ -592,17 +576,9 @@ export default {
592
576
  ::v-deep .asd20-icon {
593
577
  --line-color: var(--website-card__reverse-foreground-color);
594
578
  }
595
- // .asd20-card__date-time,
596
- // .asd20-card__location {
597
- // &::v-deep .asd20-icon g{
598
- // --line-color: var(--website-icon__fill-color-reverse);
599
- // // --line-color: red;
600
- // }
601
- // }
602
579
  }
603
580
 
604
581
  &--expanded-header {
605
- // background: var(--website-card__hover-background-color);
606
582
  .asd20-card__header {
607
583
  flex-grow: 1;
608
584
  display: flex;
@@ -359,10 +359,9 @@ export default {
359
359
  background: rgba(255, 255, 255, 0.85);
360
360
  align-self: stretch;
361
361
  margin-right: -2rem;
362
- // z-index: -1;
363
362
  z-index: 8;
364
363
  padding-right: 2rem;
365
- // padding-left: 0.5rem;
364
+ padding-left: 0.5rem;
366
365
  border-radius: 3rem;
367
366
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.0625);
368
367
  }
@@ -6,8 +6,8 @@
6
6
  (formattedPrimaryMessages.length > 0 &&
7
7
  primaryMessages[0].bodyContent &&
8
8
  primaryMessages[0].bodyContent !== '<p></p>') ||
9
- formattedPrimaryMessages.length > 1 ||
10
- forceDisplay
9
+ formattedPrimaryMessages.length > 1 ||
10
+ forceDisplay
11
11
  "
12
12
  >
13
13
  <slot name="before"></slot>
@@ -45,15 +45,37 @@
45
45
  <script>
46
46
  import Asd20Messaging from '../../atoms/Asd20Messaging'
47
47
 
48
+ // function formatMessage(
49
+ // message,
50
+ // omitBodyContent,
51
+ // omitDetailLink,
52
+ // omitCallsToAction
53
+ // ) {
54
+ // return {
55
+ // ...message,
56
+ // bodyContent: omitBodyContent ? '' : message.bodyContent,
57
+ // detailLink: omitDetailLink ? '' : message.detailLink,
58
+ // callsToAction: omitCallsToAction ? [] : message.callsToAction,
59
+ // }
60
+ // }
61
+
48
62
  function formatMessage(
49
63
  message,
50
64
  omitBodyContent,
51
65
  omitDetailLink,
52
66
  omitCallsToAction
53
67
  ) {
68
+ // Prefer existing bodyContent, else fall back to bodyHtml
69
+ const body = omitBodyContent
70
+ ? ''
71
+ : message.bodyContent || message.bodyHtml || ''
72
+
73
+ // Strip bodyHtml so it doesn't "fall through" as a root attribute
74
+ const { bodyHtml, ...rest } = message
75
+
54
76
  return {
55
- ...message,
56
- bodyContent: omitBodyContent ? '' : message.bodyContent,
77
+ ...rest,
78
+ bodyContent: body,
57
79
  detailLink: omitDetailLink ? '' : message.detailLink,
58
80
  callsToAction: omitCallsToAction ? [] : message.callsToAction,
59
81
  }
@@ -77,6 +77,7 @@ export default {
77
77
  text-align: center;
78
78
  flex: 1 1;
79
79
  align-self: start;
80
+ margin: space(0.5) 0;
80
81
  &::v-deep .asd20-button__label {
81
82
  margin-left: space(0);
82
83
  }
@@ -87,8 +88,6 @@ export default {
87
88
  @media (min-width: 1024px) {
88
89
  .asd20-quicklinks-menu {
89
90
  padding: space(0) space(1);
90
- .asd20-button {
91
- }
92
91
  }
93
92
  }
94
93
  </style>
@@ -214,7 +214,7 @@ export default {
214
214
  .asd20-swiper-feed {
215
215
  .feed-buttons {
216
216
  flex-direction: row;
217
- margin-left: space(1);
217
+ margin-left: 0;
218
218
  }
219
219
  .secondary-button {
220
220
  margin: 0 0 0 space(0.5);
@@ -240,7 +240,7 @@ export default {
240
240
  font-size: 1rem !important;
241
241
  }
242
242
  .feed-buttons {
243
- margin-left: space(3);
243
+ margin-left: space(2);
244
244
  }
245
245
  }
246
246
  }
@@ -262,7 +262,7 @@ export default {
262
262
  border-radius: var(--website-shape__radius-m) 0 0 var(--website-shape__radius-m);
263
263
  /* Make sure it sits behind the messaging card */
264
264
  z-index: -1;
265
- animation: slide_left2 2.5s ease-in-out 0s both;
265
+ animation: slide_left2 2s ease-in-out 0s both;
266
266
  }
267
267
  }
268
268
  &::v-deep .asd20-messaging__button-group {
@@ -897,7 +897,7 @@
897
897
  "id": "f4656914-9ec6-1811-aa5d-31f532f483d5",
898
898
  "title": "Discovery Canyon Campus High School",
899
899
  "educationLevels": ["High"],
900
- "logoImageUrl": "https://asd20websitestorage.blob.core.windows.net/asd20-images/school-logos/dcc_logo.jpg",
900
+ "logoImageUrl": "https://asd20websitestorage.blob.core.windows.net/asd20-images/school-logos/DCC.png",
901
901
  "website": "https://dcchigh.asd20.org"
902
902
  }, {
903
903
  "id": "b6341b18-f4b9-311d-614c-a0ee36eb3254",
@@ -124,7 +124,7 @@
124
124
  "isCover": false,
125
125
  "files": [{
126
126
  "name": "full",
127
- "url": "https://asd20websitestorage.blob.core.windows.net/website-files/message-images//full/dcc_boys_swimming_1200x800.jpg"
127
+ "url": "https://asd20websitestorage.blob.core.windows.net/website-files/message-images/supports-for-academic-success/full/AEES_student_selects_book_1280x582_2023-06-12T18_54_25.jpg"
128
128
  },
129
129
  {
130
130
  "name": "thumbnail-md",
@@ -161,7 +161,7 @@
161
161
  {
162
162
  "name": "full",
163
163
  "filename": "PES Accredidation Hero_1280x711_2023-08-29T21_16_58.jpg",
164
- "url": "https://asd20websitestorage.blob.core.windows.net/website-files/message-images/accredited-with-distinction/full/PES Accredidation Hero_1280x711_2023-08-29T21_16_58.jpg"
164
+ "url": "https://asd20websitestorage.blob.core.windows.net/website-files/message-images/supports-for-academic-success/full/AEES_student_selects_book_1280x582_2023-06-12T18_54_25.jpg"
165
165
  }
166
166
  ],
167
167
  "metadata": {
@@ -980,7 +980,7 @@
980
980
  "id": "26eaf390-d8ab-11e9-a3a8-5de5bba4f125",
981
981
  "title": "Academy District 20",
982
982
  "educationLevels": [],
983
- "logoImageUrl": "https://asd20websitestorage.blob.core.windows.net/asd20-images/school-logos/asd20logo.png",
983
+ "logoImageUrl": "https://asd20websitestorage.blob.core.windows.net/asd20-images/school-logos/ASD20.png",
984
984
  "website": "https://www.asd20.org"
985
985
  }, {
986
986
  "id": "10a1d179-6149-064e-7034-36c1a1e7f790",
@@ -853,7 +853,7 @@
853
853
  "id": "f4656914-9ec6-1811-aa5d-31f532f483d5",
854
854
  "title": "Discovery Canyon Campus High School",
855
855
  "educationLevels": ["High"],
856
- "logoImageUrl": "https://asd20websitestorage.blob.core.windows.net/asd20-images/school-logos/dcc_logo.jpg",
856
+ "logoImageUrl": "https://asd20websitestorage.blob.core.windows.net/asd20-images/school-logos/DCC.png",
857
857
  "website": "https://dcchigh.asd20.org"
858
858
  }, {
859
859
  "id": "b6341b18-f4b9-311d-614c-a0ee36eb3254",
@@ -1576,7 +1576,7 @@
1576
1576
  "id": "f4656914-9ec6-1811-aa5d-31f532f483d5",
1577
1577
  "title": "Discovery Canyon Campus High School",
1578
1578
  "educationLevels": ["High"],
1579
- "logoImageUrl": "https://asd20websitestorage.blob.core.windows.net/asd20-images/school-logos/dcc_logo.jpg",
1579
+ "logoImageUrl": "https://asd20websitestorage.blob.core.windows.net/asd20-images/school-logos/DCC.png",
1580
1580
  "website": "https://dcchigh.asd20.org"
1581
1581
  }, {
1582
1582
  "id": "b6341b18-f4b9-311d-614c-a0ee36eb3254",
@@ -1,5 +1,17 @@
1
1
  import { format, parseISO } from 'date-fns'
2
2
 
3
+ function formatApDate(iso) {
4
+ try {
5
+ const d = parseISO(iso)
6
+ if (isNaN(d)) return ''
7
+ const m = format(d, 'MMM') // locale-dependent; assumes en-US -> 'May'
8
+ const mOut = m === 'May' ? m : `${m}.`
9
+ return `${mOut} ${format(d, 'd, yyyy')}`
10
+ } catch {
11
+ return ''
12
+ }
13
+ }
14
+
3
15
  export default function mapMessageToCard(
4
16
  message,
5
17
  options = {},
@@ -53,28 +65,42 @@ export default function mapMessageToCard(
53
65
  let modifiedDate = ''
54
66
  let time = ''
55
67
 
68
+ // if (message.publishDateTime) {
69
+ // try {
70
+ // const parsed = parseISO(message.publishDateTime)
71
+ // if (!isNaN(parsed)) {
72
+ // date = format(parsed, 'MMM. d, yyyy')
73
+ // time = format(parsed, 'h:mm aa')
74
+ // }
75
+ // } catch (e) {
76
+ // date = ''
77
+ // time = ''
78
+ // }
79
+ // }
80
+
56
81
  if (message.publishDateTime) {
82
+ date = formatApDate(message.publishDateTime)
57
83
  try {
58
84
  const parsed = parseISO(message.publishDateTime)
59
- if (!isNaN(parsed)) {
60
- date = format(parsed, 'MMM. d, yyyy')
61
- time = format(parsed, 'h:mm aa')
62
- }
63
- } catch (e) {
64
- date = ''
65
- time = ''
85
+ if (!isNaN(parsed)) time = format(parsed, 'h:mm aa')
86
+ } catch {
87
+ /* ignore */
66
88
  }
67
89
  }
68
90
 
91
+ // if (message.modifiedDateTime) {
92
+ // try {
93
+ // const parsed = parseISO(message.modifiedDateTime)
94
+ // if (!isNaN(parsed)) {
95
+ // modifiedDate = format(parsed, 'MMM. d, yyyy')
96
+ // }
97
+ // } catch (e) {
98
+ // modifiedDate = ''
99
+ // }
100
+ // }
101
+
69
102
  if (message.modifiedDateTime) {
70
- try {
71
- const parsed = parseISO(message.modifiedDateTime)
72
- if (!isNaN(parsed)) {
73
- modifiedDate = format(parsed, 'MMM. d, yyyy')
74
- }
75
- } catch (e) {
76
- modifiedDate = ''
77
- }
103
+ modifiedDate = formatApDate(message.modifiedDateTime)
78
104
  }
79
105
 
80
106
  return Object.assign(