@allons-y/course-kit 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 (137) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +90 -2
  3. package/assets/fonts/instrument-sans-italic-var.woff2 +0 -0
  4. package/assets/fonts/instrument-sans-var.woff2 +0 -0
  5. package/assets/fonts/pt-mono.woff2 +0 -0
  6. package/assets/scripts/copy.js +99 -0
  7. package/assets/scripts/deck.js +161 -0
  8. package/assets/scripts/email.js +17 -0
  9. package/assets/scripts/practice.js +545 -0
  10. package/assets/scripts/theme-panel.js +647 -0
  11. package/assets/scripts/theme-restore.js +17 -0
  12. package/assets/styles/base.css +2090 -0
  13. package/assets/styles/deck.css +968 -0
  14. package/assets/styles/font.css +36 -0
  15. package/assets/styles/notes.css +137 -0
  16. package/assets/styles/print.css +428 -0
  17. package/assets/styles/semantics.css +101 -0
  18. package/components/practice/check-controls.webc +50 -0
  19. package/components/practice/choice-list.webc +86 -0
  20. package/components/practice/cite-panel.webc +108 -0
  21. package/components/practice/practice-figure.webc +47 -0
  22. package/components/practice/practice-fill.webc +154 -0
  23. package/components/practice/practice-grid.webc +82 -0
  24. package/components/practice/practice-judge.webc +165 -0
  25. package/components/practice/practice-match.webc +178 -0
  26. package/components/practice/practice-question.webc +141 -0
  27. package/components/practice/practice-selfcheck.webc +40 -0
  28. package/components/practice/practice-terms.webc +95 -0
  29. package/components/practice/practice-tree.webc +91 -0
  30. package/components/practice/practice-worksheet.webc +369 -0
  31. package/components/site/copyright.webc +13 -0
  32. package/components/site/course-documents.webc +27 -0
  33. package/components/site/course-now.webc +393 -0
  34. package/components/site/course-summary.webc +136 -0
  35. package/components/site/demo-weeks.webc +91 -0
  36. package/components/site/glossary-entry.webc +31 -0
  37. package/components/site/glossary-panel.webc +1482 -0
  38. package/components/site/glossary.webc +45 -0
  39. package/components/site/grading.webc +50 -0
  40. package/components/site/instructor.webc +269 -0
  41. package/components/site/masthead.webc +147 -0
  42. package/components/site/nav-links.webc +174 -0
  43. package/components/site/policies.webc +17 -0
  44. package/components/site/practice-index.webc +31 -0
  45. package/components/site/schedule-overview.webc +145 -0
  46. package/components/site/schedule-weeks.webc +589 -0
  47. package/components/site/site-footer.webc +119 -0
  48. package/components/site/slide-timetable.webc +152 -0
  49. package/components/site/syllabus.webc +217 -0
  50. package/components/ui/arrow-link.webc +19 -0
  51. package/components/ui/assigned-list.webc +101 -0
  52. package/components/ui/callout.webc +11 -0
  53. package/components/ui/card-list.webc +124 -0
  54. package/components/ui/codepen-embed.webc +123 -0
  55. package/components/ui/download-button.webc +49 -0
  56. package/components/ui/eyebrow.webc +18 -0
  57. package/components/ui/icons/github.webc +6 -0
  58. package/components/ui/icons/google.webc +9 -0
  59. package/components/ui/link-list.webc +130 -0
  60. package/components/ui/link-section.webc +40 -0
  61. package/components/ui/meeting-card.webc +73 -0
  62. package/components/ui/meeting-decks.webc +38 -0
  63. package/components/ui/table-rubric.webc +251 -0
  64. package/components/ui/today-link.webc +43 -0
  65. package/components/ui/today-marker.webc +149 -0
  66. package/components/ui/week-block.webc +53 -0
  67. package/examples/starter/_data/course.json +20 -0
  68. package/examples/starter/_data/dates.json +16 -0
  69. package/examples/starter/_data/grading.json +6 -0
  70. package/examples/starter/_data/instructor.json +7 -0
  71. package/examples/starter/_data/policies.json +9 -0
  72. package/examples/starter/_data/scale.json +8 -0
  73. package/examples/starter/_data/schedule.json +22 -0
  74. package/examples/starter/_data/theme.json +17 -0
  75. package/examples/starter/content/index.webc +12 -0
  76. package/examples/starter/content/schedule.webc +12 -0
  77. package/examples/starter/content/slides/index.11tydata.js +5 -0
  78. package/examples/starter/content/slides/index.webc +12 -0
  79. package/examples/starter/content/slides/week-1-day-1.md +40 -0
  80. package/examples/starter/eleventy.config.js +8 -0
  81. package/glue/deck-notes.data.js +41 -0
  82. package/glue/deck-notes.webc +32 -0
  83. package/glue/lesson-day.data.js +17 -0
  84. package/glue/lesson-day.webc +0 -0
  85. package/glue/lesson-plans.data.js +13 -0
  86. package/glue/lesson-plans.webc +2 -0
  87. package/index.js +6 -0
  88. package/layouts/base.webc +79 -0
  89. package/layouts/deck.webc +46 -0
  90. package/layouts/demo.webc +16 -0
  91. package/layouts/document.webc +10 -0
  92. package/layouts/lesson-detail.webc +109 -0
  93. package/layouts/lesson.webc +71 -0
  94. package/layouts/notes.webc +23 -0
  95. package/layouts/worksheet.webc +52 -0
  96. package/lib/assets.js +42 -0
  97. package/lib/bundles.js +79 -0
  98. package/lib/check.js +110 -0
  99. package/lib/components.js +19 -0
  100. package/lib/copy.js +653 -0
  101. package/lib/data/build.js +22 -0
  102. package/lib/data/fonts.js +16 -0
  103. package/lib/data/glossary.js +304 -0
  104. package/lib/data/index.js +8 -0
  105. package/lib/data/lessons.js +173 -0
  106. package/lib/data/project.js +22 -0
  107. package/lib/data/read.js +46 -0
  108. package/lib/data/site.js +70 -0
  109. package/lib/data/term.js +80 -0
  110. package/lib/extensions.js +70 -0
  111. package/lib/files.js +14 -0
  112. package/lib/filters.js +584 -0
  113. package/lib/fit.js +106 -0
  114. package/lib/glue.js +26 -0
  115. package/lib/lesson-materials.js +66 -0
  116. package/lib/markdown.js +568 -0
  117. package/lib/minify.js +53 -0
  118. package/lib/paths.js +5 -0
  119. package/lib/pdf.js +134 -0
  120. package/lib/plugin.js +228 -0
  121. package/lib/plugins.js +34 -0
  122. package/lib/postcss.js +93 -0
  123. package/lib/theme-server.js +88 -0
  124. package/lib/theme.js +185 -0
  125. package/lib/worksheet-dialect.js +415 -0
  126. package/lib/worksheets.js +276 -0
  127. package/package.json +118 -4
  128. package/schemas/course.schema.json +156 -0
  129. package/schemas/dates.schema.json +165 -0
  130. package/schemas/grading.schema.json +59 -0
  131. package/schemas/instructor.schema.json +68 -0
  132. package/schemas/policies.schema.json +90 -0
  133. package/schemas/project.schema.json +209 -0
  134. package/schemas/scale.schema.json +68 -0
  135. package/schemas/schedule.schema.json +260 -0
  136. package/schemas/theme.schema.json +704 -0
  137. package/schemas/worksheet.schema.json +449 -0
