@asd20/ui-next 2.26.1 → 2.27.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ # [2.27.0](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.26.1...ui-next-v2.27.0) (2026-09-30)
4
+
5
+
6
+ ### Features
7
+
8
+ * support inline public form introduction links ([bea4683](https://github.com/academydistrict20/asd20-ui-next/commit/bea4683f849623abe527ad9b70f6d85db145aa25))
9
+
3
10
  ## [2.26.1](https://github.com/academydistrict20/asd20-ui-next/compare/ui-next-v2.26.0...ui-next-v2.26.1) (2026-09-30)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asd20/ui-next",
3
- "version": "2.26.1",
3
+ "version": "2.27.0",
4
4
  "private": false,
5
5
  "description": "ASD20 UI component library for Vue 3.",
6
6
  "license": "MIT",
@@ -53,9 +53,14 @@
53
53
  v-if="formDefinition.introduction"
54
54
  class="asd20-public-form-modal__introduction"
55
55
  >
56
- {{ formDefinition.introduction }}
56
+ <template v-if="inlineIntroductionParts">
57
+ {{ inlineIntroductionParts.before }}<a :href="formDefinition.introductionLink.href">{{ formDefinition.introductionLink.label }}</a>{{ inlineIntroductionParts.after }}
58
+ </template>
59
+ <template v-else>
60
+ {{ formDefinition.introduction }}
61
+ </template>
57
62
  </p>
58
- <p v-if="formDefinition.introductionLink">
63
+ <p v-if="formDefinition.introductionLink && !formDefinition.introductionLink.inline">
59
64
  <a :href="formDefinition.introductionLink.href">
60
65
  {{ formDefinition.introductionLink.label }}
61
66
  </a>
@@ -253,6 +258,16 @@ export default {
253
258
  modalTitle() {
254
259
  return this.formDefinition?.title || 'Public Form'
255
260
  },
261
+ inlineIntroductionParts() {
262
+ const introduction = this.formDefinition?.introduction || ''
263
+ const link = this.formDefinition?.introductionLink
264
+ if (!link?.inline) return null
265
+ const index = introduction.indexOf(link.label)
266
+ return {
267
+ before: introduction.slice(0, index),
268
+ after: introduction.slice(index + link.label.length),
269
+ }
270
+ },
256
271
  usesRecordsFormSpacing() {
257
272
  return [
258
273
  'student-records-request',
@@ -171,6 +171,12 @@ export function normalizePublicFormDefinition(definition) {
171
171
  const id = boundedText(definition.id, 'Form ID', 100, true)
172
172
  if (!FORM_ID_PATTERN.test(id)) throw new Error('The public form ID is invalid.')
173
173
 
174
+ const introduction = boundedText(
175
+ definition.introduction,
176
+ 'Form introduction',
177
+ 2000
178
+ )
179
+
174
180
  let introductionLink
175
181
  if (definition.introductionLink != null) {
176
182
  const label = boundedText(
@@ -187,18 +193,25 @@ export function normalizePublicFormDefinition(definition) {
187
193
  )
188
194
  if (!/^\/[a-z0-9/-]+\/?$/.test(href) || href.startsWith('//'))
189
195
  throw new Error('The introduction link must be a local page path.')
190
- introductionLink = { label, href }
196
+ const inline = optionalBoolean(
197
+ definition.introductionLink.inline,
198
+ 'Inline introduction link'
199
+ )
200
+ if (
201
+ inline &&
202
+ (!introduction.includes(label) ||
203
+ introduction.indexOf(label) !== introduction.lastIndexOf(label))
204
+ ) {
205
+ throw new Error('The inline introduction link label must appear once in the introduction.')
206
+ }
207
+ introductionLink = inline ? { label, href, inline: true } : { label, href }
191
208
  }
192
209
 
193
210
  return {
194
211
  id,
195
212
  version,
196
213
  title: boundedText(definition.title, 'Form title', 200, true),
197
- introduction: boundedText(
198
- definition.introduction,
199
- 'Form introduction',
200
- 2000
201
- ),
214
+ introduction,
202
215
  introductionLink,
203
216
  submitLabel: boundedText(definition.submitLabel, 'Submit label', 100, true),
204
217
  successMessage: boundedText(