@astl/astrolabe 0.0.0-stage → 0.1.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.
Files changed (188) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/LICENSE +202 -0
  3. package/README.md +64 -2
  4. package/dist/cdn/astrolabe-editor.js +1441 -0
  5. package/dist/cdn/astrolabe-editor.js.map +1 -0
  6. package/dist/cdn/astrolabe-player.js +2 -0
  7. package/dist/cdn/astrolabe-player.js.map +1 -0
  8. package/dist/cdn/astrolabe.css +238 -0
  9. package/dist/cdn/astrolabe.js +3 -0
  10. package/dist/cdn/astrolabe.js.map +1 -0
  11. package/dist/cdn/astrolabe.standalone.js +8007 -0
  12. package/dist/cdn/chunks/audio-B0LSIn5N.js +48 -0
  13. package/dist/cdn/chunks/audio-B0LSIn5N.js.map +1 -0
  14. package/dist/cdn/chunks/audio-manifest-B9FWQzRy.js +2 -0
  15. package/dist/cdn/chunks/audio-manifest-B9FWQzRy.js.map +1 -0
  16. package/dist/cdn/chunks/block-styles-CKo9x7Vt.js +68 -0
  17. package/dist/cdn/chunks/block-styles-CKo9x7Vt.js.map +1 -0
  18. package/dist/cdn/chunks/book-CHzDDaim.js +15 -0
  19. package/dist/cdn/chunks/book-CHzDDaim.js.map +1 -0
  20. package/dist/cdn/chunks/callout-QFLFLPc5.js +49 -0
  21. package/dist/cdn/chunks/callout-QFLFLPc5.js.map +1 -0
  22. package/dist/cdn/chunks/callout-manifest-Cb12O4jl.js +2 -0
  23. package/dist/cdn/chunks/callout-manifest-Cb12O4jl.js.map +1 -0
  24. package/dist/cdn/chunks/categorise-BO2tNVJ3.js +203 -0
  25. package/dist/cdn/chunks/categorise-BO2tNVJ3.js.map +1 -0
  26. package/dist/cdn/chunks/categorise-manifest-C_hEDVYQ.js +2 -0
  27. package/dist/cdn/chunks/categorise-manifest-C_hEDVYQ.js.map +1 -0
  28. package/dist/cdn/chunks/chip-styles-Dme5daTO.js +77 -0
  29. package/dist/cdn/chunks/chip-styles-Dme5daTO.js.map +1 -0
  30. package/dist/cdn/chunks/choice-CExBvqKj.js +136 -0
  31. package/dist/cdn/chunks/choice-CExBvqKj.js.map +1 -0
  32. package/dist/cdn/chunks/choice-manifest-C-XahD7m.js +2 -0
  33. package/dist/cdn/chunks/choice-manifest-C-XahD7m.js.map +1 -0
  34. package/dist/cdn/chunks/color-control-Cl5cuMSO.js +91 -0
  35. package/dist/cdn/chunks/color-control-Cl5cuMSO.js.map +1 -0
  36. package/dist/cdn/chunks/crossword-Cb-a3Tjj.js +270 -0
  37. package/dist/cdn/chunks/crossword-Cb-a3Tjj.js.map +1 -0
  38. package/dist/cdn/chunks/crossword-manifest-2qlu7AYd.js +2 -0
  39. package/dist/cdn/chunks/crossword-manifest-2qlu7AYd.js.map +1 -0
  40. package/dist/cdn/chunks/declarations-BhqOz1ap.js +2 -0
  41. package/dist/cdn/chunks/declarations-BhqOz1ap.js.map +1 -0
  42. package/dist/cdn/chunks/definitions-CNX90WtL.js +6 -0
  43. package/dist/cdn/chunks/definitions-CNX90WtL.js.map +1 -0
  44. package/dist/cdn/chunks/directive-helpers-D7lOZKnB.js +14 -0
  45. package/dist/cdn/chunks/directive-helpers-D7lOZKnB.js.map +1 -0
  46. package/dist/cdn/chunks/drop-manifest-bzNOa5ks.js +2 -0
  47. package/dist/cdn/chunks/drop-manifest-bzNOa5ks.js.map +1 -0
  48. package/dist/cdn/chunks/drop-vRXndjHu.js +86 -0
  49. package/dist/cdn/chunks/drop-vRXndjHu.js.map +1 -0
  50. package/dist/cdn/chunks/flash-cards-0NrrKdrx.js +87 -0
  51. package/dist/cdn/chunks/flash-cards-0NrrKdrx.js.map +1 -0
  52. package/dist/cdn/chunks/flash-cards-manifest-B8nWXbRy.js +2 -0
  53. package/dist/cdn/chunks/flash-cards-manifest-B8nWXbRy.js.map +1 -0
  54. package/dist/cdn/chunks/gap-lor-khst.js +78 -0
  55. package/dist/cdn/chunks/gap-lor-khst.js.map +1 -0
  56. package/dist/cdn/chunks/gap-manifest-RSydA41N.js +2 -0
  57. package/dist/cdn/chunks/gap-manifest-RSydA41N.js.map +1 -0
  58. package/dist/cdn/chunks/help-C-woafz5.js +138 -0
  59. package/dist/cdn/chunks/help-C-woafz5.js.map +1 -0
  60. package/dist/cdn/chunks/help-form-DaC6KaFG.js +160 -0
  61. package/dist/cdn/chunks/help-form-DaC6KaFG.js.map +1 -0
  62. package/dist/cdn/chunks/hotspot-manifest-CNs1oiZ_.js +2 -0
  63. package/dist/cdn/chunks/hotspot-manifest-CNs1oiZ_.js.map +1 -0
  64. package/dist/cdn/chunks/hotspot-oel1Eelo.js +154 -0
  65. package/dist/cdn/chunks/hotspot-oel1Eelo.js.map +1 -0
  66. package/dist/cdn/chunks/image-drop-Dkprw0Kn.js +295 -0
  67. package/dist/cdn/chunks/image-drop-Dkprw0Kn.js.map +1 -0
  68. package/dist/cdn/chunks/image-drop-manifest-BZ6hCoAd.js +2 -0
  69. package/dist/cdn/chunks/image-drop-manifest-BZ6hCoAd.js.map +1 -0
  70. package/dist/cdn/chunks/image-label-Dm5shQSh.js +177 -0
  71. package/dist/cdn/chunks/image-label-Dm5shQSh.js.map +1 -0
  72. package/dist/cdn/chunks/image-label-manifest--1CLRJzd.js +2 -0
  73. package/dist/cdn/chunks/image-label-manifest--1CLRJzd.js.map +1 -0
  74. package/dist/cdn/chunks/inline-styles-CTgXWnHb.js +80 -0
  75. package/dist/cdn/chunks/inline-styles-CTgXWnHb.js.map +1 -0
  76. package/dist/cdn/chunks/insert-menu-LgrifBYT.js +80 -0
  77. package/dist/cdn/chunks/insert-menu-LgrifBYT.js.map +1 -0
  78. package/dist/cdn/chunks/issue-list-BgnXzXRM.js +51 -0
  79. package/dist/cdn/chunks/issue-list-BgnXzXRM.js.map +1 -0
  80. package/dist/cdn/chunks/keys-DU-Qknmz.js +2 -0
  81. package/dist/cdn/chunks/keys-DU-Qknmz.js.map +1 -0
  82. package/dist/cdn/chunks/live-jdiyYln2.js +7 -0
  83. package/dist/cdn/chunks/live-jdiyYln2.js.map +1 -0
  84. package/dist/cdn/chunks/long-answer-CtzClLAx.js +71 -0
  85. package/dist/cdn/chunks/long-answer-CtzClLAx.js.map +1 -0
  86. package/dist/cdn/chunks/long-answer-manifest-BYJpZRtB.js +2 -0
  87. package/dist/cdn/chunks/long-answer-manifest-BYJpZRtB.js.map +1 -0
  88. package/dist/cdn/chunks/mark-words-CpH3gTcX.js +131 -0
  89. package/dist/cdn/chunks/mark-words-CpH3gTcX.js.map +1 -0
  90. package/dist/cdn/chunks/mark-words-manifest-Cs2pXCEx.js +2 -0
  91. package/dist/cdn/chunks/mark-words-manifest-Cs2pXCEx.js.map +1 -0
  92. package/dist/cdn/chunks/match-DKE_4o-x.js +352 -0
  93. package/dist/cdn/chunks/match-DKE_4o-x.js.map +1 -0
  94. package/dist/cdn/chunks/match-manifest-D0UfoajU.js +2 -0
  95. package/dist/cdn/chunks/match-manifest-D0UfoajU.js.map +1 -0
  96. package/dist/cdn/chunks/memory-B6hSyHyz.js +187 -0
  97. package/dist/cdn/chunks/memory-B6hSyHyz.js.map +1 -0
  98. package/dist/cdn/chunks/memory-manifest-D1589iR0.js +2 -0
  99. package/dist/cdn/chunks/memory-manifest-D1589iR0.js.map +1 -0
  100. package/dist/cdn/chunks/menu-messages-Dx3jYUEp.js +2 -0
  101. package/dist/cdn/chunks/menu-messages-Dx3jYUEp.js.map +1 -0
  102. package/dist/cdn/chunks/messages-9xiYDvRT.js +2 -0
  103. package/dist/cdn/chunks/messages-9xiYDvRT.js.map +1 -0
  104. package/dist/cdn/chunks/option-styles-WKzjKmCH.js +50 -0
  105. package/dist/cdn/chunks/option-styles-WKzjKmCH.js.map +1 -0
  106. package/dist/cdn/chunks/order-BhG_6IC-.js +225 -0
  107. package/dist/cdn/chunks/order-BhG_6IC-.js.map +1 -0
  108. package/dist/cdn/chunks/order-manifest-J5IXN0he.js +2 -0
  109. package/dist/cdn/chunks/order-manifest-J5IXN0he.js.map +1 -0
  110. package/dist/cdn/chunks/pick-and-place-DVQIPYuL.js +2 -0
  111. package/dist/cdn/chunks/pick-and-place-DVQIPYuL.js.map +1 -0
  112. package/dist/cdn/chunks/picture-D10YRMYH.js +2 -0
  113. package/dist/cdn/chunks/picture-D10YRMYH.js.map +1 -0
  114. package/dist/cdn/chunks/picture-view-BKnAyScQ.js +92 -0
  115. package/dist/cdn/chunks/picture-view-BKnAyScQ.js.map +1 -0
  116. package/dist/cdn/chunks/repeat-CY2W2URZ.js +8 -0
  117. package/dist/cdn/chunks/repeat-CY2W2URZ.js.map +1 -0
  118. package/dist/cdn/chunks/roving-focus-BxGgi2DD.js +2 -0
  119. package/dist/cdn/chunks/roving-focus-BxGgi2DD.js.map +1 -0
  120. package/dist/cdn/chunks/runtime-DxAbpr3S.js +526 -0
  121. package/dist/cdn/chunks/runtime-DxAbpr3S.js.map +1 -0
  122. package/dist/cdn/chunks/scan-jWgPnVxA.js +2 -0
  123. package/dist/cdn/chunks/scan-jWgPnVxA.js.map +1 -0
  124. package/dist/cdn/chunks/select-DTA3dJzr.js +345 -0
  125. package/dist/cdn/chunks/select-DTA3dJzr.js.map +1 -0
  126. package/dist/cdn/chunks/select-manifest-BBMbvdkH.js +2 -0
  127. package/dist/cdn/chunks/select-manifest-BBMbvdkH.js.map +1 -0
  128. package/dist/cdn/chunks/source-view-DXKPFCl9.js +29 -0
  129. package/dist/cdn/chunks/source-view-DXKPFCl9.js.map +1 -0
  130. package/dist/cdn/chunks/style-form-D5haJtWM.js +240 -0
  131. package/dist/cdn/chunks/style-form-D5haJtWM.js.map +1 -0
  132. package/dist/cdn/chunks/style-messages-BbZpeD2a.js +2 -0
  133. package/dist/cdn/chunks/style-messages-BbZpeD2a.js.map +1 -0
  134. package/dist/cdn/chunks/style-model-ZXNe_c8R.js +2 -0
  135. package/dist/cdn/chunks/style-model-ZXNe_c8R.js.map +1 -0
  136. package/dist/cdn/chunks/style-placing-DPw1zyrz.js +2 -0
  137. package/dist/cdn/chunks/style-placing-DPw1zyrz.js.map +1 -0
  138. package/dist/cdn/chunks/style-popups-BobgX1WK.js +74 -0
  139. package/dist/cdn/chunks/style-popups-BobgX1WK.js.map +1 -0
  140. package/dist/cdn/chunks/style-rules-D45PZLCv.js +136 -0
  141. package/dist/cdn/chunks/style-rules-D45PZLCv.js.map +1 -0
  142. package/dist/cdn/chunks/styled-Dmx5Yjv7.js +57 -0
  143. package/dist/cdn/chunks/styled-Dmx5Yjv7.js.map +1 -0
  144. package/dist/cdn/chunks/styles-DxJJxVNH.js +136 -0
  145. package/dist/cdn/chunks/styles-DxJJxVNH.js.map +1 -0
  146. package/dist/cdn/chunks/surface-CgxfAwCR.js +1019 -0
  147. package/dist/cdn/chunks/surface-CgxfAwCR.js.map +1 -0
  148. package/dist/cdn/chunks/true-false-DP3MO599.js +146 -0
  149. package/dist/cdn/chunks/true-false-DP3MO599.js.map +1 -0
  150. package/dist/cdn/chunks/true-false-manifest-B4exv60u.js +2 -0
  151. package/dist/cdn/chunks/true-false-manifest-B4exv60u.js.map +1 -0
  152. package/dist/cdn/chunks/video-j9MCH6Kw.js +98 -0
  153. package/dist/cdn/chunks/video-j9MCH6Kw.js.map +1 -0
  154. package/dist/cdn/chunks/video-manifest-8OwkhhAI.js +2 -0
  155. package/dist/cdn/chunks/video-manifest-8OwkhhAI.js.map +1 -0
  156. package/dist/cdn/chunks/word-bank-ARjwUKZf.js +80 -0
  157. package/dist/cdn/chunks/word-bank-ARjwUKZf.js.map +1 -0
  158. package/dist/cdn/chunks/word-bank-manifest-C1FSo1kH.js +2 -0
  159. package/dist/cdn/chunks/word-bank-manifest-C1FSo1kH.js.map +1 -0
  160. package/dist/cdn/chunks/word-search-AHvM7yCJ.js +274 -0
  161. package/dist/cdn/chunks/word-search-AHvM7yCJ.js.map +1 -0
  162. package/dist/cdn/chunks/word-search-manifest-Fg1a59Z1.js +2 -0
  163. package/dist/cdn/chunks/word-search-manifest-Fg1a59Z1.js.map +1 -0
  164. package/dist/editor.d.ts +32 -0
  165. package/dist/editor.d.ts.map +1 -0
  166. package/dist/editor.js +51 -0
  167. package/dist/editor.js.map +1 -0
  168. package/dist/engine.d.ts +33 -0
  169. package/dist/engine.d.ts.map +1 -0
  170. package/dist/engine.js +53 -0
  171. package/dist/engine.js.map +1 -0
  172. package/dist/player.d.ts +19 -0
  173. package/dist/player.d.ts.map +1 -0
  174. package/dist/player.js +22 -0
  175. package/dist/player.js.map +1 -0
  176. package/dist/server.d.ts +8 -0
  177. package/dist/server.d.ts.map +1 -0
  178. package/dist/server.js +8 -0
  179. package/dist/server.js.map +1 -0
  180. package/package.json +70 -3
  181. package/src/bundles/astrolabe-editor.ts +11 -0
  182. package/src/bundles/astrolabe-player.ts +10 -0
  183. package/src/bundles/astrolabe-standalone.ts +23 -0
  184. package/src/bundles/astrolabe.ts +12 -0
  185. package/src/editor.ts +98 -0
  186. package/src/engine.ts +59 -0
  187. package/src/player.ts +23 -0
  188. package/src/server.ts +7 -0
