@overmap-ai/core 1.0.43-projects-licensing.5 → 1.0.43-tiptap.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.
- package/README.md +4 -4
- package/dist/overmap-core.js +567 -122
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +567 -122
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AttachmentService.d.ts +30 -8
- package/dist/store/slices/componentSlice.d.ts +34 -2
- package/dist/store/slices/componentTypeSlice.d.ts +34 -2
- package/dist/store/slices/issueSlice.d.ts +26 -6
- package/dist/store/slices/utils.d.ts +12 -0
- package/dist/typings/models/attachments.d.ts +14 -7
- package/package.json +151 -151
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
import { BaseApiService } from "./BaseApiService";
|
|
2
|
-
import type {
|
|
3
|
-
import { IssueAttachment, MaybeObjectURL,
|
|
2
|
+
import type { OptimisticModelResult } from "../typings";
|
|
3
|
+
import { ComponentAttachment, ComponentTypeAttachment, Created, IssueAttachment, MaybeObjectURL, AttachmentPayload, Stored } from "../../typings";
|
|
4
4
|
/**
|
|
5
5
|
* Handles creation and caching of attachments
|
|
6
6
|
*/
|
|
7
|
+
interface StoredAttachments {
|
|
8
|
+
issue_attachments: Stored<IssueAttachment>[];
|
|
9
|
+
component_attachments: Stored<ComponentAttachment>[];
|
|
10
|
+
component_type_attachments: Stored<ComponentTypeAttachment>[];
|
|
11
|
+
}
|
|
12
|
+
interface CreatedAttachments {
|
|
13
|
+
issue_attachments: Created<IssueAttachment>[];
|
|
14
|
+
component_attachments: Created<ComponentAttachment>[];
|
|
15
|
+
component_type_attachments: Created<ComponentTypeAttachment>[];
|
|
16
|
+
}
|
|
7
17
|
export declare class AttachmentService extends BaseApiService {
|
|
8
|
-
fetchAll(projectId: number):
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
fetchAll(projectId: number): [StoredAttachments, Promise<CreatedAttachments>];
|
|
19
|
+
addIssueAttachment(attachmentPayload: AttachmentPayload<IssueAttachment>): Promise<OptimisticModelResult<IssueAttachment>>;
|
|
20
|
+
addComponentAttachment(attachmentPayload: AttachmentPayload<ComponentAttachment>): Promise<OptimisticModelResult<ComponentAttachment>>;
|
|
21
|
+
addComponentTypeAttachment(attachmentPayload: AttachmentPayload<ComponentTypeAttachment>): Promise<OptimisticModelResult<ComponentTypeAttachment>>;
|
|
22
|
+
/** the outer Promise is needed to await the hashing of each file, which is required before offline use. If wanting to
|
|
23
|
+
* attach promise handlers to the request to add the attachment in the backend, apply it on the promise returned from the
|
|
24
|
+
* OptimisticModelResult. */
|
|
25
|
+
attachFilesToIssue(filesToSubmit: File[], issueId: string): Promise<OptimisticModelResult<IssueAttachment>>[];
|
|
26
|
+
attachFilesToComponent(filesToSubmit: File[], componentId: string): Promise<OptimisticModelResult<ComponentAttachment>>[];
|
|
27
|
+
attachFilesToComponentType(filesToSubmit: File[], componentTypeId: string): Promise<OptimisticModelResult<ComponentTypeAttachment>>[];
|
|
28
|
+
replaceIssueAttachmentFile(attachmentId: string, newFile: MaybeObjectURL<File>): Promise<OptimisticModelResult<IssueAttachment>>;
|
|
29
|
+
replaceComponentAttachmentFile(attachmentId: string, newFile: MaybeObjectURL<File>): Promise<OptimisticModelResult<ComponentAttachment>>;
|
|
30
|
+
replaceComponentTypeAttachmentFile(attachmentId: string, newFile: MaybeObjectURL<File>): Promise<OptimisticModelResult<ComponentTypeAttachment>>;
|
|
12
31
|
/**
|
|
13
32
|
* Deletes an attachment and associated data in the cloud, in the Redux store and the cache.
|
|
14
|
-
* @param
|
|
33
|
+
* @param issueAttachmentId
|
|
15
34
|
*/
|
|
16
|
-
|
|
35
|
+
deleteIssueAttachment(issueAttachmentId: string): Promise<undefined>;
|
|
36
|
+
deleteComponentAttachment(componentAttachmentId: string): Promise<undefined>;
|
|
37
|
+
deleteComponentTypeAttachment(componentTypeAttachmentId: string): Promise<undefined>;
|
|
17
38
|
}
|
|
39
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PayloadAction, Reducer } from "@reduxjs/toolkit";
|
|
2
|
-
import { Component, ComponentType, RootState, Selector, SelectorWithArgs, Submitted } from "../../typings";
|
|
2
|
+
import { Component, ComponentAttachment, ComponentType, RootState, Selector, SelectorWithArgs, Stored, Submitted } from "../../typings";
|
|
3
3
|
export interface ComponentState {
|
|
4
4
|
components: Record<string, Component | Submitted<Component>>;
|
|
5
|
+
attachments: Record<string, Stored<ComponentAttachment>>;
|
|
5
6
|
}
|
|
6
7
|
export declare const componentSlice: import("@reduxjs/toolkit").Slice<ComponentState, {
|
|
7
8
|
addComponent: (state: import("immer/dist/internal.js").WritableDraft<ComponentState>, action: {
|
|
@@ -13,6 +14,30 @@ export declare const componentSlice: import("@reduxjs/toolkit").Slice<ComponentS
|
|
|
13
14
|
setComponents: (state: import("immer/dist/internal.js").WritableDraft<ComponentState>, action: {
|
|
14
15
|
payload: Component[];
|
|
15
16
|
}) => void;
|
|
17
|
+
setComponentAttachments: (state: ComponentState, action: {
|
|
18
|
+
payload: import('../../typings/models/issues.ts').Created<ComponentAttachment>[];
|
|
19
|
+
type: string;
|
|
20
|
+
}) => void;
|
|
21
|
+
addComponentAttachment: (state: ComponentState, action: {
|
|
22
|
+
payload: Submitted<ComponentAttachment>;
|
|
23
|
+
type: string;
|
|
24
|
+
}) => void;
|
|
25
|
+
addComponentAttachments: (state: ComponentState, action: {
|
|
26
|
+
payload: Submitted<ComponentAttachment>[];
|
|
27
|
+
type: string;
|
|
28
|
+
}) => void;
|
|
29
|
+
updateComponentAttachment: (state: ComponentState, action: {
|
|
30
|
+
payload: Submitted<ComponentAttachment>;
|
|
31
|
+
type: string;
|
|
32
|
+
}) => void;
|
|
33
|
+
removeComponentAttachment: (state: ComponentState, action: {
|
|
34
|
+
payload: string;
|
|
35
|
+
type: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
removeComponentAttachments: (state: ComponentState, action: {
|
|
38
|
+
payload: string[];
|
|
39
|
+
type: string;
|
|
40
|
+
}) => void;
|
|
16
41
|
updateComponent: (state: import("immer/dist/internal.js").WritableDraft<ComponentState>, action: {
|
|
17
42
|
payload: Component;
|
|
18
43
|
}) => void;
|
|
@@ -27,5 +52,12 @@ export declare const selectComponentTypeFromComponents: Selector<Record<string,
|
|
|
27
52
|
export declare const selectComponentsByType: SelectorWithArgs<string, Component[]>;
|
|
28
53
|
export declare const selectNumberOfComponentsOfComponentType: SelectorWithArgs<string | undefined, number>;
|
|
29
54
|
export declare const selectComponentTypesFromIds: SelectorWithArgs<string[], ComponentType[]>;
|
|
30
|
-
export declare const
|
|
55
|
+
export declare const selectComponentAttachmentMapping: (state: RootState) => Record<string, Stored<ComponentAttachment>>;
|
|
56
|
+
export declare const selectAllComponentAttachments: Selector<Stored<ComponentAttachment>[]>;
|
|
57
|
+
export declare const selectAttachmentsOfComponent: (args: string) => (state: RootState) => Stored<ComponentAttachment>[];
|
|
58
|
+
export declare const selectAttachmentsOfComponentByType: (args: string) => (state: RootState) => {
|
|
59
|
+
fileAttachments: Stored<ComponentAttachment>[];
|
|
60
|
+
imageAttachments: Stored<ComponentAttachment>[];
|
|
61
|
+
};
|
|
62
|
+
export declare const addComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<Component, "components/addComponent">, updateComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<Component, "components/updateComponent">, removeComponent: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "components/removeComponent">, addComponentsInBatches: import("@reduxjs/toolkit").ActionCreatorWithPayload<(Component | Submitted<Component>)[], "components/addComponentsInBatches">, setComponents: import("@reduxjs/toolkit").ActionCreatorWithPayload<Component[], "components/setComponents">, setComponentAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Created<ComponentAttachment>[], "components/setComponentAttachments">, addComponentAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<ComponentAttachment>, "components/addComponentAttachment">, addComponentAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<ComponentAttachment>[], "components/addComponentAttachments">, updateComponentAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<ComponentAttachment>, "components/updateComponentAttachment">, removeComponentAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "components/removeComponentAttachment">, removeComponentAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "components/removeComponentAttachments">, removeAllComponentsOfType: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "components/removeAllComponentsOfType">;
|
|
31
63
|
export declare const componentReducer: Reducer<ComponentState>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Reducer } from "@reduxjs/toolkit";
|
|
2
|
-
import type { ComponentType, RootState, SelectorWithArgs } from "../../typings";
|
|
2
|
+
import type { ComponentType, ComponentTypeAttachment, RootState, Selector, SelectorWithArgs, Stored } from "../../typings";
|
|
3
3
|
export interface ComponentTypeState {
|
|
4
4
|
componentTypes: Record<string, ComponentType>;
|
|
5
5
|
hiddenComponentTypeIds: Record<string, boolean>;
|
|
6
|
+
attachments: Record<string, ComponentTypeAttachment>;
|
|
6
7
|
}
|
|
7
8
|
export declare const componentTypeSlice: import("@reduxjs/toolkit").Slice<ComponentTypeState, {
|
|
8
9
|
addComponentType: (state: import("immer/dist/internal.js").WritableDraft<ComponentTypeState>, action: {
|
|
@@ -11,6 +12,30 @@ export declare const componentTypeSlice: import("@reduxjs/toolkit").Slice<Compon
|
|
|
11
12
|
setComponentTypes: (state: import("immer/dist/internal.js").WritableDraft<ComponentTypeState>, action: {
|
|
12
13
|
payload: ComponentType[];
|
|
13
14
|
}) => void;
|
|
15
|
+
setComponentTypeAttachments: (state: ComponentTypeState, action: {
|
|
16
|
+
payload: import('../../typings/models/issues.ts').Created<ComponentTypeAttachment>[];
|
|
17
|
+
type: string;
|
|
18
|
+
}) => void;
|
|
19
|
+
addComponentTypeAttachment: (state: ComponentTypeState, action: {
|
|
20
|
+
payload: import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>;
|
|
21
|
+
type: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
addComponentTypeAttachments: (state: ComponentTypeState, action: {
|
|
24
|
+
payload: import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>[];
|
|
25
|
+
type: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
updateComponentTypeAttachment: (state: ComponentTypeState, action: {
|
|
28
|
+
payload: import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>;
|
|
29
|
+
type: string;
|
|
30
|
+
}) => void;
|
|
31
|
+
removeComponentTypeAttachment: (state: ComponentTypeState, action: {
|
|
32
|
+
payload: string;
|
|
33
|
+
type: string;
|
|
34
|
+
}) => void;
|
|
35
|
+
removeComponentTypeAttachments: (state: ComponentTypeState, action: {
|
|
36
|
+
payload: string[];
|
|
37
|
+
type: string;
|
|
38
|
+
}) => void;
|
|
14
39
|
toggleComponentTypeVisibility: (state: import("immer/dist/internal.js").WritableDraft<ComponentTypeState>, action: {
|
|
15
40
|
payload: string;
|
|
16
41
|
}) => void;
|
|
@@ -29,6 +54,13 @@ interface selectNumberOfComponentTypesMatchingCaseInsensitiveNameProps {
|
|
|
29
54
|
export declare const selectNumberOfComponentTypesMatchingCaseInsensitiveName: SelectorWithArgs<selectNumberOfComponentTypesMatchingCaseInsensitiveNameProps, number>;
|
|
30
55
|
export declare const selectComponentTypesByName: SelectorWithArgs<string, ComponentType[]>;
|
|
31
56
|
export declare const selectHiddenComponentTypeIds: AppSelector<Record<string, boolean | undefined>>;
|
|
32
|
-
export declare const
|
|
57
|
+
export declare const selectComponentTypeAttachmentMapping: (state: RootState) => Record<string, ComponentTypeAttachment>;
|
|
58
|
+
export declare const selectAllComponentTypeAttachments: Selector<Stored<ComponentTypeAttachment>[]>;
|
|
59
|
+
export declare const selectAttachmentsOfComponentType: (args: string) => (state: RootState) => Stored<ComponentTypeAttachment>[];
|
|
60
|
+
export declare const selectAttachmentsOfComponentTypeByType: (args: string) => (state: RootState) => {
|
|
61
|
+
fileAttachments: Stored<ComponentTypeAttachment>[];
|
|
62
|
+
imageAttachments: Stored<ComponentTypeAttachment>[];
|
|
63
|
+
};
|
|
64
|
+
export declare const addComponentType: import("@reduxjs/toolkit").ActionCreatorWithPayload<ComponentType, "componentTypes/addComponentType">, setComponentTypes: import("@reduxjs/toolkit").ActionCreatorWithPayload<ComponentType[], "componentTypes/setComponentTypes">, setComponentTypeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Created<ComponentTypeAttachment>[], "componentTypes/setComponentTypeAttachments">, addComponentTypeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>, "componentTypes/addComponentTypeAttachment">, addComponentTypeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>[], "componentTypes/addComponentTypeAttachments">, updateComponentTypeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<import('../../typings/models/issues.ts').Submitted<ComponentTypeAttachment>, "componentTypes/updateComponentTypeAttachment">, removeComponentTypeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "componentTypes/removeComponentTypeAttachment">, removeComponentTypeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "componentTypes/removeComponentTypeAttachments">, toggleComponentTypeVisibility: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "componentTypes/toggleComponentTypeVisibility">, deleteComponentType: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "componentTypes/deleteComponentType">;
|
|
33
65
|
export declare const componentTypeReducer: Reducer<ComponentTypeState>;
|
|
34
66
|
export {};
|
|
@@ -24,21 +24,36 @@ export declare const issueSlice: import("@reduxjs/toolkit").Slice<IssueState, {
|
|
|
24
24
|
setIssues: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
|
|
25
25
|
payload: Created<Issue>[];
|
|
26
26
|
}) => void;
|
|
27
|
-
|
|
27
|
+
setIssueAttachments: (state: IssueState, action: {
|
|
28
|
+
payload: Created<IssueAttachment>[];
|
|
29
|
+
type: string;
|
|
30
|
+
}) => void;
|
|
28
31
|
setActiveIssueId: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
|
|
29
32
|
payload: string | null;
|
|
30
33
|
}) => void;
|
|
31
34
|
addIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
|
|
32
35
|
payload: Submitted<Issue>;
|
|
33
36
|
}) => void;
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
addIssueAttachment: (state: IssueState, action: {
|
|
38
|
+
payload: Submitted<IssueAttachment>;
|
|
39
|
+
type: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
addIssueAttachments: (state: IssueState, action: {
|
|
42
|
+
payload: Submitted<IssueAttachment>[];
|
|
43
|
+
type: string;
|
|
44
|
+
}) => void;
|
|
36
45
|
updateIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
|
|
37
46
|
payload: Submitted<Partial<Issue>>;
|
|
38
47
|
}) => void;
|
|
39
|
-
|
|
48
|
+
updateIssueAttachment: (state: IssueState, action: {
|
|
49
|
+
payload: Submitted<IssueAttachment>;
|
|
50
|
+
type: string;
|
|
51
|
+
}) => void;
|
|
40
52
|
removeIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<string>) => void;
|
|
41
|
-
|
|
53
|
+
removeIssueAttachment: (state: IssueState, action: {
|
|
54
|
+
payload: string;
|
|
55
|
+
type: string;
|
|
56
|
+
}) => void;
|
|
42
57
|
removeAttachmentsOfIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<string>) => void;
|
|
43
58
|
setVisibleStatuses: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<IssueStatus[]>) => void;
|
|
44
59
|
setVisibleUserIds: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
|
|
@@ -54,7 +69,7 @@ export declare const issueSlice: import("@reduxjs/toolkit").Slice<IssueState, {
|
|
|
54
69
|
resetRecentIssues: (state: import("immer/dist/internal.js").WritableDraft<IssueState>) => void;
|
|
55
70
|
removeRecentIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<string>) => void;
|
|
56
71
|
}, "issues">;
|
|
57
|
-
export declare const
|
|
72
|
+
export declare const addIssueAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueAttachment>, "issues/addIssueAttachment">, addIssueAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueAttachment>[], "issues/addIssueAttachments">, addIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<Issue>, "issues/addIssue">, addOrReplaceIssueComment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueComment>, "issues/addOrReplaceIssueComment">, addToRecentIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/addToRecentIssues">, cleanRecentIssues: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issues/cleanRecentIssues">, removeIssueAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeIssueAttachment">, removeAttachmentsOfIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeAttachmentsOfIssue">, removeIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeIssue">, removeIssueComment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeIssueComment">, removeRecentIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/removeRecentIssue">, resetRecentIssues: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"issues/resetRecentIssues">, setActiveIssueId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "issues/setActiveIssueId">, setIssueAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Created<IssueAttachment>[], "issues/setIssueAttachments">, setIssueComments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Created<IssueComment>[], "issues/setIssueComments">, setIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<Created<Issue>[], "issues/setIssues">, setVisibleStatuses: import("@reduxjs/toolkit").ActionCreatorWithPayload<IssueStatus[], "issues/setVisibleStatuses">, setVisibleUserIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<(number | null)[], "issues/setVisibleUserIds">, updateIssueAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<IssueAttachment>, "issues/updateIssueAttachment">, updateIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Submitted<Partial<Issue>>, "issues/updateIssue">;
|
|
58
73
|
export interface IssueFilterArgs {
|
|
59
74
|
filterByAssignedTo: boolean;
|
|
60
75
|
filterByStatus: boolean;
|
|
@@ -72,6 +87,11 @@ export declare const selectIssueAttachments: Selector<Stored<IssueAttachment>[]>
|
|
|
72
87
|
export declare const selectPhotoAttachmentsOfIssue: SelectorWithArgs<string, Stored<IssueAttachment>[]>;
|
|
73
88
|
export declare const selectCommentMapping: (state: RootState) => Record<string, Stored<IssueComment>>;
|
|
74
89
|
export declare const selectCommentsOfIssue: (args: string) => (state: RootState) => Stored<IssueComment>[];
|
|
90
|
+
export declare const selectAttachmentsOfIssue: (args: string) => (state: RootState) => Stored<IssueAttachment>[];
|
|
91
|
+
export declare const selectAttachmentsOfIssueByType: (args: string) => (state: RootState) => {
|
|
92
|
+
fileAttachments: Stored<IssueAttachment>[];
|
|
93
|
+
imageAttachments: Stored<IssueAttachment>[];
|
|
94
|
+
};
|
|
75
95
|
export declare const selectFileAttachmentsOfIssue: (args: string) => (state: RootState) => Stored<IssueAttachment>[] | undefined;
|
|
76
96
|
export declare const selectIssue: SelectorWithArgs<string, Stored<Issue> | undefined>;
|
|
77
97
|
export declare const selectAllAttachments: ((state: import("redux").EmptyObject & {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
import { Created, Stored, Submitted } from "../../typings";
|
|
3
|
+
interface AttachmentState<TState> {
|
|
4
|
+
attachments: Record<string, Stored<TState>>;
|
|
5
|
+
}
|
|
6
|
+
export declare function setAttachments<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<Created<TAttachment>[]>): void;
|
|
7
|
+
export declare function addAttachment<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<Submitted<TAttachment>>): void;
|
|
8
|
+
export declare function addAttachments<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<Submitted<TAttachment>[]>): void;
|
|
9
|
+
export declare function updateAttachment<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<Submitted<TAttachment>>): void;
|
|
10
|
+
export declare function removeAttachment<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<string>): void;
|
|
11
|
+
export declare function removeAttachments<TAttachment, TState extends AttachmentState<TAttachment>>(state: TState, action: PayloadAction<string[]>): void;
|
|
12
|
+
export {};
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { OfflineModel } from "./base";
|
|
2
2
|
import { MaybeObjectURL, UploadedFileModel } from "../files";
|
|
3
|
-
interface Attachment extends OfflineModel, UploadedFileModel {
|
|
4
|
-
issue_id: string;
|
|
3
|
+
export interface Attachment extends OfflineModel, UploadedFileModel {
|
|
5
4
|
description?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface IssueAttachment extends Attachment, UploadedFileModel {
|
|
8
5
|
file_name: string;
|
|
9
6
|
file_type: string;
|
|
10
7
|
}
|
|
11
|
-
export interface
|
|
12
|
-
|
|
8
|
+
export interface IssueAttachment extends Attachment, UploadedFileModel {
|
|
9
|
+
issue: string;
|
|
13
10
|
}
|
|
11
|
+
export interface ComponentAttachment extends Attachment, UploadedFileModel {
|
|
12
|
+
component: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ComponentTypeAttachment extends Attachment, UploadedFileModel {
|
|
15
|
+
component_type: string;
|
|
16
|
+
}
|
|
17
|
+
/** to get an AttachmentPayload for a specific type, pass in the given AttachmentType
|
|
18
|
+
* ex. AttachmentPayload<IssueAttachment> */
|
|
19
|
+
export type AttachmentPayload<TAttachment> = Omit<TAttachment, "file"> & {
|
|
20
|
+
file: MaybeObjectURL<File>;
|
|
21
|
+
};
|
|
14
22
|
export interface ProfilePic extends UploadedFileModel {
|
|
15
23
|
file: string;
|
|
16
24
|
}
|
|
17
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@overmap-ai/core",
|
|
3
|
-
"description": "Core functionality for Overmap",
|
|
4
|
-
"author": "Wôrdn Inc.",
|
|
5
|
-
"license": "UNLICENSED",
|
|
6
|
-
"version": "1.0.43-
|
|
7
|
-
"type": "module",
|
|
8
|
-
"main": "dist/overmap-core.umd.cjs",
|
|
9
|
-
"module": "dist/overmap-core.js",
|
|
10
|
-
"types": "dist/index.d.ts",
|
|
11
|
-
"scripts": {
|
|
12
|
-
"dev": "vite",
|
|
13
|
-
"build": "tsc --noEmit && vite build",
|
|
14
|
-
"lint": "tsc --noEmit && eslint . --ext ts,tsx,js,jsx --report-unused-disable-directives --max-warnings 0",
|
|
15
|
-
"lint:fix": "eslint . --ext ts,tsx,js,jsx --report-unused-disable-directives --max-warnings 0 --fix",
|
|
16
|
-
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,html,sass,yaml}\"",
|
|
17
|
-
"preview": "vite preview",
|
|
18
|
-
"prepare": "husky install",
|
|
19
|
-
"storybook": "storybook dev -p 6006",
|
|
20
|
-
"build-storybook": "storybook build",
|
|
21
|
-
"test": "npx vitest"
|
|
22
|
-
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@hello-pangea/dnd": "^16.5.0",
|
|
25
|
-
"@redux-offline/redux-offline": "^2.6.0",
|
|
26
|
-
"@reduxjs/toolkit": "^1.9.5",
|
|
27
|
-
"color": "^4.2.3",
|
|
28
|
-
"dependency-graph": "^1.0.0",
|
|
29
|
-
"eslint-plugin-vitest": "^0.3.20",
|
|
30
|
-
"feather-icons-react": "^0.7.0",
|
|
31
|
-
"file-saver": "^2.0.5",
|
|
32
|
-
"formik": "^2.4.5",
|
|
33
|
-
"idb": "^7.1.1",
|
|
34
|
-
"jwt-decode": "^3.1.2",
|
|
35
|
-
"leaflet-draw": "^1.0.4",
|
|
36
|
-
"leaflet.markercluster": "^1.5.3",
|
|
37
|
-
"linkify-react": "^4.1.3",
|
|
38
|
-
"linkifyjs": "^4.1.3",
|
|
39
|
-
"localforage": "^1.10.0",
|
|
40
|
-
"lodash.clonedeep": "^4.5.0",
|
|
41
|
-
"lodash.get": "^4.4.2",
|
|
42
|
-
"lodash.set": "^4.3.2",
|
|
43
|
-
"react-leaflet": "^4.2.1",
|
|
44
|
-
"react-pdf": "^8.0.2",
|
|
45
|
-
"react-sketch-canvas": "^6.2.0",
|
|
46
|
-
"react-spreadsheet": "^0.9.4",
|
|
47
|
-
"redux-persist-migrate": "^5.0.0",
|
|
48
|
-
"superagent": "^8.1.2",
|
|
49
|
-
"uuid": "^9.0.0",
|
|
50
|
-
"xlsx": "^0.18.5"
|
|
51
|
-
},
|
|
52
|
-
"devDependencies": {
|
|
53
|
-
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
54
|
-
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
55
|
-
"@overmap-ai/blocks": "^1.0.27-alpha.0",
|
|
56
|
-
"@rollup/plugin-commonjs": "^25.0.4",
|
|
57
|
-
"@storybook/addon-essentials": "7.3.2",
|
|
58
|
-
"@storybook/addon-interactions": "7.3.2",
|
|
59
|
-
"@storybook/addon-links": "7.3.2",
|
|
60
|
-
"@storybook/addon-onboarding": "1.0.8",
|
|
61
|
-
"@storybook/blocks": "7.3.2",
|
|
62
|
-
"@storybook/react": "7.3.2",
|
|
63
|
-
"@storybook/react-vite": "7.3.2",
|
|
64
|
-
"@storybook/testing-library": "0.2.0",
|
|
65
|
-
"@testing-library/dom": "^9.3.4",
|
|
66
|
-
"@testing-library/react": "^14.1.2",
|
|
67
|
-
"@testing-library/user-event": "^14.5.2",
|
|
68
|
-
"@types/color": "^3.0.4",
|
|
69
|
-
"@types/file-saver": "^2.0.7",
|
|
70
|
-
"@types/jwt-decode": "^3.1.0",
|
|
71
|
-
"@types/leaflet": "^1.9.3",
|
|
72
|
-
"@types/lodash.clonedeep": "^4.5.9",
|
|
73
|
-
"@types/lodash.get": "^4.4.9",
|
|
74
|
-
"@types/lodash.set": "^4.3.9",
|
|
75
|
-
"@types/node": "^20.12.11",
|
|
76
|
-
"@types/react": "^18.3.1",
|
|
77
|
-
"@types/react-dom": "^18.2.7",
|
|
78
|
-
"@types/react-redux": "^7.1.26",
|
|
79
|
-
"@types/superagent": "^4.1.18",
|
|
80
|
-
"@types/uuid": "^9.0.3",
|
|
81
|
-
"@types/xlsx": "^0.0.36",
|
|
82
|
-
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
|
83
|
-
"@typescript-eslint/parser": "^6.4.1",
|
|
84
|
-
"@vitejs/plugin-react-swc": "^3.3.2",
|
|
85
|
-
"@vitest/coverage-v8": "^1.2.1",
|
|
86
|
-
"eslint": "^8.47.0",
|
|
87
|
-
"eslint-config-prettier": "^9.0.0",
|
|
88
|
-
"eslint-plugin-import": "^2.28.1",
|
|
89
|
-
"eslint-plugin-prettier": "^5.0.0",
|
|
90
|
-
"eslint-plugin-react": "^7.33.2",
|
|
91
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
92
|
-
"eslint-plugin-react-refresh": "^0.4.3",
|
|
93
|
-
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
94
|
-
"eslint-plugin-storybook": "^0.6.13",
|
|
95
|
-
"happy-dom": "^13.3.1",
|
|
96
|
-
"husky": "^8.0.3",
|
|
97
|
-
"jsdom": "^23.2.0",
|
|
98
|
-
"leaflet": "^1.9.0",
|
|
99
|
-
"lint-staged": "^15.1.0",
|
|
100
|
-
"prettier": "^3.0.2",
|
|
101
|
-
"react": "^18.2.0",
|
|
102
|
-
"react-dom": "^18.2.0",
|
|
103
|
-
"react-hooks": "^1.0.1",
|
|
104
|
-
"react-redux": "^8.1.2",
|
|
105
|
-
"redux": "^4.2.1",
|
|
106
|
-
"rollup-plugin-polyfill-node": "^0.12.0",
|
|
107
|
-
"sass": "^1.66.1",
|
|
108
|
-
"storybook": "7.3.2",
|
|
109
|
-
"typescript": "^5.2.2",
|
|
110
|
-
"vite": "^4.4.5",
|
|
111
|
-
"vite-plugin-dts": "^3.5.2",
|
|
112
|
-
"vite-plugin-externalize-deps": "^0.7.0",
|
|
113
|
-
"vitest": "^1.2.1"
|
|
114
|
-
},
|
|
115
|
-
"peerDependencies": {
|
|
116
|
-
"@overmap-ai/blocks": "1.0.8",
|
|
117
|
-
"leaflet": "^1.9.0",
|
|
118
|
-
"react": "^18.2.0",
|
|
119
|
-
"react-dom": "^18.2.0",
|
|
120
|
-
"react-redux": "^8.1.2"
|
|
121
|
-
},
|
|
122
|
-
"resolutions": {
|
|
123
|
-
"//": "Workaround for eslint issue: https://github.com/eslint/eslint/discussions/17215",
|
|
124
|
-
"strip-ansi": "6.0.1",
|
|
125
|
-
"string-width": "4.2.2",
|
|
126
|
-
"wrap-ansi": "7.0.0"
|
|
127
|
-
},
|
|
128
|
-
"lint-staged": {
|
|
129
|
-
"src/**/*.{js,jsx,ts,tsx}": [
|
|
130
|
-
"yarn lint",
|
|
131
|
-
"yarn format"
|
|
132
|
-
]
|
|
133
|
-
},
|
|
134
|
-
"files": [
|
|
135
|
-
"dist"
|
|
136
|
-
],
|
|
137
|
-
"keywords": [
|
|
138
|
-
"react",
|
|
139
|
-
"geospacial",
|
|
140
|
-
"map",
|
|
141
|
-
"components"
|
|
142
|
-
],
|
|
143
|
-
"homepage": "https://overmap.ai",
|
|
144
|
-
"repository": {
|
|
145
|
-
"type": "git",
|
|
146
|
-
"url": "git+https://github.com/hemora-app/overmap-core.git"
|
|
147
|
-
},
|
|
148
|
-
"bugs": {
|
|
149
|
-
"url": "https://github.com/hemora-app/overmap-core/issues"
|
|
150
|
-
}
|
|
151
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@overmap-ai/core",
|
|
3
|
+
"description": "Core functionality for Overmap",
|
|
4
|
+
"author": "Wôrdn Inc.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"version": "1.0.43-tiptap.1",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/overmap-core.umd.cjs",
|
|
9
|
+
"module": "dist/overmap-core.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "vite",
|
|
13
|
+
"build": "tsc --noEmit && vite build",
|
|
14
|
+
"lint": "tsc --noEmit && eslint . --ext ts,tsx,js,jsx --report-unused-disable-directives --max-warnings 0",
|
|
15
|
+
"lint:fix": "eslint . --ext ts,tsx,js,jsx --report-unused-disable-directives --max-warnings 0 --fix",
|
|
16
|
+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,html,sass,yaml}\"",
|
|
17
|
+
"preview": "vite preview",
|
|
18
|
+
"prepare": "husky install",
|
|
19
|
+
"storybook": "storybook dev -p 6006",
|
|
20
|
+
"build-storybook": "storybook build",
|
|
21
|
+
"test": "npx vitest"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@hello-pangea/dnd": "^16.5.0",
|
|
25
|
+
"@redux-offline/redux-offline": "^2.6.0",
|
|
26
|
+
"@reduxjs/toolkit": "^1.9.5",
|
|
27
|
+
"color": "^4.2.3",
|
|
28
|
+
"dependency-graph": "^1.0.0",
|
|
29
|
+
"eslint-plugin-vitest": "^0.3.20",
|
|
30
|
+
"feather-icons-react": "^0.7.0",
|
|
31
|
+
"file-saver": "^2.0.5",
|
|
32
|
+
"formik": "^2.4.5",
|
|
33
|
+
"idb": "^7.1.1",
|
|
34
|
+
"jwt-decode": "^3.1.2",
|
|
35
|
+
"leaflet-draw": "^1.0.4",
|
|
36
|
+
"leaflet.markercluster": "^1.5.3",
|
|
37
|
+
"linkify-react": "^4.1.3",
|
|
38
|
+
"linkifyjs": "^4.1.3",
|
|
39
|
+
"localforage": "^1.10.0",
|
|
40
|
+
"lodash.clonedeep": "^4.5.0",
|
|
41
|
+
"lodash.get": "^4.4.2",
|
|
42
|
+
"lodash.set": "^4.3.2",
|
|
43
|
+
"react-leaflet": "^4.2.1",
|
|
44
|
+
"react-pdf": "^8.0.2",
|
|
45
|
+
"react-sketch-canvas": "^6.2.0",
|
|
46
|
+
"react-spreadsheet": "^0.9.4",
|
|
47
|
+
"redux-persist-migrate": "^5.0.0",
|
|
48
|
+
"superagent": "^8.1.2",
|
|
49
|
+
"uuid": "^9.0.0",
|
|
50
|
+
"xlsx": "^0.18.5"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
54
|
+
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
55
|
+
"@overmap-ai/blocks": "^1.0.27-alpha.0",
|
|
56
|
+
"@rollup/plugin-commonjs": "^25.0.4",
|
|
57
|
+
"@storybook/addon-essentials": "7.3.2",
|
|
58
|
+
"@storybook/addon-interactions": "7.3.2",
|
|
59
|
+
"@storybook/addon-links": "7.3.2",
|
|
60
|
+
"@storybook/addon-onboarding": "1.0.8",
|
|
61
|
+
"@storybook/blocks": "7.3.2",
|
|
62
|
+
"@storybook/react": "7.3.2",
|
|
63
|
+
"@storybook/react-vite": "7.3.2",
|
|
64
|
+
"@storybook/testing-library": "0.2.0",
|
|
65
|
+
"@testing-library/dom": "^9.3.4",
|
|
66
|
+
"@testing-library/react": "^14.1.2",
|
|
67
|
+
"@testing-library/user-event": "^14.5.2",
|
|
68
|
+
"@types/color": "^3.0.4",
|
|
69
|
+
"@types/file-saver": "^2.0.7",
|
|
70
|
+
"@types/jwt-decode": "^3.1.0",
|
|
71
|
+
"@types/leaflet": "^1.9.3",
|
|
72
|
+
"@types/lodash.clonedeep": "^4.5.9",
|
|
73
|
+
"@types/lodash.get": "^4.4.9",
|
|
74
|
+
"@types/lodash.set": "^4.3.9",
|
|
75
|
+
"@types/node": "^20.12.11",
|
|
76
|
+
"@types/react": "^18.3.1",
|
|
77
|
+
"@types/react-dom": "^18.2.7",
|
|
78
|
+
"@types/react-redux": "^7.1.26",
|
|
79
|
+
"@types/superagent": "^4.1.18",
|
|
80
|
+
"@types/uuid": "^9.0.3",
|
|
81
|
+
"@types/xlsx": "^0.0.36",
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
|
83
|
+
"@typescript-eslint/parser": "^6.4.1",
|
|
84
|
+
"@vitejs/plugin-react-swc": "^3.3.2",
|
|
85
|
+
"@vitest/coverage-v8": "^1.2.1",
|
|
86
|
+
"eslint": "^8.47.0",
|
|
87
|
+
"eslint-config-prettier": "^9.0.0",
|
|
88
|
+
"eslint-plugin-import": "^2.28.1",
|
|
89
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
90
|
+
"eslint-plugin-react": "^7.33.2",
|
|
91
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
92
|
+
"eslint-plugin-react-refresh": "^0.4.3",
|
|
93
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
94
|
+
"eslint-plugin-storybook": "^0.6.13",
|
|
95
|
+
"happy-dom": "^13.3.1",
|
|
96
|
+
"husky": "^8.0.3",
|
|
97
|
+
"jsdom": "^23.2.0",
|
|
98
|
+
"leaflet": "^1.9.0",
|
|
99
|
+
"lint-staged": "^15.1.0",
|
|
100
|
+
"prettier": "^3.0.2",
|
|
101
|
+
"react": "^18.2.0",
|
|
102
|
+
"react-dom": "^18.2.0",
|
|
103
|
+
"react-hooks": "^1.0.1",
|
|
104
|
+
"react-redux": "^8.1.2",
|
|
105
|
+
"redux": "^4.2.1",
|
|
106
|
+
"rollup-plugin-polyfill-node": "^0.12.0",
|
|
107
|
+
"sass": "^1.66.1",
|
|
108
|
+
"storybook": "7.3.2",
|
|
109
|
+
"typescript": "^5.2.2",
|
|
110
|
+
"vite": "^4.4.5",
|
|
111
|
+
"vite-plugin-dts": "^3.5.2",
|
|
112
|
+
"vite-plugin-externalize-deps": "^0.7.0",
|
|
113
|
+
"vitest": "^1.2.1"
|
|
114
|
+
},
|
|
115
|
+
"peerDependencies": {
|
|
116
|
+
"@overmap-ai/blocks": "1.0.8",
|
|
117
|
+
"leaflet": "^1.9.0",
|
|
118
|
+
"react": "^18.2.0",
|
|
119
|
+
"react-dom": "^18.2.0",
|
|
120
|
+
"react-redux": "^8.1.2"
|
|
121
|
+
},
|
|
122
|
+
"resolutions": {
|
|
123
|
+
"//": "Workaround for eslint issue: https://github.com/eslint/eslint/discussions/17215",
|
|
124
|
+
"strip-ansi": "6.0.1",
|
|
125
|
+
"string-width": "4.2.2",
|
|
126
|
+
"wrap-ansi": "7.0.0"
|
|
127
|
+
},
|
|
128
|
+
"lint-staged": {
|
|
129
|
+
"src/**/*.{js,jsx,ts,tsx}": [
|
|
130
|
+
"yarn lint",
|
|
131
|
+
"yarn format"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"files": [
|
|
135
|
+
"dist"
|
|
136
|
+
],
|
|
137
|
+
"keywords": [
|
|
138
|
+
"react",
|
|
139
|
+
"geospacial",
|
|
140
|
+
"map",
|
|
141
|
+
"components"
|
|
142
|
+
],
|
|
143
|
+
"homepage": "https://overmap.ai",
|
|
144
|
+
"repository": {
|
|
145
|
+
"type": "git",
|
|
146
|
+
"url": "git+https://github.com/hemora-app/overmap-core.git"
|
|
147
|
+
},
|
|
148
|
+
"bugs": {
|
|
149
|
+
"url": "https://github.com/hemora-app/overmap-core/issues"
|
|
150
|
+
}
|
|
151
|
+
}
|