@instructure/platform-modules 0.3.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.
- package/README.md +3 -2
- package/dist/adapters/canvasGraphql/index.d.ts +4 -40
- package/dist/adapters/canvasGraphql/index.d.ts.map +1 -1
- package/dist/adapters/canvasGraphql/normalize.d.ts +9 -220
- package/dist/adapters/canvasGraphql/normalize.d.ts.map +1 -1
- package/dist/adapters/canvasGraphql/queries.d.ts +7 -49
- package/dist/adapters/canvasGraphql/queries.d.ts.map +1 -1
- package/dist/adapters/inMemory.d.ts +0 -40
- package/dist/adapters/inMemory.d.ts.map +1 -1
- package/dist/adapters/limits.d.ts +3 -81
- package/dist/adapters/limits.d.ts.map +1 -1
- package/dist/adapters/types.d.ts +11 -61
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/cache/invalidate.d.ts +0 -46
- package/dist/cache/invalidate.d.ts.map +1 -1
- package/dist/cache/keys.d.ts +3 -55
- package/dist/cache/keys.d.ts.map +1 -1
- package/dist/components/FilterChips.d.ts +4 -17
- package/dist/components/FilterChips.d.ts.map +1 -1
- package/dist/components/ModuleCard.d.ts +5 -29
- package/dist/components/ModuleCard.d.ts.map +1 -1
- package/dist/components/ModuleCard.stories.d.ts +14 -1
- package/dist/components/ModuleCard.stories.d.ts.map +1 -1
- package/dist/components/ModuleItemRow.d.ts +0 -10
- package/dist/components/ModuleItemRow.d.ts.map +1 -1
- package/dist/components/ModuleNumberBadge.d.ts +0 -1
- package/dist/components/ModuleNumberBadge.d.ts.map +1 -1
- package/dist/components/ModulesList.d.ts +2 -54
- package/dist/components/ModulesList.d.ts.map +1 -1
- package/dist/components/ModulesList.stories.d.ts +11 -128
- package/dist/components/ModulesList.stories.d.ts.map +1 -1
- package/dist/components/StatusPill.d.ts +4 -6
- package/dist/components/StatusPill.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/labels.d.ts +8 -78
- package/dist/components/labels.d.ts.map +1 -1
- package/dist/components/lightThemeDecorator.d.ts +3 -0
- package/dist/components/lightThemeDecorator.d.ts.map +1 -0
- package/dist/config/base.d.ts +0 -5
- package/dist/config/base.d.ts.map +1 -1
- package/dist/config/capabilities.d.ts +8 -0
- package/dist/config/capabilities.d.ts.map +1 -0
- package/dist/config/context.d.ts +1 -2
- package/dist/config/context.d.ts.map +1 -1
- package/dist/config/filters.d.ts +15 -0
- package/dist/config/filters.d.ts.map +1 -0
- package/dist/config/formatters.d.ts +15 -0
- package/dist/config/formatters.d.ts.map +1 -0
- package/dist/config/index.d.ts +9 -4
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/itemMeta.d.ts +5 -0
- package/dist/config/itemMeta.d.ts.map +1 -0
- package/dist/config/itemTypes.d.ts +4 -0
- package/dist/config/itemTypes.d.ts.map +1 -0
- package/dist/config/partialModulesConfig.d.ts +0 -1
- package/dist/config/partialModulesConfig.d.ts.map +1 -1
- package/dist/config/registry.d.ts +2 -30
- package/dist/config/registry.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +0 -4
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/schemas.d.ts +37 -7
- package/dist/config/schemas.d.ts.map +1 -1
- package/dist/config/types.d.ts +8 -14
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/useFormatters.d.ts +10 -0
- package/dist/config/useFormatters.d.ts.map +1 -0
- package/dist/fixtures/generate.d.ts +1 -37
- package/dist/fixtures/generate.d.ts.map +1 -1
- package/dist/fixtures/index.d.ts +1 -1
- package/dist/fixtures/index.d.ts.map +1 -1
- package/dist/fixtures/scenarios.d.ts +4 -34
- package/dist/fixtures/scenarios.d.ts.map +1 -1
- package/dist/hooks/constants.d.ts +6 -40
- package/dist/hooks/constants.d.ts.map +1 -1
- package/dist/hooks/queryOptions.d.ts +2 -26
- package/dist/hooks/queryOptions.d.ts.map +1 -1
- package/dist/hooks/useItemsMode.d.ts +3 -84
- package/dist/hooks/useItemsMode.d.ts.map +1 -1
- package/dist/hooks/useModuleItemQueries.d.ts +1 -45
- package/dist/hooks/useModuleItemQueries.d.ts.map +1 -1
- package/dist/hooks/useModuleItems.d.ts +0 -16
- package/dist/hooks/useModuleItems.d.ts.map +1 -1
- package/dist/hooks/useModules.d.ts +3 -24
- package/dist/hooks/useModules.d.ts.map +1 -1
- package/dist/hooks/useModulesPageData.d.ts +9 -33
- package/dist/hooks/useModulesPageData.d.ts.map +1 -1
- package/dist/i18n.d.ts +8 -45
- package/dist/i18n.d.ts.map +1 -1
- package/dist/index.d.ts +5 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1874 -1344
- package/dist/types/domain.d.ts +9 -87
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/enums.d.ts +5 -58
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/extensions.d.ts +0 -43
- package/dist/types/extensions.d.ts.map +1 -1
- package/dist/types/filterClause.d.ts +18 -0
- package/dist/types/filterClause.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/navigation.d.ts +0 -6
- package/dist/types/navigation.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +2 -28
- package/dist/types/schemas.d.ts.map +1 -1
- package/locales/en.json +20 -9
- package/package.json +35 -31
package/dist/types/domain.d.ts
CHANGED
|
@@ -1,68 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { CompletionRequirementTypeSchema, ModuleItemStatusSchema, ModuleItemTypeSchema, ModuleStatusSchema } from './enums';
|
|
3
|
-
/**
|
|
4
|
-
* The normalized domain model shared by every host and every transport.
|
|
5
|
-
*
|
|
6
|
-
* This is deliberately smaller than what either Canvas LMS or Canvas Career
|
|
7
|
-
* fetches today: it is the *intersection* of what both need to render a
|
|
8
|
-
* modules page. Anything host-specific (blueprint locks, mastery paths,
|
|
9
|
-
* assignment overrides) rides in `extensions` rather than widening the model,
|
|
10
|
-
* so a host can never make the shared contract depend on its own UI.
|
|
11
|
-
*
|
|
12
|
-
* Three normalization rules hold at every adapter boundary:
|
|
13
|
-
*
|
|
14
|
-
* 1. Ids are strings. GraphQL hands back `_id`/`id`, REST hands back numbers.
|
|
15
|
-
* 2. `published` is always populated. REST omits the field for students,
|
|
16
|
-
* which means "published"; the adapter resolves that, not the caller.
|
|
17
|
-
* 3. Item types are one closed enum. Canvas GraphQL distinguishes new quizzes
|
|
18
|
-
* with `isNewQuiz`, REST with `quiz_lti`; both collapse to `'quiz'` here.
|
|
19
|
-
* Every enum in this file is inferred from `./enums`, so the type and the
|
|
20
|
-
* runtime validator can never disagree.
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* Every closed enum below is inferred from its Zod schema in `./enums`, never
|
|
24
|
-
* written out twice. See that file for the members, where they come from, and
|
|
25
|
-
* the runtime crash the single source of truth prevents.
|
|
26
|
-
*/
|
|
27
3
|
export type ModuleItemType = z.infer<typeof ModuleItemTypeSchema>;
|
|
28
|
-
/** Per-item state, from the designer's annotation. @see ./enums */
|
|
29
4
|
export type ModuleItemStatus = z.infer<typeof ModuleItemStatusSchema>;
|
|
30
|
-
/** Per-module rollup, from the designer's annotation. @see ./enums */
|
|
31
5
|
export type ModuleStatus = z.infer<typeof ModuleStatusSchema>;
|
|
32
|
-
/**
|
|
33
|
-
* A student's progress through a module.
|
|
34
|
-
*
|
|
35
|
-
* Optional throughout: teacher and anonymous views have no progression, and
|
|
36
|
-
* an adapter that doesn't fetch it must leave this undefined rather than
|
|
37
|
-
* fabricate zeroes — "0 of 4 requirements met" and "we didn't ask" are
|
|
38
|
-
* different things, and only one of them should render a progress bar.
|
|
39
|
-
*/
|
|
40
6
|
export interface ModuleProgress {
|
|
41
|
-
status
|
|
42
|
-
/** Requirements the student has satisfied. */
|
|
7
|
+
status?: ModuleStatus;
|
|
43
8
|
requirementsMet: number;
|
|
44
|
-
/** Requirements the module defines. Mirrors `Module.requirementCount`. */
|
|
45
9
|
requirementCount: number;
|
|
46
|
-
/** 0–100, precomputed so every host rounds it the same way. */
|
|
47
10
|
percentComplete: number;
|
|
48
|
-
/** Latest due date across the module's items; drives the header byline. */
|
|
49
11
|
latestDueAt?: string | null;
|
|
50
|
-
/** Items past due and unsubmitted. Drives the "Missing" filter chip. */
|
|
51
12
|
missingCount: number;
|
|
13
|
+
incompleteCount: number;
|
|
52
14
|
}
|
|
53
|
-
/** The six types Canvas validates, plus `unknown` for forward compat. @see ./enums */
|
|
54
15
|
export type CompletionRequirementType = z.infer<typeof CompletionRequirementTypeSchema>;
|
|
55
|
-
/** A completion requirement attached to a module item. */
|
|
56
16
|
export interface CompletionRequirement {
|
|
57
|
-
/**
|
|
58
|
-
* Id of the module **item** this requirement applies to — not an id of the
|
|
59
|
-
* requirement itself, which Canvas does not give one.
|
|
60
|
-
*
|
|
61
|
-
* Named `itemId` rather than `id` because that join is the non-obvious part:
|
|
62
|
-
* `ModuleCompletionRequirement.id` on the wire is the content tag id, which is
|
|
63
|
-
* what lets `completionRequirements` be matched against `ModuleItem.id` and
|
|
64
|
-
* against `ModuleProgression.requirementsMet`.
|
|
65
|
-
*/
|
|
66
17
|
itemId: string;
|
|
67
18
|
type: CompletionRequirementType;
|
|
68
19
|
minScore?: number | null;
|
|
@@ -73,67 +24,38 @@ export interface ModuleItem {
|
|
|
73
24
|
moduleId: string;
|
|
74
25
|
title: string;
|
|
75
26
|
type: ModuleItemType;
|
|
76
|
-
/** 1-based position within the module, as Canvas reports it. */
|
|
77
27
|
position: number;
|
|
78
|
-
/** Nesting depth used for visual indentation. */
|
|
79
28
|
indent: number;
|
|
80
29
|
published: boolean;
|
|
81
|
-
/** Canvas URL the item navigates to, when it has one. */
|
|
82
30
|
url?: string | null;
|
|
83
|
-
/** Canvas `ContentTag#new_tab`. Absent or null means the item opens in place. */
|
|
84
31
|
newTab?: boolean | null;
|
|
85
32
|
completionRequirement?: CompletionRequirement | null;
|
|
86
|
-
/** ISO 8601. Overrides are already applied by the adapter when applicable. */
|
|
87
33
|
dueAt?: string | null;
|
|
88
|
-
/**
|
|
89
|
-
* Student-view submission state. Undefined when not fetched (teacher view,
|
|
90
|
-
* anonymous, or an adapter that skips it) — distinct from `'not_started'`.
|
|
91
|
-
*/
|
|
92
34
|
status?: ModuleItemStatus;
|
|
93
|
-
/** Points the item is worth. Null for types that cannot be graded. */
|
|
94
35
|
pointsPossible?: number | null;
|
|
95
|
-
/**
|
|
96
|
-
* Host-specific fields the shared contract does not model. Opaque to this
|
|
97
|
-
* package: passed through untouched, never merged, never read directly.
|
|
98
|
-
*
|
|
99
|
-
* Read it through the accessors in `types/extensions.ts` rather than by key —
|
|
100
|
-
* they own the `unknown` narrowing and document what is in here.
|
|
101
|
-
*/
|
|
102
36
|
extensions?: Record<string, unknown>;
|
|
103
37
|
}
|
|
38
|
+
export interface PrerequisiteModule {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
}
|
|
104
42
|
export interface Module {
|
|
105
43
|
id: string;
|
|
106
44
|
name: string;
|
|
107
45
|
position: number;
|
|
108
46
|
published: boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Total items in the module, independent of how many have been fetched.
|
|
111
|
-
* Drives the items-mode policy and any "showing 10 of 40" affordance.
|
|
112
|
-
*/
|
|
113
47
|
itemCount: number;
|
|
114
|
-
/**
|
|
115
|
-
* Present in `inline` mode, absent in `onDemand` mode. An empty array means
|
|
116
|
-
* "fetched, and the module is genuinely empty" — distinct from `undefined`,
|
|
117
|
-
* which means "not fetched yet".
|
|
118
|
-
*/
|
|
48
|
+
/** Absent means the adapter did not inline them. `[]` means it did, and found none. */
|
|
119
49
|
items?: ModuleItem[];
|
|
120
50
|
unlockAt?: string | null;
|
|
121
|
-
|
|
51
|
+
prerequisiteModules: PrerequisiteModule[];
|
|
122
52
|
requirementCount?: number | null;
|
|
123
53
|
requireSequentialProgress: boolean;
|
|
124
54
|
completionRequirements?: CompletionRequirement[];
|
|
125
|
-
/**
|
|
126
|
-
* The student's progress. Undefined in teacher/anonymous views.
|
|
127
|
-
*
|
|
128
|
-
* Module-level by design: the status pill, the progress bar, the header due
|
|
129
|
-
* date and every filter chip read from here, so the whole filter row works
|
|
130
|
-
* without any item having been fetched. That is what keeps `onDemand` mode
|
|
131
|
-
* viable on a 120-module course.
|
|
132
|
-
*/
|
|
55
|
+
/** Absent means not fetched. Do not default it — that is not the same as nothing done. */
|
|
133
56
|
progress?: ModuleProgress;
|
|
134
57
|
extensions?: Record<string, unknown>;
|
|
135
58
|
}
|
|
136
|
-
/** Relay-style cursor pagination, normalized across GraphQL and REST. */
|
|
137
59
|
export interface PageInfo {
|
|
138
60
|
hasNextPage: boolean;
|
|
139
61
|
endCursor: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../src/types/domain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EACV,+BAA+B,EAC/B,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAEhB
|
|
1
|
+
{"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../src/types/domain.ts"],"names":[],"mappings":"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"}
|
package/dist/types/enums.d.ts
CHANGED
|
@@ -1,30 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Every closed enum in the contract, defined **once**, as a Zod schema.
|
|
4
|
-
*
|
|
5
|
-
* The types in `domain.ts` are `z.infer`red from these rather than hand-written
|
|
6
|
-
* beside them. That inversion is the point, and it fixes a trap: when the union
|
|
7
|
-
* and the `z.enum` were two separate lists, the two ways of desynchronizing them
|
|
8
|
-
* behaved differently.
|
|
9
|
-
*
|
|
10
|
-
* - Add a member to the `z.enum` but not the union → compile error. Loud.
|
|
11
|
-
* - Add a member to the union but not the `z.enum` → **compiles clean**. The UI
|
|
12
|
-
* can switch on it, an adapter can return it, tests pass. Then real data
|
|
13
|
-
* arrives, `ModuleItemSchema.parse()` throws "invalid enum value", and the
|
|
14
|
-
* modules page dies in the browser.
|
|
15
|
-
*
|
|
16
|
-
* Not hypothetical: `AiExperience` is a Canvas item type this adapter already
|
|
17
|
-
* drops, so "someone adds `'ai_experience'` to `ModuleItemType`" is plausibly the
|
|
18
|
-
* next change made to this file.
|
|
19
|
-
*
|
|
20
|
-
* They live in their own module, rather than in `schemas.ts`, so that `domain.ts`
|
|
21
|
-
* can derive from them without a cycle — `schemas.ts` imports the object types
|
|
22
|
-
* *from* `domain.ts` for its `z.ZodType<Module>` annotations.
|
|
23
|
-
*
|
|
24
|
-
* The explicit `z.ZodEnum<[...]>` annotations are required by the repo's
|
|
25
|
-
* `isolatedDeclarations`; they duplicate the literals, but a mismatch there is a
|
|
26
|
-
* compile error rather than a runtime one.
|
|
27
|
-
*/
|
|
28
2
|
export declare const ModuleItemTypeSchema: z.ZodEnum<[
|
|
29
3
|
'assignment',
|
|
30
4
|
'quiz',
|
|
@@ -35,52 +9,25 @@ export declare const ModuleItemTypeSchema: z.ZodEnum<[
|
|
|
35
9
|
'external_tool',
|
|
36
10
|
'sub_header'
|
|
37
11
|
]>;
|
|
38
|
-
/**
|
|
39
|
-
* Per-item state as the student-view design labels it.
|
|
40
|
-
*
|
|
41
|
-
* Taken from the designer's annotation in the Modules Foundation file rather than
|
|
42
|
-
* invented here: "Not started / In progress / Submitted / Graded / Missing /
|
|
43
|
-
* Locked". Derived by the adapter from submission state, not stored on the item
|
|
44
|
-
* in Canvas.
|
|
45
|
-
*/
|
|
46
12
|
export declare const ModuleItemStatusSchema: z.ZodEnum<[
|
|
47
13
|
'not_started',
|
|
48
14
|
'in_progress',
|
|
15
|
+
'complete',
|
|
49
16
|
'submitted',
|
|
50
17
|
'graded',
|
|
18
|
+
'excused',
|
|
51
19
|
'missing',
|
|
52
20
|
'locked'
|
|
53
21
|
]>;
|
|
54
|
-
/**
|
|
55
|
-
* Per-module rollup state.
|
|
56
|
-
*
|
|
57
|
-
* Also from the design annotation: "Not started / In progress / All submitted /
|
|
58
|
-
* All graded / Missing (1+ item past due) / Locked".
|
|
59
|
-
*
|
|
60
|
-
* NOTE: the mock renders a pill reading "All items complete" which is not in that
|
|
61
|
-
* list. Treated as a presentation label over `all_graded`/`all_submitted` until
|
|
62
|
-
* the designer says otherwise — flagged rather than guessed at.
|
|
63
|
-
*/
|
|
64
22
|
export declare const ModuleStatusSchema: z.ZodEnum<[
|
|
65
23
|
'not_started',
|
|
66
24
|
'in_progress',
|
|
67
|
-
'
|
|
68
|
-
'all_graded',
|
|
25
|
+
'complete',
|
|
69
26
|
'missing',
|
|
27
|
+
'incomplete',
|
|
28
|
+
'missing_and_incomplete',
|
|
70
29
|
'locked'
|
|
71
30
|
]>;
|
|
72
|
-
/**
|
|
73
|
-
* The kinds of completion requirement Canvas can attach to a module item.
|
|
74
|
-
*
|
|
75
|
-
* Canvas validates the same six exhaustively when a teacher saves a module
|
|
76
|
-
* (`app/models/context_module.rb:684,687`), so this is the whole set, not a
|
|
77
|
-
* sample of it.
|
|
78
|
-
*
|
|
79
|
-
* `unknown` is the forward-compatibility member: a seventh type shipping in
|
|
80
|
-
* Canvas must not make this package fail to parse a module. It lands here, the
|
|
81
|
-
* label humanizes it, and nothing downstream has to handle a string it has never
|
|
82
|
-
* heard of.
|
|
83
|
-
*/
|
|
84
31
|
export declare const CompletionRequirementTypeSchema: z.ZodEnum<[
|
|
85
32
|
'must_view',
|
|
86
33
|
'must_mark_done',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAC1C;IACE,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,MAAM;IACN,MAAM;IACN,cAAc;IACd,eAAe;IACf,YAAY;CACb,CAUD,CAAA;AAEF,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAC5C;IAAC,aAAa;IAAE,aAAa;IAAE,UAAU;IAAE,WAAW;IAAE,QAAQ;IAAE,SAAS;IAAE,SAAS;IAAE,QAAQ;CAAC,CAUjG,CAAA;AAEF,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CACxC;IACE,aAAa;IACb,aAAa;IACb,UAAU;IACV,SAAS;IACT,YAAY;IACZ,wBAAwB;IACxB,QAAQ;CACT,CASD,CAAA;AAEF,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD;IACE,WAAW;IACX,gBAAgB;IAChB,iBAAiB;IACjB,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,SAAS;CACV,CASD,CAAA"}
|
|
@@ -1,48 +1,5 @@
|
|
|
1
1
|
import { ModuleItem } from './domain';
|
|
2
|
-
/**
|
|
3
|
-
* The `extensions` escape hatch, and the only sanctioned way through it.
|
|
4
|
-
*
|
|
5
|
-
* `Module.extensions` and `ModuleItem.extensions` are `Record<string, unknown>`
|
|
6
|
-
* so a host can carry a field the shared contract does not model. The bag itself
|
|
7
|
-
* is opaque to this package — never read, never merged, passed through as it
|
|
8
|
-
* arrives — which is what stops one host's UI needs from widening the model
|
|
9
|
-
* everyone else consumes.
|
|
10
|
-
*
|
|
11
|
-
* Opaque does not mean untyped at the edges. Every field that rides in here gets
|
|
12
|
-
* a key constant and a reader in this file, so:
|
|
13
|
-
*
|
|
14
|
-
* - the key is spelled once rather than stringly-typed at each use site,
|
|
15
|
-
* - the reader owns the `unknown` → narrow conversion, and a host that writes
|
|
16
|
-
* the wrong shape gets `null` rather than a render crash,
|
|
17
|
-
* - `grep` over this file answers "what is actually in extensions today".
|
|
18
|
-
*
|
|
19
|
-
* Keys are namespaced by the host that owns them. Two hosts adding a field they
|
|
20
|
-
* both call `duration` must not collide, and an unprefixed key would make that
|
|
21
|
-
* collision silent.
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* Minutes Canvas Career estimates an item takes.
|
|
25
|
-
*
|
|
26
|
-
* Career-only: Canvas LMS has no such field, does not fetch it, and renders
|
|
27
|
-
* nothing for it. It lives here rather than on `ModuleItem` for exactly that
|
|
28
|
-
* reason — a field that is null for one of the two hosts is not part of the
|
|
29
|
-
* intersection the domain model is supposed to be.
|
|
30
|
-
*
|
|
31
|
-
* Canvas exposes it as an `ISO8601Duration` (`PT45M`); the adapter converts to
|
|
32
|
-
* whole minutes, because that is the only unit either UI renders.
|
|
33
|
-
*/
|
|
34
2
|
export declare const EXT_CAREER_ESTIMATED_DURATION_MINUTES = "career.estimatedDurationMinutes";
|
|
35
|
-
/**
|
|
36
|
-
* @returns the estimate in whole minutes, or `null` when the host did not supply
|
|
37
|
-
* one — including when it supplied something that is not a positive number.
|
|
38
|
-
*/
|
|
39
3
|
export declare function getEstimatedDurationMinutes(item: Pick<ModuleItem, 'extensions'>): number | null;
|
|
40
|
-
/**
|
|
41
|
-
* Merge an estimate into an extensions bag, or leave the bag absent.
|
|
42
|
-
*
|
|
43
|
-
* Returns `undefined` for a null estimate rather than an object holding a null,
|
|
44
|
-
* so an item with nothing host-specific about it carries no `extensions` key at
|
|
45
|
-
* all. That keeps the common case — every Canvas LMS item — free.
|
|
46
|
-
*/
|
|
47
4
|
export declare function withEstimatedDurationMinutes(extensions: Record<string, unknown> | undefined, minutes: number | null | undefined): Record<string, unknown> | undefined;
|
|
48
5
|
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/types/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/types/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,eAAO,MAAM,qCAAqC,oCAAoC,CAAA;AAEtF,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG,MAAM,GAAG,IAAI,CAI/F;AAED,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC/C,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACjC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAGrC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export type FilterTarget = 'module' | 'item';
|
|
3
|
+
/** Must stay serializable: it goes in a query key. See `docs/adr/0008-filtering-and-the-data-layer.md`. */
|
|
4
|
+
export interface FilterClause {
|
|
5
|
+
target: FilterTarget;
|
|
6
|
+
field: string;
|
|
7
|
+
op: 'eq' | 'contains';
|
|
8
|
+
value: string | boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const FilterClauseSchema: z.ZodType<FilterClause>;
|
|
11
|
+
export type TargetCapabilities = Readonly<Record<string, ReadonlyArray<FilterClause['op']>>>;
|
|
12
|
+
/** Absent means the transport serves no clause at all. */
|
|
13
|
+
export interface FilterCapabilities {
|
|
14
|
+
module?: TargetCapabilities;
|
|
15
|
+
item?: TargetCapabilities;
|
|
16
|
+
}
|
|
17
|
+
export declare function servesClause(capabilities: FilterCapabilities | undefined, clause: FilterClause): boolean;
|
|
18
|
+
//# sourceMappingURL=filterClause.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterClause.d.ts","sourceRoot":"","sources":["../../src/types/filterClause.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE5C,2GAA2G;AAC3G,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,YAAY,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,IAAI,GAAG,UAAU,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CACxB;AAED,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAO5C,CAAA;AAEX,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAE5F,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAC1B;AAED,wBAAgB,YAAY,CAC1B,YAAY,EAAE,kBAAkB,GAAG,SAAS,EAC5C,MAAM,EAAE,YAAY,GACnB,OAAO,CAIT"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export type { ModuleItemStatus, ModuleProgress, ModuleStatus, CompletionRequirement, CompletionRequirementType, Module, ModuleItem, ModuleItemsPage, ModuleItemType, ModulesPage, PageInfo, } from './domain';
|
|
1
|
+
export type { ModuleItemStatus, ModuleProgress, ModuleStatus, CompletionRequirement, CompletionRequirementType, Module, ModuleItem, ModuleItemsPage, ModuleItemType, ModulesPage, PageInfo, PrerequisiteModule, } from './domain';
|
|
2
|
+
export { type FilterCapabilities, type FilterClause, FilterClauseSchema, type FilterTarget, servesClause, type TargetCapabilities, } from './filterClause';
|
|
2
3
|
export type { ModuleItemNavigation } from './navigation';
|
|
3
|
-
export { CompletionRequirementSchema, CompletionRequirementTypeSchema, ModuleItemStatusSchema, ModuleProgressSchema, ModuleStatusSchema, ModuleItemSchema, ModuleItemsPageSchema, ModuleItemTypeSchema, ModuleSchema, ModulesPageSchema, PageInfoSchema, } from './schemas';
|
|
4
|
+
export { CompletionRequirementSchema, CompletionRequirementTypeSchema, ModuleItemStatusSchema, ModuleProgressSchema, ModuleStatusSchema, ModuleItemSchema, ModuleItemsPageSchema, ModuleItemTypeSchema, ModuleSchema, ModulesPageSchema, PageInfoSchema, PrerequisiteModuleSchema, } from './schemas';
|
|
4
5
|
export { EXT_CAREER_ESTIMATED_DURATION_MINUTES, getEstimatedDurationMinutes, withEstimatedDurationMinutes, } from './extensions';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,MAAM,EACN,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,MAAM,EACN,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,QAAQ,EACR,kBAAkB,GACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,wBAAwB,GACzB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,qCAAqC,EACrC,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,cAAc,CAAA"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { ModuleItem } from './domain';
|
|
3
|
-
/**
|
|
4
|
-
* Optional host navigation for item rows. Titles link to `ModuleItem.url`
|
|
5
|
-
* without it. Pass a stable reference: `ModuleItemRow` is memoized.
|
|
6
|
-
*/
|
|
7
3
|
export interface ModuleItemNavigation {
|
|
8
|
-
/** Rewrite an item's href. Falls back to `item.url` when it returns nullish. */
|
|
9
4
|
getItemHref?: (item: ModuleItem) => string | null | undefined;
|
|
10
|
-
/** Called on click, in addition to the href rather than instead of it. */
|
|
11
5
|
onItemClick?: (item: ModuleItem, event: MouseEvent<HTMLAnchorElement>) => void;
|
|
12
6
|
}
|
|
13
7
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAE7D,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;CAC/E"}
|
package/dist/types/schemas.d.ts
CHANGED
|
@@ -1,37 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CompletionRequirement, Module, ModuleItem, ModuleItemsPage, ModuleProgress, ModulesPage, PageInfo } from './domain';
|
|
2
|
+
import { CompletionRequirement, Module, ModuleItem, ModuleItemsPage, ModuleProgress, ModulesPage, PageInfo, PrerequisiteModule } from './domain';
|
|
3
3
|
export { CompletionRequirementTypeSchema, ModuleItemStatusSchema, ModuleItemTypeSchema, ModuleStatusSchema, } from './enums';
|
|
4
|
-
/**
|
|
5
|
-
* Runtime schemas for the domain model.
|
|
6
|
-
*
|
|
7
|
-
* These validate at the *adapter boundary*, after normalization — not at the
|
|
8
|
-
* wire. That is deliberate: the wire shapes differ per transport, but every
|
|
9
|
-
* adapter must produce something that satisfies these, which is what makes
|
|
10
|
-
* "one contract, two backends" enforceable rather than aspirational.
|
|
11
|
-
*
|
|
12
|
-
* Canvas LMS ships no response validation today and Canvas Career validates
|
|
13
|
-
* its own REST shapes; neither can catch the case this catches — one adapter
|
|
14
|
-
* quietly drifting from the other.
|
|
15
|
-
*/
|
|
16
4
|
export declare const ModuleProgressSchema: z.ZodType<ModuleProgress>;
|
|
17
5
|
export declare const CompletionRequirementSchema: z.ZodType<CompletionRequirement>;
|
|
18
6
|
export declare const ModuleItemSchema: z.ZodType<ModuleItem>;
|
|
7
|
+
export declare const PrerequisiteModuleSchema: z.ZodType<PrerequisiteModule>;
|
|
19
8
|
export declare const ModuleSchema: z.ZodType<Module>;
|
|
20
|
-
/**
|
|
21
|
-
* Relay page info, with the dead-cursor combination refused.
|
|
22
|
-
*
|
|
23
|
-
* `hasNextPage: true` with a null `endCursor` type-checks but cannot be acted
|
|
24
|
-
* on: the hooks report `hasNextPage` straight off the last page, while paging is
|
|
25
|
-
* driven by `endCursor`, where null means "done" to TanStack Query. That pair
|
|
26
|
-
* therefore renders a "Load more" control that can never load anything — the
|
|
27
|
-
* silent-truncation failure this package exists to prevent, wearing a button.
|
|
28
|
-
*
|
|
29
|
-
* Relay's own spec makes it unreachable for a GraphQL adapter, but a REST
|
|
30
|
-
* adapter parsing an RFC-5988 `Link` header is one plausible bug away from it:
|
|
31
|
-
* see a `rel="next"`, set `hasNextPage`, then fail to extract the cursor from
|
|
32
|
-
* the URL. The refine is what makes it unrepresentable rather than merely
|
|
33
|
-
* unlikely.
|
|
34
|
-
*/
|
|
35
9
|
export declare const PageInfoSchema: z.ZodType<PageInfo>;
|
|
36
10
|
export declare const ModulesPageSchema: z.ZodType<ModulesPage>;
|
|
37
11
|
export declare const ModuleItemsPageSchema: z.ZodType<ModuleItemsPage>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/types/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EACV,qBAAqB,EACrB,MAAM,EACN,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,QAAQ,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/types/schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EACV,qBAAqB,EACrB,MAAM,EACN,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,QAAQ,EACR,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAQjB,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAQzD,CAAA;AAEF,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAKvE,CAAA;AAEF,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAejD,CAAA;AAEF,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAGjE,CAAA;AAEF,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAczC,CAAA;AAEF,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAU3C,CAAA;AAEJ,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAGnD,CAAA;AAEF,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAG3D,CAAA"}
|
package/locales/en.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"expandAll": "Expand all",
|
|
11
11
|
"collapseAll": "Collapse all",
|
|
12
12
|
"searchScopeHint": "Search matches module names only — items of collapsed modules are not loaded.",
|
|
13
|
+
"filterScopeHint": "This filter runs on the modules loaded so far — load more to filter the rest of the course.",
|
|
13
14
|
"modulesLoadErrorAlert": "Modules failed to load: %{message}",
|
|
14
15
|
"modulesLoadingSpinnerLabel": "Loading modules",
|
|
15
16
|
"noModulesEmptyState": "This course has no modules.",
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
"one": "The only loaded module does not match this filter.",
|
|
18
19
|
"other": "None of the %{count} loaded modules match this filter."
|
|
19
20
|
},
|
|
21
|
+
"noFilterMatches": "No modules match this filter.",
|
|
20
22
|
"clearFilters": "Clear filters",
|
|
21
23
|
"loadMoreModulesLoading": "Loading more modules…",
|
|
22
24
|
"loadMoreModules": "Load more modules (%{count} loaded)",
|
|
@@ -24,14 +26,12 @@
|
|
|
24
26
|
"one": "The only module in this course is loaded.",
|
|
25
27
|
"other": "All %{count} modules in this course are loaded."
|
|
26
28
|
},
|
|
27
|
-
|
|
28
29
|
"filterGroupLabel": "Filter",
|
|
29
30
|
"filterAll": "All",
|
|
30
31
|
"filterInProgress": "In progress",
|
|
31
32
|
"filterComplete": "Complete",
|
|
32
33
|
"filterDueThisWeek": "Due this week",
|
|
33
34
|
"filterMissing": "Missing",
|
|
34
|
-
|
|
35
35
|
"lockedByline": "Locked until prerequisites are met",
|
|
36
36
|
"moduleProgressScreenReaderLabel": "%{name} progress",
|
|
37
37
|
"itemsLoadedAnnouncement": {
|
|
@@ -47,21 +47,21 @@
|
|
|
47
47
|
"moduleUnpublishedBadge": "(unpublished)",
|
|
48
48
|
"collapseModule": "Collapse %{name}",
|
|
49
49
|
"expandModule": "Expand %{name}",
|
|
50
|
-
|
|
51
50
|
"moduleStatusNotStarted": "Not started",
|
|
52
51
|
"moduleStatusInProgress": "In progress",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
52
|
+
"moduleStatusComplete": "All completed",
|
|
53
|
+
"moduleStatusMissing": "%{count} Missing",
|
|
54
|
+
"moduleStatusIncomplete": "%{count} Incomplete",
|
|
55
|
+
"moduleStatusMissingAndIncomplete": "%{missing} & %{incomplete}",
|
|
56
56
|
"moduleStatusLocked": "Locked",
|
|
57
|
-
|
|
58
57
|
"itemStatusNotStarted": "Not started",
|
|
59
58
|
"itemStatusInProgress": "In progress",
|
|
59
|
+
"itemStatusComplete": "Complete",
|
|
60
60
|
"itemStatusSubmitted": "Submitted",
|
|
61
61
|
"itemStatusGraded": "Graded",
|
|
62
|
+
"itemStatusExcused": "Excused",
|
|
62
63
|
"itemStatusMissing": "Missing",
|
|
63
64
|
"itemStatusLocked": "Locked",
|
|
64
|
-
|
|
65
65
|
"itemTypeAssignment": "Assignment",
|
|
66
66
|
"itemTypeQuiz": "Quiz",
|
|
67
67
|
"itemTypeDiscussion": "Discussion",
|
|
@@ -71,6 +71,13 @@
|
|
|
71
71
|
"itemTypeExternalTool": "External tool",
|
|
72
72
|
"itemTypeSubHeader": "Text header",
|
|
73
73
|
|
|
74
|
+
"metaFieldTypeLabel": "Item type",
|
|
75
|
+
"metaFieldDueAtLabel": "Due date",
|
|
76
|
+
"metaFieldPointsLabel": "Points",
|
|
77
|
+
"metaFieldRequirementLabel": "Requirement",
|
|
78
|
+
"metaFieldDurationLabel": "Estimated duration",
|
|
79
|
+
"metaFieldPublishStateLabel": "Publish state",
|
|
80
|
+
|
|
74
81
|
"requirementMustView": "View the item",
|
|
75
82
|
"requirementMustSubmit": "Submit the assignment",
|
|
76
83
|
"requirementMustContribute": "Contribute to the page",
|
|
@@ -80,11 +87,11 @@
|
|
|
80
87
|
"requirementMinPercentageUnknown": "Score at least the minimum percentage",
|
|
81
88
|
"requirementMinPercentage": "Score at least %{count}%",
|
|
82
89
|
"requirementUnknown": "Complete the requirement",
|
|
83
|
-
|
|
84
90
|
"dateTimeToday": "today, %{time}",
|
|
85
91
|
"dateTimeYesterday": "yesterday, %{time}",
|
|
86
92
|
"dateTimeTomorrow": "tomorrow, %{time}",
|
|
87
93
|
"dateTimeWithDate": "%{date}, %{time}",
|
|
94
|
+
"timeWithZone": "%{time} (%{zone})",
|
|
88
95
|
"dueByline": "Due %{when}",
|
|
89
96
|
"unlockByline": "Will unlock on %{when}",
|
|
90
97
|
"pointsAbbreviated": {
|
|
@@ -95,6 +102,10 @@
|
|
|
95
102
|
"one": "%{percent}% | %{met} of %{count} requirement met",
|
|
96
103
|
"other": "%{percent}% | %{met} of %{count} requirements met"
|
|
97
104
|
},
|
|
105
|
+
"progressScreenReaderValue": {
|
|
106
|
+
"one": "%{percent}% complete, %{met} of %{count} requirement met",
|
|
107
|
+
"other": "%{percent}% complete, %{met} of %{count} requirements met"
|
|
108
|
+
},
|
|
98
109
|
"durationMinutes": "%{count} min",
|
|
99
110
|
"itemUnpublishedLabel": "Unpublished",
|
|
100
111
|
"itemUntitled": "Untitled item",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/platform-modules",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -17,20 +17,22 @@
|
|
|
17
17
|
"locales"
|
|
18
18
|
],
|
|
19
19
|
"peerDependencies": {
|
|
20
|
+
"@instructure/emotion": "^11.0.0",
|
|
20
21
|
"@instructure/ui-a11y-content": "^11.0.0",
|
|
21
|
-
"@instructure/ui-alerts": "^11.
|
|
22
|
-
"@instructure/ui-buttons": "^11.
|
|
23
|
-
"@instructure/ui-flex": "^11.
|
|
24
|
-
"@instructure/ui-heading": "^11.
|
|
22
|
+
"@instructure/ui-alerts": "^11.7.0",
|
|
23
|
+
"@instructure/ui-buttons": "^11.7.0",
|
|
24
|
+
"@instructure/ui-flex": "^11.7.0",
|
|
25
|
+
"@instructure/ui-heading": "^11.7.0",
|
|
25
26
|
"@instructure/ui-icons": "^11.0.0",
|
|
26
|
-
"@instructure/ui-link": "^11.
|
|
27
|
-
"@instructure/ui-menu": "^11.
|
|
28
|
-
"@instructure/ui-pill": "^11.
|
|
29
|
-
"@instructure/ui-progress": "^11.
|
|
30
|
-
"@instructure/ui-
|
|
31
|
-
"@instructure/ui-
|
|
32
|
-
"@instructure/ui-text
|
|
33
|
-
"@instructure/ui-
|
|
27
|
+
"@instructure/ui-link": "^11.7.0",
|
|
28
|
+
"@instructure/ui-menu": "^11.7.0",
|
|
29
|
+
"@instructure/ui-pill": "^11.7.0",
|
|
30
|
+
"@instructure/ui-progress": "^11.7.0",
|
|
31
|
+
"@instructure/ui-responsive": "^11.0.0",
|
|
32
|
+
"@instructure/ui-spinner": "^11.7.0",
|
|
33
|
+
"@instructure/ui-text": "^11.7.0",
|
|
34
|
+
"@instructure/ui-text-input": "^11.7.0",
|
|
35
|
+
"@instructure/ui-view": "^11.7.0",
|
|
34
36
|
"@tanstack/react-query": "^5.0.0",
|
|
35
37
|
"graphql": "^16.0.0",
|
|
36
38
|
"react": "^18.0.0",
|
|
@@ -40,25 +42,27 @@
|
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"graphql-tag": "^2.12.6",
|
|
42
44
|
"p-limit": "^6.1.0",
|
|
43
|
-
"@instructure/platform-instui-bindings": "0.6.4"
|
|
45
|
+
"@instructure/platform-instui-bindings": "0.6.4",
|
|
46
|
+
"@instructure/platform-with-breakpoints": "0.3.0"
|
|
44
47
|
},
|
|
45
48
|
"devDependencies": {
|
|
46
|
-
"@instructure/emotion": "11.
|
|
47
|
-
"@instructure/ui-a11y-content": "11.
|
|
48
|
-
"@instructure/ui-alerts": "11.
|
|
49
|
-
"@instructure/ui-buttons": "11.
|
|
50
|
-
"@instructure/ui-flex": "11.
|
|
51
|
-
"@instructure/ui-heading": "11.
|
|
52
|
-
"@instructure/ui-icons": "11.
|
|
53
|
-
"@instructure/ui-link": "11.
|
|
54
|
-
"@instructure/ui-menu": "11.
|
|
55
|
-
"@instructure/ui-pill": "11.
|
|
56
|
-
"@instructure/ui-progress": "11.
|
|
57
|
-
"@instructure/ui-
|
|
58
|
-
"@instructure/ui-
|
|
59
|
-
"@instructure/ui-text
|
|
60
|
-
"@instructure/ui-
|
|
61
|
-
"@instructure/ui-
|
|
49
|
+
"@instructure/emotion": "11.7.4",
|
|
50
|
+
"@instructure/ui-a11y-content": "11.7.4",
|
|
51
|
+
"@instructure/ui-alerts": "11.7.4",
|
|
52
|
+
"@instructure/ui-buttons": "11.7.4",
|
|
53
|
+
"@instructure/ui-flex": "11.7.4",
|
|
54
|
+
"@instructure/ui-heading": "11.7.4",
|
|
55
|
+
"@instructure/ui-icons": "11.7.4",
|
|
56
|
+
"@instructure/ui-link": "11.7.4",
|
|
57
|
+
"@instructure/ui-menu": "11.7.4",
|
|
58
|
+
"@instructure/ui-pill": "11.7.4",
|
|
59
|
+
"@instructure/ui-progress": "11.7.4",
|
|
60
|
+
"@instructure/ui-responsive": "11.7.4",
|
|
61
|
+
"@instructure/ui-spinner": "11.7.4",
|
|
62
|
+
"@instructure/ui-text": "11.7.4",
|
|
63
|
+
"@instructure/ui-text-input": "11.7.4",
|
|
64
|
+
"@instructure/ui-themes": "11.7.4",
|
|
65
|
+
"@instructure/ui-view": "11.7.4",
|
|
62
66
|
"@storybook/react": "^10.0.8",
|
|
63
67
|
"@testing-library/jest-dom": "^6.9.1",
|
|
64
68
|
"@testing-library/react": "^16.0.0",
|
|
@@ -74,7 +78,7 @@
|
|
|
74
78
|
"vite-plugin-dts": "^4.0.0",
|
|
75
79
|
"vitest": "^4.0.0",
|
|
76
80
|
"zod": "^3.23.8",
|
|
77
|
-
"@instructure/platform-mock-canvas-api": "0.5.
|
|
81
|
+
"@instructure/platform-mock-canvas-api": "0.5.1"
|
|
78
82
|
},
|
|
79
83
|
"scripts": {
|
|
80
84
|
"build": "vite build",
|