@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
package/CHANGELOG.md ADDED
@@ -0,0 +1,134 @@
1
+ # @astl/astrolabe
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2f8247b: Shorter npm description for @astl/astrolabe and keywords for all packages.
8
+ - Updated dependencies [2f8247b]
9
+ - @astl/components@0.1.1
10
+ - @astl/core@0.1.1
11
+ - @astl/editor@0.1.1
12
+ - @astl/editor-tiptap@0.1.1
13
+ - @astl/engine@0.1.1
14
+ - @astl/player@0.1.1
15
+ - @astl/server@0.1.1
16
+ - @astl/tokens@0.1.1
17
+
18
+ ## 0.1.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 402924c: A document can be a book: `<astl-doc lang="en" kind="book">`. `kind` is how it shows, never how it grades: `exercise` (the default, as before) one page at a time; `book` two pages side by side (1-2, 3-4, ...) once the player is at least 56rem wide, where "Next" and "Back" turn a spread with a short slide (none under reduced motion or forced colours) and the counter says "Pages 1-2 of 5"; narrower, one page at a time. Another value is `ATTRIBUTE_INVALID`. The compiled view and `Metadata.kind` carry the kind only when it is not `exercise`, so views and metadata of existing content stay byte for byte as they were. `DOC_KINDS`, `DocKind` and `DEFAULT_DOC_KIND` are exported from `@astl/core`. Example: `examples/book`.
23
+ - 97e412c: Authors' own styles, column layouts and named styles in the content format.
24
+
25
+ - `style` on every element, checked by an allow-list (`cleanStyle`, `@astl/core/declarations`): what it refuses goes with
26
+ a warning, `STYLE_REMOVED`. `STYLE_LOW_CONTRAST` warns about text that is hard to read.
27
+ - `<astl-columns>` with 2 to 4 `<astl-column>` on a page, wrapping by themselves on a phone.
28
+ - `<astl-style>` first in `<astl-doc>`, by `name` (applied by `class`) or `for` a tag. The engine writes them into each
29
+ element: a view holds only `style`.
30
+ - The player draws them from a chunk that only such a view loads, through the CSSOM (a strict CSP allows it), following
31
+ the theme, and stays within the column on any screen.
32
+ - The TipTap surface keeps them on every node and mark, shows them, and keeps block moves, page breaks and
33
+ `EditorAdapter.insert` inside a column. A paste keeps what the allow-list allows, and only classes the document defines.
34
+ - ec2a249: The editor works like a word processor with block cards.
35
+
36
+ - `<astl-toolbar>`, part of `<astl-editor>`: the text style menu, bold, italic, underline, link, the two lists, undo and redo, the host's featured inserts as buttons (`featured`, from `defineEditor` or the element; `@astl/astrolabe` features text, gap, closed question, ordering, sort into groups and picture) and "More", the insert menu in a searchable popover. One tab stop with the arrow keys; a press never moves the cursor. Its groups wrap into rows, the inserts on a row of their own; only under 30rem (a phone) is it one row that scrolls sideways.
37
+ - Block cards in the TipTap surface: each block's head gives its number, type and points, with buttons to move it up or down and delete it (one undo step each, said on the status line), and "Add block" ends each page. Chips show their answer with an icon and "+N"; an option's correct marker is a toggle before its text, and "Add option" follows the last one. A card whose block has errors or warnings is dashed, in the colour of its worst issue, and says them under its head without the page ("Gap 1 has no answer."). Each page's head says "Page 2 of 3", and its title field has the visible label "Page title".
38
+ - Hosts theme the surface with `--astl-editor-*` custom properties: the sheet (corners, padding, border, focus ring), the cards (corners, padding), the card with the cursor (a ring, its kicker's colour), the kickers' size, the chips, the correct marker and the option rows (reference/editor.md, "Theming the surface").
39
+ - `label.text` ("{label}: {text}") names the insert menu's entries, the issues, the chips and the markers, so a screen reader says "Gap: The student types a word or a number." with no space before the colon.
40
+ - `EditorAdapter` has optional capabilities: `format` and `formatState`, `undo` and `redo`, `moveBlock` and `removeBlock`, `getCursor` and `onCursorChange`, `selectedText`, `focus`, and `insert(html, { replaceSelection })`. Adapters without them keep working; their controls are left out.
41
+ - `authoring.outline(source)` lists each page's blocks with their points and issue counts; `authoring.describe(issue, source)` names a component as the author sees it, never by its id (a block component by its block's number on its page, "Question 2 on page 1", a component in text by its number among its type), and with `{ page: false }` (`DescribeOptions`) without its page ("Question 2"), for a host that shows the page apart; a template's `{{selection}}` takes the selected text (a gap made from a word).
42
+ - `<astl-editor>`: `ready` and `astl-editor-ready`, `preview()`, `panels` (an empty list leaves the side column to the host's own `<astl-inspector>`).
43
+ - `@astl/astrolabe/editor` exports `createAuthoring` and its types; importing it in Node touches no DOM.
44
+ - The TipTap surface's stylesheet comes with the surface: `<astl-editor>`'s first load no longer carries it.
45
+
46
+ Breaking: `<astl-editor>` has no `insert-menu` or `tools` part (the menu is the toolbar's `more-menu`, the types' commands are toolbar buttons), and the inspector's heading names the type only, with the id in its `data-id`. The messages `surface.flag` and `surface.chip.title` give way to `label.text`, `surface.pageTitleName` is gone (the title field is named by its label and the page number), and `surface.pageNumber` takes `{pages}`.
47
+ - ba91084: `<astl-editor>` is laid out by its host: columns, bands and two states for a frame; page titles are optional.
48
+
49
+ - The work row (`part="work"`) takes two host slots: `start`, a column before the surface, and `end`, a column after the surface and the side column. A column is there only while its slot has elements (no track, no gap); from 48rem they are columns, below it `start` is above the surface and `end` below it; in another view both are hidden. Like the side column they stay in view (`--astl-editor-sticky-top`, default `--astl-space-4`, which the side column uses too) and scroll on their own when taller than the window. `--astl-editor-layout-gap` is the space between the toolbar, the status line, the work row and the preview. New parts `work`, `start` and `end`.
50
+ - The toolbar's icon-only buttons also have the part `icon-button`, the view switch `views`, its options `view` and the rule between groups `separator` (an element now, not a border of the group; it is drawn the same), exported by `<astl-editor>` as `toolbar-icon-button`, `toolbar-views`, `toolbar-view` and `toolbar-separator`.
51
+ - Frames: the hooks `--astl-editor-frame-border-width`, `--astl-editor-frame-current-border-width` (the frame keeps its size when the cursor comes in), `--astl-editor-frame-tab-background`, `--astl-editor-frame-tab-ink` and `--astl-editor-frame-tab-border` draw a rest state and the cursor's; defaults are today's look, a frame with issues keeps its dashed colour, the tab with the cursor stays the accent. The frame with the cursor has `data-astl-current` in the light DOM, for a host that draws a line from it.
52
+ - Page titles are optional. A page without a label shows its number and a small "Add title" button before "Join with page n" and "Delete page"; it shows the field (placeholder "Page title", named "Title of page 2", no visible label) and focuses it, and an empty field goes again on blur without changing the document. With a label, the field has a "Remove title" button: one undo step, the focus moves to "Add title", the notice line says "Removed the title of page 2". New hooks `--astl-editor-page-number-{font-family,size,letter-spacing,text-transform}` and `--astl-editor-page-title-{font-family,size,weight}`. New messages `surface.pageAddTitle`, `surface.pageRemoveTitle`, `surface.pageTitleOf` and `surface.pageTitleRemoved`.
53
+ - The player's generated "Page n" heading (a page without a label in a view of several pages) is visually hidden, still a heading in the accessibility tree that takes the focus; labelled pages are unchanged.
54
+ - The inspector's header shows the type's icon and name, the `id` in a monospace chip and icon buttons "Move up", "Move down" and "Delete" (their texts are the names and tooltips); under it the element's own issues as banners (icon, severity word, the sentence its frame shows). Parts `header`, `issue`, `field`, `label` and `id`. `--astl-inspector-columns` (default 1): with 2, selects, numbers and short texts sit side by side and everything else spans the row.
55
+
56
+ Changed:
57
+
58
+ - The inspector's per-element look field is "Element style" ("Styl elementu", message `inspector.styleTemplate`), not "Look" ("Wygląd").
59
+ - On the surface the page head has no visible title label: `.astl-page-title` is gone and `.astl-page-field` is a `div` that holds the title field and "Remove title"; a page without a label has no title field until "Add title".
60
+ - cfa6485: The editor reads like a word processor: one flowing text per page, with its elements framed.
61
+
62
+ - The TipTap surface frames each block component, with a label tab at the frame's top start: the type's icon, its name in bold and a summary of its items and points ("Closed question · 4 items · 1 pt", "4 elementy · 1 pkt"), never an id. Text runs are unframed. The frame with the cursor is in the accent, its tab filled; a frame with issues is dashed in the colour of the worst one and says them under its tab, without the page.
63
+ - The inspector's head gives the type and "Move up", "Move down" and "Delete" for the block component with the cursor (the adapter's `moveBlock` and `removeBlock`, left out without them): one undo step each, said in the editor's live region.
64
+ - The toolbar, in order: text style, bold, italic, underline, link, lists; the featured inserts, "Elements" (every component, "Picture", "Page break") and "Templates" (the starters), two searchable popovers whose entries have an icon, a name and a line on what they do; "Mark word"; the view switch; undo and redo. `openMenu('elements' | 'templates')` opens a menu; `<astl-insert-menu>` takes `groups`.
65
+ - The insert menus' lines are a catalog of their own per type (`messages/menu/<locale>.json`, `<type>MenuMessages`, all of them in `builtInMenuMessages` of `@astl/components/menu-messages`), which the editors load when a menu first opens: the `menuMessages` option of `defineEditor` and `createAuthoring`, and `authoring.loadMenuMessages()`. Every built-in component and starter has a one-line description in English and Polish.
66
+ - Pages can be deleted: `removePage(id)`, optional in `EditorAdapter` and in the TipTap adapter, deletes a page and everything on it, the cursor at the start of the page before (of the next one for the first page), one undo step; `false` for the only page or an unknown id. Each page head of the TipTap surface has a "Delete page" button while there are other pages, and the status message says "Deleted page 2".
67
+ - A status line under the toolbar (`part="status-line"`) counts the elements and points and says "Ready to share", or how many errors and warnings there are. It is not a live region.
68
+ - Views: `<astl-editor>` has `view` (`visual`, `source` or a host view) and `views` (the host's `{ name, label }`, an option, an attribute in JSON or a property); `source` shows the document's HTML in a monospace text area (`part="source"`), applied on the way back and kept, with its errors listed, while it has errors; a host view shows the `view-{name}` slot. Each change dispatches `astl-editor-view` (`detail: { view }`, bubbles, composed).
69
+
70
+ Breaking:
71
+
72
+ - The block cards are gone: no card heads, points fields, move and delete buttons on the surface, no "Add block" and no `astl-add-block` event.
73
+ - The surface hooks `--astl-editor-card-radius`, `--astl-editor-card-padding` and `--astl-editor-card-current-ring` are `--astl-editor-frame-radius`, `--astl-editor-frame-padding` and `--astl-editor-frame-current-ring`; `--astl-editor-card-current-kicker` is gone.
74
+ - `<astl-toolbar>`: "More" is "Elements" and "Templates"; `openMore()` is `openMenu(menu)`; the parts `more` and `more-menu` are `insert` and `insert-menu`, the icon part `icon-more` is `icon-add`.
75
+ - `DEFAULT_FEATURED` is empty: `@astl/astrolabe` features no inserts; pass `featured` to get buttons back.
76
+ - The kit's messages `toolbar.more`, `surface.blockTitle`, `surface.pointsField`, `surface.pointsUnit`, `surface.moveUp`, `surface.moveDown`, `surface.remove` and `surface.addBlock` are gone; `editor.description` and the starters' `template.*.description` moved from each type's `messages/<locale>.json` to `messages/menu/<locale>.json`.
77
+ - 4611aeb: The editor gets styles. `EditorAdapter.style` is a new optional capability, implemented on the TipTap surface. The toolbar has font, size, text colour, highlight, alignment, spacing, a style menu and clear formatting; `defineEditor({ fonts })` sets its fonts. `<astl-style-form>` (with "Own CSS", which shows what the allow-list refused, and "Save as a style") and `<astl-style-rules>` load on first use, and `astl-style-open` lets a host show them in its own place. Pictures and figures show their position and width, with a corner handle and a field that write the same. The insert menu has a group "Layout". A component in a narrow column of the surface keeps its words whole (`--astl-editor-column-with-component`).
78
+ - 6a4f220: The first release on npm, under the scope `@astl`: `@astl/astrolabe` with everything on by default, and the single packages it is built from, all at one version.
79
+ - 45245e1: The editor's HTML view lays the source out for reading: each page, block, layout, column, list and component on a line of its own, indented by its level; a paragraph's text with its gaps and selects stays on one line as it was. White space goes only where Astrolabe, the editor and browsers ignore it, so the layout is the same document. The source the editor keeps and hands to the host (`value`) is unchanged, and only looking at the HTML, or laying it out another way, changes nothing: no change event, no undo step. The text area grows with the text where the browser supports `field-sizing`. The layout comes with the view's module, outside the editor's first load.
80
+ - c500ae1: Layouts get a toolbar button of their own, "Layout", and "Elements" no longer lists them. A layout can now be removed or changed once inserted: a tab over every layout (its commands in the same row while the cursor is in it) and the layout's style form have "Change layout" (the content stays), "Remove layout" (the columns go, their content stays in place) and "Delete with content" (asked first when it holds anything), and Backspace removes an empty one; `EditorStyles.layout()` and `EditorStyles.editLayout(edit)` (optional) do the same for any adapter. Exercises are placed and sized like pictures: position and width in their card, a handle on the frame edge away from the float and the position line in the tab row, text beside them in the player from 30rem and stacked below. `Placement` and `PLACEMENTS` name the positions (`PicturePosition` and `PICTURE_POSITIONS` stay, deprecated); `LAYOUT_SHAPES`, `LAYOUT_COLUMNS` and `splitPlacement` are new.
81
+ - 3d2f905: A layout has no tab over it on the surface any more, so the page keeps the place the student sees. While the cursor is in a layout's text (in no exercise or figure there), its columns' edges turn solid in the accent colour (as wide as before, so nothing moves) and it carries `data-astl-current` (class `astl-layout-current`), as the frame with the cursor does: a host shows the layout's settings beside the page and draws its line to it. The layout's style form starts with its commands, open, under "Columns" ("Change layout", "Remove layout", "Delete with content"); its style sections follow, closed.
82
+ - 871b57a: `<astl-mark-words>` takes an optional `<astl-prompt>` before its passage, with inline formatting, shown above the hint as the prompt of every other block type. Passages without one are valid and look as before (the hint now sits in a legend, as everywhere). For type authors: a child of a rich block (`content: 'flow'`) declared with `place: 'lead'` comes first, before the content, and nowhere else (`PLACEMENT_INVALID`); the TipTap surface edits it as a node before the content. The notebook look sets it in the book face, as the other prompts.
83
+ - 2e4cc4a: Pictures from the host's own library, and refusals in the host's words.
84
+
85
+ - `pickPicture({ signal })`, an option of `createAuthoring` and `defineEditor` (type `PickPicture`), opens the host's picture library and resolves with `{ src, width?, height? }`, or `null` when the author closes it without one. The picture dialog offers "Choose from the library" beside the upload (alone without one), and so do the inspector's picture fields; the address must pass `urlPolicy`, or the dialog says the library returned an address the policy does not allow. The dialog closes while the library is open, keeping what the author typed, so a modal of the host's own takes the pointer and the keys; it opens again when the library settles, with the picture's address, size and preview, "Chosen from the library." and the focus on the alt text. `signal` aborts when the editor no longer waits (the dialog was asked for another picture or left the page, the field started another upload or pick). The note that pictures are added by address only shows only without both hooks. `Authoring.pickPicture` is the library, or `null`. New messages `picture.library`, `picture.picked`, `picture.pickFailed` and `picture.pickBlocked`.
86
+ - `UploadRefused` (from `@astl/editor` and `@astl/astrolabe/editor`): an `uploadAsset` or `pickPicture` that rejects with it has its message, already in the editor's locale, shown as it is in the picture dialog, the picture fields and the inspector's `url` fields, instead of the generic failure text.
87
+ - 0e45514: The preview plays under the host's policy: `<astl-editor>` takes `previewPolicy` (null: `PRACTICE_POLICY`), `<astl-preview>` takes `policy`, and `Authoring.preview(source, { policy })` grades under it (`PreviewOptions`). A host whose students get less help than practice offers (an author turned hints off) previews what they get; a change plays a shown preview again. On the surface, the selects of help boxes are the kit's controls, and the card's hint cost has a short label ("Cost (% of the points)", named "Hint 2: cost" for assistive tech).
88
+ - 3a4945c: Ready styles, like a word processor's built-in ones. The style menu has a group "Ready styles" after "My styles", and the style form's named field a group of the same name: Note, Tip, Important, Definition, Example and Quote go on what the cursor is in, Highlight and Small print on the selected words. Picking one adds its `<astl-style>` rule to the document, labelled in the editor's language, and sets the class in one undo step; from then on it is one of "My styles", and a document with its own rule of that name keeps it. `defineEditor({ styles })` and `createAuthoring({ styles })` replace them (`[]`: none; type `EditorStylePreset`, default `DEFAULT_STYLES`, `Authoring.styles`), and a style the allow-list refuses throws. `EditorStyles.setClass(where, name, rule)` takes the rule of a ready style. The style menu scrolls when it is taller than the window.
89
+ - 5304924: `dist/cdn/astrolabe.standalone.js`: the player, the engine and the editor in one classic script (no `type="module"`, no chunks to fetch, the tokens added to the page), its exports on `window.Astrolabe`. Each GitHub release carries it under the same name.
90
+ - 64af38f: Help for students. Three elements of the content format, inside a graded component or on a page: `<astl-hint cost>` (hints on request, one at a time, each costing a share of the points), `<astl-explanation>` (under "Why?" after a check) and `<astl-feedback when="correct|incorrect|partial|omitted">` (a text by the verdict). Compiling moves them into the key (`AnswerKey.help`); the view keeps only what is offered (`hints`, `explanation`, `feedback`). `AttemptPolicy` gets optional `hints`, `checkScope`, `feedback` and `explanations`, whose defaults by mode (`helpPolicy`, `PRACTICE_POLICY`, `TEST_POLICY`) keep old hosts working. The protocol gets `check({ answers, element })` for one interaction, `feedback` and `explanations` on responses, and `POST /hint` (`Checker.hint`, `hints_not_allowed`, `hints_exhausted`); grading takes `hintsUsed`. The server binding serves all of it and records hints with `AttemptStore.recordHint`. The player loads its help module only for views with help: "Hint (1/2)" with the cost said first, "Check" of one interaction, a feedback box by the verdict, "Why?", a page's help at its foot. The editor's card has "Help for students" (hints with cost and order, the explanation, the four feedback texts), "Elements" has "Hint", "Explanation" and "Feedback", the surface shows labelled boxes, and the preview plays them in practice. New issues: `HINT_COST_INVALID`, `FEEDBACK_WHEN_INVALID`, `FEEDBACK_DUPLICATE`, `EXPLANATION_DUPLICATE`, `HELP_UNGRADED`, `HELP_EMPTY`.
91
+
92
+ ### Patch Changes
93
+
94
+ - c912f91: The toolbar's menus and insert menus are compact.
95
+
96
+ - Popovers have a light frame (`--astl-line`), `--astl-radius-m` corners and `--astl-space-2` inside.
97
+ - Menus (paragraph style, font, size and the rest): less padding around and in the items, 2px between them; they keep `--astl-target-min`.
98
+ - Insert menus ("Elements", "Templates", "Layouts"): no visible "Insert" title (the toolbar's button names the menu; the title is still the section's name), entries without a frame (a disabled one keeps its dashed frame), and the search with `--astl-space-2` around it.
99
+ - `<astl-insert-menu>` with one group in `groups` shows that group's title to screen readers only.
100
+ - 7bd41aa: The picture dialog asks for the next picture with an empty alt text and caption: what the author typed for the last one no longer stays in those fields.
101
+ - b2a6d40: `<astl-editor>` keeps a host's sticky toolbar (`position: sticky` on `::part(toolbar)`) working: its bands are a column of flex items, not a grid, so the toolbar holds through the whole editor in every engine, not only within its grid row, and what the editor scrolls into view (the caret, a picked element or page) stops just below the toolbar instead of under it. The editor reference shows how.
102
+ - 2ac19c0: The TipTap adapter's `focus()` leaves a surface that already has the focus as it is. Called a frame after a host closes a panel, it no longer puts the cursor back where it was when the author has just clicked somewhere else.
103
+ - Updated dependencies [402924c]
104
+ - Updated dependencies [c912f91]
105
+ - Updated dependencies [97e412c]
106
+ - Updated dependencies [47b19e2]
107
+ - Updated dependencies [bac3ecb]
108
+ - Updated dependencies [ec2a249]
109
+ - Updated dependencies [ba91084]
110
+ - Updated dependencies [cfa6485]
111
+ - Updated dependencies [4611aeb]
112
+ - Updated dependencies [6a4f220]
113
+ - Updated dependencies [45245e1]
114
+ - Updated dependencies [ae90305]
115
+ - Updated dependencies [c500ae1]
116
+ - Updated dependencies [3d2f905]
117
+ - Updated dependencies [871b57a]
118
+ - Updated dependencies [2e4cc4a]
119
+ - Updated dependencies [7bd41aa]
120
+ - Updated dependencies [0e45514]
121
+ - Updated dependencies [3a4945c]
122
+ - Updated dependencies [1609051]
123
+ - Updated dependencies [b2a6d40]
124
+ - Updated dependencies [64af38f]
125
+ - Updated dependencies [2ac19c0]
126
+ - Updated dependencies [36059aa]
127
+ - @astl/core@0.1.0
128
+ - @astl/engine@0.1.0
129
+ - @astl/player@0.1.0
130
+ - @astl/editor@0.1.0
131
+ - @astl/components@0.1.0
132
+ - @astl/editor-tiptap@0.1.0
133
+ - @astl/server@0.1.0
134
+ - @astl/tokens@0.1.0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # @astl/astrolabe
2
+
3
+ Astrolabe with everything on by default: the engine, player, editor and server entries wired with the built-in
4
+ components and looks, plus the script-tag bundles in `dist/cdn/` (`astrolabe.js` grades in the browser,
5
+ `astrolabe-player.js` plays views graded by a server, `astrolabe-editor.js` is the exercise editor,
6
+ `astrolabe.standalone.js` is all of it in one classic script).
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ npm install @astl/astrolabe
12
+ ```
13
+
14
+ ## Use it from plain HTML
15
+
16
+ No install: one script tag, and the exercise is HTML with its answers in it. The page grades in the browser.
17
+
18
+ ```html
19
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@astl/astrolabe@0.1/dist/cdn/astrolabe.js"></script>
20
+
21
+ <astl-player locale="en">
22
+ <astl-doc lang="en">
23
+ <p>An elephant is <astl-gap id="g1" answer="grey"><astl-alt>gray</astl-alt></astl-gap>.</p>
24
+ </astl-doc>
25
+ </astl-player>
26
+ ```
27
+
28
+ `astrolabe-player.js` (views graded by your server), `astrolabe-editor.js` (the editor) and `astrolabe.css` (the
29
+ tokens for the page) sit in the same folder. These modules load each component when a page first uses it.
30
+
31
+ Everything in one file, the editor and the styles included: `astrolabe.standalone.js` is a classic script (no
32
+ `type="module"`) that loads nothing else and puts its exports on `window.Astrolabe`. To host it yourself, download it
33
+ from the [latest GitHub release](https://github.com/starship1337/astrolabe/releases/latest/download/astrolabe.standalone.js).
34
+
35
+ ```html
36
+ <script src="https://cdn.jsdelivr.net/npm/@astl/astrolabe@0.1/dist/cdn/astrolabe.standalone.js"></script>
37
+ ```
38
+
39
+ ## Use it with a bundler or on a server
40
+
41
+ Each entry comes wired with every built-in:
42
+
43
+ | Entry | What it gives |
44
+ |---|---|
45
+ | `@astl/astrolabe/player` | `definePlayer()`: `<astl-player>` with every built-in element and look |
46
+ | `@astl/astrolabe/editor` | `defineEditor()`: `<astl-editor>`, the exercise editor |
47
+ | `@astl/astrolabe/engine` | `createEngine()`: validate, compile and grade with every built-in component |
48
+ | `@astl/astrolabe/server` | the engine and `createGradingHandler`, the grading endpoint |
49
+
50
+ ```ts
51
+ import { definePlayer } from '@astl/astrolabe/player';
52
+
53
+ definePlayer(); // <astl-player> with every built-in element, look and style template
54
+ ```
55
+
56
+ ## This package or the single ones
57
+
58
+ Start here. The single `@astl/*` packages take explicit lists instead of defaults: pick them when you want only some
59
+ of the components, or only one part, such as the engine on a server.
60
+
61
+ Documentation: <https://astrolabe.starship.education/start/quick-start/>
62
+
63
+ ## License
64
+
65
+ Apache-2.0, see [LICENSE](https://github.com/starship1337/astrolabe/blob/main/LICENSE).