@project-sunbird/collection-editor-react 1.0.0 → 1.0.3
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.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/style.css +1 -1
- 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/README.md
CHANGED
|
@@ -90,6 +90,61 @@ registerCollectionEditor('my-collection-editor');
|
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
93
|
+
## Learning Path profile
|
|
94
|
+
|
|
95
|
+
Setting `config.primaryCategory` to `'Learning Path'` switches the editor into the **Learning Path**
|
|
96
|
+
profile — a config-driven variant of the same editor, not a fork. Everything else about the public
|
|
97
|
+
API (props, events, `apiBaseUrl`, the web component) is unchanged; the profile only affects internal
|
|
98
|
+
behavior:
|
|
99
|
+
|
|
100
|
+
- The hierarchy is `Learning Path → Level → Course`. Levels are the only unit type (`maxDepth: 1`);
|
|
101
|
+
Courses are linked whole as leaves, never authored inline.
|
|
102
|
+
- The path's first and last Level are the **Prior** and **Outcome Assessment** slots — ordinary
|
|
103
|
+
Levels wrapping a single question-set-only Course, rendered by `OutlineTree` as pinned rows above
|
|
104
|
+
and below the Level list rather than as regular tree rows.
|
|
105
|
+
- A Level's skill scope comes from the Prior Assessment's own skill tags (never from linked courses);
|
|
106
|
+
with no Prior Assessment linked, Levels fall back to manual selection from the active framework's
|
|
107
|
+
skill-equivalent category.
|
|
108
|
+
- CSV bulk upload, dial codes, and inline Course preview are disabled for this profile; publish is
|
|
109
|
+
gated by the derived structural rules (see `IEditorProfile`) instead of a manual checklist.
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import { CollectionEditor } from '@project-sunbird/collection-editor-react';
|
|
113
|
+
import '@project-sunbird/collection-editor-react/dist/style.css';
|
|
114
|
+
|
|
115
|
+
const learningPathConfig = {
|
|
116
|
+
context: {
|
|
117
|
+
authToken: 'your-bearer-token',
|
|
118
|
+
userId: 'user-id',
|
|
119
|
+
sid: 'session-id',
|
|
120
|
+
did: 'device-id',
|
|
121
|
+
channel: 'channel-id',
|
|
122
|
+
pdata: { id: 'your.app.id', ver: '1.0' },
|
|
123
|
+
env: 'collection_editor',
|
|
124
|
+
identifier: 'do_lp_123456789',
|
|
125
|
+
contentId: 'do_lp_123456789',
|
|
126
|
+
framework: 'USF',
|
|
127
|
+
},
|
|
128
|
+
config: {
|
|
129
|
+
mode: 'edit',
|
|
130
|
+
objectType: 'Collection',
|
|
131
|
+
primaryCategory: 'Learning Path', // the only switch — everything else is resolved from this
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export default function App() {
|
|
136
|
+
return <CollectionEditor {...learningPathConfig} />;
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The equivalent web-component usage is identical to the standard flow — just set
|
|
141
|
+
`primaryCategory: 'Learning Path'` in the JSON passed to `el.config`.
|
|
142
|
+
|
|
143
|
+
`IEditorProfile` (exported for advanced integrations that need to introspect the active profile,
|
|
144
|
+
e.g. `unitLabelKey`/`features` for a custom host toolbar) is re-exported from the package root.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
93
148
|
## API
|
|
94
149
|
|
|
95
150
|
### `<CollectionEditor>` props
|
package/dist/api/content.d.ts
CHANGED
package/dist/api/framework.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IFramework, ITerm } from '../types/framework';
|
|
2
|
-
|
|
3
2
|
export declare function getFramework(frameworkId: string): Promise<IFramework>;
|
|
4
3
|
export declare function searchTerms(frameworkId: string, categoryCode: string, query?: string): Promise<ITerm[]>;
|
|
5
4
|
export interface IFrameworkSearchResult {
|
package/dist/api/hierarchy.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { INode } from '../types/editor';
|
|
2
|
-
|
|
3
2
|
export declare function mapToINode(raw: unknown, parentId?: string): INode;
|
|
4
3
|
export declare function readHierarchy(contentId: string): Promise<{
|
|
5
4
|
content: Record<string, unknown>;
|
|
@@ -19,6 +18,13 @@ export declare function updateHierarchy(_contentId: string, nodesModified: Recor
|
|
|
19
18
|
identifiers?: Record<string, string>;
|
|
20
19
|
}>;
|
|
21
20
|
export declare function publishContent(contentId: string, lastPublishedBy?: string): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Reads a Course's own hierarchy — used by the Learning Path editor to detect
|
|
23
|
+
* assessment courses (Courses whose leaves are all QuML Question Sets, see
|
|
24
|
+
* src/utils/lpStructure.ts). No metadata marker exists for this today, so the
|
|
25
|
+
* pre/post assessment slot must read the course tree on selection.
|
|
26
|
+
*/
|
|
27
|
+
export declare function readCourseHierarchy(courseId: string): Promise<Record<string, unknown>>;
|
|
22
28
|
export declare function readContent(contentId: string): Promise<Record<string, unknown>>;
|
|
23
29
|
export declare function sendForReview(contentId: string): Promise<void>;
|
|
24
30
|
export declare function rejectContent(contentId: string, comment: string): Promise<void>;
|