@instructure/platform-modules 0.4.0 → 1.0.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 (108) hide show
  1. package/README.md +3 -2
  2. package/dist/adapters/canvasGraphql/index.d.ts +4 -14
  3. package/dist/adapters/canvasGraphql/index.d.ts.map +1 -1
  4. package/dist/adapters/canvasGraphql/normalize.d.ts +6 -75
  5. package/dist/adapters/canvasGraphql/normalize.d.ts.map +1 -1
  6. package/dist/adapters/canvasGraphql/queries.d.ts +7 -21
  7. package/dist/adapters/canvasGraphql/queries.d.ts.map +1 -1
  8. package/dist/adapters/inMemory.d.ts +0 -16
  9. package/dist/adapters/inMemory.d.ts.map +1 -1
  10. package/dist/adapters/limits.d.ts +3 -24
  11. package/dist/adapters/limits.d.ts.map +1 -1
  12. package/dist/adapters/types.d.ts +14 -34
  13. package/dist/adapters/types.d.ts.map +1 -1
  14. package/dist/cache/invalidate.d.ts +0 -23
  15. package/dist/cache/invalidate.d.ts.map +1 -1
  16. package/dist/cache/keys.d.ts +3 -14
  17. package/dist/cache/keys.d.ts.map +1 -1
  18. package/dist/components/FilterChips.d.ts +4 -11
  19. package/dist/components/FilterChips.d.ts.map +1 -1
  20. package/dist/components/ModuleCard.d.ts +0 -9
  21. package/dist/components/ModuleCard.d.ts.map +1 -1
  22. package/dist/components/ModuleCard.stories.d.ts +3 -5
  23. package/dist/components/ModuleCard.stories.d.ts.map +1 -1
  24. package/dist/components/ModuleItemRow.d.ts +0 -10
  25. package/dist/components/ModuleItemRow.d.ts.map +1 -1
  26. package/dist/components/ModuleNumberBadge.d.ts +0 -1
  27. package/dist/components/ModuleNumberBadge.d.ts.map +1 -1
  28. package/dist/components/ModulesList.d.ts +0 -31
  29. package/dist/components/ModulesList.d.ts.map +1 -1
  30. package/dist/components/ModulesList.stories.d.ts +11 -69
  31. package/dist/components/ModulesList.stories.d.ts.map +1 -1
  32. package/dist/components/StatusPill.d.ts +4 -3
  33. package/dist/components/StatusPill.d.ts.map +1 -1
  34. package/dist/components/index.d.ts +1 -1
  35. package/dist/components/index.d.ts.map +1 -1
  36. package/dist/components/labels.d.ts +1 -54
  37. package/dist/components/labels.d.ts.map +1 -1
  38. package/dist/components/lightThemeDecorator.d.ts +3 -0
  39. package/dist/components/lightThemeDecorator.d.ts.map +1 -0
  40. package/dist/config/base.d.ts +0 -5
  41. package/dist/config/base.d.ts.map +1 -1
  42. package/dist/config/capabilities.d.ts +8 -0
  43. package/dist/config/capabilities.d.ts.map +1 -0
  44. package/dist/config/context.d.ts +1 -1
  45. package/dist/config/context.d.ts.map +1 -1
  46. package/dist/config/filters.d.ts +15 -0
  47. package/dist/config/filters.d.ts.map +1 -0
  48. package/dist/config/formatters.d.ts +15 -0
  49. package/dist/config/formatters.d.ts.map +1 -0
  50. package/dist/config/index.d.ts +9 -4
  51. package/dist/config/index.d.ts.map +1 -1
  52. package/dist/config/itemMeta.d.ts +5 -0
  53. package/dist/config/itemMeta.d.ts.map +1 -0
  54. package/dist/config/itemTypes.d.ts +4 -0
  55. package/dist/config/itemTypes.d.ts.map +1 -0
  56. package/dist/config/partialModulesConfig.d.ts +0 -1
  57. package/dist/config/partialModulesConfig.d.ts.map +1 -1
  58. package/dist/config/registry.d.ts +2 -22
  59. package/dist/config/registry.d.ts.map +1 -1
  60. package/dist/config/resolve.d.ts +0 -4
  61. package/dist/config/resolve.d.ts.map +1 -1
  62. package/dist/config/schemas.d.ts +37 -7
  63. package/dist/config/schemas.d.ts.map +1 -1
  64. package/dist/config/types.d.ts +8 -11
  65. package/dist/config/types.d.ts.map +1 -1
  66. package/dist/config/useFormatters.d.ts +10 -0
  67. package/dist/config/useFormatters.d.ts.map +1 -0
  68. package/dist/fixtures/generate.d.ts +1 -26
  69. package/dist/fixtures/generate.d.ts.map +1 -1
  70. package/dist/fixtures/index.d.ts +1 -1
  71. package/dist/fixtures/index.d.ts.map +1 -1
  72. package/dist/fixtures/scenarios.d.ts +1 -6
  73. package/dist/fixtures/scenarios.d.ts.map +1 -1
  74. package/dist/hooks/constants.d.ts +6 -23
  75. package/dist/hooks/constants.d.ts.map +1 -1
  76. package/dist/hooks/queryOptions.d.ts +2 -5
  77. package/dist/hooks/queryOptions.d.ts.map +1 -1
  78. package/dist/hooks/useItemsMode.d.ts +3 -35
  79. package/dist/hooks/useItemsMode.d.ts.map +1 -1
  80. package/dist/hooks/useModuleItemQueries.d.ts +1 -7
  81. package/dist/hooks/useModuleItemQueries.d.ts.map +1 -1
  82. package/dist/hooks/useModuleItems.d.ts +0 -16
  83. package/dist/hooks/useModuleItems.d.ts.map +1 -1
  84. package/dist/hooks/useModules.d.ts +3 -24
  85. package/dist/hooks/useModules.d.ts.map +1 -1
  86. package/dist/hooks/useModulesPageData.d.ts +9 -7
  87. package/dist/hooks/useModulesPageData.d.ts.map +1 -1
  88. package/dist/i18n.d.ts +6 -36
  89. package/dist/i18n.d.ts.map +1 -1
  90. package/dist/index.d.ts +5 -5
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +1788 -1405
  93. package/dist/types/domain.d.ts +4 -27
  94. package/dist/types/domain.d.ts.map +1 -1
  95. package/dist/types/enums.d.ts +3 -25
  96. package/dist/types/enums.d.ts.map +1 -1
  97. package/dist/types/extensions.d.ts +0 -22
  98. package/dist/types/extensions.d.ts.map +1 -1
  99. package/dist/types/filterClause.d.ts +18 -0
  100. package/dist/types/filterClause.d.ts.map +1 -0
  101. package/dist/types/index.d.ts +1 -0
  102. package/dist/types/index.d.ts.map +1 -1
  103. package/dist/types/navigation.d.ts +0 -6
  104. package/dist/types/navigation.d.ts.map +1 -1
  105. package/dist/types/schemas.d.ts +0 -5
  106. package/dist/types/schemas.d.ts.map +1 -1
  107. package/locales/en.json +14 -3
  108. package/package.json +14 -13
