@instructure/platform-modules 0.3.0 → 0.4.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 (73) hide show
  1. package/dist/adapters/canvasGraphql/index.d.ts +7 -33
  2. package/dist/adapters/canvasGraphql/index.d.ts.map +1 -1
  3. package/dist/adapters/canvasGraphql/normalize.d.ts +44 -186
  4. package/dist/adapters/canvasGraphql/normalize.d.ts.map +1 -1
  5. package/dist/adapters/canvasGraphql/queries.d.ts +8 -36
  6. package/dist/adapters/canvasGraphql/queries.d.ts.map +1 -1
  7. package/dist/adapters/inMemory.d.ts +1 -25
  8. package/dist/adapters/inMemory.d.ts.map +1 -1
  9. package/dist/adapters/limits.d.ts +17 -74
  10. package/dist/adapters/limits.d.ts.map +1 -1
  11. package/dist/adapters/types.d.ts +10 -40
  12. package/dist/adapters/types.d.ts.map +1 -1
  13. package/dist/cache/invalidate.d.ts +0 -23
  14. package/dist/cache/invalidate.d.ts.map +1 -1
  15. package/dist/cache/keys.d.ts +2 -43
  16. package/dist/cache/keys.d.ts.map +1 -1
  17. package/dist/components/FilterChips.d.ts +4 -10
  18. package/dist/components/FilterChips.d.ts.map +1 -1
  19. package/dist/components/ModuleCard.d.ts +10 -25
  20. package/dist/components/ModuleCard.d.ts.map +1 -1
  21. package/dist/components/ModuleCard.stories.d.ts +15 -0
  22. package/dist/components/ModuleCard.stories.d.ts.map +1 -1
  23. package/dist/components/ModuleItemRow.d.ts.map +1 -1
  24. package/dist/components/ModuleNumberBadge.d.ts.map +1 -1
  25. package/dist/components/ModulesList.d.ts +2 -23
  26. package/dist/components/ModulesList.d.ts.map +1 -1
  27. package/dist/components/ModulesList.stories.d.ts +22 -81
  28. package/dist/components/ModulesList.stories.d.ts.map +1 -1
  29. package/dist/components/StatusPill.d.ts +0 -3
  30. package/dist/components/StatusPill.d.ts.map +1 -1
  31. package/dist/components/index.d.ts +1 -1
  32. package/dist/components/index.d.ts.map +1 -1
  33. package/dist/components/labels.d.ts +26 -43
  34. package/dist/components/labels.d.ts.map +1 -1
  35. package/dist/config/context.d.ts +0 -1
  36. package/dist/config/context.d.ts.map +1 -1
  37. package/dist/config/registry.d.ts +5 -13
  38. package/dist/config/registry.d.ts.map +1 -1
  39. package/dist/config/types.d.ts +0 -3
  40. package/dist/config/types.d.ts.map +1 -1
  41. package/dist/fixtures/generate.d.ts +6 -17
  42. package/dist/fixtures/generate.d.ts.map +1 -1
  43. package/dist/fixtures/index.d.ts +1 -1
  44. package/dist/fixtures/index.d.ts.map +1 -1
  45. package/dist/fixtures/scenarios.d.ts +7 -32
  46. package/dist/fixtures/scenarios.d.ts.map +1 -1
  47. package/dist/hooks/constants.d.ts +4 -21
  48. package/dist/hooks/constants.d.ts.map +1 -1
  49. package/dist/hooks/queryOptions.d.ts +3 -24
  50. package/dist/hooks/queryOptions.d.ts.map +1 -1
  51. package/dist/hooks/useItemsMode.d.ts +3 -52
  52. package/dist/hooks/useItemsMode.d.ts.map +1 -1
  53. package/dist/hooks/useModuleItemQueries.d.ts +0 -38
  54. package/dist/hooks/useModuleItemQueries.d.ts.map +1 -1
  55. package/dist/hooks/useModulesPageData.d.ts +3 -29
  56. package/dist/hooks/useModulesPageData.d.ts.map +1 -1
  57. package/dist/i18n.d.ts +13 -20
  58. package/dist/i18n.d.ts.map +1 -1
  59. package/dist/index.d.ts +3 -10
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +1223 -1076
  62. package/dist/types/domain.d.ts +25 -80
  63. package/dist/types/domain.d.ts.map +1 -1
  64. package/dist/types/enums.d.ts +10 -41
  65. package/dist/types/enums.d.ts.map +1 -1
  66. package/dist/types/extensions.d.ts +0 -21
  67. package/dist/types/extensions.d.ts.map +1 -1
  68. package/dist/types/index.d.ts +2 -2
  69. package/dist/types/index.d.ts.map +1 -1
  70. package/dist/types/schemas.d.ts +5 -26
  71. package/dist/types/schemas.d.ts.map +1 -1
  72. package/locales/en.json +7 -7
  73. package/package.json +22 -19
@@ -5,28 +5,12 @@ import { ModulesFilterId } from './labels';
5
5
  /**
6
6
  * The Modules Foundation design over the real data layer.
7
7
  *
8
- * Harness: `createInMemoryAdapter` over a fixture, a
9
- * `QueryClient` whose identity survives a re-render, and the adapter's
10
- * `onRequest` feeding a live counter. Nothing is mocked — the adapter is a real
11
- * implementation of the contract, including declining to inline a module above
12
- * `INLINE_ITEM_LIMIT` as Canvas REST does — so the request count in the dev
13
- * banner is the genuine cost of what is on screen.
14
- *
15
- * The counter is the most useful thing here. Switch `itemsMode` to `onDemand`,
16
- * hit "Expand all" on the large course, and watch what the design costs.
8
+ * Nothing is mocked: `createInMemoryAdapter` is a real implementation of the
9
+ * contract, so the request count in the dev banner is the genuine cost of what is
10
+ * on screen. Switch `itemsMode` to `onDemand`, hit "Expand all" on the large
11
+ * course, and watch what the design costs.
17
12
  */
