@overmap-ai/core 1.0.71-mapbox.4 → 1.0.71-mapbox.5
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.
|
@@ -1740,39 +1740,26 @@ var __publicField = (obj, key, value) => {
|
|
|
1740
1740
|
const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
|
|
1741
1741
|
const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
|
|
1742
1742
|
const outboxReducer = outboxSlice.reducer;
|
|
1743
|
-
const
|
|
1744
|
-
|
|
1743
|
+
const projectFileModelAdapter = createModelAdapter((projectFile) => projectFile.offline_id);
|
|
1744
|
+
const initialState$j = projectFileModelAdapter.getInitialState({
|
|
1745
1745
|
activeProjectFileId: null,
|
|
1746
1746
|
isImportingProjectFile: false
|
|
1747
|
-
};
|
|
1747
|
+
});
|
|
1748
1748
|
const projectFileSlice = toolkit.createSlice({
|
|
1749
1749
|
name: "projectFiles",
|
|
1750
1750
|
initialState: initialState$j,
|
|
1751
1751
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
|
|
1752
1752
|
reducers: {
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
file = parts.slice(0, -1).join("/") + "/" + lastPart;
|
|
1764
|
-
console.warn("Fixed URL:", file);
|
|
1765
|
-
fileObj = { ...fileObj, file };
|
|
1766
|
-
}
|
|
1767
|
-
state.projectFiles[fileObj.offline_id] = fileObj;
|
|
1768
|
-
}
|
|
1769
|
-
},
|
|
1770
|
-
addOrReplaceProjectFile: (state, action) => {
|
|
1771
|
-
if (!action.payload.project) {
|
|
1772
|
-
throw new Error("ProjectFile has no project. A project must be set before storing.");
|
|
1773
|
-
}
|
|
1774
|
-
state.projectFiles[action.payload.offline_id] = action.payload;
|
|
1775
|
-
},
|
|
1753
|
+
initializeProjectFiles: projectFileModelAdapter.initialize,
|
|
1754
|
+
setProjectFile: projectFileModelAdapter.setOne,
|
|
1755
|
+
setProjectFiles: projectFileModelAdapter.setMany,
|
|
1756
|
+
addProjectFile: projectFileModelAdapter.addOne,
|
|
1757
|
+
addProjectFiles: projectFileModelAdapter.addMany,
|
|
1758
|
+
updateProjectFile: projectFileModelAdapter.updateOne,
|
|
1759
|
+
updateProjectFiles: projectFileModelAdapter.updateMany,
|
|
1760
|
+
deleteProjectFile: projectFileModelAdapter.deleteOne,
|
|
1761
|
+
deleteProjectFiles: projectFileModelAdapter.deleteMany,
|
|
1762
|
+
// TODO: move following to /web
|
|
1776
1763
|
setIsImportingProjectFile: (state, action) => {
|
|
1777
1764
|
state.isImportingProjectFile = action.payload;
|
|
1778
1765
|
},
|
|
@@ -1781,50 +1768,46 @@ var __publicField = (obj, key, value) => {
|
|
|
1781
1768
|
if (!activeProjectFileId) {
|
|
1782
1769
|
throw new Error("Tried to save bounds for active project file, but no active project file was set.");
|
|
1783
1770
|
}
|
|
1784
|
-
if (!state.
|
|
1771
|
+
if (!state.instances[activeProjectFileId]) {
|
|
1785
1772
|
throw new Error(
|
|
1786
1773
|
`Tried to save bounds for active project file, but project file with ID ${activeProjectFileId}
|
|
1787
1774
|
doesn't exist.`
|
|
1788
1775
|
);
|
|
1789
1776
|
}
|
|
1790
|
-
state.
|
|
1777
|
+
state.instances[activeProjectFileId].bounds = action.payload;
|
|
1791
1778
|
},
|
|
1792
|
-
// TODO: Move to MapContext. Should not be persisted.
|
|
1793
1779
|
setActiveProjectFileId: (state, action) => {
|
|
1794
1780
|
state.activeProjectFileId = action.payload;
|
|
1795
1781
|
},
|
|
1796
|
-
removeProjectFile: (state, action) => {
|
|
1797
|
-
delete state.projectFiles[action.payload];
|
|
1798
|
-
},
|
|
1799
|
-
removeProjectFilesOfProject: (state, action) => {
|
|
1800
|
-
const filesToDelete = Object.values(state.projectFiles).filter((file) => file.project === action.payload);
|
|
1801
|
-
for (const file of filesToDelete) {
|
|
1802
|
-
delete state.projectFiles[file.offline_id];
|
|
1803
|
-
}
|
|
1804
|
-
},
|
|
1805
1782
|
resetProjectFileObjectUrls: (state, ..._args) => {
|
|
1806
|
-
for (const key in state.
|
|
1807
|
-
delete state.
|
|
1783
|
+
for (const key in state.instances) {
|
|
1784
|
+
delete state.instances[key].objectURL;
|
|
1808
1785
|
}
|
|
1809
1786
|
}
|
|
1810
1787
|
}
|
|
1811
1788
|
});
|
|
1812
1789
|
const {
|
|
1813
|
-
|
|
1814
|
-
|
|
1790
|
+
initializeProjectFiles,
|
|
1791
|
+
setProjectFile,
|
|
1792
|
+
setProjectFiles,
|
|
1793
|
+
addProjectFile,
|
|
1794
|
+
addProjectFiles,
|
|
1795
|
+
updateProjectFile,
|
|
1796
|
+
updateProjectFiles,
|
|
1797
|
+
deleteProjectFile,
|
|
1798
|
+
deleteProjectFiles,
|
|
1799
|
+
// TODO: move following to /web
|
|
1815
1800
|
setIsImportingProjectFile,
|
|
1816
1801
|
setActiveProjectFileId,
|
|
1817
1802
|
saveActiveProjectFileBounds,
|
|
1818
|
-
removeProjectFile,
|
|
1819
|
-
removeProjectFilesOfProject,
|
|
1820
1803
|
resetProjectFileObjectUrls
|
|
1821
1804
|
} = projectFileSlice.actions;
|
|
1822
|
-
const selectProjectFileMapping = (state) => state.projectFileReducer.
|
|
1805
|
+
const selectProjectFileMapping = (state) => state.projectFileReducer.instances;
|
|
1823
1806
|
const selectProjectFiles = toolkit.createSelector([selectProjectFileMapping], (mapping) => {
|
|
1824
1807
|
return fallbackToEmptyArray(Object.values(mapping).sort((a, b) => a.z_index - b.z_index));
|
|
1825
1808
|
});
|
|
1826
1809
|
const selectProjectFileById = (id) => (state) => {
|
|
1827
|
-
return state.projectFileReducer.
|
|
1810
|
+
return state.projectFileReducer.instances[id];
|
|
1828
1811
|
};
|
|
1829
1812
|
const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
|
|
1830
1813
|
const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
|
|
@@ -5003,7 +4986,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5003
4986
|
blocks: [file.offline_id]
|
|
5004
4987
|
});
|
|
5005
4988
|
void promise.then((result) => {
|
|
5006
|
-
this.dispatch(
|
|
4989
|
+
this.dispatch(updateProjectFile(result));
|
|
5007
4990
|
});
|
|
5008
4991
|
return promise;
|
|
5009
4992
|
}
|
|
@@ -5015,7 +4998,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5015
4998
|
if (!activeProjectFileId) {
|
|
5016
4999
|
throw new Error("No active project file");
|
|
5017
5000
|
}
|
|
5018
|
-
const activeProjectFile = state.projectFileReducer.
|
|
5001
|
+
const activeProjectFile = state.projectFileReducer.instances[activeProjectFileId];
|
|
5019
5002
|
if (!activeProjectFile) {
|
|
5020
5003
|
throw new Error("No active project file");
|
|
5021
5004
|
}
|
|
@@ -5054,7 +5037,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5054
5037
|
return this.enqueueRequest(requestDetails2);
|
|
5055
5038
|
});
|
|
5056
5039
|
void promise.then((result) => {
|
|
5057
|
-
this.dispatch(
|
|
5040
|
+
this.dispatch(updateProjectFile(result));
|
|
5058
5041
|
});
|
|
5059
5042
|
this.dispatch(saveActiveProjectFileBounds);
|
|
5060
5043
|
this.dispatch(setActiveProjectFileId(null));
|
|
@@ -5062,7 +5045,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5062
5045
|
return [activeProjectFile, promise];
|
|
5063
5046
|
}
|
|
5064
5047
|
delete(projectFileId) {
|
|
5065
|
-
this.dispatch(
|
|
5048
|
+
this.dispatch(deleteProjectFile(projectFileId));
|
|
5066
5049
|
return this.enqueueRequest({
|
|
5067
5050
|
method: HttpMethod.DELETE,
|
|
5068
5051
|
url: `/projects/files/${projectFileId}`,
|
|
@@ -5078,8 +5061,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5078
5061
|
blockers: [],
|
|
5079
5062
|
blocks: []
|
|
5080
5063
|
});
|
|
5081
|
-
this.dispatch(
|
|
5082
|
-
this.dispatch(addOrReplaceProjectFiles(result));
|
|
5064
|
+
this.dispatch(initializeProjectFiles(result));
|
|
5083
5065
|
}
|
|
5084
5066
|
}
|
|
5085
5067
|
class ProjectAttachmentService extends BaseAttachmentService {
|
|
@@ -5157,7 +5139,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5157
5139
|
throw new Error("Expected project to exist");
|
|
5158
5140
|
}
|
|
5159
5141
|
const filesToDelete = selectProjectFiles(state).filter((file) => file.project === projectId);
|
|
5160
|
-
this.dispatch(
|
|
5142
|
+
this.dispatch(deleteProjectFiles(filesToDelete.map(({ offline_id }) => offline_id)));
|
|
5161
5143
|
const attachmentsOfProject = selectAttachmentsOfProject(project.id)(state);
|
|
5162
5144
|
this.dispatch(deleteProjectAttachments(attachmentsOfProject.map(({ offline_id }) => offline_id)));
|
|
5163
5145
|
const projectAccesses = selectProjectAccesses(state);
|
|
@@ -5180,7 +5162,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5180
5162
|
} catch (e) {
|
|
5181
5163
|
this.dispatch(setProjects(Object.values(projects)));
|
|
5182
5164
|
this.dispatch(initializeProjectAccesses(Object.values(projectAccesses)));
|
|
5183
|
-
this.dispatch(
|
|
5165
|
+
this.dispatch(addProjectFiles(filesToDelete));
|
|
5184
5166
|
this.dispatch(setProjectAttachments(attachmentsOfProject));
|
|
5185
5167
|
this.dispatch({ type: "rehydrated/setRehydrated", payload: true });
|
|
5186
5168
|
if (license) {
|
|
@@ -7299,10 +7281,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7299
7281
|
exports2.addIssueUpdates = addIssueUpdates;
|
|
7300
7282
|
exports2.addIssues = addIssues;
|
|
7301
7283
|
exports2.addLicenses = addLicenses;
|
|
7302
|
-
exports2.addOrReplaceProjectFile = addOrReplaceProjectFile;
|
|
7303
|
-
exports2.addOrReplaceProjectFiles = addOrReplaceProjectFiles;
|
|
7304
7284
|
exports2.addProjectAttachment = addProjectAttachment;
|
|
7305
7285
|
exports2.addProjectAttachments = addProjectAttachments;
|
|
7286
|
+
exports2.addProjectFile = addProjectFile;
|
|
7287
|
+
exports2.addProjectFiles = addProjectFiles;
|
|
7306
7288
|
exports2.addTeam = addTeam;
|
|
7307
7289
|
exports2.addUsers = addUsers;
|
|
7308
7290
|
exports2.addWorkspace = addWorkspace;
|
|
@@ -7376,6 +7358,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7376
7358
|
exports2.deleteProjectAccesses = deleteProjectAccesses;
|
|
7377
7359
|
exports2.deleteProjectAttachment = deleteProjectAttachment;
|
|
7378
7360
|
exports2.deleteProjectAttachments = deleteProjectAttachments;
|
|
7361
|
+
exports2.deleteProjectFile = deleteProjectFile;
|
|
7362
|
+
exports2.deleteProjectFiles = deleteProjectFiles;
|
|
7379
7363
|
exports2.deleteTeam = deleteTeam;
|
|
7380
7364
|
exports2.deleteWorkspace = deleteWorkspace;
|
|
7381
7365
|
exports2.dequeue = dequeue;
|
|
@@ -7443,6 +7427,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7443
7427
|
exports2.initializeOrganizationAccesses = initializeOrganizationAccesses;
|
|
7444
7428
|
exports2.initializeProjectAccesses = initializeProjectAccesses;
|
|
7445
7429
|
exports2.initializeProjectAttachments = initializeProjectAttachments;
|
|
7430
|
+
exports2.initializeProjectFiles = initializeProjectFiles;
|
|
7446
7431
|
exports2.initializeTeams = initializeTeams;
|
|
7447
7432
|
exports2.initializeWorkspaces = initializeWorkspaces;
|
|
7448
7433
|
exports2.isToday = isToday;
|
|
@@ -7491,8 +7476,6 @@ var __publicField = (obj, key, value) => {
|
|
|
7491
7476
|
exports2.rehydratedSlice = rehydratedSlice;
|
|
7492
7477
|
exports2.removeDocuments = removeDocuments;
|
|
7493
7478
|
exports2.removeIssueType = removeIssueType;
|
|
7494
|
-
exports2.removeProjectFile = removeProjectFile;
|
|
7495
|
-
exports2.removeProjectFilesOfProject = removeProjectFilesOfProject;
|
|
7496
7479
|
exports2.removeUser = removeUser;
|
|
7497
7480
|
exports2.resetProjectFileObjectUrls = resetProjectFileObjectUrls;
|
|
7498
7481
|
exports2.resetStore = resetStore;
|
|
@@ -7712,6 +7695,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7712
7695
|
exports2.setProfilePicture = setProfilePicture;
|
|
7713
7696
|
exports2.setProjectAttachment = setProjectAttachment;
|
|
7714
7697
|
exports2.setProjectAttachments = setProjectAttachments;
|
|
7698
|
+
exports2.setProjectFile = setProjectFile;
|
|
7699
|
+
exports2.setProjectFiles = setProjectFiles;
|
|
7715
7700
|
exports2.setProjects = setProjects;
|
|
7716
7701
|
exports2.setRehydrated = setRehydrated;
|
|
7717
7702
|
exports2.setTeam = setTeam;
|
|
@@ -7766,6 +7751,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7766
7751
|
exports2.updateProjectAccess = updateProjectAccess;
|
|
7767
7752
|
exports2.updateProjectAttachment = updateProjectAttachment;
|
|
7768
7753
|
exports2.updateProjectAttachments = updateProjectAttachments;
|
|
7754
|
+
exports2.updateProjectFile = updateProjectFile;
|
|
7755
|
+
exports2.updateProjectFiles = updateProjectFiles;
|
|
7769
7756
|
exports2.updateTeam = updateTeam;
|
|
7770
7757
|
exports2.updateWorkspace = updateWorkspace;
|
|
7771
7758
|
exports2.userReducer = userReducer;
|