@project-sunbird/sunbird-questionset-editor-web-component-react 0.1.21 → 0.1.22-alpha
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/api/competencyFramework.d.ts +15 -0
- package/dist/api/competencyFramework.test.d.ts +1 -0
- package/dist/api/content.d.ts +2 -0
- package/dist/api/urls.d.ts +4 -0
- package/dist/components/LibraryDock/SkillChips.d.ts +12 -0
- package/dist/components/SkillFrameworkFields/SkillFrameworkFields.d.ts +22 -0
- package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +10 -0
- package/dist/hooks/useLibrary.d.ts +41 -1
- package/dist/hooks/useLibrary.test.d.ts +1 -0
- package/dist/hooks/useSaveQuestion.d.ts +7 -0
- package/dist/hooks/useSaveQuestion.skillFramework.test.d.ts +1 -0
- package/dist/hooks/useSkillFramework.d.ts +55 -0
- package/dist/hooks/useSkillFramework.test.d.ts +1 -0
- package/dist/index.js +7936 -7486
- package/dist/locales/label.config.ar.json.d.ts +14 -1
- package/dist/locales/label.config.fr.json.d.ts +14 -1
- package/dist/locales/label.config.hi.json.d.ts +14 -1
- package/dist/locales/label.config.json.d.ts +14 -1
- package/dist/locales/label.config.pt.json.d.ts +14 -1
- package/dist/store/library.store.d.ts +19 -0
- package/dist/store/library.store.test.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/content.d.ts +5 -0
- package/dist/utils/competencyLeaves.d.ts +43 -0
- package/dist/utils/competencyLeaves.test.d.ts +1 -0
- package/dist/utils/skillChips.d.ts +20 -0
- package/dist/utils/skillChips.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skills of a `CompetencyFramework` (Knowlg `/competency-framework/v3/read`), worked out the way
|
|
3
|
+
* lern-service does it (`CompetencyFrameworkUtil.parseTree` / `parseSkillField`), so a question set
|
|
4
|
+
* or question is only ever tagged with skills lern can credit, under the field lern reads them from.
|
|
5
|
+
*
|
|
6
|
+
* The skill category is the framework's LAST category by `index` (falling back to its position in
|
|
7
|
+
* the response), whatever the adopter names it. Its code is the content field skill tags are
|
|
8
|
+
* stored in (`skill` for one framework, `cuisine` for another), and its terms are the skills.
|
|
9
|
+
* Inside it, terms may still nest by `children` or name a `parentCode`/`parents` in the same
|
|
10
|
+
* category; then only a term nobody descends from is a skill. Categories above it are navigation
|
|
11
|
+
* only and never offered.
|
|
12
|
+
*/
|
|
13
|
+
export interface CompetencyTermWire {
|
|
14
|
+
identifier?: string;
|
|
15
|
+
code?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
category?: string;
|
|
18
|
+
status?: string;
|
|
19
|
+
children?: CompetencyTermWire[];
|
|
20
|
+
associations?: Array<{
|
|
21
|
+
identifier?: string;
|
|
22
|
+
category?: string;
|
|
23
|
+
}>;
|
|
24
|
+
parentCode?: string;
|
|
25
|
+
parents?: Array<{
|
|
26
|
+
code?: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
export interface CompetencyCategoryWire {
|
|
30
|
+
code?: string;
|
|
31
|
+
index?: number;
|
|
32
|
+
terms?: CompetencyTermWire[];
|
|
33
|
+
}
|
|
34
|
+
export interface CompetencySkill {
|
|
35
|
+
code: string;
|
|
36
|
+
name: string;
|
|
37
|
+
}
|
|
38
|
+
/** The field a question set's or question's skill tags live in: the skill category's code. */
|
|
39
|
+
export declare function competencySkillField(categories: CompetencyCategoryWire[] | undefined): string | undefined;
|
|
40
|
+
/** Skill codes, sorted. Empty when the framework has no categories or its last one has no terms. */
|
|
41
|
+
export declare function competencyLeafCodes(categories: CompetencyCategoryWire[] | undefined): string[];
|
|
42
|
+
/** Skills with their authored names, sorted by name. */
|
|
43
|
+
export declare function competencyLeafSkills(categories: CompetencyCategoryWire[] | undefined): CompetencySkill[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IContent } from '../types/content';
|
|
2
|
+
export interface SkillChip {
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
/** One of the question set's own skills. */
|
|
6
|
+
matched: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The skill chips for one library question: its skills under the set's skill framework, the set's
|
|
10
|
+
* own skills first. A question tagged under another skill framework shows none - its codes mean
|
|
11
|
+
* something else there. Codes resolve to names through `nameOf`, falling back to the code.
|
|
12
|
+
*/
|
|
13
|
+
export declare function questionSkillChips(item: IContent, set: {
|
|
14
|
+
frameworkId?: string;
|
|
15
|
+
skillField?: string;
|
|
16
|
+
skills: string[];
|
|
17
|
+
}, nameOf: (code: string) => string | undefined, cap?: number): {
|
|
18
|
+
chips: SkillChip[];
|
|
19
|
+
more: number;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@project-sunbird/sunbird-questionset-editor-web-component-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22-alpha",
|
|
4
4
|
"description": "React-based QuML QuestionSet Editor — usable as a React component or as a <sb-questionset-editor> web component in any framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sunbird",
|