@instructure/platform-rubrics 0.1.1 → 0.2.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/dist/_internal/CourseRubrics/gql.d.ts +3 -0
- package/dist/_internal/CourseRubrics/gql.d.ts.map +1 -0
- package/dist/_internal/CourseRubrics/useCourseRubrics.d.ts +10 -0
- package/dist/_internal/CourseRubrics/useCourseRubrics.d.ts.map +1 -0
- package/dist/_internal/RubricForm/queries/gql.d.ts +5 -0
- package/dist/_internal/RubricForm/queries/gql.d.ts.map +1 -0
- package/dist/_internal/RubricForm/queries/mutations.d.ts +11 -0
- package/dist/_internal/RubricForm/queries/mutations.d.ts.map +1 -0
- package/dist/_internal/RubricForm/queries/queries.d.ts +16 -0
- package/dist/_internal/RubricForm/queries/queries.d.ts.map +1 -0
- package/dist/_internal/constants/i18n.d.ts +18 -0
- package/dist/_internal/constants/i18n.d.ts.map +1 -0
- package/dist/_internal/hooks/useLocalStorage.d.ts +4 -0
- package/dist/_internal/hooks/useLocalStorage.d.ts.map +1 -0
- package/dist/_internal/hooks/useRubricsPlatformUiContext.d.ts +4 -0
- package/dist/_internal/hooks/useRubricsPlatformUiContext.d.ts.map +1 -0
- package/dist/_internal/types/RubricForm.d.ts +26 -0
- package/dist/_internal/types/RubricForm.d.ts.map +1 -0
- package/dist/_internal/types/i18n.d.ts +63 -0
- package/dist/_internal/types/i18n.d.ts.map +1 -0
- package/dist/_internal/types/rubric.d.ts +51 -0
- package/dist/_internal/types/rubric.d.ts.map +1 -0
- package/dist/_internal/utils/errorPage.d.ts +37 -0
- package/dist/_internal/utils/errorPage.d.ts.map +1 -0
- package/dist/_internal/utils/i18n.d.ts +6 -0
- package/dist/_internal/utils/i18n.d.ts.map +1 -0
- package/dist/_internal/utils/rubricMapping.d.ts +64 -0
- package/dist/_internal/utils/rubricMapping.d.ts.map +1 -0
- package/dist/_internal/utils/tryParseJson.d.ts +5 -0
- package/dist/_internal/utils/tryParseJson.d.ts.map +1 -0
- package/dist/canvas/RubricForm/components/WarningModal.d.ts +7 -0
- package/dist/canvas/RubricForm/components/WarningModal.d.ts.map +1 -0
- package/dist/canvas/index.d.ts +1 -1
- package/dist/canvas/index.d.ts.map +1 -1
- package/dist/canvas.js +1 -1
- package/dist/chunks/helloWorld-CNLQb2fe.js +4 -0
- package/dist/foundation/RubricSelector/RubricSelector.d.ts +26 -0
- package/dist/foundation/RubricSelector/RubricSelector.d.ts.map +1 -0
- package/dist/foundation/index.d.ts +3 -1
- package/dist/foundation/index.d.ts.map +1 -1
- package/dist/foundation.js +159 -6
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -2
- package/locales/en.json +17 -0
- package/package.json +31 -6
- package/dist/_internal/types.d.ts +0 -5
- package/dist/_internal/types.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../../src/_internal/CourseRubrics/gql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,eAAO,MAAM,yBAAyB,EAAE,YAiBvC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CourseRubricsListQuery } from '@instructure/platform-graphql-types';
|
|
2
|
+
type CourseRubricsConnection = NonNullable<CourseRubricsListQuery['course']>['rubricsConnection'];
|
|
3
|
+
export type CourseRubricSummary = NonNullable<NonNullable<CourseRubricsConnection>['nodes']>[number];
|
|
4
|
+
export type CourseRubricsResult = {
|
|
5
|
+
rubrics: NonNullable<CourseRubricSummary>[];
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function useCourseRubrics(courseId: string | undefined): import('@tanstack/react-query').UseQueryResult<CourseRubricsResult, Error>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=useCourseRubrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCourseRubrics.d.ts","sourceRoot":"","sources":["../../../src/_internal/CourseRubrics/useCourseRubrics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAIjF,KAAK,uBAAuB,GAAG,WAAW,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAA;AACjG,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpG,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,WAAW,CAAC,mBAAmB,CAAC,EAAE,CAAA;IAC3C,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,8EAoB5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../../../src/_internal/RubricForm/queries/gql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,eAAO,MAAM,2BAA2B,EAAE,YA0CzC,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,YAWjC,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,YAWlC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RubricFormProps } from '../../types/RubricForm';
|
|
2
|
+
import { Rubric, RubricAssociation } from '../../types/rubric';
|
|
3
|
+
export type SaveRubricResponse = {
|
|
4
|
+
rubric: Rubric & {
|
|
5
|
+
canUpdate?: boolean;
|
|
6
|
+
association_count?: number;
|
|
7
|
+
};
|
|
8
|
+
rubricAssociation?: RubricAssociation;
|
|
9
|
+
};
|
|
10
|
+
export declare const saveRubric: (rubric: RubricFormProps, assignmentId?: string) => Promise<SaveRubricResponse>;
|
|
11
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../../src/_internal/RubricForm/queries/mutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAOnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACpE,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC,CAAA;AAiED,eAAO,MAAM,UAAU,GACrB,QAAQ,eAAe,EACvB,eAAe,MAAM,KACpB,OAAO,CAAC,kBAAkB,CA0H5B,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SharedAccountRubricQueryQuery, SharedCourseRubricQueryQuery } from '@instructure/platform-graphql-types';
|
|
2
|
+
type ExecuteQuery = <TResult, TVariables = Record<string, unknown>>(query: unknown, variables: TVariables) => Promise<TResult>;
|
|
3
|
+
type AccountRubricQueryResponse = SharedAccountRubricQueryQuery['account'];
|
|
4
|
+
type CourseRubricQueryResponse = SharedCourseRubricQueryQuery['course'];
|
|
5
|
+
export type RubricQueryResponse = NonNullable<NonNullable<NonNullable<NonNullable<AccountRubricQueryResponse | CourseRubricQueryResponse>['rubricsConnection']>['nodes']>[number]>;
|
|
6
|
+
type FetchRubricParams = {
|
|
7
|
+
executeQuery: ExecuteQuery;
|
|
8
|
+
rubricId: string | undefined;
|
|
9
|
+
accountId: string | undefined;
|
|
10
|
+
courseId: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const fetchRubric: ({ executeQuery, rubricId, accountId, courseId, }: FetchRubricParams) => Promise<RubricQueryResponse | null>;
|
|
13
|
+
export declare const fetchAccountRubric: (executeQuery: ExecuteQuery, accountId: string, rubricId: string) => Promise<RubricQueryResponse | null>;
|
|
14
|
+
export declare const fetchCourseRubric: (executeQuery: ExecuteQuery, courseId: string, rubricId: string) => Promise<RubricQueryResponse | null>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../../src/_internal/RubricForm/queries/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,qCAAqC,CAAA;AAG5C,KAAK,YAAY,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,UAAU,KAClB,OAAO,CAAC,OAAO,CAAC,CAAA;AAErB,KAAK,0BAA0B,GAAG,6BAA6B,CAAC,SAAS,CAAC,CAAA;AAC1E,KAAK,yBAAyB,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAA;AACvE,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAC3C,WAAW,CACT,WAAW,CACT,WAAW,CAAC,0BAA0B,GAAG,yBAAyB,CAAC,CAAC,mBAAmB,CAAC,CACzF,CAAC,OAAO,CAAC,CACX,CAAC,MAAM,CAAC,CACV,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,YAAY,EAAE,YAAY,CAAA;IAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,WAAW,GAAU,kDAK/B,iBAAiB,KAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAUxD,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,cAAc,YAAY,EAC1B,WAAW,MAAM,EACjB,UAAU,MAAM,KACf,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAMpC,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,cAAc,YAAY,EAC1B,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAMpC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const i18nKeys: {
|
|
2
|
+
readonly rubricSelectorAssistiveText: "Type or use arrow keys to navigate options.";
|
|
3
|
+
readonly rubricSelectorEmpty: "This course has no rubrics yet.";
|
|
4
|
+
readonly rubricSelectorErrorBody: "Please try again.";
|
|
5
|
+
readonly rubricSelectorErrorTitle: "Failed to load rubrics for this course";
|
|
6
|
+
readonly rubricSelectorLabel: "Rubric";
|
|
7
|
+
readonly rubricSelectorLoading: "Loading rubrics";
|
|
8
|
+
readonly rubricSelectorPlaceholder: "Select a rubric";
|
|
9
|
+
readonly rubricSelectorRetry: "Retry";
|
|
10
|
+
readonly rubricSelectorTruncated: "Showing the first 50 rubrics. This is a temporary selector and will be replaced with the rubrics listing page.";
|
|
11
|
+
readonly rubricSelectorUntitled: "Untitled rubric";
|
|
12
|
+
readonly warningModalExitButton: "Exit";
|
|
13
|
+
readonly warningModalHeader: "Warning";
|
|
14
|
+
readonly warningModalMessage: "You are about to exit the rubric editor. Any unsaved changes will be lost.";
|
|
15
|
+
readonly cancel: "Cancel";
|
|
16
|
+
readonly close: "Close";
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/_internal/constants/i18n.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;CAIX,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare function getLocalStorageValue<T>(key: string, initialValue: T, schema?: z.Schema<T> | undefined): T;
|
|
3
|
+
export declare function useLocalStorage<T>(key: string, initialValue: T, schema?: z.Schema<T>): [T, (value: T) => void, 'error' | 'success' | 'pending'];
|
|
4
|
+
//# sourceMappingURL=useLocalStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocalStorage.d.ts","sourceRoot":"","sources":["../../../src/_internal/hooks/useLocalStorage.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAO5B,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,CAAC,EACf,MAAM,GAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,SAAqB,GAC1C,CAAC,CAaH;AAMD,wBAAgB,eAAe,CAAC,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,CAAC,EACf,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GACnB,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC,CAoB1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRubricsPlatformUiContext.d.ts","sourceRoot":"","sources":["../../../src/_internal/hooks/useRubricsPlatformUiContext.ts"],"names":[],"mappings":"AAKA,wBAAgB,2BAA2B;;EAG1C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RubricCriterion } from './rubric';
|
|
2
|
+
export type AssociationType = 'Assignment' | 'Account' | 'Course';
|
|
3
|
+
export type RubricFormProps = {
|
|
4
|
+
associationType: AssociationType;
|
|
5
|
+
associationTypeId?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
canUpdateRubric: boolean;
|
|
8
|
+
title: string;
|
|
9
|
+
hasRubricAssociations: boolean;
|
|
10
|
+
accountId?: string;
|
|
11
|
+
courseId?: string;
|
|
12
|
+
criteria: RubricCriterion[];
|
|
13
|
+
pointsPossible: number;
|
|
14
|
+
buttonDisplay: string;
|
|
15
|
+
ratingOrder: string;
|
|
16
|
+
unassessed: boolean;
|
|
17
|
+
workflowState: string;
|
|
18
|
+
freeFormCriterionComments: boolean;
|
|
19
|
+
hideOutcomeResults: boolean;
|
|
20
|
+
hidePoints: boolean;
|
|
21
|
+
hideScoreTotal: boolean;
|
|
22
|
+
useForGrading: boolean;
|
|
23
|
+
rubricAssociationId?: string;
|
|
24
|
+
skipUpdatingPointsPossible?: boolean;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=RubricForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RubricForm.d.ts","sourceRoot":"","sources":["../../../src/_internal/types/RubricForm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAA;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,EAAE,eAAe,CAAA;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,eAAe,EAAE,OAAO,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,qBAAqB,EAAE,OAAO,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,yBAAyB,EAAE,OAAO,CAAA;IAClC,kBAAkB,EAAE,OAAO,CAAA;IAC3B,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,0BAA0B,CAAC,EAAE,OAAO,CAAA;CACrC,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { i18nKeys } from '../constants/i18n';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export type TranslateFunction<T> = (key: keyof T, options?: Record<string, unknown>) => string;
|
|
4
|
+
export type RubricsTranslations = typeof i18nKeys;
|
|
5
|
+
export type RubricsTranslationValues = {
|
|
6
|
+
readonly [K in keyof RubricsTranslations]: RubricsTranslations[K] extends {
|
|
7
|
+
readonly one: string;
|
|
8
|
+
readonly other: string;
|
|
9
|
+
} ? {
|
|
10
|
+
one: string;
|
|
11
|
+
other: string;
|
|
12
|
+
} : string;
|
|
13
|
+
};
|
|
14
|
+
type I18nKey = keyof RubricsTranslations;
|
|
15
|
+
type ExtractVars<S extends string> = S extends `${string}%{${infer Var}}${infer Rest}` ? Var | ExtractVars<Rest> : never;
|
|
16
|
+
type PluralKeys = {
|
|
17
|
+
[K in I18nKey]: RubricsTranslations[K] extends {
|
|
18
|
+
readonly one: string;
|
|
19
|
+
readonly other: string;
|
|
20
|
+
} ? K : never;
|
|
21
|
+
}[I18nKey];
|
|
22
|
+
type StringI18nKey = Exclude<I18nKey, PluralKeys>;
|
|
23
|
+
type ExtractPluralVars<K extends PluralKeys> = RubricsTranslations[K] extends {
|
|
24
|
+
readonly one: infer O extends string;
|
|
25
|
+
readonly other: infer P extends string;
|
|
26
|
+
} ? ExtractVars<O> | ExtractVars<P> : never;
|
|
27
|
+
type StringKeysWithVars = {
|
|
28
|
+
[K in StringI18nKey]: ExtractVars<RubricsTranslations[K] & string> extends never ? never : K;
|
|
29
|
+
}[StringI18nKey];
|
|
30
|
+
type KeysWithVars = StringKeysWithVars | PluralKeys;
|
|
31
|
+
type I18nStringTokenWithVars = {
|
|
32
|
+
[K in StringKeysWithVars]: {
|
|
33
|
+
key: K;
|
|
34
|
+
vars: Record<ExtractVars<RubricsTranslations[K] & string>, string | number>;
|
|
35
|
+
};
|
|
36
|
+
}[StringKeysWithVars];
|
|
37
|
+
type I18nPluralToken = {
|
|
38
|
+
[K in PluralKeys]: ExtractPluralVars<K> extends never ? {
|
|
39
|
+
key: K;
|
|
40
|
+
count: number;
|
|
41
|
+
} : {
|
|
42
|
+
key: K;
|
|
43
|
+
count: number;
|
|
44
|
+
vars: Record<ExtractPluralVars<K>, string | number>;
|
|
45
|
+
};
|
|
46
|
+
}[PluralKeys];
|
|
47
|
+
type I18nTokenWithVars = I18nStringTokenWithVars | I18nPluralToken;
|
|
48
|
+
export type I18nToken = Exclude<I18nKey, KeysWithVars> | I18nTokenWithVars;
|
|
49
|
+
export type ResolveTokenFunction = (token: I18nToken) => string;
|
|
50
|
+
export interface RubricsTranslationsContext {
|
|
51
|
+
translations: RubricsTranslationValues;
|
|
52
|
+
translate: TranslateFunction<RubricsTranslations>;
|
|
53
|
+
}
|
|
54
|
+
export interface UseTranslationsResult extends RubricsTranslationsContext {
|
|
55
|
+
resolveToken: ResolveTokenFunction;
|
|
56
|
+
}
|
|
57
|
+
export interface TranslationsProviderProps {
|
|
58
|
+
translations: RubricsTranslationValues;
|
|
59
|
+
translate: TranslateFunction<RubricsTranslations>;
|
|
60
|
+
children: React.ReactNode;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/_internal/types/i18n.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type Rubric = {
|
|
2
|
+
id: string;
|
|
3
|
+
criteria?: RubricCriterion[];
|
|
4
|
+
criteriaCount: number;
|
|
5
|
+
hidePoints?: boolean;
|
|
6
|
+
freeFormCriterionComments?: boolean;
|
|
7
|
+
buttonDisplay?: string;
|
|
8
|
+
ratingOrder?: string;
|
|
9
|
+
pointsPossible: number;
|
|
10
|
+
title: string;
|
|
11
|
+
workflowState?: string;
|
|
12
|
+
unassessed?: boolean;
|
|
13
|
+
canUpdateRubric?: boolean;
|
|
14
|
+
hasRubricAssociations?: boolean;
|
|
15
|
+
public?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type RubricAssociation = {
|
|
18
|
+
associationType: 'Assignment' | 'Account' | 'Course';
|
|
19
|
+
associationId: string;
|
|
20
|
+
hidePoints: boolean;
|
|
21
|
+
hideScoreTotal: boolean;
|
|
22
|
+
useForGrading: boolean;
|
|
23
|
+
hideOutcomeResults: boolean;
|
|
24
|
+
id: string;
|
|
25
|
+
canUpdate?: boolean;
|
|
26
|
+
canDelete?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type RubricCriterion = {
|
|
29
|
+
id: string;
|
|
30
|
+
points: number;
|
|
31
|
+
description: string;
|
|
32
|
+
longDescription?: string;
|
|
33
|
+
ignoreForScoring?: boolean;
|
|
34
|
+
masteryPoints?: number;
|
|
35
|
+
criterionUseRange: boolean;
|
|
36
|
+
ratings: RubricRating[];
|
|
37
|
+
learningOutcomeId?: string;
|
|
38
|
+
outcome?: RubricOutcome;
|
|
39
|
+
isGenerated?: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type RubricRating = {
|
|
42
|
+
id: string;
|
|
43
|
+
description: string;
|
|
44
|
+
longDescription: string;
|
|
45
|
+
points: number;
|
|
46
|
+
};
|
|
47
|
+
export type RubricOutcome = {
|
|
48
|
+
displayName: string;
|
|
49
|
+
title: string;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=rubric.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rubric.d.ts","sourceRoot":"","sources":["../../../src/_internal/types/rubric.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;IAC5B,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAA;IACpD,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { GenericErrorPageTranslations } from '@instructure/platform-generic-error-page';
|
|
3
|
+
export type { GenericErrorPageTranslations };
|
|
4
|
+
export interface ErrorPageTranslations extends GenericErrorPageTranslations {
|
|
5
|
+
notFoundTitle: () => string;
|
|
6
|
+
notFoundDescription: () => string;
|
|
7
|
+
}
|
|
8
|
+
export declare const defaultErrorPageTranslations: ErrorPageTranslations;
|
|
9
|
+
export interface RubricErrorPageOptions {
|
|
10
|
+
translations?: ErrorPageTranslations;
|
|
11
|
+
userRoles?: string[];
|
|
12
|
+
errorImageUrl: string;
|
|
13
|
+
notFoundArtwork?: ReactElement;
|
|
14
|
+
}
|
|
15
|
+
export declare function createRubricErrorReporter(userRoles?: string[]): (report: {
|
|
16
|
+
subject: string;
|
|
17
|
+
category: string;
|
|
18
|
+
message: string;
|
|
19
|
+
url: string;
|
|
20
|
+
comments: string;
|
|
21
|
+
email: string;
|
|
22
|
+
backtrace?: string;
|
|
23
|
+
}) => Promise<{
|
|
24
|
+
logged: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function rubricErrorComponent(options: {
|
|
27
|
+
translations?: ErrorPageTranslations;
|
|
28
|
+
userRoles?: string[];
|
|
29
|
+
errorImageUrl: string;
|
|
30
|
+
errorSubject?: string;
|
|
31
|
+
errorCategory?: string;
|
|
32
|
+
}): ReactElement;
|
|
33
|
+
export declare function rubricNotFoundPage(options: {
|
|
34
|
+
translations?: ErrorPageTranslations;
|
|
35
|
+
artwork?: ReactElement;
|
|
36
|
+
}): ReactElement;
|
|
37
|
+
//# sourceMappingURL=errorPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorPage.d.ts","sourceRoot":"","sources":["../../../src/_internal/utils/errorPage.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAMzC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAA;AAE5F,YAAY,EAAE,4BAA4B,EAAE,CAAA;AAE5C,MAAM,WAAW,qBAAsB,SAAQ,4BAA4B;IACzE,aAAa,EAAE,MAAM,MAAM,CAAA;IAC3B,mBAAmB,EAAE,MAAM,MAAM,CAAA;CAClC;AAED,eAAO,MAAM,4BAA4B,EAAE,qBAa1C,CAAA;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,CAAC,EAAE,YAAY,CAAA;CAC/B;AAED,wBAAgB,yBAAyB,CACvC,SAAS,CAAC,EAAE,MAAM,EAAE,GACnB,CAAC,MAAM,EAAE;IACV,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,KAAK,OAAO,CAAC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,CAEjC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,GAAG,YAAY,CAaf;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB,GAAG,YAAY,CAUf"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { I18nToken, RubricsTranslations, TranslateFunction, TranslationsProviderProps, UseTranslationsResult } from '../types/i18n';
|
|
2
|
+
export declare function TranslationsProvider({ translations, translate, children, }: TranslationsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function useTranslations(): UseTranslationsResult;
|
|
4
|
+
export declare const resolveI18nToken: (token: I18nToken, translate: TranslateFunction<RubricsTranslations>) => string;
|
|
5
|
+
export declare const translate: (key: keyof RubricsTranslations, options?: Record<string, unknown>) => string;
|
|
6
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/_internal/utils/i18n.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EAET,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,eAAe,CAAA;AAOtB,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,EAAE,yBAAyB,2CAG3B;AAED,wBAAgB,eAAe,IAAI,qBAAqB,CAUvD;AAQD,eAAO,MAAM,gBAAgB,GAC3B,OAAO,SAAS,EAChB,WAAW,iBAAiB,CAAC,mBAAmB,CAAC,KAChD,MAOF,CAAA;AAED,eAAO,MAAM,SAAS,GACpB,KAAK,MAAM,mBAAmB,EAC9B,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAChC,MAqBF,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Rubric, RubricAssociation } from '../types/rubric';
|
|
2
|
+
export type RubricUnderscoreType = {
|
|
3
|
+
title: string;
|
|
4
|
+
button_display: string;
|
|
5
|
+
criteria?: RubricUnderscoreCriteria[];
|
|
6
|
+
data?: RubricUnderscoreCriteria[];
|
|
7
|
+
hide_points: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
rating_order: string;
|
|
10
|
+
free_form_criterion_comments: boolean;
|
|
11
|
+
points_possible: number;
|
|
12
|
+
public: boolean;
|
|
13
|
+
unassessed?: boolean;
|
|
14
|
+
workflow_state: string;
|
|
15
|
+
can_update?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type RubricUnderscoreCriteria = {
|
|
18
|
+
criterion_use_range: boolean;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
learning_outcome_id?: string;
|
|
22
|
+
long_description: string;
|
|
23
|
+
ignore_for_scoring?: boolean;
|
|
24
|
+
mastery_points?: number;
|
|
25
|
+
points: number;
|
|
26
|
+
generated?: boolean;
|
|
27
|
+
ratings: {
|
|
28
|
+
criterion_id: string;
|
|
29
|
+
description: string;
|
|
30
|
+
id: string;
|
|
31
|
+
long_description: string;
|
|
32
|
+
points: number;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
export type RubricOutcomeUnderscore = {
|
|
36
|
+
id: string;
|
|
37
|
+
display_name: string;
|
|
38
|
+
};
|
|
39
|
+
export declare const mapRubricUnderscoredKeysToCamelCase: (rubric: RubricUnderscoreType, rubricOutcomeData?: RubricOutcomeUnderscore[]) => Rubric;
|
|
40
|
+
export declare const decodeHTML: (str: string) => string;
|
|
41
|
+
export type RubricAssociationUnderscore = {
|
|
42
|
+
association_type: 'Assignment' | 'Account' | 'Course';
|
|
43
|
+
association_id: string;
|
|
44
|
+
id: string;
|
|
45
|
+
use_for_grading: boolean;
|
|
46
|
+
hide_points: boolean;
|
|
47
|
+
hide_score_total: boolean;
|
|
48
|
+
hide_outcome_results: boolean;
|
|
49
|
+
can_update?: boolean;
|
|
50
|
+
can_delete?: boolean;
|
|
51
|
+
};
|
|
52
|
+
export declare const mapRubricAssociationUnderscoredKeysToCamelCase: (underscoreAssociation: RubricAssociationUnderscore) => RubricAssociation;
|
|
53
|
+
export declare const newlinesToBrTags: (str: string) => string;
|
|
54
|
+
export declare const brTagsToNewlines: (str: string) => string;
|
|
55
|
+
export declare const longDescriptionForSave: (criterion: {
|
|
56
|
+
longDescription?: string;
|
|
57
|
+
outcome?: unknown;
|
|
58
|
+
}) => string | undefined;
|
|
59
|
+
export declare const stripLongDescriptionBrTags: (criterion: {
|
|
60
|
+
longDescription?: string;
|
|
61
|
+
outcome?: unknown;
|
|
62
|
+
}) => string | undefined;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=rubricMapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rubricMapping.d.ts","sourceRoot":"","sources":["../../../src/_internal/utils/rubricMapping.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEhE,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,wBAAwB,EAAE,CAAA;IACrC,IAAI,CAAC,EAAE,wBAAwB,EAAE,CAAA;IACjC,WAAW,EAAE,OAAO,CAAA;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,4BAA4B,EAAE,OAAO,CAAA;IACrC,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,mBAAmB,EAAE,OAAO,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gBAAgB,EAAE,MAAM,CAAA;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAA;QACpB,WAAW,EAAE,MAAM,CAAA;QACnB,EAAE,EAAE,MAAM,CAAA;QACV,gBAAgB,EAAE,MAAM,CAAA;QACxB,MAAM,EAAE,MAAM,CAAA;KACf,EAAE,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,mCAAmC,GAC9C,QAAQ,oBAAoB,EAC5B,oBAAmB,uBAAuB,EAAO,KAChD,MAuDF,CAAA;AAOD,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,MAAuC,CAAA;AAEhF,MAAM,MAAM,2BAA2B,GAAG;IACxC,gBAAgB,EAAE,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAA;IACrD,cAAc,EAAE,MAAM,CAAA;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,eAAe,EAAE,OAAO,CAAA;IACxB,WAAW,EAAE,OAAO,CAAA;IACpB,gBAAgB,EAAE,OAAO,CAAA;IACzB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,8CAA8C,GACzD,uBAAuB,2BAA2B,KACjD,iBAYF,CAAA;AAMD,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,KAAG,MAIlB,CAAA;AAQ7B,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,KAAG,MAAiD,CAAA;AAMhG,eAAO,MAAM,sBAAsB,GAAI,WAAW;IAChD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,KAAG,MAAM,GAAG,SAGsD,CAAA;AAInE,eAAO,MAAM,0BAA0B,cAVW;IAChD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,KAAG,MAAM,GAAG,SAOmD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tryParseJson.d.ts","sourceRoot":"","sources":["../../../src/_internal/utils/tryParseJson.ts"],"names":[],"mappings":"AAkBA,wBAAgB,YAAY,CAAC,sBAAsB,EAAE,MAAM,GAAG;IAC5D,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;CACrB,CAOA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type WarningModalProps = {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onDismiss: () => void;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function WarningModal({ isOpen, onCancel, onDismiss }: WarningModalProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=WarningModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WarningModal.d.ts","sourceRoot":"","sources":["../../../../src/canvas/RubricForm/components/WarningModal.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,2CAgD9E"}
|
package/dist/canvas/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/canvas/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/canvas/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/canvas.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Heading as r } from "@instructure/ui-heading";
|
|
3
3
|
import { View as e } from "@instructure/ui-view";
|
|
4
|
-
import {
|
|
4
|
+
import { g as l } from "./chunks/helloWorld-CNLQb2fe.js";
|
|
5
5
|
const s = () => /* @__PURE__ */ o(e, { as: "div", padding: "small", children: /* @__PURE__ */ o(r, { level: "h2", children: l("canvas") }) });
|
|
6
6
|
export {
|
|
7
7
|
s as HelloWorld
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface RubricSelectorProps {
|
|
2
|
+
/**
|
|
3
|
+
* Course to list rubrics for.
|
|
4
|
+
*/
|
|
5
|
+
courseId: string;
|
|
6
|
+
/**
|
|
7
|
+
* Currently selected rubric id, or `undefined` when the user hasn't picked yet. Controlled
|
|
8
|
+
* — the caller owns this state.
|
|
9
|
+
*/
|
|
10
|
+
value: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Fires when the user picks a different rubric, with the title as fetched (may be an
|
|
13
|
+
* empty string for an untitled rubric).
|
|
14
|
+
*/
|
|
15
|
+
onChange: (rubricId: string, rubricTitle: string) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Dropdown that lists the rubrics belonging to a course. Temporary stand-in for the real
|
|
19
|
+
* rubrics list/browse experience until ViewRubrics is ported (FOUND-578) — this just proves
|
|
20
|
+
* the data layer (FOUND-574) end to end.
|
|
21
|
+
*
|
|
22
|
+
* Wraps itself in the package's default (English) TranslationsProvider, matching
|
|
23
|
+
* institutional-tagging's Layout pattern — the host doesn't need to supply one.
|
|
24
|
+
*/
|
|
25
|
+
export declare const RubricSelector: (props: RubricSelectorProps) => React.ReactElement;
|
|
26
|
+
//# sourceMappingURL=RubricSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RubricSelector.d.ts","sourceRoot":"","sources":["../../../src/foundation/RubricSelector/RubricSelector.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB;;;OAGG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;CAC1D;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,KAAG,KAAK,CAAC,YAIjE,CAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export type { Rubric } from '../_internal/types';
|
|
1
|
+
export type { Rubric } from '../_internal/types/rubric';
|
|
2
2
|
export { HelloWorld } from './HelloWorld';
|
|
3
|
+
export { RubricSelector } from './RubricSelector/RubricSelector';
|
|
4
|
+
export type { RubricSelectorProps } from './RubricSelector/RubricSelector';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/foundation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/foundation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA"}
|
package/dist/foundation.js
CHANGED
|
@@ -1,8 +1,161 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Heading as
|
|
3
|
-
import { View as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { Heading as T } from "@instructure/ui-heading";
|
|
3
|
+
import { View as s } from "@instructure/ui-view";
|
|
4
|
+
import { g as w } from "./chunks/helloWorld-CNLQb2fe.js";
|
|
5
|
+
import { Button as C } from "@instructure/ui-buttons";
|
|
6
|
+
import { Flex as f } from "@instructure/ui-flex";
|
|
7
|
+
import { SimpleSelect as h } from "@instructure/ui-simple-select";
|
|
8
|
+
import { Spinner as R } from "@instructure/ui-spinner";
|
|
9
|
+
import { Text as m } from "@instructure/ui-text";
|
|
10
|
+
import { useQuery as E } from "@tanstack/react-query";
|
|
11
|
+
import { usePlatformUi as P } from "@instructure/platform-provider";
|
|
12
|
+
import I from "graphql-tag";
|
|
13
|
+
import g from "react";
|
|
14
|
+
const V = () => /* @__PURE__ */ o(s, { as: "div", padding: "small", children: /* @__PURE__ */ o(T, { level: "h2", children: w("foundation") }) });
|
|
15
|
+
function L() {
|
|
16
|
+
const { executeQuery: e } = P();
|
|
17
|
+
return { executeQuery: e };
|
|
18
|
+
}
|
|
19
|
+
const M = I`
|
|
20
|
+
query CourseRubricsList($courseId: ID!, $first: Int) {
|
|
21
|
+
course(id: $courseId) {
|
|
22
|
+
rubricsConnection(first: $first) {
|
|
23
|
+
pageInfo {
|
|
24
|
+
hasNextPage
|
|
25
|
+
}
|
|
26
|
+
nodes {
|
|
27
|
+
id: _id
|
|
28
|
+
title
|
|
29
|
+
pointsPossible
|
|
30
|
+
criteriaCount
|
|
31
|
+
workflowState
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
function U(e) {
|
|
38
|
+
const { executeQuery: t } = L();
|
|
39
|
+
return E({
|
|
40
|
+
queryKey: ["courseRubrics", e],
|
|
41
|
+
queryFn: async () => {
|
|
42
|
+
var n;
|
|
43
|
+
const { course: i } = await t(M, {
|
|
44
|
+
courseId: e,
|
|
45
|
+
first: 50
|
|
46
|
+
}), r = i == null ? void 0 : i.rubricsConnection;
|
|
47
|
+
return {
|
|
48
|
+
rubrics: ((r == null ? void 0 : r.nodes) ?? []).filter(
|
|
49
|
+
(l) => l != null
|
|
50
|
+
),
|
|
51
|
+
hasMore: ((n = r == null ? void 0 : r.pageInfo) == null ? void 0 : n.hasNextPage) ?? !1
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
enabled: !!e
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const z = {
|
|
58
|
+
cancel: "Cancel",
|
|
59
|
+
close: "Close"
|
|
60
|
+
}, B = {
|
|
61
|
+
warningModalExitButton: "Exit",
|
|
62
|
+
warningModalHeader: "Warning",
|
|
63
|
+
warningModalMessage: "You are about to exit the rubric editor. Any unsaved changes will be lost."
|
|
64
|
+
}, _ = {
|
|
65
|
+
rubricSelectorAssistiveText: "Type or use arrow keys to navigate options.",
|
|
66
|
+
rubricSelectorEmpty: "This course has no rubrics yet.",
|
|
67
|
+
rubricSelectorErrorBody: "Please try again.",
|
|
68
|
+
rubricSelectorErrorTitle: "Failed to load rubrics for this course",
|
|
69
|
+
rubricSelectorLabel: "Rubric",
|
|
70
|
+
rubricSelectorLoading: "Loading rubrics",
|
|
71
|
+
rubricSelectorPlaceholder: "Select a rubric",
|
|
72
|
+
rubricSelectorRetry: "Retry",
|
|
73
|
+
rubricSelectorTruncated: "Showing the first 50 rubrics. This is a temporary selector and will be replaced with the rubrics listing page.",
|
|
74
|
+
rubricSelectorUntitled: "Untitled rubric"
|
|
75
|
+
}, S = {
|
|
76
|
+
...z,
|
|
77
|
+
...B,
|
|
78
|
+
..._
|
|
79
|
+
}, v = g.createContext(
|
|
80
|
+
void 0
|
|
81
|
+
);
|
|
82
|
+
function $({
|
|
83
|
+
translations: e,
|
|
84
|
+
translate: t,
|
|
85
|
+
children: i
|
|
86
|
+
}) {
|
|
87
|
+
const r = { translations: e, translate: t };
|
|
88
|
+
return /* @__PURE__ */ o(v.Provider, { value: r, children: i });
|
|
89
|
+
}
|
|
90
|
+
function q() {
|
|
91
|
+
const e = g.useContext(v);
|
|
92
|
+
if (!e)
|
|
93
|
+
throw new Error("useTranslations must be used within TranslationsProvider");
|
|
94
|
+
const t = g.useCallback(
|
|
95
|
+
(i) => H(i, e.translate),
|
|
96
|
+
[e.translate]
|
|
97
|
+
);
|
|
98
|
+
return { ...e, resolveToken: t };
|
|
99
|
+
}
|
|
100
|
+
const H = (e, t) => {
|
|
101
|
+
if (typeof e == "string") return t(e);
|
|
102
|
+
const { key: i, count: r, vars: n } = e;
|
|
103
|
+
return r !== void 0 ? t(i, { count: r, ...n }) : t(i, n);
|
|
104
|
+
}, Q = (e, t) => {
|
|
105
|
+
const i = S[e];
|
|
106
|
+
let r;
|
|
107
|
+
if (typeof i == "object" && "one" in i && "other" in i) {
|
|
108
|
+
const n = i, l = Number((t == null ? void 0 : t.count) ?? 0);
|
|
109
|
+
r = new Intl.PluralRules("en").select(l) === "one" ? n.one : n.other;
|
|
110
|
+
} else
|
|
111
|
+
r = i || e;
|
|
112
|
+
return t ? r.replace(/%\{([^}]+)}/g, (n, l) => l in t ? String(t[l]) : n) : r;
|
|
113
|
+
}, rr = (e) => /* @__PURE__ */ o($, { translations: S, translate: Q, children: /* @__PURE__ */ o(W, { ...e }) }), W = ({
|
|
114
|
+
courseId: e,
|
|
115
|
+
value: t,
|
|
116
|
+
onChange: i
|
|
117
|
+
}) => {
|
|
118
|
+
const { translations: r } = q(), { data: n, isLoading: l, isError: p, refetch: y } = U(e), u = n == null ? void 0 : n.rubrics;
|
|
119
|
+
return l ? /* @__PURE__ */ a(s, { as: "div", role: "status", "aria-live": "polite", margin: "0 0 medium", children: [
|
|
120
|
+
/* @__PURE__ */ o(R, { renderTitle: r.rubricSelectorLoading, size: "x-small" }),
|
|
121
|
+
/* @__PURE__ */ o(s, { as: "span", padding: "0 0 0 x-small", children: /* @__PURE__ */ o(m, { size: "small", children: r.rubricSelectorLoading }) })
|
|
122
|
+
] }) : p ? /* @__PURE__ */ o(s, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ a(f, { gap: "small", alignItems: "center", wrap: "wrap", children: [
|
|
123
|
+
/* @__PURE__ */ o(f.Item, { children: /* @__PURE__ */ a(m, { size: "small", color: "danger", children: [
|
|
124
|
+
r.rubricSelectorErrorTitle,
|
|
125
|
+
". ",
|
|
126
|
+
r.rubricSelectorErrorBody
|
|
127
|
+
] }) }),
|
|
128
|
+
/* @__PURE__ */ o(f.Item, { children: /* @__PURE__ */ o(C, { size: "small", onClick: () => y(), children: r.rubricSelectorRetry }) })
|
|
129
|
+
] }) }) : !u || u.length === 0 ? /* @__PURE__ */ o(s, { as: "div", margin: "0 0 medium", children: /* @__PURE__ */ o(m, { size: "small", children: r.rubricSelectorEmpty }) }) : /* @__PURE__ */ a(s, { as: "div", margin: "0 0 medium", maxWidth: "360px", children: [
|
|
130
|
+
/* @__PURE__ */ a(
|
|
131
|
+
h,
|
|
132
|
+
{
|
|
133
|
+
renderLabel: r.rubricSelectorLabel,
|
|
134
|
+
assistiveText: r.rubricSelectorAssistiveText,
|
|
135
|
+
value: t ?? "",
|
|
136
|
+
onChange: (c, { value: d }) => {
|
|
137
|
+
if (typeof d != "string" || !d) return;
|
|
138
|
+
const b = u.find((x) => x.id === d);
|
|
139
|
+
i(d, (b == null ? void 0 : b.title) ?? "");
|
|
140
|
+
},
|
|
141
|
+
children: [
|
|
142
|
+
t === void 0 && /* @__PURE__ */ o(h.Option, { id: "rubrics-rubric-selector-placeholder", value: "", children: r.rubricSelectorPlaceholder }),
|
|
143
|
+
u.map((c) => /* @__PURE__ */ o(
|
|
144
|
+
h.Option,
|
|
145
|
+
{
|
|
146
|
+
id: `rubrics-rubric-selector-option-${c.id}`,
|
|
147
|
+
value: c.id,
|
|
148
|
+
children: c.title || r.rubricSelectorUntitled
|
|
149
|
+
},
|
|
150
|
+
c.id
|
|
151
|
+
))
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
(n == null ? void 0 : n.hasMore) && /* @__PURE__ */ o(s, { as: "div", padding: "xx-small 0 0", children: /* @__PURE__ */ o(m, { size: "x-small", color: "secondary", children: r.rubricSelectorTruncated }) })
|
|
156
|
+
] });
|
|
157
|
+
};
|
|
6
158
|
export {
|
|
7
|
-
|
|
159
|
+
V as HelloWorld,
|
|
160
|
+
rr as RubricSelector
|
|
8
161
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export type { Rubric } from './_internal/types';
|
|
1
|
+
export type { Rubric, RubricAssociation, RubricCriterion, RubricRating, RubricOutcome, } from './_internal/types/rubric';
|
|
2
2
|
export { getHelloWorldMessage } from './_internal/helloWorld';
|
|
3
3
|
export type { RubricsHost } from './_internal/helloWorld';
|
|
4
|
+
export { useLocalStorage, getLocalStorageValue } from './_internal/hooks/useLocalStorage';
|
|
5
|
+
export { tryParseJson } from './_internal/utils/tryParseJson';
|
|
6
|
+
export { rubricErrorComponent, rubricNotFoundPage, createRubricErrorReporter, defaultErrorPageTranslations, } from './_internal/utils/errorPage';
|
|
7
|
+
export type { ErrorPageTranslations, RubricErrorPageOptions } from './_internal/utils/errorPage';
|
|
4
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,MAAM,EACN,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,aAAa,GACd,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,6BAA6B,CAAA;AACpC,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,90 @@
|
|
|
1
|
-
|
|
1
|
+
import { g as L } from "./chunks/helloWorld-CNLQb2fe.js";
|
|
2
|
+
import { useQueryClient as p, useQuery as g, useMutation as f } from "@tanstack/react-query";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
import { createErrorReporter as l, GenericErrorPage as S, NotFoundPage as I } from "@instructure/platform-generic-error-page";
|
|
5
|
+
function y(r) {
|
|
6
|
+
try {
|
|
7
|
+
return { parseError: !1, parsedValue: JSON.parse(r) };
|
|
8
|
+
} catch {
|
|
9
|
+
return { parseError: !0, parsedValue: null };
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function E(r, e) {
|
|
13
|
+
return !e.safeParse(r).success;
|
|
14
|
+
}
|
|
15
|
+
function u(r, e, t = void 0) {
|
|
16
|
+
const o = window.localStorage.getItem(r);
|
|
17
|
+
if (o === null)
|
|
18
|
+
return e;
|
|
19
|
+
const { parseError: n, parsedValue: a } = y(o);
|
|
20
|
+
return n || t && E(a, t) ? e : a;
|
|
21
|
+
}
|
|
22
|
+
async function b(r, e) {
|
|
23
|
+
window.localStorage.setItem(r, JSON.stringify(e));
|
|
24
|
+
}
|
|
25
|
+
function P(r, e, t) {
|
|
26
|
+
const o = p(), { data: n, status: a } = g({
|
|
27
|
+
queryKey: [r],
|
|
28
|
+
queryFn: () => u(r, e, t),
|
|
29
|
+
initialData: () => u(r, e, t),
|
|
30
|
+
staleTime: Number.POSITIVE_INFINITY,
|
|
31
|
+
gcTime: Number.POSITIVE_INFINITY
|
|
32
|
+
}), m = n, { mutate: d } = f({
|
|
33
|
+
mutationFn: (s) => b(r, s),
|
|
34
|
+
onMutate: (s) => {
|
|
35
|
+
o.setQueryData([r], s);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return [m, d, a];
|
|
39
|
+
}
|
|
40
|
+
const c = {
|
|
41
|
+
somethingBroke: () => "Sorry, Something Broke",
|
|
42
|
+
helpUsImprove: () => "Help us improve by telling us what happened",
|
|
43
|
+
reportIssue: () => "Report Issue",
|
|
44
|
+
loading: () => "Loading",
|
|
45
|
+
commentSubmitted: () => "Comment submitted!",
|
|
46
|
+
commentFailed: () => "Comment failed to post! Please try again later.",
|
|
47
|
+
whatHappened: () => "What happened?",
|
|
48
|
+
yourEmailAddress: () => "Your Email Address",
|
|
49
|
+
emailPlaceholder: () => "email@example.com",
|
|
50
|
+
submit: () => "Submit",
|
|
51
|
+
notFoundTitle: () => "Whoops... Looks like nothing is here!",
|
|
52
|
+
notFoundDescription: () => "We couldn't find that page!"
|
|
53
|
+
};
|
|
54
|
+
function T(r) {
|
|
55
|
+
return l({ userRoles: r });
|
|
56
|
+
}
|
|
57
|
+
function V(r) {
|
|
58
|
+
const e = r.translations ?? c, t = l({ userRoles: r.userRoles });
|
|
59
|
+
return /* @__PURE__ */ i(
|
|
60
|
+
S,
|
|
61
|
+
{
|
|
62
|
+
imageUrl: r.errorImageUrl,
|
|
63
|
+
onReportError: t,
|
|
64
|
+
translations: e,
|
|
65
|
+
errorSubject: r.errorSubject,
|
|
66
|
+
errorCategory: r.errorCategory
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
function w(r) {
|
|
71
|
+
const e = r.translations ?? c;
|
|
72
|
+
return /* @__PURE__ */ i(
|
|
73
|
+
I,
|
|
74
|
+
{
|
|
75
|
+
artwork: r.artwork,
|
|
76
|
+
title: e.notFoundTitle(),
|
|
77
|
+
description: e.notFoundDescription()
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
2
81
|
export {
|
|
3
|
-
|
|
82
|
+
T as createRubricErrorReporter,
|
|
83
|
+
c as defaultErrorPageTranslations,
|
|
84
|
+
L as getHelloWorldMessage,
|
|
85
|
+
u as getLocalStorageValue,
|
|
86
|
+
V as rubricErrorComponent,
|
|
87
|
+
w as rubricNotFoundPage,
|
|
88
|
+
y as tryParseJson,
|
|
89
|
+
P as useLocalStorage
|
|
4
90
|
};
|
package/locales/en.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cancel": "Cancel",
|
|
3
|
+
"close": "Close",
|
|
4
|
+
"warningModalExitButton": "Exit",
|
|
5
|
+
"warningModalHeader": "Warning",
|
|
6
|
+
"warningModalMessage": "You are about to exit the rubric editor. Any unsaved changes will be lost.",
|
|
7
|
+
"rubricSelectorAssistiveText": "Type or use arrow keys to navigate options.",
|
|
8
|
+
"rubricSelectorEmpty": "This course has no rubrics yet.",
|
|
9
|
+
"rubricSelectorErrorBody": "Please try again.",
|
|
10
|
+
"rubricSelectorErrorTitle": "Failed to load rubrics for this course",
|
|
11
|
+
"rubricSelectorLabel": "Rubric",
|
|
12
|
+
"rubricSelectorLoading": "Loading rubrics",
|
|
13
|
+
"rubricSelectorPlaceholder": "Select a rubric",
|
|
14
|
+
"rubricSelectorRetry": "Retry",
|
|
15
|
+
"rubricSelectorTruncated": "Showing the first 50 rubrics. This is a temporary selector and will be replaced with the rubrics listing page.",
|
|
16
|
+
"rubricSelectorUntitled": "Untitled rubric"
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/platform-rubrics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,22 +20,34 @@
|
|
|
20
20
|
"./foundation": {
|
|
21
21
|
"types": "./dist/foundation/index.d.ts",
|
|
22
22
|
"import": "./dist/foundation.js"
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
|
+
"./locales/*": "./locales/*"
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
26
|
-
"dist"
|
|
27
|
+
"dist",
|
|
28
|
+
"locales"
|
|
27
29
|
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@instructure/platform-generic-error-page": "1.2.0"
|
|
32
|
+
},
|
|
28
33
|
"peerDependencies": {
|
|
29
34
|
"@instructure/ui-a11y-content": "^11.0.0",
|
|
30
35
|
"@instructure/ui-buttons": "^11.0.0",
|
|
31
36
|
"@instructure/ui-flex": "^11.0.0",
|
|
32
37
|
"@instructure/ui-heading": "^11.0.0",
|
|
33
38
|
"@instructure/ui-icons": "^11.0.0",
|
|
39
|
+
"@instructure/ui-modal": "^11.0.0",
|
|
40
|
+
"@instructure/ui-simple-select": "^11.0.0",
|
|
41
|
+
"@instructure/ui-spinner": "^11.0.0",
|
|
34
42
|
"@instructure/ui-text": "^11.0.0",
|
|
35
43
|
"@instructure/ui-view": "^11.0.0",
|
|
36
44
|
"@tanstack/react-query": "^5.0.0",
|
|
45
|
+
"graphql": "^16.0.0",
|
|
46
|
+
"graphql-tag": "^2.12.0",
|
|
37
47
|
"react": "^18.0.0",
|
|
38
48
|
"react-dom": "^18.0.0",
|
|
49
|
+
"zod": "^3.23.8",
|
|
50
|
+
"@instructure/platform-canvas-fetch": "0.1.3",
|
|
39
51
|
"@instructure/platform-provider": "0.5.2"
|
|
40
52
|
},
|
|
41
53
|
"devDependencies": {
|
|
@@ -44,31 +56,44 @@
|
|
|
44
56
|
"@instructure/ui-flex": "11.7.4",
|
|
45
57
|
"@instructure/ui-heading": "11.7.4",
|
|
46
58
|
"@instructure/ui-icons": "11.7.4",
|
|
59
|
+
"@instructure/ui-modal": "11.7.4",
|
|
60
|
+
"@instructure/ui-simple-select": "11.7.4",
|
|
61
|
+
"@instructure/ui-spinner": "11.7.4",
|
|
47
62
|
"@instructure/ui-text": "11.7.4",
|
|
48
63
|
"@instructure/ui-view": "11.7.4",
|
|
49
64
|
"@tanstack/react-query": "^5.90.7",
|
|
50
65
|
"@testing-library/jest-dom": "^6.9.1",
|
|
51
66
|
"@testing-library/react": "^16.3.0",
|
|
52
67
|
"@testing-library/user-event": "^14.0.0",
|
|
68
|
+
"@types/node": "^20.0.0",
|
|
53
69
|
"@types/react": "^18.3.0",
|
|
54
70
|
"@types/react-dom": "^18.3.0",
|
|
55
71
|
"@vitejs/plugin-react": "^4.2.0",
|
|
56
72
|
"@vitest/coverage-v8": "^4.0.17",
|
|
73
|
+
"entities": "^7.0.0",
|
|
74
|
+
"graphql-tag": "^2.12.6",
|
|
57
75
|
"jsdom": "^25.0.0",
|
|
58
76
|
"msw": "^2.7.0",
|
|
59
77
|
"typescript": "^5.3.0",
|
|
60
78
|
"vite": "^6.0.0",
|
|
61
79
|
"vite-plugin-dts": "^4.0.0",
|
|
62
80
|
"vitest": "^4.0.0",
|
|
63
|
-
"
|
|
81
|
+
"zod": "^3.23.8",
|
|
82
|
+
"@instructure/platform-canvas-fetch": "0.1.3",
|
|
83
|
+
"@instructure/platform-provider": "0.5.2",
|
|
84
|
+
"@instructure/platform-graphql-types": "0.2.0",
|
|
85
|
+
"@instructure/platform-test-utils": "0.2.5"
|
|
64
86
|
},
|
|
65
87
|
"scripts": {
|
|
66
88
|
"build": "vite build",
|
|
67
89
|
"dev": "vite build --watch",
|
|
68
|
-
"test": "vitest run",
|
|
90
|
+
"test": "pnpm locales:validate && vitest run",
|
|
69
91
|
"test:watch": "vitest",
|
|
70
92
|
"test:coverage": "vitest run --coverage",
|
|
71
93
|
"type-check": "tsc --noEmit",
|
|
72
|
-
"pack:tarball": "pnpm build && pnpm pack"
|
|
94
|
+
"pack:tarball": "pnpm build && pnpm pack",
|
|
95
|
+
"locales:generate": "node scripts/generate-locales.mjs && pnpm locales:validate",
|
|
96
|
+
"locales:sort": "node scripts/sort-locales.mjs",
|
|
97
|
+
"locales:validate": "node scripts/validate-locales.mjs"
|
|
73
98
|
}
|
|
74
99
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/_internal/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd"}
|