@project-sunbird/collection-editor-react 1.0.0 → 1.0.2
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 +55 -0
- package/dist/api/content.d.ts +1 -1
- package/dist/api/framework.d.ts +0 -1
- package/dist/api/hierarchy.d.ts +7 -1
- package/dist/collection-editor-react.css +1 -0
- package/dist/collection-editor.umd.js +144 -104
- package/dist/components/AssetBrowser/AssetBrowser.d.ts +0 -1
- package/dist/components/AssignPageNumber/AssignPageNumber.d.ts +0 -1
- package/dist/components/BulkUpload/CsvUpload.d.ts +0 -1
- package/dist/components/Collaborators/ManageCollaborators.d.ts +0 -1
- package/dist/components/CollectionEditor/CollectionEditor.d.ts +0 -1
- package/dist/components/ContentPlayer/ContentPlayer.d.ts +0 -1
- package/dist/components/ContextualEditor/AssessmentDetailPanel.d.ts +7 -0
- package/dist/components/ContextualEditor/Breadcrumb.d.ts +0 -1
- package/dist/components/ContextualEditor/ContentEditForm.d.ts +0 -1
- package/dist/components/ContextualEditor/ContextualEditor.d.ts +0 -1
- package/dist/components/ContextualEditor/TabBar.d.ts +0 -1
- package/dist/components/ContextualEditor/TitleAppIcon.d.ts +0 -1
- package/dist/components/Dialcode/DialcodePanel.d.ts +0 -1
- package/dist/components/LibraryDock/FilterChips.d.ts +0 -1
- package/dist/components/LibraryDock/LibraryCard.d.ts +0 -1
- package/dist/components/LibraryDock/LibraryDock.d.ts +0 -1
- package/dist/components/LibraryDock/LibraryFilterPanel.d.ts +0 -1
- package/dist/components/LibraryDock/LibraryPreviewPanel.d.ts +0 -1
- package/dist/components/OutlineTree/OutlineTree.d.ts +0 -1
- package/dist/components/OutlineTree/TreeNode.d.ts +0 -1
- package/dist/components/ProgressStatus/ProgressStatus.d.ts +0 -1
- package/dist/components/ResourceReorder/ResourceReorderDialog.d.ts +0 -1
- package/dist/components/SparkMetaForm/FormSection.d.ts +0 -1
- package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/AppIconField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/AppIconPickerModal.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/ChipGroupField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/DateTimeField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/DialcodeInputField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/KeywordSuggestField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/LicenseSelectField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/MultiSelectField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/NestedSelectField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/PolicyCardField.d.ts +9 -0
- package/dist/components/SparkMetaForm/fields/RadioField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/SelectField.d.ts +0 -1
- package/dist/components/SparkMetaForm/fields/TextField.d.ts +0 -1
- package/dist/components/SparkMetaForm/hooks/useCascade.d.ts +0 -1
- package/dist/components/SparkMetaForm/hooks/useFieldPrepare.d.ts +9 -1
- package/dist/components/SparkMetaForm/hooks/useFieldPrepare.learningPath.test.d.ts +1 -0
- package/dist/components/SplitBuilderShell/SplitBuilderShell.d.ts +0 -1
- package/dist/components/Topbar/Topbar.d.ts +0 -1
- package/dist/components/UnitContentList/AssessmentSlotItem.d.ts +7 -0
- package/dist/components/UnitContentList/ContentRow.d.ts +0 -1
- package/dist/components/UnitContentList/SkillPicker.d.ts +15 -0
- package/dist/components/UnitContentList/UnitContentList.d.ts +1 -1
- package/dist/components/modals/ConfirmDialog.d.ts +0 -1
- package/dist/components/modals/PublishChecklist.d.ts +0 -1
- package/dist/components/modals/QualityParamsModal.d.ts +0 -1
- package/dist/components/modals/UnsavedChangesModal.d.ts +0 -1
- package/dist/components/shared/Button.d.ts +0 -1
- package/dist/components/shared/Card.d.ts +0 -1
- package/dist/components/shared/Chip.d.ts +0 -1
- package/dist/components/shared/CourseDetailsPanel.d.ts +11 -0
- package/dist/components/shared/DropZone.d.ts +0 -1
- package/dist/components/shared/LanguageSelector/LanguageSelector.d.ts +0 -1
- package/dist/components/shared/LearningPathIcon.d.ts +6 -0
- package/dist/components/shared/Spinner.d.ts +0 -1
- package/dist/components/shared/index.d.ts +2 -0
- package/dist/dev-mock-api.d.ts +1 -0
- package/dist/hooks/useAssessmentSlots.d.ts +16 -0
- package/dist/hooks/useChannelData.d.ts +0 -1
- package/dist/hooks/useContentType.d.ts +0 -1
- package/dist/hooks/useEditorInit.d.ts +0 -1
- package/dist/hooks/useFramework.d.ts +0 -1
- package/dist/hooks/useLabels.d.ts +0 -1
- package/dist/hooks/useLibrary.d.ts +30 -1
- package/dist/hooks/useLibrary.test.d.ts +1 -0
- package/dist/hooks/useLibraryTargetLabel.d.ts +1 -0
- package/dist/hooks/useQumlContent.d.ts +0 -1
- package/dist/hooks/useSaveHierarchy.d.ts +6 -0
- package/dist/hooks/useSaveHierarchy.test.d.ts +1 -0
- package/dist/hooks/useSkillCategory.d.ts +24 -0
- package/dist/hooks/useSkillCategory.test.d.ts +1 -0
- package/dist/hooks/useSkillScope.d.ts +14 -0
- package/dist/hooks/useSkillScope.test.d.ts +1 -0
- package/dist/hooks/useToolbarActions.d.ts +0 -1
- package/dist/hooks/useTree.d.ts +0 -1
- package/dist/i18n/index.d.ts +0 -1
- package/dist/i18n/locales/ar.json.d.ts +92 -0
- package/dist/i18n/locales/en.json.d.ts +92 -0
- package/dist/i18n/locales/fr.json.d.ts +92 -0
- package/dist/i18n/locales/pt.json.d.ts +92 -0
- package/dist/index.cjs +144 -104
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10861 -11055
- package/dist/services/quml/QumlPlayerService.d.ts +0 -1
- package/dist/store/editor.store.d.ts +3 -1
- package/dist/store/i18n.store.d.ts +0 -1
- package/dist/store/library.store.d.ts +0 -1
- package/dist/store/tree.store.d.ts +8 -3
- package/dist/store/tree.store.learningPath.test.d.ts +1 -0
- package/dist/store/ui.store.d.ts +2 -0
- package/dist/types/content.d.ts +2 -0
- package/dist/types/framework.d.ts +4 -0
- package/dist/types/profile.d.ts +30 -0
- package/dist/types/profile.test.d.ts +1 -0
- package/dist/utils/lpStructure.d.ts +151 -0
- package/dist/utils/lpStructure.test.d.ts +1 -0
- package/dist/utils/validateRequiredFields.d.ts +0 -1
- package/dist/web-component/configRoundTrip.test.d.ts +1 -0
- package/package.json +13 -4
- package/dist/style.css +0 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { IFrameworkDetails } from '../../../types/framework';
|
|
2
|
-
|
|
2
|
+
import { IEditorProfile } from '../../../types/profile';
|
|
3
|
+
export declare const POLICY_OPTIONS: Array<{
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}>;
|
|
3
7
|
export interface NestedSelectLevel {
|
|
4
8
|
code: string;
|
|
5
9
|
label: string;
|
|
@@ -69,6 +73,10 @@ export interface IPrepareContext {
|
|
|
69
73
|
contentAdditionalCategories?: string[];
|
|
70
74
|
/** Count of the active node's direct children — feeds maxQuestions range. */
|
|
71
75
|
childCount?: number;
|
|
76
|
+
/** Active editor profile — used to render profile-specific fallback fields
|
|
77
|
+
* (e.g. the LP root's `policy` field) when no category-definition form
|
|
78
|
+
* config is available yet. */
|
|
79
|
+
profile?: IEditorProfile;
|
|
72
80
|
}
|
|
73
81
|
export declare function useFieldPrepare(formConfig: Array<Record<string, unknown>>, nodeMetadata: Record<string, unknown>, frameworkDetails: IFrameworkDetails, isRoot: boolean, ctx?: IPrepareContext): PreparedField[];
|
|
74
82
|
export declare function __computeFieldOptionsForTest(field: Record<string, unknown>, fw: IFrameworkDetails, nodeMetadata: Record<string, unknown>, siblingFields?: Array<Record<string, unknown>>): Array<{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface SkillPickerProps {
|
|
3
|
+
options: string[];
|
|
4
|
+
selected: string[];
|
|
5
|
+
/** Selected skills that fell outside the scope after the prior assessment changed —
|
|
6
|
+
* flagged for re-selection rather than silently dropped. */
|
|
7
|
+
outOfScope: string[];
|
|
8
|
+
onChange: (skills: string[]) => void;
|
|
9
|
+
isEditable: boolean;
|
|
10
|
+
/** Explains where the options come from — prior assessment scope, or the
|
|
11
|
+
* manual-selection fallback. Rendered directly under the heading. */
|
|
12
|
+
description: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const SkillPicker: React.FC<SkillPickerProps>;
|
|
15
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { EditorMode } from '../../types/editor';
|
|
3
|
-
|
|
4
3
|
interface UnitContentListProps {
|
|
5
4
|
editorMode: EditorMode;
|
|
5
|
+
isRoot?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const UnitContentList: React.FC<UnitContentListProps>;
|
|
8
8
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface CourseDetailsPanelProps {
|
|
3
|
+
courseId: string;
|
|
4
|
+
variant?: 'compact' | 'full';
|
|
5
|
+
title?: string;
|
|
6
|
+
onLoaded?: (info: {
|
|
7
|
+
totalContents: number;
|
|
8
|
+
}) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const CourseDetailsPanel: React.FC<CourseDetailsPanelProps>;
|
|
11
|
+
export {};
|
|
@@ -4,3 +4,5 @@ export { Button } from './Button';
|
|
|
4
4
|
export { Card } from './Card';
|
|
5
5
|
export { DropZone } from './DropZone';
|
|
6
6
|
export { LanguageSelector } from './LanguageSelector/LanguageSelector';
|
|
7
|
+
export { CourseDetailsPanel } from './CourseDetailsPanel';
|
|
8
|
+
export { LearningPathIcon } from './LearningPathIcon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function installMockApi(): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { INode } from '../types/editor';
|
|
2
|
+
export interface AssessmentSlotInfo {
|
|
3
|
+
level: INode | undefined;
|
|
4
|
+
filled: boolean;
|
|
5
|
+
courseName: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface UseAssessmentSlotsResult {
|
|
8
|
+
pre: AssessmentSlotInfo;
|
|
9
|
+
post: AssessmentSlotInfo;
|
|
10
|
+
activeAssessmentSlot: 'pre' | 'post' | null;
|
|
11
|
+
setActiveAssessmentSlot: (slot: 'pre' | 'post' | null) => void;
|
|
12
|
+
/** Deletes the pre/post slot's Level, confirming first if it's the Prior
|
|
13
|
+
* Assessment under the Diagnostic policy (it drives the Adaptive skip). */
|
|
14
|
+
deleteSlot: (slot: 'pre' | 'post') => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function useAssessmentSlots(): UseAssessmentSlotsResult;
|
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import { LibraryFilters } from '../components/LibraryDock/LibraryFilterPanel';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* LP profile library filters: search is strictly constrained to Courses.
|
|
4
|
+
* Filling the pre/post assessment slot has no competency constraint (the
|
|
5
|
+
* prior assessment *defines* the skill scope, so it can't be filtered by
|
|
6
|
+
* it). Browsing a Level otherwise shows every Course by default, narrowed
|
|
7
|
+
* to the selected skills once the author has picked any.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildLpLibraryFilters(activeAssessmentSlot: 'pre' | 'post' | null, selectedSkills: string[], skillCategoryCode: string | undefined, frameworkId?: string): Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* LP profile search fields: append the resolved skill-category code so each
|
|
12
|
+
* returned course carries its own skill tags in `metadata` — Skills
|
|
13
|
+
* covered, useSkillScope, and the publish-time "course has no skill tag"
|
|
14
|
+
* check all read that field off the linked course node, and it's otherwise
|
|
15
|
+
* absent from the default search field set (Collection profile leaves the
|
|
16
|
+
* default fields untouched).
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildSearchFields(competencyScoped: boolean, skillCategoryCode: string | undefined): string[] | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Why the Library is (or would be) empty for the LP profile, so the dock can
|
|
21
|
+
* show a guiding message instead of the generic "no results" empty state —
|
|
22
|
+
* mandatory per learning_path_plan.md §3 item 3: with no Curriculum chosen
|
|
23
|
+
* there's no framework to scope search by, and with no skills selected on a
|
|
24
|
+
* content Level there's nothing to filter by, so browsing must show nothing
|
|
25
|
+
* rather than every course. Doesn't apply to Collection, root, an assessment
|
|
26
|
+
* Level, or while filling the Prior/Outcome Assessment slot (that course
|
|
27
|
+
* *defines* the skill scope, so it can't be filtered by it).
|
|
28
|
+
*/
|
|
29
|
+
export declare function computeLibraryEmptyReason(competencyScoped: boolean, frameworkId: string | undefined, isLpLevel: boolean, activeAssessmentSlot: 'pre' | 'post' | null, selectedSkills: string[]): 'noCurriculum' | 'noSkills' | null;
|
|
3
30
|
/**
|
|
4
31
|
* Returns allowed primaryCategory values for the currently selected unit,
|
|
5
32
|
* driven by editorConfig.config.hierarchy.levelN.children.Content.
|
|
@@ -21,4 +48,6 @@ export declare function useLibrary(): {
|
|
|
21
48
|
toggleSort: () => void;
|
|
22
49
|
loadMore: () => void;
|
|
23
50
|
refetch: () => Promise<void>;
|
|
51
|
+
activeAssessmentSlot: "pre" | "post" | null;
|
|
52
|
+
emptyReason: "noCurriculum" | "noSkills" | null;
|
|
24
53
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLibraryTargetLabel(): string | null;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { INode } from '../types/editor';
|
|
2
|
+
import { IEditorProfile } from '../types/profile';
|
|
3
|
+
export declare function buildSavePayload(nodes: INode[], treeCache: Record<string, Record<string, unknown>>, channel: string, profile?: IEditorProfile): {
|
|
4
|
+
nodesModified: Record<string, unknown>;
|
|
5
|
+
hierarchy: Record<string, unknown>;
|
|
6
|
+
};
|
|
1
7
|
export declare function useSaveHierarchy(): {
|
|
2
8
|
save: () => Promise<void>;
|
|
3
9
|
isSaving: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ICategory, ITerm } from '../types/framework';
|
|
2
|
+
import { INode } from '../types/editor';
|
|
3
|
+
export interface ISkillCategory {
|
|
4
|
+
/** The metadata field used for tagging Levels/Courses and filtering course search. */
|
|
5
|
+
code: string;
|
|
6
|
+
/** The skill catalog — this category's terms. */
|
|
7
|
+
terms: ITerm[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Skills are not a fixed field: resolve the active framework's
|
|
11
|
+
* skill-equivalent category. USF exposes it directly as the `skill`
|
|
12
|
+
* category; any other framework's highest-index category is the
|
|
13
|
+
* skill-equivalent (USF's `skill` category also has the highest index, so
|
|
14
|
+
* one rule covers both — see learning_path_plan.md §3 item 0). Categories
|
|
15
|
+
* missing `index` are treated as lower priority than any category that
|
|
16
|
+
* declares one, rather than crashing the comparison.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveSkillCategory(categories: ICategory[] | undefined): ISkillCategory | null;
|
|
19
|
+
/** The prior-assessment course's own framework, when one is linked. Its skill
|
|
20
|
+
* tags live under *that* framework's skill category — an LP whose own
|
|
21
|
+
* framework is a fallback (e.g. context default) must not resolve the skill
|
|
22
|
+
* field against the wrong taxonomy. */
|
|
23
|
+
export declare function resolvePriorCourseFramework(rootNode: INode | undefined): string | undefined;
|
|
24
|
+
export declare function useSkillCategory(): ISkillCategory | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|