@astl/astrolabe 0.0.0 → 0.1.1

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 +134 -0
  2. package/LICENSE +202 -0
  3. package/README.md +65 -0
  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 +82 -4
  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 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE7D,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;AAEvE;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAAO,GAA2B,EAAE;IAC/D,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;IAC7C,OAAO,gBAAgB,CAAC;QACtB,UAAU,EAAE,kBAAkB;QAC9B,cAAc,EAAE,qBAAqB;QACrC,YAAY,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;QAC9B,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAM,GAAW,YAAY,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;YAC3E,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzF,wEAAwE;YACxE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1E,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * `@astl/astrolabe/player`: `<astl-player>` with the built-in elements and looks. Player side only: nothing
3
+ * here may import the engine, the server, a definition or the editor (the student bundle carries no answer logic).
4
+ *
5
+ * For HTML with answers through a bundler: `definePlayer({ compileSource: createSourceCompiler() })`, with
6
+ * `createSourceCompiler` from `@astl/astrolabe/engine`.
7
+ */
8
+ import { builtInElements } from '@astl/components/elements';
9
+ import { type DefinePlayerOptions } from '@astl/player';
10
+ import { builtInStyleTemplates, tokensCss } from '@astl/tokens';
11
+ export * from '@astl/core';
12
+ export * from '@astl/player';
13
+ export { builtInElements, builtInStyleTemplates, tokensCss };
14
+ /**
15
+ * Defines `<astl-player>` with `elements: builtInElements` and `styleTemplates: builtInStyleTemplates`. An option
16
+ * replaces its default (extend with `[...builtInElements, mine]`); a second call adds.
17
+ */
18
+ export declare function definePlayer(options?: Partial<DefinePlayerOptions>): void;
19
+ //# sourceMappingURL=player.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"player.d.ts","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,KAAK,mBAAmB,EAAoC,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAAG,IAAI,CAE7E"}
package/dist/player.js ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * `@astl/astrolabe/player`: `<astl-player>` with the built-in elements and looks. Player side only: nothing
3
+ * here may import the engine, the server, a definition or the editor (the student bundle carries no answer logic).
4
+ *
5
+ * For HTML with answers through a bundler: `definePlayer({ compileSource: createSourceCompiler() })`, with
6
+ * `createSourceCompiler` from `@astl/astrolabe/engine`.
7
+ */
8
+ import { builtInElements } from '@astl/components/elements';
9
+ import { definePlayer as defineBasePlayer } from '@astl/player';
10
+ import { builtInStyleTemplates, tokensCss } from '@astl/tokens';
11
+ export * from '@astl/core';
12
+ export * from '@astl/player';
13
+ // `tokensCss`: the --astl-* tokens for the page around the player, with the same themes.
14
+ export { builtInElements, builtInStyleTemplates, tokensCss };
15
+ /**
16
+ * Defines `<astl-player>` with `elements: builtInElements` and `styleTemplates: builtInStyleTemplates`. An option
17
+ * replaces its default (extend with `[...builtInElements, mine]`); a second call adds.
18
+ */
19
+ export function definePlayer(options = {}) {
20
+ defineBasePlayer({ elements: builtInElements, styleTemplates: builtInStyleTemplates, ...options });
21
+ }
22
+ //# sourceMappingURL=player.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"player.js","sourceRoot":"","sources":["../src/player.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAA4B,YAAY,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,yFAAyF;AACzF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC;AAE7D;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,OAAO,GAAiC,EAAE;IACrE,gBAAgB,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,qBAAqB,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AACrG,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `@astl/astrolabe/server`: the grading endpoint (`createGradingHandler({ engine, attempts })`) and the engine
3
+ * with the built-in components and looks. No DOM code.
4
+ */
5
+ export * from '@astl/core';
6
+ export * from '@astl/server';
7
+ export { builtInDefinitions, builtInStyleTemplates, createEngine } from './engine.js';
8
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
package/dist/server.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `@astl/astrolabe/server`: the grading endpoint (`createGradingHandler({ engine, attempts })`) and the engine
3
+ * with the built-in components and looks. No DOM code.
4
+ */
5
+ export * from '@astl/core';
6
+ export * from '@astl/server';
7
+ export { builtInDefinitions, builtInStyleTemplates, createEngine } from './engine.js';
8
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,85 @@
1
1
  {
2
2
  "name": "@astl/astrolabe",
3
- "version": "0.0.0",
4
- "description": "Placeholder for the trusted publishing setup. Use 0.1.0 or later.",
3
+ "version": "0.1.1",
4
+ "description": "Open-source building blocks for interactive exercises (gaps, choice, crosswords and more) with practice and test modes: engine, player, editor, server and a one-file script for plain HTML.",
5
+ "keywords": [
6
+ "astrolabe",
7
+ "education",
8
+ "edtech",
9
+ "e-learning",
10
+ "interactive-exercises",
11
+ "quiz",
12
+ "assessment",
13
+ "web-components",
14
+ "custom-elements",
15
+ "accessibility"
16
+ ],
5
17
  "license": "Apache-2.0",
6
- "repository": { "type": "git", "url": "git+https://github.com/starship1337/astrolabe.git" }
7
- }
18
+ "author": "The Astrolabe Authors",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/starship1337/astrolabe.git",
22
+ "directory": "packages/astrolabe"
23
+ },
24
+ "homepage": "https://astrolabe.starship.education",
25
+ "bugs": "https://github.com/starship1337/astrolabe/issues",
26
+ "type": "module",
27
+ "sideEffects": [
28
+ "./dist/cdn/**",
29
+ "./src/bundles/**"
30
+ ],
31
+ "exports": {
32
+ "./engine": {
33
+ "@astl/source": "./src/engine.ts",
34
+ "types": "./dist/engine.d.ts",
35
+ "default": "./dist/engine.js"
36
+ },
37
+ "./player": {
38
+ "@astl/source": "./src/player.ts",
39
+ "types": "./dist/player.d.ts",
40
+ "default": "./dist/player.js"
41
+ },
42
+ "./editor": {
43
+ "@astl/source": "./src/editor.ts",
44
+ "types": "./dist/editor.d.ts",
45
+ "default": "./dist/editor.js"
46
+ },
47
+ "./server": {
48
+ "@astl/source": "./src/server.ts",
49
+ "types": "./dist/server.d.ts",
50
+ "default": "./dist/server.js"
51
+ },
52
+ "./package.json": "./package.json"
53
+ },
54
+ "files": [
55
+ "dist",
56
+ "src",
57
+ "CHANGELOG.md",
58
+ "!src/**/*.test.ts",
59
+ "!src/**/testing",
60
+ "!dist/bundles",
61
+ "!dist/cdn/.vite"
62
+ ],
63
+ "engines": {
64
+ "node": ">=22.12"
65
+ },
66
+ "publishConfig": {
67
+ "access": "public"
68
+ },
69
+ "dependencies": {
70
+ "@astl/components": "0.1.1",
71
+ "@astl/core": "0.1.1",
72
+ "@astl/editor": "0.1.1",
73
+ "@astl/editor-tiptap": "0.1.1",
74
+ "@astl/engine": "0.1.1",
75
+ "@astl/player": "0.1.1",
76
+ "@astl/server": "0.1.1",
77
+ "@astl/tokens": "0.1.1"
78
+ },
79
+ "devDependencies": {
80
+ "vite": "8.3.4"
81
+ },
82
+ "scripts": {
83
+ "build:assets": "vite build && vite build -c vite.standalone.config.ts && node scripts/check-bundles.mjs"
84
+ }
85
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * astrolabe-editor.js, for authoring pages: `@astl/astrolabe/editor`, defined on load with every built-in
3
+ * component, editor descriptor, preview element and look. TipTap is a chunk of its own, fetched only when an
4
+ * `<astl-editor>` without an adapter and without a `slot="surface"` child connects; the bundle check keeps it out of
5
+ * the first load.
6
+ */
7
+ import { defineEditor } from '../editor.js';
8
+
9
+ defineEditor();
10
+
11
+ export * from '../editor.js';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * astrolabe-player.js, for HTML + backend: `@astl/astrolabe/player`, defined on load with the built-in elements
3
+ * (each loaded with the first view that uses it) and looks. No engine and no answer logic (checked after every
4
+ * build): verdicts come from the grading endpoint.
5
+ */
6
+ import { definePlayer } from '../player.js';
7
+
8
+ definePlayer();
9
+
10
+ export * from '../player.js';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * astrolabe.standalone.js, for a page that loads one classic script and nothing else: astrolabe.js (the player and
3
+ * the engine, a source `<astl-doc>` compiled and graded in the browser) and astrolabe-editor.js (`<astl-editor>`) in
4
+ * one IIFE with every lazy chunk inlined (vite.standalone.config.ts). The tokens of astrolabe.css go first in
5
+ * `<head>`, so the page's own rules still win. The exports are on `window.Astrolabe`.
6
+ */
7
+ import { defineEditor } from '../editor.js';
8
+ import { createSourceCompiler } from '../engine.js';
9
+ import { definePlayer, tokensCss } from '../player.js';
10
+
11
+ const TOKENS = 'data-astl-tokens';
12
+ if (document.head.querySelector(`style[${TOKENS}]`) === null) {
13
+ const style = document.createElement('style');
14
+ style.setAttribute(TOKENS, '');
15
+ style.textContent = tokensCss(':root, .astl-theme');
16
+ document.head.prepend(style);
17
+ }
18
+ definePlayer({ compileSource: createSourceCompiler() });
19
+ defineEditor();
20
+
21
+ export * from '../editor.js';
22
+ export * from '../engine.js';
23
+ export * from '../player.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * astrolabe.js, for HTML with answers: `@astl/astrolabe/player` and `@astl/astrolabe/engine`, defined on
3
+ * load. A source `<astl-doc>` inside `<astl-player>` is compiled in the browser and graded with `localChecker`, so
4
+ * the page needs no backend.
5
+ */
6
+ import { createSourceCompiler } from '../engine.js';
7
+ import { definePlayer } from '../player.js';
8
+
9
+ definePlayer({ compileSource: createSourceCompiler() });
10
+
11
+ export * from '../engine.js';
12
+ export * from '../player.js';
package/src/editor.ts ADDED
@@ -0,0 +1,98 @@
1
+ /**
2
+ * `@astl/astrolabe/editor`: `<astl-editor>` with every built-in component, editor descriptor, preview element
3
+ * and look. Only the main entry of `@astl/editor-tiptap`, never its `/tiptap` entry: importing this module
4
+ * never loads TipTap, which `<astl-editor>` imports on demand when it creates its own surface. Hosts that build
5
+ * their own TipTap editor install `@astl/editor-tiptap` and take `astrolabeExtensions` and
6
+ * `createTiptapAdapter` from its `/tiptap` entry.
7
+ */
8
+ import { builtInDefinitions } from '@astl/components/definitions';
9
+ import { builtInEditors } from '@astl/components/editors';
10
+ import { builtInElements } from '@astl/components/elements';
11
+ import type { MessageCatalog } from '@astl/core';
12
+ import {
13
+ createAuthoring,
14
+ createTextareaAdapter,
15
+ DEFAULT_FONTS,
16
+ DEFAULT_STYLES,
17
+ loadStyleElements,
18
+ STYLE_OPEN,
19
+ UploadRefused,
20
+ } from '@astl/editor';
21
+ import { type DefineEditorOptions, defineEditor as defineBaseEditor } from '@astl/editor-tiptap';
22
+ import { builtInStyleTemplates, tokens, tokensCss } from '@astl/tokens';
23
+
24
+ export * from '@astl/core';
25
+ export type {
26
+ AstlStyleForm,
27
+ AstlStyleRules,
28
+ Authoring,
29
+ AuthoringOptions,
30
+ DescribeOptions,
31
+ EditorFont,
32
+ EditorStylePreset,
33
+ Outline,
34
+ OutlineBlock,
35
+ OutlineComponent,
36
+ OutlinePage,
37
+ PickPicture,
38
+ PreviewOptions,
39
+ PreviewResult,
40
+ StyleOpen,
41
+ TextareaAdapter,
42
+ UploadAsset,
43
+ UploadedAsset,
44
+ } from '@astl/editor';
45
+ export type { DefineEditorOptions } from '@astl/editor-tiptap';
46
+ export { AstlEditor } from '@astl/editor-tiptap';
47
+ // `tokensCss`: the --astl-* tokens for the page around the editor, with the same themes.
48
+ // `createAuthoring`: the kit's logic without the element (validate, outline, preview), Node-safe.
49
+ // `UploadRefused`: what a host's upload or picture library rejects with to tell the author why.
50
+ // `DEFAULT_FONTS` and `DEFAULT_STYLES`: the `fonts` and `styles` defaults, to extend. `loadStyleElements`: for a host
51
+ // that places `<astl-style-form>` or `<astl-style-rules>` itself. `STYLE_OPEN`: the event of a request for them.
52
+ export {
53
+ builtInDefinitions,
54
+ builtInEditors,
55
+ builtInElements,
56
+ builtInStyleTemplates,
57
+ createAuthoring,
58
+ createTextareaAdapter,
59
+ DEFAULT_FONTS,
60
+ DEFAULT_STYLES,
61
+ loadStyleElements,
62
+ STYLE_OPEN,
63
+ tokensCss,
64
+ UploadRefused,
65
+ };
66
+
67
+ /**
68
+ * The toolbar's default featured inserts: none, every component and starter is under "Elements" and "Templates".
69
+ * `featured` replaces it.
70
+ */
71
+ export const DEFAULT_FEATURED: readonly string[] = [];
72
+
73
+ /** The built-ins' insert menu descriptions, imported when a menu first opens. */
74
+ const loadMenuMessages = async (): Promise<readonly MessageCatalog[]> =>
75
+ (await import('@astl/components/menu-messages')).builtInMenuMessages;
76
+
77
+ /**
78
+ * Defines `<astl-editor>` with `components: builtInDefinitions`, `styleTemplates: builtInStyleTemplates`, the light
79
+ * theme's `groundColors` (what an author sees while writing),
80
+ * the built-ins' `menuMessages` and `featured: DEFAULT_FEATURED`, and as `editors` and `elements` the built-in entries of the `components` tags (so a
81
+ * subset of components brings its own editors and elements). An option replaces its default (extend with
82
+ * `[...builtInDefinitions, mine]`); a second call adds.
83
+ */
84
+ export function defineEditor(options: Partial<DefineEditorOptions> = {}): void {
85
+ const components = options.components ?? builtInDefinitions;
86
+ const tags = new Set(components.map((definition) => definition.manifest.tag));
87
+ const { surface, ink } = tokens.themes.light;
88
+ defineBaseEditor({
89
+ styleTemplates: builtInStyleTemplates,
90
+ groundColors: { surface, ink },
91
+ featured: DEFAULT_FEATURED,
92
+ menuMessages: loadMenuMessages,
93
+ ...options,
94
+ components,
95
+ editors: options.editors ?? builtInEditors.filter((editor) => tags.has(editor.manifest.tag)),
96
+ elements: options.elements ?? builtInElements.filter((element) => tags.has(element.tag)),
97
+ });
98
+ }
package/src/engine.ts ADDED
@@ -0,0 +1,59 @@
1
+ /**
2
+ * `@astl/astrolabe/engine`: the engine with the built-in components and looks, and the in-browser source
3
+ * compiler of HTML with answers. It imports no DOM code, so servers use it too; only the compiler it creates reads
4
+ * the page (`location`), when it compiles.
5
+ */
6
+ import { builtInDefinitions } from '@astl/components/definitions';
7
+ import { builtInManifests } from '@astl/components/manifests';
8
+ import type { Engine, EngineOptions, SourceCompiler } from '@astl/core';
9
+ import { createEngine as createBaseEngine, localChecker } from '@astl/engine';
10
+ import { builtInStyleTemplates, tokens } from '@astl/tokens';
11
+
12
+ export * from '@astl/core';
13
+ export * from '@astl/core/declarations';
14
+ export * from '@astl/engine';
15
+ export { builtInDefinitions, builtInManifests, builtInStyleTemplates };
16
+
17
+ /**
18
+ * Public on purpose: in HTML with answers the answers are in the page, so the secret protects nothing. Being fixed,
19
+ * it keeps ids (and progress saved with `persist`) stable across reloads. Never use it on a server.
20
+ */
21
+ export const IN_BROWSER_SECRET = 'astrolabe-in-browser-key';
22
+
23
+ /**
24
+ * An engine with `components: builtInDefinitions`, `styleTemplates: builtInStyleTemplates` and the light theme's
25
+ * `groundColors`: what an author sees while writing, and the theme whose colours are the author's own in the player.
26
+ * An option replaces its default (extend with `[...builtInDefinitions, mine]`). There is no default secret: `compile`
27
+ * needs one.
28
+ */
29
+ export function createEngine(options: Partial<EngineOptions> = {}): Engine {
30
+ const { surface, ink } = tokens.themes.light;
31
+ return createBaseEngine({
32
+ components: builtInDefinitions,
33
+ styleTemplates: builtInStyleTemplates,
34
+ groundColors: { surface, ink },
35
+ ...options,
36
+ });
37
+ }
38
+
39
+ /**
40
+ * Compiles light-DOM sources for `<astl-player>` (`definePlayer({ compileSource })`), with the page path as salt,
41
+ * and grades them with `localChecker`. Default engine: `createEngine({ secret: IN_BROWSER_SECRET })`. An invalid
42
+ * source throws an Error listing its errors in the asking player's UI locale, one per line; the player shows it to
43
+ * the author under its notice.
44
+ */
45
+ export function createSourceCompiler(
46
+ engine: Engine = createEngine({ secret: IN_BROWSER_SECRET }),
47
+ ): SourceCompiler {
48
+ return async (source, context) => {
49
+ const result = await engine.compile(source, { salt: location.pathname });
50
+ if (!result.ok) {
51
+ const errors = result.issues.filter((issue) => issue.severity === 'error');
52
+ const message = errors.map((issue) => engine.describe(issue, context.locale)).join('\n');
53
+ // Also in the console, where authors look first when a page misbehaves.
54
+ console.error(message);
55
+ throw new Error(message);
56
+ }
57
+ return { view: result.view, checker: localChecker(engine, result.key) };
58
+ };
59
+ }
package/src/player.ts ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `@astl/astrolabe/player`: `<astl-player>` with the built-in elements and looks. Player side only: nothing
3
+ * here may import the engine, the server, a definition or the editor (the student bundle carries no answer logic).
4
+ *
5
+ * For HTML with answers through a bundler: `definePlayer({ compileSource: createSourceCompiler() })`, with
6
+ * `createSourceCompiler` from `@astl/astrolabe/engine`.
7
+ */
8
+ import { builtInElements } from '@astl/components/elements';
9
+ import { type DefinePlayerOptions, definePlayer as defineBasePlayer } from '@astl/player';
10
+ import { builtInStyleTemplates, tokensCss } from '@astl/tokens';
11
+
12
+ export * from '@astl/core';
13
+ export * from '@astl/player';
14
+ // `tokensCss`: the --astl-* tokens for the page around the player, with the same themes.
15
+ export { builtInElements, builtInStyleTemplates, tokensCss };
16
+
17
+ /**
18
+ * Defines `<astl-player>` with `elements: builtInElements` and `styleTemplates: builtInStyleTemplates`. An option
19
+ * replaces its default (extend with `[...builtInElements, mine]`); a second call adds.
20
+ */
21
+ export function definePlayer(options: Partial<DefinePlayerOptions> = {}): void {
22
+ defineBasePlayer({ elements: builtInElements, styleTemplates: builtInStyleTemplates, ...options });
23
+ }
package/src/server.ts ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@astl/astrolabe/server`: the grading endpoint (`createGradingHandler({ engine, attempts })`) and the engine
3
+ * with the built-in components and looks. No DOM code.
4
+ */
5
+ export * from '@astl/core';
6
+ export * from '@astl/server';
7
+ export { builtInDefinitions, builtInStyleTemplates, createEngine } from './engine.js';