@defra/forms-model 3.0.480 → 3.0.482

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.
Files changed (176) hide show
  1. package/dist/module/form/form-editor/__stubs__/preview.js +83 -4
  2. package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -1
  3. package/dist/module/form/form-editor/index.js +2 -2
  4. package/dist/module/form/form-editor/index.js.map +1 -1
  5. package/dist/module/form/form-editor/macros/types.js +2 -0
  6. package/dist/module/form/form-editor/macros/types.js.map +1 -0
  7. package/dist/module/form/form-editor/preview/autocomplete.js +20 -4
  8. package/dist/module/form/form-editor/preview/autocomplete.js.map +1 -1
  9. package/dist/module/form/form-editor/preview/checkbox-sortable.js +7 -2
  10. package/dist/module/form/form-editor/preview/checkbox-sortable.js.map +1 -1
  11. package/dist/module/form/form-editor/preview/checkbox.js +17 -0
  12. package/dist/module/form/form-editor/preview/checkbox.js.map +1 -0
  13. package/dist/module/form/form-editor/preview/component-elements.js +61 -0
  14. package/dist/module/form/form-editor/preview/component-elements.js.map +1 -0
  15. package/dist/module/form/form-editor/preview/constants.js +2 -0
  16. package/dist/module/form/form-editor/preview/constants.js.map +1 -0
  17. package/dist/module/form/form-editor/preview/content.js +94 -0
  18. package/dist/module/form/form-editor/preview/content.js.map +1 -0
  19. package/dist/module/form/form-editor/preview/controller/page-controller.js +260 -0
  20. package/dist/module/form/form-editor/preview/controller/page-controller.js.map +1 -0
  21. package/dist/module/form/form-editor/preview/date-input.js +7 -2
  22. package/dist/module/form/form-editor/preview/date-input.js.map +1 -1
  23. package/dist/module/form/form-editor/preview/email-address.js +7 -1
  24. package/dist/module/form/form-editor/preview/email-address.js.map +1 -1
  25. package/dist/module/form/form-editor/preview/fieldset-question.js +5 -0
  26. package/dist/module/form/form-editor/preview/fieldset-question.js.map +1 -1
  27. package/dist/module/form/form-editor/preview/helpers.js +81 -0
  28. package/dist/module/form/form-editor/preview/helpers.js.map +1 -0
  29. package/dist/module/form/form-editor/preview/index.js +6 -0
  30. package/dist/module/form/form-editor/preview/index.js.map +1 -1
  31. package/dist/module/form/form-editor/preview/list.js +59 -3
  32. package/dist/module/form/form-editor/preview/list.js.map +1 -1
  33. package/dist/module/form/form-editor/preview/long-answer.js +7 -1
  34. package/dist/module/form/form-editor/preview/long-answer.js.map +1 -1
  35. package/dist/module/form/form-editor/preview/markdown.js +53 -0
  36. package/dist/module/form/form-editor/preview/markdown.js.map +1 -0
  37. package/dist/module/form/form-editor/preview/month-year.js +7 -2
  38. package/dist/module/form/form-editor/preview/month-year.js.map +1 -1
  39. package/dist/module/form/form-editor/preview/number-only.js +5 -0
  40. package/dist/module/form/form-editor/preview/number-only.js.map +1 -1
  41. package/dist/module/form/form-editor/preview/phone-number.js +7 -1
  42. package/dist/module/form/form-editor/preview/phone-number.js.map +1 -1
  43. package/dist/module/form/form-editor/preview/preview.js +212 -0
  44. package/dist/module/form/form-editor/preview/preview.js.map +1 -0
  45. package/dist/module/form/form-editor/preview/question.js +48 -138
  46. package/dist/module/form/form-editor/preview/question.js.map +1 -1
  47. package/dist/module/form/form-editor/preview/radio-sortable.js +7 -2
  48. package/dist/module/form/form-editor/preview/radio-sortable.js.map +1 -1
  49. package/dist/module/form/form-editor/preview/radio.js +7 -2
  50. package/dist/module/form/form-editor/preview/radio.js.map +1 -1
  51. package/dist/module/form/form-editor/preview/select-sortable.js +38 -0
  52. package/dist/module/form/form-editor/preview/select-sortable.js.map +1 -0
  53. package/dist/module/form/form-editor/preview/select.js +11 -0
  54. package/dist/module/form/form-editor/preview/select.js.map +1 -0
  55. package/dist/module/form/form-editor/preview/short-answer.js +7 -1
  56. package/dist/module/form/form-editor/preview/short-answer.js.map +1 -1
  57. package/dist/module/form/form-editor/preview/supporting-evidence.js +7 -1
  58. package/dist/module/form/form-editor/preview/supporting-evidence.js.map +1 -1
  59. package/dist/module/form/form-editor/preview/types.js.map +1 -1
  60. package/dist/module/form/form-editor/preview/uk-address.js +7 -2
  61. package/dist/module/form/form-editor/preview/uk-address.js.map +1 -1
  62. package/dist/module/form/form-editor/preview/yes-no.js +7 -2
  63. package/dist/module/form/form-editor/preview/yes-no.js.map +1 -1
  64. package/dist/module/form/form-editor/types.js.map +1 -1
  65. package/dist/module/form/form-metadata/index.js +1 -5
  66. package/dist/module/form/form-metadata/index.js.map +1 -1
  67. package/dist/module/form/utils/index.js +1 -0
  68. package/dist/module/form/utils/index.js.map +1 -1
  69. package/dist/module/form/utils/list.js +15 -0
  70. package/dist/module/form/utils/list.js.map +1 -0
  71. package/dist/module/index.js.map +1 -1
  72. package/dist/module/stubs.js +1 -0
  73. package/dist/module/stubs.js.map +1 -1
  74. package/dist/types/form/form-editor/__stubs__/preview.d.ts +58 -11
  75. package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -1
  76. package/dist/types/form/form-editor/index.d.ts.map +1 -1
  77. package/dist/types/form/form-editor/macros/types.d.ts +62 -0
  78. package/dist/types/form/form-editor/macros/types.d.ts.map +1 -0
  79. package/dist/types/form/form-editor/preview/autocomplete.d.ts +3 -1
  80. package/dist/types/form/form-editor/preview/autocomplete.d.ts.map +1 -1
  81. package/dist/types/form/form-editor/preview/checkbox-sortable.d.ts.map +1 -1
  82. package/dist/types/form/form-editor/preview/checkbox.d.ts +4 -0
  83. package/dist/types/form/form-editor/preview/checkbox.d.ts.map +1 -0
  84. package/dist/types/form/form-editor/preview/component-elements.d.ts +35 -0
  85. package/dist/types/form/form-editor/preview/component-elements.d.ts.map +1 -0
  86. package/dist/types/form/form-editor/preview/constants.d.ts +2 -0
  87. package/dist/types/form/form-editor/preview/constants.d.ts.map +1 -0
  88. package/dist/types/form/form-editor/preview/content.d.ts +43 -0
  89. package/dist/types/form/form-editor/preview/content.d.ts.map +1 -0
  90. package/dist/types/form/form-editor/preview/controller/page-controller.d.ts +132 -0
  91. package/dist/types/form/form-editor/preview/controller/page-controller.d.ts.map +1 -0
  92. package/dist/types/form/form-editor/preview/date-input.d.ts.map +1 -1
  93. package/dist/types/form/form-editor/preview/email-address.d.ts.map +1 -1
  94. package/dist/types/form/form-editor/preview/fieldset-question.d.ts +2 -0
  95. package/dist/types/form/form-editor/preview/fieldset-question.d.ts.map +1 -1
  96. package/dist/types/form/form-editor/preview/helpers.d.ts +11 -0
  97. package/dist/types/form/form-editor/preview/helpers.d.ts.map +1 -0
  98. package/dist/types/form/form-editor/preview/index.d.ts +6 -0
  99. package/dist/types/form/form-editor/preview/list-sortable.d.ts +1 -1
  100. package/dist/types/form/form-editor/preview/list.d.ts +25 -0
  101. package/dist/types/form/form-editor/preview/list.d.ts.map +1 -1
  102. package/dist/types/form/form-editor/preview/long-answer.d.ts.map +1 -1
  103. package/dist/types/form/form-editor/preview/markdown.d.ts +9 -0
  104. package/dist/types/form/form-editor/preview/markdown.d.ts.map +1 -0
  105. package/dist/types/form/form-editor/preview/month-year.d.ts.map +1 -1
  106. package/dist/types/form/form-editor/preview/number-only.d.ts.map +1 -1
  107. package/dist/types/form/form-editor/preview/phone-number.d.ts.map +1 -1
  108. package/dist/types/form/form-editor/preview/preview.d.ts +126 -0
  109. package/dist/types/form/form-editor/preview/preview.d.ts.map +1 -0
  110. package/dist/types/form/form-editor/preview/question.d.ts +19 -93
  111. package/dist/types/form/form-editor/preview/question.d.ts.map +1 -1
  112. package/dist/types/form/form-editor/preview/radio-sortable.d.ts.map +1 -1
  113. package/dist/types/form/form-editor/preview/radio.d.ts.map +1 -1
  114. package/dist/types/form/form-editor/preview/select-sortable.d.ts +18 -0
  115. package/dist/types/form/form-editor/preview/select-sortable.d.ts.map +1 -0
  116. package/dist/types/form/form-editor/preview/select.d.ts +4 -0
  117. package/dist/types/form/form-editor/preview/select.d.ts.map +1 -0
  118. package/dist/types/form/form-editor/preview/short-answer.d.ts.map +1 -1
  119. package/dist/types/form/form-editor/preview/supporting-evidence.d.ts.map +1 -1
  120. package/dist/types/form/form-editor/preview/types.d.ts +13 -17
  121. package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
  122. package/dist/types/form/form-editor/preview/uk-address.d.ts.map +1 -1
  123. package/dist/types/form/form-editor/preview/yes-no.d.ts.map +1 -1
  124. package/dist/types/form/form-editor/types.d.ts +6 -4
  125. package/dist/types/form/form-editor/types.d.ts.map +1 -1
  126. package/dist/types/form/form-metadata/index.d.ts.map +1 -1
  127. package/dist/types/form/utils/index.d.ts +1 -0
  128. package/dist/types/form/utils/index.d.ts.map +1 -1
  129. package/dist/types/form/utils/list.d.ts +10 -0
  130. package/dist/types/form/utils/list.d.ts.map +1 -0
  131. package/dist/types/index.d.ts +1 -0
  132. package/dist/types/index.d.ts.map +1 -1
  133. package/dist/types/stubs.d.ts +1 -0
  134. package/dist/types/stubs.d.ts.map +1 -1
  135. package/package.json +1 -1
  136. package/schemas/form-metadata-input-schema.json +1 -2
  137. package/schemas/form-metadata-schema.json +1 -2
  138. package/schemas/question-type-full-schema.json +2 -1
  139. package/src/form/form-editor/__stubs__/preview.js +84 -4
  140. package/src/form/form-editor/index.ts +4 -2
  141. package/src/form/form-editor/macros/types.ts +65 -0
  142. package/src/form/form-editor/preview/autocomplete.js +21 -4
  143. package/src/form/form-editor/preview/checkbox-sortable.js +7 -2
  144. package/src/form/form-editor/preview/checkbox.js +17 -0
  145. package/src/form/form-editor/preview/component-elements.js +61 -0
  146. package/src/form/form-editor/preview/constants.js +1 -0
  147. package/src/form/form-editor/preview/content.js +93 -0
  148. package/src/form/form-editor/preview/controller/page-controller.js +284 -0
  149. package/src/form/form-editor/preview/date-input.js +8 -2
  150. package/src/form/form-editor/preview/email-address.js +7 -1
  151. package/src/form/form-editor/preview/fieldset-question.js +6 -0
  152. package/src/form/form-editor/preview/helpers.js +95 -0
  153. package/src/form/form-editor/preview/index.js +6 -0
  154. package/src/form/form-editor/preview/list.js +62 -3
  155. package/src/form/form-editor/preview/long-answer.js +7 -1
  156. package/src/form/form-editor/preview/markdown.js +50 -0
  157. package/src/form/form-editor/preview/month-year.js +7 -2
  158. package/src/form/form-editor/preview/number-only.js +5 -0
  159. package/src/form/form-editor/preview/phone-number.js +7 -1
  160. package/src/form/form-editor/preview/preview.js +211 -0
  161. package/src/form/form-editor/preview/question.js +47 -142
  162. package/src/form/form-editor/preview/radio-sortable.js +7 -2
  163. package/src/form/form-editor/preview/radio.js +7 -2
  164. package/src/form/form-editor/preview/select-sortable.js +43 -0
  165. package/src/form/form-editor/preview/select.js +11 -0
  166. package/src/form/form-editor/preview/short-answer.js +7 -1
  167. package/src/form/form-editor/preview/supporting-evidence.js +7 -1
  168. package/src/form/form-editor/preview/types.ts +18 -18
  169. package/src/form/form-editor/preview/uk-address.js +7 -2
  170. package/src/form/form-editor/preview/yes-no.js +7 -2
  171. package/src/form/form-editor/types.ts +6 -4
  172. package/src/form/form-metadata/index.ts +2 -5
  173. package/src/form/utils/index.ts +1 -0
  174. package/src/form/utils/list.ts +25 -0
  175. package/src/index.ts +1 -0
  176. package/src/stubs.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","organisations","idSchema","string","hex","length","required","description","titleSchema","max","trim","slugSchema","pattern","name","organisationSchema","valid","teamNameSchema","teamEmailSchema","email","tlds","allow","phoneSchema","emailAddressSchema","emailResponseTimeSchema","emailSchema","object","keys","address","responseTime","onlineUrlSchema","uri","scheme","onlineTextSchema","onlineSchema","url","text","contactSchema","phone","online","submissionGuidanceSchema","privacyNoticeUrlSchema","notificationEmailAddressSchema","authoredAtSchema","date","iso","authorIdSchema","authorDisplayNameSchema","formMetadataInputKeys","title","organisation","teamName","teamEmail","contact","submissionGuidance","privacyNoticeUrl","notificationEmail","formMetadataInputSchema","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formMetadataSchema","append","slug","draft","live"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type FormMetadata,\n type FormMetadataAuthor,\n type FormMetadataContact,\n type FormMetadataContactEmail,\n type FormMetadataContactOnline,\n type FormMetadataInput,\n type FormMetadataState\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string()\n .hex()\n .length(24)\n .required()\n .description(\n 'Unique identifier for the form, 24-character hexadecimal string'\n )\n\nexport const titleSchema = Joi.string()\n .max(250)\n .trim()\n .required()\n .description('Title of the form, displayed to users')\n\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n .description('URL-friendly identifier used in form paths')\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n .description('Defra organisation responsible for the form')\n\nexport const teamNameSchema = Joi.string()\n .max(100)\n .trim()\n .required()\n .description('Name of the team responsible for the form')\n\nexport const teamEmailSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .required()\n .description('Contact email for the team responsible for the form')\n\nexport const phoneSchema = Joi.string()\n .trim()\n .description('Phone number for form-related inquiries')\n\nexport const emailAddressSchema = Joi.string()\n .email()\n .trim()\n .required()\n .description('Email address for form-related inquiries')\n\nexport const emailResponseTimeSchema = Joi.string()\n .trim()\n .required()\n .description('Expected response time for email inquiries')\n\nexport const emailSchema = Joi.object<FormMetadataContactEmail>()\n .keys({\n address: emailAddressSchema,\n responseTime: emailResponseTimeSchema\n })\n .description('Email contact details including response expectations')\n\nexport const onlineUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .required()\n .description('URL for online contact method')\n\nexport const onlineTextSchema = Joi.string()\n .trim()\n .required()\n .description('Descriptive text for the online contact link')\n\nexport const onlineSchema = Joi.object<FormMetadataContactOnline>()\n .keys({\n url: onlineUrlSchema,\n text: onlineTextSchema\n })\n .description('Online contact details with URL and descriptive text')\n\nexport const contactSchema = Joi.object<FormMetadataContact>()\n .keys({\n phone: phoneSchema,\n email: emailSchema,\n online: onlineSchema\n })\n .description('Complete contact information for form-related inquiries')\n\nexport const submissionGuidanceSchema = Joi.string()\n .trim()\n .description('Guidance text shown to users when submitting the form')\n\nexport const privacyNoticeUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .description('URL to the privacy notice for this form')\n\nexport const notificationEmailAddressSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .pattern(/\\.gov\\.uk$|\\.org\\.uk$/)\n .description(\n 'Email address to receive form submission notifications, must be a .gov.uk or .org.uk address'\n )\n\nexport const authoredAtSchema = Joi.date()\n .iso()\n .required()\n .description('ISO format timestamp of when an action occurred')\n\nexport const authorIdSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the author')\n\nexport const authorDisplayNameSchema = Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the author')\n\nexport const formMetadataInputKeys = {\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema,\n contact: contactSchema,\n submissionGuidance: submissionGuidanceSchema,\n privacyNoticeUrl: privacyNoticeUrlSchema,\n notificationEmail: notificationEmailAddressSchema\n}\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys(formMetadataInputKeys)\n .required()\n .description('Input data for creating or updating form metadata')\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n .description('Information about the author of a form or form change')\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>()\n .keys({\n createdAt: authoredAtSchema.description(\n 'When this version was first created'\n ),\n createdBy: formMetadataAuthorSchema.description('Who created this version'),\n updatedAt: authoredAtSchema.description(\n 'When this version was last updated'\n ),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated this version'\n )\n })\n .description('Metadata about a specific version state (draft or live)')\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema\n .append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,\n draft: formMetadataStateSchema.description(\n 'Metadata for the draft version'\n ),\n live: formMetadataStateSchema.description(\n 'Metadata for the published version'\n ),\n createdAt: authoredAtSchema.description('When the form was first created'),\n createdBy: formMetadataAuthorSchema.description('Who created the form'),\n updatedAt: authoredAtSchema.description('When the form was last updated'),\n updatedBy: formMetadataAuthorSchema.description('Who last updated the form')\n })\n .description(\n 'Complete metadata for a form, including version information and authoring details'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAYrB,OAAO,MAAMC,aAAa,GAAG,CAC3B,uCAAuC,EACvC,mEAAmE,EACnE,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,sCAAsC,EACtC,iBAAiB,EACjB,6BAA6B,EAC7B,wCAAwC,CACzC;AAED,OAAO,MAAMC,QAAQ,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CACjCC,GAAG,CAAC,CAAC,CACLC,MAAM,CAAC,EAAE,CAAC,CACVC,QAAQ,CAAC,CAAC,CACVC,WAAW,CACV,iEACF,CAAC;AAEH,OAAO,MAAMC,WAAW,GAAGR,GAAG,CAACG,MAAM,CAAC,CAAC,CACpCM,GAAG,CAAC,GAAG,CAAC,CACRC,IAAI,CAAC,CAAC,CACNJ,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,uCAAuC,CAAC;AAEvD,OAAO,MAAMI,UAAU,GAAGX,GAAG,CAACG,MAAM,CAAC,CAAC,CACnCS,OAAO,CAAC,cAAc,EAAE;EAAEC,IA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C,CACrEC,IAAI,CAAC;EACJgC,EAAE,EAAEb,cAAc;EAClBc,WAAW,EAAEb;AACf,CAAC,CAAC,CACDxC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,uDAAuD,CAAC;;AAEvE;AACA;AACA;AACA;AACA,OAAO,MAAMqD,uBAAuB,GAAG5D,GAAG,CAACyB,MAAM,CAAoB,CAAC,CACnEC,IAAI,CAAC;EACJmC,SAAS,EAAEnB,gBAAgB,CAACnC,WAAW,CACrC,qCACF,CAAC;EACDuD,SAAS,EAAEL,wBAAwB,CAAClD,WAAW,CAAC,0BAA0B,CAAC;EAC3EwD,SAAS,EAAErB,gBAAgB,CAACnC,WAAW,CACrC,oCACF,CAAC;EACDyD,SAAS,EAAEP,wBAAwB,CAAClD,WAAW,CAC7C,+BACF;AACF,CAAC,CAAC,CACDA,WAAW,CAAC,yDAAyD,CAAC;;AAEzE;AACA;AACA;AACA;AACA,OAAO,MAAM0D,kBAAkB,GAAGT,uBAAuB,CACtDU,MAAM,CAAe;EACpBR,EAAE,EAAExD,QAAQ;EACZiE,IAAI,EAAExD,UAAU;EAChByD,KAAK,EAAER,uBAAuB,CAACrD,WAAW,CACxC,gCACF,CAAC;EACD8D,IAAI,EAAET,uBAAuB,CAACrD,WAAW,CACvC,oCACF,CAAC;EACDsD,SAAS,EAAEnB,gBAAgB,CAACnC,WAAW,CAAC,iCAAiC,CAAC;EAC1EuD,SAAS,EAAEL,wBAAwB,CAAClD,WAAW,CAAC,sBAAsB,CAAC;EACvEwD,SAAS,EAAErB,gBAAgB,CAACnC,WAAW,CAAC,gCAAgC,CAAC;EACzEyD,SAAS,EAAEP,wBAAwB,CAAClD,WAAW,CAAC,2BAA2B;AAC7E,CAAC,CAAC,CACDA,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","organisations","idSchema","string","hex","length","required","description","titleSchema","max","trim","slugSchema","pattern","name","organisationSchema","valid","teamNameSchema","teamEmailSchema","email","tlds","allow","phoneSchema","emailAddressSchema","emailResponseTimeSchema","emailSchema","object","keys","address","responseTime","onlineUrlSchema","uri","scheme","onlineTextSchema","onlineSchema","url","text","contactSchema","phone","online","submissionGuidanceSchema","privacyNoticeUrlSchema","notificationEmailAddressSchema","authoredAtSchema","date","iso","authorIdSchema","authorDisplayNameSchema","formMetadataInputKeys","title","organisation","teamName","teamEmail","contact","submissionGuidance","privacyNoticeUrl","notificationEmail","formMetadataInputSchema","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formMetadataSchema","append","slug","draft","live"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type FormMetadata,\n type FormMetadataAuthor,\n type FormMetadataContact,\n type FormMetadataContactEmail,\n type FormMetadataContactOnline,\n type FormMetadataInput,\n type FormMetadataState\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string()\n .hex()\n .length(24)\n .required()\n .description(\n 'Unique identifier for the form, 24-character hexadecimal string'\n )\n\nexport const titleSchema = Joi.string()\n .max(250)\n .trim()\n .required()\n .description('Title of the form, displayed to users')\n\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n .description('URL-friendly identifier used in form paths')\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n .description('Defra organisation responsible for the form')\n\nexport const teamNameSchema = Joi.string()\n .max(100)\n .trim()\n .required()\n .description('Name of the team responsible for the form')\n\nexport const teamEmailSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .required()\n .description('Contact email for the team responsible for the form')\n\nexport const phoneSchema = Joi.string()\n .trim()\n .description('Phone number for form-related inquiries')\n\nexport const emailAddressSchema = Joi.string()\n .email()\n .trim()\n .required()\n .description('Email address for form-related inquiries')\n\nexport const emailResponseTimeSchema = Joi.string()\n .trim()\n .required()\n .description('Expected response time for email inquiries')\n\nexport const emailSchema = Joi.object<FormMetadataContactEmail>()\n .keys({\n address: emailAddressSchema,\n responseTime: emailResponseTimeSchema\n })\n .description('Email contact details including response expectations')\n\nexport const onlineUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .required()\n .description('URL for online contact method')\n\nexport const onlineTextSchema = Joi.string()\n .trim()\n .required()\n .description('Descriptive text for the online contact link')\n\nexport const onlineSchema = Joi.object<FormMetadataContactOnline>()\n .keys({\n url: onlineUrlSchema,\n text: onlineTextSchema\n })\n .description('Online contact details with URL and descriptive text')\n\nexport const contactSchema = Joi.object<FormMetadataContact>()\n .keys({\n phone: phoneSchema,\n email: emailSchema,\n online: onlineSchema\n })\n .description('Complete contact information for form-related inquiries')\n\nexport const submissionGuidanceSchema = Joi.string()\n .trim()\n .description('Guidance text shown to users when submitting the form')\n\nexport const privacyNoticeUrlSchema = Joi.string()\n .uri({\n scheme: ['http', 'https']\n })\n .trim()\n .description('URL to the privacy notice for this form')\n\nexport const notificationEmailAddressSchema = Joi.string()\n .email()\n .trim()\n .description('Email address to receive form submission notifications')\n\nexport const authoredAtSchema = Joi.date()\n .iso()\n .required()\n .description('ISO format timestamp of when an action occurred')\n\nexport const authorIdSchema = Joi.string()\n .trim()\n .required()\n .description('Unique identifier for the author')\n\nexport const authorDisplayNameSchema = Joi.string()\n .trim()\n .required()\n .description('Human-readable name of the author')\n\nexport const formMetadataInputKeys = {\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema,\n contact: contactSchema,\n submissionGuidance: submissionGuidanceSchema,\n privacyNoticeUrl: privacyNoticeUrlSchema,\n notificationEmail: notificationEmailAddressSchema\n}\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys(formMetadataInputKeys)\n .required()\n .description('Input data for creating or updating form metadata')\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n .description('Information about the author of a form or form change')\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>()\n .keys({\n createdAt: authoredAtSchema.description(\n 'When this version was first created'\n ),\n createdBy: formMetadataAuthorSchema.description('Who created this version'),\n updatedAt: authoredAtSchema.description(\n 'When this version was last updated'\n ),\n updatedBy: formMetadataAuthorSchema.description(\n 'Who last updated this version'\n )\n })\n .description('Metadata about a specific version state (draft or live)')\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema\n .append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,\n draft: formMetadataStateSchema.description(\n 'Metadata for the draft version'\n ),\n live: formMetadataStateSchema.description(\n 'Metadata for the published version'\n ),\n createdAt: authoredAtSchema.description('When the form was first created'),\n createdBy: formMetadataAuthorSchema.description('Who created the form'),\n updatedAt: authoredAtSchema.description('When the form was last updated'),\n updatedBy: formMetadataAuthorSchema.description('Who last updated the form')\n })\n .description(\n 'Complete metadata for a form, including version information and authoring details'\n )\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAYrB,OAAO,MAAMC,aAAa,GAAG,CAC3B,uCAAuC,EACvC,mEAAmE,EACnE,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,sCAAsC,EACtC,iBAAiB,EACjB,6BAA6B,EAC7B,wCAAwC,CACzC;AAED,OAAO,M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wBAAwB,CAAClD,WAAW,CAAC,sBAAsB,CAAC;EACvEwD,SAAS,EAAErB,gBAAgB,CAACnC,WAAW,CAAC,gCAAgC,CAAC;EACzEyD,SAAS,EAAEP,wBAAwB,CAAClD,WAAW,CAAC,2BAA2B;AAC7E,CAAC,CAAC,CACDA,WAAW,CACV,mFACF,CAAC","ignoreList":[]}