18
13
  declare const FIXTURES: Record<string, () => InMemoryFixture>;
19
- /**
20
- * The four scales, as either audience.
21
- *
22
- * The teacher shape comes from `buildFixture`'s own `view` option rather than
23
- * being derived here by stripping fields. That matters for what the story shows:
24
- * a teacher sees unpublished modules and items — which is the whole reason the
25
- * teacher view exists — and no progress, because Canvas resolves `progression`
26
- * to null for a viewer with no progression record. Deriving it by deletion used
27
- * to produce the one combination Canvas cannot: an unpublished module with a
28
- * progress bar beside it.
29
- */
30
14
  type ProgressMode = 'student' | 'teacher';
31
15
  interface ModulesListStoryProps {
32
16
  fixture: keyof typeof FIXTURES;
@@ -40,51 +24,28 @@ interface ModulesListStoryProps {
40
24
  itemConcurrency: number;
41
25
  /** Expand these module ids on mount, so a story shows item rows without a click. */
42
26
  initialExpandedModuleIds: string[];
43
- /**
44
- * Which i18n bridge to render through.
45
- *
46
- * `none` is a host that supplies no catalog: every string comes from
47
- * `locales/en.json`. `pseudo` is the standard pre-translation audit — every
48
- * string is bracketed and padded, so an untranslated literal is visible on
49
- * sight and a layout that cannot survive a longer language shows up before a
50
- * translator is ever involved. `rebranded` and `partial` are host catalogs,
51
- * and both are deliberately incomplete.
52
- */
27
+ /** `rebranded` and `partial` are host catalogs, both deliberately incomplete. */
53
28
  i18n: 'none' | 'pseudo' | 'rebranded' | 'partial';
29
+ timezone: string;
54
30
  /** Clear it to render the catalog's `pageTitle` instead of a host-supplied name. */
55
31
  courseName: string;
56
32
  navigation: 'none' | 'rewritten' | 'intercepted';
57
33
  }
58
- /**
59
- * Its own `QueryClient`, deliberately — the global preview decorator builds one
60
- * in its render body, and these stories are about cache behavior.
61
- */
62
34
  declare function ModulesListHarness(props: ModulesListStoryProps): ReactElement;
63
35
  declare const meta: Meta<typeof ModulesListHarness>;
64
36
  export default meta;
65
37
  type Story = StoryObj<typeof meta>;
66
- /**
67
- * The design, near enough: 5 modules × 8 items with module 1 open.
68
- *
69
- * `auto` resolves to `inline`, so opening any other module costs zero extra
70
- * requests — the counter in the dev banner stays put as you click around.
71
- */
38
+ /** `auto` resolves to `inline`, so opening another module costs zero extra requests. */
72
39
  export declare const Default: Story;
73
40
  /**
74
- * 120 modules × 25 items. `auto` resolves to `onDemand` and first paint is a
75
- * single request no matter how big the course is.
76
- *
77
- * The point of this story is the button at the bottom: `hasNextPage` is true,
78
- * it says so, and the remaining 20 modules are one click away rather than gone.
79
- * Canvas Career shows 100 and says nothing.
41
+ * 120 modules. `auto` resolves to `onDemand`, so first paint is one request whatever the
42
+ * course size, and the button at the bottom is the point: the remaining 20 modules are one
43
+ * click away rather than gone. Canvas Career shows 100 and says nothing.
80
44
  */
81
45
  export declare const LargeCourse: Story;
82
46
  /**
83
- * 3 modules, the middle one 250 items, pinned to `inline` the Canvas fallback
84
- * in miniature. Modules 1 and 3 come back with items attached; module 2 is over
85
- * `INLINE_ITEM_LIMIT` so the server omits its items and that *one module* falls
86
- * back to a per-module fetch, then pages 100 at a time. "Load more items" stays
87
- * on the card until all 250 are loaded.
47
+ * Pinned to `inline` with a 250-item middle module: that *one module* is over
48
+ * `INLINE_ITEM_LIMIT`, so it alone falls back to a per-module fetch and pages 100 at a time.
88
49
  */
89
50
  export declare const FatModuleInlineFallback: Story;
90
51
  /** Every shape an item title can take: linked, new tab, sub-header, no url, long, locked. */
@@ -96,13 +57,8 @@ export declare const ItemTitleLinksIntercepted: Story;
96
57
  /** No modules. The empty state. */
97
58
  export declare const EmptyCourse: Story;
98
59
  /**
99
- * Teacher / anonymous: `progress` is undefined on every module and `status` on
100
- * every item.
101
- *
102
- * The card renders no progress bar and no status pill, and nowhere does it say
103
- * "0%" — "we did not fetch progress" and "the student has done none of it" are
104
- * different facts. Every filter chip except "All" correctly matches nothing,
105
- * because a module-level filter has nothing to read.
60
+ * Teacher / anonymous. Nowhere does it say "0%" "we did not fetch progress" and "none of
61
+ * it is done" are different facts. Every chip except "All" correctly matches nothing.
106
62
  */
107
63
  export declare const TeacherViewNoProgress: Story;
108
64
  /** `progress.status === 'in_progress'`. */
@@ -110,13 +66,8 @@ export declare const FilterInProgress: Story;
110
66
  /** `progress.status` is `all_submitted` or `all_graded`. */
111
67
  export declare const FilterComplete: Story;
112
68
  /**
113
- * `progress.latestDueAt` within 7 days of the injected "today" (2025-01-08).
114
- *
115
- * On the small fixture rather than the large one, deliberately: `latestDueAt` is
116
- * the *latest* due date in a module, and a 25-item module's latest date is
117
- * always months out, so the large course legitimately has nothing in a 7-day
118
- * window. A story that only ever showed the empty state would prove nothing
119
- * about the chip.
69
+ * Small fixture on purpose: `latestDueAt` is a module's *latest* date, so a 25-item module's
70
+ * is always months out and the large course legitimately matches nothing.
120
71
  */
121
72
  export declare const FilterDueThisWeek: Story;
122
73
  /** `progress.missingCount > 0`. */
@@ -124,25 +75,15 @@ export declare const FilterMissing: Story;
124
75
  /**
125
76
  * Every module status and every item status on one screen.
126
77
  *
127
- * `courseSmall` is sized to `MODULE_STATUS_CYCLE.length` precisely so it can
128
- * show all six `ModuleStatus` values; expanding every module then shows every
129
- * `ModuleItemStatus` too, so a reviewer can check the whole pill mapping in one
130
- * screenshot. Note the mock's single green "All items complete" pill is split
131
- * here into "All items complete" (`all_submitted`) and "All items graded"
132
- * (`all_graded`), because the domain distinguishes them and the view should not
133
- * quietly collapse the two.
78
+ * `courseSmall` is sized to `MODULE_STATUS_CYCLE.length`, so expanding every
79
+ * module covers the whole mapping in one screenshot. Module 1 is `not_started`
80
+ * throughout and module 6 is `locked` throughout, which is the density check.
134
81
  */
135
82
  export declare const StatusCoverage: Story;
136
83
  /**
137
- * Every user-visible string, bracketed and padded.
138
- *
139
- * This is the story that makes the i18n seam reviewable rather than asserted: a
140
- * string rendering *without* `⟦ ⟧` never went through `t`. Padding to ~135%
141
- * approximates German, so it also shows whether the card header, the chip row
142
- * and the "Load more" button survive a longer language.
143
- *
144
- * The one deliberate exception is the dev diagnostics banner, which is developer
145
- * text and is documented as untranslated in `ModuleCard`.
84
+ * A string rendering *without* `⟦ ⟧` never went through `t`. Padding to ~135% approximates
85
+ * German, so it also shows whether the layout survives a longer language. The dev diagnostics
86
+ * banner is the one deliberate exception.
146
87
  */
147
88
  export declare const PseudoLocalized: Story;
148
89
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ModulesList.stories.d.ts","sourceRoot":"","sources":["../../src/components/ModulesList.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,OAAO,CAAA;AAE5D,OAAO,EASL,KAAK,eAAe,EACpB,KAAK,SAAS,EAKf,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG/C;;;;;;;;;;;;GAYG;AAEH,QAAA,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,eAAe,CAMnD,CAAA;AAoBD;;;;;;;;;;GAUG;AAIH,KAAK,YAAY,GAAG,SAAS,GAAG,SAAS,CAAA;AAEzC,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,OAAO,QAAQ,CAAA;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AAO,MAAM,eAAe,EAAE,KAO7B,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAA"}
@@ -3,16 +3,13 @@ import { TranslateFunction } from '../i18n';
3
3
  import { ModuleItemStatus, ModuleStatus } from '../types';
4
4
  /** Exhaustive: a new `ModuleStatus` is a compile error until it has a label. */
5
5
  export declare function moduleStatusLabel(t: TranslateFunction, status: ModuleStatus): string;
6
- /** @see moduleStatusLabel */
7
6
  export declare function moduleItemStatusLabel(t: TranslateFunction, status: ModuleItemStatus): string;
8
7
  export interface ModuleStatusPillProps {
9
8
  status: ModuleStatus;
10
9
  }
11
- /** @see ModuleStatusPillProps */
12
10
  export declare function ModuleStatusPill({ status }: ModuleStatusPillProps): ReactElement;
13
11
  export interface ModuleItemStatusPillProps {
14
12
  status: ModuleItemStatus;
15
13
  }
16
- /** @see ModuleItemStatusPillProps */
17
14
  export declare function ModuleItemStatusPill({ status }: ModuleItemStatusPillProps): ReactElement;
18
15
  //# sourceMappingURL=StatusPill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatusPill.d.ts","sourceRoot":"","sources":["../../src/components/StatusPill.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AA4C9D,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAepF;AAED,6BAA6B;AAC7B,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAe5F;AAUD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,iCAAiC;AACjC,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE,qBAAqB,GAAG,YAAY,CAOhF;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,gBAAgB,CAAA;CACzB;AAED,qCAAqC;AACrC,wBAAgB,oBAAoB,CAAC,EAAE,MAAM,EAAE,EAAE,yBAAyB,GAAG,YAAY,CAOxF"}
1
+ {"version":3,"file":"StatusPill.d.ts","sourceRoot":"","sources":["../../src/components/StatusPill.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAwC9D,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAepF;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAmB5F;AAUD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE,qBAAqB,GAAG,YAAY,CAOhF;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,gBAAgB,CAAA;CACzB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,MAAM,EAAE,EAAE,yBAAyB,GAAG,YAAY,CAOxF"}
@@ -1,5 +1,5 @@
1
1
  export { FilterChips, type FilterChipsProps } from './FilterChips';
2
- export { calendarDayDiff, DUE_THIS_WEEK_DAYS, filterLabel, formatDateTime, formatDueByline, formatModuleNumber, formatPoints, formatUnlockByline, itemTypeLabel, moduleMatchesFilter, moduleMatchesSearch, MODULES_FILTER_IDS, type ModulesFilterId, progressSummary, requirementLabel, } from './labels';
2
+ export { calendarDayDiff, DUE_THIS_WEEK_DAYS, filterLabel, type DateFormatOptions, formatDateTime, formatDueByline, formatModuleNumber, formatPoints, formatUnlockByline, itemTypeLabel, moduleMatchesFilter, moduleMatchesSearch, MODULES_FILTER_IDS, type ModulesFilterId, progressScreenReaderValue, progressSummary, requirementLabel, } from './labels';
3
3
  export { ModuleCard, type ModuleCardProps } from './ModuleCard';
4
4
  export { ModuleItemRow, type ModuleItemRowProps } from './ModuleItemRow';
5
5
  export { ModuleNumberBadge, type ModuleNumberBadgeProps } from './ModuleNumberBadge';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,eAAe,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAC7F,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,KAAK,iBAAiB,EACtB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,eAAe,EACpB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,GACjB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAC7F,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAA"}
@@ -1,26 +1,26 @@
1
1
  import { TranslateFunction } from '../i18n';
2
2
  import { CompletionRequirement, Module, ModuleItemType } from '../types';
3
- /** Whole calendar days between two dates, ignoring the time of day. */
4
- export declare function calendarDayDiff(a: Date, b: Date): number;
3
+ export interface DateFormatOptions {
4
+ locale?: string;
5
+ /** IANA zone. Omitted renders in the viewer's own clock and prints no zone. */
6
+ timezone?: string;
7
+ }
5
8
  /**
6
- * "today, 11:59 PM" / "yesterday, 11:59 PM" / "January 12, 11:59 PM".
7
- *
8
- * The relative words are separate keys rather than one string with a placeholder,
9
- * because a language that puts the time first, or inflects "yesterday" by what
10
- * follows it, needs to move the pieces independently.
11
- *
12
- * No timezone suffix. The domain model carries none and this package may not read
13
- * one off the host, so printing one would be a guess — see `src/i18n.tsx`.
9
+ * Whole calendar days between two dates, ignoring the time of day. Counted in
10
+ * `timezone` when given, so "today" agrees with the clock time rendered beside it.
14
11
  */
15
- export declare function formatDateTime(t: TranslateFunction, iso: string, today: Date, locale?: string): string;
16
- /** The module header byline when the module is open: "Due yesterday, 11:59 PM". */
17
- export declare function formatDueByline(t: TranslateFunction, iso: string, today: Date, locale?: string): string;
18
- /** The module header byline when the module is locked. */
19
- export declare function formatUnlockByline(t: TranslateFunction, iso: string, today: Date, locale?: string): string;
12
+ export declare function calendarDayDiff(a: Date, b: Date, timezone?: string): number;
20
13
  /**
21
- * "01", "02", "120". `Intl` rather than `padStart` so a locale's own digits show.
22
- * Anything but a positive integer is an unknown position and returns `null`.
14
+ * The relative words are separate keys, not one string with a placeholder: a language that
15
+ * puts the time first, or inflects "yesterday" by what follows, must move the pieces.
16
+ *
17
+ * The zone abbreviation is appended only when the host supplies a `timezone` — without one
18
+ * there is nothing to print but a guess.
23
19
  */
20
+ export declare function formatDateTime(t: TranslateFunction, iso: string, today: Date, { locale, timezone }?: DateFormatOptions): string;
21
+ export declare function formatDueByline(t: TranslateFunction, iso: string, today: Date, options?: DateFormatOptions): string;
22
+ export declare function formatUnlockByline(t: TranslateFunction, iso: string, today: Date, options?: DateFormatOptions): string;
23
+ /** `Intl` rather than `padStart` so a locale's own digits show. */
24
24
  export declare function formatModuleNumber(position: number, locale?: string): string | null;
25
25
  export declare function itemTypeLabel(t: TranslateFunction, type: ModuleItemType): string;
26
26
  /** "10 pts". Null/undefined points render nothing at all, not "0 pts". */
@@ -35,15 +35,8 @@ export declare function formatPoints(t: TranslateFunction, pointsPossible: numbe
35
35
  * is the wrong failure.
36
36
  */
37
37
  export declare function requirementLabel(t: TranslateFunction, requirement: CompletionRequirement): string;
38
- /**
39
- * "75% | 3 of 4 requirements met", straight off the design.
40
- *
41
- * The `|` is baked into the translatable string, which is not ideal — a translator
42
- * cannot tell it is a divider rather than punctuation, and a screen reader may
43
- * either skip it or announce "vertical bar". Left as one key because splitting it
44
- * changes the design's copy; flagged rather than quietly restructured.
45
- */
46
38
  export declare function progressSummary(t: TranslateFunction, percentComplete: number, met: number, total: number): string;
39
+ export declare function progressScreenReaderValue(t: TranslateFunction, percentComplete: number, met: number, total: number): string;
47
40
  export type ModulesFilterId = 'all' | 'in_progress' | 'complete' | 'due_this_week' | 'missing';
48
41
  /**
49
42
  * The chip order the design draws, as ids only.
@@ -59,27 +52,17 @@ export declare const DUE_THIS_WEEK_DAYS = 7;
59
52
  /**
60
53
  * Filter chips are **module-level only**, by design.
61
54
  *
62
- * Every predicate reads `module.progress`, which the adapter returns with the
63
- * module list. None of them touch items. That is deliberate: in `onDemand` mode
64
- * the items of a collapsed module have not been fetched, so an item-level
65
- * filter would either lie or cost one request per module. The designer's
66
- * annotation says the filters describe the *module's* overall status, which is
67
- * exactly the cheap version.
55
+ * Every predicate reads `module.progress` and none touch items: in `onDemand`
56
+ * mode a collapsed module's items are not fetched, so an item-level filter would
57
+ * either lie or cost one request per module.
68
58
  *
69
- * A module with no `progress` (teacher/anonymous view) matches only "All" —
70
- * "we did not fetch progress" is not the same as "not in progress".
59
+ * A module with no `progress` (teacher/anonymous) matches only "All" — "we did
60
+ * not fetch progress" is not "not in progress".
71
61
  */
72
- export declare function moduleMatchesFilter(module: Module, filter: ModulesFilterId, today: Date): boolean;
62
+ export declare function moduleMatchesFilter(module: Module, filter: ModulesFilterId, today: Date, timezone?: string): boolean;
73
63
  /**
74
- * Search matches **module names only**, never item titles.
75
- *
76
- * Same reason as the filters: with `onDemand` pagination the items of collapsed
77
- * modules are not in memory, so an item-level search would silently under-report
78
- * — the one thing this package exists to prevent. The input is labeled
79
- * "Search module names" so the limit is on screen rather than in a comment.
80
- *
81
- * `toLocaleLowerCase` rather than `toLowerCase`: the Turkish dotless i is the
82
- * standard counterexample, and a course in Turkish should find its own modules.
64
+ * Module names only: with `onDemand` the items of collapsed modules are not in memory, so an
65
+ * item-level search would silently under-report. `toLocaleLowerCase` for the Turkish dotless i.
83
66
  */
84
67
  export declare function moduleMatchesSearch(module: Module, query: string, locale?: string): boolean;
85
68
  //# sourceMappingURL=labels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/components/labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AA8D7E,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAIxD;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,iBAAiB,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,IAAI,EACX,MAAM,GAAE,MAAuB,GAC9B,MAAM,CAiBR;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAC7B,CAAC,EAAE,iBAAiB,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,IAAI,EACX,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAER;AAED,0DAA0D;AAC1D,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,iBAAiB,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,IAAI,EACX,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAER;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,MAAuB,GAC9B,MAAM,GAAG,IAAI,CAGf;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CAmBhF;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAC1B,CAAC,EAAE,i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;AAED,wBAAgB,yBAAyB,CACvC,CAAC,EAAE,iBAAiB,EACpB,eAAe,EAAE,MAAM,EACvB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAID,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,aAAa,GAAG,UAAU,GAAG,eAAe,GAAG,SAAS,CAAA;AAE9F;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAMxD,CAAA;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE,eAAe,GAAG,MAAM,CAa7E;AAED,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,IAAI,EACX,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CA2BT;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAI3F"}
@@ -6,6 +6,5 @@ export interface ModulesConfigProviderProps {
6
6
  }
7
7
  /** Optional. Without it the package renders against `baseModulesConfig`. */
8
8
  export declare function ModulesConfigProvider({ value, children }: ModulesConfigProviderProps): ReactNode;
9
- /** The resolved config, falling back to `baseModulesConfig`. */
10
9
  export declare function useModulesConfig(): ModulesConfig;
11
10
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/config/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,aAAa,CAAA;IACpB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,0BAA0B,GAAG,SAAS,CAEhG;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/config/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,aAAa,CAAA;IACpB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,0BAA0B,GAAG,SAAS,CAEhG;AAED,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD"}
@@ -14,25 +14,17 @@ export declare const hasOwn: (target: object, key: string) => boolean;
14
14
  /** Spread one object over another, skipping explicit `undefined` so a stated key cannot blank an inherited value. */
15
15
  export declare function overlay<T extends object>(base: Partial<T>, over: Partial<T> | undefined): T;
16
16
  /**
17
- * Fold an override over a base registry, one entry at a time:
18
- * `{ ...base[key], ...override[key] }`. A key the base has is an overlay; a key
19
- * it doesn't is an addition.
17
+ * Result key order is what `visibleEntries` breaks ties on — base keys in base order, then
18
+ * additions sorted by key, so a host cannot change rendered order by reordering its literal.
20
19
  *
21
- * Key order of the result is what `visibleEntries` breaks ties on: base keys in
22
- * base order, then additions sorted by key so a host cannot change the rendered
23
- * order by reordering its own literal.
24
- *
25
- * Copies every entry, so neither argument is mutated or shared. Built by spread
26
- * rather than assignment, and keyed by own properties only, so an override
27
- * parsed from host JSON cannot reach `Object.prototype` through a `__proto__`
28
- * or `constructor` key.
20
+ * Keyed by own properties only, so an override parsed from host JSON cannot reach
21
+ * `Object.prototype` via `__proto__` or `constructor`.
29
22
  */
30
23
  export declare function mergeRegistry<E extends RegistryEntry>(base: Registry<E>, override?: RegistryOverride<E>): Registry<E>;
31
24
  /**
32
25
  * The entries a host has left switched on, sorted by `order` ascending.
33
26
  *
34
- * Ties fall through to key order, per `mergeRegistry` above — `Array#sort` is
35
- * stable by specification from ES2019.
27
+ * Ties fall through to key order, per `mergeRegistry` above.
36
28
  *
37
29
  * Filtering `hidden` here rather than at the merge is what lets a host inspect
38
30
  * what it turned off.
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/config/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE9C;;;;GAIG;AAEH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAEjF,6IAA6I;AAC7I,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAElG,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvF,eAAO,MAAM,MAAM,GAAI,QAAQ,MAAM,EAAE,KAAK,MAAM,KAAG,OACF,CAAA;AAEnD,qHAAqH;AACrH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,CAAC,CAI3F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EACnD,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EACjB,QAA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c,CAAC,CAAC,SAAS,aAAa,EACpD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GACpB,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAKhC"}
@@ -1,8 +1,6 @@
1
1
  import { Registry, RegistryOverride } from './registry';
2
- /** Pure display functions over domain values. */
3
2
  export interface ModulesFormatters {
4
3
  }
5
- /** Where a click on a module or an item goes. */
6
4
  export interface ModulesNavigation {
7
5
  }
8
6
  /**
@@ -18,7 +16,6 @@ export interface ModulesConfig {
18
16
  itemActions: Registry;
19
17
  navigation: ModulesNavigation;
20
18
  }
21
- /** A host writes only the surfaces it wants different from the base. */
22
19
  export interface ModulesConfigOverride {
23
20
  formatters?: Partial<ModulesFormatters>;
24
21
  itemTypes?: RegistryOverride;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE5D,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;CAAG;AAErC,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;CAAG;AAErC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,iBAAiB,CAAA;IAC7B,SAAS,EAAE,QAAQ,CAAA;IACnB,YAAY,EAAE,QAAQ,CAAA;IACtB,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE,QAAQ,CAAA;IACjB,aAAa,EAAE,QAAQ,CAAA;IACvB,WAAW,EAAE,QAAQ,CAAA;IACrB,UAAU,EAAE,iBAAiB,CAAA;CAC9B;AAED,wEAAwE;AACxE,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACvC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,aAAa,CAAC,EAAE,gBAAgB,CAAA;IAChC,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACxC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE5D,MAAM,WAAW,iBAAiB;CAAG;AAErC,MAAM,WAAW,iBAAiB;CAAG;AAErC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,iBAAiB,CAAA;IAC7B,SAAS,EAAE,QAAQ,CAAA;IACnB,YAAY,EAAE,QAAQ,CAAA;IACtB,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE,QAAQ,CAAA;IACjB,aAAa,EAAE,QAAQ,CAAA;IACvB,WAAW,EAAE,QAAQ,CAAA;IACrB,UAAU,EAAE,iBAAiB,CAAA;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACvC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,aAAa,CAAC,EAAE,gBAAgB,CAAA;IAChC,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACxC"}
@@ -1,18 +1,8 @@
1
1
  import { InMemoryFixture } from '../adapters/inMemory';
2
2
  import { ModuleStatus } from '../types/domain';
3
- /**
4
- * The full `ModuleStatus` enum, one per module, cycled.
5
- *
6
- * Exported because it is also the reason `SMALL_MODULE_COUNT` is what it is:
7
- * a fixture shorter than this cycle cannot show every state.
8
- */
3
+ /** Also the reason `SMALL_MODULE_COUNT` is what it is: a shorter fixture hides a state. */
9
4
  export declare const MODULE_STATUS_CYCLE: readonly ModuleStatus[];
10
- /** The course every fixture belongs to; only used to build plausible URLs. */
11
5
  export declare const FIXTURE_COURSE_ID = "1";
12
- /**
13
- * Build a fixture from a per-module item count, e.g. `[8, 250, 8]` is three
14
- * modules where the middle one is far past the inline limit.
15
- */
16
6
  /**
17
7
  * Which audience the fixture describes.
18
8
  *
@@ -21,15 +11,10 @@ export declare const FIXTURE_COURSE_ID = "1";
21
11
  *
22
12
  * - `student` — everything is published, and every module carries a `progress`
23
13
  * with every item a `status`. A student's module list contains no unpublished
24
- * content at all; that is exactly why normalization rule 2 reads a null
25
- * `published` as `true` for a viewer without manage permission.
14
+ * content at all.
26
15
  * - `teacher` — publish state varies, and nothing carries progress. Canvas
27
16
  * resolves `progression` to null for a viewer with no progression record, so a
28
17
  * teacher fixture with a `progress` would be describing a student.
29
- *
30
- * The bug this fixes: the generator used to emit unpublished modules *and*
31
- * student progress on the same module, so `courseSmall`'s module 4 rendered as
32
- * "(unpublished)" next to a progress bar — a combination that cannot occur.
33
18
  */
34
19
  export type FixtureView = 'student' | 'teacher';
35
20
  export interface BuildFixtureOptions {
@@ -44,5 +29,9 @@ export interface BuildFixtureOptions {
44
29
  */
45
30
  courseId?: string;
46
31
  }
32
+ /**
33
+ * Build a fixture from a per-module item count, e.g. `[8, 250, 8]` is three
34
+ * modules where the middle one is far past the inline limit.
35
+ */
47
36
  export declare function buildFixture(itemCounts: readonly number[], options?: BuildFixtureOptions): InMemoryFixture;
48
37
  //# sourceMappingURL=generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/fixtures/generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAQV,YAAY,EACb,MAAM,iBAAiB,CAAA;AA4DxB;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,YAAY,EAOtD,CAAA;AA6BD,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,MAAM,CAAA;AA4PpC;;;GAGG;AACH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAA;AAE/C,MAAM,WAAW,mBAAmB;IAClC,6BAA6B;IAC7B,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAgBD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,GAAE,mBAAwB,GAChC,eAAe,CAiBjB"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/fixtures/generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAQV,YAAY,EACb,MAAM,iBAAiB,CAAA;AAiBxB,2FAA2F;AAC3F,eAAO,MAAM,mBAAmB,EAAE,SAAS,YAAY,EAOtD,CAAA;AA2BD,eAAO,MAAM,iBAAiB,MAAM,CAAA;AAsPpC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAA;AAE/C,MAAM,WAAW,mBAAmB;IAClC,6BAA6B;IAC7B,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAgBD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,GAAE,mBAAwB,GAChC,eAAe,CAiBjB"}
@@ -1,3 +1,3 @@
1
1
  export { buildFixture, type BuildFixtureOptions, FIXTURE_COURSE_ID, type FixtureView, MODULE_STATUS_CYCLE, } from './generate';
2
- export { courseEmpty, courseFatModule, courseItemLinks, courseLarge, courseSmall, FAT_MODULE_ITEM_COUNT, FAT_MODULE_SIBLING_ITEM_COUNT, LARGE_ITEMS_PER_MODULE, LARGE_MODULE_COUNT, SMALL_ITEMS_PER_MODULE, SMALL_MODULE_COUNT, } from './scenarios';
2
+ export { courseEmpty, courseFatModule, courseItemLinks, courseLarge, courseLockReasons, courseSmall, FAT_MODULE_ITEM_COUNT, FAT_MODULE_SIBLING_ITEM_COUNT, FUTURE_UNLOCK_AT, LARGE_ITEMS_PER_MODULE, LARGE_MODULE_COUNT, PAST_UNLOCK_AT, SMALL_ITEMS_PER_MODULE, SMALL_MODULE_COUNT, } from './scenarios';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,KAAK,WAAW,EAChB,mBAAmB,GACpB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,EACf,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,6BAA6B,EAC7B,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,KAAK,WAAW,EAChB,mBAAmB,GACpB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,aAAa,CAAA"}
@@ -1,16 +1,7 @@
1
1
  import { InMemoryFixture } from '../adapters/inMemory';
2
- /**
3
- * Four named scales. Each one exists to make a specific failure impossible to
4
- * ship silently, so they are sized against real Canvas limits rather than
5
- * chosen for convenience.
6
- */
7
- /**
8
- * 6 modules × 8 items. Inline mode resolves; the whole course in ~2 requests.
9
- *
10
- * The module count is `MODULE_STATUS_CYCLE.length` rather than a round number:
11
- * this is the fixture a story reaches for by default, and at five modules it
12
- * would silently omit one of the six `ModuleStatus` states.
13
- */
2
+ export declare const FUTURE_UNLOCK_AT = "2099-08-31T06:59:00Z";
3
+ export declare const PAST_UNLOCK_AT = "2020-01-06T07:00:00Z";
4
+ /** `MODULE_STATUS_CYCLE.length` modules, not a round number: fewer hides a `ModuleStatus`. */
14
5
  export declare const SMALL_MODULE_COUNT: number;
15
6
  export declare const SMALL_ITEMS_PER_MODULE = 8;
16
7
  /** 120 modules × 25 items. Past the 100-per-page module limit Career truncates at. */
@@ -19,29 +10,13 @@ export declare const LARGE_ITEMS_PER_MODULE = 25;
19
10
  /** 3 modules, the middle one 250 items — 2.5× `INLINE_ITEM_LIMIT`. */
20
11
  export declare const FAT_MODULE_ITEM_COUNT = 250;
21
12
  export declare const FAT_MODULE_SIBLING_ITEM_COUNT = 8;
22
- /**
23
- * The happy path: everything fits in one page of modules with items inlined,
24
- * so a correct implementation renders the course in about two requests.
25
- */
26
13
  export declare function courseSmall(): InMemoryFixture;
27
- /**
28
- * Module-list pagination past 100. Canvas caps `per_page` at 100, so a client
29
- * that ignores the next cursor shows 100 of 120 modules and says nothing —
30
- * which is what Canvas Career does today.
31
- */
14
+ /** A client that ignores the next cursor shows 100 of 120 and says nothing, as Career does. */
32
15
  export declare function courseLarge(): InMemoryFixture;
33
- /**
34
- * Item pagination past `INLINE_ITEM_LIMIT`. Canvas omits the `items` key
35
- * entirely for the fat module, so the client must fall back to a per-module
36
- * fetch and then page it. The "renders exactly 100 items and stops" bug lives
37
- * here and cannot recur while this fixture is in the suite.
38
- */
16
+ /** The "renders exactly 100 items and stops" bug cannot recur while this is in the suite. */
39
17
  export declare function courseFatModule(): InMemoryFixture;
40
- /** No modules at all. The empty state exists before the designs specify it. */
18
+ /** Prerequisites point at modules outside this fixture, as they do on a paged course. */
19
+ export declare function courseLockReasons(): InMemoryFixture;
41
20
  export declare function courseEmpty(): InMemoryFixture;
42
- /**
43
- * The item-title edge cases, hand-authored: linked, new tab, sub-header, no url,
44
- * a very long title, and locked.
45
- */
46
21
  export declare function courseItemLinks(): InMemoryFixture;
47
22
  //# sourceMappingURL=scenarios.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scenarios.d.ts","sourceRoot":"","sources":["../../src/fixtures/scenarios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAO3D;;;;GAIG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAmC,CAAA;AACpE,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,MAAM,CAAA;AACrC,eAAO,MAAM,sBAAsB,KAAK,CAAA;AAExC,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,MAAM,CAAA;AACxC,eAAO,MAAM,6BAA6B,IAAI,CAAA;AAE9C;;;GAGG;AACH,wBAAgB,WAAW,IAAI,eAAe,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,eAAe,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,eAAe,CAMjD;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,IAAI,eAAe,CAE7C;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,eAAe,CA8CjD"}
1
+ {"version":3,"file":"scenarios.d.ts","sourceRoot":"","sources":["../../src/fixtures/scenarios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAM3D,eAAO,MAAM,gBAAgB,yBAAyB,CAAA;AACtD,eAAO,MAAM,cAAc,yBAAyB,CAAA;AAKpD,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,EAAE,MAAmC,CAAA;AACpE,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,MAAM,CAAA;AACrC,eAAO,MAAM,sBAAsB,KAAK,CAAA;AAExC,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,MAAM,CAAA;AACxC,eAAO,MAAM,6BAA6B,IAAI,CAAA;AAE9C,wBAAgB,WAAW,IAAI,eAAe,CAE7C;AAED,+FAA+F;AAC/F,wBAAgB,WAAW,IAAI,eAAe,CAE7C;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,IAAI,eAAe,CAMjD;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,IAAI,eAAe,CAwCnD;AAED,wBAAgB,WAAW,IAAI,eAAe,CAE7C;AAED,wBAAgB,eAAe,IAAI,eAAe,CA8CjD"}
@@ -3,13 +3,7 @@ import { PageInfo } from '../types/domain';
3
3
  export declare const DEFAULT_PAGE_SIZE: number;
4
4
  /** Items are paged separately; same ceiling. */
5
5
  export declare const DEFAULT_ITEM_PAGE_SIZE: number;
6
- /**
7
- * Per-module ceiling above which inlining stops being worthwhile.
8
- *
9
- * Matches `Api::MAX_PER_PAGE` and `INLINE_ITEM_LIMIT`. On REST that is Canvas's
10
- * own rule — the `items` key is simply absent above it. On GraphQL it is this
11
- * package's policy rather than a server constraint. @see INLINE_ITEM_LIMIT
12
- */
6
+ /** Per-module ceiling above which inlining stops being worthwhile. @see INLINE_ITEM_LIMIT */
13
7
  export declare const DEFAULT_INLINE_THRESHOLD: number;
14
8
  /**
15
9
  * How many per-module item requests may be in flight at once.
@@ -28,20 +22,9 @@ export declare const DEFAULT_ITEM_CONCURRENCY: number;
28
22
  */
29
23
  export declare const DEFAULT_STALE_TIME_MS: number;
30
24
  /**
31
- * How many *collapsed* modules keep their item query subscribed.
32
- *
33
- * A collapsed module's observer is retained on purpose that is what makes
34
- * re-expanding a guaranteed cache hit rather than a lucky one. But retention has
35
- * to stop somewhere: "Expand all" followed by "Collapse all" on a 120-module
36
- * course would otherwise leave 120 subscriptions alive for the life of the page,
37
- * each pinning its own pages of items past any `gcTime`.
38
- *
39
- * Twenty is chosen against the interaction rather than the data: a reader moving
40
- * through a course revisits the handful of modules around where they are, and
41
- * twenty covers that with room to spare while keeping the retained set a fixed
42
- * cost instead of one that grows with course size. Above the cap the
43
- * least-recently-active collapsed module is evicted, and re-expanding it may
44
- * refetch.
25
+ * Collapsed modules keep their item query subscribed, which pins the cache entry. Capped so
26
+ * "Expand all" on a 120-module course cannot pin 120 of them; past the cap the
27
+ * least-recently-active is evicted and re-expanding it may refetch.
45
28
  */
46
29
  export declare const DEFAULT_RETAIN_COLLAPSED_LIMIT: number;
47
30
  /** The pageInfo of a query that has not resolved yet. Never truncates silently. */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/hooks/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,EAAE,MAAY,CAAA;AAE5C,gDAAgD;AAChD,eAAO,MAAM,sBAAsB,EAAE,MAAY,CAAA;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAY,CAAA;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAU,CAAA;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAsB,CAAA;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAW,CAAA;AAExD,mFAAmF;AACnF,eAAO,MAAM,eAAe,EAAE,QAAkD,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/hooks/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,EAAE,MAAY,CAAA;AAE5C,gDAAgD;AAChD,eAAO,MAAM,sBAAsB,EAAE,MAAY,CAAA;AAEjD,6FAA6F;AAC7F,eAAO,MAAM,wBAAwB,EAAE,MAAY,CAAA;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAU,CAAA;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAsB,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAW,CAAA;AAExD,mFAAmF;AACnF,eAAO,MAAM,eAAe,EAAE,QAAkD,CAAA"}