@imtf/dms-core 1.1.0-beta.0 → 1.1.0-beta.1

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.
@@ -15,7 +15,7 @@ import { InspectorProps } from "../Inspectors/types";
15
15
  import { Task } from "../Tasks/types";
16
16
  import { TYPES } from "./constants";
17
17
  import { useTaskCompletionDisabling } from "./hooks/tasks/useTaskCompletionDisabling";
18
- import { CategoryFilterProps, EntitiesWrapperProps, EntityDocumentsDocumentLabelProps, EntityDocumentsDocumentProps, EntityDocumentsTypeLabelProps, EntityEditModalEditForm, MdmEditorEntityRowActionsProps } from "./types/componentPlugins";
18
+ import { CategoryFilterProps, EntitiesWrapperProps, EntityDocumentsComponentProps, EntityDocumentsDocumentLabelProps, EntityDocumentsDocumentProps, EntityDocumentsTypeLabelProps, EntityEditModalEditForm, MdmEditorEntityRowActionsProps } from "./types/componentPlugins";
19
19
  type PLUGIN_TYPES = (typeof TYPES)[keyof typeof TYPES];
20
20
  declare const plugins: {
21
21
  [key in Exclude<PLUGIN_TYPES, "INSPECTOR" | "CONTEXT_MENU_ACTION">]: Record<string, Record<string, any>>;
@@ -228,6 +228,9 @@ declare class PluginRegistry {
228
228
  register(type: typeof TYPES.COMPONENT, name: "documentUpload/Filters", plugin: React.FC<CategoryFilterProps>, params?: {
229
229
  condition?: (props: CategoryFilterProps) => boolean;
230
230
  }): void;
231
+ register(type: typeof TYPES.COMPONENT, name: "entityDocuments/Section", plugin: React.FC<EntityDocumentsComponentProps>, params?: {
232
+ condition?: (props: EntityDocumentsComponentProps) => boolean;
233
+ }): void;
231
234
  register(type: typeof TYPES.COMPONENT, name: "entityDocuments/TypeLabel", plugin: React.FC<EntityDocumentsTypeLabelProps>, params?: {
232
235
  condition?: (props: EntityDocumentsTypeLabelProps) => boolean;
233
236
  }): void;
@@ -253,12 +256,12 @@ declare class PluginRegistry {
253
256
  type?: import("../Inodes/types").InodeType;
254
257
  properties?: any;
255
258
  types?: import("../Inodes/types").InodeType[];
256
- }) => Promise<null>;
259
+ }) => Promise<import("../Inodes/types").UploadResult[]>;
257
260
  promptUpdateBinary: (params: {
258
261
  accept?: string;
259
262
  target: string;
260
263
  updateInodeName?: boolean;
261
- }) => Promise<null>;
264
+ }) => Promise<import("../Inodes/types").UploadResult[]>;
262
265
  uploadIcosFiles: (params: {
263
266
  files: File[];
264
267
  caseOid?: string;
@@ -267,8 +270,8 @@ declare class PluginRegistry {
267
270
  fileProps?: Record<string, any>;
268
271
  fileInodes?: Inode[];
269
272
  types: import("../Inodes/types").InodeType[];
270
- }) => Promise<null>;
271
- updateBinary: (inodeOid: string, file: File, updateInodeName?: boolean | undefined) => Promise<null>;
273
+ }) => Promise<import("../Inodes/types").UploadResult[]>;
274
+ updateBinary: (inodeOid: string, file: File, updateInodeName?: boolean | undefined) => Promise<import("../Inodes/types").UploadResult[]>;
272
275
  };
273
276
  /**
274
277
  * As `getActions` and `triggerItems` as redefined after class instantiation,
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import React, { ReactNode } from "react";
2
2
  import { FormDefinition, MdmEditorDefinition } from "../../Definitions/types";
3
3
  import { Inode } from "../../Inodes/types";
4
4
  import { Entity } from "../../MdmGraph/types";
@@ -18,6 +18,15 @@ export type EntityEditModalEditForm = ComponentPluginProps<{
18
18
  entity: Entity;
19
19
  children: ReactNode;
20
20
  }>;
21
+ export type EntityDocumentsComponentProps = ComponentPluginProps<{
22
+ dropRef: React.Ref<HTMLElement>;
23
+ canDrop: () => boolean;
24
+ documentUploadButton?: ReactNode;
25
+ identifier?: string;
26
+ taskOid?: string;
27
+ caseOid?: string;
28
+ entityOid?: string;
29
+ }>;
21
30
  export type EntityDocumentsDocumentProps = ComponentPluginProps<{
22
31
  document: Inode<"dms-core.File">;
23
32
  disabled: boolean;
@@ -1,7 +1,7 @@
1
1
  import { ComponentType } from "react";
2
- import { Inode, InodeType } from "../Inodes/types";
2
+ import { Inode, InodeType, UploadResult } from "../Inodes/types";
3
3
  export type UploadContextType = {
4
- upload: (files: File[], targetInode: Inode, fileProps: Record<string, any>) => Promise<null>;
4
+ upload: (files: File[], targetInode: Inode, fileProps: Record<string, any>) => Promise<UploadResult[]>;
5
5
  icosUpload: (params: {
6
6
  files: File[];
7
7
  caseOid?: string;
@@ -10,8 +10,8 @@ export type UploadContextType = {
10
10
  fileProps?: Record<string, any>;
11
11
  fileInodes?: Inode[];
12
12
  types: InodeType[];
13
- }) => Promise<null>;
14
- updateBinary: (inodeOid: string, file: File, updateInodeName?: boolean) => Promise<null>;
13
+ }) => Promise<UploadResult[]>;
14
+ updateBinary: (inodeOid: string, file: File, updateInodeName?: boolean) => Promise<UploadResult[]>;
15
15
  promptGetFiles: (params: {
16
16
  accept?: string;
17
17
  multiple?: boolean;
@@ -23,12 +23,12 @@ export type UploadContextType = {
23
23
  expandItem?: boolean;
24
24
  type?: InodeType;
25
25
  properties?: any;
26
- }) => Promise<null>;
26
+ }) => Promise<UploadResult[]>;
27
27
  promptUpdateBinary: (params: {
28
28
  accept?: string;
29
29
  target: string;
30
30
  updateInodeName?: boolean;
31
- }) => Promise<null>;
31
+ }) => Promise<UploadResult[]>;
32
32
  promptIcosUpload: (params: {
33
33
  multiple?: boolean;
34
34
  accept?: string;
@@ -38,7 +38,7 @@ export type UploadContextType = {
38
38
  type?: InodeType;
39
39
  properties?: any;
40
40
  types?: InodeType[];
41
- }) => Promise<null>;
41
+ }) => Promise<UploadResult[]>;
42
42
  processes: Record<string, any>;
43
43
  clearCompletedProcesses: () => void;
44
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imtf/dms-core",
3
- "version": "1.1.0-beta.0",
3
+ "version": "1.1.0-beta.1",
4
4
  "description": "Typings for dms-core plugin system",
5
5
  "nonNpm": true
6
6
  }