@@ -1,2 +1,3 @@
1
1
  export { findStartPage } from "./find-start-page.js";
2
+ export { findDefinitionListFromComponent } from "./list.js";
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["findStartPage"],"sources":["../../../../src/form/utils/index.ts"],"sourcesContent":["export { findStartPage } from '~/src/form/utils/find-start-page.js'\n"],"mappings":"AAAA,SAASA,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["findStartPage","findDefinitionListFromComponent"],"sources":["../../../../src/form/utils/index.ts"],"sourcesContent":["export { findStartPage } from '~/src/form/utils/find-start-page.js'\nexport { findDefinitionListFromComponent } from '~/src/form/utils/list.js'\n"],"mappings":"AAAA,SAASA,aAAa;AACtB,SAASC,+BAA+B","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Given a SelectionComponent finds the associated list
3
+ * @param {ListComponentsDef} selectionComponent
4
+ * @param {FormDefinition} definition
5
+ * @returns {List}
6
+ */
7
+ export function findDefinitionListFromComponent(selectionComponent, definition) {
8
+ const listId = selectionComponent.list;
9
+ const list = definition.lists.find(list => list.id === listId);
10
+ if (list === undefined) {
11
+ throw new Error('List not found');
12
+ }
13
+ return list;
14
+ }
15
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","names":["findDefinitionListFromComponent","selectionComponent","definition","listId","list","lists","find","id","undefined","Error"],"sources":["../../../../src/form/utils/list.ts"],"sourcesContent":["import { type ListComponentsDef } from '~/src/components/types.js'\nimport {\n type FormDefinition,\n type List\n} from '~/src/form/form-definition/types.js'\n\n/**\n * Given a SelectionComponent finds the associated list\n * @param {ListComponentsDef} selectionComponent\n * @param {FormDefinition} definition\n * @returns {List}\n */\nexport function findDefinitionListFromComponent(\n selectionComponent: ListComponentsDef,\n definition: FormDefinition\n): List {\n const listId = selectionComponent.list\n const list = definition.lists.find((list) => list.id === listId)\n\n if (list === undefined) {\n throw new Error('List not found')\n }\n\n return list\n}\n"],"mappings":"AAMA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,+BAA+BA,CAC7CC,kBAAqC,EACrCC,UAA0B,EACpB;EACN,MAAMC,MAAM,GAAGF,kBAAkB,CAACG,IAAI;EACtC,MAAMA,IAAI,GAAGF,UAAU,CAACG,KAAK,CAACC,IAAI,CAAEF,IAAI,IAAKA,IAAI,CAACG,EAAE,KAAKJ,MAAM,CAAC;EAEhE,IAAIC,IAAI,KAAKI,SAAS,EAAE;IACtB,MAAM,IAAIC,KAAK,CAAC,gBAAgB,CAAC;EACnC;EAEA,OAAOL,IAAI;AACb","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/enums.js'\nexport * from '~/src/common/random-id.js'\nexport * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-definition/types.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/form/form-editor/index.js'\nexport * from '~/src/form/form-editor/preview/index.js'\nexport * from '~/src/form/form-manager/types.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\nexport type * from '~/src/form/form-editor/preview/types.js'\nexport type * from '~/src/form/form-editor/types.js'\nexport type * from '~/src/form/form-editor/macros/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -10,4 +10,5 @@ export { buildRepeaterPage } from "./__stubs__/pages.js";
10
10
  export { buildFileUploadPage } from "./__stubs__/pages.js";
