@overmap-ai/core 1.0.53-add-agent-conversations.22 → 1.0.53-add-agent-conversations.24
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/dist/overmap-core.js +160 -154
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +160 -154
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/store/slices/componentSlice.d.ts +1 -1
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -1627,13 +1627,138 @@ function removeAttachments(state, action) {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
1629
|
const initialState$q = {
|
|
1630
|
+
componentTypes: {},
|
|
1631
|
+
hiddenComponentTypeIds: {},
|
|
1632
|
+
attachments: {}
|
|
1633
|
+
};
|
|
1634
|
+
const componentTypeSlice = createSlice({
|
|
1635
|
+
name: "componentTypes",
|
|
1636
|
+
initialState: initialState$q,
|
|
1637
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$q)),
|
|
1638
|
+
reducers: {
|
|
1639
|
+
addComponentType: (state, action) => {
|
|
1640
|
+
state.componentTypes[action.payload.offline_id] = action.payload;
|
|
1641
|
+
},
|
|
1642
|
+
setComponentTypes: (state, action) => {
|
|
1643
|
+
state.componentTypes = toOfflineIdRecord(action.payload);
|
|
1644
|
+
},
|
|
1645
|
+
toggleComponentTypeVisibility: (state, action) => {
|
|
1646
|
+
state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
|
|
1647
|
+
},
|
|
1648
|
+
deleteComponentType: (state, action) => {
|
|
1649
|
+
delete state.componentTypes[action.payload];
|
|
1650
|
+
},
|
|
1651
|
+
// Attachments
|
|
1652
|
+
setComponentTypeAttachment: setAttachment,
|
|
1653
|
+
setComponentTypeAttachments: setAttachments,
|
|
1654
|
+
addComponentTypeAttachment: addAttachment,
|
|
1655
|
+
addComponentTypeAttachments: addAttachments,
|
|
1656
|
+
updateComponentTypeAttachment: updateAttachment,
|
|
1657
|
+
updateComponentTypeAttachments: updateAttachments,
|
|
1658
|
+
removeComponentTypeAttachment: removeAttachment,
|
|
1659
|
+
removeComponentTypeAttachments: removeAttachments
|
|
1660
|
+
}
|
|
1661
|
+
});
|
|
1662
|
+
const {
|
|
1663
|
+
addComponentType,
|
|
1664
|
+
setComponentTypes,
|
|
1665
|
+
toggleComponentTypeVisibility,
|
|
1666
|
+
deleteComponentType,
|
|
1667
|
+
// Attachmet
|
|
1668
|
+
setComponentTypeAttachment,
|
|
1669
|
+
setComponentTypeAttachments,
|
|
1670
|
+
addComponentTypeAttachment,
|
|
1671
|
+
addComponentTypeAttachments,
|
|
1672
|
+
updateComponentTypeAttachment,
|
|
1673
|
+
updateComponentTypeAttachments,
|
|
1674
|
+
removeComponentTypeAttachment,
|
|
1675
|
+
removeComponentTypeAttachments
|
|
1676
|
+
} = componentTypeSlice.actions;
|
|
1677
|
+
const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
|
|
1678
|
+
const selectComponentTypes = createSelector(
|
|
1679
|
+
[selectComponentTypesMapping],
|
|
1680
|
+
(mapping) => Object.values(mapping)
|
|
1681
|
+
);
|
|
1682
|
+
const selectComponentType = restructureCreateSelectorWithArgs(
|
|
1683
|
+
createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
|
|
1684
|
+
);
|
|
1685
|
+
const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
|
|
1686
|
+
createSelector(
|
|
1687
|
+
[
|
|
1688
|
+
selectComponentTypesMapping,
|
|
1689
|
+
(_state, args) => args
|
|
1690
|
+
],
|
|
1691
|
+
(mapping, args) => {
|
|
1692
|
+
var _a2;
|
|
1693
|
+
const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
|
|
1694
|
+
return Object.values(mapping).filter(
|
|
1695
|
+
(componentType) => {
|
|
1696
|
+
var _a3;
|
|
1697
|
+
return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
|
|
1698
|
+
}
|
|
1699
|
+
).length;
|
|
1700
|
+
}
|
|
1701
|
+
)
|
|
1702
|
+
);
|
|
1703
|
+
const selectComponentTypesByName = restructureCreateSelectorWithArgs(
|
|
1704
|
+
createSelector(
|
|
1705
|
+
[selectComponentTypesMapping, (_state, name) => name],
|
|
1706
|
+
(mapping, name) => {
|
|
1707
|
+
name = (name == null ? void 0 : name.toLowerCase()) ?? null;
|
|
1708
|
+
return Object.values(mapping).filter(
|
|
1709
|
+
(componentType) => {
|
|
1710
|
+
var _a2;
|
|
1711
|
+
return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
|
|
1712
|
+
}
|
|
1713
|
+
);
|
|
1714
|
+
}
|
|
1715
|
+
)
|
|
1716
|
+
);
|
|
1717
|
+
const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
|
|
1718
|
+
const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
|
|
1719
|
+
const selectAllComponentTypeAttachments = createSelector(
|
|
1720
|
+
[selectComponentTypeAttachmentMapping],
|
|
1721
|
+
(mapping) => Object.values(mapping)
|
|
1722
|
+
);
|
|
1723
|
+
const selectComponentTypeAttachment = (attachmentId) => (state) => {
|
|
1724
|
+
return state.componentTypeReducer.attachments[attachmentId];
|
|
1725
|
+
};
|
|
1726
|
+
const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
|
|
1727
|
+
createSelector(
|
|
1728
|
+
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
1729
|
+
(attachments, componentTypeId) => {
|
|
1730
|
+
return attachments.filter(({ component_type }) => componentTypeId === component_type);
|
|
1731
|
+
}
|
|
1732
|
+
)
|
|
1733
|
+
);
|
|
1734
|
+
const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
|
|
1735
|
+
createSelector(
|
|
1736
|
+
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
1737
|
+
(attachments, componentTypeId) => {
|
|
1738
|
+
const attachmentsOfComponent = attachments.filter(
|
|
1739
|
+
({ component_type }) => component_type === componentTypeId
|
|
1740
|
+
);
|
|
1741
|
+
const fileAttachments = attachmentsOfComponent.filter(
|
|
1742
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1743
|
+
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
1744
|
+
);
|
|
1745
|
+
const imageAttachments = attachmentsOfComponent.filter(
|
|
1746
|
+
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
1747
|
+
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
1748
|
+
);
|
|
1749
|
+
return { fileAttachments, imageAttachments };
|
|
1750
|
+
}
|
|
1751
|
+
)
|
|
1752
|
+
);
|
|
1753
|
+
const componentTypeReducer = componentTypeSlice.reducer;
|
|
1754
|
+
const initialState$p = {
|
|
1630
1755
|
components: {},
|
|
1631
1756
|
attachments: {}
|
|
1632
1757
|
};
|
|
1633
1758
|
const componentSlice = createSlice({
|
|
1634
1759
|
name: "components",
|
|
1635
|
-
initialState: initialState$
|
|
1636
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1760
|
+
initialState: initialState$p,
|
|
1761
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$p)),
|
|
1637
1762
|
reducers: {
|
|
1638
1763
|
addComponent: (state, action) => {
|
|
1639
1764
|
state.components[action.payload.offline_id] = action.payload;
|
|
@@ -1708,36 +1833,41 @@ const selectComponents = (state) => {
|
|
|
1708
1833
|
return prevComponents;
|
|
1709
1834
|
};
|
|
1710
1835
|
const selectComponentsMapping = (state) => state.componentReducer.components;
|
|
1711
|
-
const selectComponentsFromComponentType = (
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1836
|
+
const selectComponentsFromComponentType = restructureCreateSelectorWithArgs(
|
|
1837
|
+
createSelector(
|
|
1838
|
+
[selectComponents, (_state, componentTypeId) => componentTypeId],
|
|
1839
|
+
(components, componentTypeId) => {
|
|
1840
|
+
if (!componentTypeId)
|
|
1841
|
+
return [];
|
|
1842
|
+
return components.filter((component) => component.component_type === componentTypeId);
|
|
1843
|
+
}
|
|
1844
|
+
)
|
|
1845
|
+
);
|
|
1717
1846
|
const selectComponent = (componentId) => (state) => {
|
|
1718
1847
|
return state.componentReducer.components[componentId];
|
|
1719
1848
|
};
|
|
1720
1849
|
const selectComponentTypeFromComponent = (componentTypeId) => (state) => {
|
|
1721
1850
|
return state.componentTypeReducer.componentTypes[componentTypeId];
|
|
1722
1851
|
};
|
|
1723
|
-
const selectComponentTypeFromComponents = (
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1852
|
+
const selectComponentTypeFromComponents = createSelector(
|
|
1853
|
+
[selectComponents, selectComponentTypesMapping],
|
|
1854
|
+
(components, componentTypeMapping) => {
|
|
1855
|
+
const ret = {};
|
|
1856
|
+
for (const component of components) {
|
|
1857
|
+
const componentType = componentTypeMapping[component.component_type];
|
|
1858
|
+
if (!componentType) {
|
|
1859
|
+
console.error(
|
|
1860
|
+
`Component type with ID ${component.component_type} not found.
|
|
1732
1861
|
Expected all referenced component types to be populated.
|
|
1733
1862
|
Returning empty object to avoid fatal errors.`
|
|
1734
|
-
|
|
1735
|
-
|
|
1863
|
+
);
|
|
1864
|
+
return {};
|
|
1865
|
+
}
|
|
1866
|
+
ret[component.offline_id] = componentType;
|
|
1736
1867
|
}
|
|
1737
|
-
ret
|
|
1868
|
+
return ret;
|
|
1738
1869
|
}
|
|
1739
|
-
|
|
1740
|
-
};
|
|
1870
|
+
);
|
|
1741
1871
|
const selectComponentsByType = restructureCreateSelectorWithArgs(
|
|
1742
1872
|
createSelector(
|
|
1743
1873
|
[selectComponents, (_state, componentTypeId) => componentTypeId],
|
|
@@ -1795,13 +1925,13 @@ const selectAttachmentsOfComponentByType = restructureCreateSelectorWithArgs(
|
|
|
1795
1925
|
)
|
|
1796
1926
|
);
|
|
1797
1927
|
const componentReducer = componentSlice.reducer;
|
|
1798
|
-
const initialState$
|
|
1928
|
+
const initialState$o = {
|
|
1799
1929
|
completionsByComponentId: {}
|
|
1800
1930
|
};
|
|
1801
1931
|
const componentStageCompletionSlice = createSlice({
|
|
1802
1932
|
name: "componentStageCompletions",
|
|
1803
|
-
initialState: initialState$
|
|
1804
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1933
|
+
initialState: initialState$o,
|
|
1934
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
|
|
1805
1935
|
reducers: {
|
|
1806
1936
|
addStageCompletion: (state, action) => {
|
|
1807
1937
|
let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
|
|
@@ -1852,13 +1982,13 @@ const selectCompletedStageIdsForComponent = (component) => (state) => {
|
|
|
1852
1982
|
return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
|
|
1853
1983
|
};
|
|
1854
1984
|
const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
|
|
1855
|
-
const initialState$
|
|
1985
|
+
const initialState$n = {
|
|
1856
1986
|
stages: {}
|
|
1857
1987
|
};
|
|
1858
1988
|
const componentStageSlice = createSlice({
|
|
1859
1989
|
name: "componentStages",
|
|
1860
|
-
initialState: initialState$
|
|
1861
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$
|
|
1990
|
+
initialState: initialState$n,
|
|
1991
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1862
1992
|
reducers: {
|
|
1863
1993
|
addStages: (state, action) => {
|
|
1864
1994
|
Object.assign(state.stages, toOfflineIdRecord(action.payload));
|
|
@@ -1968,131 +2098,6 @@ const selectStageFormIdsFromStageIds = restructureCreateSelectorWithArgs(
|
|
|
1968
2098
|
);
|
|
1969
2099
|
const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
|
|
1970
2100
|
const componentStageReducer = componentStageSlice.reducer;
|
|
1971
|
-
const initialState$n = {
|
|
1972
|
-
componentTypes: {},
|
|
1973
|
-
hiddenComponentTypeIds: {},
|
|
1974
|
-
attachments: {}
|
|
1975
|
-
};
|
|
1976
|
-
const componentTypeSlice = createSlice({
|
|
1977
|
-
name: "componentTypes",
|
|
1978
|
-
initialState: initialState$n,
|
|
1979
|
-
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
|
|
1980
|
-
reducers: {
|
|
1981
|
-
addComponentType: (state, action) => {
|
|
1982
|
-
state.componentTypes[action.payload.offline_id] = action.payload;
|
|
1983
|
-
},
|
|
1984
|
-
setComponentTypes: (state, action) => {
|
|
1985
|
-
state.componentTypes = toOfflineIdRecord(action.payload);
|
|
1986
|
-
},
|
|
1987
|
-
toggleComponentTypeVisibility: (state, action) => {
|
|
1988
|
-
state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
|
|
1989
|
-
},
|
|
1990
|
-
deleteComponentType: (state, action) => {
|
|
1991
|
-
delete state.componentTypes[action.payload];
|
|
1992
|
-
},
|
|
1993
|
-
// Attachments
|
|
1994
|
-
setComponentTypeAttachment: setAttachment,
|
|
1995
|
-
setComponentTypeAttachments: setAttachments,
|
|
1996
|
-
addComponentTypeAttachment: addAttachment,
|
|
1997
|
-
addComponentTypeAttachments: addAttachments,
|
|
1998
|
-
updateComponentTypeAttachment: updateAttachment,
|
|
1999
|
-
updateComponentTypeAttachments: updateAttachments,
|
|
2000
|
-
removeComponentTypeAttachment: removeAttachment,
|
|
2001
|
-
removeComponentTypeAttachments: removeAttachments
|
|
2002
|
-
}
|
|
2003
|
-
});
|
|
2004
|
-
const {
|
|
2005
|
-
addComponentType,
|
|
2006
|
-
setComponentTypes,
|
|
2007
|
-
toggleComponentTypeVisibility,
|
|
2008
|
-
deleteComponentType,
|
|
2009
|
-
// Attachmet
|
|
2010
|
-
setComponentTypeAttachment,
|
|
2011
|
-
setComponentTypeAttachments,
|
|
2012
|
-
addComponentTypeAttachment,
|
|
2013
|
-
addComponentTypeAttachments,
|
|
2014
|
-
updateComponentTypeAttachment,
|
|
2015
|
-
updateComponentTypeAttachments,
|
|
2016
|
-
removeComponentTypeAttachment,
|
|
2017
|
-
removeComponentTypeAttachments
|
|
2018
|
-
} = componentTypeSlice.actions;
|
|
2019
|
-
const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
|
|
2020
|
-
const selectComponentTypes = createSelector(
|
|
2021
|
-
[selectComponentTypesMapping],
|
|
2022
|
-
(mapping) => Object.values(mapping)
|
|
2023
|
-
);
|
|
2024
|
-
const selectComponentType = restructureCreateSelectorWithArgs(
|
|
2025
|
-
createSelector([selectComponentTypesMapping, (_state, id) => id], (mapping, id) => mapping[id])
|
|
2026
|
-
);
|
|
2027
|
-
const selectNumberOfComponentTypesMatchingCaseInsensitiveName = restructureCreateSelectorWithArgs(
|
|
2028
|
-
createSelector(
|
|
2029
|
-
[
|
|
2030
|
-
selectComponentTypesMapping,
|
|
2031
|
-
(_state, args) => args
|
|
2032
|
-
],
|
|
2033
|
-
(mapping, args) => {
|
|
2034
|
-
var _a2;
|
|
2035
|
-
const name = ((_a2 = args.name) == null ? void 0 : _a2.toLowerCase()) ?? null;
|
|
2036
|
-
return Object.values(mapping).filter(
|
|
2037
|
-
(componentType) => {
|
|
2038
|
-
var _a3;
|
|
2039
|
-
return (((_a3 = componentType.name) == null ? void 0 : _a3.toLowerCase()) ?? null) === name && componentType.offline_id !== args.componentTypeId;
|
|
2040
|
-
}
|
|
2041
|
-
).length;
|
|
2042
|
-
}
|
|
2043
|
-
)
|
|
2044
|
-
);
|
|
2045
|
-
const selectComponentTypesByName = restructureCreateSelectorWithArgs(
|
|
2046
|
-
createSelector(
|
|
2047
|
-
[selectComponentTypesMapping, (_state, name) => name],
|
|
2048
|
-
(mapping, name) => {
|
|
2049
|
-
name = (name == null ? void 0 : name.toLowerCase()) ?? null;
|
|
2050
|
-
return Object.values(mapping).filter(
|
|
2051
|
-
(componentType) => {
|
|
2052
|
-
var _a2;
|
|
2053
|
-
return (((_a2 = componentType.name) == null ? void 0 : _a2.toLowerCase()) ?? null) === name;
|
|
2054
|
-
}
|
|
2055
|
-
);
|
|
2056
|
-
}
|
|
2057
|
-
)
|
|
2058
|
-
);
|
|
2059
|
-
const selectHiddenComponentTypeIds = (state) => state.componentTypeReducer.hiddenComponentTypeIds;
|
|
2060
|
-
const selectComponentTypeAttachmentMapping = (state) => state.componentTypeReducer.attachments;
|
|
2061
|
-
const selectAllComponentTypeAttachments = createSelector(
|
|
2062
|
-
[selectComponentTypeAttachmentMapping],
|
|
2063
|
-
(mapping) => Object.values(mapping)
|
|
2064
|
-
);
|
|
2065
|
-
const selectComponentTypeAttachment = (attachmentId) => (state) => {
|
|
2066
|
-
return state.componentTypeReducer.attachments[attachmentId];
|
|
2067
|
-
};
|
|
2068
|
-
const selectAttachmentsOfComponentType = restructureCreateSelectorWithArgs(
|
|
2069
|
-
createSelector(
|
|
2070
|
-
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
2071
|
-
(attachments, componentTypeId) => {
|
|
2072
|
-
return attachments.filter(({ component_type }) => componentTypeId === component_type);
|
|
2073
|
-
}
|
|
2074
|
-
)
|
|
2075
|
-
);
|
|
2076
|
-
const selectAttachmentsOfComponentTypeByType = restructureCreateSelectorWithArgs(
|
|
2077
|
-
createSelector(
|
|
2078
|
-
[selectAllComponentTypeAttachments, (_state, componentTypeId) => componentTypeId],
|
|
2079
|
-
(attachments, componentTypeId) => {
|
|
2080
|
-
const attachmentsOfComponent = attachments.filter(
|
|
2081
|
-
({ component_type }) => component_type === componentTypeId
|
|
2082
|
-
);
|
|
2083
|
-
const fileAttachments = attachmentsOfComponent.filter(
|
|
2084
|
-
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
2085
|
-
({ file_type }) => !file_type || !file_type.startsWith("image/")
|
|
2086
|
-
);
|
|
2087
|
-
const imageAttachments = attachmentsOfComponent.filter(
|
|
2088
|
-
// this null check here is necessary, there are cases where file_type is null or undefined
|
|
2089
|
-
({ file_type }) => file_type && file_type.startsWith("image/")
|
|
2090
|
-
);
|
|
2091
|
-
return { fileAttachments, imageAttachments };
|
|
2092
|
-
}
|
|
2093
|
-
)
|
|
2094
|
-
);
|
|
2095
|
-
const componentTypeReducer = componentTypeSlice.reducer;
|
|
2096
2101
|
const initialState$m = {
|
|
2097
2102
|
workspaces: {},
|
|
2098
2103
|
activeWorkspaceId: null
|
|
@@ -6333,7 +6338,8 @@ class IssueService extends BaseApiService {
|
|
|
6333
6338
|
if (error2 instanceof APIError) {
|
|
6334
6339
|
(_a2 = unsafeShowToast) == null ? void 0 : _a2({
|
|
6335
6340
|
title: "Could not create issue",
|
|
6336
|
-
description:
|
|
6341
|
+
description: error2.message,
|
|
6342
|
+
severity: "danger"
|
|
6337
6343
|
});
|
|
6338
6344
|
}
|
|
6339
6345
|
store.dispatch(removeIssue(issuePayload.offline_id));
|