@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.
- package/dist/api/asset.d.ts +31 -0
- package/dist/api/categoryDefinition.d.ts +39 -0
- package/dist/api/channel.d.ts +13 -0
- package/dist/api/client.d.ts +10 -0
- package/dist/api/client.test.d.ts +1 -0
- package/dist/api/comments.d.ts +10 -0
- package/dist/api/content.d.ts +14 -0
- package/dist/api/framework.d.ts +4 -0
- package/dist/api/hierarchy.d.ts +13 -0
- package/dist/api/license.d.ts +2 -0
- package/dist/api/question.d.ts +13 -0
- package/dist/api/question.test.d.ts +1 -0
- package/dist/api/urls.d.ts +64 -0
- package/dist/assets/libs/mathEquation/plugin/mathModal/css/mathmodal.css +1 -0
- package/dist/assets/libs/mathEquation/plugin/mathModal/favicon.ico +0 -0
- package/dist/assets/libs/mathEquation/plugin/mathModal/index.html +1 -0
- package/dist/assets/libs/mathEquation/plugin/mathModal/js/mathmodal.js +8 -0
- package/dist/assets/libs/mathEquation/plugin/mathModal/katex.min.css +1 -0
- package/dist/assets/libs/mathEquation/plugin/mathModal/katex.min.js +1 -0
- package/dist/assets/libs/mathEquation/plugin/mathModal/mathquill.css +425 -0
- package/dist/assets/libs/mathEquation/plugin/mathModal/mathquill.js +4925 -0
- package/dist/ckeditor/ckeditor.js +6 -0
- package/dist/components/AssetBrowser/AssetBrowser.d.ts +17 -0
- package/dist/components/BehaviourForm/SetBehaviourForm.d.ts +8 -0
- package/dist/components/CKEditorField/CKEditorField.d.ts +11 -0
- package/dist/components/ContextualEditor/ContextualEditor.d.ts +13 -0
- package/dist/components/LibraryDock/LibraryDock.d.ts +8 -0
- package/dist/components/OutlineTree/OutlineTree.d.ts +7 -0
- package/dist/components/QuestionDetail/QuestionDetail.d.ts +13 -0
- package/dist/components/QuestionEditor/BooleanEditor/BooleanEditor.d.ts +7 -0
- package/dist/components/QuestionEditor/FtbEditor/FtbEditor.d.ts +8 -0
- package/dist/components/QuestionEditor/McqEditor/McqEditor.d.ts +7 -0
- package/dist/components/QuestionEditor/MtfEditor/MtfEditor.d.ts +7 -0
- package/dist/components/QuestionEditor/QuestionEditor.d.ts +8 -0
- package/dist/components/QuestionEditor/ReoEditor/ReoEditor.d.ts +7 -0
- package/dist/components/QuestionEditor/SaEditor/SaEditor.d.ts +7 -0
- package/dist/components/QuestionEditor/SeqEditor/SeqEditor.d.ts +7 -0
- package/dist/components/QuestionsetEditor/QuestionsetEditor.d.ts +6 -0
- package/dist/components/QumlPlayer/QumlPlayer.d.ts +13 -0
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +28 -0
- package/dist/components/SectionBehaviourForm/SectionBehaviourForm.d.ts +8 -0
- package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +39 -0
- package/dist/components/SplitEditorShell/SplitEditorShell.d.ts +8 -0
- package/dist/components/Topbar/Topbar.d.ts +18 -0
- package/dist/components/modals/ConfirmDialog.d.ts +4 -0
- package/dist/components/modals/ProgressStatusModal.d.ts +7 -0
- package/dist/components/modals/PublishChecklist.d.ts +10 -0
- package/dist/components/modals/QualityParamsModal.d.ts +11 -0
- package/dist/components/modals/QuestionTypeSelectorModal.d.ts +4 -0
- package/dist/components/modals/TermAndConditionModal.d.ts +8 -0
- package/dist/components/modals/UnsavedChangesModal.d.ts +10 -0
- package/dist/components/shared/Badge.d.ts +20 -0
- package/dist/components/shared/Button.d.ts +25 -0
- package/dist/components/shared/ContentEditable.d.ts +14 -0
- package/dist/components/shared/Icon.d.ts +11 -0
- package/dist/components/shared/ImagePickerModal.d.ts +15 -0
- package/dist/components/shared/MathModal.d.ts +10 -0
- package/dist/components/shared/Modal.d.ts +29 -0
- package/dist/components/shared/SharedRichToolbar.d.ts +5 -0
- package/dist/components/shared/Spinner.d.ts +15 -0
- package/dist/components/shared/specialCharsData.d.ts +7 -0
- package/dist/dev-main.d.ts +1 -0
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/useChannelData.d.ts +3 -0
- package/dist/hooks/useEditorInit.d.ts +12 -0
- package/dist/hooks/useFramework.d.ts +9 -0
- package/dist/hooks/useLabels.d.ts +4 -0
- package/dist/hooks/useLibrary.d.ts +18 -0
- package/dist/hooks/useQuestionRead.d.ts +16 -0
- package/dist/hooks/useSaveHierarchy.d.ts +6 -0
- package/dist/hooks/useSaveQuestion.d.ts +3 -0
- package/dist/hooks/useTelemetry.d.ts +9 -0
- package/dist/hooks/useToolbarActions.d.ts +5 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +16202 -0
- package/dist/locales/label.config.ar.json.d.ts +344 -0
- package/dist/locales/label.config.fr.json.d.ts +237 -0
- package/dist/locales/label.config.hi.json.d.ts +51 -0
- package/dist/locales/label.config.json.d.ts +379 -0
- package/dist/locales/label.config.pt.json.d.ts +237 -0
- package/dist/registry/defaultQuestionTypes.d.ts +1 -0
- package/dist/registry/index.d.ts +9 -0
- package/dist/registry/questionTypeRegistry.d.ts +38 -0
- package/dist/store/editor.store.d.ts +66 -0
- package/dist/store/index.d.ts +5 -0
- package/dist/store/library.store.d.ts +32 -0
- package/dist/store/question.store.d.ts +103 -0
- package/dist/store/tree.store.d.ts +43 -0
- package/dist/store/tree.store.test.d.ts +1 -0
- package/dist/store/ui.store.d.ts +16 -0
- package/dist/style.css +1 -0
- package/dist/types/content.d.ts +23 -0
- package/dist/types/editor.d.ts +130 -0
- package/dist/types/framework.d.ts +40 -0
- package/dist/types/question.d.ts +118 -0
- package/dist/utils/assetUrl.d.ts +11 -0
- package/dist/utils/context.d.ts +10 -0
- package/dist/utils/context.test.d.ts +1 -0
- package/dist/utils/html.d.ts +12 -0
- package/dist/utils/i18n.test.d.ts +1 -0
- package/dist/utils/i18nField.d.ts +38 -0
- package/dist/utils/i18nSerialize.d.ts +16 -0
- package/dist/utils/labels.d.ts +8 -0
- package/dist/utils/nodeKind.d.ts +9 -0
- package/dist/utils/notify.d.ts +4 -0
- package/dist/utils/questionRead.d.ts +10 -0
- package/dist/utils/questionRead.test.d.ts +1 -0
- package/dist/utils/telemetry.d.ts +15 -0
- package/dist/web-component/register.d.ts +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface AssetBrowserProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onSelect: (asset: {
|
|
7
|
+
url: string;
|
|
8
|
+
name: string;
|
|
9
|
+
id: string;
|
|
10
|
+
thumbnail?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
mediaType?: 'image' | 'audio' | 'video';
|
|
13
|
+
channel: string;
|
|
14
|
+
userId: string;
|
|
15
|
+
}
|
|
16
|
+
declare const AssetBrowser: React.FC<AssetBrowserProps>;
|
|
17
|
+
export default AssetBrowser;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CKEditorFieldProps {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (html: string) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
minHeight?: number;
|
|
9
|
+
compact?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export default function CKEditorField({ value, onChange, placeholder, disabled, minHeight, compact, }: CKEditorFieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { EditorMode, ToolbarAction } from '../../types/editor';
|
|
3
|
+
|
|
4
|
+
export interface ContextualEditorProps {
|
|
5
|
+
editorMode?: EditorMode;
|
|
6
|
+
onToolbarEvent: (event: {
|
|
7
|
+
action: ToolbarAction;
|
|
8
|
+
data?: unknown;
|
|
9
|
+
}) => void;
|
|
10
|
+
hasContent?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const ContextualEditor: React.FC<ContextualEditorProps>;
|
|
13
|
+
export default ContextualEditor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface LibraryDockProps {
|
|
4
|
+
/** Called when the user clicks the collapse button */
|
|
5
|
+
onCollapse: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function LibraryDock({ onCollapse }: LibraryDockProps): React.JSX.Element;
|
|
8
|
+
export default LibraryDock;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { INode } from '../../types/editor';
|
|
3
|
+
|
|
4
|
+
interface QuestionDetailProps {
|
|
5
|
+
node: INode;
|
|
6
|
+
onOpenEditor: () => void;
|
|
7
|
+
onRemove: () => void;
|
|
8
|
+
isEditMode?: boolean;
|
|
9
|
+
/** True while question/v2/read for this node is in flight. */
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const QuestionDetail: React.FC<QuestionDetailProps>;
|
|
13
|
+
export default QuestionDetail;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { EditorMode } from '../../types/editor';
|
|
3
|
+
|
|
4
|
+
export interface QuestionEditorProps {
|
|
5
|
+
editorMode: EditorMode;
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export default function QuestionEditor({ editorMode, onBack }: QuestionEditorProps): React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IEditorConfig, IEditorEvents } from '../../types/editor';
|
|
3
|
+
|
|
4
|
+
export type QuestionsetEditorProps = IEditorConfig & IEditorEvents;
|
|
5
|
+
export declare function QuestionsetEditor(props: QuestionsetEditorProps): React.JSX.Element;
|
|
6
|
+
export default QuestionsetEditor;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface QumlPlayerProps {
|
|
4
|
+
/** Identifier of the question set being previewed. */
|
|
5
|
+
questionSetId: string;
|
|
6
|
+
/** When set, previews just this question (old editor question preview). */
|
|
7
|
+
singleQuestionId?: string;
|
|
8
|
+
/** Render embedded in the page instead of a full-screen overlay. */
|
|
9
|
+
inline?: boolean;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const QumlPlayer: React.FC<QumlPlayerProps>;
|
|
13
|
+
export default QumlPlayer;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Editor } from '@tiptap/react';
|
|
3
|
+
|
|
4
|
+
export interface RichTextEditorProps {
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (html: string) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
minHeight?: number;
|
|
10
|
+
enableImages?: boolean;
|
|
11
|
+
maxLength?: number;
|
|
12
|
+
/** Compact mode: smaller toolbar, reduced padding */
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
/** No outer border — use when parent container already provides a border */
|
|
15
|
+
borderless?: boolean;
|
|
16
|
+
/** Hide the built-in toolbar (use when rendering the toolbar externally) */
|
|
17
|
+
hideToolbar?: boolean;
|
|
18
|
+
/** Called once the editor instance is ready — use to render an external toolbar */
|
|
19
|
+
onEditorReady?: (editor: Editor) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface ToolbarProps {
|
|
22
|
+
editor: Editor | null;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
enableImages?: boolean;
|
|
25
|
+
onImageClick?: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function Toolbar({ editor, disabled, enableImages, onImageClick }: ToolbarProps): React.JSX.Element | null;
|
|
28
|
+
export default function RichTextEditor({ value, onChange, placeholder, disabled, minHeight, enableImages, maxLength, compact, borderless, hideToolbar, onEditorReady, }: RichTextEditorProps): React.JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ICategoryField } from '../../api/categoryDefinition';
|
|
3
|
+
|
|
4
|
+
/** Shape of a single framework term entry. */
|
|
5
|
+
export interface FrameworkTerm {
|
|
6
|
+
name: string;
|
|
7
|
+
identifier: string;
|
|
8
|
+
code: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SparkMetaFormProps {
|
|
11
|
+
/** Field configuration array from category-definition API. */
|
|
12
|
+
fields: ICategoryField[];
|
|
13
|
+
/** Current field values (from activeNodeMeta or node metadata). */
|
|
14
|
+
values: Record<string, unknown>;
|
|
15
|
+
/** Called when a field value changes — (fieldCode, newValue). */
|
|
16
|
+
onChange: (code: string, value: unknown) => void;
|
|
17
|
+
/** Called when overall form validity changes. */
|
|
18
|
+
onValidityChange?: (isValid: boolean) => void;
|
|
19
|
+
/** When true, all inputs are disabled/read-only. */
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* When set, only fields whose `section` property matches this value are
|
|
23
|
+
* rendered. Fields with no `section` are shown when `section` is
|
|
24
|
+
* undefined (i.e. the "Details" tab).
|
|
25
|
+
*/
|
|
26
|
+
section?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Framework terms keyed by sourceCategory (e.g. "board", "medium",
|
|
29
|
+
* "gradeLevel", "subject"). When provided, fields whose `sourceCategory`
|
|
30
|
+
* matches a key will be populated from this map instead of falling back to
|
|
31
|
+
* `field.range` / `field.enum`.
|
|
32
|
+
*
|
|
33
|
+
* Each term has shape: { name, identifier, code }
|
|
34
|
+
* — `identifier` is used as the option value, `name` as the visible label.
|
|
35
|
+
*/
|
|
36
|
+
frameworkTerms?: Map<string, FrameworkTerm[]>;
|
|
37
|
+
}
|
|
38
|
+
declare const SparkMetaForm: React.FC<SparkMetaFormProps>;
|
|
39
|
+
export default SparkMetaForm;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IEditorEvents } from '../../types/editor';
|
|
3
|
+
|
|
4
|
+
interface SplitEditorShellProps {
|
|
5
|
+
events: IEditorEvents;
|
|
6
|
+
}
|
|
7
|
+
export declare function SplitEditorShell({ events }: SplitEditorShellProps): React.JSX.Element;
|
|
8
|
+
export default SplitEditorShell;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { EditorMode, ToolbarAction } from '../../types/editor';
|
|
3
|
+
|
|
4
|
+
interface TopbarProps {
|
|
5
|
+
/** Locks all topbar actions while the inline question editor is open. */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
editorMode: EditorMode;
|
|
8
|
+
isSaving: boolean;
|
|
9
|
+
isDirty: boolean;
|
|
10
|
+
lastSaved: string | null;
|
|
11
|
+
isFormValid?: boolean;
|
|
12
|
+
onToolbarEvent: (event: {
|
|
13
|
+
action: ToolbarAction;
|
|
14
|
+
data?: unknown;
|
|
15
|
+
}) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const Topbar: React.FC<TopbarProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface PublishChecklistProps {
|
|
4
|
+
contentId: string;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const PublishChecklist: React.FC<PublishChecklistProps>;
|
|
9
|
+
export { PublishChecklist };
|
|
10
|
+
export default PublishChecklist;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface QualityParamsModalProps {
|
|
4
|
+
contentId: string;
|
|
5
|
+
action: 'approve' | 'reject';
|
|
6
|
+
onConfirm: (comment: string, score?: number) => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const QualityParamsModal: React.FC<QualityParamsModalProps>;
|
|
10
|
+
export { QualityParamsModal };
|
|
11
|
+
export default QualityParamsModal;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface UnsavedChangesModalProps {
|
|
4
|
+
onSave: () => void;
|
|
5
|
+
onDiscard: () => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
isSaving: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const UnsavedChangesModal: React.FC<UnsavedChangesModalProps>;
|
|
10
|
+
export default UnsavedChangesModal;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { QuestionType } from '../../types/question';
|
|
3
|
+
|
|
4
|
+
export type BadgeSize = 'sm' | 'md';
|
|
5
|
+
export interface BadgeProps {
|
|
6
|
+
/** The question type that determines color and icon. */
|
|
7
|
+
type: QuestionType;
|
|
8
|
+
/** Visual size of the badge. Defaults to 'md'. */
|
|
9
|
+
size?: BadgeSize;
|
|
10
|
+
/** Override the displayed label. Falls back to the registry's type label. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** When true, only renders the icon (no label text). */
|
|
13
|
+
iconOnly?: boolean;
|
|
14
|
+
/** Additional CSS class applied to the root element. */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Inline styles applied to the root element. */
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
declare const Badge: React.FC<BadgeProps>;
|
|
20
|
+
export default Badge;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ButtonVariant = 'primary' | 'ghost' | 'danger' | 'outline';
|
|
4
|
+
export type ButtonSize = 'sm' | 'md';
|
|
5
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
/** Visual style of the button. Defaults to 'primary'. */
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
/** Size of the button. Defaults to 'md'. */
|
|
9
|
+
size?: ButtonSize;
|
|
10
|
+
/** When true, shows a spinner and disables interaction. */
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
/** Screen-reader label shown while loading. Defaults to 'Loading…'. */
|
|
13
|
+
loadingLabel?: string;
|
|
14
|
+
/** Icon rendered before the button label. */
|
|
15
|
+
leftIcon?: React.ReactNode;
|
|
16
|
+
/** Icon rendered after the button label. */
|
|
17
|
+
rightIcon?: React.ReactNode;
|
|
18
|
+
/** Renders an anchor element instead of a button (pass href). */
|
|
19
|
+
as?: 'button' | 'a';
|
|
20
|
+
/** Target URL when `as="a"`. */
|
|
21
|
+
href?: string;
|
|
22
|
+
}
|
|
23
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
export { Button };
|
|
25
|
+
export default Button;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ContentEditableProps {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (html: string) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Inline mode: Enter blurs instead of inserting newline */
|
|
9
|
+
inline?: boolean;
|
|
10
|
+
minHeight?: number;
|
|
11
|
+
/** Extra className appended to .re-body */
|
|
12
|
+
bodyClass?: string;
|
|
13
|
+
}
|
|
14
|
+
export default function ContentEditable({ value, onChange, placeholder, disabled, inline, minHeight, bodyClass, }: ContentEditableProps): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface IconProps {
|
|
4
|
+
name: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
'aria-hidden'?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Icon: React.FC<IconProps>;
|
|
11
|
+
export default Icon;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type PickerMediaType = 'image' | 'video' | 'audio';
|
|
4
|
+
export interface PickedAsset {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
thumbnail?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ImagePickerModalProps {
|
|
10
|
+
onSelect: (url: string, asset?: PickedAsset) => void;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
/** Asset type to browse/upload — labels and search filters follow. */
|
|
13
|
+
mediaType?: PickerMediaType;
|
|
14
|
+
}
|
|
15
|
+
export default function ImagePickerModal({ onSelect, onClose, mediaType }: ImagePickerModalProps): React.ReactPortal;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface MathModalProps {
|
|
4
|
+
/** Position of the Σ toolbar button — dropdown appears below it */
|
|
5
|
+
anchor: DOMRect;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
savedRange: Range | null;
|
|
8
|
+
}
|
|
9
|
+
export default function MathModal({ anchor, onClose, savedRange }: MathModalProps): React.ReactPortal;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
4
|
+
export interface ModalProps {
|
|
5
|
+
/** Title displayed in the modal header. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Controls visibility. */
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
/** Callback when the modal requests to close (X button or overlay click). */
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/** Body content. */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Footer content — typically action buttons. Omit to hide the footer bar. */
|
|
14
|
+
footer?: React.ReactNode;
|
|
15
|
+
/** Max-width variant of the card. Defaults to 'md'. */
|
|
16
|
+
size?: ModalSize;
|
|
17
|
+
/** Prevent closing when the overlay backdrop is clicked. Default false. */
|
|
18
|
+
disableOverlayClose?: boolean;
|
|
19
|
+
/** Prevent closing when Escape key is pressed. Default false. */
|
|
20
|
+
disableEscapeClose?: boolean;
|
|
21
|
+
/** DOM node to portal into. Defaults to document.body. */
|
|
22
|
+
container?: HTMLElement | null;
|
|
23
|
+
/** Additional CSS class applied to the card. */
|
|
24
|
+
cardClassName?: string;
|
|
25
|
+
/** aria-describedby id pointing to a description element inside the body. */
|
|
26
|
+
descriptionId?: string;
|
|
27
|
+
}
|
|
28
|
+
declare const Modal: React.FC<ModalProps>;
|
|
29
|
+
export default Modal;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface SpinnerProps {
|
|
5
|
+
/** Visual size of the spinner ring. Defaults to 'md'. */
|
|
6
|
+
size?: SpinnerSize;
|
|
7
|
+
/** Accessible label announced to screen readers. Defaults to 'Loading…'. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Additional CSS class applied to the wrapper. */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Inline styles applied to the wrapper. */
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
declare const Spinner: React.FC<SpinnerProps>;
|
|
15
|
+
export default Spinner;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface SpecialChar {
|
|
2
|
+
char: string;
|
|
3
|
+
title: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const SPECIAL_CHAR_GROUPS: Record<string, SpecialChar[]>;
|
|
6
|
+
export declare const ALL_CATEGORIES: readonly ["All", ...string[]];
|
|
7
|
+
export type CharCategory = typeof ALL_CATEGORIES[number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|