11
11
  export { buildSummaryPage } from "./__stubs__/pages.js";
12
12
  export { buildQuestionPage } from "./__stubs__/pages.js";
13
+ export { buildMarkdownComponent } from "./__stubs__/components.js";
13
14
  //# sourceMappingURL=stubs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stubs.js","names":["buildList","buildListItem","buildCheckboxComponent","buildRadioComponent","buildAutoCompleteComponent","buildFileUploadComponent","buildTextFieldComponent","buildRepeaterPage","buildFileUploadPage","buildSummaryPage","buildQuestionPage"],"sources":["../../src/stubs.ts"],"sourcesContent":["export * from '~/src/__stubs__/form-definition.js'\nexport { buildList } from '~/src/__stubs__/components.js'\nexport { buildListItem } from '~/src/__stubs__/components.js'\nexport { buildCheckboxComponent } from '~/src/__stubs__/components.js'\nexport { buildRadioComponent } from '~/src/__stubs__/components.js'\nexport { buildAutoCompleteComponent } from '~/src/__stubs__/components.js'\nexport { buildFileUploadComponent } from '~/src/__stubs__/components.js'\nexport { buildTextFieldComponent } from '~/src/__stubs__/components.js'\nexport { buildRepeaterPage } from '~/src/__stubs__/pages.js'\nexport { buildFileUploadPage } from '~/src/__stubs__/pages.js'\nexport { buildSummaryPage } from '~/src/__stubs__/pages.js'\nexport { buildQuestionPage } from '~/src/__stubs__/pages.js'\n"],"mappings":"AAAA;AACA,SAASA,SAAS;AAClB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,SAASC,wBAAwB;AACjC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"stubs.js","names":["buildList","buildListItem","buildCheckboxComponent","buildRadioComponent","buildAutoCompleteComponent","buildFileUploadComponent","buildTextFieldComponent","buildRepeaterPage","buildFileUploadPage","buildSummaryPage","buildQuestionPage","buildMarkdownComponent"],"sources":["../../src/stubs.ts"],"sourcesContent":["export * from '~/src/__stubs__/form-definition.js'\nexport { buildList } from '~/src/__stubs__/components.js'\nexport { buildListItem } from '~/src/__stubs__/components.js'\nexport { buildCheckboxComponent } from '~/src/__stubs__/components.js'\nexport { buildRadioComponent } from '~/src/__stubs__/components.js'\nexport { buildAutoCompleteComponent } from '~/src/__stubs__/components.js'\nexport { buildFileUploadComponent } from '~/src/__stubs__/components.js'\nexport { buildTextFieldComponent } from '~/src/__stubs__/components.js'\nexport { buildRepeaterPage } from '~/src/__stubs__/pages.js'\nexport { buildFileUploadPage } from '~/src/__stubs__/pages.js'\nexport { buildSummaryPage } from '~/src/__stubs__/pages.js'\nexport { buildQuestionPage } from '~/src/__stubs__/pages.js'\nexport { buildMarkdownComponent } from '~/src/__stubs__/components.js'\n"],"mappings":"AAAA;AACA,SAASA,SAAS;AAClB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,SAASC,wBAAwB;AACjC,SAASC,uBAAuB;AAChC,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB","ignoreList":[]}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @param {Partial<BaseSettings>} partialBaseElements