@@ -6,16 +6,11 @@ type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
7
  export declare const ThreeDigitNumber: Story;
8
8
  export declare const Locked: Story;
9
- /** A label longer than the square widens the badge instead of spilling out of it. */
10
9
  export declare const LongLabel: Story;
11
10
  export declare const NoBadge: Story;
12
- /** A completed module: Graded, Excused and Complete on one screen. */
13
11
  export declare const ExpandedWithStatusPills: Story;
14
- /** A page, a file and an external URL: the statuses ungradable content can reach. */
15
12
  export declare const ExpandedNonGradableItems: Story;
16
- /** A locked module, expanded. */
17
13
  export declare const ExpandedLockedModule: Story;
18
- /** An untouched module, expanded: every row reads Not started. */
19
14
  export declare const ExpandedUntouchedModule: Story;
20
15
  export declare const ProgressNotStarted: Story;
21
16
  export declare const ProgressPartial: Story;
@@ -24,4 +19,7 @@ export declare const ProgressNoRequirements: Story;
24
19
  export declare const ProgressLocked: Story;
25
20
  export declare const ProgressAbsentForTeacher: Story;
26
21
  export declare const ProgressStacked: Story;
22
+ export declare const LongModuleName: Story;
23
+ export declare const LetterLabelScheme: Story;
24
+ export declare const NoLabelScheme: Story;
27
25
  //# sourceMappingURL=ModuleCard.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleCard.stories.d.ts","sourceRoot":"","sources":["../../src/components/ModuleCard.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAItD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA2BzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAWjC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAA;AAEhC,eAAO,MAAM,gBAAgB,EAAE,KAE9B,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAEpB,CAAA;AAED,qFAAqF;AACrF,eAAO,MAAM,SAAS,EAAE,KAEvB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAErB,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM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AM,uBAAuB,EAAE,KAErC,CAAA;AAmBD,eAAO,MAAM,kBAAkB,EAAE,KAEhC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAE9B,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAEpC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAE5B,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,KAEtC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAA;AAQD,eAAO,MAAM,iBAAiB,EAAE,KAU/B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAA"}
@@ -2,18 +2,8 @@ import { NamedExoticComponent } from 'react';
2
2
  import { ModuleItem, ModuleItemNavigation } from '../types';
3
3
  export interface ModuleItemRowProps {
4
4
  item: ModuleItem;
5
- /** Injected so relative dates ("yesterday") are deterministic. */
6
5
  today: Date;
7
- /** Stable reference required; see `ModuleItemNavigation`. */
8
6
  navigation?: ModuleItemNavigation;
9
7
  }
