@project-sunbird/sunbird-questionset-editor-web-component-react 0.1.14 → 0.1.16
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/framework.d.ts +14 -0
- package/dist/api/hierarchy.d.ts +4 -0
- package/dist/api/question.d.ts +18 -0
- package/dist/assets/sunbird-quml-player.js +2 -2
- package/dist/components/LibraryDock/LibraryDock.d.ts +0 -1
- package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +46 -0
- package/dist/hooks/useFramework.d.ts +19 -1
- package/dist/hooks/useLibrary.d.ts +7 -0
- package/dist/index.js +6661 -5394
- package/dist/locales/label.config.ar.json.d.ts +39 -4
- package/dist/locales/label.config.fr.json.d.ts +39 -4
- package/dist/locales/label.config.json.d.ts +39 -4
- package/dist/locales/label.config.pt.json.d.ts +39 -4
- package/dist/queryClient.d.ts +2 -0
- package/dist/store/copyRegistry.store.d.ts +29 -0
- package/dist/store/editor.store.d.ts +9 -0
- package/dist/store/tree.store.d.ts +10 -0
- package/dist/style.css +1 -1
- package/dist/types/content.d.ts +4 -0
- package/dist/types/framework.d.ts +4 -0
- package/dist/utils/labels.d.ts +2 -1
- package/package.json +2 -2
|
@@ -23,6 +23,15 @@ export interface SparkMetaFormProps {
|
|
|
23
23
|
* undefined (i.e. the "Details" tab).
|
|
24
24
|
*/
|
|
25
25
|
section?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Bypasses the `section` tab logic entirely — every visible field is
|
|
28
|
+
* rendered regardless of its own `section`. For a caller with no tabs at
|
|
29
|
+
* all (the question editor's Details form, the read-only question meta
|
|
30
|
+
* view): omitting `section` there would otherwise mean "show only the
|
|
31
|
+
* untabbed fields" (root's Details-tab meaning), silently dropping any
|
|
32
|
+
* framework-driven category field tagged 'Audience & Curriculum'.
|
|
33
|
+
*/
|
|
34
|
+
showAllSections?: boolean;
|
|
26
35
|
/**
|
|
27
36
|
* Framework terms keyed by sourceCategory (e.g. "board", "medium",
|
|
28
37
|
* "gradeLevel", "subject"). When provided, fields whose `sourceCategory`
|
|
@@ -33,7 +42,44 @@ export interface SparkMetaFormProps {
|
|
|
33
42
|
* — `identifier` is used as the option value, `name` as the visible label.
|
|
34
43
|
*/
|
|
35
44
|
frameworkTerms?: Map<string, FrameworkTerm[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Category codes in framework order (ascending `index`), from the same
|
|
47
|
+
* `useFramework()` call that produced `frameworkTerms` — see
|
|
48
|
+
* `adaptFieldsForFramework`'s single-vs-multi-select rule below. Only
|
|
49
|
+
* meaningful together with `isRoot`; omit for section/question forms.
|
|
50
|
+
*/
|
|
51
|
+
categoryOrder?: string[];
|
|
52
|
+
/**
|
|
53
|
+
* True for the root (questionset-level) form only. The "framework" field
|
|
54
|
+
* (code: 'framework') is special-cased to live-update which framework's
|
|
55
|
+
* terms populate every other category dropdown on this same form — see
|
|
56
|
+
* editor.store.ts's contentFramework — but that only makes sense at the
|
|
57
|
+
* root, so section/question forms never have this set.
|
|
58
|
+
*/
|
|
59
|
+
isRoot?: boolean;
|
|
36
60
|
}
|
|
61
|
+
/** Exported so callers (e.g. ContextualEditor's tab bar) can check whether a
|
|
62
|
+
* given tab's section has any required field, using the exact same
|
|
63
|
+
* matching rule the tab's own <SparkMetaForm section="..."/> render uses.
|
|
64
|
+
* `showAllSections` bypasses the tab logic entirely — for a caller with no
|
|
65
|
+
* tabs at all (the question editor's Details form, the read-only question
|
|
66
|
+
* meta view), where "undefined section" must mean "show everything",
|
|
67
|
+
* not "show only the untabbed fields" (root's actual meaning for it). */
|
|
68
|
+
export declare function fieldMatchesSection(field: ICategoryField, section?: string, showAllSections?: boolean): boolean;
|
|
37
69
|
export declare function findMissingRequiredFields(fields: ICategoryField[], values: Record<string, unknown>): ICategoryField[];
|
|
70
|
+
export interface SelectOption {
|
|
71
|
+
value: string;
|
|
72
|
+
label: string;
|
|
73
|
+
}
|
|
74
|
+
export interface SingleSelectDropdownProps {
|
|
75
|
+
fieldId: string;
|
|
76
|
+
value: string;
|
|
77
|
+
options: SelectOption[];
|
|
78
|
+
onChange: (v: string) => void;
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
placeholder?: string;
|
|
81
|
+
hasError?: boolean;
|
|
82
|
+
}
|
|
83
|
+
export declare const SingleSelectDropdown: React.FC<SingleSelectDropdownProps>;
|
|
38
84
|
declare const SparkMetaForm: React.FC<SparkMetaFormProps>;
|
|
39
85
|
export default SparkMetaForm;
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import { IFramework, ITerm } from '../types/framework';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @param overrideFrameworkId - Resolves categories against this framework
|
|
4
|
+
* instead of the root/live one, fully locally to the caller — e.g. a
|
|
5
|
+
* question that picked its own Framework in its Details form. Does not
|
|
6
|
+
* touch editor.store's contentFramework or affect any other caller; target
|
|
7
|
+
* frameworks still come from root (questions have no targetFWIds concept of
|
|
8
|
+
* their own). Omit for the existing root-level behaviour, unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFramework(overrideFrameworkId?: string): {
|
|
3
11
|
orgFramework: NoInfer<IFramework> | undefined;
|
|
4
12
|
targetFrameworks: IFramework[];
|
|
5
13
|
isLoading: boolean;
|
|
6
14
|
targetFrameworkIds: string[];
|
|
7
15
|
frameworkTerms: Map<string, ITerm[]>;
|
|
16
|
+
categoryOrder: string[];
|
|
8
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Same target-framework precedence useFramework() applies internally
|
|
20
|
+
* (rootMeta.targetFWIds wins over the host-supplied config) — extracted for
|
|
21
|
+
* plain, non-hook code that needs to resolve the same ids without
|
|
22
|
+
* subscribing to store changes (useSaveQuestion.ts, reading straight out of
|
|
23
|
+
* getState() at save time to sweep target frameworks' categories into the
|
|
24
|
+
* taxonomy payload, same as this hook's frameworkTerms merge does).
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveTargetFrameworkIds(): string[];
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { LibraryFilters } from '../store/library.store';
|
|
2
|
+
/**
|
|
3
|
+
* Re-run the library search with whatever query/filter is currently active —
|
|
4
|
+
* e.g. after a new standalone question is created, so it shows up without
|
|
5
|
+
* the user having to re-search manually. Callable from outside a component
|
|
6
|
+
* (not a hook), unlike `useLibrary()`'s `refetch`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function refreshLibrary(): void;
|
|
2
9
|
export declare function useLibrary(): {
|
|
3
10
|
content: import('../types/content').IContent[];
|
|
4
11
|
isLoading: boolean;
|