3
+ * @param {jest.Mock<void, [string, QuestionBaseModel]>} renderMock
4
+ * @returns {Question}
5
+ */
6
+ export function buildPreviewShortAnswer(partialBaseElements: Partial<BaseSettings>, renderMock: jest.Mock<void, [string, QuestionBaseModel]>): Question;
1
7
  /**
2
8
  * @implements {QuestionRenderer}
3
9
  */
@@ -22,6 +28,30 @@ export class QuestionRendererStub implements QuestionRenderer {
22
28
  */
23
29
  render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void;
24
30
  }
31
+ /**
32
+ * @implements {PageRenderer}
33
+ */
34
+ export class PageRendererStub implements PageRenderer {
35
+ /**
36
+ * @returns {string}
37
+ * @param {string} _questionTemplate
38
+ * @param {RenderContext} _renderContext
39
+ */
40
+ static buildHTML(_questionTemplate: string, _renderContext: RenderContext): string;
41
+ /**
42
+ * @param {jest.Mock<void, [string, PagePreviewPanelMacro]>} renderMock
43
+ */
44
+ constructor(renderMock: jest.Mock<void, [string, PagePreviewPanelMacro]>);
45
+ /**
46
+ * @type {jest.Mock<void, [string, PagePreviewPanelMacro]>}
47
+ */
48
+ renderMock: jest.Mock<void, [string, PagePreviewPanelMacro]>;
49
+ /**
50
+ * @param {string} pageTemplate
51
+ * @param {PagePreviewPanelMacro} pagePreviewPanelMacro
52
+ */
53
+ render(pageTemplate: string, pagePreviewPanelMacro: PagePreviewPanelMacro): void;
54
+ }
25
55
  /**
26
56
  * @implements {ListElements}
27
57
  */
