@project-sunbird/sunbird-questionset-editor-web-component-react 0.1.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.
Files changed (170) hide show
  1. package/dist/api/asset.d.ts +31 -0
  2. package/dist/api/categoryDefinition.d.ts +39 -0
  3. package/dist/api/channel.d.ts +13 -0
  4. package/dist/api/client.d.ts +10 -0
  5. package/dist/api/client.test.d.ts +1 -0
  6. package/dist/api/comments.d.ts +10 -0
  7. package/dist/api/content.d.ts +14 -0
  8. package/dist/api/framework.d.ts +4 -0
  9. package/dist/api/hierarchy.d.ts +13 -0
  10. package/dist/api/license.d.ts +2 -0
  11. package/dist/api/question.d.ts +13 -0
  12. package/dist/api/question.test.d.ts +1 -0
  13. package/dist/api/urls.d.ts +64 -0
  14. package/dist/assets/libs/mathEquation/plugin/mathModal/css/mathmodal.css +1 -0
  15. package/dist/assets/libs/mathEquation/plugin/mathModal/favicon.ico +0 -0
  16. package/dist/assets/libs/mathEquation/plugin/mathModal/index.html +1 -0
  17. package/dist/assets/libs/mathEquation/plugin/mathModal/js/mathmodal.js +8 -0
  18. package/dist/assets/libs/mathEquation/plugin/mathModal/katex.min.css +1 -0
  19. package/dist/assets/libs/mathEquation/plugin/mathModal/katex.min.js +1 -0
  20. package/dist/assets/libs/mathEquation/plugin/mathModal/mathquill.css +425 -0
  21. package/dist/assets/libs/mathEquation/plugin/mathModal/mathquill.js +4925 -0
  22. package/dist/ckeditor/ckeditor.js +6 -0
  23. package/dist/components/AssetBrowser/AssetBrowser.d.ts +17 -0
  24. package/dist/components/BehaviourForm/SetBehaviourForm.d.ts +8 -0
  25. package/dist/components/CKEditorField/CKEditorField.d.ts +11 -0
  26. package/dist/components/ContextualEditor/ContextualEditor.d.ts +13 -0
  27. package/dist/components/LibraryDock/LibraryDock.d.ts +8 -0
  28. package/dist/components/OutlineTree/OutlineTree.d.ts +7 -0
  29. package/dist/components/QuestionDetail/QuestionDetail.d.ts +13 -0
  30. package/dist/components/QuestionEditor/BooleanEditor/BooleanEditor.d.ts +7 -0
  31. package/dist/components/QuestionEditor/FtbEditor/FtbEditor.d.ts +8 -0
  32. package/dist/components/QuestionEditor/McqEditor/McqEditor.d.ts +7 -0
  33. package/dist/components/QuestionEditor/MtfEditor/MtfEditor.d.ts +7 -0
  34. package/dist/components/QuestionEditor/QuestionEditor.d.ts +8 -0
  35. package/dist/components/QuestionEditor/ReoEditor/ReoEditor.d.ts +7 -0
  36. package/dist/components/QuestionEditor/SaEditor/SaEditor.d.ts +7 -0
  37. package/dist/components/QuestionEditor/SeqEditor/SeqEditor.d.ts +7 -0
  38. package/dist/components/QuestionsetEditor/QuestionsetEditor.d.ts +6 -0
  39. package/dist/components/QumlPlayer/QumlPlayer.d.ts +13 -0
  40. package/dist/components/RichTextEditor/RichTextEditor.d.ts +28 -0
  41. package/dist/components/SectionBehaviourForm/SectionBehaviourForm.d.ts +8 -0
  42. package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +39 -0
  43. package/dist/components/SplitEditorShell/SplitEditorShell.d.ts +8 -0
  44. package/dist/components/Topbar/Topbar.d.ts +18 -0
  45. package/dist/components/modals/ConfirmDialog.d.ts +4 -0
  46. package/dist/components/modals/ProgressStatusModal.d.ts +7 -0
  47. package/dist/components/modals/PublishChecklist.d.ts +10 -0
  48. package/dist/components/modals/QualityParamsModal.d.ts +11 -0
  49. package/dist/components/modals/QuestionTypeSelectorModal.d.ts +4 -0
  50. package/dist/components/modals/TermAndConditionModal.d.ts +8 -0
  51. package/dist/components/modals/UnsavedChangesModal.d.ts +10 -0
  52. package/dist/components/shared/Badge.d.ts +20 -0
  53. package/dist/components/shared/Button.d.ts +25 -0
  54. package/dist/components/shared/ContentEditable.d.ts +14 -0
  55. package/dist/components/shared/Icon.d.ts +11 -0
  56. package/dist/components/shared/ImagePickerModal.d.ts +15 -0
  57. package/dist/components/shared/MathModal.d.ts +10 -0
  58. package/dist/components/shared/Modal.d.ts +29 -0
  59. package/dist/components/shared/SharedRichToolbar.d.ts +5 -0
  60. package/dist/components/shared/Spinner.d.ts +15 -0
  61. package/dist/components/shared/specialCharsData.d.ts +7 -0
  62. package/dist/dev-main.d.ts +1 -0
  63. package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  64. package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  65. package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  66. package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  67. package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  68. package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  69. package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  70. package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  71. package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  72. package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  73. package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  74. package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  75. package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  76. package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  77. package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  78. package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  79. package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  80. package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  81. package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  82. package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  83. package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  84. package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  85. package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  86. package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  87. package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  88. package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  89. package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  90. package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  91. package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  92. package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  93. package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  94. package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  95. package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  96. package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  97. package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  98. package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  99. package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  100. package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  101. package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  102. package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  103. package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  104. package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  105. package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  106. package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  107. package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  108. package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  109. package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  110. package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  111. package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  112. package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  113. package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  114. package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  115. package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  116. package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  117. package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  118. package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  119. package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  120. package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  121. package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  122. package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  123. package/dist/hooks/index.d.ts +9 -0
  124. package/dist/hooks/useChannelData.d.ts +3 -0
  125. package/dist/hooks/useEditorInit.d.ts +12 -0
  126. package/dist/hooks/useFramework.d.ts +9 -0
  127. package/dist/hooks/useLabels.d.ts +4 -0
  128. package/dist/hooks/useLibrary.d.ts +18 -0
  129. package/dist/hooks/useQuestionRead.d.ts +16 -0
  130. package/dist/hooks/useSaveHierarchy.d.ts +6 -0
  131. package/dist/hooks/useSaveQuestion.d.ts +3 -0
  132. package/dist/hooks/useTelemetry.d.ts +9 -0
  133. package/dist/hooks/useToolbarActions.d.ts +5 -0
  134. package/dist/index.d.ts +19 -0
  135. package/dist/index.js +16202 -0
  136. package/dist/locales/label.config.ar.json.d.ts +344 -0
  137. package/dist/locales/label.config.fr.json.d.ts +237 -0
  138. package/dist/locales/label.config.hi.json.d.ts +51 -0
  139. package/dist/locales/label.config.json.d.ts +379 -0
  140. package/dist/locales/label.config.pt.json.d.ts +237 -0
  141. package/dist/registry/defaultQuestionTypes.d.ts +1 -0
  142. package/dist/registry/index.d.ts +9 -0
  143. package/dist/registry/questionTypeRegistry.d.ts +38 -0
  144. package/dist/store/editor.store.d.ts +66 -0
  145. package/dist/store/index.d.ts +5 -0
  146. package/dist/store/library.store.d.ts +32 -0
  147. package/dist/store/question.store.d.ts +103 -0
  148. package/dist/store/tree.store.d.ts +43 -0
  149. package/dist/store/tree.store.test.d.ts +1 -0
  150. package/dist/store/ui.store.d.ts +16 -0
  151. package/dist/style.css +1 -0
  152. package/dist/types/content.d.ts +23 -0
  153. package/dist/types/editor.d.ts +130 -0
  154. package/dist/types/framework.d.ts +40 -0
  155. package/dist/types/question.d.ts +118 -0
  156. package/dist/utils/assetUrl.d.ts +11 -0
  157. package/dist/utils/context.d.ts +10 -0
  158. package/dist/utils/context.test.d.ts +1 -0
  159. package/dist/utils/html.d.ts +12 -0
  160. package/dist/utils/i18n.test.d.ts +1 -0
  161. package/dist/utils/i18nField.d.ts +38 -0
  162. package/dist/utils/i18nSerialize.d.ts +16 -0
  163. package/dist/utils/labels.d.ts +8 -0
  164. package/dist/utils/nodeKind.d.ts +9 -0
  165. package/dist/utils/notify.d.ts +4 -0
  166. package/dist/utils/questionRead.d.ts +10 -0
  167. package/dist/utils/questionRead.test.d.ts +1 -0
  168. package/dist/utils/telemetry.d.ts +15 -0
  169. package/dist/web-component/register.d.ts +1 -0
  170. package/package.json +99 -0