@@ -0,0 +1,369 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The practice worksheet page: heading, results summary, question list, sections of questions and the check controls. Reads the `worksheet` data a worksheet's `.11tydata.js` supplies; `practice.js` grades, saves and restores the answers in this browser. With `checkMode: "question"` (front matter, or `worksheets.checkMode` in the course config) each gradable question also has a Check answer button; the default, `"end"`, checks only from See results at the end.
4
+ */
5
+ </script>
6
+ <article class="content-column practice" id="worksheet" data-worksheet webc:if="$data.worksheet"
7
+ :data-storage-id="`${$data.course.code.toLowerCase()}/${$data.page.fileSlug}`">
8
+ <header class="practice-head">
9
+ <eyebrow class="separators">
10
+ <span @text="$data.term.label"></span>
11
+ <span @text="$data.course.code"></span>
12
+ <span @text="$data.worksheet.eyebrow"></span>
13
+ </eyebrow>
14
+ <h1 @text="$data.worksheet.heading"></h1>
15
+ <p class="not-graded" @text="$data.worksheet.copy.notGraded"></p>
16
+ <p class="lede" @text="$data.worksheet.lede"></p>
17
+ <p webc:for="paragraph of $data.worksheet.intro" @text="paragraph"></p>
18
+
19
+ <div class="callout">
20
+ <p><strong @text="$data.worksheet.copy.notice"></strong> <span @text="$data.worksheet.copy.noticeBody"></span></p>
21
+ </div>
22
+
23
+ <h2 id="terms" webc:if="$data.worksheet.terms?.length" @text="$data.worksheet.copy.termsHeading"></h2>
24
+ <practice-terms webc:if="$data.worksheet.terms?.length" :@terms="$data.worksheet.terms"
25
+ :@hint="$data.worksheet.copy.termsHint" :@sourceprefix="$data.worksheet.copy.termSource"></practice-terms>
26
+
27
+ <check-controls @scope="#worksheet" :@label="$data.worksheet.copy.checkAll"
28
+ :@reset="$data.worksheet.copy.resetAll" :@confirm="$data.worksheet.copy.confirmClearAll"></check-controls>
29
+ <p class="restore-note" data-restore-note role="status" hidden></p>
30
+
31
+ <section class="practice-summary" data-summary="#worksheet" aria-labelledby="practice-summary-heading" hidden>
32
+ <h2 id="practice-summary-heading" @text="$data.worksheet.copy.resultsHeading"></h2>
33
+ <p class="score"><strong data-score></strong> <span data-score-of></span></p>
34
+ <ol role="list" data-summary-list></ol>
35
+ <button type="button" data-retry="#worksheet" hidden @text="$data.worksheet.copy.retryMissed"></button>
36
+ </section>
37
+
38
+ <nav class="question-nav" aria-labelledby="question-nav-heading" data-question-nav>
39
+ <h2 id="question-nav-heading" @text="$data.worksheet.copy.navHeading"></h2>
40
+ <ol role="list">
41
+ <template webc:nokeep webc:for="section of $data.worksheet.sections">
42
+ <li webc:for="question of section.questions" :data-nav-for="question.id" data-state="unattempted">
43
+ <a :href="`#q-${question.id}`">
44
+ <span class="nav-badge" @text="question.id"></span>
45
+ <span class="nav-status" @text="$data.worksheet.copy.statusUnattempted"></span>
46
+ </a>
47
+ </li>
48
+ </template>
49
+ </ol>
50
+ </nav>
51
+ </header>
52
+
53
+ <section webc:for="section of $data.worksheet.sections" :id="`section-${section.n}`" class="practice-section">
54
+ <header>
55
+ <h2><span class="section-number" @text="`${$data.worksheet.copy.section} ${section.n}:`"></span> <span @text="section.title"></span></h2>
56
+ <p class="blurb" @text="section.blurb"></p>
57
+ <ul class="legend" webc:if="section.legend">
58
+ <li webc:for="entry of section.legend">
59
+ <span class="letter" @text="entry.letter"></span> <span @text="entry.text"></span>
60
+ </li>
61
+ </ul>
62
+ </header>
63
+
64
+ <practice-question webc:for="question of section.questions" :@q="question"></practice-question>
65
+
66
+ <check-controls :@scope="`#section-${section.n}`" :@label="`${$data.worksheet.copy.checkSection} ${section.n}`"
67
+ :@reset="$data.worksheet.copy.resetSection" :@confirm="$data.worksheet.copy.confirmClearSection"></check-controls>
68
+ </section>
69
+
70
+ <footer class="practice-foot" webc:if="$data.worksheet.footer?.length || $data.worksheet.links?.length">
71
+ <p webc:for="paragraph of $data.worksheet.footer" @text="paragraph"></p>
72
+ <ul class="foot-links" webc:if="$data.worksheet.links?.length">
73
+ <li webc:for="link of $data.worksheet.links"><a :href="link.href" @text="link.label"></a></li>
74
+ </ul>
75
+ </footer>
76
+ </article>
77
+
78
+ <style webc:scoped>
79
+ :host {
80
+ --practice-gap: 1.5em;
81
+ --color-drop-target: color-mix(in srgb, var(--color-accent) 12%, var(--color-page));
82
+
83
+ .practice-section {
84
+ border-block-start: var(--thin-border-width) solid var(--color-border);
85
+ padding-block-start: var(--content-space);
86
+
87
+ > header h2 {
88
+ margin-block-end: 0.2em;
89
+ }
90
+ }
91
+
92
+ .section-number {
93
+ color: var(--color-accent-text);
94
+ font-variant-numeric: tabular-nums;
95
+ }
96
+
97
+ .blurb {
98
+ color: var(--color-text-muted);
99
+ margin-block-start: 0;
100
+ }
101
+
102
+ .legend {
103
+ list-style: none;
104
+ padding-inline-start: 0;
105
+
106
+ li {
107
+ margin-block: 0.3em;
108
+ }
109
+ }
110
+
111
+ .letter {
112
+ background: var(--color-surface);
113
+ border-radius: var(--standard-border-radius);
114
+ display: inline-block;
115
+ font-family: var(--mono-font);
116
+ font-weight: var(--font-weight--semi-bold);
117
+ min-inline-size: 1.7em;
118
+ padding: 0.05em 0.35em;
119
+ text-align: center;
120
+ text-transform: uppercase;
121
+ }
122
+
123
+ .not-graded {
124
+ display: inline-block;
125
+ margin-block: 0;
126
+ padding: 0.1em 0.75em;
127
+ border: var(--thin-border-width) solid var(--color-border);
128
+ border-radius: 999px;
129
+ color: var(--color-text-muted);
130
+ font-size: max(var(--base-font-size), 0.875em);
131
+ }
132
+
133
+ /* The question list: one tile per question, its status mirrored from
134
+ the question by practice.js. The word carries the state; color only
135
+ reinforces it. */
136
+ .question-nav {
137
+ margin-block: var(--content-space);
138
+
139
+ h2 {
140
+ margin-block: 0 0.5em;
141
+ font-size: max(var(--base-font-size), 0.875em);
142
+ font-weight: var(--font-weight--medium);
143
+ letter-spacing: 0.08em;
144
+ text-transform: uppercase;
145
+ color: var(--color-text-muted);
146
+ }
147
+
148
+ ol {
149
+ display: grid;
150
+ grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
151
+ gap: 0.5em;
152
+ margin: 0;
153
+ padding: 0;
154
+ list-style: none;
155
+ }
156
+
157
+ a[href] {
158
+ display: flex;
159
+ text-decoration: none;
160
+ align-items: center;
161
+ gap: 0.6em;
162
+ min-block-size: var(--target-min);
163
+ padding: 0.35em 0.6em;
164
+ border: var(--thin-border-width) solid var(--color-border-strong);
165
+ border-radius: var(--standard-border-radius);
166
+ color: var(--color-text);
167
+ text-decoration: none;
168
+
169
+ &:is(:hover, :focus-visible) {
170
+ border-color: var(--color-text);
171
+ }
172
+ }
173
+
174
+ .nav-badge {
175
+ display: grid;
176
+ flex: none;
177
+ place-items: center;
178
+ min-inline-size: 2em;
179
+ block-size: 2em;
180
+ padding-inline: 0.3em;
181
+ border-radius: 999px;
182
+ background: var(--color-surface);
183
+ font-family: var(--mono-font);
184
+ font-size: 0.875em;
185
+ font-weight: var(--font-weight--bold);
186
+ }
187
+
188
+ .nav-status {
189
+ font-size: max(var(--base-font-size), 0.875em);
190
+ color: var(--color-text-muted);
191
+ }
192
+
193
+ [data-state="right"] a {
194
+ border-color: var(--color-success);
195
+
196
+ .nav-badge {
197
+ background: color-mix(in oklab, var(--color-success) 16%, var(--color-page));
198
+ }
199
+
200
+ .nav-status::before {
201
+ content: "✓ ";
202
+ }
203
+ }
204
+
205
+ [data-state="wrong"] a {
206
+ border-color: var(--color-error);
207
+
208
+ .nav-badge {
209
+ background: color-mix(in oklab, var(--color-error) 14%, var(--color-page));
210
+ }
211
+
212
+ .nav-status::before {
213
+ content: "✕ ";
214
+ }
215
+ }
216
+
217
+ [data-state="partial"] a {
218
+ border-color: var(--color-border-strong);
219
+ border-style: dashed;
220
+
221
+ .nav-status::before {
222
+ content: "✕ ";
223
+ }
224
+ }
225
+
226
+ /* Not yet looked at is not wrong: no color, only the word. */
227
+ [data-state="unattempted"] a {
228
+ border-color: var(--color-border);
229
+ }
230
+ }
231
+
232
+ .practice-summary {
233
+ .score {
234
+ display: inline-flex;
235
+ flex-direction: column;
236
+ align-items: center;
237
+ justify-content: center;
238
+ inline-size: 5.5rem;
239
+ block-size: 5.5rem;
240
+ box-sizing: border-box;
241
+ margin: 0;
242
+ border: 0.4rem solid var(--color-accent-secondary);
243
+ border-radius: 50%;
244
+ line-height: var(--font-height--dense);
245
+
246
+ strong {
247
+ font-size: var(--font-size-3);
248
+ }
249
+
250
+ span {
251
+ color: var(--color-text-muted);
252
+ font-size: max(var(--base-font-size), 0.85em);
253
+ }
254
+ }
255
+
256
+ h2 {
257
+ flex: 1 1 12rem;
258
+ margin: 0;
259
+ font-size: var(--font-size-4);
260
+ }
261
+
262
+ flex-basis: 100%;
263
+ display: flex;
264
+
265
+ &[hidden] {
266
+ display: none;
267
+ }
268
+
269
+ flex-wrap: wrap;
270
+ align-items: center;
271
+ gap: var(--content-space);
272
+ padding: 0.8em 1em;
273
+ border: var(--thin-border-width) solid var(--color-border);
274
+ border-radius: var(--standard-border-radius);
275
+ background-color: var(--color-surface);
276
+
277
+ ol {
278
+ display: flex;
279
+ flex-wrap: wrap;
280
+ gap: 0.4em;
281
+ margin: 0;
282
+ padding: 0;
283
+ list-style: none;
284
+ }
285
+
286
+ li {
287
+ display: inline-flex;
288
+ align-items: center;
289
+ gap: 0.35em;
290
+ padding: 0.15em 0.6em;
291
+ border-radius: var(--radius-pill);
292
+ border: var(--thin-border-width) solid var(--color-border);
293
+ font-size: max(var(--base-font-size), 0.9em);
294
+
295
+ a {
296
+ font-family: var(--mono-font);
297
+ font-weight: var(--font-weight--bold);
298
+ }
299
+ }
300
+
301
+ [data-status="right"] {
302
+ border-color: var(--color-success);
303
+ color: var(--color-success);
304
+ }
305
+
306
+ [data-status="wrong"] {
307
+ border-color: var(--color-error);
308
+ color: var(--color-error);
309
+ }
310
+
311
+ [data-status="partial"] {
312
+ border-style: dashed;
313
+ border-color: var(--color-border-strong);
314
+ }
315
+
316
+ [data-status="unattempted"] {
317
+ border-style: dashed;
318
+ color: var(--color-text-muted);
319
+ }
320
+
321
+ button {
322
+ min-block-size: var(--target-min);
323
+ padding-inline: 1.2em;
324
+ margin: 0;
325
+ border: var(--border-width) solid var(--color-accent);
326
+ border-radius: var(--radius-pill);
327
+ background-color: var(--color-accent);
328
+ color: var(--color-on-accent);
329
+ font-weight: var(--font-weight--semi-bold);
330
+ cursor: pointer;
331
+ }
332
+ }
333
+
334
+ .restore-note {
335
+ margin-block: 0 var(--content-space);
336
+ color: var(--color-text-muted);
337
+
338
+ &[hidden] {
339
+ display: none;
340
+ }
341
+ }
342
+
343
+ .practice-foot {
344
+ border-block-start: var(--thin-border-width) solid var(--color-border);
345
+ margin-block-start: var(--section-space);
346
+ padding-block-start: var(--content-space);
347
+ }
348
+
349
+ .foot-links {
350
+ display: flex;
351
+ flex-wrap: wrap;
352
+ gap: 1em;
353
+ list-style: none;
354
+ padding-inline-start: 0;
355
+ }
356
+
357
+ @media print {
358
+ check-controls,
359
+ .restore-note,
360
+ .question-nav,
361
+ .practice-summary,
362
+ .check-one,
363
+ .feedback,
364
+ .why {
365
+ display: none;
366
+ }
367
+ }
368
+ }
369
+ </style>
@@ -0,0 +1,13 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The copyright line: the build year and the site's author. Reads `site`.
4
+ */
5
+ </script>
6
+ <span webc:root="override">&copy;&nbsp;<span @text="$data.site.buildYear"></span> <span class="no-wrap" @text="$data.site.author"></span></span>
7
+ <style webc:scoped>
8
+ :host {
9
+ display: inline-block;
10
+ font-size: max(var(--base-font-size), 0.85em);
11
+ color: var(--color-text-muted);
12
+ }
13
+ </style>
@@ -0,0 +1,27 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The "Additional resources" list: the entries of `course.documents`, each a
4
+ * link with an optional description. A PDF is listed only when the build
5
+ * produced PDFs. Renders nothing when there are none.
6
+ * @prop {{ title: string, description?: string, href: string }[]} [documents] defaults to `course.documents`
7
+ */
8
+ const visibleDocs = (docs) => (docs ?? []).filter((doc) => $data.pdf?.available || !doc.href?.endsWith(".pdf"));
9
+ </script>
10
+ <section webc:root="override" id="documents" aria-labelledby="documents-heading" webc:if="visibleDocs(documents ?? $data.course?.documents).length">
11
+ <h2 id="documents-heading" @text="$data.copy.courseDocuments.additionalResources"></h2>
12
+ <dl>
13
+ <template webc:for="doc of visibleDocs(documents ?? $data.course?.documents)" webc:nokeep>
14
+ <dt><a :href="doc.href" @text="doc.title"></a></dt>
15
+ <dd webc:if="doc.description" @text="doc.description"></dd>
16
+ </template>
17
+ </dl>
18
+ </section>
19
+
20
+ <style webc:scoped>
21
+ /* Each link is an operable target: 44px tall (WCAG 2.5.5). */
22
+ dt a {
23
+ display: inline-flex;
24
+ align-items: center;
25
+ min-block-size: var(--target-min);
26
+ }
27
+ </style>