@@ -29,7 +59,7 @@ export class QuestionPreviewElements implements ListElements {
29
59
  /**
30
60
  * @param {BaseSettings} baseSettings
31
61
  */
32
- constructor({ question, hintText, optional, shortDesc, items }: BaseSettings);
62
+ constructor({ question, hintText, optional, shortDesc, items, content }: BaseSettings);
33
63
  /**
34
64
  * @protected
35
65
  */
@@ -43,6 +73,11 @@ export class QuestionPreviewElements implements ListElements {
43
73
  * @protected
44
74
  */
45
75
  protected _shortDesc: string;
76
+ /**
77
+ * @type {string}
78
+ * @protected
79
+ */
80
+ protected _content: string;
46
81
  /**
47
82
  *
48
83
  * @type {ListElement[]}
@@ -50,13 +85,10 @@ export class QuestionPreviewElements implements ListElements {
50
85
  */
51
86
  private _items;
52
87
  afterInputsHTML: string;
53
- get values(): {
54
- question: string;
55
- hintText: string;
56
- optional: boolean;
57
- shortDesc: string;
58
- items: ListElement[];
59
- };
88
+ /**
89
+ * @returns {BaseSettings}
90
+ */
91
+ get values(): BaseSettings;
60
92
  /**
61
93
  * @param {string} _value
62
94
  */
@@ -78,6 +110,18 @@ export class AutocompletePreviewElements extends QuestionPreviewElements impleme
78
110
  });