@@ -0,0 +1,9 @@
1
+ export * from './useEditorInit';
2
+ export * from './useSaveHierarchy';
3
+ export * from './useSaveQuestion';
4
+ export * from './useToolbarActions';
5
+ export * from './useLibrary';
6
+ export * from './useFramework';
7
+ export * from './useChannelData';
8
+ export * from './useQuestionRead';
9
+ export * from './useTelemetry';
@@ -0,0 +1,3 @@
1
+ import { IChannelData } from '../api/channel';
2
+
3
+ export declare function useChannelData(): import('@tanstack/react-query').UseQueryResult<NoInfer<IChannelData>, Error>;
@@ -0,0 +1,12 @@
1
+ import { IEditorConfig } from '../types/editor';
2
+
3
+ interface UseEditorInitOptions {
4
+ config: IEditorConfig;
5
+ onError?: (e: Error) => void;
6
+ }
7
+ export declare function useEditorInit({ config, onError }: UseEditorInitOptions): {
8
+ isLoading: boolean;
9
+ error: Error | null;
10
+ isReady: boolean;
11
+ };
12
+ export {};
@@ -0,0 +1,9 @@
1
+ import { IFramework, ITerm } from '../types/framework';
2
+
3
+ export declare function useFramework(): {
4
+ orgFramework: NoInfer<IFramework> | undefined;
5
+ targetFrameworks: IFramework[];
6
+ isLoading: boolean;
7
+ targetFrameworkIds: string[];
8
+ frameworkTerms: Map<string, ITerm[]>;
9
+ };
@@ -0,0 +1,4 @@
1
+ /** Store-driven label lookup: L('section.key', 'Fallback'). */
2
+ export declare function useLabels(): (path: string, fallback: string) => string;
3
+ /** UI direction follows the UI language (ar = rtl). */
4
+ export declare function useUiDir(): 'ltr' | 'rtl';
@@ -0,0 +1,18 @@
1
+ import { LibraryFilters } from '../store/library.store';
2
+
3
+ export declare function useLibrary(): {
4
+ content: import('../types/content').IContent[];
5
+ isLoading: boolean;
6
+ totalCount: number;
7
+ activeFilter: string;
8
+ advancedFilters: LibraryFilters;
9
+ searchQuery: string;
10
+ sortAZ: boolean;
11
+ hasMore: boolean;
12
+ search: (query: string) => void;
13
+ setFilter: (filter: string) => void;
14
+ applyAdvancedFilters: (advancedFilters: LibraryFilters) => void;
15
+ toggleSort: () => void;
16
+ loadMore: () => void;
17
+ refetch: () => Promise<void>;
18
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Reads the selected question individually from `question/v2/read`, the way
3
+ * the old Angular editor's question.component did on open. The hierarchy
4
+ * response does NOT embed editorState/options/solutions/hints/media on a
5
+ * real backend — without this read the editing panel would be empty.
6
+ *
7
+ * On success the response hydrates:
8
+ * - question.store (via normalizeQuestionRead → setActiveQuestion), unless
9
+ * the user already started editing (isDirty guard)
10
+ * - the tree node's metadata (hydrateNodeMeta — no treeCache entry, so the
11
+ * node is not re-sent on the next hierarchy save)
12
+ */
13
+ export declare function useQuestionRead(): {
14
+ isFetching: boolean;
15
+ error: Error | null;
16
+ };
@@ -0,0 +1,6 @@
1
+ export declare function useSaveHierarchy(): {
2
+ save: () => Promise<boolean>;
3
+ isSaving: boolean;
4
+ isDirty: boolean;
5
+ lastSaved: string | null;
6
+ };
@@ -0,0 +1,3 @@
1
+ export declare function useSaveQuestion(): {
2
+ save: () => Promise<boolean>;
3
+ };
@@ -0,0 +1,9 @@
1
+ import { telemetryInteract } from '../utils/telemetry';
2
+
3
+ /**
4
+ * Telemetry lifecycle — old editor parity: init with the host context, fire
5
+ * START + the first IMPRESSION on mount, END (with a final flush) on unmount.
6
+ */
7
+ export declare function useTelemetry(): {
8
+ logInteract: typeof telemetryInteract;
9
+ };
@@ -0,0 +1,5 @@
1
+ import { ToolbarAction } from '../types/editor';
2
+
3
+ export declare function useToolbarActions(save: () => Promise<boolean | void>): {
4
+ runAction: (action: ToolbarAction, data?: unknown) => Promise<boolean>;
5
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * index.ts — public API surface for the questionset-editor-react library.
3
+ *
4
+ * Only symbols exported here are part of the public contract.
5
+ * Internal implementation details (store internals, API client internals, etc.)
6
+ * should NOT be added here.
7
+ */
8
+ export { QuestionsetEditor } from './components/QuestionsetEditor/QuestionsetEditor';
9
+ export type { QuestionsetEditorProps } from './components/QuestionsetEditor/QuestionsetEditor';
10
+ export { registerQuestionsetEditor } from './web-component/register';
11
+ export { useEditorStore } from './store/editor.store';
12
+ export { useTreeStore } from './store/tree.store';
13
+ export { useQuestionStore } from './store/question.store';
14
+ export { useUiStore } from './store/ui.store';
15
+ export { setApiBaseUrl, setApiSlug } from './api/client';
16
+ export { registerQuestionType, resolveQuestionType, resolveByQType, resolveByCategory, resolveByInteractionType, allQuestionTypes, } from './registry';
17
+ export type { QuestionTypeDefinition, QuestionTypeEditorProps } from './registry';
18
+ export type { IEditorConfig, IEditorEvents, INode, EditorMode, ToolbarAction, } from './types/editor';
19
+ export type { IQuestion, QuestionType, IOption, IMatchPair, IHint, } from './types/question';