@project-sunbird/collection-editor-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/bulkUpload.d.ts +10 -0
- package/dist/api/categoryDefinition.d.ts +45 -0
- package/dist/api/client.d.ts +3 -0
- package/dist/api/content.d.ts +15 -0
- package/dist/api/dialcode.d.ts +12 -0
- package/dist/api/framework.d.ts +4 -0
- package/dist/api/hierarchy.d.ts +12 -0
- package/dist/api/user.d.ts +25 -0
- package/dist/collection-editor.umd.js +466 -0
- package/dist/components/AssetBrowser/AssetBrowser.d.ts +9 -0
- package/dist/components/AssetBrowser/index.d.ts +1 -0
- package/dist/components/AssignPageNumber/AssignPageNumber.d.ts +8 -0
- package/dist/components/AssignPageNumber/index.d.ts +1 -0
- package/dist/components/BulkUpload/CsvUpload.d.ts +10 -0
- package/dist/components/BulkUpload/index.d.ts +1 -0
- package/dist/components/Collaborators/ManageCollaborators.d.ts +8 -0
- package/dist/components/Collaborators/index.d.ts +1 -0
- package/dist/components/CollectionEditor/CollectionEditor.d.ts +5 -0
- package/dist/components/CollectionEditor/index.d.ts +2 -0
- package/dist/components/ContentPlayer/ContentPlayer.d.ts +10 -0
- package/dist/components/ContentPlayer/index.d.ts +1 -0
- package/dist/components/ContextualEditor/Breadcrumb.d.ts +10 -0
- package/dist/components/ContextualEditor/ContentEditForm.d.ts +11 -0
- package/dist/components/ContextualEditor/ContextualEditor.d.ts +12 -0
- package/dist/components/ContextualEditor/TabBar.d.ts +21 -0
- package/dist/components/ContextualEditor/TitleAppIcon.d.ts +9 -0
- package/dist/components/ContextualEditor/index.d.ts +1 -0
- package/dist/components/Dialcode/DialcodePanel.d.ts +10 -0
- package/dist/components/Dialcode/index.d.ts +1 -0
- package/dist/components/LibraryDock/FilterChips.d.ts +13 -0
- package/dist/components/LibraryDock/LibraryCard.d.ts +12 -0
- package/dist/components/LibraryDock/LibraryDock.d.ts +10 -0
- package/dist/components/LibraryDock/LibraryFilterPanel.d.ts +19 -0
- package/dist/components/LibraryDock/LibraryPreviewPanel.d.ts +10 -0
- package/dist/components/LibraryDock/index.d.ts +1 -0
- package/dist/components/OutlineTree/OutlineTree.d.ts +10 -0
- package/dist/components/OutlineTree/TreeNode.d.ts +9 -0
- package/dist/components/OutlineTree/index.d.ts +1 -0
- package/dist/components/ProgressStatus/ProgressStatus.d.ts +12 -0
- package/dist/components/ProgressStatus/index.d.ts +1 -0
- package/dist/components/ResourceReorder/ResourceReorderDialog.d.ts +10 -0
- package/dist/components/ResourceReorder/index.d.ts +1 -0
- package/dist/components/SparkMetaForm/FormSection.d.ts +9 -0
- package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +14 -0
- package/dist/components/SparkMetaForm/fields/AppIconField.d.ts +11 -0
- package/dist/components/SparkMetaForm/fields/AppIconPickerModal.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/ChipGroupField.d.ts +11 -0
- package/dist/components/SparkMetaForm/fields/DateTimeField.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/DialcodeInputField.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/KeywordSuggestField.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/LicenseSelectField.d.ts +10 -0
- package/dist/components/SparkMetaForm/fields/MultiSelectField.d.ts +15 -0
- package/dist/components/SparkMetaForm/fields/NestedSelectField.d.ts +20 -0
- package/dist/components/SparkMetaForm/fields/RadioField.d.ts +15 -0
- package/dist/components/SparkMetaForm/fields/SelectField.d.ts +15 -0
- package/dist/components/SparkMetaForm/fields/TextField.d.ts +13 -0
- package/dist/components/SparkMetaForm/fields/index.d.ts +11 -0
- package/dist/components/SparkMetaForm/hooks/index.d.ts +3 -0
- package/dist/components/SparkMetaForm/hooks/useCascade.d.ts +16 -0
- package/dist/components/SparkMetaForm/hooks/useFieldPrepare.d.ts +42 -0
- package/dist/components/SparkMetaForm/index.d.ts +1 -0
- package/dist/components/SplitBuilderShell/SplitBuilderShell.d.ts +14 -0
- package/dist/components/SplitBuilderShell/index.d.ts +1 -0
- package/dist/components/Topbar/Topbar.d.ts +15 -0
- package/dist/components/Topbar/index.d.ts +1 -0
- package/dist/components/UnitContentList/ContentRow.d.ts +10 -0
- package/dist/components/UnitContentList/UnitContentList.d.ts +8 -0
- package/dist/components/UnitContentList/index.d.ts +1 -0
- package/dist/components/modals/ConfirmDialog.d.ts +13 -0
- package/dist/components/modals/PublishChecklist.d.ts +9 -0
- package/dist/components/modals/QualityParamsModal.d.ts +10 -0
- package/dist/components/modals/index.d.ts +3 -0
- package/dist/components/shared/Button.d.ts +14 -0
- package/dist/components/shared/Card.d.ts +9 -0
- package/dist/components/shared/Chip.d.ts +12 -0
- package/dist/components/shared/DropZone.d.ts +10 -0
- package/dist/components/shared/Spinner.d.ts +8 -0
- package/dist/components/shared/index.d.ts +5 -0
- package/dist/dev-main.d.ts +1 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/useContentType.d.ts +18 -0
- package/dist/hooks/useEditorInit.d.ts +12 -0
- package/dist/hooks/useFramework.d.ts +5 -0
- package/dist/hooks/useLibrary.d.ts +24 -0
- package/dist/hooks/useSaveHierarchy.d.ts +6 -0
- package/dist/hooks/useTelemetry.d.ts +13 -0
- package/dist/hooks/useTree.d.ts +23 -0
- package/dist/index.cjs +466 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +20941 -0
- package/dist/store/editor.store.d.ts +47 -0
- package/dist/store/index.d.ts +3 -0
- package/dist/store/library.store.d.ts +25 -0
- package/dist/store/tree.store.d.ts +31 -0
- package/dist/store/ui.store.d.ts +9 -0
- package/dist/style.css +1 -0
- package/dist/types/content.d.ts +43 -0
- package/dist/types/editor.d.ts +86 -0
- package/dist/types/framework.d.ts +23 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/utils/telemetry.d.ts +18 -0
- package/dist/web-component/register.d.ts +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ConfirmDialogProps {
|
|
4
|
+
title: string;
|
|
5
|
+
message: React.ReactNode;
|
|
6
|
+
confirmLabel?: string;
|
|
7
|
+
cancelLabel?: string;
|
|
8
|
+
variant?: 'primary' | 'danger';
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const ConfirmDialog: React.FC<ConfirmDialogProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface QualityParamsModalProps {
|
|
4
|
+
contentId: string;
|
|
5
|
+
action: 'approve' | 'reject';
|
|
6
|
+
onConfirm: (comment: string, score?: number) => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const QualityParamsModal: React.FC<QualityParamsModalProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ButtonProps {
|
|
4
|
+
variant?: 'primary' | 'ghost' | 'danger';
|
|
5
|
+
size?: 'sm' | 'md';
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
|
+
}
|
|
13
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ChipProps {
|
|
4
|
+
variant?: 'filled' | 'outline';
|
|
5
|
+
active?: boolean;
|
|
6
|
+
onRemove?: () => void;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const Chip: React.FC<ChipProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { useEditorInit } from './useEditorInit';
|
|
2
|
+
export { useTree } from './useTree';
|
|
3
|
+
export type { UseTreeReturn } from './useTree';
|
|
4
|
+
export { useFramework } from './useFramework';
|
|
5
|
+
export { useLibrary } from './useLibrary';
|
|
6
|
+
export { useSaveHierarchy } from './useSaveHierarchy';
|
|
7
|
+
export { useContentType, getCtStyle } from './useContentType';
|
|
8
|
+
export type { CtStyle } from './useContentType';
|
|
9
|
+
export { useTelemetry } from './useTelemetry';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { INode } from '../types/editor';
|
|
2
|
+
import { IContent } from '../types/content';
|
|
3
|
+
|
|
4
|
+
type ContentLike = Partial<INode> | Partial<IContent>;
|
|
5
|
+
export interface CtStyle {
|
|
6
|
+
key: string;
|
|
7
|
+
color: string;
|
|
8
|
+
bgClass: string;
|
|
9
|
+
badgeClass: string;
|
|
10
|
+
tintClass: string;
|
|
11
|
+
iconName: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function getCtStyle(item: ContentLike): CtStyle;
|
|
15
|
+
export declare function useContentType(): {
|
|
16
|
+
getCtStyle: typeof getCtStyle;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -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,24 @@
|
|
|
1
|
+
import { LibraryFilters } from '../components/LibraryDock/LibraryFilterPanel';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns allowed primaryCategory values for the currently selected unit,
|
|
5
|
+
* driven by editorConfig.config.hierarchy.levelN.children.Content.
|
|
6
|
+
* Falls back to the full LIBRARY_PRIMARY_CATEGORIES constant.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useAllowedCategories(): string[];
|
|
9
|
+
export declare function useLibrary(): {
|
|
10
|
+
content: import('..').IContent[];
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
totalCount: number;
|
|
13
|
+
activeFilter: string;
|
|
14
|
+
advancedFilters: LibraryFilters;
|
|
15
|
+
searchQuery: string;
|
|
16
|
+
sortAZ: boolean;
|
|
17
|
+
hasMore: boolean;
|
|
18
|
+
search: (query: string) => void;
|
|
19
|
+
setFilter: (filter: string) => void;
|
|
20
|
+
applyAdvancedFilters: (advancedFilters: LibraryFilters) => void;
|
|
21
|
+
toggleSort: () => void;
|
|
22
|
+
loadMore: () => void;
|
|
23
|
+
refetch: () => Promise<void>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface EData {
|
|
2
|
+
type: string;
|
|
3
|
+
subtype?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
pageid?: string;
|
|
6
|
+
[k: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare function useTelemetry(): {
|
|
9
|
+
interact: (edata: EData) => void;
|
|
10
|
+
impression: (edata: EData) => void;
|
|
11
|
+
error: (edata: EData) => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { INode } from '../types/editor';
|
|
2
|
+
import { IContent } from '../types/content';
|
|
3
|
+
|
|
4
|
+
export interface UseTreeReturn {
|
|
5
|
+
treeData: INode[];
|
|
6
|
+
selectedNode: INode | undefined;
|
|
7
|
+
selectedNodeId: string | null;
|
|
8
|
+
breadcrumb: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}>;
|
|
12
|
+
isFolder: boolean;
|
|
13
|
+
isRoot: boolean;
|
|
14
|
+
children: INode[];
|
|
15
|
+
addNode: (parentId: string, type: 'unit' | 'subunit') => string;
|
|
16
|
+
deleteNode: (id: string) => void;
|
|
17
|
+
addResource: (content: IContent, nodeId: string) => void;
|
|
18
|
+
reorderChildren: (parentId: string, fromIndex: number, toIndex: number) => void;
|
|
19
|
+
updateNode: (id: string, patch: Record<string, unknown>) => void;
|
|
20
|
+
getNodeById: (id: string) => INode | undefined;
|
|
21
|
+
selectNode: (id: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function useTree(): UseTreeReturn;
|