@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.
Files changed (103) hide show
  1. package/dist/api/bulkUpload.d.ts +10 -0
  2. package/dist/api/categoryDefinition.d.ts +45 -0
  3. package/dist/api/client.d.ts +3 -0
  4. package/dist/api/content.d.ts +15 -0
  5. package/dist/api/dialcode.d.ts +12 -0
  6. package/dist/api/framework.d.ts +4 -0
  7. package/dist/api/hierarchy.d.ts +12 -0
  8. package/dist/api/user.d.ts +25 -0
  9. package/dist/collection-editor.umd.js +466 -0
  10. package/dist/components/AssetBrowser/AssetBrowser.d.ts +9 -0
  11. package/dist/components/AssetBrowser/index.d.ts +1 -0
  12. package/dist/components/AssignPageNumber/AssignPageNumber.d.ts +8 -0
  13. package/dist/components/AssignPageNumber/index.d.ts +1 -0
  14. package/dist/components/BulkUpload/CsvUpload.d.ts +10 -0
  15. package/dist/components/BulkUpload/index.d.ts +1 -0
  16. package/dist/components/Collaborators/ManageCollaborators.d.ts +8 -0
  17. package/dist/components/Collaborators/index.d.ts +1 -0
  18. package/dist/components/CollectionEditor/CollectionEditor.d.ts +5 -0
  19. package/dist/components/CollectionEditor/index.d.ts +2 -0
  20. package/dist/components/ContentPlayer/ContentPlayer.d.ts +10 -0
  21. package/dist/components/ContentPlayer/index.d.ts +1 -0
  22. package/dist/components/ContextualEditor/Breadcrumb.d.ts +10 -0
  23. package/dist/components/ContextualEditor/ContentEditForm.d.ts +11 -0
  24. package/dist/components/ContextualEditor/ContextualEditor.d.ts +12 -0
  25. package/dist/components/ContextualEditor/TabBar.d.ts +21 -0
  26. package/dist/components/ContextualEditor/TitleAppIcon.d.ts +9 -0
  27. package/dist/components/ContextualEditor/index.d.ts +1 -0
  28. package/dist/components/Dialcode/DialcodePanel.d.ts +10 -0
  29. package/dist/components/Dialcode/index.d.ts +1 -0
  30. package/dist/components/LibraryDock/FilterChips.d.ts +13 -0
  31. package/dist/components/LibraryDock/LibraryCard.d.ts +12 -0
  32. package/dist/components/LibraryDock/LibraryDock.d.ts +10 -0
  33. package/dist/components/LibraryDock/LibraryFilterPanel.d.ts +19 -0
  34. package/dist/components/LibraryDock/LibraryPreviewPanel.d.ts +10 -0
  35. package/dist/components/LibraryDock/index.d.ts +1 -0
  36. package/dist/components/OutlineTree/OutlineTree.d.ts +10 -0
  37. package/dist/components/OutlineTree/TreeNode.d.ts +9 -0
  38. package/dist/components/OutlineTree/index.d.ts +1 -0
  39. package/dist/components/ProgressStatus/ProgressStatus.d.ts +12 -0
  40. package/dist/components/ProgressStatus/index.d.ts +1 -0
  41. package/dist/components/ResourceReorder/ResourceReorderDialog.d.ts +10 -0
  42. package/dist/components/ResourceReorder/index.d.ts +1 -0
  43. package/dist/components/SparkMetaForm/FormSection.d.ts +9 -0
  44. package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +14 -0
  45. package/dist/components/SparkMetaForm/fields/AppIconField.d.ts +11 -0
  46. package/dist/components/SparkMetaForm/fields/AppIconPickerModal.d.ts +10 -0
  47. package/dist/components/SparkMetaForm/fields/ChipGroupField.d.ts +11 -0
  48. package/dist/components/SparkMetaForm/fields/DateTimeField.d.ts +10 -0
  49. package/dist/components/SparkMetaForm/fields/DialcodeInputField.d.ts +10 -0
  50. package/dist/components/SparkMetaForm/fields/KeywordSuggestField.d.ts +10 -0
  51. package/dist/components/SparkMetaForm/fields/LicenseSelectField.d.ts +10 -0
  52. package/dist/components/SparkMetaForm/fields/MultiSelectField.d.ts +15 -0
  53. package/dist/components/SparkMetaForm/fields/NestedSelectField.d.ts +20 -0
  54. package/dist/components/SparkMetaForm/fields/RadioField.d.ts +15 -0
  55. package/dist/components/SparkMetaForm/fields/SelectField.d.ts +15 -0
  56. package/dist/components/SparkMetaForm/fields/TextField.d.ts +13 -0
  57. package/dist/components/SparkMetaForm/fields/index.d.ts +11 -0
  58. package/dist/components/SparkMetaForm/hooks/index.d.ts +3 -0
  59. package/dist/components/SparkMetaForm/hooks/useCascade.d.ts +16 -0
  60. package/dist/components/SparkMetaForm/hooks/useFieldPrepare.d.ts +42 -0
  61. package/dist/components/SparkMetaForm/index.d.ts +1 -0
  62. package/dist/components/SplitBuilderShell/SplitBuilderShell.d.ts +14 -0
  63. package/dist/components/SplitBuilderShell/index.d.ts +1 -0
  64. package/dist/components/Topbar/Topbar.d.ts +15 -0
  65. package/dist/components/Topbar/index.d.ts +1 -0
  66. package/dist/components/UnitContentList/ContentRow.d.ts +10 -0
  67. package/dist/components/UnitContentList/UnitContentList.d.ts +8 -0
  68. package/dist/components/UnitContentList/index.d.ts +1 -0
  69. package/dist/components/modals/ConfirmDialog.d.ts +13 -0
  70. package/dist/components/modals/PublishChecklist.d.ts +9 -0
  71. package/dist/components/modals/QualityParamsModal.d.ts +10 -0
  72. package/dist/components/modals/index.d.ts +3 -0
  73. package/dist/components/shared/Button.d.ts +14 -0
  74. package/dist/components/shared/Card.d.ts +9 -0
  75. package/dist/components/shared/Chip.d.ts +12 -0
  76. package/dist/components/shared/DropZone.d.ts +10 -0
  77. package/dist/components/shared/Spinner.d.ts +8 -0
  78. package/dist/components/shared/index.d.ts +5 -0
  79. package/dist/dev-main.d.ts +1 -0
  80. package/dist/hooks/index.d.ts +9 -0
  81. package/dist/hooks/useContentType.d.ts +18 -0
  82. package/dist/hooks/useEditorInit.d.ts +12 -0
  83. package/dist/hooks/useFramework.d.ts +5 -0
  84. package/dist/hooks/useLibrary.d.ts +24 -0
  85. package/dist/hooks/useSaveHierarchy.d.ts +6 -0
  86. package/dist/hooks/useTelemetry.d.ts +13 -0
  87. package/dist/hooks/useTree.d.ts +23 -0
  88. package/dist/index.cjs +466 -0
  89. package/dist/index.d.ts +8 -0
  90. package/dist/index.js +20941 -0
  91. package/dist/store/editor.store.d.ts +47 -0
  92. package/dist/store/index.d.ts +3 -0
  93. package/dist/store/library.store.d.ts +25 -0
  94. package/dist/store/tree.store.d.ts +31 -0
  95. package/dist/store/ui.store.d.ts +9 -0
  96. package/dist/style.css +1 -0
  97. package/dist/types/content.d.ts +43 -0
  98. package/dist/types/editor.d.ts +86 -0
  99. package/dist/types/framework.d.ts +23 -0
  100. package/dist/types/index.d.ts +3 -0
  101. package/dist/utils/telemetry.d.ts +18 -0
  102. package/dist/web-component/register.d.ts +1 -0
  103. 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,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface PublishChecklistProps {
4
+ contentId: string;
5
+ onConfirm: () => void;
6
+ onCancel: () => void;
7
+ }
8
+ export declare const PublishChecklist: React.FC<PublishChecklistProps>;
9
+ 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,3 @@
1
+ export { PublishChecklist } from './PublishChecklist';
2
+ export { QualityParamsModal } from './QualityParamsModal';
3
+ export { ConfirmDialog } from './ConfirmDialog';
@@ -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,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface CardProps {
4
+ className?: string;
5
+ children: React.ReactNode;
6
+ onClick?: () => void;
7
+ }
8
+ export declare const Card: React.FC<CardProps>;
9
+ 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,10 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface DropZoneProps {
4
+ isActive: boolean;
5
+ label?: string;
6
+ nodeId?: string;
7
+ className?: string;
8
+ }
9
+ export declare const DropZone: React.FC<DropZoneProps>;
10
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface SpinnerProps {
4
+ size?: number;
5
+ color?: string;
6
+ }
7
+ export declare const Spinner: React.FC<SpinnerProps>;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ export { Chip } from './Chip';
2
+ export { Spinner } from './Spinner';
3
+ export { Button } from './Button';
4
+ export { Card } from './Card';
5
+ export { DropZone } from './DropZone';
@@ -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,5 @@
1
+ import { IFrameworkDetails } from '../types/framework';
2
+
3
+ export declare function useFramework(frameworkId?: string, targetFWIds?: string[]): IFrameworkDetails & {
4
+ isLoading: boolean;
5
+ };
@@ -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,6 @@
1
+ export declare function useSaveHierarchy(): {
2
+ save: () => Promise<void>;
3
+ isSaving: boolean;
4
+ isDirty: boolean;
5
+ lastSaved: string | null;
6
+ };
@@ -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;