10
- /**
11
- * Memoized because it is the hottest component in the package.
12
- *
13
- * `item` is a stable reference out of the query cache and `today` is pinned per
14
- * mount, so the default shallow comparison is enough. It is what stops one
15
- * module's observer publishing from re-rendering every other module's rows —
16
- * ~3000 of them on a 30-module course with everything expanded.
17
- */
18
8
  export declare const ModuleItemRow: NamedExoticComponent<ModuleItemRowProps>;
19
9
  //# sourceMappingURL=ModuleItemRow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleItemRow.d.ts","sourceRoot":"","sources":["../../src/components/ModuleItemRow.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAyB,KAAK,oBAAoB,EAAqB,MAAM,OAAO,CAAA;AAC3F,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,oBAAoB,EAE1B,MAAM,UAAU,CAAA;AA6BjB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,UAAU,CAAA;IAChB,kEAAkE;IAClE,KAAK,EAAE,IAAI,CAAA;IACX,6DAA6D;IAC7D,UAAU,CAAC,EAAE,oBAAoB,CAAA;CAClC;AAmJD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,oBAAoB,CAAC,kBAAkB,CAA2B,CAAA"}
1
+ {"version":3,"file":"ModuleItemRow.d.ts","sourceRoot":"","sources":["../../src/components/ModuleItemRow.tsx"],"names":[],"mappings":"AAOA,OAAO,EAKL,KAAK,oBAAoB,EAI1B,MAAM,OAAO,CAAA;AASd,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAmChE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,IAAI,CAAA;IACX,UAAU,CAAC,EAAE,oBAAoB,CAAA;CAClC;AAiKD,eAAO,MAAM,aAAa,EAAE,oBAAoB,CAAC,kBAAkB,CAA2B,CAAA"}
@@ -1,6 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
2
  export interface ModuleNumberBadgeProps {
3
- /** `null` renders no badge. */
4
3
  label: string | null;
5
4
  dimmed?: boolean;
6
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleNumberBadge.d.ts","sourceRoot":"","sources":["../../src/components/ModuleNumberBadge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAIzC,MAAM,WAAW,sBAAsB;IACrC,+BAA+B;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,MAAc,GACf,EAAE,sBAAsB,GAAG,YAAY,GAAG,IAAI,CAsB9C"}
1
+ {"version":3,"file":"ModuleNumberBadge.d.ts","sourceRoot":"","sources":["../../src/components/ModuleNumberBadge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAIzC,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,MAAc,GACf,EAAE,sBAAsB,GAAG,YAAY,GAAG,IAAI,CAsB9C"}
@@ -1,7 +1,6 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { UseModulesPageDataResult } from '../hooks';
3
3
  import { ModuleItemNavigation } from '../types';
4
- import { ModulesFilterId } from './labels';
5
4
  export interface ModulesRequestCounts {
6
5
  listModules: number;
7
6
  listModuleItems: number;
@@ -9,42 +8,12 @@ export interface ModulesRequestCounts {
9
8
  export interface ModulesListProps {
10
9
  data: UseModulesPageDataResult;
11
10
  courseName?: string;
12
- /** The crumb above the title, e.g. "Math". Purely decorative. */
13
11
  courseContext?: string;
14
- /**
15
- * "Now", injected so relative dates and the "Due this week" filter are
16
- * deterministic in stories and tests. The fixtures use a fixed 2025-01-06
17
- * epoch, so a story that wants sensible dates should pin this.
18
- */
19
12
  today?: Date;
20
- /**
21
- * Live counts from `createInMemoryAdapter`'s `onRequest`. When supplied, a
22
- * dev banner renders them. It is the most useful thing on screen for
23
- * reviewing this MVP — "does this scale" as a number rather than a devtools
24
- * exercise — and a host with a real adapter simply omits the prop.
25
- */
26
13
  requestCounts?: ModulesRequestCounts;
27
- /** Also show items-mode and per-module item provenance. Defaults to `requestCounts !== undefined`. */
28
14
  showDiagnostics?: boolean;
29
- /** Which chip starts active. Uncontrolled after mount — the chips own it. */
30
- initialFilter?: ModulesFilterId;
31
- /** Stable reference required; see `ModuleItemNavigation`. */
32
15
  navigation?: ModuleItemNavigation;
33
- /**
34
- * Element for the outer container. Defaults to `'div'`.
35
- *
36
- * Deliberately not `'main'` by default: Canvas's own layout already ships
37
- * `role="main"` (`application.html.erb:267`), so a Canvas host rendering this
38
- * would get two main landmarks. A host that owns its whole page can opt in with
39
- * `as="main"`.
40
- */
41
16
  as?: 'div' | 'main' | 'section';
42
- /**
43
- * Heading level for the course title. Defaults to `'h2'`.
44
- *
45
- * Also not `h1` by default, and for the same reason: a host page usually already
46
- * has one. `ModuleCard` renders one level below this.
47
- */
48
17
  headingLevel?: 'h1' | 'h2' | 'h3';
49
18
  }
50
19
  export declare const ModulesList: ComponentType<ModulesListProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"ModulesList.d.ts","sourceRoot":"","sources":["../../src/components/ModulesList.tsx"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,aAAa,EAOnB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,KAAK,EAAU,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAG5D,OAAO,EAA4C,KAAK,eAAe,EAAE,MAAM,UAAU,CAAA;AAGzF,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ;;;;;OAKG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAA;IACpC,sGAAsG;IACtG,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,eAAe,CAAA;IAC/B,6DAA6D;IAC7D,UAAU,CAAC,EAAE,oBAAoB,CAAA;IACjC;;;;;;;OAOG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAA;IAC/B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAClC;AA4VD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAET,CAAA"}
1
+ {"version":3,"file":"ModulesList.d.ts","sourceRoot":"","sources":["../../src/components/ModulesList.tsx"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,aAAa,EAOnB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,KAAK,EAAU,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAM5D,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,aAAa,CAAC,EAAE,oBAAoB,CAAA;IACpC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE,oBAAoB,CAAA;IACjC,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAA;IAC/B,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAClC;AAkVD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAET,CAAA"}
@@ -1,107 +1,49 @@
1
1
  import { Meta, StoryObj } from '@storybook/react';
2
2
  import { ReactElement } from 'react';
3
3
  import { InMemoryFixture, ItemsMode } from '../index';
4
- import { ModulesFilterId } from './labels';
5
- /**
6
- * The Modules Foundation design over the real data layer.
7
- *
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.
12
- */
13
4
  declare const FIXTURES: Record<string, () => InMemoryFixture>;
5
+ type ThemeName = 'light' | 'canvas-high-contrast';
14
6
  type ProgressMode = 'student' | 'teacher';
15
7
  interface ModulesListStoryProps {
16
8
  fixture: keyof typeof FIXTURES;
17
9
  itemsMode: ItemsMode;
18
10
  progressMode: ProgressMode;
19
- initialFilter: ModulesFilterId;
20
- /** Modules per `listModules` request. Canvas caps this at 100. */
11
+ initialFilter: string;
21
12
  pageSize: number;
22
- /** Items per `listModuleItems` request. Canvas caps this at 100. */
23
13
  itemPageSize: number;
24
14
  itemConcurrency: number;
25
- /** Expand these module ids on mount, so a story shows item rows without a click. */
26
15
  initialExpandedModuleIds: string[];
27
- /** `rebranded` and `partial` are host catalogs, both deliberately incomplete. */
28
16
  i18n: 'none' | 'pseudo' | 'rebranded' | 'partial';
29
- timezone: string;
30
- /** Clear it to render the catalog's `pageTitle` instead of a host-supplied name. */
17
+ timezone: 'none' | 'America/Denver' | 'America/Los_Angeles' | 'Australia/Sydney';
31
18
  courseName: string;
32
19
  navigation: 'none' | 'rewritten' | 'intercepted';
20
+ config: HostConfigName;
21
+ theme: ThemeName;
33
22
  }
23
+ type HostConfigName = 'none' | 'itemTypes' | 'itemMeta' | 'filters';
34
24
  declare function ModulesListHarness(props: ModulesListStoryProps): ReactElement;
35
25
  declare const meta: Meta<typeof ModulesListHarness>;
36
26
  export default meta;
37
27
  type Story = StoryObj<typeof meta>;
38
- /** `auto` resolves to `inline`, so opening another module costs zero extra requests. */
39
28
  export declare const Default: Story;
40
- /**
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.
44
- */
29
+ export declare const HighContrast: Story;
45
30
  export declare const LargeCourse: Story;
46
- /**
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.
49
- */
50
31
  export declare const FatModuleInlineFallback: Story;
51
- /** Every shape an item title can take: linked, new tab, sub-header, no url, long, locked. */
52
32
  export declare const ItemTitleLinks: Story;
53
- /** The same module with `getItemHref` rewriting each href the adapter supplied. */
33
+ export declare const ItemRowVariants: Story;
54
34
  export declare const ItemTitleLinksRewritten: Story;
55
- /** `onItemClick` with `preventDefault()`, as a client-side router would. */
56
35
  export declare const ItemTitleLinksIntercepted: Story;
57
- /** No modules. The empty state. */
58
36
  export declare const EmptyCourse: Story;
59
- /**
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.
62
- */
63
37
  export declare const TeacherViewNoProgress: Story;
64
- /** `progress.status === 'in_progress'`. */
65
38
  export declare const FilterInProgress: Story;
66
- /** `progress.status` is `all_submitted` or `all_graded`. */
67
39
  export declare const FilterComplete: Story;
68
- /**
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.
71
- */
72
40
  export declare const FilterDueThisWeek: Story;
73
- /** `progress.missingCount > 0`. */
74
41
  export declare const FilterMissing: Story;
75
- /**
76
- * Every module status and every item status on one screen.
77
- *
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.
81
- */
82
42
  export declare const StatusCoverage: Story;
83
- /**
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.
87
- */
88
43
  export declare const PseudoLocalized: Story;
89
- /**
90
- * A host rebranding the page in its own language.
91
- *
92
- * Career calls the page a Learning Path and its modules units. That is a
93
- * catalog entry, not a config key — six entries here, and every string they do
94
- * not name still reads English from `locales/en.json`. Switch the `fixture`
95
- * control to `empty` to see the rebranded empty state.
96
- */
97
44
  export declare const HostRebrand: Story;
98
- /**
99
- * A deliberately incomplete translation.
100
- *
101
- * Four German keys against an English catalog: the filter row is translated
102
- * and everything else falls back rather than throwing or rendering blank. This
103
- * is the property that lets a host adopt the package before translating it, and
104
- * `locale` travels with the catalog so `Intl` dates match the words.
105
- */
106
45
  export declare const PartialCatalog: Story;
46
+ export declare const ItemTypesCustomized: Story;
47
+ export declare const FiltersCustomized: Story;
48
+ export declare const ItemMetaCustomized: Story;
107
49
  //# sourceMappingURL=ModulesList.stories.d.ts.map
@@ -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,EAUL,KAAK,eAAe,EACpB,KAAK,SAAS,EAKf,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG/C;;;;;;;GAOG;AAEH,QAAA,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,eAAe,CAOnD,CAAA;AAoBD,KAAK,YAAY,GAAG,SAAS,GAAG,SAAS,CAAA;AAEzC,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,OAAO,QAAQ,CAAA;IAC9B,SAAS,EAAE,SAAS,CAAA;IACpB,YAAY,EAAE,YAAY,CAAA;IAC1B,aAAa,EAAE,eAAe,CAAA;IAC9B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAA;IAChB,oEAAoE;IACpE,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,oFAAoF;IACpF,wBAAwB,EAAE,MAAM,EAAE,CAAA;IAClC,iFAAiF;IACjF,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG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AAE,qBAAqB,GAAG,YAAY,CAetE;AAkBD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAiDzC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,KAErC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAE5B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,KAErC,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,KAEvC,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,KAEnC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAE9B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAE5B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAE/B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAM5B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAO7B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAEjC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAE/B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAA"}
@@ -1,13 +1,14 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { TranslateFunction } from '../i18n';
3
3
  import { ModuleItemStatus, ModuleStatus } from '../types';
4
- /** Exhaustive: a new `ModuleStatus` is a compile error until it has a label. */
5
- export declare function moduleStatusLabel(t: TranslateFunction, status: ModuleStatus): string;
4
+ export declare function moduleStatusLabel(t: TranslateFunction, status: ModuleStatus, missingCount: number, incompleteCount: number): string;
6
5
  export declare function moduleItemStatusLabel(t: TranslateFunction, status: ModuleItemStatus): string;
7
6
  export interface ModuleStatusPillProps {
8
7
  status: ModuleStatus;
8
+ missingCount: number;
9
+ incompleteCount: number;
9
10
  }
10
- export declare function ModuleStatusPill({ status }: ModuleStatusPillProps): ReactElement;
11
+ export declare function ModuleStatusPill({ status, missingCount, incompleteCount, }: ModuleStatusPillProps): ReactElement;
11
12
  export interface ModuleItemStatusPillProps {
12
13
  status: ModuleItemStatus;
13
14
  }
@@ -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;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
+ {"version":3,"file":"StatusPill.d.ts","sourceRoot":"","sources":["../../src/components/StatusPill.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAuC9D,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,iBAAiB,EACpB,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,MAAM,CAoBR;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAmB5F;AAeD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,YAAY,EACZ,eAAe,GAChB,EAAE,qBAAqB,GAAG,YAAY,CAOtC;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, type DateFormatOptions, formatDateTime, formatDueByline, formatModuleNumber, formatPoints, formatUnlockByline, itemTypeLabel, moduleMatchesFilter, moduleMatchesSearch, MODULES_FILTER_IDS, type ModulesFilterId, progressScreenReaderValue, progressSummary, requirementLabel, } from './labels';
2
+ export { calendarDayDiff, type DateFormatOptions, formatDateTime, formatModuleNumber, formatPoints, moduleMatchesSearch, 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,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
+ {"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,KAAK,iBAAiB,EACtB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,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,68 +1,15 @@
1
1
  import { TranslateFunction } from '../i18n';
2
- import { CompletionRequirement, Module, ModuleItemType } from '../types';
2
+ import { CompletionRequirement, Module } from '../types';
3
3
  export interface DateFormatOptions {
4
4
  locale?: string;
5
- /** IANA zone. Omitted renders in the viewer's own clock and prints no zone. */
6
5
  timezone?: string;
7
6
  }
8
- /**
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.
11
- */
12
7
  export declare function calendarDayDiff(a: Date, b: Date, timezone?: string): number;
13
- /**
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.
19
- */
20
8
  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
9
  export declare function formatModuleNumber(position: number, locale?: string): string | null;
25
- export declare function itemTypeLabel(t: TranslateFunction, type: ModuleItemType): string;
26
- /** "10 pts". Null/undefined points render nothing at all, not "0 pts". */
27
10
  export declare function formatPoints(t: TranslateFunction, pointsPossible: number | null | undefined): string | null;
28
- /**
29
- * The requirement column, e.g. "Submit the assignment".
30
- *
31
- * Exhaustive over `CompletionRequirementType` — no `default`, so adding a member
32
- * to the enum is a compile error here rather than a silently unlabeled row. The
33
- * `unknown` member is what absorbs a seventh Canvas type, and it still renders
34
- * something: an unlabeled requirement would look like *no* requirement, which
35
- * is the wrong failure.
36
- */
37
11
  export declare function requirementLabel(t: TranslateFunction, requirement: CompletionRequirement): string;
38
12
  export declare function progressSummary(t: TranslateFunction, percentComplete: number, met: number, total: number): string;
39
13
  export declare function progressScreenReaderValue(t: TranslateFunction, percentComplete: number, met: number, total: number): string;
40
- export type ModulesFilterId = 'all' | 'in_progress' | 'complete' | 'due_this_week' | 'missing';
41
- /**
42
- * The chip order the design draws, as ids only.
43
- *
44
- * Ids rather than `{ id, label }` pairs because a label is now a function of the
45
- * host's `t`, and a module-level constant cannot call one. `filterLabel` supplies
46
- * the text.
47
- */
48
- export declare const MODULES_FILTER_IDS: readonly ModulesFilterId[];
49
- export declare function filterLabel(t: TranslateFunction, id: ModulesFilterId): string;
50
- /** How far ahead "Due this week" looks. */
51
- export declare const DUE_THIS_WEEK_DAYS = 7;
52
- /**
53
- * Filter chips are **module-level only**, by design.
54
- *
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.
58
- *
59
- * A module with no `progress` (teacher/anonymous) matches only "All" — "we did
60
- * not fetch progress" is not "not in progress".
61
- */
62
- export declare function moduleMatchesFilter(module: Module, filter: ModulesFilterId, today: Date, timezone?: string): boolean;
63
- /**
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.
66
- */
67
14
  export declare function moduleMatchesSearch(module: Module, query: string, locale?: string): boolean;
68
15
  //# 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;AAO7E,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAyFD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3E;AAMD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,iBAAiB,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,IAAI,EACX,EAAE,MAAuB,EAAE,QAAQ,EAAE,GAAE,iBAAsB,GAC5D,MAAM,CAiBR;AAED,wBAAgB,eAAe,CAC7B,CAAC,EAAE,iBAAiB,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,IAAI,EACX,OAAO,GAAE,iBAAsB,GAC9B,MAAM,CAER;AAED,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,iBAAiB,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,IAAI,EACX,OAAO,GAAE,iBAAsB,GAC9B,MAAM,CAER;AAED,mEAAmE;AACnE,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,CAmBh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import { Decorator } from '@storybook/react';
2
+ export declare const withLightTheme: Decorator;
3
+ //# sourceMappingURL=lightThemeDecorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lightThemeDecorator.d.ts","sourceRoot":"","sources":["../../src/components/lightThemeDecorator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,eAAO,MAAM,cAAc,EAAE,SAI5B,CAAA"}
@@ -1,8 +1,3 @@
1
1
  import { ModulesConfig } from './types';
2
- /**
3
- * The starting point every host resolves against. Empty until each mechanism
4
- * lands; `docs/adr/0001-customization.md` decides what each key then carries.
5
- * Frozen: it is what `useModulesConfig` returns with no provider mounted.
6
- */
7
2
  export declare const baseModulesConfig: ModulesConfig;
8
3
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/config/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,aAS/B,CAAA"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/config/base.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,iBAAiB,EAAE,aAS/B,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { FilterCapabilities } from '../types';
2
+ import { Registry } from './registry';
3
+ import { FilterEntry } from './schemas';
4
+ export declare function unservableFilters(filters: Registry<FilterEntry>, capabilities: FilterCapabilities | undefined): string[];
5
+ export declare function unservableFilterMessage(keys: readonly string[]): string;
6
+ /** Do not fall back to the predicate. That trades complete results for partial ones. */
7
+ export declare function hideUnservableFilters(filters: Registry<FilterEntry>, capabilities: FilterCapabilities | undefined): Registry<FilterEntry>;
8
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/config/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,UAAU,CAAA;AAEhE,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC9B,YAAY,EAAE,kBAAkB,GAAG,SAAS,GAC3C,MAAM,EAAE,CAOV;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAKvE;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC9B,YAAY,EAAE,kBAAkB,GAAG,SAAS,GAC3C,QAAQ,CAAC,WAAW,CAAC,CAWvB"}
@@ -4,7 +4,7 @@ export interface ModulesConfigProviderProps {
4
4
  value: ModulesConfig;
5
5
  children: ReactNode;
6
6
  }
7
- /** Optional. Without it the package renders against `baseModulesConfig`. */
8
7
  export declare function ModulesConfigProvider({ value, children }: ModulesConfigProviderProps): ReactNode;
9
8
  export declare function useModulesConfig(): ModulesConfig;
9
+ export declare function useFieldVisible(key: string): boolean;
10
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,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;AAGjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,aAAa,CAAA;IACpB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,0BAA0B,GAAG,SAAS,CAEhG;AAED,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD"}
@@ -0,0 +1,15 @@
1
+ import { FilterClause } from '../types';
2
+ import { Registry } from './registry';
3
+ import { FilterEntry } from './schemas';
4
+ export declare const ALL_FILTER = "all";
5
+ /** How far ahead "Due this week" looks. */
6
+ export declare const DUE_THIS_WEEK_DAYS = 7;
7
+ /**
8
+ * In design order. See `docs/adr/0008-filtering-and-the-data-layer.md`.
9
+ * Read `module.progress` only. A collapsed module has no items in `onDemand` mode.
10
+ */
11
+ export declare const baseFilters: Registry<FilterEntry>;
12
+ /** `clientOnly` is the only way to un-write an inherited clause. */
13
+ export declare function filterClauseOf(entry: FilterEntry | undefined): FilterClause | undefined;
14
+ export declare function isPredicateServed(entry: FilterEntry | undefined): boolean;
15
+ //# sourceMappingURL=filters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/config/filters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,UAAU,QAAQ,CAAA;AAE/B,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAyC4B,CAAA;AAE1E,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAGvF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAEzE"}
@@ -0,0 +1,15 @@
1
+ import { TranslateFunction } from '../i18n';
2
+ import { Module } from '../types';
3
+ export interface FormatterContext {
4
+ t: TranslateFunction;
5
+ locale: string;
6
+ timezone?: string;
7
+ }
8
+ export interface ModulesFormatters {
9
+ moduleLabel: (position: number, module: Module, ctx: FormatterContext) => string | null;
10
+ dateTime: (iso: string, today: Date, ctx: FormatterContext) => string;
11
+ points: (pointsPossible: number | null | undefined, ctx: FormatterContext) => string | null;
12
+ progress: (percentComplete: number, met: number, total: number, ctx: FormatterContext) => string;
13
+ }
14
+ export declare const defaultFormatters: ModulesFormatters;
15
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/config/formatters.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,iBAAiB,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,KAAK,MAAM,GAAG,IAAI,CAAA;IACvF,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,gBAAgB,KAAK,MAAM,CAAA;IACrE,MAAM,EAAE,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,gBAAgB,KAAK,MAAM,GAAG,IAAI,CAAA;IAC3F,QAAQ,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,KAAK,MAAM,CAAA;CACjG;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAS/B,CAAA"}
@@ -1,8 +1,13 @@
1
1
  export { baseModulesConfig } from './base';
2
- export { ModulesConfigProvider, type ModulesConfigProviderProps, useModulesConfig, } from './context';
2
+ export { ALL_FILTER, baseFilters, DUE_THIS_WEEK_DAYS, filterClauseOf, isPredicateServed, } from './filters';
3
+ export { hideUnservableFilters, unservableFilters } from './capabilities';
4
+ export { TYPE_FIELD } from './itemMeta';
5
+ export { ModulesConfigProvider, type ModulesConfigProviderProps, useFieldVisible, useModulesConfig, } from './context';
6
+ export { defaultFormatters, type FormatterContext, type ModulesFormatters, } from './formatters';
3
7
  export { partialModulesConfig } from './partialModulesConfig';
4
- export { mergeRegistry, visibleEntries, type Registry, type RegistryOverride, type VisibleEntry, } from './registry';
8
+ export { mergeRegistry, visibleEntries, visibleEntry, type Registry, type RegistryOverride, type VisibleEntry, } from './registry';
5
9
  export { resolveModulesConfig } from './resolve';
6
- export { ModulesConfigSchema, registrySchema, RegistryEntrySchema, type RegistryEntry, } from './schemas';
7
- export type { ModulesConfig, ModulesConfigOverride, ModulesFormatters, ModulesNavigation, } from './types';
10
+ export { type FilterContext, type FilterEntry, FilterEntrySchema, type ItemTypeContext, type ItemTypeEntry, ItemTypeEntrySchema, type MetaFieldContext, type MetaFieldEntry, MetaFieldEntrySchema, ModulesConfigSchema, registrySchema, RegistryEntrySchema, type RegistryEntry, } from './schemas';
11
+ export type { ModulesConfig, ModulesConfigOverride, ModulesNavigation } from './types';
12
+ export { type BoundFormatters, useFormatters } from './useFormatters';
8
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,gBAAgB,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,KAAK,aAAa,GACnB,MAAM,WAAW,CAAA;AAClB,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EACL,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,iBAAiB,GAClB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,eAAe,EACf,gBAAgB,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,KAAK,aAAa,GACnB,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACtF,OAAO,EAAE,KAAK,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { Registry } from './registry';
2
+ import { MetaFieldEntry } from './schemas';
3
+ export declare const TYPE_FIELD = "type";
4
+ export declare const baseItemMeta: Registry<MetaFieldEntry>;
5
+ //# sourceMappingURL=itemMeta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemMeta.d.ts","sourceRoot":"","sources":["../../src/config/itemMeta.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,eAAO,MAAM,UAAU,SAAS,CAAA;AAEhC,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,cAAc,CA4C2B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { ModuleItemType } from '../types';
2
+ import { ItemTypeEntry } from './schemas';
3
+ export declare const baseItemTypes: Record<ModuleItemType, ItemTypeEntry>;
4
+ //# sourceMappingURL=itemTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemTypes.d.ts","sourceRoot":"","sources":["../../src/config/itemTypes.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAI9C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,aAAa,CAyBoB,CAAA"}
@@ -1,4 +1,3 @@
1
1
  import { ModulesConfig, ModulesConfigOverride } from './types';
2
- /** Use for tests where you don't need a full config. */
3
2
  export declare function partialModulesConfig(override?: ModulesConfigOverride): ModulesConfig;
4
3
  //# sourceMappingURL=partialModulesConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"partialModulesConfig.d.ts","sourceRoot":"","sources":["../../src/config/partialModulesConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEnE,wDAAwD;AACxD,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,qBAA0B,GAAG,aAAa,CAExF"}
1
+ {"version":3,"file":"partialModulesConfig.d.ts","sourceRoot":"","sources":["../../src/config/partialModulesConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEnE,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,qBAA0B,GAAG,aAAa,CAExF"}
@@ -1,33 +1,13 @@
1
1
  import { RegistryEntry } from './schemas';
2
- /**
3
- * The registry primitive: merge one over another, then read the visible entries
4
- * in a deterministic order. No React, no validation — the schemas in
5
- * `./schemas` validate once, at config resolution.
6
- */
7
2
  export type Registry<E extends RegistryEntry = RegistryEntry> = Record<string, E>;
8
- /** `Partial<E>` because an overlay states only what it changes. An addition still needs a whole entry, which only the schema can enforce. */
9
3
  export type RegistryOverride<E extends RegistryEntry = RegistryEntry> = Record<string, Partial<E>>;
10
4
  export type VisibleEntry<E extends RegistryEntry = RegistryEntry> = E & {
11
5
  key: string;
12
6
  };
7
+ /** Own properties only: a host override parsed from JSON must not reach `Object.prototype`. */
13
8
  export declare const hasOwn: (target: object, key: string) => boolean;
14
- /** Spread one object over another, skipping explicit `undefined` so a stated key cannot blank an inherited value. */
15
9
  export declare function overlay<T extends object>(base: Partial<T>, over: Partial<T> | undefined): T;
16
- /**
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.
19
- *
20
- * Keyed by own properties only, so an override parsed from host JSON cannot reach
21
- * `Object.prototype` via `__proto__` or `constructor`.
22
- */
23
10
  export declare function mergeRegistry<E extends RegistryEntry>(base: Registry<E>, override?: RegistryOverride<E>): Registry<E>;
24
- /**
25
- * The entries a host has left switched on, sorted by `order` ascending.
26
- *
27
- * Ties fall through to key order, per `mergeRegistry` above.
28
- *
29
- * Filtering `hidden` here rather than at the merge is what lets a host inspect
30
- * what it turned off.
31
- */
11
+ export declare function visibleEntry<E extends RegistryEntry>(registry: Registry<E>, key: string): E | undefined;
32
12
  export declare function visibleEntries<E extends RegistryEntry>(registry: Registry<E>): ReadonlyArray<VisibleEntry<E>>;
33
13
  //# sourceMappingURL=registry.d.ts.map
@@ -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,6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G,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvF,+FAA+F;AAC/F,eAAO,MAAM,MAAM,GAAI,QAAQ,MAAM,EAAE,KAAK,MAAM,KAAG,OACF,CAAA;AAEnD,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,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EACnD,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EACjB,QAAQ,GAAE,gBAAgB,CAAC,CAAC,CAAM,GACjC,QAAQ,CAAC,CAAC,CAAC,CAYb;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EAClD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EACrB,GAAG,EAAE,MAAM,GACV,CAAC,GAAG,SAAS,CAGf;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,aAAa,EACpD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GACpB,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAKhC"}
@@ -1,7 +1,3 @@
1
1
  import { ModulesConfig, ModulesConfigOverride } from './types';
2
- /**
3
- * Fold an override over a base config, one key at a time, and validate the
4
- * result.
5
- */
6
2
  export declare function resolveModulesConfig(base: ModulesConfig, override?: ModulesConfigOverride): ModulesConfig;
7
3
  //# sourceMappingURL=resolve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEnE;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,EACnB,QAAQ,GAAE,qBAA0B,GACnC,aAAa,CAwBf"}
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEnE,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,EACnB,QAAQ,GAAE,qBAA0B,GACnC,aAAa,CAuBf"}