@@ -0,0 +1,48 @@
1
+ import{C as e,E as t,b as n,n as r,v as i,y as a}from"./runtime-DxAbpr3S.js";import{n as o,r as s,t as c}from"./audio-manifest-B9FWQzRy.js";import{t as l}from"./block-styles-CKo9x7Vt.js";var u=`astl.audio`,d=[{namespace:u,locale:`en`,messages:o},{namespace:u,locale:`pl`,messages:c}],f=class extends r{static manifest=s;static messages=d;static shadowRootOptions={...a.shadowRootOptions,slotAssignment:`manual`};static styles=[t`
2
+ .title {
3
+ margin-block: 0 var(--astl-space-2);
4
+ font-weight: 600;
5
+ }
6
+ audio {
7
+ display: block;
8
+ box-sizing: border-box;
9
+ inline-size: 100%;
10
+ border: var(--astl-outline-width) solid var(--astl-outline);
11
+ border-radius: 2rem;
12
+ background: var(--astl-surface-raised);
13
+ }
14
+ audio::-webkit-media-controls-panel {
15
+ background-color: var(--astl-surface-raised);
16
+ }
17
+ details {
18
+ margin-block-start: var(--astl-space-2);
19
+ }
20
+ summary {
21
+ padding-block: calc((var(--astl-target-min) - 1lh) / 2);
22
+ font-size: var(--astl-size-ui);
23
+ font-weight: 600;
24
+ cursor: pointer;
25
+ }
26
+ .text {
27
+ margin-block-start: var(--astl-space-1);
28
+ padding-block: var(--astl-space-2);
29
+ padding-inline: var(--astl-space-4);
30
+ border-inline-start: var(--astl-outline-width) solid var(--astl-line);
31
+ white-space: pre-line;
32
+ overflow-wrap: anywhere;
33
+ }
34
+ `,l];get slotIds(){return[]}getAnswers(){return{}}setAnswers(){}units(){return{answered:0,total:0}}render(){let t=(this.stringAttribute(`label`)??``).trim(),r=Array.from(this.children).some(e=>e.localName===`astl-transcript`),a=this.uiLanguage;return e`<div part="audio">
35
+ ${t===``?n:e`<p class="title" part="title" id="title">${t}</p>`}
36
+ <audio
37
+ part="player"
38
+ controls
39
+ preload="metadata"
40
+ src=${i(this.stringAttribute(`src`)??void 0)}
41
+ aria-labelledby=${i(t===``?void 0:`title`)}
42
+ ></audio>
43
+ ${r?e`<details part="transcript">
44
+ <summary lang=${a.lang} dir=${a.dir}>${this.t(`ui.transcript`)}</summary>
45
+ <div class="text"><slot data-tag="astl-transcript"></slot></div>
46
+ </details>`:n}
47
+ </div>`}},p={manifest:s,element:f,messages:d};export{p as audioElement};
48
+ //# sourceMappingURL=audio-B0LSIn5N.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio-B0LSIn5N.js","names":["en","pl","LitElement","nothing","ifDefined","b","i$1","A","AstlElement","o","i","en_default","audioManifest","pl_default","blockStyles","namespace","audioUiMessages","AudioElement","label","transcript","child","ui","audioElement"],"sources":["../../../../components/src/audio/ui-messages.ts","../../../../components/src/audio/element.ts"],"sourcesContent":["import type { MessageCatalog } from '@astl/core';\nimport en from './messages/ui/en.json' with { type: 'json' };\nimport pl from './messages/ui/pl.json' with { type: 'json' };\n\nconst namespace = 'astl.audio';\n\n/**\n * The student strings (`ui.*`): the element's catalogs. A module of their own, because bundlers split by module: one\n * that also built `audioMessages` would put the authoring strings into the element's chunk.\n */\nexport const audioUiMessages: readonly MessageCatalog[] = [\n { namespace, locale: 'en', messages: en },\n { namespace, locale: 'pl', messages: pl },\n];\n","import type { Answers, ComponentManifest, MessageCatalog, Units } from '@astl/core';\nimport { AstlElement, type ElementRegistration } from '@astl/player';\nimport { type CSSResultGroup, css, html, LitElement, nothing, type TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { blockStyles } from '../block-styles.js';\nimport { audioManifest } from './manifest.js';\nimport { audioUiMessages } from './ui-messages.js';\n\n/**\n * `<astl-audio>`: the title, the browser's audio player, and the transcript (the view's `<astl-transcript>`, slotted\n * manually and never changed) in a disclosure under it, its lines as written. Nothing is answered or stored; a\n * handed-in attempt still plays.\n */\nexport class AudioElement extends AstlElement {\n static override manifest: ComponentManifest = audioManifest;\n static override messages: readonly MessageCatalog[] = audioUiMessages;\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n slotAssignment: 'manual',\n };\n\n static override styles: CSSResultGroup = [\n css`\n .title {\n margin-block: 0 var(--astl-space-2);\n font-weight: 600;\n }\n audio {\n display: block;\n box-sizing: border-box;\n inline-size: 100%;\n border: var(--astl-outline-width) solid var(--astl-outline);\n border-radius: 2rem;\n background: var(--astl-surface-raised);\n }\n audio::-webkit-media-controls-panel {\n background-color: var(--astl-surface-raised);\n }\n details {\n margin-block-start: var(--astl-space-2);\n }\n summary {\n padding-block: calc((var(--astl-target-min) - 1lh) / 2);\n font-size: var(--astl-size-ui);\n font-weight: 600;\n cursor: pointer;\n }\n .text {\n margin-block-start: var(--astl-space-1);\n padding-block: var(--astl-space-2);\n padding-inline: var(--astl-space-4);\n border-inline-start: var(--astl-outline-width) solid var(--astl-line);\n white-space: pre-line;\n overflow-wrap: anywhere;\n }\n `,\n blockStyles,\n ];\n\n get slotIds(): readonly string[] {\n return [];\n }\n\n getAnswers(): Answers {\n return {};\n }\n\n setAnswers(): void {}\n\n units(): Units {\n return { answered: 0, total: 0 };\n }\n\n protected override render(): TemplateResult {\n const label = (this.stringAttribute('label') ?? '').trim();\n const transcript = Array.from(this.children).some((child) => child.localName === 'astl-transcript');\n const ui = this.uiLanguage;\n return html`<div part=\"audio\">\n ${label === '' ? nothing : html`<p class=\"title\" part=\"title\" id=\"title\">${label}</p>`}\n <audio\n part=\"player\"\n controls\n preload=\"metadata\"\n src=${ifDefined(this.stringAttribute('src') ?? undefined)}\n aria-labelledby=${ifDefined(label === '' ? undefined : 'title')}\n ></audio>\n ${\n transcript\n ? html`<details part=\"transcript\">\n <summary lang=${ui.lang} dir=${ui.dir}>${this.t('ui.transcript')}</summary>\n <div class=\"text\"><slot data-tag=\"astl-transcript\"></slot></div>\n </details>`\n : nothing\n }\n </div>`;\n }\n}\n\nexport const audioElement: ElementRegistration = {\n manifest: audioManifest,\n element: AudioElement,\n messages: audioUiMessages,\n};\n"],"mappings":"A,2LAIA,IAAMe,EAAY,aAMLC,EAA6C,CACxD,CAAE,YAAW,OAAQ,KAAM,SAAUhB,CAAG,EACxC,CAAE,YAAW,OAAQ,KAAM,SAAUC,CAAG,CAC1C,ECAagB,EAAb,cAAkCT,CAAY,CAC5C,OAAgB,SAA8BI,EAC9C,OAAgB,SAAsCI,EACtD,OAAgB,kBAAoC,CAClD,GAAGd,EAAW,kBACd,eAAgB,QAClB,EAEA,OAAgB,OAAyB,CACvC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCHY,CAAA,EAGF,IAAI,SAA6B,CAC/B,MAAO,CAAC,CACV,CAEA,YAAsB,CACpB,MAAO,CAAC,CACV,CAEA,YAAmB,CAAC,CAEpB,OAAe,CACb,MAAO,CAAE,SAAU,EAAG,MAAO,CAAE,CACjC,CAEA,QAA4C,CAC1C,IAAMI,GAAS,KAAK,gBAAgB,OAAO,GAAK,GAAA,CAAI,KAAK,EACnDC,EAAa,MAAM,KAAK,KAAK,QAAQ,CAAC,CAAC,KAAM,GAAUC,EAAM,YAAc,iBAAiB,EAC5FC,EAAK,KAAK,WAChB,MAAO,EAAI;QACPH,IAAU,GAAKf,EAAU,CAAI,4CAA4Ce,EAAM,MAAM;;;;;cAK/Ed,EAAU,KAAK,gBAAgB,KAAK,GAAK,IAAA,EAAS,EAAE;0BACxCA,EAAUc,IAAU,GAAK,IAAA,GAAY,OAAO,EAAE;;QAGhEC,EACI,CAAI;8BACcE,EAAG,KAAK,OAAOA,EAAG,IAAI,GAAG,KAAK,EAAE,eAAe,EAAE;;wBAGnElB,EACL;WAEL,CACF,EAEamB,EAAoC,CAC/C,SAAUV,EACV,QAASK,EACT,SAAUD,CACZ,E"}
@@ -0,0 +1,2 @@
1
+ var e={tag:`astl-audio`,version:1,display:`block`,graded:!1,attributes:[{name:`label`,type:`string`,visibility:`public`},{name:`src`,type:`url`,visibility:`public`,required:!0}],children:[{tag:`astl-transcript`,visibility:`public`,content:`text`,min:0,max:1,attributes:[]}],scoring:null,variants:null,slotKinds:[],issues:[`AUDIO_TRANSCRIPT_EMPTY`],messages:`astl.audio`,a11y:{pattern:`the browser's audio player, labelled by the title; the transcript is a native disclosure (details and summary)`,keys:[`Tab`,`Enter`,`Space`]},cssParts:[`audio`,`title`,`player`,`transcript`]},t={"ui.transcript":`Transcript`},n={"ui.transcript":`Transkrypcja`};export{t as n,e as r,n as t};
2
+ //# sourceMappingURL=audio-manifest-B9FWQzRy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio-manifest-B9FWQzRy.js","names":["audioManifest","en_default","pl_default"],"sources":["../../../../components/src/audio/manifest.ts","../../../../components/src/audio/messages/ui/en.json","../../../../components/src/audio/messages/ui/pl.json"],"sourcesContent":["import type { ComponentManifest } from '@astl/core';\n\n/**\n * A sound between paragraphs in the browser's own player, with an optional title and an optional transcript that\n * the student opens under it, its lines as written. Nothing is graded or stored. Under a Content Security Policy, the\n * file's host needs `media-src`.\n */\nexport const audioManifest: ComponentManifest = {\n tag: 'astl-audio',\n version: 1,\n display: 'block',\n graded: false,\n attributes: [\n /** The title, shown above the player: it also names the player. */\n { name: 'label', type: 'string', visibility: 'public' },\n /** The sound file, in a format browsers play (mp3 plays in all of them). Before Play only its metadata loads. */\n { name: 'src', type: 'url', visibility: 'public', required: true },\n ],\n children: [\n /** What is said, as plain text: each line stays a line (one per speaker, say). Closed until the student opens it. */\n { tag: 'astl-transcript', visibility: 'public', content: 'text', min: 0, max: 1, attributes: [] },\n ],\n scoring: null,\n variants: null,\n slotKinds: [],\n issues: ['AUDIO_TRANSCRIPT_EMPTY'],\n messages: 'astl.audio',\n a11y: {\n pattern:\n \"the browser's audio player, labelled by the title; the transcript is a native disclosure (details and summary)\",\n keys: ['Tab', 'Enter', 'Space'],\n },\n cssParts: ['audio', 'title', 'player', 'transcript'],\n};\n","{\n \"ui.transcript\": \"Transcript\"\n}\n","{\n \"ui.transcript\": \"Transkrypcja\"\n}\n"],"mappings":"AAOA,IAAaA,EAAmC,CAC9C,IAAK,aACL,QAAS,EACT,QAAS,QACT,OAAQ,GACR,WAAY,CAEV,CAAE,KAAM,QAAS,KAAM,SAAU,WAAY,QAAS,EAEtD,CAAE,KAAM,MAAO,KAAM,MAAO,WAAY,SAAU,SAAU,EAAK,CACnE,EACA,SAAU,CAER,CAAE,IAAK,kBAAmB,WAAY,SAAU,QAAS,OAAQ,IAAK,EAAG,IAAK,EAAG,WAAY,CAAC,CAAE,CAClG,EACA,QAAS,KACT,SAAU,KACV,UAAW,CAAC,EACZ,OAAQ,CAAC,wBAAwB,EACjC,SAAU,aACV,KAAM,CACJ,QACE,iHACF,KAAM,CAAC,MAAO,QAAS,OAAO,CAChC,EACA,SAAU,CAAC,QAAS,QAAS,SAAU,YAAY,CACrD,E"}
@@ -0,0 +1,68 @@
1
+ import{E as e,_ as t,g as n}from"./runtime-DxAbpr3S.js";var r=[t,n,e`
2
+ :host([hidden]) {
3
+ display: none;
4
+ }
5
+ :focus-visible:not(.astl-ring *),
6
+ .astl-ring:has(:focus-visible) {
7
+ outline: var(--astl-focus-width) solid var(--astl-focus);
8
+ outline-offset: var(--astl-focus-offset);
9
+ }
10
+ .astl-ring :focus-visible {
11
+ outline: none;
12
+ }
13
+ .astl-box[data-verdict] {
14
+ border-color: var(--astl-verdict-color);
15
+ border-style: var(--astl-verdict-border);
16
+ background: var(--astl-verdict-soft);
17
+ }
18
+ `,e`
19
+ :host {
20
+ display: block;
21
+ margin-block: 0 var(--astl-space-5);
22
+ }
23
+ fieldset {
24
+ min-inline-size: 0;
25
+ margin: 0;
26
+ padding: 0;
27
+ border: 0;
28
+ }
29
+ legend {
30
+ margin-block-end: var(--astl-space-3);
31
+ padding: 0;
32
+ font-weight: 600;
33
+ }
34
+ legend > .hint {
35
+ display: block;
36
+ margin-block-start: var(--astl-space-1);
37
+ color: var(--astl-ink-muted);
38
+ font-family: var(--astl-font-body);
39
+ font-size: var(--astl-size-ui);
40
+ font-weight: 400;
41
+ }
42
+ .group-verdict {
43
+ padding-block: var(--astl-space-1);
44
+ padding-inline: var(--astl-space-3);
45
+ border-inline-start: var(--astl-focus-width) var(--astl-verdict-border) var(--astl-verdict-color);
46
+ }
47
+ `,e`
48
+ :where(.astl-solution) {
49
+ margin: 0;
50
+ }
51
+ .astl-solution {
52
+ color: var(--astl-ink);
53
+ font-size: var(--astl-size-ui);
54
+ font-weight: 600;
55
+ line-height: 1.4;
56
+ overflow-wrap: anywhere;
57
+ hyphens: auto;
58
+ }
59
+ .astl-solution > .astl-verdict-icon {
60
+ margin-inline-end: var(--astl-space-1);
61
+ color: var(--astl-success);
62
+ vertical-align: -0.2em;
63
+ }
64
+ .astl-solution-label {
65
+ color: var(--astl-success);
66
+ }
67
+ `];export{r as t};
68
+ //# sourceMappingURL=block-styles-CKo9x7Vt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-styles-CKo9x7Vt.js","names":["i","visuallyHidden","verdictStyles","blockStyles"],"sources":["../../../../components/src/block-styles.ts"],"sourcesContent":["/**\n * Shared CSS of the built-in question blocks (`display: 'block'`); fields in running text take `inline-styles.ts`.\n * Built-ins only: it loads with the element chunks, never with the player (other elements take `verdictStyles` and\n * `visuallyHidden` from `@astl/player`). One file per kind, neither importing the other, so each element loads\n * one shared chunk holding only rules it uses (the element budget counts that chunk for every element).\n *\n * An element lists these after its own rules: its own rules never restate them, and the verdict on a box wins over\n * the element's own states of the same specificity (selected, picked up). To refine one, use a more specific selector.\n */\nimport { verdictStyles, visuallyHidden } from '@astl/player';\nimport { type CSSResultGroup, css } from 'lit';\n\nexport const blockStyles: CSSResultGroup = [\n visuallyHidden,\n verdictStyles,\n // `hidden` hides the element and whatever takes focus shows the focus ring. Two classes for the element's boxes:\n // `astl-ring` draws the ring of the control inside the box instead of the control's own (a radio in its option, a\n // button in its card), and `astl-box` shows the box's `data-verdict` in its border (colour and style) and its fill\n // (the verdict's soft colour: the same rule in every type, the fields in running text included). The verdict's fill\n // replaces a pick's or a group's.\n css`\n :host([hidden]) {\n display: none;\n }\n :focus-visible:not(.astl-ring *),\n .astl-ring:has(:focus-visible) {\n outline: var(--astl-focus-width) solid var(--astl-focus);\n outline-offset: var(--astl-focus-offset);\n }\n .astl-ring :focus-visible {\n outline: none;\n }\n .astl-box[data-verdict] {\n border-color: var(--astl-verdict-color);\n border-style: var(--astl-verdict-border);\n background: var(--astl-verdict-soft);\n }\n `,\n // A fieldset whose legend holds the prompt and a hint, and the group verdict line at its end. The hint is read by\n // young students: UI size, never smaller, and on the body face whatever face a look gives the prompt. Where the\n // verdict line sits (its margins) is the element's own.\n css`\n :host {\n display: block;\n margin-block: 0 var(--astl-space-5);\n }\n fieldset {\n min-inline-size: 0;\n margin: 0;\n padding: 0;\n border: 0;\n }\n legend {\n margin-block-end: var(--astl-space-3);\n padding: 0;\n font-weight: 600;\n }\n legend > .hint {\n display: block;\n margin-block-start: var(--astl-space-1);\n color: var(--astl-ink-muted);\n font-family: var(--astl-font-body);\n font-size: var(--astl-size-ui);\n font-weight: 400;\n }\n .group-verdict {\n padding-block: var(--astl-space-1);\n padding-inline: var(--astl-space-3);\n border-inline-start: var(--astl-focus-width) var(--astl-verdict-border) var(--astl-verdict-color);\n }\n `,\n // The \"correct answer\" line, alike in every type: the tick and its label in the success colour, the answer in ink,\n // at UI size; a long answer hyphenates in its own language. Where it sits is the element's own (the margin reset\n // has no specificity, so an element's own margins win).\n css`\n :where(.astl-solution) {\n margin: 0;\n }\n .astl-solution {\n color: var(--astl-ink);\n font-size: var(--astl-size-ui);\n font-weight: 600;\n line-height: 1.4;\n overflow-wrap: anywhere;\n hyphens: auto;\n }\n .astl-solution > .astl-verdict-icon {\n margin-inline-end: var(--astl-space-1);\n color: var(--astl-success);\n vertical-align: -0.2em;\n }\n .astl-solution-label {\n color: var(--astl-success);\n }\n `,\n];\n"],"mappings":"A,wDAYA,IAAaG,EAA8B,CACzCF,EACAC,EAMA,CAAG;;;;;;;;;;;;;;;;;EAqBH,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCH,CAAG;;;;;;;;;;;;;;;;;;;;CAqBL,E"}
@@ -0,0 +1,15 @@
1
+ import{E as e}from"./runtime-DxAbpr3S.js";var t=56,n=240,r=1.5,i=e`
2
+ .root[data-spread] > * {
3
+ max-inline-size: 1240px;
4
+ }
5
+ .root[data-spread] astl-doc {
6
+ display: grid;
7
+ grid-template-columns: repeat(2, minmax(0, 1fr));
8
+ column-gap: var(--astl-space-5);
9
+ }
10
+ .root[data-spread] astl-doc > astl-page:not([hidden]) + astl-page:not([hidden]) {
11
+ border-inline-start: var(--astl-outline-width) solid var(--astl-line);
12
+ padding-inline-start: var(--astl-space-5);
13
+ }
14
+ `.styleSheet;function a(e){i!==void 0&&e instanceof ShadowRoot&&!e.adoptedStyleSheets.includes(i)&&(e.adoptedStyleSheets=[...e.adoptedStyleSheets,i])}function o(e,n){let r=e=>{n(e>=t*(Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16))},i=new ResizeObserver(([e])=>{e!==void 0&&r(e.contentRect.width)});return i.observe(e),r(e.clientWidth),i}function s(e,t,i){if(matchMedia(`(prefers-reduced-motion: reduce), (forced-colors: active)`).matches)return;let a=`translateX(${(i?-t:t)*r}rem)`;for(let t of e)t.animate([{opacity:0,transform:a},{opacity:1,transform:`none`}],{duration:n,easing:`ease-out`})}export{a as adoptBookSheet,s as turn,o as watchSpread};
15
+ //# sourceMappingURL=book-CHzDDaim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"book-CHzDDaim.js","names":["i","SPREAD_MIN_REM","TURN_MS","TURN_DISTANCE_REM","bookSheet","adoptBookSheet","root","watchSpread","measure","spread","width","observer","entry","host","turn","offset","rtl","direction","page","pages"],"sources":["../../../../player/src/player/book.ts"],"sourcesContent":["/**\n * A book (`kind=\"book\"`) in the player, in a module of its own: a view that is no book never loads it. It says when the\n * player is wide enough for a spread, two pages side by side, draws the spread and slides the pages of a new one in.\n * Without it (or when its chunk fails) a book plays one page at a time, as an exercise.\n */\nimport { css } from 'lit';\n\n/** Narrowest player (rem) that shows a book a spread at a time; narrower, one page at a time. */\nconst SPREAD_MIN_REM = 56;\n/** A spread's turn: its pages come in from the side of travel. */\nconst TURN_MS = 240;\nconst TURN_DISTANCE_REM = 1.5;\n\n/** A spread: two pages side by side (the first on the start side), a line between them as the spine. */\nconst bookSheet = css`\n .root[data-spread] > * {\n max-inline-size: 1240px;\n }\n .root[data-spread] astl-doc {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n column-gap: var(--astl-space-5);\n }\n .root[data-spread] astl-doc > astl-page:not([hidden]) + astl-page:not([hidden]) {\n border-inline-start: var(--astl-outline-width) solid var(--astl-line);\n padding-inline-start: var(--astl-space-5);\n }\n`.styleSheet;\n\n/** Adopts the stylesheet of spreads in a player's root, once. */\nexport function adoptBookSheet(root: Node): void {\n if (bookSheet !== undefined && root instanceof ShadowRoot && !root.adoptedStyleSheets.includes(bookSheet)) {\n root.adoptedStyleSheets = [...root.adoptedStyleSheets, bookSheet];\n }\n}\n\n/**\n * Tells `spread` whether `host` is wide enough for a spread (in the root font size), now and on every resize. The\n * observer is the caller's to disconnect, and to observe `host` again when it is connected again.\n */\nexport function watchSpread(host: HTMLElement, spread: (wide: boolean) => void): ResizeObserver {\n const measure = (width: number) => {\n const rem = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n spread(width >= SPREAD_MIN_REM * rem);\n };\n const observer = new ResizeObserver(([entry]) => {\n if (entry !== undefined) measure(entry.contentRect.width);\n });\n observer.observe(host);\n measure(host.clientWidth);\n return observer;\n}\n\n/**\n * The pages of a new spread come in from the side of travel (`direction` 1 forwards, mirrored right to left); they just\n * appear with reduced motion or forced colours.\n */\nexport function turn(pages: readonly HTMLElement[], direction: 1 | -1, rtl: boolean): void {\n if (matchMedia('(prefers-reduced-motion: reduce), (forced-colors: active)').matches) return;\n const offset = `translateX(${(rtl ? -direction : direction) * TURN_DISTANCE_REM}rem)`;\n for (const page of pages) {\n page.animate(\n [\n { opacity: 0, transform: offset },\n { opacity: 1, transform: 'none' },\n ],\n { duration: TURN_MS, easing: 'ease-out' },\n );\n }\n}\n"],"mappings":"A,0CAQA,IAAMC,EAAiB,GAEjBC,EAAU,IACVC,EAAoB,IAGpBC,EAAY,CAAG;;;;;;;;;;;;;EAanB,WAGF,SAAgBC,EAAe,EAAkB,CAC3CD,IAAc,IAAA,IAAaE,aAAgB,YAAc,CAACA,EAAK,mBAAmB,SAASF,CAAS,IACtG,EAAK,mBAAqB,CAAC,GAAGE,EAAK,mBAAoBF,CAAS,EAEpE,CAMA,SAAgBG,EAAY,EAAmB,EAAiD,CAC9F,IAAMC,EAAW,GAAkB,CAEjCC,EAAOC,GAAST,GADJ,OAAO,WAAW,iBAAiB,SAAS,eAAe,CAAC,CAAC,QAAQ,GAAK,GAClD,CACtC,EACMU,EAAW,IAAI,gBAAgB,CAACC,KAAW,CAC3CA,IAAU,IAAA,IAAWJ,EAAQI,EAAM,YAAY,KAAK,CAC1D,CAAC,EAGD,OAFAD,EAAS,QAAQE,CAAI,EACrBL,EAAQK,EAAK,WAAW,EACjBF,CACT,CAMA,SAAgBG,EAAK,EAA+B,EAAmB,EAAoB,CACzF,GAAI,WAAW,2DAA2D,CAAC,CAAC,QAAS,OACrF,IAAMC,EAAS,eAAeC,EAAM,CAACC,EAAYA,GAAad,EAAkB,MAChF,IAAK,IAAMe,KAAQC,EACjBD,EAAK,QACH,CACE,CAAE,QAAS,EAAG,UAAWH,CAAO,EAChC,CAAE,QAAS,EAAG,UAAW,MAAO,CAClC,EACA,CAAE,SAAUb,EAAS,OAAQ,UAAW,CAC1C,CAEJ,C"}
@@ -0,0 +1,49 @@
1
+ import{C as e,E as t,T as n,n as r}from"./runtime-DxAbpr3S.js";import{n as i,r as a,t as o}from"./callout-manifest-Cb12O4jl.js";import{t as s}from"./block-styles-CKo9x7Vt.js";var c=`astl.callout`,l=[{namespace:c,locale:`en`,messages:i},{namespace:c,locale:`pl`,messages:o}],u={tip:n`<path d="M10 2.5a5.5 5.5 0 0 0-3.2 10V15h6.4v-2.5A5.5 5.5 0 0 0 10 2.5zM7.8 17.5h4.4" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`,info:n`<circle cx="10" cy="10" r="7.5" fill="none" stroke="currentColor" stroke-width="1.8"/><path d="M10 9v5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="10" cy="6.2" r="1.2" fill="currentColor"/>`,warning:n`<path d="M10 2.8 18 16.8H2z" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M10 8v4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="10" cy="14.4" r="1.1" fill="currentColor"/>`},d=class extends r{static manifest=a;static messages=l;static styles=[t`
2
+ :host {
3
+ --astl-callout: var(--astl-accent);
4
+ --astl-callout-soft: var(--astl-accent-soft);
5
+ }
6
+ :host([kind='tip']) {
7
+ --astl-callout: var(--astl-palette-3);
8
+ --astl-callout-soft: var(--astl-palette-3-soft);
9
+ }
10
+ :host([kind='warning']) {
11
+ --astl-callout: var(--astl-warning);
12
+ --astl-callout-soft: var(--astl-warning-soft);
13
+ }
14
+ .callout {
15
+ hyphens: auto;
16
+ padding: var(--astl-space-3) var(--astl-space-4);
17
+ border: var(--astl-outline-width) solid var(--astl-callout);
18
+ border-inline-start-width: var(--astl-space-2);
19
+ border-radius: var(--astl-radius-m);
20
+ background: var(--astl-callout-soft);
21
+ }
22
+ .head {
23
+ display: flex;
24
+ align-items: center;
25
+ gap: var(--astl-space-2);
26
+ margin-block: 0 var(--astl-space-2);
27
+ color: var(--astl-callout);
28
+ font-size: var(--astl-size-ui);
29
+ font-weight: 700;
30
+ }
31
+ .icon {
32
+ flex: none;
33
+ inline-size: 1.4em;
34
+ block-size: 1.4em;
35
+ }
36
+ ::slotted(:first-child) {
37
+ margin-block-start: 0 !important;
38
+ }
39
+ ::slotted(:last-child) {
40
+ margin-block-end: 0 !important;
41
+ }
42
+ `,s];get slotIds(){return[]}getAnswers(){return{}}setAnswers(){}units(){return{answered:0,total:0}}render(){let t=this.stringAttribute(`kind`)??`info`,n=this.uiLanguage;return e`<div class="callout" part="callout" role="note" aria-labelledby="label">
43
+ <p class="head">
44
+ <svg class="icon" part="icon" viewBox="0 0 20 20" aria-hidden="true" focusable="false">${u[t]}</svg>
45
+ <span id="label" part="label" lang=${n.lang} dir=${n.dir}>${this.t(`ui.kind.${t}`)}</span>
46
+ </p>
47
+ <div class="body" part="body"><slot></slot></div>
48
+ </div>`}},f={manifest:a,element:d,messages:l};export{f as calloutElement};
49
+ //# sourceMappingURL=callout-QFLFLPc5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callout-QFLFLPc5.js","names":["en","pl","b","i","w","AstlElement","en_default","calloutManifest","pl_default","blockStyles","namespace","calloutUiMessages","ICONS","CalloutElement","kind","ui","calloutElement"],"sources":["../../../../components/src/callout/ui-messages.ts","../../../../components/src/callout/element.ts"],"sourcesContent":["import type { MessageCatalog } from '@astl/core';\nimport en from './messages/ui/en.json' with { type: 'json' };\nimport pl from './messages/ui/pl.json' with { type: 'json' };\n\nconst namespace = 'astl.callout';\n\n/** The student strings (`ui.*`), for the element only: a module of their own keeps the authoring ones out of its chunk. */\nexport const calloutUiMessages: readonly MessageCatalog[] = [\n { namespace, locale: 'en', messages: en },\n { namespace, locale: 'pl', messages: pl },\n];\n","import type { Answers, ComponentManifest, MessageCatalog, Units } from '@astl/core';\nimport { AstlElement, type ElementRegistration } from '@astl/player';\nimport { type CSSResultGroup, css, html, svg, type TemplateResult } from 'lit';\nimport { blockStyles } from '../block-styles.js';\nimport { calloutManifest } from './manifest.js';\nimport { calloutUiMessages } from './ui-messages.js';\n\n/** An icon per kind (decorative: the label says the kind): a light bulb, an \"i\" in a circle, a \"!\" in a triangle. */\nconst ICONS: Readonly<Record<string, TemplateResult>> = {\n tip: svg`<path d=\"M10 2.5a5.5 5.5 0 0 0-3.2 10V15h6.4v-2.5A5.5 5.5 0 0 0 10 2.5zM7.8 17.5h4.4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`,\n info: svg`<circle cx=\"10\" cy=\"10\" r=\"7.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\"/><path d=\"M10 9v5\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/><circle cx=\"10\" cy=\"6.2\" r=\"1.2\" fill=\"currentColor\"/>`,\n warning: svg`<path d=\"M10 2.8 18 16.8H2z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linejoin=\"round\"/><path d=\"M10 8v4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/><circle cx=\"10\" cy=\"14.4\" r=\"1.1\" fill=\"currentColor\"/>`,\n};\n\n/**\n * `<astl-callout>`: a note beside the exercise. Its rich content is the light DOM, shown through a slot and styled by\n * the player like the page around it. A note (`role=\"note\"`: content aside from the main text), not a landmark\n * (`aside`): an exercise may hold several, and landmarks are for the page's regions. Named by its kind label, the text\n * shown next to the icon, so screen readers announce \"Tip, note\". Nothing to answer.\n */\nexport class CalloutElement extends AstlElement {\n static override manifest: ComponentManifest = calloutManifest;\n static override messages: readonly MessageCatalog[] = calloutUiMessages;\n\n // The kind's colour and fill (tokens that read as text on each other, and the ink on the fill). The content's own\n // margins come from the player's canvas, an outer scope that wins over ::slotted() unless the rule is important: the\n // box's padding is the space at its edges.\n static override styles: CSSResultGroup = [\n css`\n :host {\n --astl-callout: var(--astl-accent);\n --astl-callout-soft: var(--astl-accent-soft);\n }\n :host([kind='tip']) {\n --astl-callout: var(--astl-palette-3);\n --astl-callout-soft: var(--astl-palette-3-soft);\n }\n :host([kind='warning']) {\n --astl-callout: var(--astl-warning);\n --astl-callout-soft: var(--astl-warning-soft);\n }\n .callout {\n hyphens: auto;\n padding: var(--astl-space-3) var(--astl-space-4);\n border: var(--astl-outline-width) solid var(--astl-callout);\n border-inline-start-width: var(--astl-space-2);\n border-radius: var(--astl-radius-m);\n background: var(--astl-callout-soft);\n }\n .head {\n display: flex;\n align-items: center;\n gap: var(--astl-space-2);\n margin-block: 0 var(--astl-space-2);\n color: var(--astl-callout);\n font-size: var(--astl-size-ui);\n font-weight: 700;\n }\n .icon {\n flex: none;\n inline-size: 1.4em;\n block-size: 1.4em;\n }\n ::slotted(:first-child) {\n margin-block-start: 0 !important;\n }\n ::slotted(:last-child) {\n margin-block-end: 0 !important;\n }\n `,\n blockStyles,\n ];\n\n get slotIds(): readonly string[] {\n return [];\n }\n\n getAnswers(): Answers {\n return {};\n }\n\n setAnswers(): void {}\n\n units(): Units {\n return { answered: 0, total: 0 };\n }\n\n protected override render(): TemplateResult {\n const kind = this.stringAttribute('kind') ?? 'info';\n const ui = this.uiLanguage;\n return html`<div class=\"callout\" part=\"callout\" role=\"note\" aria-labelledby=\"label\">\n <p class=\"head\">\n <svg class=\"icon\" part=\"icon\" viewBox=\"0 0 20 20\" aria-hidden=\"true\" focusable=\"false\">${ICONS[kind]}</svg>\n <span id=\"label\" part=\"label\" lang=${ui.lang} dir=${ui.dir}>${this.t(`ui.kind.${kind}`)}</span>\n </p>\n <div class=\"body\" part=\"body\"><slot></slot></div>\n </div>`;\n }\n}\n\nexport const calloutElement: ElementRegistration = {\n manifest: calloutManifest,\n element: CalloutElement,\n messages: calloutUiMessages,\n};\n"],"mappings":"A,+KAIA,IAAMU,EAAY,eAGLC,EAA+C,CAC1D,CAAE,YAAW,OAAQ,KAAM,SAAUX,CAAG,EACxC,CAAE,YAAW,OAAQ,KAAM,SAAUC,CAAG,CAC1C,ECFMW,EAAkD,CACtD,IAAK,CAAG,8LACR,KAAM,CAAG,gOACT,QAAS,CAAG,qPACd,EAQaC,EAAb,cAAoCR,CAAY,CAC9C,OAAgB,SAA8BE,EAC9C,OAAgB,SAAsCI,EAKtD,OAAgB,OAAyB,CACvC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CHF,CAAA,EAGF,IAAI,SAA6B,CAC/B,MAAO,CAAC,CACV,CAEA,YAAsB,CACpB,MAAO,CAAC,CACV,CAEA,YAAmB,CAAC,CAEpB,OAAe,CACb,MAAO,CAAE,SAAU,EAAG,MAAO,CAAE,CACjC,CAEA,QAA4C,CAC1C,IAAMK,EAAO,KAAK,gBAAgB,MAAM,GAAK,OACvCC,EAAK,KAAK,WAChB,MAAO,EAAI;;iGAEkFH,EAAME,GAAM;6CAChEC,EAAG,KAAK,OAAOA,EAAG,IAAI,GAAG,KAAK,EAAE,WAAWD,GAAM,EAAE;;;WAI9F,CACF,EAEaE,EAAsC,CACjD,SAAUT,EACV,QAASM,EACT,SAAUF,CACZ,E"}
@@ -0,0 +1,2 @@
1
+ var e={tag:`astl-callout`,version:1,display:`block`,graded:!1,attributes:[{name:`kind`,type:`enum`,values:[`tip`,`info`,`warning`],default:`info`,visibility:`public`}],content:`flow`,children:[],scoring:null,variants:null,slotKinds:[],issues:[`CALLOUT_EMPTY`],messages:`astl.callout`,a11y:{pattern:`a note (role="note") named by its kind, which it shows as a label next to its icon; nothing to operate`,keys:[]},cssParts:[`callout`,`icon`,`label`,`body`]},t={"ui.kind.tip":`Tip`,"ui.kind.info":`Information`,"ui.kind.warning":`Warning`},n={"ui.kind.tip":`Wskazówka`,"ui.kind.info":`Informacja`,"ui.kind.warning":`Uwaga`};export{t as n,e as r,n as t};
2
+ //# sourceMappingURL=callout-manifest-Cb12O4jl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callout-manifest-Cb12O4jl.js","names":["calloutManifest","en_default","pl_default"],"sources":["../../../../components/src/callout/manifest.ts","../../../../components/src/callout/messages/ui/en.json","../../../../components/src/callout/messages/ui/pl.json"],"sourcesContent":["import type { ComponentManifest } from '@astl/core';\n\n/**\n * A note beside the exercise: a tip, information or a warning, with an icon and the kind as a label above its rich\n * content. Ungraded: no slots, nothing added to the maximum score.\n */\nexport const calloutManifest: ComponentManifest = {\n tag: 'astl-callout',\n version: 1,\n display: 'block',\n graded: false,\n attributes: [\n /** What the note is: its icon, its colour and the label a screen reader names it by. */\n { name: 'kind', type: 'enum', values: ['tip', 'info', 'warning'], default: 'info', visibility: 'public' },\n ],\n content: 'flow',\n children: [],\n scoring: null,\n variants: null,\n slotKinds: [],\n issues: ['CALLOUT_EMPTY'],\n messages: 'astl.callout',\n a11y: {\n pattern:\n 'a note (role=\"note\") named by its kind, which it shows as a label next to its icon; nothing to operate',\n keys: [],\n },\n cssParts: ['callout', 'icon', 'label', 'body'],\n};\n","{\n \"ui.kind.tip\": \"Tip\",\n \"ui.kind.info\": \"Information\",\n \"ui.kind.warning\": \"Warning\"\n}\n","{\n \"ui.kind.tip\": \"Wskazówka\",\n \"ui.kind.info\": \"Informacja\",\n \"ui.kind.warning\": \"Uwaga\"\n}\n"],"mappings":"AAMA,IAAaA,EAAqC,CAChD,IAAK,eACL,QAAS,EACT,QAAS,QACT,OAAQ,GACR,WAAY,CAEV,CAAE,KAAM,OAAQ,KAAM,OAAQ,OAAQ,CAAC,MAAO,OAAQ,SAAS,EAAG,QAAS,OAAQ,WAAY,QAAS,CAC1G,EACA,QAAS,OACT,SAAU,CAAC,EACX,QAAS,KACT,SAAU,KACV,UAAW,CAAC,EACZ,OAAQ,CAAC,eAAe,EACxB,SAAU,eACV,KAAM,CACJ,QACE,yGACF,KAAM,CAAC,CACT,EACA,SAAU,CAAC,UAAW,OAAQ,QAAS,MAAM,CAC/C,E"}
@@ -0,0 +1,203 @@
1
+ import{C as e,D as t,E as n,b as r,h as i,n as a,v as o,y as s}from"./runtime-DxAbpr3S.js";import{n as c,r as l,t as u}from"./categorise-manifest-C_hEDVYQ.js";import{t as d}from"./pick-and-place-DVQIPYuL.js";import{t as f}from"./block-styles-CKo9x7Vt.js";import{t as p}from"./repeat-CY2W2URZ.js";import{t as m}from"./chip-styles-Dme5daTO.js";var h=`astl.categorise`,g=[{namespace:h,locale:`en`,messages:c},{namespace:h,locale:`pl`,messages:u}],_=``,v=250,y=e`<svg class="move" viewBox="0 0 20 20" aria-hidden="true" focusable="false">
2
+ <path
3
+ d="M10 2.5v15M2.5 10h15M10 2.5 7.5 5M10 2.5 12.5 5M10 17.5 7.5 15M10 17.5 12.5 15M2.5 10 5 7.5M2.5 10 5 12.5M17.5 10 15 7.5M17.5 10 15 12.5"
4
+ fill="none"
5
+ stroke="currentColor"
6
+ stroke-width="2"
7
+ stroke-linecap="round"
8
+ stroke-linejoin="round"
9
+ />
10
+ </svg>`,b=e=>{let t=e?.cloneNode(!0);for(let e of t?.querySelectorAll(`img`)??[])e.replaceWith(` ${e.alt} `);return(t?.textContent??``).replace(/\s+/g,` `).trim()};function x(e){let t=Number(e.getAttribute(`palette`));return Number.isInteger(t)&&t>=1&&t<=8?t:null}var S=class extends a{static manifest=l;static messages=g;static shadowRootOptions={...s.shadowRootOptions,slotAssignment:`manual`};static properties={placed:{state:!0}};static styles=[n`
11
+ fieldset {
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: var(--astl-space-3);
15
+ }
16
+ .group-verdict {
17
+ margin-block: 0;
18
+ }
19
+ `,n`
20
+ .zone {
21
+ box-sizing: border-box;
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: var(--astl-space-2);
25
+ min-inline-size: 0;
26
+ padding: var(--astl-space-3);
27
+ border: var(--astl-outline-width) solid var(--astl-line);
28
+ border-radius: var(--astl-radius-l);
29
+ background: var(--astl-canvas);
30
+ touch-action: manipulation;
31
+ }
32
+ `,n`
33
+ .groups .zone {
34
+ border-color: var(--astl-group);
35
+ background: var(--astl-group-soft);
36
+ }
37
+ `,n`
38
+ .zone[data-target],
39
+ .zone[data-over] {
40
+ border-color: var(--astl-accent);
41
+ outline: var(--astl-outline-width) solid var(--astl-accent);
42
+ outline-offset: calc(-2 * var(--astl-outline-width));
43
+ background: var(--astl-accent-soft);
44
+ }
45
+ `,n`
46
+ fieldset[data-picking] .zone {
47
+ cursor: pointer;
48
+ }
49
+ `,n`
50
+ .groups {
51
+ display: grid;
52
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
53
+ gap: var(--astl-space-3);
54
+ }
55
+ .label {
56
+ font-size: var(--astl-size-ui);
57
+ font-weight: 600;
58
+ line-height: 1.4;
59
+ overflow-wrap: anywhere;
60
+ }
61
+ .note {
62
+ margin: 0;
63
+ color: var(--astl-ink-muted);
64
+ font-size: var(--astl-size-small);
65
+ }
66
+ .cards {
67
+ display: flex;
68
+ flex-wrap: wrap;
69
+ gap: var(--astl-space-2);
70
+ }
71
+ `,n`
72
+ .card {
73
+ box-sizing: border-box;
74
+ display: grid;
75
+ grid-template-columns: minmax(0, 1fr) auto;
76
+ grid-template-areas: 'button verdict' 'mark mark';
77
+ align-items: start;
78
+ }
79
+ .groups .card {
80
+ border-color: var(--astl-group);
81
+ }
82
+ .card[data-picked] .text {
83
+ font-weight: var(--astl-selected-weight);
84
+ }
85
+ .card:not([data-verdict]):has(.card-button:disabled) {
86
+ border-color: var(--astl-line);
87
+ }
88
+ .card-button {
89
+ grid-area: button;
90
+ }
91
+ .text {
92
+ min-inline-size: 0;
93
+ overflow-wrap: anywhere;
94
+ }
95
+ .card > .astl-verdict {
96
+ grid-area: verdict;
97
+ min-block-size: var(--astl-target-min);
98
+ padding-inline-end: var(--astl-space-3);
99
+ }
100
+ .mark-row {
101
+ grid-area: mark;
102
+ contain: inline-size;
103
+ padding-block-end: var(--astl-space-2);
104
+ padding-inline: var(--astl-space-3);
105
+ }
106
+ .card:has(> .mark-row) {
107
+ min-inline-size: min(100%, 11rem);
108
+ }
109
+ .drop {
110
+ box-sizing: border-box;
111
+ min-inline-size: var(--astl-target-min);
112
+ min-block-size: var(--astl-target-min);
113
+ margin: 0;
114
+ padding-block: var(--astl-space-2);
115
+ padding-inline: var(--astl-space-4);
116
+ border: var(--astl-outline-width) solid var(--astl-accent);
117
+ border-radius: var(--astl-radius-m);
118
+ background: var(--astl-surface);
119
+ color: var(--astl-accent);
120
+ font: inherit;
121
+ font-size: var(--astl-size-ui);
122
+ font-weight: 600;
123
+ line-height: 1.4;
124
+ cursor: pointer;
125
+ }
126
+ .zone[data-target] .drop {
127
+ background: var(--astl-accent);
128
+ color: var(--astl-on-accent);
129
+ }
130
+ `,n`
131
+ @media (forced-colors: active) {
132
+ .zone[data-target] .drop {
133
+ background: var(--astl-surface);
134
+ color: var(--astl-accent);
135
+ }
136
+ }
137
+ `,t(Array.from({length:8},(e,t)=>`[data-palette='${t+1}']{--astl-group:var(--astl-palette-${t+1});--astl-group-soft:var(--astl-palette-${t+1}-soft)}`).join(``)),m,f];#e=null;#t=new d(this,{destinations:()=>[_,...this.categories.map(e=>e.id)],current:e=>this.#a(e),at:(e,t)=>this.#u(e,t),commit:(e,t)=>this.#s(e,t),say:(e,t,n)=>this.#c(e,t,n),wrap:!0,box:`.card`,hold:v});constructor(){super(),this.placed=new Map}get categories(){return this.childElements(`astl-category`)}get cards(){return this.shuffled(this.childElements(`astl-card`))}get slotIds(){return this.id===``?[]:this.cards.map(e=>e.id)}getAnswers(){return this.id===``?{}:Object.fromEntries(this.placed)}setAnswers(e){let t=new Set(this.cards.map(e=>e.id)),n=new Set(this.categories.map(e=>e.id)),r=new Map(this.placed);for(let[i,a]of Object.entries(e))t.has(i)&&r.get(i)!==a&&(r.delete(i),n.has(a)&&r.set(i,a));this.placed=r,this.#t.reset()}units(){return{answered:this.placed.size,total:this.cards.length}}getUiState(){return[...this.placed.keys()]}setUiState(e){if(!Array.isArray(e))return;let t=new Map;for(let n of e){let e=typeof n==`string`?this.placed.get(n):void 0;e!==void 0&&t.set(n,e)}for(let[e,n]of this.placed)t.has(e)||t.set(e,n);this.placed=t}render(){let t=this.uiLanguage,n=this.cards,r=new Map(n.map((e,t)=>[e.id,t])),i=n.filter(e=>!this.placed.has(e.id)).map(e=>e.id),a=this.#n();return e`<fieldset part="categorise" ?data-picking=${this.#t.picked!==null} @click=${this.#l}>
138
+ <legend part="prompt">
139
+ <slot data-tag="astl-prompt"></slot>
140
+ <span class="hint" lang=${t.lang}><bdi>${this.t(`ui.hint`)}</bdi></span>
141
+ </legend>
142
+ <span class="astl-vh" id="instructions" lang=${t.lang} dir=${t.dir}>${this.t(`ui.instructions`)}</span>
143
+ ${this.#r(_,i,r,0,null)}
144
+ <div class="groups">
145
+ ${this.categories.map((e,t)=>this.#r(e.id,[...this.placed].filter(([,t])=>t===e.id).map(([e])=>e),r,t+1,a[t]??null))}
146
+ </div>
147
+ ${this.renderGroupVerdict()}
148
+ </fieldset>`}#n(){let e=this.categories.map(x),t=[1,2,3,4,5,6,7,8].filter(t=>!e.includes(t)),n=0;return e.map(e=>e??t[n++%t.length]??1)}#r(t,n,i,a,o){let s=this.uiLanguage,c=t===_,l=this.#t,u=l.picked,d=this.#o(t),f=c?`ui.allSorted`:`ui.emptyGroup`;return e`<div
149
+ class="zone"
150
+ part=${c?`unsorted`:`group`}
151
+ role="group"
152
+ aria-labelledby="zone-${a}"
153
+ data-zone=${t}
154
+ data-palette=${o??r}
155
+ ?data-target=${u!==null&&l.target===t}
156
+ ?data-over=${l.dragging!==null&&l.over===t}
157
+ >
158
+ <div class="label" part="label" id="zone-${a}">
159
+ ${c?e`<span lang=${s.lang} dir=${s.dir}>${d}</span>`:e`<slot data-category=${t}></slot>`}
160
+ </div>
161
+ ${n.length===0?e`<p class="note"><span lang=${s.lang} dir=${s.dir}>${this.t(f)}</span></p>`:e`<div class="cards">
162
+ ${p(n,e=>e,e=>this.#i(e,i.get(e)??0))}
163
+ </div>`}
164
+ ${u!==null&&!this.disabled&&this.#a(u)!==t?e`<button
165
+ type="button"
166
+ class="drop"
167
+ part="drop"
168
+ lang=${s.lang}
169
+ dir=${s.dir}
170
+ aria-label=${this.t(`ui.dropLabel`,{group:d})}
171
+ @click=${()=>l.put(t)}
172
+ >
173
+ ${this.t(`ui.drop`)}
174
+ </button>`:r}
175
+ </div>`}#i(t,n){let a=this.uiLanguage,s=this.#a(t),c=Object.keys(this.feedback?.slots??{}).length>0,l=s===_?c?`empty`:null:this.slotVerdict(t),u=this.solution?.[t],d=u!==void 0&&u!==s?u:null,f=this.#t,p=f.picked===t,m=[this.disabled?``:`instructions`,l===null?``:`verdict-${n}`,d===null?``:`solution-${n}`].filter(e=>e!==``).join(` `),h=this.contentLang;return e`<div
176
+ class="card chip astl-box astl-ring"
177
+ part="card"
178
+ data-card=${t}
179
+ data-verdict=${o(l??void 0)}
180
+ ?data-picked=${p}
181
+ ?data-dragging=${f.dragging===t}
182
+ >
183
+ <button
184
+ type="button"
185
+ class="card-button"
186
+ data-card=${t}
187
+ aria-pressed=${p?`true`:`false`}
188
+ aria-describedby=${m===``?r:m}
189
+ ?disabled=${this.disabled}
190
+ @click=${e=>f.click(e,t)}
191
+ @keydown=${e=>f.keydown(e,t)}
192
+ @pointerdown=${e=>f.pointerdown(e,t)}
193
+ @touchmove=${f.touchmove}
194
+ >
195
+ ${p?y:r}<span class="text"><slot data-card=${t}></slot></span>
196
+ </button>
197
+ ${this.renderVerdict(l,{hiddenWord:!0,id:`verdict-${n}`})}
198
+ ${d===null?r:e`<p class="mark-row astl-solution" part="solution" id="solution-${n}" data-category=${d} lang=${a.lang} dir=${a.dir}>
199
+ ${i(`correct`)}<span class="astl-solution-label">${this.t(`ui.solution`)}</span>
200
+ <bdi lang=${o(h===``?void 0:h)}>${this.#o(d)}</bdi>
201
+ </p>`}
202
+ </div>`}updated(){let e=this.#e;e!==null&&(this.#e=null,this.renderRoot.querySelector(`button.card-button[data-card="${CSS.escape(e)}"]`)?.focus())}#a(e){return this.placed.get(e)??_}#o(e){return e===_?this.t(`ui.unsorted`):b(this.categories.find(t=>t.id===e))}#s(e,t){let n=this.#a(e),r=this.cards.filter(e=>!this.placed.has(e.id)).map(e=>e.id),i=this.renderRoot.activeElement!==null,a=new Map(this.placed);a.delete(e),t!==_&&a.set(e,t),this.placed=a,this.emitChange({[e]:t}),i&&(this.#e=(n===_?r[r.indexOf(e)+1]:void 0)??e)}#c(e,t,n){let r=this.cards,i=this.placed,a=e===`put`?n===_?`unsort`:`drop`:e;return this.t(`ui.announce.${a}`,{card:b(r.find(e=>e.id===t)),group:this.#o(n),count:n===_?r.length-i.size:[...i.values()].filter(e=>e===n).length,placed:i.size,total:r.length})}#l(e){if(this.#t.picked===null||this.disabled)return;let t=e.composedPath(),n=t.slice(0,t.indexOf(e.currentTarget));if(n.some(e=>e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement))return;let r=n.find(e=>e instanceof HTMLElement&&e.dataset.zone!==void 0);r!==void 0&&this.#t.put(r.dataset.zone??_)}#u(e,t){for(let n of this.renderRoot.querySelectorAll(`[data-zone]`)){let r=n.getBoundingClientRect();if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return n.dataset.zone??null}return null}},C={manifest:l,element:S,messages:g};export{C as categoriseElement};
203
+ //# sourceMappingURL=categorise-BO2tNVJ3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categorise-BO2tNVJ3.js","names":["en","pl","LitElement","unsafeCSS","nothing","repeat","ifDefined","b","r","i$1","A","verdictIcon","AstlElement","i","en_default","categoriseManifest","pl_default","PickAndPlace","blockStyles","c","chipStyles","namespace","categoriseUiMessages","UNSORTED","LONG_PRESS","MOVE_ICON","textOf","copy","el","img","paletteOf","slot","category","CategoriseElement","#zoneOf","id","#zoneAt","x","y","#move","zone","#message","moment","card","cards","categories","next","value","answers","#pick","state","ui","index","unsorted","slots","#slots","#onZoneClick","#renderZone","named","free","pick","picked","name","#zoneName","note","n","palette","ids","#renderCard","answer","marked","verdict","correct","mark","describedBy","ref","content","event","focus","#focusAfter","from","pile","focused","placed","key","path","inside","node","box","categoriseElement"],"sources":["../../../../components/src/categorise/ui-messages.ts","../../../../components/src/categorise/element.ts"],"sourcesContent":["import type { MessageCatalog } from '@astl/core';\nimport en from './messages/ui/en.json' with { type: 'json' };\nimport pl from './messages/ui/pl.json' with { type: 'json' };\n\nconst namespace = 'astl.categorise';\n\n/**\n * The student strings (`ui.*`): the element's catalogs. A module of their own, because bundlers split by module: one\n * that also built `categoriseMessages` would put the authoring strings into the element's chunk.\n */\nexport const categoriseUiMessages: readonly MessageCatalog[] = [\n { namespace, locale: 'en', messages: en },\n { namespace, locale: 'pl', messages: pl },\n];\n","import type { Answers, ComponentManifest, JsonValue, MessageCatalog, Units } from '@astl/core';\nimport { AstlElement, type ElementRegistration, verdictIcon } from '@astl/player';\nimport { PickAndPlace, type PickMoment } from '@astl/player/interaction';\nimport {\n type CSSResultGroup,\n css,\n html,\n LitElement,\n nothing,\n type PropertyDeclarations,\n type TemplateResult,\n unsafeCSS,\n} from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { blockStyles } from '../block-styles.js';\nimport { chipStyles } from '../chip-styles.js';\nimport { categoriseManifest } from './manifest.js';\nimport { categoriseUiMessages } from './ui-messages.js';\n\n/** Zone key of the unsorted area; categories use their ids. */\nconst UNSORTED = '';\n\n/**\n * A touch held this long (ms) without moving starts a drag. A touch that moves sooner scrolls the page, as touches\n * do everywhere else, and a short one is a tap.\n */\nconst LONG_PRESS = 250;\n\n/** Marks the picked card next to its other cues (bar, lift, `aria-pressed`): four arrows, \"this card moves\". */\nconst MOVE_ICON = html`<svg class=\"move\" viewBox=\"0 0 20 20\" aria-hidden=\"true\" focusable=\"false\">\n <path\n d=\"M10 2.5v15M2.5 10h15M10 2.5 7.5 5M10 2.5 12.5 5M10 17.5 7.5 15M10 17.5 12.5 15M2.5 10 5 7.5M2.5 10 5 12.5M17.5 10 15 7.5M17.5 10 15 12.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n</svg>`;\n\n/** What a card or a group says: its text, each picture by its alt text, as a screen reader reads it. */\nconst textOf = (el: Element | undefined): string => {\n const copy = el?.cloneNode(true) as Element | undefined;\n for (const img of copy?.querySelectorAll('img') ?? []) img.replaceWith(` ${img.alt} `);\n return (copy?.textContent ?? '').replace(/\\s+/g, ' ').trim();\n};\n\n/** A group's own palette slot (`palette`, 1 to 8), or null. */\nfunction paletteOf(category: Element): number | null {\n const slot = Number(category.getAttribute('palette'));\n return Number.isInteger(slot) && slot >= 1 && slot <= 8 ? slot : null;\n}\n\n/**\n * `<astl-categorise>`: the cards of the view, unsorted at first, and one drop zone per category. Each card is a\n * native toggle button (`aria-pressed` while picked) in the tab order. Three ways to move a card, all with the\n * same result and announcement:\n * - keyboard: Space or Enter picks the card, the arrow keys choose a zone (the unsorted area, then the categories;\n * left and right follow the writing direction), Enter or Space puts it there, Escape cancels;\n * - pointer: drag the card onto a zone (with touch: hold the card a moment, then drag);\n * - single pointer (WCAG 2.5.7): tap the card, then \"Put here\" (or anywhere in a zone).\n * Slots: one per card (its id); the answer is the id of the category it is in. The light-DOM children are slotted\n * manually and never moved or changed.\n */\nexport class CategoriseElement extends AstlElement {\n static override manifest: ComponentManifest = categoriseManifest;\n static override messages: readonly MessageCatalog[] = categoriseUiMessages;\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n slotAssignment: 'manual',\n };\n\n static override properties: PropertyDeclarations = {\n placed: { state: true },\n };\n\n // Notes on the rules are JS comments between css parts: inside a css literal they would ship to every student.\n static override styles: CSSResultGroup = [\n // A column whose gaps space its parts, so the group verdict line has no margin of its own.\n css`\n fieldset {\n display: flex;\n flex-direction: column;\n gap: var(--astl-space-3);\n }\n .group-verdict {\n margin-block: 0;\n }\n `,\n // Trays: tinted, solid edges (dashed, dotted and double borders are the verdict language). A tap target while a\n // card is picked: no double-tap zoom (touch-action), so the tap is not delayed.\n css`\n .zone {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: var(--astl-space-2);\n min-inline-size: 0;\n padding: var(--astl-space-3);\n border: var(--astl-outline-width) solid var(--astl-line);\n border-radius: var(--astl-radius-l);\n background: var(--astl-canvas);\n touch-action: manipulation;\n }\n `,\n // A group's tray takes its palette slot (below), and so do the cards placed in it; cards to sort have no group\n // colour, so colour never hints at an answer, and the group's name stays above its cards.\n css`\n .groups .zone {\n border-color: var(--astl-group);\n background: var(--astl-group-soft);\n }\n `,\n // The zone Enter puts the picked card in, or the one under a dragged card: a doubled edge (an inner outline, which\n // forced colours keep) and a tint.\n css`\n .zone[data-target],\n .zone[data-over] {\n border-color: var(--astl-accent);\n outline: var(--astl-outline-width) solid var(--astl-accent);\n outline-offset: calc(-2 * var(--astl-outline-width));\n background: var(--astl-accent-soft);\n }\n `,\n // While a card is picked, a tap anywhere in a zone puts it there.\n css`\n fieldset[data-picking] .zone {\n cursor: pointer;\n }\n `,\n // One column on phones, up to three in the player's column.\n css`\n .groups {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));\n gap: var(--astl-space-3);\n }\n .label {\n font-size: var(--astl-size-ui);\n font-weight: 600;\n line-height: 1.4;\n overflow-wrap: anywhere;\n }\n .note {\n margin: 0;\n color: var(--astl-ink-muted);\n font-size: var(--astl-size-small);\n }\n .cards {\n display: flex;\n flex-wrap: wrap;\n gap: var(--astl-space-2);\n }\n `,\n // A card is a chip (chipStyles: its box, button, pick and drag): row 1, the button and its verdict icon; row 2, the\n // solution line (block-styles.ts), which wraps at the card's own width rather than stretch the card across its\n // group (a card with one is a little wider, so the line keeps a few words a line). Picked: in hc also bold text\n // (selected-weight). Locked (review, handed in): a quieter edge, the text at full contrast; a verdict keeps its\n // colour. A long press starts a drag (see LONG_PRESS).\n css`\n .card {\n box-sizing: border-box;\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n grid-template-areas: 'button verdict' 'mark mark';\n align-items: start;\n }\n .groups .card {\n border-color: var(--astl-group);\n }\n .card[data-picked] .text {\n font-weight: var(--astl-selected-weight);\n }\n .card:not([data-verdict]):has(.card-button:disabled) {\n border-color: var(--astl-line);\n }\n .card-button {\n grid-area: button;\n }\n .text {\n min-inline-size: 0;\n overflow-wrap: anywhere;\n }\n .card > .astl-verdict {\n grid-area: verdict;\n min-block-size: var(--astl-target-min);\n padding-inline-end: var(--astl-space-3);\n }\n .mark-row {\n grid-area: mark;\n contain: inline-size;\n padding-block-end: var(--astl-space-2);\n padding-inline: var(--astl-space-3);\n }\n .card:has(> .mark-row) {\n min-inline-size: min(100%, 11rem);\n }\n .drop {\n box-sizing: border-box;\n min-inline-size: var(--astl-target-min);\n min-block-size: var(--astl-target-min);\n margin: 0;\n padding-block: var(--astl-space-2);\n padding-inline: var(--astl-space-4);\n border: var(--astl-outline-width) solid var(--astl-accent);\n border-radius: var(--astl-radius-m);\n background: var(--astl-surface);\n color: var(--astl-accent);\n font: inherit;\n font-size: var(--astl-size-ui);\n font-weight: 600;\n line-height: 1.4;\n cursor: pointer;\n }\n .zone[data-target] .drop {\n background: var(--astl-accent);\n color: var(--astl-on-accent);\n }\n `,\n // System colours draw a backplate behind text: a filled button would hide its label.\n css`\n @media (forced-colors: active) {\n .zone[data-target] .drop {\n background: var(--astl-surface);\n color: var(--astl-accent);\n }\n }\n `,\n // Palette slots of the groups, through an attribute: a strict Content Security Policy blocks inline styles.\n unsafeCSS(\n Array.from(\n { length: 8 },\n (_, i) =>\n `[data-palette='${i + 1}']{--astl-group:var(--astl-palette-${i + 1});--astl-group-soft:var(--astl-palette-${i + 1}-soft)}`,\n ).join(''),\n ),\n chipStyles,\n blockStyles,\n ];\n\n /** Card id to category id, in placement order: a zone shows its cards in the order they were put there. */\n declare protected placed: ReadonlyMap<string, string>;\n /** Card to focus after the next render (a card that changes zone is a new button). */\n #focusAfter: string | null = null;\n /**\n * Picking and moving cards: destinations are the zones (the unsorted area, then the categories, in arrow key\n * order with wrap-around), a dragged card follows the pointer, a touch drags after a long press. Focus leaving the\n * task, or a press outside it, puts a picked card down where it was.\n */\n readonly #pick: PickAndPlace<string> = new PickAndPlace<string>(this, {\n destinations: () => [UNSORTED, ...this.categories.map((category) => category.id)],\n current: (id) => this.#zoneOf(id),\n at: (x, y) => this.#zoneAt(x, y),\n commit: (id, zone) => this.#move(id, zone),\n say: (moment, id, zone) => this.#message(moment, id, zone),\n wrap: true,\n box: '.card',\n hold: LONG_PRESS,\n });\n\n constructor() {\n super();\n this.placed = new Map();\n }\n\n /** `<astl-category>` children, in view order. */\n get categories(): readonly HTMLElement[] {\n return this.childElements('astl-category');\n }\n\n /** `<astl-card>` children in rendered order: view order, or shuffled per attempt with a seed. */\n get cards(): readonly HTMLElement[] {\n return this.shuffled(this.childElements('astl-card'));\n }\n\n get slotIds(): readonly string[] {\n return this.id === '' ? [] : this.cards.map((card) => card.id);\n }\n\n getAnswers(): Answers {\n return this.id === '' ? {} : Object.fromEntries(this.placed);\n }\n\n setAnswers(answers: Answers): void {\n const cards = new Set(this.cards.map((card) => card.id));\n const categories = new Set(this.categories.map((category) => category.id));\n const next = new Map(this.placed);\n for (const [id, value] of Object.entries(answers)) {\n if (!cards.has(id) || next.get(id) === value) continue;\n next.delete(id);\n // '' takes the card out; an unknown category cannot be shown, so the card is unsorted, as the player sends it.\n if (categories.has(value)) next.set(id, value);\n }\n this.placed = next;\n this.#pick.reset();\n }\n\n units(): Units {\n return { answered: this.placed.size, total: this.cards.length };\n }\n\n /** The placement order, so a restored attempt shows each zone as the student left it. */\n getUiState(): JsonValue {\n return [...this.placed.keys()];\n }\n\n setUiState(state: JsonValue): void {\n if (!Array.isArray(state)) return;\n const next = new Map<string, string>();\n for (const id of state) {\n const category = typeof id === 'string' ? this.placed.get(id) : undefined;\n if (category !== undefined) next.set(id as string, category);\n }\n for (const [id, category] of this.placed) if (!next.has(id)) next.set(id, category);\n this.placed = next;\n }\n\n protected override render(): TemplateResult {\n const ui = this.uiLanguage;\n const cards = this.cards;\n const index = new Map(cards.map((card, i) => [card.id, i]));\n const unsorted = cards.filter((card) => !this.placed.has(card.id)).map((card) => card.id);\n const slots = this.#slots();\n return html`<fieldset part=\"categorise\" ?data-picking=${this.#pick.picked !== null} @click=${this.#onZoneClick}>\n <legend part=\"prompt\">\n <slot data-tag=\"astl-prompt\"></slot>\n <span class=\"hint\" lang=${ui.lang}><bdi>${this.t('ui.hint')}</bdi></span>\n </legend>\n <span class=\"astl-vh\" id=\"instructions\" lang=${ui.lang} dir=${ui.dir}>${this.t('ui.instructions')}</span>\n ${this.#renderZone(UNSORTED, unsorted, index, 0, null)}\n <div class=\"groups\">\n ${this.categories.map((category, i) =>\n this.#renderZone(\n category.id,\n [...this.placed].filter(([, c]) => c === category.id).map(([id]) => id),\n index,\n i + 1,\n slots[i] ?? null,\n ),\n )}\n </div>\n ${this.renderGroupVerdict()}\n </fieldset>`;\n }\n\n /**\n * The palette slot of each group, in order: its own `palette`, else the next slot no group names; past the free\n * slots it wraps around them.\n */\n #slots(): readonly number[] {\n const named = this.categories.map(paletteOf);\n const free = [1, 2, 3, 4, 5, 6, 7, 8].filter((slot) => !named.includes(slot));\n let next = 0;\n return named.map((slot) => slot ?? free[next++ % free.length] ?? 1);\n }\n\n #renderZone(\n zone: string,\n ids: readonly string[],\n index: ReadonlyMap<string, number>,\n n: number,\n palette: number | null,\n ): TemplateResult {\n const ui = this.uiLanguage;\n const unsorted = zone === UNSORTED;\n const pick = this.#pick;\n const picked = pick.picked;\n const name = this.#zoneName(zone);\n const note = unsorted ? 'ui.allSorted' : 'ui.emptyGroup';\n return html`<div\n class=\"zone\"\n part=${unsorted ? 'unsorted' : 'group'}\n role=\"group\"\n aria-labelledby=\"zone-${n}\"\n data-zone=${zone}\n data-palette=${palette ?? nothing}\n ?data-target=${picked !== null && pick.target === zone}\n ?data-over=${pick.dragging !== null && pick.over === zone}\n >\n <div class=\"label\" part=\"label\" id=\"zone-${n}\">\n ${\n unsorted\n ? html`<span lang=${ui.lang} dir=${ui.dir}>${name}</span>`\n : html`<slot data-category=${zone}></slot>`\n }\n </div>\n ${\n ids.length === 0\n ? // Aligned like the zone label (the zone's direction); the UI text keeps its own language and direction.\n html`<p class=\"note\"><span lang=${ui.lang} dir=${ui.dir}>${this.t(note)}</span></p>`\n : html`<div class=\"cards\">\n ${repeat(\n ids,\n (id) => id,\n (id) => this.#renderCard(id, index.get(id) ?? 0),\n )}\n </div>`\n }\n ${\n picked !== null && !this.disabled && this.#zoneOf(picked) !== zone\n ? html`<button\n type=\"button\"\n class=\"drop\"\n part=\"drop\"\n lang=${ui.lang}\n dir=${ui.dir}\n aria-label=${this.t('ui.dropLabel', { group: name })}\n @click=${() => pick.put(zone)}\n >\n ${this.t('ui.drop')}\n </button>`\n : nothing\n }\n </div>`;\n }\n\n #renderCard(id: string, i: number): TemplateResult {\n const ui = this.uiLanguage;\n const answer = this.#zoneOf(id);\n // Where cards are marked one by one, a card left unsorted shows \"no answer\" (dotted), as in every type.\n const marked = Object.keys(this.feedback?.slots ?? {}).length > 0;\n const verdict = answer === UNSORTED ? (marked ? 'empty' : null) : this.slotVerdict(id);\n const correct = this.solution?.[id];\n // One clear indicator: a card in its own category needs no solution mark (its place, or its verdict, says it).\n const mark = correct !== undefined && correct !== answer ? correct : null;\n const pick = this.#pick;\n const picked = pick.picked === id;\n const describedBy = [\n this.disabled ? '' : 'instructions',\n verdict === null ? '' : `verdict-${i}`,\n mark === null ? '' : `solution-${i}`,\n ]\n .filter((ref) => ref !== '')\n .join(' ');\n const content = this.contentLang;\n return html`<div\n class=\"card chip astl-box astl-ring\"\n part=\"card\"\n data-card=${id}\n data-verdict=${ifDefined(verdict ?? undefined)}\n ?data-picked=${picked}\n ?data-dragging=${pick.dragging === id}\n >\n <button\n type=\"button\"\n class=\"card-button\"\n data-card=${id}\n aria-pressed=${picked ? 'true' : 'false'}\n aria-describedby=${describedBy === '' ? nothing : describedBy}\n ?disabled=${this.disabled}\n @click=${(event: MouseEvent) => pick.click(event, id)}\n @keydown=${(event: KeyboardEvent) => pick.keydown(event, id)}\n @pointerdown=${(event: PointerEvent) => pick.pointerdown(event, id)}\n @touchmove=${pick.touchmove}\n >\n ${picked ? MOVE_ICON : nothing}<span class=\"text\"><slot data-card=${id}></slot></span>\n </button>\n ${this.renderVerdict(verdict, { hiddenWord: true, id: `verdict-${i}` })}\n ${\n mark === null\n ? nothing\n : // A UI sentence around a content name: it reads in the UI's direction, the name keeps its language.\n html`<p class=\"mark-row astl-solution\" part=\"solution\" id=\"solution-${i}\" data-category=${mark} lang=${ui.lang} dir=${ui.dir}>\n ${verdictIcon('correct')}<span class=\"astl-solution-label\">${this.t('ui.solution')}</span>\n <bdi lang=${ifDefined(content === '' ? undefined : content)}>${this.#zoneName(mark)}</bdi>\n </p>`\n }\n </div>`;\n }\n\n protected override updated(): void {\n const focus = this.#focusAfter;\n if (focus !== null) {\n this.#focusAfter = null;\n this.renderRoot\n .querySelector<HTMLElement>(`button.card-button[data-card=\"${CSS.escape(focus)}\"]`)\n ?.focus();\n }\n }\n\n // Moving cards\n\n #zoneOf(id: string): string {\n return this.placed.get(id) ?? UNSORTED;\n }\n\n #zoneName(zone: string): string {\n if (zone === UNSORTED) return this.t('ui.unsorted');\n return textOf(this.categories.find((category) => category.id === zone));\n }\n\n /** Puts card `id` into `zone`: a keyboard put, a \"Put here\" button, a tap on a zone or a drop. */\n #move(id: string, zone: string): void {\n const from = this.#zoneOf(id);\n const pile = this.cards.filter((card) => !this.placed.has(card.id)).map((card) => card.id);\n const focused = (this.renderRoot as ShadowRoot).activeElement !== null;\n const next = new Map(this.placed);\n next.delete(id);\n if (zone !== UNSORTED) next.set(id, zone);\n this.placed = next;\n this.emitChange({ [id]: zone });\n // Sorting works through the pile: from the unsorted area, focus goes on to the card that takes this one's place.\n if (focused) this.#focusAfter = (from === UNSORTED ? pile[pile.indexOf(id) + 1] : undefined) ?? id;\n }\n\n /** `ui.announce.pick`, `target`, `cancel`, and for a put `drop` (or `unsort`, back to the cards to sort). */\n #message(moment: PickMoment, id: string, zone: string): string {\n const cards = this.cards;\n const placed = this.placed;\n const key = moment !== 'put' ? moment : zone === UNSORTED ? 'unsort' : 'drop';\n return this.t(`ui.announce.${key}`, {\n card: textOf(cards.find((card) => card.id === id)),\n group: this.#zoneName(zone),\n // Cards in the zone (a target); cards placed so far (a put).\n count:\n zone === UNSORTED\n ? cards.length - placed.size\n : [...placed.values()].filter((c) => c === zone).length,\n placed: placed.size,\n total: cards.length,\n });\n }\n\n /** Taps on a zone (not on a card, a button or a link) put the picked card there. */\n #onZoneClick(event: MouseEvent): void {\n if (this.#pick.picked === null || this.disabled) return;\n // Only what is inside the task: an element of the host page may carry `data-zone` too.\n const path = event.composedPath();\n const inside = path.slice(0, path.indexOf(event.currentTarget as EventTarget));\n if (inside.some((node) => node instanceof HTMLButtonElement || node instanceof HTMLAnchorElement)) return;\n const zone = inside.find(\n (node): node is HTMLElement => node instanceof HTMLElement && node.dataset.zone !== undefined,\n );\n if (zone !== undefined) this.#pick.put(zone.dataset.zone ?? UNSORTED);\n }\n\n #zoneAt(x: number, y: number): string | null {\n for (const zone of (this.renderRoot as ShadowRoot).querySelectorAll<HTMLElement>('[data-zone]')) {\n const box = zone.getBoundingClientRect();\n if (x >= box.left && x <= box.right && y >= box.top && y <= box.bottom)\n return zone.dataset.zone ?? null;\n }\n return null;\n }\n}\n\nexport const categoriseElement: ElementRegistration = {\n manifest: categoriseManifest,\n element: CategoriseElement,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
1
+ var e={tag:`astl-categorise`,version:1,display:`block`,graded:!0,attributes:[],children:[{tag:`astl-prompt`,visibility:`public`,content:`inline`,min:0,max:1,attributes:[]},{tag:`astl-category`,visibility:`public`,content:`inline`,min:2,max:6,attributes:[{name:`id`,type:`id`,visibility:`public`,required:!0},{name:`palette`,type:`integer`,min:1,max:8,visibility:`public`}]},{tag:`astl-card`,visibility:`public`,content:`inline`,min:2,max:24,attributes:[{name:`id`,type:`id`,visibility:`public`,required:!0},{name:`category`,type:`string`,visibility:`private`,required:!0}]}],scoring:{default:`per-card`,modes:{all:`all-correct`,"per-card":`proportional`}},variants:null,slotKinds:[`choice`],issues:[`CATEGORISE_CATEGORY_EMPTY`,`CATEGORISE_CATEGORY_DUPLICATE`,`CATEGORISE_CATEGORY_UNUSED`,`CATEGORISE_CARD_CATEGORY_UNKNOWN`,`CATEGORISE_CARD_EMPTY`,`CATEGORISE_CARD_ALT_EMPTY`,`CATEGORISE_CARD_DUPLICATE`,`CATEGORISE_CARD_AMBIGUOUS`,`CATEGORISE_CARD_LINK`,`CATEGORISE_PROMPT_EMPTY`],messages:`astl.categorise`,a11y:{pattern:`group of toggle buttons with keyboard pick and place: Space or Enter picks a card, the arrow keys choose a group, Enter puts the card there, Escape cancels; or drag (with touch after a long press), or tap a card and then "Put here" in a group`,keys:[`Tab`,`Space`,`Enter`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Escape`]},cssParts:[`categorise`,`prompt`,`unsorted`,`group`,`label`,`card`,`drop`,`verdict`,`solution`]},t={"ui.hint":`Put each card in its group.`,"ui.instructions":`Press Space to pick up the card. Then choose a group with the arrow keys and press Enter, or use the “Put here” button of a group. Escape cancels.`,"ui.unsorted":`Cards to sort`,"ui.allSorted":`Every card is in a group.`,"ui.emptyGroup":`No cards yet`,"ui.drop":`Put here`,"ui.dropLabel":`Put here: {group}`,"ui.solution":`Correct group:`,"ui.announce.pick":`Picked up “{card}”. Choose a group with the arrow keys and press Enter, or use a “Put here” button.`,"ui.announce.target":`“{group}”, {count, plural, =0 {no cards} one {# card} other {# cards}}`,"ui.announce.drop":`Placed “{card}” in “{group}”, {placed} of {total}`,"ui.announce.unsort":`Put “{card}” back with the cards to sort, {placed} of {total}`,"ui.announce.cancel":`“{card}” stays where it was.`},n={"ui.hint":`Umieść każdą kartę we właściwej grupie.`,"ui.instructions":`Naciśnij spację, aby podnieść kartę. Potem wybierz grupę strzałkami i naciśnij Enter albo użyj przycisku „Połóż tutaj” w grupie. Escape anuluje.`,"ui.unsorted":`Karty do posortowania`,"ui.allSorted":`Każda karta jest już w grupie.`,"ui.emptyGroup":`Na razie brak kart`,"ui.drop":`Połóż tutaj`,"ui.dropLabel":`Połóż tutaj: {group}`,"ui.solution":`Poprawna grupa:`,"ui.announce.pick":`Podniesiono „{card}”. Wybierz grupę strzałkami i naciśnij Enter albo użyj przycisku „Połóż tutaj”.`,"ui.announce.target":`„{group}”, {count, plural, =0 {brak kart} one {# karta} few {# karty} many {# kart} other {# karty}}`,"ui.announce.drop":`Umieszczono „{card}” w grupie „{group}”, {placed} z {total}`,"ui.announce.unsort":`Odłożono „{card}” z powrotem do kart do posortowania, {placed} z {total}`,"ui.announce.cancel":`„{card}” zostaje na swoim miejscu.`};export{t as n,e as r,n as t};
2
+ //# sourceMappingURL=categorise-manifest-C_hEDVYQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categorise-manifest-C_hEDVYQ.js","names":["categoriseManifest","en_default","pl_default"],"sources":["../../../../components/src/categorise/manifest.ts","../../../../components/src/categorise/messages/ui/en.json","../../../../components/src/categorise/messages/ui/pl.json"],"sourcesContent":["import type { ComponentManifest } from '@astl/core';\n\n/**\n * A sorting task: the student puts every card into one of the groups (animals into birds, fish and mammals).\n * Each card belongs to exactly one group and grades one `choice` slot whose answer is the group's opaque id. Cards\n * are shown in a keyed shuffled order; students move them with the keyboard, by dragging, or by tapping a card and\n * then a group.\n */\nexport const categoriseManifest: ComponentManifest = {\n tag: 'astl-categorise',\n version: 1,\n display: 'block',\n graded: true,\n attributes: [],\n children: [\n /** The task. */\n { tag: 'astl-prompt', visibility: 'public', content: 'inline', min: 0, max: 1, attributes: [] },\n /**\n * A group cards are sorted into: `id` is local to the task, the content is its name. `palette` (1 to 8) names its\n * slot of the group palette; the others take the next free slot in order. A card takes its group's colour only\n * once it is placed there.\n */\n {\n tag: 'astl-category',\n visibility: 'public',\n content: 'inline',\n min: 2,\n max: 6,\n attributes: [\n { name: 'id', type: 'id', visibility: 'public', required: true },\n { name: 'palette', type: 'integer', min: 1, max: 8, visibility: 'public' },\n ],\n },\n /** A card to sort: `category` (private) is the id of the one group it belongs to. It may show a picture. */\n {\n tag: 'astl-card',\n visibility: 'public',\n content: 'inline',\n min: 2,\n max: 24,\n attributes: [\n { name: 'id', type: 'id', visibility: 'public', required: true },\n { name: 'category', type: 'string', visibility: 'private', required: true },\n ],\n },\n ],\n scoring: { default: 'per-card', modes: { all: 'all-correct', 'per-card': 'proportional' } },\n variants: null,\n slotKinds: ['choice'],\n issues: [\n 'CATEGORISE_CATEGORY_EMPTY',\n 'CATEGORISE_CATEGORY_DUPLICATE',\n 'CATEGORISE_CATEGORY_UNUSED',\n 'CATEGORISE_CARD_CATEGORY_UNKNOWN',\n 'CATEGORISE_CARD_EMPTY',\n 'CATEGORISE_CARD_ALT_EMPTY',\n 'CATEGORISE_CARD_DUPLICATE',\n 'CATEGORISE_CARD_AMBIGUOUS',\n 'CATEGORISE_CARD_LINK',\n 'CATEGORISE_PROMPT_EMPTY',\n ],\n messages: 'astl.categorise',\n a11y: {\n pattern:\n 'group of toggle buttons with keyboard pick and place: Space or Enter picks a card, the arrow keys choose a group, Enter puts the card there, Escape cancels; or drag (with touch after a long press), or tap a card and then \"Put here\" in a group',\n keys: ['Tab', 'Space', 'Enter', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Escape'],\n },\n cssParts: ['categorise', 'prompt', 'unsorted', 'group', 'label', 'card', 'drop', 'verdict', 'solution'],\n};\n","{\n \"ui.hint\": \"Put each card in its group.\",\n \"ui.instructions\": \"Press Space to pick up the card. Then choose a group with the arrow keys and press Enter, or use the “Put here” button of a group. Escape cancels.\",\n \"ui.unsorted\": \"Cards to sort\",\n \"ui.allSorted\": \"Every card is in a group.\",\n \"ui.emptyGroup\": \"No cards yet\",\n \"ui.drop\": \"Put here\",\n \"ui.dropLabel\": \"Put here: {group}\",\n \"ui.solution\": \"Correct group:\",\n \"ui.announce.pick\": \"Picked up “{card}”. Choose a group with the arrow keys and press Enter, or use a “Put here” button.\",\n \"ui.announce.target\": \"“{group}”, {count, plural, =0 {no cards} one {# card} other {# cards}}\",\n \"ui.announce.drop\": \"Placed “{card}” in “{group}”, {placed} of {total}\",\n \"ui.announce.unsort\": \"Put “{card}” back with the cards to sort, {placed} of {total}\",\n \"ui.announce.cancel\": \"“{card}” stays where it was.\"\n}\n","{\n \"ui.hint\": \"Umieść każdą kartę we właściwej grupie.\",\n \"ui.instructions\": \"Naciśnij spację, aby podnieść kartę. Potem wybierz grupę strzałkami i naciśnij Enter albo użyj przycisku „Połóż tutaj” w grupie. Escape anuluje.\",\n \"ui.unsorted\": \"Karty do posortowania\",\n \"ui.allSorted\": \"Każda karta jest już w grupie.\",\n \"ui.emptyGroup\": \"Na razie brak kart\",\n \"ui.drop\": \"Połóż tutaj\",\n \"ui.dropLabel\": \"Połóż tutaj: {group}\",\n \"ui.solution\": \"Poprawna grupa:\",\n \"ui.announce.pick\": \"Podniesiono „{card}”. Wybierz grupę strzałkami i naciśnij Enter albo użyj przycisku „Połóż tutaj”.\",\n \"ui.announce.target\": \"„{group}”, {count, plural, =0 {brak kart} one {# karta} few {# karty} many {# kart} other {# karty}}\",\n \"ui.announce.drop\": \"Umieszczono „{card}” w grupie „{group}”, {placed} z {total}\",\n \"ui.announce.unsort\": \"Odłożono „{card}” z powrotem do kart do posortowania, {placed} z {total}\",\n \"ui.announce.cancel\": \"„{card}” zostaje na swoim miejscu.\"\n}\n"],"mappings":"AAQA,IAAaA,EAAwC,CACnD,IAAK,kBACL,QAAS,EACT,QAAS,QACT,OAAQ,GACR,WAAY,CAAC,EACb,SAAU,CAER,CAAE,IAAK,cAAe,WAAY,SAAU,QAAS,SAAU,IAAK,EAAG,IAAK,EAAG,WAAY,CAAC,CAAE,EAM9F,CACE,IAAK,gBACL,WAAY,SACZ,QAAS,SACT,IAAK,EACL,IAAK,EACL,WAAY,CACV,CAAE,KAAM,KAAM,KAAM,KAAM,WAAY,SAAU,SAAU,EAAK,EAC/D,CAAE,KAAM,UAAW,KAAM,UAAW,IAAK,EAAG,IAAK,EAAG,WAAY,QAAS,CAC3E,CACF,EAEA,CACE,IAAK,YACL,WAAY,SACZ,QAAS,SACT,IAAK,EACL,IAAK,GACL,WAAY,CACV,CAAE,KAAM,KAAM,KAAM,KAAM,WAAY,SAAU,SAAU,EAAK,EAC/D,CAAE,KAAM,WAAY,KAAM,SAAU,WAAY,UAAW,SAAU,EAAK,CAC5E,CACF,CACF,EACA,QAAS,CAAE,QAAS,WAAY,MAAO,CAAE,IAAK,cAAe,WAAY,cAAe,CAAE,EAC1F,SAAU,KACV,UAAW,CAAC,QAAQ,EACpB,OAAQ,CACN,4BACA,gCACA,6BACA,mCACA,wBACA,4BACA,4BACA,4BACA,uBACA,yBACF,EACA,SAAU,kBACV,KAAM,CACJ,QACE,qPACF,KAAM,CAAC,MAAO,QAAS,QAAS,UAAW,YAAa,YAAa,aAAc,QAAQ,CAC7F,EACA,SAAU,CAAC,aAAc,SAAU,WAAY,QAAS,QAAS,OAAQ,OAAQ,UAAW,UAAU,CACxG,E"}