@instructure/platform-modules 0.1.1 → 0.3.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 +113 -3
- package/dist/adapters/canvasGraphql/index.d.ts +1 -1
- package/dist/adapters/canvasGraphql/normalize.d.ts +7 -6
- package/dist/adapters/canvasGraphql/normalize.d.ts.map +1 -1
- package/dist/adapters/canvasGraphql/queries.d.ts +2 -2
- package/dist/adapters/canvasGraphql/queries.d.ts.map +1 -1
- package/dist/adapters/inMemory.d.ts +4 -4
- package/dist/adapters/limits.d.ts +4 -4
- package/dist/adapters/types.d.ts +6 -6
- package/dist/cache/keys.d.ts +1 -1
- package/dist/components/FilterChips.d.ts +10 -8
- package/dist/components/FilterChips.d.ts.map +1 -1
- package/dist/components/ModuleCard.d.ts +18 -6
- package/dist/components/ModuleCard.d.ts.map +1 -1
- package/dist/components/ModuleCard.stories.d.ts +12 -0
- package/dist/components/ModuleCard.stories.d.ts.map +1 -0
- package/dist/components/ModuleItemRow.d.ts +4 -2
- package/dist/components/ModuleItemRow.d.ts.map +1 -1
- package/dist/components/ModuleNumberBadge.d.ts +8 -0
- package/dist/components/ModuleNumberBadge.d.ts.map +1 -0
- package/dist/components/ModulesList.d.ts +4 -1
- package/dist/components/ModulesList.d.ts.map +1 -1
- package/dist/components/ModulesList.stories.d.ts +36 -8
- package/dist/components/ModulesList.stories.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/labels.d.ts +9 -13
- package/dist/components/labels.d.ts.map +1 -1
- package/dist/config/base.d.ts +8 -0
- package/dist/config/base.d.ts.map +1 -0
- package/dist/config/context.d.ts +11 -0
- package/dist/config/context.d.ts.map +1 -0
- package/dist/config/index.d.ts +6 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/partialModulesConfig.d.ts +4 -0
- package/dist/config/partialModulesConfig.d.ts.map +1 -0
- package/dist/config/registry.d.ts +3 -0
- package/dist/config/registry.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +7 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/schemas.d.ts +2 -0
- package/dist/config/schemas.d.ts.map +1 -1
- package/dist/config/types.d.ts +32 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/fixtures/generate.d.ts +1 -1
- 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 +5 -0
- package/dist/fixtures/scenarios.d.ts.map +1 -1
- package/dist/hooks/constants.d.ts +1 -1
- package/dist/hooks/queryOptions.d.ts +1 -1
- package/dist/hooks/useModuleItemQueries.d.ts +1 -1
- package/dist/hooks/useModuleItems.d.ts +1 -1
- package/dist/hooks/useModules.d.ts +1 -1
- package/dist/i18n.d.ts +33 -63
- package/dist/i18n.d.ts.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1135 -867
- package/dist/types/domain.d.ts +5 -3
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/enums.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/navigation.d.ts +13 -0
- package/dist/types/navigation.d.ts.map +1 -0
- package/dist/types/schemas.d.ts +1 -1
- package/dist/types/schemas.d.ts.map +1 -1
- package/locales/en.json +102 -0
- package/package.json +11 -3
package/dist/types/domain.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { CompletionRequirementTypeSchema, ModuleItemStatusSchema, ModuleItemTypeSchema, ModuleStatusSchema } from './enums';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The normalized domain model shared by every host and every transport.
|
|
5
5
|
*
|
|
6
6
|
* This is deliberately smaller than what either Canvas LMS or Canvas Career
|
|
7
7
|
* fetches today: it is the *intersection* of what both need to render a
|
|
@@ -9,7 +9,7 @@ import { CompletionRequirementTypeSchema, ModuleItemStatusSchema, ModuleItemType
|
|
|
9
9
|
* assignment overrides) rides in `extensions` rather than widening the model,
|
|
10
10
|
* so a host can never make the shared contract depend on its own UI.
|
|
11
11
|
*
|
|
12
|
-
* Three
|
|
12
|
+
* Three normalization rules hold at every adapter boundary:
|
|
13
13
|
*
|
|
14
14
|
* 1. Ids are strings. GraphQL hands back `_id`/`id`, REST hands back numbers.
|
|
15
15
|
* 2. `published` is always populated. REST omits the field for students,
|
|
@@ -80,6 +80,8 @@ export interface ModuleItem {
|
|
|
80
80
|
published: boolean;
|
|
81
81
|
/** Canvas URL the item navigates to, when it has one. */
|
|
82
82
|
url?: string | null;
|
|
83
|
+
/** Canvas `ContentTag#new_tab`. Absent or null means the item opens in place. */
|
|
84
|
+
newTab?: boolean | null;
|
|
83
85
|
completionRequirement?: CompletionRequirement | null;
|
|
84
86
|
/** ISO 8601. Overrides are already applied by the adapter when applicable. */
|
|
85
87
|
dueAt?: string | null;
|
|
@@ -131,7 +133,7 @@ export interface Module {
|
|
|
131
133
|
progress?: ModuleProgress;
|
|
132
134
|
extensions?: Record<string, unknown>;
|
|
133
135
|
}
|
|
134
|
-
/** Relay-style cursor pagination,
|
|
136
|
+
/** Relay-style cursor pagination, normalized across GraphQL and REST. */
|
|
135
137
|
export interface PageInfo {
|
|
136
138
|
hasNextPage: boolean;
|
|
137
139
|
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;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;GAIG;AAEH,MAAM,MAA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AAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC;AAED,yEAAyE;AACzE,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,QAAQ,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,QAAQ,EAAE,QAAQ,CAAA;CACnB"}
|
package/dist/types/enums.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
*
|
|
5
5
|
* The types in `domain.ts` are `z.infer`red from these rather than hand-written
|
|
6
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
|
|
7
|
+
* and the `z.enum` were two separate lists, the two ways of desynchronizing them
|
|
8
8
|
* behaved differently.
|
|
9
9
|
*
|
|
10
10
|
* - Add a member to the `z.enum` but not the union → compile error. Loud.
|
|
@@ -78,7 +78,7 @@ export declare const ModuleStatusSchema: z.ZodEnum<[
|
|
|
78
78
|
*
|
|
79
79
|
* `unknown` is the forward-compatibility member: a seventh type shipping in
|
|
80
80
|
* Canvas must not make this package fail to parse a module. It lands here, the
|
|
81
|
-
* label
|
|
81
|
+
* label humanizes it, and nothing downstream has to handle a string it has never
|
|
82
82
|
* heard of.
|
|
83
83
|
*/
|
|
84
84
|
export declare const CompletionRequirementTypeSchema: z.ZodEnum<[
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { ModuleItemStatus, ModuleProgress, ModuleStatus, CompletionRequirement, CompletionRequirementType, Module, ModuleItem, ModuleItemsPage, ModuleItemType, ModulesPage, PageInfo, } from './domain';
|
|
2
|
+
export type { ModuleItemNavigation } from './navigation';
|
|
2
3
|
export { CompletionRequirementSchema, CompletionRequirementTypeSchema, ModuleItemStatusSchema, ModuleProgressSchema, ModuleStatusSchema, ModuleItemSchema, ModuleItemsPageSchema, ModuleItemTypeSchema, ModuleSchema, ModulesPageSchema, PageInfoSchema, } from './schemas';
|
|
3
4
|
export { EXT_CAREER_ESTIMATED_DURATION_MINUTES, getEstimatedDurationMinutes, withEstimatedDurationMinutes, } from './extensions';
|
|
4
5
|
//# 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,GACT,MAAM,UAAU,CAAA;AACjB,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,GACf,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,qCAAqC,EACrC,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,cAAc,CAAA"}
|
|
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,GACT,MAAM,UAAU,CAAA;AACjB,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,GACf,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,qCAAqC,EACrC,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
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
|
+
export interface ModuleItemNavigation {
|
|
8
|
+
/** Rewrite an item's href. Falls back to `item.url` when it returns nullish. */
|
|
9
|
+
getItemHref?: (item: ModuleItem) => string | null | undefined;
|
|
10
|
+
/** Called on click, in addition to the href rather than instead of it. */
|
|
11
|
+
onItemClick?: (item: ModuleItem, event: MouseEvent<HTMLAnchorElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +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;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,gFAAgF;IAChF,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAE7D,0EAA0E;IAC1E,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
|
@@ -4,7 +4,7 @@ export { CompletionRequirementTypeSchema, ModuleItemStatusSchema, ModuleItemType
|
|
|
4
4
|
/**
|
|
5
5
|
* Runtime schemas for the domain model.
|
|
6
6
|
*
|
|
7
|
-
* These validate at the *adapter boundary*, after
|
|
7
|
+
* These validate at the *adapter boundary*, after normalization — not at the
|
|
8
8
|
* wire. That is deliberate: the wire shapes differ per transport, but every
|
|
9
9
|
* adapter must produce something that satisfies these, which is what makes
|
|
10
10
|
* "one contract, two backends" enforceable rather than aspirational.
|
|
@@ -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,EACT,MAAM,UAAU,CAAA;AAWjB,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAOzD,CAAA;AAEF,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAKvE,CAAA;AAEF,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,
|
|
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,EACT,MAAM,UAAU,CAAA;AAWjB,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAOzD,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,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAczC,CAAA;AAEF;;;;;;;;;;;;;;GAcG;AACH,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
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pageTitle": "Course modules",
|
|
3
|
+
"modulesLoadedAnnouncement": {
|
|
4
|
+
"one": "%{count} module loaded",
|
|
5
|
+
"other": "%{count} modules loaded"
|
|
6
|
+
},
|
|
7
|
+
"moduleSearchLabel": "Search by name",
|
|
8
|
+
"searchPlaceholder": "Search…",
|
|
9
|
+
"expandCollapseTrigger": "Expand / collapse",
|
|
10
|
+
"expandAll": "Expand all",
|
|
11
|
+
"collapseAll": "Collapse all",
|
|
12
|
+
"searchScopeHint": "Search matches module names only — items of collapsed modules are not loaded.",
|
|
13
|
+
"modulesLoadErrorAlert": "Modules failed to load: %{message}",
|
|
14
|
+
"modulesLoadingSpinnerLabel": "Loading modules",
|
|
15
|
+
"noModulesEmptyState": "This course has no modules.",
|
|
16
|
+
"filteredEmptyState": {
|
|
17
|
+
"one": "The only loaded module does not match this filter.",
|
|
18
|
+
"other": "None of the %{count} loaded modules match this filter."
|
|
19
|
+
},
|
|
20
|
+
"clearFilters": "Clear filters",
|
|
21
|
+
"loadMoreModulesLoading": "Loading more modules…",
|
|
22
|
+
"loadMoreModules": "Load more modules (%{count} loaded)",
|
|
23
|
+
"allModulesLoaded": {
|
|
24
|
+
"one": "The only module in this course is loaded.",
|
|
25
|
+
"other": "All %{count} modules in this course are loaded."
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
"filterGroupLabel": "Filter",
|
|
29
|
+
"filterAll": "All",
|
|
30
|
+
"filterInProgress": "In progress",
|
|
31
|
+
"filterComplete": "Complete",
|
|
32
|
+
"filterDueThisWeek": "Due this week",
|
|
33
|
+
"filterMissing": "Missing",
|
|
34
|
+
|
|
35
|
+
"lockedByline": "Locked until prerequisites are met",
|
|
36
|
+
"moduleProgressScreenReaderLabel": "%{name} progress",
|
|
37
|
+
"itemsLoadedAnnouncement": {
|
|
38
|
+
"one": "%{loaded} of %{count} item loaded in %{name}",
|
|
39
|
+
"other": "%{loaded} of %{count} items loaded in %{name}"
|
|
40
|
+
},
|
|
41
|
+
"itemsLoadErrorAlert": "Items failed to load: %{message}",
|
|
42
|
+
"itemsLoadingSpinnerLabel": "Loading items",
|
|
43
|
+
"itemsLoadingText": "Loading…",
|
|
44
|
+
"noItemsEmptyState": "No items.",
|
|
45
|
+
"loadMoreItemsLoading": "Loading more items…",
|
|
46
|
+
"loadMoreItems": "Load more items (%{loaded} of %{count} loaded)",
|
|
47
|
+
"moduleUnpublishedBadge": "(unpublished)",
|
|
48
|
+
"collapseModule": "Collapse %{name}",
|
|
49
|
+
"expandModule": "Expand %{name}",
|
|
50
|
+
|
|
51
|
+
"moduleStatusNotStarted": "Not started",
|
|
52
|
+
"moduleStatusInProgress": "In progress",
|
|
53
|
+
"moduleStatusAllSubmitted": "All items complete",
|
|
54
|
+
"moduleStatusAllGraded": "All items graded",
|
|
55
|
+
"moduleStatusMissing": "Missing",
|
|
56
|
+
"moduleStatusLocked": "Locked",
|
|
57
|
+
|
|
58
|
+
"itemStatusNotStarted": "Not started",
|
|
59
|
+
"itemStatusInProgress": "In progress",
|
|
60
|
+
"itemStatusSubmitted": "Submitted",
|
|
61
|
+
"itemStatusGraded": "Graded",
|
|
62
|
+
"itemStatusMissing": "Missing",
|
|
63
|
+
"itemStatusLocked": "Locked",
|
|
64
|
+
|
|
65
|
+
"itemTypeAssignment": "Assignment",
|
|
66
|
+
"itemTypeQuiz": "Quiz",
|
|
67
|
+
"itemTypeDiscussion": "Discussion",
|
|
68
|
+
"itemTypePage": "Page",
|
|
69
|
+
"itemTypeFile": "File",
|
|
70
|
+
"itemTypeExternalUrl": "External URL",
|
|
71
|
+
"itemTypeExternalTool": "External tool",
|
|
72
|
+
"itemTypeSubHeader": "Text header",
|
|
73
|
+
|
|
74
|
+
"requirementMustView": "View the item",
|
|
75
|
+
"requirementMustSubmit": "Submit the assignment",
|
|
76
|
+
"requirementMustContribute": "Contribute to the page",
|
|
77
|
+
"requirementMustMarkDone": "Mark as done",
|
|
78
|
+
"requirementMinScoreUnknown": "Score at least the minimum",
|
|
79
|
+
"requirementMinScore": "Score at least %{count}",
|
|
80
|
+
"requirementMinPercentageUnknown": "Score at least the minimum percentage",
|
|
81
|
+
"requirementMinPercentage": "Score at least %{count}%",
|
|
82
|
+
"requirementUnknown": "Complete the requirement",
|
|
83
|
+
|
|
84
|
+
"dateTimeToday": "today, %{time}",
|
|
85
|
+
"dateTimeYesterday": "yesterday, %{time}",
|
|
86
|
+
"dateTimeTomorrow": "tomorrow, %{time}",
|
|
87
|
+
"dateTimeWithDate": "%{date}, %{time}",
|
|
88
|
+
"dueByline": "Due %{when}",
|
|
89
|
+
"unlockByline": "Will unlock on %{when}",
|
|
90
|
+
"pointsAbbreviated": {
|
|
91
|
+
"one": "%{count} pt",
|
|
92
|
+
"other": "%{count} pts"
|
|
93
|
+
},
|
|
94
|
+
"progressSummary": {
|
|
95
|
+
"one": "%{percent}% | %{met} of %{count} requirement met",
|
|
96
|
+
"other": "%{percent}% | %{met} of %{count} requirements met"
|
|
97
|
+
},
|
|
98
|
+
"durationMinutes": "%{count} min",
|
|
99
|
+
"itemUnpublishedLabel": "Unpublished",
|
|
100
|
+
"itemUntitled": "Untitled item",
|
|
101
|
+
"opensInNewWindow": "opens in a new window"
|
|
102
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/platform-modules",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -9,17 +9,21 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"./locales/*": "./locales/*"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"locales"
|
|
16
18
|
],
|
|
17
19
|
"peerDependencies": {
|
|
20
|
+
"@instructure/ui-a11y-content": "^11.0.0",
|
|
18
21
|
"@instructure/ui-alerts": "^11.0.0",
|
|
19
22
|
"@instructure/ui-buttons": "^11.0.0",
|
|
20
23
|
"@instructure/ui-flex": "^11.0.0",
|
|
21
24
|
"@instructure/ui-heading": "^11.0.0",
|
|
22
25
|
"@instructure/ui-icons": "^11.0.0",
|
|
26
|
+
"@instructure/ui-link": "^11.0.0",
|
|
23
27
|
"@instructure/ui-menu": "^11.0.0",
|
|
24
28
|
"@instructure/ui-pill": "^11.0.0",
|
|
25
29
|
"@instructure/ui-progress": "^11.0.0",
|
|
@@ -39,17 +43,21 @@
|
|
|
39
43
|
"@instructure/platform-instui-bindings": "0.6.4"
|
|
40
44
|
},
|
|
41
45
|
"devDependencies": {
|
|
46
|
+
"@instructure/emotion": "11.6.0",
|
|
47
|
+
"@instructure/ui-a11y-content": "11.6.0",
|
|
42
48
|
"@instructure/ui-alerts": "11.6.0",
|
|
43
49
|
"@instructure/ui-buttons": "11.6.0",
|
|
44
50
|
"@instructure/ui-flex": "11.6.0",
|
|
45
51
|
"@instructure/ui-heading": "11.6.0",
|
|
46
52
|
"@instructure/ui-icons": "11.6.0",
|
|
53
|
+
"@instructure/ui-link": "11.6.0",
|
|
47
54
|
"@instructure/ui-menu": "11.6.0",
|
|
48
55
|
"@instructure/ui-pill": "11.6.0",
|
|
49
56
|
"@instructure/ui-progress": "11.6.0",
|
|
50
57
|
"@instructure/ui-spinner": "11.6.0",
|
|
51
58
|
"@instructure/ui-text": "11.6.0",
|
|
52
59
|
"@instructure/ui-text-input": "11.6.0",
|
|
60
|
+
"@instructure/ui-themes": "11.6.0",
|
|
53
61
|
"@instructure/ui-view": "11.6.0",
|
|
54
62
|
"@storybook/react": "^10.0.8",
|
|
55
63
|
"@testing-library/jest-dom": "^6.9.1",
|