@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,10 @@
1
+ export declare function uploadCsvHierarchy(contentId: string, file: File): Promise<{
2
+ processId: string;
3
+ }>;
4
+ export declare function getCsvUploadStatus(processId: string): Promise<{
5
+ status: 'PENDING' | 'COMPLETED' | 'FAILED';
6
+ failedRecords?: unknown[];
7
+ successCount?: number;
8
+ }>;
9
+ export declare function exportFolderCsv(contentId: string): Promise<string>;
10
+ export declare function downloadSampleCsv(contentId: string): Promise<string>;
@@ -0,0 +1,45 @@
1
+ export interface ICategoryField {
2
+ code: string;
3
+ label: string;
4
+ name?: string;
5
+ inputType?: string;
6
+ dataType?: string;
7
+ required: boolean;
8
+ editable: boolean;
9
+ visible: boolean;
10
+ placeholder?: string;
11
+ maxLength?: number;
12
+ depends?: string[];
13
+ /** Framework category the field's options are sourced from (board/medium/…). */
14
+ sourceCategory?: string;
15
+ /** Raw range: string[] OR Array<{ name; identifier }>. */
16
+ range?: unknown;
17
+ enum?: string[];
18
+ default?: unknown;
19
+ defaultValue?: unknown;
20
+ index?: number;
21
+ /** Section title the field was grouped under (drives tab assignment). */
22
+ section?: string;
23
+ /** 'name' | 'identifier' — which term property to store as the value. */
24
+ output?: string;
25
+ [key: string]: unknown;
26
+ }
27
+ export interface IParsedCategoryDefinition {
28
+ rootForm: ICategoryField[];
29
+ unitForm: ICategoryField[];
30
+ childForm: ICategoryField[];
31
+ searchForm: ICategoryField[];
32
+ relationalForm: ICategoryField[];
33
+ publishChecklist: ICategoryField[];
34
+ reviewChecklist: ICategoryField[];
35
+ rfcChecklist: ICategoryField[];
36
+ /** schema.properties[*].default keyed by property name (generateDIALCodes, …). */
37
+ schemaDefaults: Record<string, unknown>;
38
+ frameworkMetadata: {
39
+ orgFWType?: string[];
40
+ targetFWType?: string[];
41
+ };
42
+ sourcingSettings: Record<string, unknown>;
43
+ }
44
+ export type ICategoryDefinitionField = ICategoryField;
45
+ export declare function getCategoryDefinition(categoryName: string, channel: string, objectType?: string): Promise<IParsedCategoryDefinition>;
@@ -0,0 +1,3 @@
1
+ export declare function setApiBaseUrl(url: string): void;
2
+ export declare const apiClient: import('axios').AxiosInstance;
3
+ export default apiClient;
@@ -0,0 +1,15 @@
1
+ import { IContent } from '../types/content';
2
+
3
+ export declare function compositeSearch(params: {
4
+ filters?: Record<string, unknown>;
5
+ query?: string;
6
+ limit?: number;
7
+ offset?: number;
8
+ fields?: string[];
9
+ channel?: string;
10
+ sortBy?: Record<string, string>;
11
+ }): Promise<{
12
+ content: IContent[];
13
+ count: number;
14
+ }>;
15
+ export declare function fetchContentDetails(contentId: string): Promise<IContent>;
@@ -0,0 +1,12 @@
1
+ export declare function checkDialCode(dialCode: string): Promise<unknown>;
2
+ export declare function linkDialCode(contentId: string, dialCode: string): Promise<unknown>;
3
+ export declare function reserveDialcodes(contentId: string, count: number): Promise<string>;
4
+ export declare function getDialcodeProcessStatus(processId: string): Promise<{
5
+ status: string;
6
+ zipFileName?: string;
7
+ dialcodes?: Array<{
8
+ identifier: string;
9
+ }>;
10
+ }>;
11
+ export declare function releaseDialcodes(_contentId: string, ids: string[]): Promise<void>;
12
+ export declare function unlinkDialcode(contentId: string): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { IFramework, ITerm } from '../types/framework';
2
+
3
+ export declare function getFramework(frameworkId: string): Promise<IFramework>;
4
+ export declare function searchTerms(frameworkId: string, categoryCode: string, query?: string): Promise<ITerm[]>;
@@ -0,0 +1,12 @@
1
+ import { INode } from '../types/editor';
2
+
3
+ export declare function readHierarchy(contentId: string): Promise<{
4
+ content: Record<string, unknown>;
5
+ rootNode: INode;
6
+ }>;
7
+ export declare function updateHierarchy(_contentId: string, nodesModified: Record<string, unknown>, hierarchy: Record<string, unknown>, lastUpdatedBy?: string): Promise<void>;
8
+ export declare function publishContent(contentId: string): Promise<void>;
9
+ export declare function readContent(contentId: string): Promise<Record<string, unknown>>;
10
+ export declare function sendForReview(contentId: string): Promise<void>;
11
+ export declare function rejectContent(contentId: string, comment: string): Promise<void>;
12
+ export declare function updateCollaborators(contentId: string, collaborators: string[]): Promise<void>;
@@ -0,0 +1,25 @@
1
+ export interface IUser {
2
+ identifier: string;
3
+ firstName: string;
4
+ lastName?: string;
5
+ email?: string;
6
+ userName?: string;
7
+ organisations?: Array<{
8
+ orgName?: string;
9
+ }>;
10
+ }
11
+ interface SearchOpts {
12
+ rootOrgId?: string;
13
+ limit?: number;
14
+ }
15
+ /**
16
+ * Search content-creator users by name/email. Mirrors the Sunbird collaborator
17
+ * search: restricts to CONTENT_CREATOR role and (optionally) the same org.
18
+ */
19
+ export declare function searchUsers(query: string, opts?: SearchOpts): Promise<IUser[]>;
20
+ /**
21
+ * Resolve a set of user identifiers to full user objects (used to render the
22
+ * content's existing collaborators by name rather than raw id).
23
+ */
24
+ export declare function getUsersByIds(ids: string[]): Promise<IUser[]>;
25
+ export {};