79
111
  autocompleteOptions: string;
80
112
  }
113
+ /**
114
+ * @implements {PageOverviewElements}
115
+ */
116
+ export class PagePreviewElements implements PageOverviewElements {
117
+ /**
118
+ * @param {string} heading
119
+ * @param {string} guidance
120
+ */
121
+ constructor(heading: string, guidance?: string);
122
+ guidance: string;
123
+ heading: string;
124
+ }
81
125
  export const baseElements: BaseSettings;
82
126
  export namespace listElementsStub {
83
127
  export { list1Id };
@@ -86,13 +130,16 @@ export namespace listElementsStub {
86
130
  export { list4Id };
87
131
  export { listElementsBase as baseElements };
88
132
  }
89
- import type { QuestionRenderer } from '../../../form/form-editor/preview/types.js';
133
+ import type { BaseSettings } from '../../../form/form-editor/preview/types.js';
90
134
  import type { QuestionBaseModel } from '../../../form/form-editor/preview/types.js';
135
+ import { Question } from '../../../form/form-editor/preview/question.js';
136
+ import type { QuestionRenderer } from '../../../form/form-editor/preview/types.js';
91
137
  import type { RenderContext } from '../../../form/form-editor/preview/types.js';
138
+ import type { PageRenderer } from '../../../form/form-editor/preview/types.js';
139
+ import type { PagePreviewPanelMacro } from '../../../form/form-editor/macros/types.js';
92
140
  import type { ListElements } from '../../../form/form-editor/preview/types.js';
93
- import type { ListElement } from '../../../form/form-editor/types.js';
94
- import type { BaseSettings } from '../../../form/form-editor/preview/types.js';
95
141
  import type { AutocompleteElements } from '../../../form/form-editor/preview/types.js';
142
+ import type { PageOverviewElements } from '../../../form/form-editor/preview/types.js';
96
143
  declare const list1Id: "414d82a3-4cab-416a-bd54-6b86fbd51120";
97
144
  declare const list2Id: "801385a4-81e6-4171-96c3-6c6727d97f22";
98
145
  declare const list3Id: "e6e3f621-b875-4ca3-a054-cca9149149dd";
@@ -1 +1 @@
1
- {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAqBE;;;;OAIG;IACH,oCAHW,MAAM,kBACN,aAAa,GAFX,MAAM,CAMlB;IAtBD;;OAEG;IACH,wBAFW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,EAItD;IAVD;;OAEG;IACH,YAFU,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAE5C;IASV;;;OAGG;IACH,yBAHW,MAAM,qBACN,iBAAiB,QAI3B;CAUF;AAED;;GAEG;AACH;IAuBE;;OAEG;IACH,gEAFW,YAAY,EAQtB;IA/BD;;OAEG;IACH,4BAAc;IACd,iBAAiB;IACjB,4BAAc;IACd,iBAAiB;IACjB,6BAAiB;IACjB;;;OAGG;IACH,sBAHU,MAAM,CAGD;IACf;;;;OAIG;IACH,eAAW;IAEX,wBAA2E;IAa3E;;;;;;MAQC;IAED;;OAEG;IACH,uBAFW,MAAM,QAIhB;IAED;;OAEG;IACH,sBAFW,WAAW,QAIrB;CACF;AAED;;GAEG;AACH;IACE;;OAEG;IACH,kDAFW,YAAY,GAAG;QAAC,mBAAmB,EAAE,MAAM,CAAA;KAAC,EAKtD;IADC,4BAA8C;CAEjD;AAED,2BAAuC,YAAY,CAMjD;;;;;;;;sCA+C0I,yCAAyC;uCAAzC,yCAAyC;mCAAzC,yCAAyC;kCAAzC,yCAAyC;iCADpJ,iCAAiC;kCAC0E,yCAAyC;0CAAzC,yCAAyC;AA7CrL,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AACtD,uBAAgB,sCAAsC,CAAA;AAEtD,gCAAoC,YAAY,CA4B9C"}
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/__stubs__/preview.js"],"names":[],"mappings":"AAgOA;;;;GAIG;AACH,6DAJW,OAAO,CAAC,YAAY,CAAC,cACrB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,M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AAM,yBAAyB;UACvB,MAAM;WAAS,MAAM;IAiBvB,CAAA;AAEb,eAAO,MAAM,yBAAyB;;cAnBvB,MAAM;eAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDnC,CAAA;AAED,eAAO,MAAM,uBAAuB;;;CAGnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,uCAGmC,CAAA;AAEzE,eAAO,MAAM,sCAAsC;;CAElD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wCAAwC,uDAIO,CAAA;AAE5D,eAAO,MAAM,2BAA2B;;;;;CAKvC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,2CAMrC,CAAA;AAEL,eAAO,MAAM,+BAA+B;;;;CAI3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,+CAI8B,CAAA;AAE5E,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,gBAAgB,CAOhC;AAED,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,0BAA0B,CAM1C;AAGD,eAAO,MAAM,6BAA6B,UAA+B,CAAA"}
@@ -0,0 +1,62 @@
1
+ import { type ComponentType } from '../../../components/enums.js';
2
+ import { type DateItem, type GovukField, type ListItemReadonly } from '../../../form/form-editor/types.js';
3
+ import { type DefaultComponent, type GovukFieldset } from '../../../index.js';
4
+ export interface AppPreviewErrorPanelMacroErrorTemplate {
5
+ advancedSettingsErrors: [];
6
+ baseErrors: {
7
+ template: unknown;
8
+ type: string;
9
+ }[];
10
+ }
11
+ export interface AppPreviewErrorPanelMacro {
12
+ errorTemplates: AppPreviewErrorPanelMacroErrorTemplate;
13
+ fieldDetails: {
14
+ extraFields: GovukField[];
15
+ basePageFields: GovukField[];
16
+ };
17
+ questionType: ComponentType;
18
+ }
19
+ export interface AppPreviewPanelTabsMacro {
20
+ questionType: ComponentType;
21
+ previewPageUrl: string;
22
+ previewErrorsUrl: string;
23
+ errorTemplates: AppPreviewErrorPanelMacroErrorTemplate;
24
+ extraFields: GovukField[];
25
+ basePageFields: GovukField[];
26
+ }
27
+ export interface QuestionBaseModel {
28
+ id?: string;
29
+ name?: string;
30
+ content?: string;
31
+ label?: DefaultComponent;
32
+ hint?: DefaultComponent;
33
+ fieldset?: GovukFieldset;
34
+ readonly items?: ListItemReadonly[] | DateItem[];
35
+ text?: string;
36
+ formGroup?: {
37
+ afterInputs: {
38
+ html: string;
39
+ };
40
+ };
41
+ type?: 'text' | 'number' | 'boolean';
42
+ classes?: string;
43
+ }
44
+ export interface AppPreviewPanelMacro extends AppPreviewPanelTabsMacro {
45
+ model: QuestionBaseModel;
46
+ }
47
+ export interface PagePreviewComponent {
48
+ model: QuestionBaseModel;
49
+ questionType: ComponentType;
50
+ }
51
+ export interface PagePreviewPanelMacro {
52
+ readonly pageTitle: {
53
+ text: string;
54
+ classes: string;
55
+ };
56
+ readonly guidance: {
57
+ text: string;
58
+ classes: string;
59
+ };
60
+ readonly components: PagePreviewComponent[];
61
+ }
62
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/macros/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE1E,MAAM,WAAW,sCAAsC;IACrD,sBAAsB,EAAE,EAAE,CAAA;IAC1B,UAAU,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAClD;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAA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AAA;KAChB,CAAA;IACD,QAAQ,CAAC,QAAQ,EAAE;QACjB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,QAAQ,CAAC,UAAU,EAAE,oBAAoB,EAAE,CAAA;CAC5C"}
@@ -1,4 +1,6 @@
1
- export class AutocompleteQuestion extends Question {
1
+ export class AutocompleteListQuestion extends Question {
2
+ }
3
+ export class AutocompleteQuestion extends AutocompleteListQuestion {
2
4
  /**
3
5
  * @param {AutocompleteElements} autocompleteElements
4
6
  * @param {QuestionRenderer} questionRenderer
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/autocomplete.js"],"names":[],"mappings":"AAGA;IAaE;;;OAGG;IACH,kCAHW,oBAAoB,oBACpB,gBAAgB,EAK1B;IAbD;;;OAGG;IACH,0BAAsB;IAWtB,sCAEC;IAED;;OAEG;IACH,8BAFW,MAAM,QAkBhB;IAED;;;;;;;;;MASC;CACF;yBA3DwB,4CAA4C;iCA+DrC,iCAAiC;0CACN,yCAAyC;sCAAzC,yCAAyC"}
1
+ {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/autocomplete.js"],"names":[],"mappings":"AAKA;CAoBC;AAED;IAME;;;OAGG;IACH,kCAHW,oBAAoB,oBACpB,gBAAgB,EAK1B;IAZD;;;OAGG;IACH,0BAAsB;IAUtB,sCAEC;IAED;;OAEG;IACH,8BAFW,MAAM,QAkBhB;IAED;;;;;;;;;MASC;CACF;yBA1EwB,4CAA4C;iCA8ErC,iCAAiC;0CACa,yCAAyC;sCAAzC,yCAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-sortable.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/checkbox-sortable.js"],"names":[],"mappings":"AAGA;CAQC;qCAXoC,iDAAiD"}
1
+ {"version":3,"file":"checkbox-sortable.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/checkbox-sortable.js"],"names":[],"mappings":"AAIA;CAYC;qCAfoC,iDAAiD"}
@@ -0,0 +1,4 @@
1
+ export class CheckboxQuestion extends ListQuestion {
2
+ }
3
+ import { ListQuestion } from '../../../form/form-editor/preview/list.js';
4
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/checkbox.js"],"names":[],"mappings":"AAIA;CAYC;6BAf4B,wCAAwC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @implements {QuestionElements}
3
+ */
4
+ export class ComponentElements implements QuestionElements {
5
+ /**
6
+ * @param {ComponentDef} component
7
+ */
8
+ constructor(component: ComponentDef);
9
+ /**
10
+ * @type {ComponentDef}
11
+ * @protected
12
+ */
13
+ protected _component: ComponentDef;
14
+ /**
15
+ * @protected
16
+ * @returns {BaseSettings}
17
+ */
18
+ protected _getValues(): BaseSettings;
19
+ /**
20
+ * @returns {BaseSettings}
21
+ */
22
+ get values(): BaseSettings;
23
+ /**
24
+ * @param {HTMLElement} _element
25
+ */
26
+ setPreviewDOM(_element: HTMLElement): void;
27
+ /**
28
+ * @param {string} _value
29
+ */
30
+ setPreviewHTML(_value: string): void;
31
+ }
32
+ import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
33
+ import type { ComponentDef } from '../../../components/types.js';
34
+ import type { BaseSettings } from '../../../form/form-editor/preview/types.js';
35
+ //# sourceMappingURL=component-elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-elements.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/component-elements.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,YAAY,EAItB;IAVD;;;OAGG;IACH,sBAHU,YAAY,CAGZ;IAQV;;;OAGG;IACH,wBAFa,YAAY,CAaxB;IAED;;OAEG;IACH,cAFa,YAAY,CAKxB;IAED;;OAEG;IACH,wBAFW,WAAW,QAIrB;IAED;;OAEG;IACH,uBAFW,MAAM,QAIhB;CACF;sCAGqI,yCAAyC;kCACrG,2BAA2B;kCADiC,yCAAyC"}
@@ -0,0 +1,2 @@
1
+ export const HIGHLIGHT_CLASS: "highlight";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/constants.js"],"names":[],"mappings":"AAAA,8BAA+B,WAAW,CAAA"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @implements {QuestionElements}
3
+ */
4
+ export class ContentElements extends ComponentElements implements QuestionElements {
5
+ /**
6
+ * @param {Exclude<ContentComponentsDef, ListComponent>} component
7
+ */
8
+ constructor(component: Exclude<ContentComponentsDef, ListComponent>);
9
+ /**
10
+ * @type {Exclude<ContentComponentsDef, ListComponent>}
11
+ * @protected
12
+ */
13
+ protected _component: Exclude<ContentComponentsDef, ListComponent>;
14
+ }
15
+ /**
16
+ * @abstract
17
+ * @class Content
18
+ * @classdesc
19
+ * Base of Content preview classes
20
+ */
21
+ export class Content extends PreviewComponent {
22
+ /**
23
+ * @type {string}
24
+ * @protected
25
+ */
26
+ protected _content: string;
27
+ /**
28
+ * @param {string} value
29
+ * @protected
30
+ */
31
+ protected _setContent(value: string): void;
32
+ set content(value: string);
33
+ /**
34
+ * @returns {string}
35
+ */
36
+ get content(): string;
37
+ }
38
+ import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
39
+ import { ComponentElements } from '../../../form/form-editor/preview/component-elements.js';
40
+ import type { ContentComponentsDef } from '../../../components/types.js';
41
+ import type { ListComponent } from '../../../components/types.js';
42
+ import { PreviewComponent } from '../../../form/form-editor/preview/preview.js';
43
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/content.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAME;;OAEG;IACH,uBAFW,OAAO,CAAC,oBAAoB,EAAE,aAAa,CAAC,EAKtD;IAXD;;;OAGG;IACH,sBAHU,OAAO,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAG5C;CAmBX;AAED;;;;;GAKG;AACH;IACE;;;OAGG;IACH,oBAHU,MAAM,CAGR;IAwBR;;;OAGG;IACH,6BAHW,MAAM,QAKhB;IASD,mBANa,MAAM,EASlB;IAVD;;OAEG;IACH,eAFa,MAAM,CAIlB;CAMF;sCAGqI,yCAAyC;kCAzF7I,sDAAsD;0CA0FC,2BAA2B;mCAA3B,2BAA2B;iCAzFnF,2CAA2C"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * @implements {PageOverviewElements}
3
+ */
4
+ export class PagePreviewElements implements PageOverviewElements {
5
+ /**
6
+ * @param {Page} page
7
+ */
8
+ constructor(page: Page);
9
+ /**
10
+ * @type {Page}
11
+ * @private
12
+ */
13
+ private _page;
14
+ get heading(): string;
15
+ get guidance(): string;
16
+ }
17
+ /**
18
+ * @implements {PagePreviewPanelMacro}
19
+ */
20
+ export class PreviewPageController implements PagePreviewPanelMacro {
21
+ static PATH: string;
22
+ /**
23
+ * Creates a dummy component for when guidance is highlighted
24
+ * but no guidance text exists
25
+ * @returns {Markdown}
26
+ */
27
+ static createGuidanceComponent(): Markdown;
28
+ /**
29
+ * Helper method to return the guidance or a new one
30
+ * @param { Markdown | Question | undefined } guidanceComponent
31
+ * @returns {Markdown}
32
+ * @private
33
+ */
34
+ private static getOrCreateGuidanceComponent;
35
+ /**
36
+ * @param {ComponentDef[]} components
37
+ * @param {PageOverviewElements} elements
38
+ * @param {FormDefinition} definition
39
+ * @param {PageRenderer} renderer
40
+ */
41
+ constructor(components: ComponentDef[], elements: PageOverviewElements, definition: FormDefinition, renderer: PageRenderer);
42
+ /**
43
+ * @type {string}
44
+ * @protected
45
+ */
46
+ protected _pageTemplate: string;
47
+ /**
48
+ * @protected
49
+ * @type {Question[]}
50
+ */
51
+ protected _components: Question[];
52
+ /**
53
+ * @type { undefined | 'title' | 'guidance'}
54
+ * @protected
55
+ */
56
+ protected _highlighted: undefined | "title" | "guidance";
57
+ /**
58
+ * @type {string}
59
+ * @private
60
+ */
61
+ private _guidanceText;
62
+ /**
63
+ * @type {Markdown}
64
+ * @private
65
+ */
66
+ private _emptyGuidance;
67
+ /**
68
+ *
69
+ * @type {Markdown}
70
+ * @protected
71
+ */
72
+ protected _guidanceComponent: Markdown;
73
+ /**
74
+ * @type {boolean}
75
+ * @private
76
+ */
77
+ private _showGuidance;
78
+ /**
79
+ * @returns {Markdown[]}
80
+ * @private
81
+ */
82
+ private get _guidanceComponents();
83
+ /**
84
+ * @returns {PagePreviewComponent[]}
85
+ */
86
+ get components(): PagePreviewComponent[];
87
+ set guidanceText(text: string);
88
+ get guidanceText(): string;
89
+ get guidance(): {
90
+ text: string;
91
+ classes: string;
92
+ };
93
+ /**
94
+ * @private
95
+ * @returns {string}
96
+ */
97
+ private _fallBackTitle;
98
+ /**
99
+ * @returns {{ text: string, classes: string }}
100
+ */
101
+ get pageTitle(): {
102
+ text: string;
103
+ classes: string;
104
+ };
105
+ render(): void;
106
+ /**
107
+ * @param {string} value
108
+ */
109
+ set title(value: string);
110
+ /**
111
+ * @returns {string}
112
+ */
113
+ get title(): string;
114
+ highlightTitle(): void;
115
+ highlightGuidance(): void;
116
+ /**
117
+ * @param {'title'|'guidance'} highlightSection
118
+ */
119
+ setHighLighted(highlightSection: "title" | "guidance"): void;
120
+ clearHighlight(): void;
121
+ #private;
122
+ }
123
+ import type { PageOverviewElements } from '../../../../form/form-editor/preview/types.js';
124
+ import type { Page } from '../../../../form/form-definition/types.js';
125
+ import type { PagePreviewPanelMacro } from '../../../../form/form-editor/macros/types.js';
126
+ import type { Question } from '../../../../form/form-editor/preview/question.js';
127
+ import { Markdown } from '../../../../form/form-editor/preview/markdown.js';
128
+ import type { PagePreviewComponent } from '../../../../form/form-editor/macros/types.js';
129
+ import type { ComponentDef } from '../../../../components/types.js';
130
+ import type { FormDefinition } from '../../../../form/form-definition/types.js';
131
+ import type { PageRenderer } from '../../../../form/form-editor/preview/types.js';
132
+ //# sourceMappingURL=page-controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-controller.d.ts","sourceRoot":"","sources":["../../../../../../src/form/form-editor/preview/controller/page-controller.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH;IAME;;OAEG;IACH,kBAFW,IAAI,EAId;IAVD;;;OAGG;IACH,cAAK;IAQL,sBAEC;IAED,uBAUC;CACF;AAED;;GAEG;AACH;IACE,oBAAoC;IAuKpC;;;;OAIG;IACH,kCAFa,QAAQ,CAepB;IAED;;;;;OAKG;IACH,4CAKC;IAvJD;;;;;OAKG;IACH,wBALW,YAAY,EAAE,YACd,oBAAoB,cACpB,cAAc,YACd,YAAY,EAgBtB;IAlED;;;OAGG;IACH,yBAHU,MAAM,CAGkD;IAClE;;;OAGG;IACH,uBAFU,QAAQ,EAAE,CAEJ;IAUhB;;;OAGG;IACH,wBAHW,SAAS,GAAG,OAAO,GAAG,UAAU,CAGnB;IACxB;;;OAGG;IACH,sBAAkB;IAClB;;;OAGG;IACH,uBAAgE;IAChE;;;;OAIG;IACH,8BAHU,QAAQ,CAGA;IAElB;;;OAGG;IACH,sBAAqB;IAkCrB;;;OAGG;IACH,kCAQC;IAED;;OAEG;IACH,kBAFa,oBAAoB,EAAE,CAYlC;IAED,+BAIC;IAED,2BAEC;IAED;;;MAKC;IAED;;;OAGG;IACH,uBAEC;IAED;;OAEG;IACH,iBAFa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAO7C;IAED,eAEC;IASD;;OAEG;IACH,iBAFW,MAAM,EAKhB;IAbD;;OAEG;IACH,aAFa,MAAM,CAIlB;IAUD,uBAEC;IAmCD,0BAGC;IAED;;OAEG;IACH,iCAFW,OAAO,GAAC,UAAU,QAK5B;IAED,uBAKC;;CACF;0CAG2F,yCAAyC;0BAE5F,qCAAqC;2CAEd,wCAAwC;8BAH3E,4CAA4C;yBAnRhD,4CAA4C;0CAsRL,wCAAwC;kCADpD,2BAA2B;oCADtC,qCAAqC;kCAFc,yCAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"date-input.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/date-input.js"],"names":[],"mappings":"AAEA;CAOC;iCATgC,qDAAqD"}
1
+ {"version":3,"file":"date-input.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/date-input.js"],"names":[],"mappings":"AAIA;CAWC;iCAdgC,qDAAqD"}
@@ -1 +1 @@
1
- {"version":3,"file":"email-address.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/email-address.js"],"names":[],"mappings":"AAEA;CAGC;yBALwB,4CAA4C"}
1
+ {"version":3,"file":"email-address.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/email-address.js"],"names":[],"mappings":"AAIA;CAOC;yBATwB,4CAA4C"}
@@ -6,6 +6,7 @@ export class FieldsetQuestion extends Question {
6
6
  get renderInput(): {
7
7
  id: string;
8
8
  name: string;
9
+ content?: string | undefined;
9
10
  label?: import("./types.js").DefaultComponent | undefined;
10
11
  hint: import("./types.js").DefaultComponent;
11
12
  fieldset: import("./types.js").GovukFieldset;
@@ -17,6 +18,7 @@ export class FieldsetQuestion extends Question {
17
18
  };
18
19
  } | undefined;
19
20
  type?: "text" | "number" | "boolean" | undefined;
21
+ classes?: string | undefined;
20
22
  };
21
23
  }
22
24
  import { Question } from '../../../form/form-editor/preview/question.js';