@overmap-ai/core 1.0.53-add-agent-conversations.10 → 1.0.53-add-agent-conversations.12
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 +1300 -1201
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +1340 -1241
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/sdk.d.ts +6 -2
- package/dist/sdk/services/BaseAttachmentService.d.ts +31 -0
- package/dist/sdk/services/ComponentAttachmentService.d.ts +10 -0
- package/dist/sdk/services/ComponentTypeAttachmentService.d.ts +10 -0
- package/dist/sdk/services/DocumentAttachmentService.d.ts +10 -0
- package/dist/sdk/services/IssueAttachmentService.d.ts +10 -0
- package/dist/sdk/services/IssueService.d.ts +1 -1
- package/dist/sdk/services/MainService.d.ts +3 -10
- package/dist/sdk/services/ProjectAttachmentService.d.ts +10 -0
- package/dist/sdk/services/index.d.ts +5 -1
- package/dist/store/slices/componentSlice.d.ts +15 -7
- package/dist/store/slices/componentTypeSlice.d.ts +16 -8
- package/dist/store/slices/documentSlice.d.ts +10 -2
- package/dist/store/slices/issueSlice.d.ts +33 -21
- package/dist/store/slices/projectSlice.d.ts +12 -3
- package/dist/store/slices/utils.d.ts +3 -2
- package/dist/typings/models/attachments.d.ts +7 -0
- package/dist/typings/models/projects.d.ts +4 -5
- package/package.json +1 -1
- package/dist/sdk/services/AttachmentService.d.ts +0 -46
|
@@ -5,8 +5,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
(function(global2, factory) {
|
|
8
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("dependency-graph"), require("@redux-offline/redux-offline"), require("@redux-offline/redux-offline/lib/defaults"), require("localforage"), require("redux-persist-migrate"), require("@reduxjs/toolkit"), require("superagent"), require("react-redux"), require("file-saver"), require("uuid"), require("color"), require("jwt-decode"), require("@redux-offline/redux-offline/lib/constants"), require("idb"), require("formik"), require("lodash.get"), require("linkify-react"), require("@hello-pangea/dnd"), require("qr-scanner"), require("xlsx"), require("react-pdf"), require("react-pdf/dist/Page/AnnotationLayer.css"), require("react-pdf/dist/Page/TextLayer.css"), require("react-
|
|
9
|
-
})(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request, reactRedux, saveAs, uuid, ColorCls, jwtDecode, constants, idb, formik, get, Linkify, dnd, QrScannerAPI, xlsx, reactPdf, AnnotationLayer_css, TextLayer_css,
|
|
8
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("dependency-graph"), require("@redux-offline/redux-offline"), require("@redux-offline/redux-offline/lib/defaults"), require("localforage"), require("redux-persist-migrate"), require("@reduxjs/toolkit"), require("superagent"), require("react-redux"), require("file-saver"), require("uuid"), require("color"), require("jwt-decode"), require("@redux-offline/redux-offline/lib/constants"), require("idb"), require("formik"), require("react-dom"), require("lodash.get"), require("linkify-react"), require("@hello-pangea/dnd"), require("qr-scanner"), require("xlsx"), require("react-pdf"), require("react-pdf/dist/Page/AnnotationLayer.css"), require("react-pdf/dist/Page/TextLayer.css"), require("react-sketch-canvas"), require("lodash.set"), require("lodash.clonedeep")) : typeof define === "function" && define.amd ? define(["exports", "react", "react/jsx-runtime", "@overmap-ai/blocks", "dependency-graph", "@redux-offline/redux-offline", "@redux-offline/redux-offline/lib/defaults", "localforage", "redux-persist-migrate", "@reduxjs/toolkit", "superagent", "react-redux", "file-saver", "uuid", "color", "jwt-decode", "@redux-offline/redux-offline/lib/constants", "idb", "formik", "react-dom", "lodash.get", "linkify-react", "@hello-pangea/dnd", "qr-scanner", "xlsx", "react-pdf", "react-pdf/dist/Page/AnnotationLayer.css", "react-pdf/dist/Page/TextLayer.css", "react-sketch-canvas", "lodash.set", "lodash.clonedeep"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["overmap-core"] = {}, global2.React, global2.jsxRuntime, global2.blocks, global2.dependencyGraph, global2.reduxOffline, global2.offlineConfig, global2.localforage, global2.createMigration, global2.toolkit, global2.request, global2.reactRedux, global2.saveAs, global2.uuid, global2.ColorCls, global2.jwtDecode, global2.constants, global2.idb, global2.formik, global2.ReactDOM, global2.get, global2.Linkify, global2.dnd, global2.QrScannerAPI, global2.xlsx, global2.reactPdf, null, null, global2.reactSketchCanvas, global2.set, global2.cloneDeep));
|
|
9
|
+
})(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request, reactRedux, saveAs, uuid, ColorCls, jwtDecode, constants, idb, formik, ReactDOM, get, Linkify, dnd, QrScannerAPI, xlsx, reactPdf, AnnotationLayer_css, TextLayer_css, reactSketchCanvas, set, cloneDeep) {
|
|
10
10
|
var _a;
|
|
11
11
|
"use strict";
|
|
12
12
|
function _interopNamespaceDefault(e) {
|
|
@@ -1568,6 +1568,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1568
1568
|
return Object.values(state.issueReducer.issues).filter((issue) => issue.category === categoryId).length;
|
|
1569
1569
|
};
|
|
1570
1570
|
const categoryReducer = categorySlice.reducer;
|
|
1571
|
+
function setAttachment(state, action) {
|
|
1572
|
+
state.attachments[action.payload.offline_id] = action.payload;
|
|
1573
|
+
}
|
|
1571
1574
|
function setAttachments(state, action) {
|
|
1572
1575
|
state.attachments = {};
|
|
1573
1576
|
for (const attachment of action.payload) {
|
|
@@ -1592,6 +1595,15 @@ var __publicField = (obj, key, value) => {
|
|
|
1592
1595
|
throw new Error(`Attachment ${action.payload.offline_id} does not exist.`);
|
|
1593
1596
|
}
|
|
1594
1597
|
}
|
|
1598
|
+
function updateAttachments(state, action) {
|
|
1599
|
+
for (const attachment of action.payload) {
|
|
1600
|
+
if (attachment.offline_id in state.attachments) {
|
|
1601
|
+
state.attachments[attachment.offline_id] = attachment;
|
|
1602
|
+
} else {
|
|
1603
|
+
throw new Error(`Attachment ${attachment.offline_id} does not exist.`);
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1595
1607
|
function removeAttachment(state, action) {
|
|
1596
1608
|
if (action.payload in state.attachments) {
|
|
1597
1609
|
delete state.attachments[action.payload];
|
|
@@ -1625,12 +1637,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1625
1637
|
state.components = toOfflineIdRecord(action.payload);
|
|
1626
1638
|
prevComponents = null;
|
|
1627
1639
|
},
|
|
1628
|
-
setComponentAttachments: setAttachments,
|
|
1629
|
-
addComponentAttachment: addAttachment,
|
|
1630
|
-
addComponentAttachments: addAttachments,
|
|
1631
|
-
updateComponentAttachment: updateAttachment,
|
|
1632
|
-
removeComponentAttachment: removeAttachment,
|
|
1633
|
-
removeComponentAttachments: removeAttachments,
|
|
1634
1640
|
updateComponent: (state, action) => {
|
|
1635
1641
|
if (action.payload.offline_id in state.components) {
|
|
1636
1642
|
state.components[action.payload.offline_id] = action.payload;
|
|
@@ -1655,9 +1661,35 @@ var __publicField = (obj, key, value) => {
|
|
|
1655
1661
|
}
|
|
1656
1662
|
}
|
|
1657
1663
|
prevComponents = null;
|
|
1658
|
-
}
|
|
1664
|
+
},
|
|
1665
|
+
// Attachments
|
|
1666
|
+
setComponentAttachment: setAttachment,
|
|
1667
|
+
setComponentAttachments: setAttachments,
|
|
1668
|
+
addComponentAttachment: addAttachment,
|
|
1669
|
+
addComponentAttachments: addAttachments,
|
|
1670
|
+
updateComponentAttachment: updateAttachment,
|
|
1671
|
+
updateComponentAttachments: updateAttachments,
|
|
1672
|
+
removeComponentAttachment: removeAttachment,
|
|
1673
|
+
removeComponentAttachments: removeAttachments
|
|
1659
1674
|
}
|
|
1660
1675
|
});
|
|
1676
|
+
const {
|
|
1677
|
+
addComponent,
|
|
1678
|
+
updateComponent,
|
|
1679
|
+
removeComponent,
|
|
1680
|
+
addComponentsInBatches,
|
|
1681
|
+
setComponents,
|
|
1682
|
+
removeAllComponentsOfType,
|
|
1683
|
+
// Attachments
|
|
1684
|
+
setComponentAttachment,
|
|
1685
|
+
setComponentAttachments,
|
|
1686
|
+
addComponentAttachment,
|
|
1687
|
+
addComponentAttachments,
|
|
1688
|
+
updateComponentAttachment,
|
|
1689
|
+
updateComponentAttachments,
|
|
1690
|
+
removeComponentAttachment,
|
|
1691
|
+
removeComponentAttachments
|
|
1692
|
+
} = componentSlice.actions;
|
|
1661
1693
|
let prevComponents = null;
|
|
1662
1694
|
const selectComponents = (state) => {
|
|
1663
1695
|
if (!prevComponents) {
|
|
@@ -1752,20 +1784,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1752
1784
|
}
|
|
1753
1785
|
)
|
|
1754
1786
|
);
|
|
1755
|
-
const {
|
|
1756
|
-
addComponent,
|
|
1757
|
-
updateComponent,
|
|
1758
|
-
removeComponent,
|
|
1759
|
-
addComponentsInBatches,
|
|
1760
|
-
setComponents,
|
|
1761
|
-
setComponentAttachments,
|
|
1762
|
-
addComponentAttachment,
|
|
1763
|
-
addComponentAttachments,
|
|
1764
|
-
updateComponentAttachment,
|
|
1765
|
-
removeComponentAttachment,
|
|
1766
|
-
removeComponentAttachments,
|
|
1767
|
-
removeAllComponentsOfType
|
|
1768
|
-
} = componentSlice.actions;
|
|
1769
1787
|
const componentReducer = componentSlice.reducer;
|
|
1770
1788
|
const initialState$p = {
|
|
1771
1789
|
completionsByComponentId: {}
|
|
@@ -1956,20 +1974,38 @@ var __publicField = (obj, key, value) => {
|
|
|
1956
1974
|
setComponentTypes: (state, action) => {
|
|
1957
1975
|
state.componentTypes = toOfflineIdRecord(action.payload);
|
|
1958
1976
|
},
|
|
1959
|
-
setComponentTypeAttachments: setAttachments,
|
|
1960
|
-
addComponentTypeAttachment: addAttachment,
|
|
1961
|
-
addComponentTypeAttachments: addAttachments,
|
|
1962
|
-
updateComponentTypeAttachment: updateAttachment,
|
|
1963
|
-
removeComponentTypeAttachment: removeAttachment,
|
|
1964
|
-
removeComponentTypeAttachments: removeAttachments,
|
|
1965
1977
|
toggleComponentTypeVisibility: (state, action) => {
|
|
1966
1978
|
state.hiddenComponentTypeIds[action.payload] = !state.hiddenComponentTypeIds[action.payload];
|
|
1967
1979
|
},
|
|
1968
1980
|
deleteComponentType: (state, action) => {
|
|
1969
1981
|
delete state.componentTypes[action.payload];
|
|
1970
|
-
}
|
|
1982
|
+
},
|
|
1983
|
+
// Attachments
|
|
1984
|
+
setComponentTypeAttachment: setAttachment,
|
|
1985
|
+
setComponentTypeAttachments: setAttachments,
|
|
1986
|
+
addComponentTypeAttachment: addAttachment,
|
|
1987
|
+
addComponentTypeAttachments: addAttachments,
|
|
1988
|
+
updateComponentTypeAttachment: updateAttachment,
|
|
1989
|
+
updateComponentTypeAttachments: updateAttachments,
|
|
1990
|
+
removeComponentTypeAttachment: removeAttachment,
|
|
1991
|
+
removeComponentTypeAttachments: removeAttachments
|
|
1971
1992
|
}
|
|
1972
1993
|
});
|
|
1994
|
+
const {
|
|
1995
|
+
addComponentType,
|
|
1996
|
+
setComponentTypes,
|
|
1997
|
+
toggleComponentTypeVisibility,
|
|
1998
|
+
deleteComponentType,
|
|
1999
|
+
// Attachmet
|
|
2000
|
+
setComponentTypeAttachment,
|
|
2001
|
+
setComponentTypeAttachments,
|
|
2002
|
+
addComponentTypeAttachment,
|
|
2003
|
+
addComponentTypeAttachments,
|
|
2004
|
+
updateComponentTypeAttachment,
|
|
2005
|
+
updateComponentTypeAttachments,
|
|
2006
|
+
removeComponentTypeAttachment,
|
|
2007
|
+
removeComponentTypeAttachments
|
|
2008
|
+
} = componentTypeSlice.actions;
|
|
1973
2009
|
const selectComponentTypesMapping = (state) => state.componentTypeReducer.componentTypes;
|
|
1974
2010
|
const selectComponentTypes = toolkit.createSelector(
|
|
1975
2011
|
[selectComponentTypesMapping],
|
|
@@ -2046,18 +2082,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2046
2082
|
}
|
|
2047
2083
|
)
|
|
2048
2084
|
);
|
|
2049
|
-
const {
|
|
2050
|
-
addComponentType,
|
|
2051
|
-
setComponentTypes,
|
|
2052
|
-
setComponentTypeAttachments,
|
|
2053
|
-
addComponentTypeAttachment,
|
|
2054
|
-
addComponentTypeAttachments,
|
|
2055
|
-
updateComponentTypeAttachment,
|
|
2056
|
-
removeComponentTypeAttachment,
|
|
2057
|
-
removeComponentTypeAttachments,
|
|
2058
|
-
toggleComponentTypeVisibility,
|
|
2059
|
-
deleteComponentType
|
|
2060
|
-
} = componentTypeSlice.actions;
|
|
2061
2085
|
const componentTypeReducer = componentTypeSlice.reducer;
|
|
2062
2086
|
const initialState$m = {
|
|
2063
2087
|
workspaces: {},
|
|
@@ -2147,7 +2171,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2147
2171
|
state.issues[issue.offline_id] = issue;
|
|
2148
2172
|
});
|
|
2149
2173
|
},
|
|
2150
|
-
setIssueAttachments: setAttachments,
|
|
2151
2174
|
setIssueUpdates: (state, action) => {
|
|
2152
2175
|
if (action.payload.filter(onlyUniqueOfflineIds).length !== action.payload.length) {
|
|
2153
2176
|
throw new Error("Tried to use setIssues reducer with duplicate ID's");
|
|
@@ -2177,8 +2200,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2177
2200
|
state.issues[issue.offline_id] = issue;
|
|
2178
2201
|
}
|
|
2179
2202
|
},
|
|
2180
|
-
addIssueAttachment: addAttachment,
|
|
2181
|
-
addIssueAttachments: addAttachments,
|
|
2182
2203
|
addIssueUpdate: (state, action) => {
|
|
2183
2204
|
if (action.payload.offline_id in state.updates) {
|
|
2184
2205
|
throw new Error(`Tried to add duplicate issue update with offline_id: ${action.payload.offline_id}`);
|
|
@@ -2200,7 +2221,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2200
2221
|
throw new Error(`Tried to update issue with ID that doesn't exist: ${action.payload.offline_id}`);
|
|
2201
2222
|
}
|
|
2202
2223
|
},
|
|
2203
|
-
updateIssueAttachment: updateAttachment,
|
|
2204
2224
|
removeIssue: (state, action) => {
|
|
2205
2225
|
if (action.payload in state.issues) {
|
|
2206
2226
|
delete state.issues[action.payload];
|
|
@@ -2213,7 +2233,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2213
2233
|
delete state.issues[issueId];
|
|
2214
2234
|
}
|
|
2215
2235
|
},
|
|
2216
|
-
removeIssueAttachment: removeAttachment,
|
|
2217
2236
|
removeIssueUpdate: (state, action) => {
|
|
2218
2237
|
if (action.payload in state.updates) {
|
|
2219
2238
|
delete state.updates[action.payload];
|
|
@@ -2310,12 +2329,19 @@ var __publicField = (obj, key, value) => {
|
|
|
2310
2329
|
if (indexToRemove !== -1) {
|
|
2311
2330
|
state.recentIssueIds.splice(indexToRemove, 1);
|
|
2312
2331
|
}
|
|
2313
|
-
}
|
|
2332
|
+
},
|
|
2333
|
+
// Attachments
|
|
2334
|
+
setIssueAttachment: setAttachment,
|
|
2335
|
+
setIssueAttachments: setAttachments,
|
|
2336
|
+
addIssueAttachment: addAttachment,
|
|
2337
|
+
addIssueAttachments: addAttachments,
|
|
2338
|
+
updateIssueAttachment: updateAttachment,
|
|
2339
|
+
updateIssueAttachments: updateAttachments,
|
|
2340
|
+
removeIssueAttachment: removeAttachment,
|
|
2341
|
+
removeIssueAttachments: removeAttachments
|
|
2314
2342
|
}
|
|
2315
2343
|
});
|
|
2316
2344
|
const {
|
|
2317
|
-
addIssueAttachment,
|
|
2318
|
-
addIssueAttachments,
|
|
2319
2345
|
addIssue,
|
|
2320
2346
|
addIssues,
|
|
2321
2347
|
addIssueUpdate,
|
|
@@ -2323,7 +2349,6 @@ var __publicField = (obj, key, value) => {
|
|
|
2323
2349
|
addOrReplaceIssueComment,
|
|
2324
2350
|
addToRecentIssues,
|
|
2325
2351
|
cleanRecentIssues,
|
|
2326
|
-
removeIssueAttachment,
|
|
2327
2352
|
removeAttachmentsOfIssue,
|
|
2328
2353
|
removeIssue,
|
|
2329
2354
|
removeIssues,
|
|
@@ -2332,13 +2357,20 @@ var __publicField = (obj, key, value) => {
|
|
|
2332
2357
|
removeRecentIssue,
|
|
2333
2358
|
resetRecentIssues,
|
|
2334
2359
|
setActiveIssueId,
|
|
2335
|
-
setIssueAttachments,
|
|
2336
2360
|
setIssueUpdates,
|
|
2337
2361
|
setIssues,
|
|
2338
2362
|
setVisibleStatuses,
|
|
2339
2363
|
setVisibleUserIds,
|
|
2340
|
-
updateIssueAttachment,
|
|
2341
2364
|
updateIssue,
|
|
2365
|
+
// Attachments
|
|
2366
|
+
setIssueAttachment,
|
|
2367
|
+
setIssueAttachments,
|
|
2368
|
+
addIssueAttachment,
|
|
2369
|
+
addIssueAttachments,
|
|
2370
|
+
updateIssueAttachment,
|
|
2371
|
+
updateIssueAttachments,
|
|
2372
|
+
removeIssueAttachment,
|
|
2373
|
+
removeIssueAttachments,
|
|
2342
2374
|
// Commments
|
|
2343
2375
|
addIssueComment,
|
|
2344
2376
|
addIssueComments,
|
|
@@ -2707,6 +2739,14 @@ var __publicField = (obj, key, value) => {
|
|
|
2707
2739
|
OrganizationAccessLevel2[OrganizationAccessLevel2["ADMIN"] = 2] = "ADMIN";
|
|
2708
2740
|
return OrganizationAccessLevel2;
|
|
2709
2741
|
})(OrganizationAccessLevel || {});
|
|
2742
|
+
var AttachmentModel = /* @__PURE__ */ ((AttachmentModel2) => {
|
|
2743
|
+
AttachmentModel2["Issue"] = "issue";
|
|
2744
|
+
AttachmentModel2["Component"] = "component";
|
|
2745
|
+
AttachmentModel2["ComponentType"] = "component_type";
|
|
2746
|
+
AttachmentModel2["Project"] = "project";
|
|
2747
|
+
AttachmentModel2["Document"] = "document";
|
|
2748
|
+
return AttachmentModel2;
|
|
2749
|
+
})(AttachmentModel || {});
|
|
2710
2750
|
var IssueUpdateChange = /* @__PURE__ */ ((IssueUpdateChange2) => {
|
|
2711
2751
|
IssueUpdateChange2["STATUS"] = "status";
|
|
2712
2752
|
IssueUpdateChange2["PRIORITY"] = "priority";
|
|
@@ -3094,11 +3134,13 @@ var __publicField = (obj, key, value) => {
|
|
|
3094
3134
|
throw new Error("Update form submissions count: no active project");
|
|
3095
3135
|
}
|
|
3096
3136
|
},
|
|
3097
|
-
//
|
|
3137
|
+
// Attachments
|
|
3138
|
+
setProjectAttachment: setAttachment,
|
|
3098
3139
|
setProjectAttachments: setAttachments,
|
|
3099
3140
|
addProjectAttachment: addAttachment,
|
|
3100
3141
|
addProjectAttachments: addAttachments,
|
|
3101
3142
|
updateProjectAttachment: updateAttachment,
|
|
3143
|
+
updateProjectAttachments: updateAttachments,
|
|
3102
3144
|
removeProjectAttachment: removeAttachment,
|
|
3103
3145
|
removeProjectAttachments: removeAttachments
|
|
3104
3146
|
}
|
|
@@ -3113,11 +3155,13 @@ var __publicField = (obj, key, value) => {
|
|
|
3113
3155
|
acceptProjectInvite,
|
|
3114
3156
|
addActiveProjectIssuesCount,
|
|
3115
3157
|
addActiveProjectFormSubmissionsCount,
|
|
3116
|
-
//
|
|
3158
|
+
// Attachments
|
|
3159
|
+
setProjectAttachment,
|
|
3117
3160
|
setProjectAttachments,
|
|
3118
3161
|
addProjectAttachment,
|
|
3119
3162
|
addProjectAttachments,
|
|
3120
3163
|
updateProjectAttachment,
|
|
3164
|
+
updateProjectAttachments,
|
|
3121
3165
|
removeProjectAttachment,
|
|
3122
3166
|
removeProjectAttachments
|
|
3123
3167
|
} = projectSlice.actions;
|
|
@@ -3188,6 +3232,9 @@ var __publicField = (obj, key, value) => {
|
|
|
3188
3232
|
[selectProjectAttachmentMapping],
|
|
3189
3233
|
(mapping) => Object.values(mapping)
|
|
3190
3234
|
);
|
|
3235
|
+
const selectProjectAttachment = (attachmentId) => (state) => {
|
|
3236
|
+
return state.projectReducer.attachments[attachmentId];
|
|
3237
|
+
};
|
|
3191
3238
|
const selectAttachmentsOfProject = restructureCreateSelectorWithArgs(
|
|
3192
3239
|
toolkit.createSelector(
|
|
3193
3240
|
[selectAllProjectAttachments, (_state, projectId) => projectId],
|
|
@@ -4303,10 +4350,13 @@ var __publicField = (obj, key, value) => {
|
|
|
4303
4350
|
delete state.documents[documentId];
|
|
4304
4351
|
}
|
|
4305
4352
|
},
|
|
4353
|
+
// Attachments
|
|
4354
|
+
setDocumentAttachment: setAttachment,
|
|
4306
4355
|
setDocumentAttachments: setAttachments,
|
|
4307
4356
|
addDocumentAttachment: addAttachment,
|
|
4308
4357
|
addDocumentAttachments: addAttachments,
|
|
4309
4358
|
updateDocumentAttachment: updateAttachment,
|
|
4359
|
+
updateDocumentAttachments: updateAttachments,
|
|
4310
4360
|
removeDocumentAttachment: removeAttachment,
|
|
4311
4361
|
removeDocumentAttachments: removeAttachments
|
|
4312
4362
|
}
|
|
@@ -4317,10 +4367,13 @@ var __publicField = (obj, key, value) => {
|
|
|
4317
4367
|
updateDocuments,
|
|
4318
4368
|
moveDocument,
|
|
4319
4369
|
removeDocuments,
|
|
4370
|
+
// Attachments
|
|
4371
|
+
setDocumentAttachment,
|
|
4320
4372
|
setDocumentAttachments,
|
|
4321
4373
|
addDocumentAttachment,
|
|
4322
4374
|
addDocumentAttachments,
|
|
4323
4375
|
updateDocumentAttachment,
|
|
4376
|
+
updateDocumentAttachments,
|
|
4324
4377
|
removeDocumentAttachment,
|
|
4325
4378
|
removeDocumentAttachments
|
|
4326
4379
|
} = documentSlice.actions;
|
|
@@ -5059,642 +5112,95 @@ var __publicField = (obj, key, value) => {
|
|
|
5059
5112
|
return promise;
|
|
5060
5113
|
}
|
|
5061
5114
|
}
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
blocks: [offline_id, issue],
|
|
5103
|
-
blockers: [file_sha1],
|
|
5104
|
-
payload: {
|
|
5105
|
-
...offlineAttachment,
|
|
5106
|
-
...fileProps
|
|
5107
|
-
}
|
|
5108
|
-
});
|
|
5109
|
-
promise.catch((error2) => {
|
|
5110
|
-
this.client.store.dispatch(removeIssueAttachment(offlineAttachment.offline_id));
|
|
5111
|
-
throw error2;
|
|
5112
|
-
});
|
|
5113
|
-
return [offlineAttachment, promise];
|
|
5114
|
-
}
|
|
5115
|
-
async addComponentAttachment(attachmentPayload) {
|
|
5116
|
-
const { component, file_sha1, offline_id } = attachmentPayload;
|
|
5117
|
-
if (!attachmentPayload.file.objectURL) {
|
|
5118
|
-
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
5119
|
-
}
|
|
5120
|
-
const offlineAttachment = {
|
|
5121
|
-
...attachmentPayload,
|
|
5122
|
-
file: attachmentPayload.file.objectURL,
|
|
5123
|
-
file_name: attachmentPayload.file.name,
|
|
5124
|
-
file_type: attachmentPayload.file.type,
|
|
5125
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5126
|
-
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
5127
|
-
};
|
|
5128
|
-
await this.client.files.addCache(attachmentPayload.file, file_sha1);
|
|
5129
|
-
this.client.store.dispatch(addComponentAttachment(offlineAttachment));
|
|
5130
|
-
const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
|
|
5131
|
-
const promise = this.enqueueRequest({
|
|
5132
|
-
description: "Create attachment",
|
|
5133
|
-
method: HttpMethod.POST,
|
|
5134
|
-
url: `/components/${component}/attach/`,
|
|
5135
|
-
blocks: [offline_id, component],
|
|
5136
|
-
blockers: [file_sha1],
|
|
5137
|
-
payload: {
|
|
5138
|
-
...offlineAttachment,
|
|
5139
|
-
...fileProps
|
|
5140
|
-
}
|
|
5141
|
-
});
|
|
5142
|
-
promise.catch((error2) => {
|
|
5143
|
-
this.client.store.dispatch(removeComponentAttachment(offlineAttachment.offline_id));
|
|
5144
|
-
throw error2;
|
|
5145
|
-
});
|
|
5146
|
-
return [offlineAttachment, promise];
|
|
5147
|
-
}
|
|
5148
|
-
async addComponentTypeAttachment(attachmentPayload) {
|
|
5149
|
-
const { component_type, file_sha1, offline_id } = attachmentPayload;
|
|
5150
|
-
if (!attachmentPayload.file.objectURL) {
|
|
5151
|
-
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
5152
|
-
}
|
|
5153
|
-
const offlineAttachment = {
|
|
5154
|
-
...attachmentPayload,
|
|
5155
|
-
file: attachmentPayload.file.objectURL,
|
|
5156
|
-
file_name: attachmentPayload.file.name,
|
|
5157
|
-
file_type: attachmentPayload.file.type,
|
|
5158
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5159
|
-
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
5160
|
-
};
|
|
5161
|
-
await this.client.files.addCache(attachmentPayload.file, file_sha1);
|
|
5162
|
-
this.client.store.dispatch(addComponentTypeAttachment(offlineAttachment));
|
|
5163
|
-
const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
|
|
5164
|
-
const promise = this.enqueueRequest({
|
|
5165
|
-
description: "Create attachment",
|
|
5166
|
-
method: HttpMethod.POST,
|
|
5167
|
-
url: `/components/types/${component_type}/attach/`,
|
|
5168
|
-
blocks: [offline_id, component_type],
|
|
5169
|
-
blockers: [file_sha1],
|
|
5170
|
-
payload: {
|
|
5171
|
-
...offlineAttachment,
|
|
5172
|
-
...fileProps
|
|
5173
|
-
}
|
|
5174
|
-
});
|
|
5175
|
-
promise.catch((error2) => {
|
|
5176
|
-
this.client.store.dispatch(removeComponentTypeAttachment(offlineAttachment.offline_id));
|
|
5177
|
-
throw error2;
|
|
5178
|
-
});
|
|
5179
|
-
return [offlineAttachment, promise];
|
|
5180
|
-
}
|
|
5181
|
-
async addDocumentAttachment(attachmentPayload) {
|
|
5182
|
-
const { description: description2, document: document2, file_sha1, offline_id } = attachmentPayload;
|
|
5183
|
-
if (!attachmentPayload.file.objectURL) {
|
|
5184
|
-
throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
|
|
5185
|
-
}
|
|
5186
|
-
const offlineAttachment = {
|
|
5187
|
-
...attachmentPayload,
|
|
5188
|
-
file: attachmentPayload.file.objectURL,
|
|
5189
|
-
file_name: attachmentPayload.file.name,
|
|
5190
|
-
file_type: attachmentPayload.file.type,
|
|
5191
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5192
|
-
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
5193
|
-
};
|
|
5194
|
-
await this.client.files.addCache(attachmentPayload.file, file_sha1);
|
|
5195
|
-
this.client.store.dispatch(addDocumentAttachment(offlineAttachment));
|
|
5196
|
-
const [fileProps] = await this.client.files.uploadFileToS3(file_sha1);
|
|
5197
|
-
const promise = this.enqueueRequest({
|
|
5198
|
-
description: "Create attachment",
|
|
5199
|
-
method: HttpMethod.POST,
|
|
5200
|
-
url: `/documents/${document2}/attach/`,
|
|
5201
|
-
blocks: [offline_id, document2],
|
|
5202
|
-
blockers: [file_sha1],
|
|
5203
|
-
payload: {
|
|
5204
|
-
offline_id,
|
|
5205
|
-
document: document2,
|
|
5206
|
-
description: description2 ?? "",
|
|
5207
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5208
|
-
...fileProps
|
|
5209
|
-
}
|
|
5210
|
-
});
|
|
5211
|
-
promise.catch((error2) => {
|
|
5212
|
-
this.client.store.dispatch(removeDocumentAttachment(offlineAttachment.offline_id));
|
|
5213
|
-
throw error2;
|
|
5214
|
-
});
|
|
5215
|
-
return [offlineAttachment, promise];
|
|
5216
|
-
}
|
|
5217
|
-
/** the outer Promise is needed to await the hashing of each file, which is required before offline use. If wanting to
|
|
5218
|
-
* attach promise handlers to the request to add the attachment in the backend, apply it on the promise returned from the
|
|
5219
|
-
* OptimisticModelResult. */
|
|
5220
|
-
attachFilesToIssue(filesToSubmit, issueId) {
|
|
5221
|
-
return filesToSubmit.map((file) => {
|
|
5222
|
-
if (!(file instanceof File)) {
|
|
5223
|
-
throw new Error("Expected a File instance.");
|
|
5224
|
-
}
|
|
5225
|
-
const photoAttachmentPromise = async (file2) => {
|
|
5226
|
-
const hash = await hashFile(file2);
|
|
5227
|
-
const attachment = offline({
|
|
5228
|
-
file: file2,
|
|
5229
|
-
file_name: file2.name,
|
|
5230
|
-
file_type: file2.type,
|
|
5231
|
-
issue: issueId,
|
|
5232
|
-
file_sha1: hash,
|
|
5233
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5234
|
-
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
5235
|
-
});
|
|
5236
|
-
return this.addIssueAttachment(attachment);
|
|
5237
|
-
};
|
|
5238
|
-
return photoAttachmentPromise(file);
|
|
5239
|
-
});
|
|
5240
|
-
}
|
|
5241
|
-
attachFilesToComponent(filesToSubmit, componentId) {
|
|
5242
|
-
return filesToSubmit.map((file) => {
|
|
5243
|
-
if (!(file instanceof File)) {
|
|
5244
|
-
throw new Error("Expected a File instance.");
|
|
5245
|
-
}
|
|
5246
|
-
const photoAttachmentPromise = async (file2) => {
|
|
5247
|
-
const hash = await hashFile(file2);
|
|
5248
|
-
const attachment = offline({
|
|
5249
|
-
file: file2,
|
|
5250
|
-
file_name: file2.name,
|
|
5251
|
-
file_type: file2.type,
|
|
5252
|
-
component: componentId,
|
|
5253
|
-
file_sha1: hash,
|
|
5254
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5255
|
-
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
5256
|
-
});
|
|
5257
|
-
return this.addComponentAttachment(attachment);
|
|
5258
|
-
};
|
|
5259
|
-
return photoAttachmentPromise(file);
|
|
5260
|
-
});
|
|
5261
|
-
}
|
|
5262
|
-
attachFilesToComponentType(filesToSubmit, componentTypeId) {
|
|
5263
|
-
return filesToSubmit.map((file) => {
|
|
5264
|
-
if (!(file instanceof File)) {
|
|
5265
|
-
throw new Error("Expected a File instance.");
|
|
5266
|
-
}
|
|
5267
|
-
const photoAttachmentPromise = async (file2) => {
|
|
5268
|
-
const hash = await hashFile(file2);
|
|
5269
|
-
const attachment = offline({
|
|
5270
|
-
file: file2,
|
|
5271
|
-
file_name: file2.name,
|
|
5272
|
-
file_type: file2.type,
|
|
5273
|
-
component_type: componentTypeId,
|
|
5274
|
-
file_sha1: hash,
|
|
5275
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5276
|
-
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
5277
|
-
});
|
|
5278
|
-
return this.addComponentTypeAttachment(attachment);
|
|
5279
|
-
};
|
|
5280
|
-
return photoAttachmentPromise(file);
|
|
5281
|
-
});
|
|
5282
|
-
}
|
|
5283
|
-
attachFilesToDocument(filesToSubmit, documentId) {
|
|
5284
|
-
return filesToSubmit.map((file) => {
|
|
5285
|
-
if (!(file instanceof File)) {
|
|
5286
|
-
throw new Error("Expected a File instance.");
|
|
5287
|
-
}
|
|
5288
|
-
const photoAttachmentPromise = async (file2) => {
|
|
5289
|
-
const hash = await hashFile(file2);
|
|
5290
|
-
const attachment = offline({
|
|
5291
|
-
file: file2,
|
|
5292
|
-
file_name: file2.name,
|
|
5293
|
-
file_type: file2.type,
|
|
5294
|
-
document: documentId,
|
|
5295
|
-
file_sha1: hash,
|
|
5296
|
-
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5297
|
-
created_by: this.client.store.getState().userReducer.currentUser.id
|
|
5298
|
-
});
|
|
5299
|
-
return this.addDocumentAttachment(attachment);
|
|
5300
|
-
};
|
|
5301
|
-
return photoAttachmentPromise(file);
|
|
5302
|
-
});
|
|
5303
|
-
}
|
|
5304
|
-
async replaceIssueAttachmentFile(attachmentId, newFile) {
|
|
5305
|
-
const { store } = this.client;
|
|
5306
|
-
const attachment = store.getState().issueReducer.attachments[attachmentId];
|
|
5307
|
-
if (!attachment)
|
|
5308
|
-
throw new Error(`Attachment ${attachmentId} not found`);
|
|
5309
|
-
let oldFile = void 0;
|
|
5310
|
-
const newSha1 = await hashFile(newFile);
|
|
5311
|
-
const performRequest2 = async () => {
|
|
5312
|
-
oldFile = await this.client.files.fetchCache(attachment.file_sha1);
|
|
5313
|
-
if (!oldFile) {
|
|
5314
|
-
console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
|
|
5315
|
-
}
|
|
5316
|
-
if (!newFile.objectURL) {
|
|
5317
|
-
throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
|
|
5318
|
-
}
|
|
5319
|
-
store.dispatch(
|
|
5320
|
-
updateIssueAttachment({ ...attachment, file_sha1: newSha1, file: URL.createObjectURL(newFile) })
|
|
5321
|
-
);
|
|
5322
|
-
await this.client.files.addCache(newFile, newSha1);
|
|
5323
|
-
const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
|
|
5324
|
-
store.dispatch(updateIssueAttachment(attachment));
|
|
5115
|
+
const EXPIRING_SOON_THRESHOLD = 1800;
|
|
5116
|
+
function parseTokens(response) {
|
|
5117
|
+
if (!response.access)
|
|
5118
|
+
throw new Error("Missing access token");
|
|
5119
|
+
if (!response.refresh)
|
|
5120
|
+
throw new Error("Missing refresh token");
|
|
5121
|
+
return { accessToken: response.access, refreshToken: response.refresh };
|
|
5122
|
+
}
|
|
5123
|
+
class AuthService extends BaseApiService {
|
|
5124
|
+
constructor() {
|
|
5125
|
+
super(...arguments);
|
|
5126
|
+
__publicField(this, "_getAccessToken", () => this.client.store.getState().authReducer.accessToken);
|
|
5127
|
+
__publicField(this, "_getRefreshToken", () => this.client.store.getState().authReducer.refreshToken);
|
|
5128
|
+
// _getTokenPair and _getRenewedTokens don't need to use enqueueRequest from the BaseApiService because
|
|
5129
|
+
// they are very simple. However, if we need robust error handling or want these operations to queue in the Outbox,
|
|
5130
|
+
// we will use enqueueRequest.
|
|
5131
|
+
/**
|
|
5132
|
+
* Takes credentials and gets a token pair
|
|
5133
|
+
* @async
|
|
5134
|
+
* @param credentials The username and password for obtaining a token pair
|
|
5135
|
+
* @param logoutOnFailure Whether to log out if the request fails
|
|
5136
|
+
* @returns An array containing two elements: 1) a Promise for the access and refresh tokens, and 2) the UUID of the
|
|
5137
|
+
* request, so the request can be cancelled if necessary.
|
|
5138
|
+
*/
|
|
5139
|
+
__publicField(this, "_getTokenPair", (credentials, logoutOnFailure = true) => {
|
|
5140
|
+
const uuid$1 = uuid.v4();
|
|
5141
|
+
const responsePromise = this.enqueueRequest({
|
|
5142
|
+
uuid: uuid$1,
|
|
5143
|
+
description: "Get token pair",
|
|
5144
|
+
method: HttpMethod.POST,
|
|
5145
|
+
url: "/api/token/",
|
|
5146
|
+
payload: credentials,
|
|
5147
|
+
isAuthNeeded: false,
|
|
5148
|
+
checkAuth: false,
|
|
5149
|
+
blockers: [],
|
|
5150
|
+
blocks: []
|
|
5151
|
+
}).then(parseTokens).catch((e) => {
|
|
5152
|
+
if (logoutOnFailure) {
|
|
5153
|
+
void this.logout().then();
|
|
5154
|
+
}
|
|
5325
5155
|
throw e;
|
|
5326
5156
|
});
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5157
|
+
return [responsePromise, uuid$1];
|
|
5158
|
+
});
|
|
5159
|
+
/**
|
|
5160
|
+
* Takes refresh token and gets a new token pair
|
|
5161
|
+
* @async
|
|
5162
|
+
* @param {string} refreshToken The refresh token used to get new tokens
|
|
5163
|
+
* @returns {Promise<TokenPair>} The new access and refresh tokens
|
|
5164
|
+
*/
|
|
5165
|
+
__publicField(this, "_getRenewedTokens", async (refreshToken) => {
|
|
5166
|
+
const promise = this.enqueueRequest({
|
|
5167
|
+
description: "Get renewed tokens",
|
|
5168
|
+
method: HttpMethod.POST,
|
|
5169
|
+
url: "/api/token/refresh/",
|
|
5170
|
+
payload: { refresh: refreshToken },
|
|
5171
|
+
isAuthNeeded: false,
|
|
5172
|
+
blockers: [],
|
|
5173
|
+
blocks: [],
|
|
5174
|
+
// Don't wait for an auth check since this is a refresh token request.
|
|
5175
|
+
checkAuth: false,
|
|
5176
|
+
// Don't wait for other requests to finish, or we might end up in a deadlock.
|
|
5177
|
+
immediate: true
|
|
5178
|
+
}).catch((e) => {
|
|
5179
|
+
console.error("Could not renew tokens; logging out due to error:", e);
|
|
5180
|
+
void this.logout();
|
|
5181
|
+
return void 0;
|
|
5335
5182
|
});
|
|
5183
|
+
let response = void 0;
|
|
5336
5184
|
try {
|
|
5337
|
-
|
|
5338
|
-
void this.client.files.removeCache(attachment.file_sha1);
|
|
5339
|
-
return result;
|
|
5185
|
+
response = await promise;
|
|
5340
5186
|
} catch (e) {
|
|
5341
|
-
|
|
5342
|
-
store.dispatch(
|
|
5343
|
-
updateIssueAttachment({
|
|
5344
|
-
...attachment,
|
|
5345
|
-
file_sha1: attachment.file_sha1,
|
|
5346
|
-
file: URL.createObjectURL(oldFile)
|
|
5347
|
-
})
|
|
5348
|
-
);
|
|
5349
|
-
}
|
|
5350
|
-
throw e;
|
|
5187
|
+
await this.logout();
|
|
5351
5188
|
}
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5189
|
+
if (!response)
|
|
5190
|
+
return void 0;
|
|
5191
|
+
if (!response.access)
|
|
5192
|
+
throw new Error("Missing access token");
|
|
5193
|
+
if (!response.refresh)
|
|
5194
|
+
throw new Error("Missing refresh token");
|
|
5195
|
+
return { accessToken: response.access, refreshToken: response.refresh };
|
|
5196
|
+
});
|
|
5360
5197
|
}
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
const newSha1 = await hashFile(newFile);
|
|
5368
|
-
const performRequest2 = async () => {
|
|
5369
|
-
oldFile = await this.client.files.fetchCache(attachment.file_sha1);
|
|
5370
|
-
if (!oldFile) {
|
|
5371
|
-
console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
|
|
5372
|
-
}
|
|
5373
|
-
if (!newFile.objectURL) {
|
|
5374
|
-
throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
|
|
5375
|
-
}
|
|
5376
|
-
store.dispatch(
|
|
5377
|
-
updateComponentAttachment({ ...attachment, file_sha1: newSha1, file: URL.createObjectURL(newFile) })
|
|
5378
|
-
);
|
|
5379
|
-
await this.client.files.addCache(newFile, newSha1);
|
|
5380
|
-
const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
|
|
5381
|
-
store.dispatch(updateComponentAttachment(attachment));
|
|
5382
|
-
throw e;
|
|
5383
|
-
});
|
|
5384
|
-
const promise2 = this.enqueueRequest({
|
|
5385
|
-
description: "Edit attachment",
|
|
5386
|
-
method: HttpMethod.PATCH,
|
|
5387
|
-
url: `/attachments/components/${attachment.offline_id}/`,
|
|
5388
|
-
isResponseBlob: false,
|
|
5389
|
-
payload: fileProps,
|
|
5390
|
-
blockers: [attachmentId, newSha1],
|
|
5391
|
-
blocks: [attachmentId, newSha1]
|
|
5392
|
-
});
|
|
5393
|
-
try {
|
|
5394
|
-
const result = await promise2;
|
|
5395
|
-
void this.client.files.removeCache(attachment.file_sha1);
|
|
5396
|
-
return result;
|
|
5397
|
-
} catch (e) {
|
|
5398
|
-
if (oldFile) {
|
|
5399
|
-
store.dispatch(
|
|
5400
|
-
updateComponentAttachment({
|
|
5401
|
-
...attachment,
|
|
5402
|
-
file_sha1: attachment.file_sha1,
|
|
5403
|
-
file: URL.createObjectURL(oldFile)
|
|
5404
|
-
})
|
|
5405
|
-
);
|
|
5406
|
-
}
|
|
5407
|
-
throw e;
|
|
5408
|
-
}
|
|
5409
|
-
};
|
|
5410
|
-
const offlineAttachment = {
|
|
5411
|
-
...attachment,
|
|
5412
|
-
file_sha1: newSha1,
|
|
5413
|
-
file: URL.createObjectURL(newFile)
|
|
5414
|
-
};
|
|
5415
|
-
const promise = performRequest2();
|
|
5416
|
-
return [offlineAttachment, promise];
|
|
5417
|
-
}
|
|
5418
|
-
async replaceComponentTypeAttachmentFile(attachmentId, newFile) {
|
|
5419
|
-
const { store } = this.client;
|
|
5420
|
-
const attachment = store.getState().componentTypeReducer.attachments[attachmentId];
|
|
5421
|
-
if (!attachment)
|
|
5422
|
-
throw new Error(`Attachment ${attachmentId} not found`);
|
|
5423
|
-
let oldFile = void 0;
|
|
5424
|
-
const newSha1 = await hashFile(newFile);
|
|
5425
|
-
const performRequest2 = async () => {
|
|
5426
|
-
oldFile = await this.client.files.fetchCache(attachment.file_sha1);
|
|
5427
|
-
if (!oldFile) {
|
|
5428
|
-
console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
|
|
5429
|
-
}
|
|
5430
|
-
if (!newFile.objectURL) {
|
|
5431
|
-
throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
|
|
5432
|
-
}
|
|
5433
|
-
store.dispatch(
|
|
5434
|
-
updateComponentTypeAttachment({
|
|
5435
|
-
...attachment,
|
|
5436
|
-
file_sha1: newSha1,
|
|
5437
|
-
file: URL.createObjectURL(newFile)
|
|
5438
|
-
})
|
|
5439
|
-
);
|
|
5440
|
-
await this.client.files.addCache(newFile, newSha1);
|
|
5441
|
-
const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
|
|
5442
|
-
store.dispatch(updateComponentTypeAttachment(attachment));
|
|
5443
|
-
throw e;
|
|
5444
|
-
});
|
|
5445
|
-
const promise2 = this.enqueueRequest({
|
|
5446
|
-
description: "Edit attachment",
|
|
5447
|
-
method: HttpMethod.PATCH,
|
|
5448
|
-
url: `/attachments/component_types/${attachment.offline_id}/`,
|
|
5449
|
-
isResponseBlob: false,
|
|
5450
|
-
payload: fileProps,
|
|
5451
|
-
blockers: [attachmentId, newSha1],
|
|
5452
|
-
blocks: [attachmentId, newSha1]
|
|
5453
|
-
});
|
|
5454
|
-
try {
|
|
5455
|
-
const result = await promise2;
|
|
5456
|
-
void this.client.files.removeCache(attachment.file_sha1);
|
|
5457
|
-
return result;
|
|
5458
|
-
} catch (e) {
|
|
5459
|
-
if (oldFile) {
|
|
5460
|
-
store.dispatch(
|
|
5461
|
-
updateComponentTypeAttachment({
|
|
5462
|
-
...attachment,
|
|
5463
|
-
file_sha1: attachment.file_sha1,
|
|
5464
|
-
file: URL.createObjectURL(oldFile)
|
|
5465
|
-
})
|
|
5466
|
-
);
|
|
5467
|
-
}
|
|
5468
|
-
throw e;
|
|
5469
|
-
}
|
|
5470
|
-
};
|
|
5471
|
-
const offlineAttachment = {
|
|
5472
|
-
...attachment,
|
|
5473
|
-
file_sha1: newSha1,
|
|
5474
|
-
file: URL.createObjectURL(newFile)
|
|
5475
|
-
};
|
|
5476
|
-
const promise = performRequest2();
|
|
5477
|
-
return [offlineAttachment, promise];
|
|
5478
|
-
}
|
|
5479
|
-
async replaceDocumentAttachmentFile(attachmentId, newFile) {
|
|
5480
|
-
const { store } = this.client;
|
|
5481
|
-
const attachment = store.getState().documentsReducer.attachments[attachmentId];
|
|
5482
|
-
if (!attachment)
|
|
5483
|
-
throw new Error(`Attachment ${attachmentId} not found`);
|
|
5484
|
-
let oldFile = void 0;
|
|
5485
|
-
const newSha1 = await hashFile(newFile);
|
|
5486
|
-
const performRequest2 = async () => {
|
|
5487
|
-
oldFile = await this.client.files.fetchCache(attachment.file_sha1);
|
|
5488
|
-
if (!oldFile) {
|
|
5489
|
-
console.error(`Failed to fetch old file from cache for sha1 ${attachment.file_sha1}.`);
|
|
5490
|
-
}
|
|
5491
|
-
if (!newFile.objectURL) {
|
|
5492
|
-
throw new Error(`newFile["objectURL"] is unexpectedly ${newFile.objectURL}`);
|
|
5493
|
-
}
|
|
5494
|
-
store.dispatch(
|
|
5495
|
-
updateDocumentAttachment({
|
|
5496
|
-
...attachment,
|
|
5497
|
-
file_sha1: newSha1,
|
|
5498
|
-
file: URL.createObjectURL(newFile)
|
|
5499
|
-
})
|
|
5500
|
-
);
|
|
5501
|
-
await this.client.files.addCache(newFile, newSha1);
|
|
5502
|
-
const [fileProps] = await this.client.files.uploadFileToS3(newSha1).catch((e) => {
|
|
5503
|
-
store.dispatch(updateDocumentAttachment(attachment));
|
|
5504
|
-
throw e;
|
|
5505
|
-
});
|
|
5506
|
-
const promise2 = this.enqueueRequest({
|
|
5507
|
-
description: "Edit attachment",
|
|
5508
|
-
method: HttpMethod.PATCH,
|
|
5509
|
-
url: `/attachments/documents/${attachment.offline_id}/`,
|
|
5510
|
-
isResponseBlob: false,
|
|
5511
|
-
payload: fileProps,
|
|
5512
|
-
blockers: [attachmentId, newSha1],
|
|
5513
|
-
blocks: [attachmentId, newSha1]
|
|
5514
|
-
});
|
|
5515
|
-
try {
|
|
5516
|
-
const result = await promise2;
|
|
5517
|
-
void this.client.files.removeCache(attachment.file_sha1);
|
|
5518
|
-
return result;
|
|
5519
|
-
} catch (e) {
|
|
5520
|
-
if (oldFile) {
|
|
5521
|
-
store.dispatch(
|
|
5522
|
-
updateDocumentAttachment({
|
|
5523
|
-
...attachment,
|
|
5524
|
-
file_sha1: attachment.file_sha1,
|
|
5525
|
-
file: URL.createObjectURL(oldFile)
|
|
5526
|
-
})
|
|
5527
|
-
);
|
|
5528
|
-
}
|
|
5529
|
-
throw e;
|
|
5530
|
-
}
|
|
5531
|
-
};
|
|
5532
|
-
const offlineAttachment = {
|
|
5533
|
-
...attachment,
|
|
5534
|
-
file_sha1: newSha1,
|
|
5535
|
-
file: URL.createObjectURL(newFile)
|
|
5536
|
-
};
|
|
5537
|
-
const promise = performRequest2();
|
|
5538
|
-
return [offlineAttachment, promise];
|
|
5539
|
-
}
|
|
5540
|
-
/**
|
|
5541
|
-
* Deletes an attachment and associated data in the cloud, in the Redux store and the cache.
|
|
5542
|
-
* @param issueAttachmentId
|
|
5543
|
-
*/
|
|
5544
|
-
deleteIssueAttachment(issueAttachmentId) {
|
|
5545
|
-
const { store } = this.client;
|
|
5546
|
-
const attachment = selectIssueAttachmentMapping(store.getState())[issueAttachmentId];
|
|
5547
|
-
if (!attachment) {
|
|
5548
|
-
throw new Error(`Attachment ${issueAttachmentId} not found`);
|
|
5549
|
-
}
|
|
5550
|
-
store.dispatch(removeIssueAttachment(issueAttachmentId));
|
|
5551
|
-
void this.client.files.removeCache(attachment.file_sha1);
|
|
5552
|
-
return this.enqueueRequest({
|
|
5553
|
-
description: "Delete attachment",
|
|
5554
|
-
method: HttpMethod.DELETE,
|
|
5555
|
-
url: `/attachments/issues/${issueAttachmentId}/`,
|
|
5556
|
-
blockers: [issueAttachmentId],
|
|
5557
|
-
blocks: [issueAttachmentId]
|
|
5558
|
-
});
|
|
5559
|
-
}
|
|
5560
|
-
deleteComponentAttachment(componentAttachmentId) {
|
|
5561
|
-
const { store } = this.client;
|
|
5562
|
-
const attachment = selectComponentAttachmentMapping(store.getState())[componentAttachmentId];
|
|
5563
|
-
if (!attachment) {
|
|
5564
|
-
throw new Error(`Attachment ${componentAttachmentId} not found`);
|
|
5565
|
-
}
|
|
5566
|
-
store.dispatch(removeComponentAttachment(componentAttachmentId));
|
|
5567
|
-
void this.client.files.removeCache(attachment.file_sha1);
|
|
5568
|
-
return this.enqueueRequest({
|
|
5569
|
-
description: "Delete attachment",
|
|
5570
|
-
method: HttpMethod.DELETE,
|
|
5571
|
-
url: `/attachments/components/${componentAttachmentId}/`,
|
|
5572
|
-
blockers: [componentAttachmentId],
|
|
5573
|
-
blocks: [componentAttachmentId]
|
|
5574
|
-
});
|
|
5575
|
-
}
|
|
5576
|
-
deleteComponentTypeAttachment(componentTypeAttachmentId) {
|
|
5577
|
-
const { store } = this.client;
|
|
5578
|
-
const attachment = selectComponentTypeAttachmentMapping(store.getState())[componentTypeAttachmentId];
|
|
5579
|
-
if (!attachment) {
|
|
5580
|
-
throw new Error(`Attachment ${componentTypeAttachmentId} not found`);
|
|
5581
|
-
}
|
|
5582
|
-
store.dispatch(removeComponentTypeAttachment(componentTypeAttachmentId));
|
|
5583
|
-
void this.client.files.removeCache(attachment.file_sha1);
|
|
5584
|
-
return this.enqueueRequest({
|
|
5585
|
-
description: "Delete attachment",
|
|
5586
|
-
method: HttpMethod.DELETE,
|
|
5587
|
-
url: `/attachments/component_types/${componentTypeAttachmentId}/`,
|
|
5588
|
-
blockers: [componentTypeAttachmentId],
|
|
5589
|
-
blocks: [componentTypeAttachmentId]
|
|
5590
|
-
});
|
|
5591
|
-
}
|
|
5592
|
-
deleteDocumentAttachment(documentAttachmentId) {
|
|
5593
|
-
const { store } = this.client;
|
|
5594
|
-
const attachment = store.getState().documentsReducer.attachments[documentAttachmentId];
|
|
5595
|
-
if (!attachment) {
|
|
5596
|
-
throw new Error(`Attachment ${documentAttachmentId} not found`);
|
|
5597
|
-
}
|
|
5598
|
-
store.dispatch(removeDocumentAttachment(documentAttachmentId));
|
|
5599
|
-
void this.client.files.removeCache(attachment.file_sha1);
|
|
5600
|
-
return this.enqueueRequest({
|
|
5601
|
-
description: "Delete document attachment",
|
|
5602
|
-
method: HttpMethod.DELETE,
|
|
5603
|
-
url: `/attachments/documents/${documentAttachmentId}/`,
|
|
5604
|
-
blockers: [documentAttachmentId],
|
|
5605
|
-
blocks: [documentAttachmentId]
|
|
5606
|
-
});
|
|
5607
|
-
}
|
|
5608
|
-
}
|
|
5609
|
-
const EXPIRING_SOON_THRESHOLD = 1800;
|
|
5610
|
-
function parseTokens(response) {
|
|
5611
|
-
if (!response.access)
|
|
5612
|
-
throw new Error("Missing access token");
|
|
5613
|
-
if (!response.refresh)
|
|
5614
|
-
throw new Error("Missing refresh token");
|
|
5615
|
-
return { accessToken: response.access, refreshToken: response.refresh };
|
|
5616
|
-
}
|
|
5617
|
-
class AuthService extends BaseApiService {
|
|
5618
|
-
constructor() {
|
|
5619
|
-
super(...arguments);
|
|
5620
|
-
__publicField(this, "_getAccessToken", () => this.client.store.getState().authReducer.accessToken);
|
|
5621
|
-
__publicField(this, "_getRefreshToken", () => this.client.store.getState().authReducer.refreshToken);
|
|
5622
|
-
// _getTokenPair and _getRenewedTokens don't need to use enqueueRequest from the BaseApiService because
|
|
5623
|
-
// they are very simple. However, if we need robust error handling or want these operations to queue in the Outbox,
|
|
5624
|
-
// we will use enqueueRequest.
|
|
5625
|
-
/**
|
|
5626
|
-
* Takes credentials and gets a token pair
|
|
5627
|
-
* @async
|
|
5628
|
-
* @param credentials The username and password for obtaining a token pair
|
|
5629
|
-
* @param logoutOnFailure Whether to log out if the request fails
|
|
5630
|
-
* @returns An array containing two elements: 1) a Promise for the access and refresh tokens, and 2) the UUID of the
|
|
5631
|
-
* request, so the request can be cancelled if necessary.
|
|
5632
|
-
*/
|
|
5633
|
-
__publicField(this, "_getTokenPair", (credentials, logoutOnFailure = true) => {
|
|
5634
|
-
const uuid$1 = uuid.v4();
|
|
5635
|
-
const responsePromise = this.enqueueRequest({
|
|
5636
|
-
uuid: uuid$1,
|
|
5637
|
-
description: "Get token pair",
|
|
5638
|
-
method: HttpMethod.POST,
|
|
5639
|
-
url: "/api/token/",
|
|
5640
|
-
payload: credentials,
|
|
5641
|
-
isAuthNeeded: false,
|
|
5642
|
-
checkAuth: false,
|
|
5643
|
-
blockers: [],
|
|
5644
|
-
blocks: []
|
|
5645
|
-
}).then(parseTokens).catch((e) => {
|
|
5646
|
-
if (logoutOnFailure) {
|
|
5647
|
-
void this.logout().then();
|
|
5648
|
-
}
|
|
5649
|
-
throw e;
|
|
5650
|
-
});
|
|
5651
|
-
return [responsePromise, uuid$1];
|
|
5652
|
-
});
|
|
5653
|
-
/**
|
|
5654
|
-
* Takes refresh token and gets a new token pair
|
|
5655
|
-
* @async
|
|
5656
|
-
* @param {string} refreshToken The refresh token used to get new tokens
|
|
5657
|
-
* @returns {Promise<TokenPair>} The new access and refresh tokens
|
|
5658
|
-
*/
|
|
5659
|
-
__publicField(this, "_getRenewedTokens", async (refreshToken) => {
|
|
5660
|
-
const promise = this.enqueueRequest({
|
|
5661
|
-
description: "Get renewed tokens",
|
|
5662
|
-
method: HttpMethod.POST,
|
|
5663
|
-
url: "/api/token/refresh/",
|
|
5664
|
-
payload: { refresh: refreshToken },
|
|
5665
|
-
isAuthNeeded: false,
|
|
5666
|
-
blockers: [],
|
|
5667
|
-
blocks: [],
|
|
5668
|
-
// Don't wait for an auth check since this is a refresh token request.
|
|
5669
|
-
checkAuth: false,
|
|
5670
|
-
// Don't wait for other requests to finish, or we might end up in a deadlock.
|
|
5671
|
-
immediate: true
|
|
5672
|
-
}).catch((e) => {
|
|
5673
|
-
console.error("Could not renew tokens; logging out due to error:", e);
|
|
5674
|
-
void this.logout();
|
|
5675
|
-
return void 0;
|
|
5676
|
-
});
|
|
5677
|
-
let response = void 0;
|
|
5678
|
-
try {
|
|
5679
|
-
response = await promise;
|
|
5680
|
-
} catch (e) {
|
|
5681
|
-
await this.logout();
|
|
5682
|
-
}
|
|
5683
|
-
if (!response)
|
|
5684
|
-
return void 0;
|
|
5685
|
-
if (!response.access)
|
|
5686
|
-
throw new Error("Missing access token");
|
|
5687
|
-
if (!response.refresh)
|
|
5688
|
-
throw new Error("Missing refresh token");
|
|
5689
|
-
return { accessToken: response.access, refreshToken: response.refresh };
|
|
5690
|
-
});
|
|
5691
|
-
}
|
|
5692
|
-
/**
|
|
5693
|
-
* Attempts to log into Hemora using given credentials
|
|
5694
|
-
* @param {string} username
|
|
5695
|
-
* @param {string} password
|
|
5696
|
-
*/
|
|
5697
|
-
async login(username, password) {
|
|
5198
|
+
/**
|
|
5199
|
+
* Attempts to log into Hemora using given credentials
|
|
5200
|
+
* @param {string} username
|
|
5201
|
+
* @param {string} password
|
|
5202
|
+
*/
|
|
5203
|
+
async login(username, password) {
|
|
5698
5204
|
const { store } = this.client;
|
|
5699
5205
|
const [promise, uuid$1] = this._getTokenPair({ username, password }, false);
|
|
5700
5206
|
const initialDataUuid = uuid.v4();
|
|
@@ -6297,55 +5803,270 @@ var __publicField = (obj, key, value) => {
|
|
|
6297
5803
|
store.dispatch(addStages(result));
|
|
6298
5804
|
}
|
|
6299
5805
|
}
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
5806
|
+
const AttachmentModelMeta = {
|
|
5807
|
+
[AttachmentModel.Issue]: {
|
|
5808
|
+
name: "issue",
|
|
5809
|
+
attachUrlPrefix: "/issues",
|
|
5810
|
+
deleteUrlPrefix: "/issues",
|
|
5811
|
+
fetchUrlPostfix: "/issue-attachments"
|
|
5812
|
+
},
|
|
5813
|
+
[AttachmentModel.Component]: {
|
|
5814
|
+
name: "component",
|
|
5815
|
+
attachUrlPrefix: "/components",
|
|
5816
|
+
deleteUrlPrefix: "/components",
|
|
5817
|
+
fetchUrlPostfix: "/component-attachments"
|
|
5818
|
+
},
|
|
5819
|
+
[AttachmentModel.ComponentType]: {
|
|
5820
|
+
name: "component type",
|
|
5821
|
+
attachUrlPrefix: "/components/types",
|
|
5822
|
+
deleteUrlPrefix: "/components/types",
|
|
5823
|
+
fetchUrlPostfix: "/component-type-attachments"
|
|
5824
|
+
},
|
|
5825
|
+
[AttachmentModel.Project]: {
|
|
5826
|
+
name: "component project",
|
|
5827
|
+
attachUrlPrefix: "/projects",
|
|
5828
|
+
deleteUrlPrefix: "/projects",
|
|
5829
|
+
fetchUrlPostfix: "/attachments"
|
|
5830
|
+
},
|
|
5831
|
+
[AttachmentModel.Document]: {
|
|
5832
|
+
name: "document",
|
|
5833
|
+
attachUrlPrefix: "/documents",
|
|
5834
|
+
deleteUrlPrefix: "/documents",
|
|
5835
|
+
fetchUrlPostfix: "/document-attachments"
|
|
5836
|
+
}
|
|
5837
|
+
};
|
|
5838
|
+
class BaseAttachmentService extends BaseApiService {
|
|
5839
|
+
getNumberOfAttachmentsWithSha1(sha1) {
|
|
5840
|
+
const {
|
|
5841
|
+
issueReducer: issueReducer2,
|
|
5842
|
+
componentReducer: componentReducer2,
|
|
5843
|
+
componentTypeReducer: componentTypeReducer2,
|
|
5844
|
+
documentsReducer: documentsReducer2,
|
|
5845
|
+
projectReducer: projectReducer2,
|
|
5846
|
+
formSubmissionReducer: formSubmissionReducer2,
|
|
5847
|
+
formRevisionReducer: formRevisionReducer2
|
|
5848
|
+
} = this.client.store.getState();
|
|
5849
|
+
const objectsWithSha1 = [].concat(
|
|
5850
|
+
Object.values(issueReducer2.attachments),
|
|
5851
|
+
Object.values(componentReducer2.attachments),
|
|
5852
|
+
Object.values(componentTypeReducer2.attachments),
|
|
5853
|
+
Object.values(documentsReducer2.attachments),
|
|
5854
|
+
Object.values(projectReducer2.attachments),
|
|
5855
|
+
Object.values(formRevisionReducer2.attachments),
|
|
5856
|
+
Object.values(formSubmissionReducer2.attachments)
|
|
5857
|
+
);
|
|
5858
|
+
return objectsWithSha1.filter((object) => object.file_sha1 === sha1).length;
|
|
5859
|
+
}
|
|
5860
|
+
processPresignedUrls(presignedUrls) {
|
|
5861
|
+
for (const [sha1, presignedUrl] of Object.entries(presignedUrls)) {
|
|
5862
|
+
void this.enqueueRequest({
|
|
5863
|
+
url: presignedUrl.url,
|
|
5864
|
+
description: "Upload file to S3",
|
|
5865
|
+
method: HttpMethod.POST,
|
|
5866
|
+
isExternalUrl: true,
|
|
5867
|
+
isAuthNeeded: false,
|
|
5868
|
+
attachmentHash: sha1,
|
|
5869
|
+
// TODO: can we use the sha1 as the blocker?
|
|
5870
|
+
blockers: [`s3-${presignedUrl.fields.key}`],
|
|
5871
|
+
blocks: [sha1],
|
|
5872
|
+
s3url: presignedUrl
|
|
5873
|
+
});
|
|
5874
|
+
}
|
|
5875
|
+
}
|
|
5876
|
+
// Note that currently the fetching of attachments for all models dependds on the active projectId. This may change in the future. And
|
|
5877
|
+
// so for some attachment model services, this method will have to be overridden.
|
|
5878
|
+
async getAttachments(actions) {
|
|
6303
5879
|
const { store } = this.client;
|
|
6304
5880
|
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
6305
|
-
|
|
5881
|
+
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
5882
|
+
const result = await this.enqueueRequest({
|
|
5883
|
+
description: `Get ${meta.name} attachments`,
|
|
5884
|
+
method: HttpMethod.GET,
|
|
5885
|
+
url: `/projects/${activeProjectId}${meta.fetchUrlPostfix}/`,
|
|
5886
|
+
blocks: [],
|
|
5887
|
+
blockers: []
|
|
5888
|
+
});
|
|
5889
|
+
store.dispatch(actions.setAttachments(result));
|
|
5890
|
+
}
|
|
5891
|
+
async attachFiles(files, modelId, buildOfflineAttachment, actions) {
|
|
5892
|
+
const { store } = this.client;
|
|
5893
|
+
const currentUser = store.getState().userReducer.currentUser;
|
|
5894
|
+
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5895
|
+
const offlineAttachments = [];
|
|
5896
|
+
const attachmentPayloads = [];
|
|
5897
|
+
const filePayloads = {};
|
|
5898
|
+
for (const file of files) {
|
|
5899
|
+
const sha1 = await hashFile(file);
|
|
5900
|
+
if (!(sha1 in filePayloads)) {
|
|
5901
|
+
filePayloads[sha1] = {
|
|
5902
|
+
sha1,
|
|
5903
|
+
file_type: file.type,
|
|
5904
|
+
extension: file.name.split(".").pop(),
|
|
5905
|
+
size: file.size
|
|
5906
|
+
};
|
|
5907
|
+
await this.client.files.addCache(file, sha1);
|
|
5908
|
+
}
|
|
5909
|
+
const offlineAttachment = buildOfflineAttachment({
|
|
5910
|
+
file,
|
|
5911
|
+
sha1,
|
|
5912
|
+
submittedAt,
|
|
5913
|
+
createdBy: currentUser.id,
|
|
5914
|
+
description: "",
|
|
5915
|
+
modelId
|
|
5916
|
+
});
|
|
5917
|
+
offlineAttachments.push(offlineAttachment);
|
|
5918
|
+
attachmentPayloads.push({
|
|
5919
|
+
offline_id: offlineAttachment.offline_id,
|
|
5920
|
+
name: offlineAttachment.file_name,
|
|
5921
|
+
sha1: offlineAttachment.file_sha1,
|
|
5922
|
+
description: offlineAttachment.description
|
|
5923
|
+
});
|
|
5924
|
+
}
|
|
5925
|
+
store.dispatch(actions.addAttachments(offlineAttachments));
|
|
5926
|
+
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
6306
5927
|
const promise = this.enqueueRequest({
|
|
6307
|
-
description:
|
|
5928
|
+
description: `Attach files to ${meta.name}`,
|
|
6308
5929
|
method: HttpMethod.POST,
|
|
6309
|
-
url:
|
|
6310
|
-
payload: {
|
|
6311
|
-
|
|
6312
|
-
|
|
5930
|
+
url: `${meta.attachUrlPrefix}/${modelId}/attach/`,
|
|
5931
|
+
payload: {
|
|
5932
|
+
submitted_at: submittedAt,
|
|
5933
|
+
attachments: attachmentPayloads,
|
|
5934
|
+
files: Object.values(filePayloads)
|
|
5935
|
+
},
|
|
5936
|
+
blocks: offlineAttachments.map((attachment) => attachment.offline_id),
|
|
5937
|
+
blockers: offlineAttachments.map((attachment) => attachment.file_sha1)
|
|
6313
5938
|
});
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
description: "Update ComponentType",
|
|
6320
|
-
method: HttpMethod.PATCH,
|
|
6321
|
-
url: `/components/types/${componentType.offline_id}/`,
|
|
6322
|
-
payload: componentType,
|
|
6323
|
-
blockers: [componentType.offline_id],
|
|
6324
|
-
blocks: [componentType.offline_id]
|
|
5939
|
+
promise.then(({ attachments, presigned_urls }) => {
|
|
5940
|
+
store.dispatch(actions.updateAttachments(attachments));
|
|
5941
|
+
this.processPresignedUrls(presigned_urls);
|
|
5942
|
+
}).catch(() => {
|
|
5943
|
+
store.dispatch(actions.removeAttachments(offlineAttachments.map((attachment) => attachment.offline_id)));
|
|
6325
5944
|
});
|
|
5945
|
+
return [offlineAttachments, promise.then(({ attachments }) => attachments)];
|
|
6326
5946
|
}
|
|
6327
|
-
async
|
|
5947
|
+
async deleteAttachment(attachmendId, actions, selectors) {
|
|
6328
5948
|
const { store } = this.client;
|
|
6329
|
-
const
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
}
|
|
6334
|
-
const stagesOfComponentType = selectStagesFromComponentType(componentTypeId)(state) ?? [];
|
|
6335
|
-
const attachmentsOfComponentType = selectAttachmentsOfComponentType(componentTypeId)(state);
|
|
6336
|
-
store.dispatch(deleteComponentType(componentTypeId));
|
|
6337
|
-
if (stagesOfComponentType.length > 0) {
|
|
6338
|
-
const stagesOfComponentTypeIds = stagesOfComponentType.map(
|
|
6339
|
-
(componentTypeStage) => componentTypeStage.offline_id
|
|
5949
|
+
const attachment = selectors.selectAttachment(attachmendId)(store.getState());
|
|
5950
|
+
if (!attachment) {
|
|
5951
|
+
throw new Error(
|
|
5952
|
+
`Attempting to delete attachment with offline_id ${attachmendId} that does not exist in the store`
|
|
6340
5953
|
);
|
|
6341
|
-
store.dispatch(removeStages(stagesOfComponentTypeIds));
|
|
6342
|
-
}
|
|
6343
|
-
if (attachmentsOfComponentType.length > 0) {
|
|
6344
|
-
const attachmentsOfComponentTypeIds = attachmentsOfComponentType.map(({ offline_id }) => offline_id);
|
|
6345
|
-
store.dispatch(removeComponentTypeAttachments(attachmentsOfComponentTypeIds));
|
|
6346
5954
|
}
|
|
6347
|
-
|
|
6348
|
-
|
|
5955
|
+
store.dispatch(actions.removeAttachment(attachment.offline_id));
|
|
5956
|
+
const meta = AttachmentModelMeta[this.attachmentModel];
|
|
5957
|
+
const promise = this.enqueueRequest({
|
|
5958
|
+
description: "Delete attachment",
|
|
5959
|
+
method: HttpMethod.DELETE,
|
|
5960
|
+
url: `${meta.deleteUrlPrefix}/attachments/${attachmendId}/`,
|
|
5961
|
+
blockers: [attachmendId],
|
|
5962
|
+
blocks: []
|
|
5963
|
+
});
|
|
5964
|
+
promise.then(() => {
|
|
5965
|
+
if (this.getNumberOfAttachmentsWithSha1(attachment.file_sha1) === 0) {
|
|
5966
|
+
void this.client.files.removeCache(attachment.file_sha1);
|
|
5967
|
+
}
|
|
5968
|
+
}).catch(() => {
|
|
5969
|
+
store.dispatch(actions.setAttachment(attachment));
|
|
5970
|
+
});
|
|
5971
|
+
return promise;
|
|
5972
|
+
}
|
|
5973
|
+
}
|
|
5974
|
+
class ComponentAttachmentService extends BaseAttachmentService {
|
|
5975
|
+
constructor() {
|
|
5976
|
+
super(...arguments);
|
|
5977
|
+
__publicField(this, "attachmentModel", AttachmentModel.Component);
|
|
5978
|
+
}
|
|
5979
|
+
buildOfflineAttachment(data) {
|
|
5980
|
+
return offline({
|
|
5981
|
+
file: URL.createObjectURL(data.file),
|
|
5982
|
+
file_sha1: data.sha1,
|
|
5983
|
+
created_by: data.createdBy,
|
|
5984
|
+
file_name: data.file.name,
|
|
5985
|
+
file_type: data.file.type,
|
|
5986
|
+
submitted_at: data.submittedAt,
|
|
5987
|
+
description: data.description,
|
|
5988
|
+
component: data.modelId
|
|
5989
|
+
});
|
|
5990
|
+
}
|
|
5991
|
+
async attachFilesToComponent(files, componentId) {
|
|
5992
|
+
return this.attachFiles(
|
|
5993
|
+
files,
|
|
5994
|
+
componentId,
|
|
5995
|
+
this.buildOfflineAttachment.bind(this),
|
|
5996
|
+
{
|
|
5997
|
+
addAttachments: addComponentAttachments,
|
|
5998
|
+
updateAttachments: updateComponentAttachments,
|
|
5999
|
+
removeAttachments: removeComponentAttachments
|
|
6000
|
+
}
|
|
6001
|
+
);
|
|
6002
|
+
}
|
|
6003
|
+
deleteComponentAttachment(attachmentId) {
|
|
6004
|
+
return this.deleteAttachment(
|
|
6005
|
+
attachmentId,
|
|
6006
|
+
{
|
|
6007
|
+
setAttachment: setComponentAttachment,
|
|
6008
|
+
removeAttachment: removeComponentAttachment
|
|
6009
|
+
},
|
|
6010
|
+
{
|
|
6011
|
+
selectAttachment: selectComponentAttachment
|
|
6012
|
+
}
|
|
6013
|
+
);
|
|
6014
|
+
}
|
|
6015
|
+
async refreshStore() {
|
|
6016
|
+
return this.getAttachments({
|
|
6017
|
+
setAttachments: setComponentAttachments
|
|
6018
|
+
});
|
|
6019
|
+
}
|
|
6020
|
+
}
|
|
6021
|
+
class ComponentTypeService extends BaseApiService {
|
|
6022
|
+
add(componentType) {
|
|
6023
|
+
const offlineComponentType = offline(componentType);
|
|
6024
|
+
const { store } = this.client;
|
|
6025
|
+
const activeProjectId = store.getState().projectReducer.activeProjectId;
|
|
6026
|
+
store.dispatch(addComponentType(offlineComponentType));
|
|
6027
|
+
const promise = this.enqueueRequest({
|
|
6028
|
+
description: "Create ComponentType",
|
|
6029
|
+
method: HttpMethod.POST,
|
|
6030
|
+
url: `/projects/${activeProjectId}/component-types/`,
|
|
6031
|
+
payload: { ...offlineComponentType },
|
|
6032
|
+
blockers: [],
|
|
6033
|
+
blocks: [offlineComponentType.offline_id]
|
|
6034
|
+
});
|
|
6035
|
+
return [offlineComponentType, promise];
|
|
6036
|
+
}
|
|
6037
|
+
update(componentType) {
|
|
6038
|
+
this.client.store.dispatch(addComponentType(componentType));
|
|
6039
|
+
return this.enqueueRequest({
|
|
6040
|
+
description: "Update ComponentType",
|
|
6041
|
+
method: HttpMethod.PATCH,
|
|
6042
|
+
url: `/components/types/${componentType.offline_id}/`,
|
|
6043
|
+
payload: componentType,
|
|
6044
|
+
blockers: [componentType.offline_id],
|
|
6045
|
+
blocks: [componentType.offline_id]
|
|
6046
|
+
});
|
|
6047
|
+
}
|
|
6048
|
+
async delete(componentTypeId) {
|
|
6049
|
+
const { store } = this.client;
|
|
6050
|
+
const state = store.getState();
|
|
6051
|
+
const componentType = selectComponentType(componentTypeId)(state);
|
|
6052
|
+
if (!componentType) {
|
|
6053
|
+
throw new Error("Expected componentType to exist");
|
|
6054
|
+
}
|
|
6055
|
+
const stagesOfComponentType = selectStagesFromComponentType(componentTypeId)(state) ?? [];
|
|
6056
|
+
const attachmentsOfComponentType = selectAttachmentsOfComponentType(componentTypeId)(state);
|
|
6057
|
+
store.dispatch(deleteComponentType(componentTypeId));
|
|
6058
|
+
if (stagesOfComponentType.length > 0) {
|
|
6059
|
+
const stagesOfComponentTypeIds = stagesOfComponentType.map(
|
|
6060
|
+
(componentTypeStage) => componentTypeStage.offline_id
|
|
6061
|
+
);
|
|
6062
|
+
store.dispatch(removeStages(stagesOfComponentTypeIds));
|
|
6063
|
+
}
|
|
6064
|
+
if (attachmentsOfComponentType.length > 0) {
|
|
6065
|
+
const attachmentsOfComponentTypeIds = attachmentsOfComponentType.map(({ offline_id }) => offline_id);
|
|
6066
|
+
store.dispatch(removeComponentTypeAttachments(attachmentsOfComponentTypeIds));
|
|
6067
|
+
}
|
|
6068
|
+
return this.enqueueRequest({
|
|
6069
|
+
description: "Delete ComponentType",
|
|
6349
6070
|
method: HttpMethod.DELETE,
|
|
6350
6071
|
url: `/components/types/${componentTypeId}/`,
|
|
6351
6072
|
blockers: [componentTypeId],
|
|
@@ -6369,6 +6090,53 @@ var __publicField = (obj, key, value) => {
|
|
|
6369
6090
|
store.dispatch(setComponentTypes(result));
|
|
6370
6091
|
}
|
|
6371
6092
|
}
|
|
6093
|
+
class ComponentTypeAttachmentService extends BaseAttachmentService {
|
|
6094
|
+
constructor() {
|
|
6095
|
+
super(...arguments);
|
|
6096
|
+
__publicField(this, "attachmentModel", AttachmentModel.ComponentType);
|
|
6097
|
+
}
|
|
6098
|
+
buildOfflineAttachment(data) {
|
|
6099
|
+
return offline({
|
|
6100
|
+
file: URL.createObjectURL(data.file),
|
|
6101
|
+
file_sha1: data.sha1,
|
|
6102
|
+
created_by: data.createdBy,
|
|
6103
|
+
file_name: data.file.name,
|
|
6104
|
+
file_type: data.file.type,
|
|
6105
|
+
submitted_at: data.submittedAt,
|
|
6106
|
+
description: data.description,
|
|
6107
|
+
component_type: data.modelId
|
|
6108
|
+
});
|
|
6109
|
+
}
|
|
6110
|
+
async attachFilesToComponentType(files, componentTypeId) {
|
|
6111
|
+
return this.attachFiles(
|
|
6112
|
+
files,
|
|
6113
|
+
componentTypeId,
|
|
6114
|
+
this.buildOfflineAttachment.bind(this),
|
|
6115
|
+
{
|
|
6116
|
+
addAttachments: addComponentTypeAttachments,
|
|
6117
|
+
updateAttachments: updateComponentTypeAttachments,
|
|
6118
|
+
removeAttachments: removeComponentTypeAttachments
|
|
6119
|
+
}
|
|
6120
|
+
);
|
|
6121
|
+
}
|
|
6122
|
+
deleteComponentTypeAttachment(attachmentId) {
|
|
6123
|
+
return this.deleteAttachment(
|
|
6124
|
+
attachmentId,
|
|
6125
|
+
{
|
|
6126
|
+
setAttachment: setComponentTypeAttachment,
|
|
6127
|
+
removeAttachment: removeComponentTypeAttachment
|
|
6128
|
+
},
|
|
6129
|
+
{
|
|
6130
|
+
selectAttachment: selectComponentTypeAttachment
|
|
6131
|
+
}
|
|
6132
|
+
);
|
|
6133
|
+
}
|
|
6134
|
+
async refreshStore() {
|
|
6135
|
+
return this.getAttachments({
|
|
6136
|
+
setAttachments: setComponentTypeAttachments
|
|
6137
|
+
});
|
|
6138
|
+
}
|
|
6139
|
+
}
|
|
6372
6140
|
class IssueCommentService extends BaseApiService {
|
|
6373
6141
|
// Omit author and submitted_at since these will always be set internally
|
|
6374
6142
|
add(comment) {
|
|
@@ -6465,11 +6233,53 @@ var __publicField = (obj, key, value) => {
|
|
|
6465
6233
|
store.dispatch(setIssueUpdates(filteredResult));
|
|
6466
6234
|
}
|
|
6467
6235
|
}
|
|
6236
|
+
class IssueAttachmentService extends BaseAttachmentService {
|
|
6237
|
+
constructor() {
|
|
6238
|
+
super(...arguments);
|
|
6239
|
+
__publicField(this, "attachmentModel", AttachmentModel.Issue);
|
|
6240
|
+
}
|
|
6241
|
+
buildOfflineAttachment(data) {
|
|
6242
|
+
return offline({
|
|
6243
|
+
file: URL.createObjectURL(data.file),
|
|
6244
|
+
file_sha1: data.sha1,
|
|
6245
|
+
created_by: data.createdBy,
|
|
6246
|
+
file_name: data.file.name,
|
|
6247
|
+
file_type: data.file.type,
|
|
6248
|
+
submitted_at: data.submittedAt,
|
|
6249
|
+
description: data.description,
|
|
6250
|
+
issue: data.modelId
|
|
6251
|
+
});
|
|
6252
|
+
}
|
|
6253
|
+
async attachFilesToIssue(files, issueId) {
|
|
6254
|
+
return this.attachFiles(files, issueId, this.buildOfflineAttachment.bind(this), {
|
|
6255
|
+
addAttachments: addIssueAttachments,
|
|
6256
|
+
updateAttachments: updateIssueAttachments,
|
|
6257
|
+
removeAttachments: removeIssueAttachments
|
|
6258
|
+
});
|
|
6259
|
+
}
|
|
6260
|
+
deleteIssueAttachment(attachmentId) {
|
|
6261
|
+
return this.deleteAttachment(
|
|
6262
|
+
attachmentId,
|
|
6263
|
+
{
|
|
6264
|
+
setAttachment: setIssueAttachment,
|
|
6265
|
+
removeAttachment: removeIssueAttachment
|
|
6266
|
+
},
|
|
6267
|
+
{
|
|
6268
|
+
selectAttachment: selectIssueAttachment
|
|
6269
|
+
}
|
|
6270
|
+
);
|
|
6271
|
+
}
|
|
6272
|
+
async refreshStore() {
|
|
6273
|
+
return this.getAttachments({
|
|
6274
|
+
setAttachments: setIssueAttachments
|
|
6275
|
+
});
|
|
6276
|
+
}
|
|
6277
|
+
}
|
|
6468
6278
|
class IssueService extends BaseApiService {
|
|
6469
6279
|
// Basic CRUD functions
|
|
6470
6280
|
// TODO: Once all models are represented in `Created<TModel>`, use `Created` in `OptimisticModelResult`, so we don't
|
|
6471
6281
|
// have to repeat it for all optimistic model results (all optimistic results are created).
|
|
6472
|
-
add(issue,
|
|
6282
|
+
add(issue, issueType = null) {
|
|
6473
6283
|
const { store } = this.client;
|
|
6474
6284
|
const dateWithoutMilliseconds = /* @__PURE__ */ new Date();
|
|
6475
6285
|
const state = store.getState();
|
|
@@ -6496,7 +6306,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6496
6306
|
url: "/issues/",
|
|
6497
6307
|
queryParams: {
|
|
6498
6308
|
workspace_id: workspaceId,
|
|
6499
|
-
...
|
|
6309
|
+
...issueType ? { issue_type: issueType } : {}
|
|
6500
6310
|
},
|
|
6501
6311
|
payload: issuePayload,
|
|
6502
6312
|
blockers: [
|
|
@@ -6633,7 +6443,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6633
6443
|
this.client.store.dispatch(updateIssue(issueToBeUpdated));
|
|
6634
6444
|
this.client.store.dispatch(removeIssueUpdate(offlineIssueUpdate.offline_id));
|
|
6635
6445
|
});
|
|
6636
|
-
const fullIssue =
|
|
6446
|
+
const fullIssue = state.issueReducer.issues[issue.offline_id];
|
|
6637
6447
|
return [fullIssue, promise];
|
|
6638
6448
|
}
|
|
6639
6449
|
async remove(id) {
|
|
@@ -6684,14 +6494,15 @@ var __publicField = (obj, key, value) => {
|
|
|
6684
6494
|
class IssueTypeService extends BaseApiService {
|
|
6685
6495
|
add(payload) {
|
|
6686
6496
|
const { store } = this.client;
|
|
6687
|
-
const
|
|
6497
|
+
const state = store.getState();
|
|
6498
|
+
const activeOrganizationId = state.organizationReducer.activeOrganizationId;
|
|
6688
6499
|
if (!activeOrganizationId) {
|
|
6689
6500
|
throw new Error(`No active organization, got ${activeOrganizationId} for activeOrganizationId.`);
|
|
6690
6501
|
}
|
|
6691
6502
|
const offlineIssueType = offline({
|
|
6692
6503
|
...payload,
|
|
6693
6504
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6694
|
-
created_by:
|
|
6505
|
+
created_by: state.userReducer.currentUser.id,
|
|
6695
6506
|
organization: activeOrganizationId
|
|
6696
6507
|
});
|
|
6697
6508
|
store.dispatch(addIssueType(offlineIssueType));
|
|
@@ -6744,11 +6555,12 @@ var __publicField = (obj, key, value) => {
|
|
|
6744
6555
|
}
|
|
6745
6556
|
delete(issueTypeId) {
|
|
6746
6557
|
const { store } = this.client;
|
|
6747
|
-
const
|
|
6558
|
+
const state = store.getState();
|
|
6559
|
+
const issueTypeToDelete = state.issueTypeReducer.issueTypes[issueTypeId];
|
|
6748
6560
|
if (!issueTypeToDelete) {
|
|
6749
6561
|
throw new Error(`IssueType with offline_id ${issueTypeId} does not exist in the store.`);
|
|
6750
6562
|
}
|
|
6751
|
-
const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(
|
|
6563
|
+
const issuesOfIssueType = selectIssuesOfIssueType(issueTypeId)(state) ?? [];
|
|
6752
6564
|
store.dispatch(removeIssueType(issueTypeId));
|
|
6753
6565
|
store.dispatch(removeIssues(issuesOfIssueType.map((issue) => issue.offline_id)));
|
|
6754
6566
|
const promise = this.enqueueRequest({
|
|
@@ -6797,13 +6609,17 @@ var __publicField = (obj, key, value) => {
|
|
|
6797
6609
|
return result;
|
|
6798
6610
|
});
|
|
6799
6611
|
}
|
|
6800
|
-
async fetchProjectUsers(
|
|
6612
|
+
async fetchProjectUsers() {
|
|
6613
|
+
const projectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
6801
6614
|
return this.enqueueRequest({
|
|
6802
6615
|
description: "Fetch users",
|
|
6803
6616
|
method: HttpMethod.GET,
|
|
6804
6617
|
url: `/projects/${projectId}/users/`,
|
|
6805
6618
|
blockers: [],
|
|
6806
6619
|
blocks: []
|
|
6620
|
+
}).then((users) => {
|
|
6621
|
+
this.client.store.dispatch(addUsers(users));
|
|
6622
|
+
return users;
|
|
6807
6623
|
});
|
|
6808
6624
|
}
|
|
6809
6625
|
async fetchOrganizationUsers(orgId) {
|
|
@@ -6818,11 +6634,12 @@ var __publicField = (obj, key, value) => {
|
|
|
6818
6634
|
// TODO:
|
|
6819
6635
|
// Don't accept updateStore in ComponentService.list. Just return the offline objects and promise. Here, if
|
|
6820
6636
|
// overwrite, use setComponents. Otherwise, use bulkAddComponents.
|
|
6637
|
+
// TODO: This needs major cleanup. Send less in the initial data: Only the basic project info and anything needed
|
|
6638
|
+
// literally immediately.
|
|
6821
6639
|
async _processInitialData(data, overwrite) {
|
|
6822
6640
|
var _a2, _b, _c;
|
|
6823
6641
|
const workspaces = {};
|
|
6824
6642
|
const projects = [];
|
|
6825
|
-
const categories = [];
|
|
6826
6643
|
const projectsData = data.projects;
|
|
6827
6644
|
const { store } = this.client;
|
|
6828
6645
|
const oldProjectId = (_a2 = projectsData.find(
|
|
@@ -6846,18 +6663,12 @@ var __publicField = (obj, key, value) => {
|
|
|
6846
6663
|
isProjectIdValid = true;
|
|
6847
6664
|
for (const workspaceData of projectData.workspaces) {
|
|
6848
6665
|
const workspace = { ...workspaceData, project: projectData.id };
|
|
6849
|
-
if (workspace.categories) {
|
|
6850
|
-
for (const category of workspace.categories) {
|
|
6851
|
-
categories.push(category);
|
|
6852
|
-
}
|
|
6853
|
-
}
|
|
6854
6666
|
delete workspace.categories;
|
|
6855
6667
|
workspaces[workspace.offline_id] = workspace;
|
|
6856
6668
|
}
|
|
6857
6669
|
}
|
|
6858
6670
|
}
|
|
6859
6671
|
store.dispatch(setCurrentUser(data.user));
|
|
6860
|
-
store.dispatch(addUsers(data.project_owners));
|
|
6861
6672
|
store.dispatch(setLicenses(data.licenses));
|
|
6862
6673
|
const organizationsData = data.organizations;
|
|
6863
6674
|
store.dispatch(setOrganizations(organizationsData));
|
|
@@ -6878,8 +6689,11 @@ var __publicField = (obj, key, value) => {
|
|
|
6878
6689
|
currentOrgId = firstOrg.id;
|
|
6879
6690
|
}
|
|
6880
6691
|
if (currentOrgId) {
|
|
6881
|
-
await this.client.organizations.fetchInitialOrganizationData(currentOrgId, false);
|
|
6882
|
-
|
|
6692
|
+
const initialOrgData = await this.client.organizations.fetchInitialOrganizationData(currentOrgId, false);
|
|
6693
|
+
currentOrgId = initialOrgData.organization.id;
|
|
6694
|
+
}
|
|
6695
|
+
if (!currentOrgId) {
|
|
6696
|
+
throw new Error("No organization found");
|
|
6883
6697
|
}
|
|
6884
6698
|
if (!isProjectIdValid) {
|
|
6885
6699
|
if (validProjects.length !== 0) {
|
|
@@ -6889,12 +6703,6 @@ var __publicField = (obj, key, value) => {
|
|
|
6889
6703
|
if (projectData) {
|
|
6890
6704
|
for (const workspaceData of projectData.workspaces) {
|
|
6891
6705
|
const workspace = { ...workspaceData, project: projectData.id };
|
|
6892
|
-
if (workspace.categories) {
|
|
6893
|
-
for (const category of workspace.categories) {
|
|
6894
|
-
categories.push(category);
|
|
6895
|
-
}
|
|
6896
|
-
}
|
|
6897
|
-
delete workspace.categories;
|
|
6898
6706
|
workspaces[workspace.offline_id] = workspace;
|
|
6899
6707
|
}
|
|
6900
6708
|
}
|
|
@@ -6903,13 +6711,6 @@ var __publicField = (obj, key, value) => {
|
|
|
6903
6711
|
store.dispatch(setActiveProjectId(currentProjectId));
|
|
6904
6712
|
}
|
|
6905
6713
|
}
|
|
6906
|
-
if (currentProjectId) {
|
|
6907
|
-
const usersResultPromise = this.fetchProjectUsers(currentProjectId);
|
|
6908
|
-
const projectAccessRefreshPromise = this.client.projectAccesses.refreshStore();
|
|
6909
|
-
const usersResult = await usersResultPromise;
|
|
6910
|
-
await projectAccessRefreshPromise;
|
|
6911
|
-
store.dispatch(addUsers(usersResult));
|
|
6912
|
-
}
|
|
6913
6714
|
let currentWorkspaceId;
|
|
6914
6715
|
const oldWorkspaceId = this.client.store.getState().workspaceReducer.activeWorkspaceId;
|
|
6915
6716
|
if (overwrite || !oldWorkspaceId) {
|
|
@@ -6917,56 +6718,54 @@ var __publicField = (obj, key, value) => {
|
|
|
6917
6718
|
} else {
|
|
6918
6719
|
currentWorkspaceId = oldWorkspaceId;
|
|
6919
6720
|
}
|
|
6920
|
-
if (currentWorkspaceId
|
|
6721
|
+
if (currentWorkspaceId) {
|
|
6921
6722
|
store.dispatch(setActiveWorkspaceId(currentWorkspaceId));
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
});
|
|
6926
|
-
});
|
|
6723
|
+
}
|
|
6724
|
+
if (currentProjectId) {
|
|
6725
|
+
void this.client.projectAccesses.refreshStore();
|
|
6927
6726
|
void this.client.projectFiles.refreshStore();
|
|
6928
|
-
void this.client.
|
|
6929
|
-
|
|
6930
|
-
|
|
6727
|
+
void this.client.projectAttachments.refreshStore();
|
|
6728
|
+
let issuesPromise;
|
|
6729
|
+
void Promise.allSettled([
|
|
6730
|
+
this.client.categories.refreshStore(),
|
|
6731
|
+
this.client.issueTypes.refreshStore()
|
|
6732
|
+
]).then(() => {
|
|
6733
|
+
issuesPromise = this.client.issues.refreshStore();
|
|
6734
|
+
});
|
|
6735
|
+
void Promise.allSettled([
|
|
6736
|
+
this.client.componentTypes.refreshStore(),
|
|
6737
|
+
this.client.componentStages.refreshStore()
|
|
6738
|
+
]).then(() => {
|
|
6739
|
+
void this.client.components.refreshStore(overwrite).then(() => {
|
|
6740
|
+
void this.client.componentStageCompletions.refreshStore();
|
|
6741
|
+
void this.client.componentTypeAttachments.refreshStore();
|
|
6742
|
+
void this.client.componentAttachments.refreshStore();
|
|
6931
6743
|
});
|
|
6932
6744
|
});
|
|
6745
|
+
void this.client.documents.refreshStore().then(() => {
|
|
6746
|
+
void this.client.documentAttachments.refreshStore();
|
|
6747
|
+
});
|
|
6933
6748
|
void this.client.userForms.refreshStore().then(() => {
|
|
6934
6749
|
void this.client.userFormSubmissions.refreshStore();
|
|
6935
6750
|
});
|
|
6936
|
-
}
|
|
6937
|
-
if (currentProjectId) {
|
|
6938
|
-
const [_offlineAttachments, promise] = this.client.attachments.fetchAll(currentProjectId);
|
|
6939
|
-
void promise.then((result) => {
|
|
6940
|
-
const {
|
|
6941
|
-
issue_attachments,
|
|
6942
|
-
component_type_attachments,
|
|
6943
|
-
component_attachments,
|
|
6944
|
-
project_attachments,
|
|
6945
|
-
document_attachments
|
|
6946
|
-
} = result;
|
|
6947
|
-
store.dispatch(setIssueAttachments(issue_attachments));
|
|
6948
|
-
store.dispatch(setComponentAttachments(component_attachments));
|
|
6949
|
-
store.dispatch(setComponentTypeAttachments(component_type_attachments));
|
|
6950
|
-
store.dispatch(setProjectAttachments(project_attachments));
|
|
6951
|
-
store.dispatch(setDocumentAttachments(document_attachments));
|
|
6952
|
-
});
|
|
6953
|
-
void this.client.documents.refreshStore();
|
|
6954
|
-
void this.client.issueUpdates.refreshStore();
|
|
6955
|
-
void this.client.issueTypes.refreshStore();
|
|
6956
6751
|
void this.client.agent.refreshStore();
|
|
6752
|
+
void this.fetchProjectUsers();
|
|
6753
|
+
await issuesPromise;
|
|
6754
|
+
void this.client.issueAttachments.refreshStore();
|
|
6755
|
+
void this.client.issueComments.refreshStore();
|
|
6756
|
+
void this.client.issueUpdates.refreshStore();
|
|
6957
6757
|
}
|
|
6758
|
+
void this.client.teams.refreshStore();
|
|
6958
6759
|
store.dispatch(setIsFetchingInitialData(false));
|
|
6959
6760
|
if (overwrite) {
|
|
6960
6761
|
console.log("Overwriting data");
|
|
6961
6762
|
store.dispatch(setProjects(projects));
|
|
6962
6763
|
store.dispatch(setWorkspaces(workspaces));
|
|
6963
|
-
store.dispatch(setCategories(categories));
|
|
6964
6764
|
store.dispatch(resetRecentIssues());
|
|
6965
6765
|
} else {
|
|
6966
6766
|
console.log("Updating data (collisions will be replaced)");
|
|
6967
6767
|
store.dispatch(addOrReplaceProjects(projects));
|
|
6968
6768
|
store.dispatch(addOrReplaceWorkspaces(workspaces));
|
|
6969
|
-
store.dispatch(addOrReplaceCategories(categories));
|
|
6970
6769
|
}
|
|
6971
6770
|
}
|
|
6972
6771
|
}
|
|
@@ -7052,6 +6851,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7052
6851
|
});
|
|
7053
6852
|
return promise;
|
|
7054
6853
|
}
|
|
6854
|
+
// TODO: This needs to be seperated into a update and create method
|
|
7055
6855
|
saveActive() {
|
|
7056
6856
|
const { store } = this.client;
|
|
7057
6857
|
const state = store.getState();
|
|
@@ -7117,6 +6917,48 @@ var __publicField = (obj, key, value) => {
|
|
|
7117
6917
|
});
|
|
7118
6918
|
}
|
|
7119
6919
|
}
|
|
6920
|
+
class ProjectAttachmentService extends BaseAttachmentService {
|
|
6921
|
+
constructor() {
|
|
6922
|
+
super(...arguments);
|
|
6923
|
+
__publicField(this, "attachmentModel", AttachmentModel.Project);
|
|
6924
|
+
}
|
|
6925
|
+
buildOfflineAttachment(data) {
|
|
6926
|
+
return offline({
|
|
6927
|
+
file: URL.createObjectURL(data.file),
|
|
6928
|
+
file_sha1: data.sha1,
|
|
6929
|
+
created_by: data.createdBy,
|
|
6930
|
+
file_name: data.file.name,
|
|
6931
|
+
file_type: data.file.type,
|
|
6932
|
+
submitted_at: data.submittedAt,
|
|
6933
|
+
description: data.description,
|
|
6934
|
+
project: data.modelId
|
|
6935
|
+
});
|
|
6936
|
+
}
|
|
6937
|
+
async attachFilesToProject(files, projectId) {
|
|
6938
|
+
return this.attachFiles(files, projectId, this.buildOfflineAttachment.bind(this), {
|
|
6939
|
+
addAttachments: addProjectAttachments,
|
|
6940
|
+
updateAttachments: updateProjectAttachments,
|
|
6941
|
+
removeAttachments: removeProjectAttachments
|
|
6942
|
+
});
|
|
6943
|
+
}
|
|
6944
|
+
deleteProjectAttachment(attachmentId) {
|
|
6945
|
+
return this.deleteAttachment(
|
|
6946
|
+
attachmentId,
|
|
6947
|
+
{
|
|
6948
|
+
setAttachment: setProjectAttachment,
|
|
6949
|
+
removeAttachment: removeProjectAttachment
|
|
6950
|
+
},
|
|
6951
|
+
{
|
|
6952
|
+
selectAttachment: selectProjectAttachment
|
|
6953
|
+
}
|
|
6954
|
+
);
|
|
6955
|
+
}
|
|
6956
|
+
async refreshStore() {
|
|
6957
|
+
return this.getAttachments({
|
|
6958
|
+
setAttachments: setProjectAttachments
|
|
6959
|
+
});
|
|
6960
|
+
}
|
|
6961
|
+
}
|
|
7120
6962
|
class ProjectService extends BaseApiService {
|
|
7121
6963
|
/**
|
|
7122
6964
|
* Creates a new project. Due to the nature of project creation,
|
|
@@ -8508,6 +8350,48 @@ var __publicField = (obj, key, value) => {
|
|
|
8508
8350
|
store.dispatch(addDocuments(await organizationDocumentsPromise));
|
|
8509
8351
|
}
|
|
8510
8352
|
}
|
|
8353
|
+
class DocumentAttachmentService extends BaseAttachmentService {
|
|
8354
|
+
constructor() {
|
|
8355
|
+
super(...arguments);
|
|
8356
|
+
__publicField(this, "attachmentModel", AttachmentModel.Document);
|
|
8357
|
+
}
|
|
8358
|
+
buildOfflineAttachment(data) {
|
|
8359
|
+
return offline({
|
|
8360
|
+
file: URL.createObjectURL(data.file),
|
|
8361
|
+
file_sha1: data.sha1,
|
|
8362
|
+
created_by: data.createdBy,
|
|
8363
|
+
file_name: data.file.name,
|
|
8364
|
+
file_type: data.file.type,
|
|
8365
|
+
submitted_at: data.submittedAt,
|
|
8366
|
+
description: data.description,
|
|
8367
|
+
document: data.modelId
|
|
8368
|
+
});
|
|
8369
|
+
}
|
|
8370
|
+
async attachFilesToDocument(files, documentId) {
|
|
8371
|
+
return this.attachFiles(files, documentId, this.buildOfflineAttachment.bind(this), {
|
|
8372
|
+
addAttachments: addDocumentAttachments,
|
|
8373
|
+
updateAttachments: updateDocumentAttachments,
|
|
8374
|
+
removeAttachments: removeDocumentAttachments
|
|
8375
|
+
});
|
|
8376
|
+
}
|
|
8377
|
+
deleteDocumentAttachment(attachmentId) {
|
|
8378
|
+
return this.deleteAttachment(
|
|
8379
|
+
attachmentId,
|
|
8380
|
+
{
|
|
8381
|
+
setAttachment: setDocumentAttachment,
|
|
8382
|
+
removeAttachment: removeDocumentAttachment
|
|
8383
|
+
},
|
|
8384
|
+
{
|
|
8385
|
+
selectAttachment: selectDocumentAttachment
|
|
8386
|
+
}
|
|
8387
|
+
);
|
|
8388
|
+
}
|
|
8389
|
+
async refreshStore() {
|
|
8390
|
+
return this.getAttachments({
|
|
8391
|
+
setAttachments: setDocumentAttachments
|
|
8392
|
+
});
|
|
8393
|
+
}
|
|
8394
|
+
}
|
|
8511
8395
|
class AgentService extends BaseApiService {
|
|
8512
8396
|
async startConversation(prompt) {
|
|
8513
8397
|
const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
@@ -8742,7 +8626,6 @@ var __publicField = (obj, key, value) => {
|
|
|
8742
8626
|
__publicField(this, "store");
|
|
8743
8627
|
__publicField(this, "agent", new AgentService(this));
|
|
8744
8628
|
__publicField(this, "files", new FileService(this));
|
|
8745
|
-
__publicField(this, "attachments", new AttachmentService(this));
|
|
8746
8629
|
__publicField(this, "auth", new AuthService(this));
|
|
8747
8630
|
__publicField(this, "categories", new CategoryService(this));
|
|
8748
8631
|
__publicField(this, "projectAccesses", new ProjectAccessService(this));
|
|
@@ -8752,21 +8635,26 @@ var __publicField = (obj, key, value) => {
|
|
|
8752
8635
|
__publicField(this, "issueTypes", new IssueTypeService(this));
|
|
8753
8636
|
__publicField(this, "issueComments", new IssueCommentService(this));
|
|
8754
8637
|
__publicField(this, "issueUpdates", new IssueUpdateService(this));
|
|
8638
|
+
__publicField(this, "issueAttachments", new IssueAttachmentService(this));
|
|
8755
8639
|
__publicField(this, "workspaces", new WorkspaceService(this));
|
|
8756
8640
|
__publicField(this, "main", new MainService(this));
|
|
8757
8641
|
__publicField(this, "components", new ComponentService(this));
|
|
8642
|
+
__publicField(this, "componentAttachments", new ComponentAttachmentService(this));
|
|
8758
8643
|
__publicField(this, "componentTypes", new ComponentTypeService(this));
|
|
8644
|
+
__publicField(this, "componentTypeAttachments", new ComponentTypeAttachmentService(this));
|
|
8759
8645
|
__publicField(this, "componentStages", new ComponentStageService(this));
|
|
8760
8646
|
__publicField(this, "componentStageCompletions", new ComponentStageCompletionService(this));
|
|
8761
8647
|
__publicField(this, "userForms", new UserFormService(this));
|
|
8762
8648
|
__publicField(this, "userFormSubmissions", new UserFormSubmissionService(this));
|
|
8763
8649
|
__publicField(this, "projects", new ProjectService(this));
|
|
8764
8650
|
__publicField(this, "projectFiles", new ProjectFileService(this));
|
|
8651
|
+
__publicField(this, "projectAttachments", new ProjectAttachmentService(this));
|
|
8765
8652
|
__publicField(this, "emailVerification", new EmailVerificationService(this));
|
|
8766
8653
|
__publicField(this, "emailDomains", new EmailDomainsService(this));
|
|
8767
8654
|
__publicField(this, "licenses", new LicenseService(this));
|
|
8768
8655
|
__publicField(this, "documents", new DocumentService(this));
|
|
8769
8656
|
__publicField(this, "teams", new TeamService(this));
|
|
8657
|
+
__publicField(this, "documentAttachments", new DocumentAttachmentService(this));
|
|
8770
8658
|
this.API_URL = apiUrl;
|
|
8771
8659
|
this.store = store;
|
|
8772
8660
|
}
|
|
@@ -8948,406 +8836,152 @@ var __publicField = (obj, key, value) => {
|
|
|
8948
8836
|
saveAs(blob, name);
|
|
8949
8837
|
},
|
|
8950
8838
|
[name, file]
|
|
8951
|
-
);
|
|
8952
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8953
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8954
|
-
"button",
|
|
8955
|
-
{
|
|
8956
|
-
className: styles$c.FullScreenImageContainer,
|
|
8957
|
-
type: "button",
|
|
8958
|
-
onClick: () => {
|
|
8959
|
-
setShowPreview(false);
|
|
8960
|
-
},
|
|
8961
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8962
|
-
"img",
|
|
8963
|
-
{
|
|
8964
|
-
className: styles$c.FullScreenImage,
|
|
8965
|
-
src: url,
|
|
8966
|
-
alt: name,
|
|
8967
|
-
onClick: (e) => {
|
|
8968
|
-
e.stopPropagation();
|
|
8969
|
-
}
|
|
8970
|
-
}
|
|
8971
|
-
)
|
|
8972
|
-
}
|
|
8973
|
-
),
|
|
8974
|
-
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$c.TopBarContainer, align: "center", children: [
|
|
8975
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8976
|
-
blocks.IconButton,
|
|
8977
|
-
{
|
|
8978
|
-
className: styles$c.longIconButton,
|
|
8979
|
-
variant: "soft",
|
|
8980
|
-
"aria-label": "Exit preview",
|
|
8981
|
-
onClick: () => {
|
|
8982
|
-
setShowPreview(false);
|
|
8983
|
-
},
|
|
8984
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiArrowLeftLine" })
|
|
8985
|
-
}
|
|
8986
|
-
),
|
|
8987
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$c.fileName, children: name }),
|
|
8988
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8989
|
-
blocks.IconButton,
|
|
8990
|
-
{
|
|
8991
|
-
className: styles$c.longIconButton,
|
|
8992
|
-
variant: "soft",
|
|
8993
|
-
"aria-label": `Download ${name}`,
|
|
8994
|
-
onClick: handleDownload,
|
|
8995
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiDownload2Line" })
|
|
8996
|
-
}
|
|
8997
|
-
)
|
|
8998
|
-
] })
|
|
8999
|
-
] });
|
|
9000
|
-
});
|
|
9001
|
-
FullScreenImagePreview.displayName = "FullScreenImagePreview";
|
|
9002
|
-
const InputWithLabel = (props) => {
|
|
9003
|
-
const { label, children, size, severity, inputId, labelId, image, flexProps } = props;
|
|
9004
|
-
const [resolvedImage, setResolvedImage] = React.useState(void 0);
|
|
9005
|
-
const [showImagePreview, setShowImagePreview] = React.useState(false);
|
|
9006
|
-
React.useEffect(() => {
|
|
9007
|
-
if (image instanceof Promise) {
|
|
9008
|
-
image.then(setResolvedImage).catch(console.error);
|
|
9009
|
-
} else {
|
|
9010
|
-
setResolvedImage(image);
|
|
9011
|
-
}
|
|
9012
|
-
}, [image]);
|
|
9013
|
-
const resolvedImageURL = resolvedImage ? URL.createObjectURL(resolvedImage) : void 0;
|
|
9014
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "2", children: [
|
|
9015
|
-
resolvedImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9016
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9017
|
-
"img",
|
|
9018
|
-
{
|
|
9019
|
-
className: styles$c.previewImage,
|
|
9020
|
-
src: resolvedImageURL,
|
|
9021
|
-
alt: resolvedImage.name,
|
|
9022
|
-
onClick: () => {
|
|
9023
|
-
setShowImagePreview(true);
|
|
9024
|
-
}
|
|
9025
|
-
}
|
|
9026
|
-
),
|
|
9027
|
-
showImagePreview && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9028
|
-
FullScreenImagePreview,
|
|
9029
|
-
{
|
|
9030
|
-
file: resolvedImage,
|
|
9031
|
-
url: resolvedImageURL,
|
|
9032
|
-
name: resolvedImage.name,
|
|
9033
|
-
setShowPreview: setShowImagePreview
|
|
9034
|
-
}
|
|
9035
|
-
)
|
|
9036
|
-
] }),
|
|
9037
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", gap: "1", asChild: true, ...flexProps, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, children: [
|
|
9038
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size, severity, id: labelId, children: label }),
|
|
9039
|
-
children
|
|
9040
|
-
] }) })
|
|
9041
|
-
] });
|
|
9042
|
-
};
|
|
9043
|
-
const InputWithHelpText = (props) => {
|
|
9044
|
-
const { helpText, children, severity } = props;
|
|
9045
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "1", children: [
|
|
9046
|
-
children,
|
|
9047
|
-
/* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "1", severity, className: styles$c.description, children: helpText }) })
|
|
9048
|
-
] });
|
|
9049
|
-
};
|
|
9050
|
-
const InputWithLabelAndHelpText = (props) => {
|
|
9051
|
-
const { children, ...restProps } = props;
|
|
9052
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InputWithHelpText, { ...restProps, children });
|
|
9053
|
-
};
|
|
9054
|
-
const useFormikInput = (props) => {
|
|
9055
|
-
const { id, field, formId: formId2, size, showInputOnly, ...rest } = props;
|
|
9056
|
-
const [fieldProps, meta, helpers] = formik.useField(field.getId());
|
|
9057
|
-
const { touched } = meta;
|
|
9058
|
-
const helpText = meta.error ?? field.description;
|
|
9059
|
-
const severity = meta.error ? "danger" : void 0;
|
|
9060
|
-
const inputId = id ?? `${formId2}-${field.getId()}-input`;
|
|
9061
|
-
const labelId = `${inputId}-label`;
|
|
9062
|
-
const label = field.required ? `${field.label} *` : field.label;
|
|
9063
|
-
const fieldPropsWithValidation = React.useMemo(() => {
|
|
9064
|
-
const handleChange = (e) => {
|
|
9065
|
-
const value = field.getValueFromChangeEvent(e);
|
|
9066
|
-
void helpers.setValue(value, false).then();
|
|
9067
|
-
if (touched || !field.onlyValidateAfterTouched) {
|
|
9068
|
-
helpers.setError(field.getError(value));
|
|
9069
|
-
}
|
|
9070
|
-
};
|
|
9071
|
-
const handleBlur = (e) => {
|
|
9072
|
-
void helpers.setTouched(true, false).then();
|
|
9073
|
-
helpers.setError(field.getError(field.getValueFromChangeEvent(e)));
|
|
9074
|
-
};
|
|
9075
|
-
return {
|
|
9076
|
-
...fieldProps,
|
|
9077
|
-
onChange: handleChange,
|
|
9078
|
-
onBlur: handleBlur
|
|
9079
|
-
};
|
|
9080
|
-
}, [field, fieldProps, helpers, touched]);
|
|
9081
|
-
return [
|
|
9082
|
-
{
|
|
9083
|
-
helpText,
|
|
9084
|
-
size,
|
|
9085
|
-
severity,
|
|
9086
|
-
inputId,
|
|
9087
|
-
labelId,
|
|
9088
|
-
label,
|
|
9089
|
-
showInputOnly,
|
|
9090
|
-
fieldProps: fieldPropsWithValidation,
|
|
9091
|
-
helpers,
|
|
9092
|
-
field
|
|
9093
|
-
},
|
|
9094
|
-
{ ...rest, "aria-labelledby": labelId }
|
|
9095
|
-
];
|
|
9096
|
-
};
|
|
9097
|
-
const truthyValues = [true, "true"];
|
|
9098
|
-
const BooleanInput = React.memo((props) => {
|
|
9099
|
-
const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
|
|
9100
|
-
let [{ helpText, label }] = useFormikInput(props);
|
|
9101
|
-
helpText = showInputOnly ? null : helpText;
|
|
9102
|
-
label = showInputOnly ? "" : label;
|
|
9103
|
-
const color = blocks.useSeverityColor(severity);
|
|
9104
|
-
const value = truthyValues.includes(fieldProps.value);
|
|
9105
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9106
|
-
InputWithLabel,
|
|
9107
|
-
{
|
|
9108
|
-
size,
|
|
9109
|
-
severity,
|
|
9110
|
-
inputId,
|
|
9111
|
-
labelId,
|
|
9112
|
-
label,
|
|
9113
|
-
image: showInputOnly ? void 0 : field.image,
|
|
9114
|
-
flexProps: { direction: "row-reverse", justify: "end", align: "center", gap: "2" },
|
|
9115
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9116
|
-
blocks.Checkbox,
|
|
9117
|
-
{
|
|
9118
|
-
...rest,
|
|
9119
|
-
...fieldProps,
|
|
9120
|
-
id: inputId,
|
|
9121
|
-
color,
|
|
9122
|
-
value: value.toString(),
|
|
9123
|
-
checked: value,
|
|
9124
|
-
onCheckedChange: fieldProps.onChange,
|
|
9125
|
-
onChange: void 0,
|
|
9126
|
-
onBlur: void 0
|
|
9127
|
-
}
|
|
9128
|
-
)
|
|
9129
|
-
}
|
|
9130
|
-
) });
|
|
9131
|
-
});
|
|
9132
|
-
BooleanInput.displayName = "BooleanInput";
|
|
9133
|
-
var DefaultContext = {
|
|
9134
|
-
color: void 0,
|
|
9135
|
-
size: void 0,
|
|
9136
|
-
className: void 0,
|
|
9137
|
-
style: void 0,
|
|
9138
|
-
attr: void 0
|
|
9139
|
-
};
|
|
9140
|
-
var IconContext = React.createContext && /* @__PURE__ */ React.createContext(DefaultContext);
|
|
9141
|
-
var _excluded = ["attr", "size", "title"];
|
|
9142
|
-
function _objectWithoutProperties(source, excluded) {
|
|
9143
|
-
if (source == null)
|
|
9144
|
-
return {};
|
|
9145
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
9146
|
-
var key, i;
|
|
9147
|
-
if (Object.getOwnPropertySymbols) {
|
|
9148
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
9149
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
9150
|
-
key = sourceSymbolKeys[i];
|
|
9151
|
-
if (excluded.indexOf(key) >= 0)
|
|
9152
|
-
continue;
|
|
9153
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
9154
|
-
continue;
|
|
9155
|
-
target[key] = source[key];
|
|
9156
|
-
}
|
|
9157
|
-
}
|
|
9158
|
-
return target;
|
|
9159
|
-
}
|
|
9160
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
9161
|
-
if (source == null)
|
|
9162
|
-
return {};
|
|
9163
|
-
var target = {};
|
|
9164
|
-
for (var key in source) {
|
|
9165
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9166
|
-
if (excluded.indexOf(key) >= 0)
|
|
9167
|
-
continue;
|
|
9168
|
-
target[key] = source[key];
|
|
9169
|
-
}
|
|
9170
|
-
}
|
|
9171
|
-
return target;
|
|
9172
|
-
}
|
|
9173
|
-
function _extends$1() {
|
|
9174
|
-
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
|
|
9175
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
9176
|
-
var source = arguments[i];
|
|
9177
|
-
for (var key in source) {
|
|
9178
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9179
|
-
target[key] = source[key];
|
|
9180
|
-
}
|
|
9181
|
-
}
|
|
9182
|
-
}
|
|
9183
|
-
return target;
|
|
9184
|
-
};
|
|
9185
|
-
return _extends$1.apply(this, arguments);
|
|
9186
|
-
}
|
|
9187
|
-
function ownKeys(e, r) {
|
|
9188
|
-
var t = Object.keys(e);
|
|
9189
|
-
if (Object.getOwnPropertySymbols) {
|
|
9190
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
9191
|
-
r && (o = o.filter(function(r2) {
|
|
9192
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
9193
|
-
})), t.push.apply(t, o);
|
|
9194
|
-
}
|
|
9195
|
-
return t;
|
|
9196
|
-
}
|
|
9197
|
-
function _objectSpread(e) {
|
|
9198
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
9199
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
9200
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
9201
|
-
_defineProperty(e, r2, t[r2]);
|
|
9202
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
9203
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
9204
|
-
});
|
|
9205
|
-
}
|
|
9206
|
-
return e;
|
|
9207
|
-
}
|
|
9208
|
-
function _defineProperty(obj, key, value) {
|
|
9209
|
-
key = _toPropertyKey(key);
|
|
9210
|
-
if (key in obj) {
|
|
9211
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
9212
|
-
} else {
|
|
9213
|
-
obj[key] = value;
|
|
9214
|
-
}
|
|
9215
|
-
return obj;
|
|
9216
|
-
}
|
|
9217
|
-
function _toPropertyKey(t) {
|
|
9218
|
-
var i = _toPrimitive(t, "string");
|
|
9219
|
-
return "symbol" == typeof i ? i : i + "";
|
|
9220
|
-
}
|
|
9221
|
-
function _toPrimitive(t, r) {
|
|
9222
|
-
if ("object" != typeof t || !t)
|
|
9223
|
-
return t;
|
|
9224
|
-
var e = t[Symbol.toPrimitive];
|
|
9225
|
-
if (void 0 !== e) {
|
|
9226
|
-
var i = e.call(t, r || "default");
|
|
9227
|
-
if ("object" != typeof i)
|
|
9228
|
-
return i;
|
|
9229
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
9230
|
-
}
|
|
9231
|
-
return ("string" === r ? String : Number)(t);
|
|
9232
|
-
}
|
|
9233
|
-
function Tree2Element(tree) {
|
|
9234
|
-
return tree && tree.map((node, i) => /* @__PURE__ */ React.createElement(node.tag, _objectSpread({
|
|
9235
|
-
key: i
|
|
9236
|
-
}, node.attr), Tree2Element(node.child)));
|
|
9237
|
-
}
|
|
9238
|
-
function GenIcon(data) {
|
|
9239
|
-
return (props) => /* @__PURE__ */ React.createElement(IconBase, _extends$1({
|
|
9240
|
-
attr: _objectSpread({}, data.attr)
|
|
9241
|
-
}, props), Tree2Element(data.child));
|
|
9242
|
-
}
|
|
9243
|
-
function IconBase(props) {
|
|
9244
|
-
var elem = (conf) => {
|
|
9245
|
-
var {
|
|
9246
|
-
attr,
|
|
9247
|
-
size,
|
|
9248
|
-
title: title2
|
|
9249
|
-
} = props, svgProps = _objectWithoutProperties(props, _excluded);
|
|
9250
|
-
var computedSize = size || conf.size || "1em";
|
|
9251
|
-
var className;
|
|
9252
|
-
if (conf.className)
|
|
9253
|
-
className = conf.className;
|
|
9254
|
-
if (props.className)
|
|
9255
|
-
className = (className ? className + " " : "") + props.className;
|
|
9256
|
-
return /* @__PURE__ */ React.createElement("svg", _extends$1({
|
|
9257
|
-
stroke: "currentColor",
|
|
9258
|
-
fill: "currentColor",
|
|
9259
|
-
strokeWidth: "0"
|
|
9260
|
-
}, conf.attr, attr, svgProps, {
|
|
9261
|
-
className,
|
|
9262
|
-
style: _objectSpread(_objectSpread({
|
|
9263
|
-
color: props.color || conf.color
|
|
9264
|
-
}, conf.style), props.style),
|
|
9265
|
-
height: computedSize,
|
|
9266
|
-
width: computedSize,
|
|
9267
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
9268
|
-
}), title2 && /* @__PURE__ */ React.createElement("title", null, title2), props.children);
|
|
9269
|
-
};
|
|
9270
|
-
return IconContext !== void 0 ? /* @__PURE__ */ React.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
|
9271
|
-
}
|
|
9272
|
-
function RiArrowDownLine(props) {
|
|
9273
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z" }, "child": [] }] })(props);
|
|
9274
|
-
}
|
|
9275
|
-
function RiArrowUpLine(props) {
|
|
9276
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z" }, "child": [] }] })(props);
|
|
9277
|
-
}
|
|
9278
|
-
function RiCalendarLine(props) {
|
|
9279
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z" }, "child": [] }] })(props);
|
|
9280
|
-
}
|
|
9281
|
-
function RiQrCodeLine(props) {
|
|
9282
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M16 17V16H13V13H16V15H18V17H17V19H15V21H13V18H15V17H16ZM21 21H17V19H19V17H21V21ZM3 3H11V11H3V3ZM5 5V9H9V5H5ZM13 3H21V11H13V3ZM15 5V9H19V5H15ZM3 13H11V21H3V13ZM5 15V19H9V15H5ZM18 13H21V15H18V13ZM6 6H8V8H6V6ZM6 16H8V18H6V16ZM16 6H18V8H16V6Z" }, "child": [] }] })(props);
|
|
9283
|
-
}
|
|
9284
|
-
function RiFileCopyLine(props) {
|
|
9285
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z" }, "child": [] }] })(props);
|
|
9286
|
-
}
|
|
9287
|
-
function RiAlignJustify(props) {
|
|
9288
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z" }, "child": [] }] })(props);
|
|
9289
|
-
}
|
|
9290
|
-
function RiHashtag(props) {
|
|
9291
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M7.78428 14L8.2047 10H4V8H8.41491L8.94043 3H10.9514L10.4259 8H14.4149L14.9404 3H16.9514L16.4259 8H20V10H16.2157L15.7953 14H20V16H15.5851L15.0596 21H13.0486L13.5741 16H9.58509L9.05957 21H7.04855L7.57407 16H4V14H7.78428ZM9.7953 14H13.7843L14.2047 10H10.2157L9.7953 14Z" }, "child": [] }] })(props);
|
|
9292
|
-
}
|
|
9293
|
-
function RiInputField(props) {
|
|
9294
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z" }, "child": [] }] })(props);
|
|
9295
|
-
}
|
|
9296
|
-
function RiListCheck(props) {
|
|
9297
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 4H21V6H8V4ZM3 3.5H6V6.5H3V3.5ZM3 10.5H6V13.5H3V10.5ZM3 17.5H6V20.5H3V17.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z" }, "child": [] }] })(props);
|
|
9298
|
-
}
|
|
9299
|
-
function RiImageLine(props) {
|
|
9300
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918ZM20 15V5H4V19L14 9L20 15ZM20 17.8284L14 11.8284L6.82843 19H20V17.8284ZM8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11Z" }, "child": [] }] })(props);
|
|
9301
|
-
}
|
|
9302
|
-
function RiCheckboxCircleLine(props) {
|
|
9303
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
|
|
9304
|
-
}
|
|
9305
|
-
function RiCheckboxLine(props) {
|
|
9306
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
|
|
9307
|
-
}
|
|
9308
|
-
function RiDeleteBin2Line(props) {
|
|
9309
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM13.4142 13.9997L15.182 15.7675L13.7678 17.1817L12 15.4139L10.2322 17.1817L8.81802 15.7675L10.5858 13.9997L8.81802 12.232L10.2322 10.8178L12 12.5855L13.7678 10.8178L15.182 12.232L13.4142 13.9997ZM9 4V6H15V4H9Z" }, "child": [] }] })(props);
|
|
9310
|
-
}
|
|
9311
|
-
function RiMenuFoldLine(props) {
|
|
9312
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M21 17.9995V19.9995H3V17.9995H21ZM6.59619 3.90332L8.01041 5.31753L4.82843 8.49951L8.01041 11.6815L6.59619 13.0957L2 8.49951L6.59619 3.90332ZM21 10.9995V12.9995H12V10.9995H21ZM21 3.99951V5.99951H12V3.99951H21Z" }, "child": [] }] })(props);
|
|
9313
|
-
}
|
|
9314
|
-
function RiUpload2Line(props) {
|
|
9315
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM13 9V16H11V9H6L12 3L18 9H13Z" }, "child": [] }] })(props);
|
|
9316
|
-
}
|
|
9317
|
-
const emptyBooleanField = {
|
|
9318
|
-
...emptyBaseField,
|
|
9319
|
-
type: "boolean"
|
|
8839
|
+
);
|
|
8840
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8841
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8842
|
+
"button",
|
|
8843
|
+
{
|
|
8844
|
+
className: styles$c.FullScreenImageContainer,
|
|
8845
|
+
type: "button",
|
|
8846
|
+
onClick: () => {
|
|
8847
|
+
setShowPreview(false);
|
|
8848
|
+
},
|
|
8849
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8850
|
+
"img",
|
|
8851
|
+
{
|
|
8852
|
+
className: styles$c.FullScreenImage,
|
|
8853
|
+
src: url,
|
|
8854
|
+
alt: name,
|
|
8855
|
+
onClick: (e) => {
|
|
8856
|
+
e.stopPropagation();
|
|
8857
|
+
}
|
|
8858
|
+
}
|
|
8859
|
+
)
|
|
8860
|
+
}
|
|
8861
|
+
),
|
|
8862
|
+
/* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$c.TopBarContainer, align: "center", children: [
|
|
8863
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8864
|
+
blocks.IconButton,
|
|
8865
|
+
{
|
|
8866
|
+
className: styles$c.longIconButton,
|
|
8867
|
+
variant: "soft",
|
|
8868
|
+
"aria-label": "Exit preview",
|
|
8869
|
+
onClick: () => {
|
|
8870
|
+
setShowPreview(false);
|
|
8871
|
+
},
|
|
8872
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiArrowLeftLine" })
|
|
8873
|
+
}
|
|
8874
|
+
),
|
|
8875
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$c.fileName, children: name }),
|
|
8876
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8877
|
+
blocks.IconButton,
|
|
8878
|
+
{
|
|
8879
|
+
className: styles$c.longIconButton,
|
|
8880
|
+
variant: "soft",
|
|
8881
|
+
"aria-label": `Download ${name}`,
|
|
8882
|
+
onClick: handleDownload,
|
|
8883
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiDownload2Line" })
|
|
8884
|
+
}
|
|
8885
|
+
)
|
|
8886
|
+
] })
|
|
8887
|
+
] });
|
|
8888
|
+
});
|
|
8889
|
+
FullScreenImagePreview.displayName = "FullScreenImagePreview";
|
|
8890
|
+
const InputWithLabel = (props) => {
|
|
8891
|
+
const { label, children, size, severity, inputId, labelId, image, flexProps } = props;
|
|
8892
|
+
const [resolvedImage, setResolvedImage] = React.useState(void 0);
|
|
8893
|
+
const [showImagePreview, setShowImagePreview] = React.useState(false);
|
|
8894
|
+
React.useEffect(() => {
|
|
8895
|
+
if (image instanceof Promise) {
|
|
8896
|
+
image.then(setResolvedImage).catch(console.error);
|
|
8897
|
+
} else {
|
|
8898
|
+
setResolvedImage(image);
|
|
8899
|
+
}
|
|
8900
|
+
}, [image]);
|
|
8901
|
+
const resolvedImageURL = resolvedImage ? URL.createObjectURL(resolvedImage) : void 0;
|
|
8902
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "2", children: [
|
|
8903
|
+
resolvedImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8904
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8905
|
+
"img",
|
|
8906
|
+
{
|
|
8907
|
+
className: styles$c.previewImage,
|
|
8908
|
+
src: resolvedImageURL,
|
|
8909
|
+
alt: resolvedImage.name,
|
|
8910
|
+
onClick: () => {
|
|
8911
|
+
setShowImagePreview(true);
|
|
8912
|
+
}
|
|
8913
|
+
}
|
|
8914
|
+
),
|
|
8915
|
+
showImagePreview && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8916
|
+
FullScreenImagePreview,
|
|
8917
|
+
{
|
|
8918
|
+
file: resolvedImage,
|
|
8919
|
+
url: resolvedImageURL,
|
|
8920
|
+
name: resolvedImage.name,
|
|
8921
|
+
setShowPreview: setShowImagePreview
|
|
8922
|
+
}
|
|
8923
|
+
)
|
|
8924
|
+
] }),
|
|
8925
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", gap: "1", asChild: true, ...flexProps, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: inputId, children: [
|
|
8926
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size, severity, id: labelId, children: label }),
|
|
8927
|
+
children
|
|
8928
|
+
] }) })
|
|
8929
|
+
] });
|
|
9320
8930
|
};
|
|
9321
|
-
const
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
}
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
8931
|
+
const InputWithHelpText = (props) => {
|
|
8932
|
+
const { helpText, children, severity } = props;
|
|
8933
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "1", children: [
|
|
8934
|
+
children,
|
|
8935
|
+
/* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "1", severity, className: styles$c.description, children: helpText }) })
|
|
8936
|
+
] });
|
|
8937
|
+
};
|
|
8938
|
+
const InputWithLabelAndHelpText = (props) => {
|
|
8939
|
+
const { children, ...restProps } = props;
|
|
8940
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputWithHelpText, { ...restProps, children });
|
|
8941
|
+
};
|
|
8942
|
+
const useFormikInput = (props) => {
|
|
8943
|
+
const { id, field, formId: formId2, size, showInputOnly, ...rest } = props;
|
|
8944
|
+
const [fieldProps, meta, helpers] = formik.useField(field.getId());
|
|
8945
|
+
const { touched } = meta;
|
|
8946
|
+
const helpText = meta.error ?? field.description;
|
|
8947
|
+
const severity = meta.error ? "danger" : void 0;
|
|
8948
|
+
const inputId = id ?? `${formId2}-${field.getId()}-input`;
|
|
8949
|
+
const labelId = `${inputId}-label`;
|
|
8950
|
+
const label = field.required ? `${field.label} *` : field.label;
|
|
8951
|
+
const fieldPropsWithValidation = React.useMemo(() => {
|
|
8952
|
+
const handleChange = (e) => {
|
|
8953
|
+
const value = field.getValueFromChangeEvent(e);
|
|
8954
|
+
void helpers.setValue(value, false).then();
|
|
8955
|
+
if (touched || !field.onlyValidateAfterTouched) {
|
|
8956
|
+
helpers.setError(field.getError(value));
|
|
8957
|
+
}
|
|
8958
|
+
};
|
|
8959
|
+
const handleBlur = (e) => {
|
|
8960
|
+
void helpers.setTouched(true, false).then();
|
|
8961
|
+
helpers.setError(field.getError(field.getValueFromChangeEvent(e)));
|
|
8962
|
+
};
|
|
8963
|
+
return {
|
|
8964
|
+
...fieldProps,
|
|
8965
|
+
onChange: handleChange,
|
|
8966
|
+
onBlur: handleBlur
|
|
8967
|
+
};
|
|
8968
|
+
}, [field, fieldProps, helpers, touched]);
|
|
8969
|
+
return [
|
|
8970
|
+
{
|
|
8971
|
+
helpText,
|
|
8972
|
+
size,
|
|
8973
|
+
severity,
|
|
8974
|
+
inputId,
|
|
8975
|
+
labelId,
|
|
8976
|
+
label,
|
|
8977
|
+
showInputOnly,
|
|
8978
|
+
fieldProps: fieldPropsWithValidation,
|
|
8979
|
+
helpers,
|
|
8980
|
+
field
|
|
8981
|
+
},
|
|
8982
|
+
{ ...rest, "aria-labelledby": labelId }
|
|
8983
|
+
];
|
|
9346
8984
|
};
|
|
9347
|
-
__publicField(_BooleanField, "fieldTypeName", "Checkbox");
|
|
9348
|
-
__publicField(_BooleanField, "fieldTypeDescription", "Perfect for both optional and required yes/no questions.");
|
|
9349
|
-
__publicField(_BooleanField, "Icon", RiCheckboxCircleLine);
|
|
9350
|
-
let BooleanField = _BooleanField;
|
|
9351
8985
|
function getDefaultExportFromCjs(x) {
|
|
9352
8986
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
9353
8987
|
}
|
|
@@ -9400,8 +9034,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9400
9034
|
})(classnames);
|
|
9401
9035
|
var classnamesExports = classnames.exports;
|
|
9402
9036
|
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
9403
|
-
function _extends() {
|
|
9404
|
-
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
9037
|
+
function _extends$1() {
|
|
9038
|
+
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
|
|
9405
9039
|
for (var i = 1; i < arguments.length; i++) {
|
|
9406
9040
|
var source = arguments[i];
|
|
9407
9041
|
for (var key in source) {
|
|
@@ -9412,7 +9046,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9412
9046
|
}
|
|
9413
9047
|
return target;
|
|
9414
9048
|
};
|
|
9415
|
-
return _extends.apply(this, arguments);
|
|
9049
|
+
return _extends$1.apply(this, arguments);
|
|
9416
9050
|
}
|
|
9417
9051
|
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
9418
9052
|
return function handleEvent(event) {
|
|
@@ -9543,11 +9177,11 @@ var __publicField = (obj, key, value) => {
|
|
|
9543
9177
|
} else
|
|
9544
9178
|
return child;
|
|
9545
9179
|
});
|
|
9546
|
-
return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
9180
|
+
return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends$1({}, slotProps, {
|
|
9547
9181
|
ref: forwardedRef
|
|
9548
9182
|
}), /* @__PURE__ */ React.isValidElement(newElement) ? /* @__PURE__ */ React.cloneElement(newElement, void 0, newChildren) : null);
|
|
9549
9183
|
}
|
|
9550
|
-
return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
9184
|
+
return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends$1({}, slotProps, {
|
|
9551
9185
|
ref: forwardedRef
|
|
9552
9186
|
}), children);
|
|
9553
9187
|
});
|
|
@@ -9625,7 +9259,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9625
9259
|
React.useEffect(() => {
|
|
9626
9260
|
window[Symbol.for("radix-ui")] = true;
|
|
9627
9261
|
}, []);
|
|
9628
|
-
return /* @__PURE__ */ React.createElement(Comp, _extends({}, primitiveProps, {
|
|
9262
|
+
return /* @__PURE__ */ React.createElement(Comp, _extends$1({}, primitiveProps, {
|
|
9629
9263
|
ref: forwardedRef
|
|
9630
9264
|
}));
|
|
9631
9265
|
});
|
|
@@ -10184,9 +9818,9 @@ var __publicField = (obj, key, value) => {
|
|
|
10184
9818
|
return React__namespace.createElement("div", { ...insetProps, ref: forwardedRef, className: classNames("rt-Inset", className, withBreakpoints(side, "rt-r-side"), withBreakpoints(clip, "rt-r-clip"), withBreakpoints(p, "rt-r-p"), withBreakpoints(px, "rt-r-px"), withBreakpoints(py, "rt-r-py"), withBreakpoints(pt, "rt-r-pt"), withBreakpoints(pr, "rt-r-pr"), withBreakpoints(pb, "rt-r-pb"), withBreakpoints(pl, "rt-r-pl"), withMarginProps(marginProps)) });
|
|
10185
9819
|
});
|
|
10186
9820
|
Inset.displayName = "Inset";
|
|
10187
|
-
const sizes$
|
|
9821
|
+
const sizes$9 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
10188
9822
|
const headingPropDefs = {
|
|
10189
|
-
size: { type: "enum", values: sizes$
|
|
9823
|
+
size: { type: "enum", values: sizes$9, default: "6", responsive: true },
|
|
10190
9824
|
weight: { ...weightProp, default: "bold" },
|
|
10191
9825
|
align: alignProp,
|
|
10192
9826
|
trim: trimProp,
|
|
@@ -10199,9 +9833,9 @@ var __publicField = (obj, key, value) => {
|
|
|
10199
9833
|
return React__namespace.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { "data-accent-color": color, ...headingProps, ref: forwardedRef, className: classNames("rt-Heading", className, withBreakpoints(size, "rt-r-size"), withBreakpoints(weight, "rt-r-weight"), withBreakpoints(align, "rt-r-ta"), withBreakpoints(trim, "rt-r-lt"), { "rt-high-contrast": highContrast }, withMarginProps(marginProps)) }, asChild ? children : React__namespace.createElement(Tag, null, children));
|
|
10200
9834
|
});
|
|
10201
9835
|
Heading.displayName = "Heading";
|
|
10202
|
-
const sizes$
|
|
9836
|
+
const sizes$8 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
10203
9837
|
const textPropDefs = {
|
|
10204
|
-
size: { type: "enum", values: sizes$
|
|
9838
|
+
size: { type: "enum", values: sizes$8, default: void 0, responsive: true },
|
|
10205
9839
|
weight: weightProp,
|
|
10206
9840
|
align: alignProp,
|
|
10207
9841
|
trim: trimProp,
|
|
@@ -10214,11 +9848,11 @@ var __publicField = (obj, key, value) => {
|
|
|
10214
9848
|
return React__namespace.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { "data-accent-color": color, ...textProps, ref: forwardedRef, className: classNames("rt-Text", className, withBreakpoints(size, "rt-r-size"), withBreakpoints(weight, "rt-r-weight"), withBreakpoints(align, "rt-r-ta"), withBreakpoints(trim, "rt-r-lt"), { "rt-high-contrast": highContrast }, withMarginProps(marginProps)) }, asChild ? children : React__namespace.createElement(Tag, null, children));
|
|
10215
9849
|
});
|
|
10216
9850
|
Text.displayName = "Text";
|
|
10217
|
-
const sizes$
|
|
10218
|
-
const variants$
|
|
9851
|
+
const sizes$7 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
9852
|
+
const variants$5 = ["solid", "soft", "outline", "ghost"];
|
|
10219
9853
|
const codePropDefs = {
|
|
10220
|
-
size: { type: "enum", values: sizes$
|
|
10221
|
-
variant: { type: "enum", values: variants$
|
|
9854
|
+
size: { type: "enum", values: sizes$7, default: void 0, responsive: true },
|
|
9855
|
+
variant: { type: "enum", values: variants$5, default: "soft" },
|
|
10222
9856
|
weight: weightProp,
|
|
10223
9857
|
color: colorProp,
|
|
10224
9858
|
highContrast: highContrastProp
|
|
@@ -10248,6 +9882,202 @@ var __publicField = (obj, key, value) => {
|
|
|
10248
9882
|
value
|
|
10249
9883
|
]);
|
|
10250
9884
|
}
|
|
9885
|
+
const $e698a72e93240346$var$CHECKBOX_NAME = "Checkbox";
|
|
9886
|
+
const [$e698a72e93240346$var$createCheckboxContext, $e698a72e93240346$export$b566c4ff5488ea01] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($e698a72e93240346$var$CHECKBOX_NAME);
|
|
9887
|
+
const [$e698a72e93240346$var$CheckboxProvider, $e698a72e93240346$var$useCheckboxContext] = $e698a72e93240346$var$createCheckboxContext($e698a72e93240346$var$CHECKBOX_NAME);
|
|
9888
|
+
const $e698a72e93240346$export$48513f6b9f8ce62d = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
|
|
9889
|
+
const { __scopeCheckbox, name, checked: checkedProp, defaultChecked, required, disabled, value = "on", onCheckedChange, ...checkboxProps } = props;
|
|
9890
|
+
const [button, setButton] = React.useState(null);
|
|
9891
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
|
|
9892
|
+
forwardedRef,
|
|
9893
|
+
(node) => setButton(node)
|
|
9894
|
+
);
|
|
9895
|
+
const hasConsumerStoppedPropagationRef = React.useRef(false);
|
|
9896
|
+
const isFormControl = button ? Boolean(button.closest("form")) : true;
|
|
9897
|
+
const [checked = false, setChecked] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
9898
|
+
prop: checkedProp,
|
|
9899
|
+
defaultProp: defaultChecked,
|
|
9900
|
+
onChange: onCheckedChange
|
|
9901
|
+
});
|
|
9902
|
+
const initialCheckedStateRef = React.useRef(checked);
|
|
9903
|
+
React.useEffect(() => {
|
|
9904
|
+
const form = button === null || button === void 0 ? void 0 : button.form;
|
|
9905
|
+
if (form) {
|
|
9906
|
+
const reset = () => setChecked(initialCheckedStateRef.current);
|
|
9907
|
+
form.addEventListener("reset", reset);
|
|
9908
|
+
return () => form.removeEventListener("reset", reset);
|
|
9909
|
+
}
|
|
9910
|
+
}, [
|
|
9911
|
+
button,
|
|
9912
|
+
setChecked
|
|
9913
|
+
]);
|
|
9914
|
+
return /* @__PURE__ */ React.createElement($e698a72e93240346$var$CheckboxProvider, {
|
|
9915
|
+
scope: __scopeCheckbox,
|
|
9916
|
+
state: checked,
|
|
9917
|
+
disabled
|
|
9918
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
|
|
9919
|
+
type: "button",
|
|
9920
|
+
role: "checkbox",
|
|
9921
|
+
"aria-checked": $e698a72e93240346$var$isIndeterminate(checked) ? "mixed" : checked,
|
|
9922
|
+
"aria-required": required,
|
|
9923
|
+
"data-state": $e698a72e93240346$var$getState(checked),
|
|
9924
|
+
"data-disabled": disabled ? "" : void 0,
|
|
9925
|
+
disabled,
|
|
9926
|
+
value
|
|
9927
|
+
}, checkboxProps, {
|
|
9928
|
+
ref: composedRefs,
|
|
9929
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
|
|
9930
|
+
if (event.key === "Enter")
|
|
9931
|
+
event.preventDefault();
|
|
9932
|
+
}),
|
|
9933
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, (event) => {
|
|
9934
|
+
setChecked(
|
|
9935
|
+
(prevChecked) => $e698a72e93240346$var$isIndeterminate(prevChecked) ? true : !prevChecked
|
|
9936
|
+
);
|
|
9937
|
+
if (isFormControl) {
|
|
9938
|
+
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
9939
|
+
if (!hasConsumerStoppedPropagationRef.current)
|
|
9940
|
+
event.stopPropagation();
|
|
9941
|
+
}
|
|
9942
|
+
})
|
|
9943
|
+
})), isFormControl && /* @__PURE__ */ React.createElement($e698a72e93240346$var$BubbleInput, {
|
|
9944
|
+
control: button,
|
|
9945
|
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
9946
|
+
name,
|
|
9947
|
+
value,
|
|
9948
|
+
checked,
|
|
9949
|
+
required,
|
|
9950
|
+
disabled,
|
|
9951
|
+
style: {
|
|
9952
|
+
transform: "translateX(-100%)"
|
|
9953
|
+
}
|
|
9954
|
+
}));
|
|
9955
|
+
});
|
|
9956
|
+
const $e698a72e93240346$var$INDICATOR_NAME = "CheckboxIndicator";
|
|
9957
|
+
const $e698a72e93240346$export$59aad738f51d1c05 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
|
|
9958
|
+
const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
|
|
9959
|
+
const context = $e698a72e93240346$var$useCheckboxContext($e698a72e93240346$var$INDICATOR_NAME, __scopeCheckbox);
|
|
9960
|
+
return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
9961
|
+
present: forceMount || $e698a72e93240346$var$isIndeterminate(context.state) || context.state === true
|
|
9962
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
|
|
9963
|
+
"data-state": $e698a72e93240346$var$getState(context.state),
|
|
9964
|
+
"data-disabled": context.disabled ? "" : void 0
|
|
9965
|
+
}, indicatorProps, {
|
|
9966
|
+
ref: forwardedRef,
|
|
9967
|
+
style: {
|
|
9968
|
+
pointerEvents: "none",
|
|
9969
|
+
...props.style
|
|
9970
|
+
}
|
|
9971
|
+
})));
|
|
9972
|
+
});
|
|
9973
|
+
const $e698a72e93240346$var$BubbleInput = (props) => {
|
|
9974
|
+
const { control, checked, bubbles = true, ...inputProps } = props;
|
|
9975
|
+
const ref = React.useRef(null);
|
|
9976
|
+
const prevChecked = $010c2913dbd2fe3d$export$5cae361ad82dce8b(checked);
|
|
9977
|
+
const controlSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(control);
|
|
9978
|
+
React.useEffect(() => {
|
|
9979
|
+
const input = ref.current;
|
|
9980
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
9981
|
+
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
|
|
9982
|
+
const setChecked = descriptor.set;
|
|
9983
|
+
if (prevChecked !== checked && setChecked) {
|
|
9984
|
+
const event = new Event("click", {
|
|
9985
|
+
bubbles
|
|
9986
|
+
});
|
|
9987
|
+
input.indeterminate = $e698a72e93240346$var$isIndeterminate(checked);
|
|
9988
|
+
setChecked.call(input, $e698a72e93240346$var$isIndeterminate(checked) ? false : checked);
|
|
9989
|
+
input.dispatchEvent(event);
|
|
9990
|
+
}
|
|
9991
|
+
}, [
|
|
9992
|
+
prevChecked,
|
|
9993
|
+
checked,
|
|
9994
|
+
bubbles
|
|
9995
|
+
]);
|
|
9996
|
+
return /* @__PURE__ */ React.createElement("input", _extends$1({
|
|
9997
|
+
type: "checkbox",
|
|
9998
|
+
"aria-hidden": true,
|
|
9999
|
+
defaultChecked: $e698a72e93240346$var$isIndeterminate(checked) ? false : checked
|
|
10000
|
+
}, inputProps, {
|
|
10001
|
+
tabIndex: -1,
|
|
10002
|
+
ref,
|
|
10003
|
+
style: {
|
|
10004
|
+
...props.style,
|
|
10005
|
+
...controlSize,
|
|
10006
|
+
position: "absolute",
|
|
10007
|
+
pointerEvents: "none",
|
|
10008
|
+
opacity: 0,
|
|
10009
|
+
margin: 0
|
|
10010
|
+
}
|
|
10011
|
+
}));
|
|
10012
|
+
};
|
|
10013
|
+
function $e698a72e93240346$var$isIndeterminate(checked) {
|
|
10014
|
+
return checked === "indeterminate";
|
|
10015
|
+
}
|
|
10016
|
+
function $e698a72e93240346$var$getState(checked) {
|
|
10017
|
+
return $e698a72e93240346$var$isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
10018
|
+
}
|
|
10019
|
+
const $e698a72e93240346$export$be92b6f5f03c0fe9 = $e698a72e93240346$export$48513f6b9f8ce62d;
|
|
10020
|
+
const $e698a72e93240346$export$adb584737d712b70 = $e698a72e93240346$export$59aad738f51d1c05;
|
|
10021
|
+
const sizes$6 = ["1", "2", "3"];
|
|
10022
|
+
const variants$4 = ["classic", "surface", "soft"];
|
|
10023
|
+
const checkboxPropDefs = {
|
|
10024
|
+
size: { type: "enum", values: sizes$6, default: "2", responsive: true },
|
|
10025
|
+
variant: { type: "enum", values: variants$4, default: "surface" },
|
|
10026
|
+
color: colorProp,
|
|
10027
|
+
highContrast: highContrastProp
|
|
10028
|
+
};
|
|
10029
|
+
const ThickCheckIcon = React__namespace.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
|
|
10030
|
+
return React__namespace.createElement(
|
|
10031
|
+
"svg",
|
|
10032
|
+
{ width: "9", height: "9", viewBox: "0 0 9 9", fill: color, xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
|
|
10033
|
+
React__namespace.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z" })
|
|
10034
|
+
);
|
|
10035
|
+
});
|
|
10036
|
+
ThickCheckIcon.displayName = "ThickCheckIcon";
|
|
10037
|
+
const ChevronDownIcon = React__namespace.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
|
|
10038
|
+
return React__namespace.createElement(
|
|
10039
|
+
"svg",
|
|
10040
|
+
{ width: "9", height: "9", viewBox: "0 0 9 9", fill: color, xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
|
|
10041
|
+
React__namespace.createElement("path", { d: "M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z" })
|
|
10042
|
+
);
|
|
10043
|
+
});
|
|
10044
|
+
ChevronDownIcon.displayName = "ChevronDownIcon";
|
|
10045
|
+
const ThickChevronRightIcon = React__namespace.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
|
|
10046
|
+
return React__namespace.createElement(
|
|
10047
|
+
"svg",
|
|
10048
|
+
{ width: "9", height: "9", viewBox: "0 0 9 9", fill: color, xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
|
|
10049
|
+
React__namespace.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z" })
|
|
10050
|
+
);
|
|
10051
|
+
});
|
|
10052
|
+
ThickChevronRightIcon.displayName = "ThickChevronRightIcon";
|
|
10053
|
+
const InfoCircledIcon = React__namespace.forwardRef(({ color = "currentColor", ...props }, forwardedRef) => {
|
|
10054
|
+
return React__namespace.createElement(
|
|
10055
|
+
"svg",
|
|
10056
|
+
{ width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: forwardedRef },
|
|
10057
|
+
React__namespace.createElement("path", { d: "M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z", fill: color, fillRule: "evenodd", clipRule: "evenodd" })
|
|
10058
|
+
);
|
|
10059
|
+
});
|
|
10060
|
+
InfoCircledIcon.displayName = "InfoCircledIcon";
|
|
10061
|
+
const Checkbox = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10062
|
+
const { rest: marginRest, ...marginProps } = extractMarginProps(props);
|
|
10063
|
+
const { className, style, size = checkboxPropDefs.size.default, variant = checkboxPropDefs.variant.default, color = checkboxPropDefs.color.default, highContrast = checkboxPropDefs.highContrast.default, ...checkboxProps } = marginRest;
|
|
10064
|
+
return React__namespace.createElement(
|
|
10065
|
+
"span",
|
|
10066
|
+
{ className: classNames("rt-CheckboxRoot", className, withBreakpoints(size, "rt-r-size"), withMarginProps(marginProps)), style },
|
|
10067
|
+
React__namespace.createElement(
|
|
10068
|
+
$e698a72e93240346$export$be92b6f5f03c0fe9,
|
|
10069
|
+
{ "data-accent-color": color, ...checkboxProps, ref: forwardedRef, className: classNames("rt-reset", "rt-CheckboxButton", `rt-variant-${variant}`, {
|
|
10070
|
+
"rt-high-contrast": highContrast
|
|
10071
|
+
}) },
|
|
10072
|
+
React__namespace.createElement(
|
|
10073
|
+
$e698a72e93240346$export$adb584737d712b70,
|
|
10074
|
+
{ className: "rt-CheckboxIndicator" },
|
|
10075
|
+
React__namespace.createElement(ThickCheckIcon, { className: "rt-CheckboxIndicatorIcon" })
|
|
10076
|
+
)
|
|
10077
|
+
)
|
|
10078
|
+
);
|
|
10079
|
+
});
|
|
10080
|
+
Checkbox.displayName = "Checkbox";
|
|
10251
10081
|
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
10252
10082
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
10253
10083
|
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
@@ -10339,7 +10169,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10339
10169
|
scope: props.__scopeRovingFocusGroup
|
|
10340
10170
|
}, /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {
|
|
10341
10171
|
scope: props.__scopeRovingFocusGroup
|
|
10342
|
-
}, /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
|
|
10172
|
+
}, /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends$1({}, props, {
|
|
10343
10173
|
ref: forwardedRef
|
|
10344
10174
|
}))));
|
|
10345
10175
|
});
|
|
@@ -10395,7 +10225,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10395
10225
|
),
|
|
10396
10226
|
[]
|
|
10397
10227
|
)
|
|
10398
|
-
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
10228
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
|
|
10399
10229
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
10400
10230
|
"data-orientation": orientation
|
|
10401
10231
|
}, groupProps, {
|
|
@@ -10465,7 +10295,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10465
10295
|
id,
|
|
10466
10296
|
focusable,
|
|
10467
10297
|
active
|
|
10468
|
-
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
10298
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
|
|
10469
10299
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
10470
10300
|
"data-orientation": context.orientation
|
|
10471
10301
|
}, itemProps, {
|
|
@@ -10605,7 +10435,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10605
10435
|
onScrollbarYEnabledChange: setScrollbarYEnabled,
|
|
10606
10436
|
onCornerWidthChange: setCornerWidth,
|
|
10607
10437
|
onCornerHeightChange: setCornerHeight
|
|
10608
|
-
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
10438
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
|
|
10609
10439
|
dir: direction
|
|
10610
10440
|
}, scrollAreaProps, {
|
|
10611
10441
|
ref: composedRefs,
|
|
@@ -10628,7 +10458,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10628
10458
|
dangerouslySetInnerHTML: {
|
|
10629
10459
|
__html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`
|
|
10630
10460
|
}
|
|
10631
|
-
}), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
10461
|
+
}), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
|
|
10632
10462
|
"data-radix-scroll-area-viewport": ""
|
|
10633
10463
|
}, viewportProps, {
|
|
10634
10464
|
ref: composedRefs,
|
|
@@ -10672,16 +10502,16 @@ var __publicField = (obj, key, value) => {
|
|
|
10672
10502
|
onScrollbarXEnabledChange,
|
|
10673
10503
|
onScrollbarYEnabledChange
|
|
10674
10504
|
]);
|
|
10675
|
-
return context.type === "hover" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarHover, _extends({}, scrollbarProps, {
|
|
10505
|
+
return context.type === "hover" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarHover, _extends$1({}, scrollbarProps, {
|
|
10676
10506
|
ref: forwardedRef,
|
|
10677
10507
|
forceMount
|
|
10678
|
-
})) : context.type === "scroll" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarScroll, _extends({}, scrollbarProps, {
|
|
10508
|
+
})) : context.type === "scroll" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarScroll, _extends$1({}, scrollbarProps, {
|
|
10679
10509
|
ref: forwardedRef,
|
|
10680
10510
|
forceMount
|
|
10681
|
-
})) : context.type === "auto" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends({}, scrollbarProps, {
|
|
10511
|
+
})) : context.type === "auto" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends$1({}, scrollbarProps, {
|
|
10682
10512
|
ref: forwardedRef,
|
|
10683
10513
|
forceMount
|
|
10684
|
-
})) : context.type === "always" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({}, scrollbarProps, {
|
|
10514
|
+
})) : context.type === "always" ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({}, scrollbarProps, {
|
|
10685
10515
|
ref: forwardedRef
|
|
10686
10516
|
})) : null;
|
|
10687
10517
|
});
|
|
@@ -10717,7 +10547,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10717
10547
|
]);
|
|
10718
10548
|
return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
10719
10549
|
present: forceMount || visible
|
|
10720
|
-
}, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends({
|
|
10550
|
+
}, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, _extends$1({
|
|
10721
10551
|
"data-state": visible ? "visible" : "hidden"
|
|
10722
10552
|
}, scrollbarProps, {
|
|
10723
10553
|
ref: forwardedRef
|
|
@@ -10787,7 +10617,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10787
10617
|
]);
|
|
10788
10618
|
return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
10789
10619
|
present: forceMount || state !== "hidden"
|
|
10790
|
-
}, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({
|
|
10620
|
+
}, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({
|
|
10791
10621
|
"data-state": state === "hidden" ? "hidden" : "visible"
|
|
10792
10622
|
}, scrollbarProps, {
|
|
10793
10623
|
ref: forwardedRef,
|
|
@@ -10817,7 +10647,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10817
10647
|
$57acba87d6e25586$var$useResizeObserver(context.content, handleResize);
|
|
10818
10648
|
return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
10819
10649
|
present: forceMount || visible
|
|
10820
|
-
}, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends({
|
|
10650
|
+
}, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, _extends$1({
|
|
10821
10651
|
"data-state": visible ? "visible" : "hidden"
|
|
10822
10652
|
}, scrollbarProps, {
|
|
10823
10653
|
ref: forwardedRef
|
|
@@ -10851,7 +10681,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10851
10681
|
return $57acba87d6e25586$var$getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes2, dir);
|
|
10852
10682
|
}
|
|
10853
10683
|
if (orientation === "horizontal")
|
|
10854
|
-
return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarX, _extends({}, commonProps, {
|
|
10684
|
+
return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarX, _extends$1({}, commonProps, {
|
|
10855
10685
|
ref: forwardedRef,
|
|
10856
10686
|
onThumbPositionChange: () => {
|
|
10857
10687
|
if (context.viewport && thumbRef.current) {
|
|
@@ -10870,7 +10700,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10870
10700
|
}
|
|
10871
10701
|
}));
|
|
10872
10702
|
if (orientation === "vertical")
|
|
10873
|
-
return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarY, _extends({}, commonProps, {
|
|
10703
|
+
return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarY, _extends$1({}, commonProps, {
|
|
10874
10704
|
ref: forwardedRef,
|
|
10875
10705
|
onThumbPositionChange: () => {
|
|
10876
10706
|
if (context.viewport && thumbRef.current) {
|
|
@@ -10902,7 +10732,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10902
10732
|
}, [
|
|
10903
10733
|
ref
|
|
10904
10734
|
]);
|
|
10905
|
-
return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends({
|
|
10735
|
+
return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends$1({
|
|
10906
10736
|
"data-orientation": "horizontal"
|
|
10907
10737
|
}, scrollbarProps, {
|
|
10908
10738
|
ref: composeRefs,
|
|
@@ -10950,7 +10780,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10950
10780
|
}, [
|
|
10951
10781
|
ref
|
|
10952
10782
|
]);
|
|
10953
|
-
return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends({
|
|
10783
|
+
return /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, _extends$1({
|
|
10954
10784
|
"data-orientation": "vertical"
|
|
10955
10785
|
}, scrollbarProps, {
|
|
10956
10786
|
ref: composeRefs,
|
|
@@ -11046,7 +10876,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11046
10876
|
onThumbPointerUp: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onThumbPointerUp),
|
|
11047
10877
|
onThumbPositionChange: handleThumbPositionChange,
|
|
11048
10878
|
onThumbPointerDown: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onThumbPointerDown)
|
|
11049
|
-
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, scrollbarProps, {
|
|
10879
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({}, scrollbarProps, {
|
|
11050
10880
|
ref: composeRefs,
|
|
11051
10881
|
style: {
|
|
11052
10882
|
position: "absolute",
|
|
@@ -11083,7 +10913,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11083
10913
|
const scrollbarContext = $57acba87d6e25586$var$useScrollbarContext($57acba87d6e25586$var$THUMB_NAME, props.__scopeScrollArea);
|
|
11084
10914
|
return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
11085
10915
|
present: forceMount || scrollbarContext.hasThumb
|
|
11086
|
-
}, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaThumbImpl, _extends({
|
|
10916
|
+
}, /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaThumbImpl, _extends$1({
|
|
11087
10917
|
ref: forwardedRef
|
|
11088
10918
|
}, thumbProps)));
|
|
11089
10919
|
});
|
|
@@ -11123,7 +10953,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11123
10953
|
debounceScrollEnd,
|
|
11124
10954
|
onThumbPositionChange
|
|
11125
10955
|
]);
|
|
11126
|
-
return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
10956
|
+
return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
|
|
11127
10957
|
"data-state": scrollbarContext.hasThumb ? "visible" : "hidden"
|
|
11128
10958
|
}, thumbProps, {
|
|
11129
10959
|
ref: composedRef,
|
|
@@ -11150,7 +10980,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11150
10980
|
const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$CORNER_NAME, props.__scopeScrollArea);
|
|
11151
10981
|
const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
|
|
11152
10982
|
const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible;
|
|
11153
|
-
return hasCorner ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaCornerImpl, _extends({}, props, {
|
|
10983
|
+
return hasCorner ? /* @__PURE__ */ React.createElement($57acba87d6e25586$var$ScrollAreaCornerImpl, _extends$1({}, props, {
|
|
11154
10984
|
ref: forwardedRef
|
|
11155
10985
|
})) : null;
|
|
11156
10986
|
});
|
|
@@ -11172,7 +11002,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11172
11002
|
context.onCornerWidthChange(width);
|
|
11173
11003
|
setWidth(width);
|
|
11174
11004
|
});
|
|
11175
|
-
return hasSize ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, cornerProps, {
|
|
11005
|
+
return hasSize ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({}, cornerProps, {
|
|
11176
11006
|
ref: forwardedRef,
|
|
11177
11007
|
style: {
|
|
11178
11008
|
width: width1,
|
|
@@ -11433,7 +11263,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11433
11263
|
scope: props.__scopeSlider
|
|
11434
11264
|
}, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$Collection.Slot, {
|
|
11435
11265
|
scope: props.__scopeSlider
|
|
11436
|
-
}, /* @__PURE__ */ React.createElement(SliderOrientation, _extends({
|
|
11266
|
+
}, /* @__PURE__ */ React.createElement(SliderOrientation, _extends$1({
|
|
11437
11267
|
"aria-disabled": disabled,
|
|
11438
11268
|
"data-disabled": disabled ? "" : void 0
|
|
11439
11269
|
}, sliderProps, {
|
|
@@ -11515,7 +11345,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11515
11345
|
endEdge: isSlidingFromLeft ? "right" : "left",
|
|
11516
11346
|
direction: isSlidingFromLeft ? 1 : -1,
|
|
11517
11347
|
size: "width"
|
|
11518
|
-
}, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends({
|
|
11348
|
+
}, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends$1({
|
|
11519
11349
|
dir: direction,
|
|
11520
11350
|
"data-orientation": "horizontal"
|
|
11521
11351
|
}, sliderProps, {
|
|
@@ -11575,7 +11405,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11575
11405
|
endEdge: isSlidingFromBottom ? "top" : "bottom",
|
|
11576
11406
|
size: "height",
|
|
11577
11407
|
direction: isSlidingFromBottom ? 1 : -1
|
|
11578
|
-
}, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends({
|
|
11408
|
+
}, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderImpl, _extends$1({
|
|
11579
11409
|
"data-orientation": "vertical"
|
|
11580
11410
|
}, sliderProps, {
|
|
11581
11411
|
ref,
|
|
@@ -11608,7 +11438,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11608
11438
|
const $faa2e61a3361514f$var$SliderImpl = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
|
|
11609
11439
|
const { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props;
|
|
11610
11440
|
const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$SLIDER_NAME, __scopeSlider);
|
|
11611
|
-
return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, sliderProps, {
|
|
11441
|
+
return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, sliderProps, {
|
|
11612
11442
|
ref: forwardedRef,
|
|
11613
11443
|
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
|
|
11614
11444
|
if (event.key === "Home") {
|
|
@@ -11649,7 +11479,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11649
11479
|
const $faa2e61a3361514f$export$105594979f116971 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
|
|
11650
11480
|
const { __scopeSlider, ...trackProps } = props;
|
|
11651
11481
|
const context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$TRACK_NAME, __scopeSlider);
|
|
11652
|
-
return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
11482
|
+
return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
|
|
11653
11483
|
"data-disabled": context.disabled ? "" : void 0,
|
|
11654
11484
|
"data-orientation": context.orientation
|
|
11655
11485
|
}, trackProps, {
|
|
@@ -11669,7 +11499,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11669
11499
|
);
|
|
11670
11500
|
const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
|
|
11671
11501
|
const offsetEnd = 100 - Math.max(...percentages);
|
|
11672
|
-
return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
11502
|
+
return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
|
|
11673
11503
|
"data-orientation": context.orientation,
|
|
11674
11504
|
"data-disabled": context.disabled ? "" : void 0
|
|
11675
11505
|
}, rangeProps, {
|
|
@@ -11698,7 +11528,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11698
11528
|
thumb
|
|
11699
11529
|
]
|
|
11700
11530
|
);
|
|
11701
|
-
return /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends({}, props, {
|
|
11531
|
+
return /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends$1({}, props, {
|
|
11702
11532
|
ref: composedRefs,
|
|
11703
11533
|
index: index2
|
|
11704
11534
|
}));
|
|
@@ -11737,7 +11567,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11737
11567
|
}
|
|
11738
11568
|
}, /* @__PURE__ */ React.createElement($faa2e61a3361514f$var$Collection.ItemSlot, {
|
|
11739
11569
|
scope: props.__scopeSlider
|
|
11740
|
-
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
11570
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({
|
|
11741
11571
|
role: "slider",
|
|
11742
11572
|
"aria-label": props["aria-label"] || label,
|
|
11743
11573
|
"aria-valuemin": context.min,
|
|
@@ -11777,7 +11607,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11777
11607
|
prevValue,
|
|
11778
11608
|
value
|
|
11779
11609
|
]);
|
|
11780
|
-
return /* @__PURE__ */ React.createElement("input", _extends({
|
|
11610
|
+
return /* @__PURE__ */ React.createElement("input", _extends$1({
|
|
11781
11611
|
style: {
|
|
11782
11612
|
display: "none"
|
|
11783
11613
|
}
|
|
@@ -11996,7 +11826,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11996
11826
|
scope: __scopeAvatar,
|
|
11997
11827
|
imageLoadingStatus,
|
|
11998
11828
|
onImageLoadingStatusChange: setImageLoadingStatus
|
|
11999
|
-
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, avatarProps, {
|
|
11829
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, avatarProps, {
|
|
12000
11830
|
ref: forwardedRef
|
|
12001
11831
|
})));
|
|
12002
11832
|
});
|
|
@@ -12017,7 +11847,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12017
11847
|
imageLoadingStatus,
|
|
12018
11848
|
handleLoadingStatusChange
|
|
12019
11849
|
]);
|
|
12020
|
-
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.img, _extends({}, imageProps, {
|
|
11850
|
+
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.img, _extends$1({}, imageProps, {
|
|
12021
11851
|
ref: forwardedRef,
|
|
12022
11852
|
src
|
|
12023
11853
|
})) : null;
|
|
@@ -12038,7 +11868,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12038
11868
|
}, [
|
|
12039
11869
|
delayMs
|
|
12040
11870
|
]);
|
|
12041
|
-
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, fallbackProps, {
|
|
11871
|
+
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends$1({}, fallbackProps, {
|
|
12042
11872
|
ref: forwardedRef
|
|
12043
11873
|
})) : null;
|
|
12044
11874
|
});
|
|
@@ -12142,7 +11972,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12142
11972
|
orientation,
|
|
12143
11973
|
dir: direction,
|
|
12144
11974
|
activationMode
|
|
12145
|
-
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
11975
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
|
|
12146
11976
|
dir: direction,
|
|
12147
11977
|
"data-orientation": orientation
|
|
12148
11978
|
}, tabsProps, {
|
|
@@ -12154,13 +11984,13 @@ var __publicField = (obj, key, value) => {
|
|
|
12154
11984
|
const { __scopeTabs, loop = true, ...listProps } = props;
|
|
12155
11985
|
const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs);
|
|
12156
11986
|
const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
|
|
12157
|
-
return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
|
|
11987
|
+
return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends$1({
|
|
12158
11988
|
asChild: true
|
|
12159
11989
|
}, rovingFocusGroupScope, {
|
|
12160
11990
|
orientation: context.orientation,
|
|
12161
11991
|
dir: context.dir,
|
|
12162
11992
|
loop
|
|
12163
|
-
}), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
11993
|
+
}), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
|
|
12164
11994
|
role: "tablist",
|
|
12165
11995
|
"aria-orientation": context.orientation
|
|
12166
11996
|
}, listProps, {
|
|
@@ -12175,12 +12005,12 @@ var __publicField = (obj, key, value) => {
|
|
|
12175
12005
|
const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
|
|
12176
12006
|
const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
|
|
12177
12007
|
const isSelected = value === context.value;
|
|
12178
|
-
return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
|
|
12008
|
+
return /* @__PURE__ */ React.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends$1({
|
|
12179
12009
|
asChild: true
|
|
12180
12010
|
}, rovingFocusGroupScope, {
|
|
12181
12011
|
focusable: !disabled,
|
|
12182
12012
|
active: isSelected
|
|
12183
|
-
}), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
12013
|
+
}), /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
|
|
12184
12014
|
type: "button",
|
|
12185
12015
|
role: "tab",
|
|
12186
12016
|
"aria-selected": isSelected,
|
|
@@ -12230,7 +12060,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12230
12060
|
{
|
|
12231
12061
|
present: forceMount || isSelected
|
|
12232
12062
|
},
|
|
12233
|
-
({ present }) => /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
12063
|
+
({ present }) => /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
|
|
12234
12064
|
"data-state": isSelected ? "active" : "inactive",
|
|
12235
12065
|
"data-orientation": context.orientation,
|
|
12236
12066
|
role: "tabpanel",
|
|
@@ -12290,6 +12120,260 @@ var __publicField = (obj, key, value) => {
|
|
|
12290
12120
|
Trigger: TabsTrigger,
|
|
12291
12121
|
Content: TabsContent
|
|
12292
12122
|
});
|
|
12123
|
+
const truthyValues = [true, "true"];
|
|
12124
|
+
const BooleanInput = React.memo((props) => {
|
|
12125
|
+
const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
|
|
12126
|
+
let [{ helpText, label }] = useFormikInput(props);
|
|
12127
|
+
helpText = showInputOnly ? null : helpText;
|
|
12128
|
+
label = showInputOnly ? "" : label;
|
|
12129
|
+
const color = blocks.useSeverityColor(severity);
|
|
12130
|
+
const value = truthyValues.includes(fieldProps.value);
|
|
12131
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12132
|
+
InputWithLabel,
|
|
12133
|
+
{
|
|
12134
|
+
size,
|
|
12135
|
+
severity,
|
|
12136
|
+
inputId,
|
|
12137
|
+
labelId,
|
|
12138
|
+
label,
|
|
12139
|
+
image: showInputOnly ? void 0 : field.image,
|
|
12140
|
+
flexProps: { direction: "row-reverse", justify: "end", align: "center", gap: "2" },
|
|
12141
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12142
|
+
Checkbox,
|
|
12143
|
+
{
|
|
12144
|
+
...rest,
|
|
12145
|
+
...fieldProps,
|
|
12146
|
+
id: inputId,
|
|
12147
|
+
color,
|
|
12148
|
+
value: value.toString(),
|
|
12149
|
+
checked: value,
|
|
12150
|
+
onCheckedChange: fieldProps.onChange,
|
|
12151
|
+
onChange: void 0,
|
|
12152
|
+
onBlur: void 0
|
|
12153
|
+
}
|
|
12154
|
+
)
|
|
12155
|
+
}
|
|
12156
|
+
) });
|
|
12157
|
+
});
|
|
12158
|
+
BooleanInput.displayName = "BooleanInput";
|
|
12159
|
+
var DefaultContext = {
|
|
12160
|
+
color: void 0,
|
|
12161
|
+
size: void 0,
|
|
12162
|
+
className: void 0,
|
|
12163
|
+
style: void 0,
|
|
12164
|
+
attr: void 0
|
|
12165
|
+
};
|
|
12166
|
+
var IconContext = React.createContext && /* @__PURE__ */ React.createContext(DefaultContext);
|
|
12167
|
+
var _excluded = ["attr", "size", "title"];
|
|
12168
|
+
function _objectWithoutProperties(source, excluded) {
|
|
12169
|
+
if (source == null)
|
|
12170
|
+
return {};
|
|
12171
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
12172
|
+
var key, i;
|
|
12173
|
+
if (Object.getOwnPropertySymbols) {
|
|
12174
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
12175
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
12176
|
+
key = sourceSymbolKeys[i];
|
|
12177
|
+
if (excluded.indexOf(key) >= 0)
|
|
12178
|
+
continue;
|
|
12179
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
12180
|
+
continue;
|
|
12181
|
+
target[key] = source[key];
|
|
12182
|
+
}
|
|
12183
|
+
}
|
|
12184
|
+
return target;
|
|
12185
|
+
}
|
|
12186
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
12187
|
+
if (source == null)
|
|
12188
|
+
return {};
|
|
12189
|
+
var target = {};
|
|
12190
|
+
for (var key in source) {
|
|
12191
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12192
|
+
if (excluded.indexOf(key) >= 0)
|
|
12193
|
+
continue;
|
|
12194
|
+
target[key] = source[key];
|
|
12195
|
+
}
|
|
12196
|
+
}
|
|
12197
|
+
return target;
|
|
12198
|
+
}
|
|
12199
|
+
function _extends() {
|
|
12200
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
12201
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
12202
|
+
var source = arguments[i];
|
|
12203
|
+
for (var key in source) {
|
|
12204
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12205
|
+
target[key] = source[key];
|
|
12206
|
+
}
|
|
12207
|
+
}
|
|
12208
|
+
}
|
|
12209
|
+
return target;
|
|
12210
|
+
};
|
|
12211
|
+
return _extends.apply(this, arguments);
|
|
12212
|
+
}
|
|
12213
|
+
function ownKeys(e, r) {
|
|
12214
|
+
var t = Object.keys(e);
|
|
12215
|
+
if (Object.getOwnPropertySymbols) {
|
|
12216
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
12217
|
+
r && (o = o.filter(function(r2) {
|
|
12218
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
12219
|
+
})), t.push.apply(t, o);
|
|
12220
|
+
}
|
|
12221
|
+
return t;
|
|
12222
|
+
}
|
|
12223
|
+
function _objectSpread(e) {
|
|
12224
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
12225
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
12226
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
12227
|
+
_defineProperty(e, r2, t[r2]);
|
|
12228
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
12229
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
12230
|
+
});
|
|
12231
|
+
}
|
|
12232
|
+
return e;
|
|
12233
|
+
}
|
|
12234
|
+
function _defineProperty(obj, key, value) {
|
|
12235
|
+
key = _toPropertyKey(key);
|
|
12236
|
+
if (key in obj) {
|
|
12237
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
12238
|
+
} else {
|
|
12239
|
+
obj[key] = value;
|
|
12240
|
+
}
|
|
12241
|
+
return obj;
|
|
12242
|
+
}
|
|
12243
|
+
function _toPropertyKey(t) {
|
|
12244
|
+
var i = _toPrimitive(t, "string");
|
|
12245
|
+
return "symbol" == typeof i ? i : i + "";
|
|
12246
|
+
}
|
|
12247
|
+
function _toPrimitive(t, r) {
|
|
12248
|
+
if ("object" != typeof t || !t)
|
|
12249
|
+
return t;
|
|
12250
|
+
var e = t[Symbol.toPrimitive];
|
|
12251
|
+
if (void 0 !== e) {
|
|
12252
|
+
var i = e.call(t, r || "default");
|
|
12253
|
+
if ("object" != typeof i)
|
|
12254
|
+
return i;
|
|
12255
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
12256
|
+
}
|
|
12257
|
+
return ("string" === r ? String : Number)(t);
|
|
12258
|
+
}
|
|
12259
|
+
function Tree2Element(tree) {
|
|
12260
|
+
return tree && tree.map((node, i) => /* @__PURE__ */ React.createElement(node.tag, _objectSpread({
|
|
12261
|
+
key: i
|
|
12262
|
+
}, node.attr), Tree2Element(node.child)));
|
|
12263
|
+
}
|
|
12264
|
+
function GenIcon(data) {
|
|
12265
|
+
return (props) => /* @__PURE__ */ React.createElement(IconBase, _extends({
|
|
12266
|
+
attr: _objectSpread({}, data.attr)
|
|
12267
|
+
}, props), Tree2Element(data.child));
|
|
12268
|
+
}
|
|
12269
|
+
function IconBase(props) {
|
|
12270
|
+
var elem = (conf) => {
|
|
12271
|
+
var {
|
|
12272
|
+
attr,
|
|
12273
|
+
size,
|
|
12274
|
+
title: title2
|
|
12275
|
+
} = props, svgProps = _objectWithoutProperties(props, _excluded);
|
|
12276
|
+
var computedSize = size || conf.size || "1em";
|
|
12277
|
+
var className;
|
|
12278
|
+
if (conf.className)
|
|
12279
|
+
className = conf.className;
|
|
12280
|
+
if (props.className)
|
|
12281
|
+
className = (className ? className + " " : "") + props.className;
|
|
12282
|
+
return /* @__PURE__ */ React.createElement("svg", _extends({
|
|
12283
|
+
stroke: "currentColor",
|
|
12284
|
+
fill: "currentColor",
|
|
12285
|
+
strokeWidth: "0"
|
|
12286
|
+
}, conf.attr, attr, svgProps, {
|
|
12287
|
+
className,
|
|
12288
|
+
style: _objectSpread(_objectSpread({
|
|
12289
|
+
color: props.color || conf.color
|
|
12290
|
+
}, conf.style), props.style),
|
|
12291
|
+
height: computedSize,
|
|
12292
|
+
width: computedSize,
|
|
12293
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
12294
|
+
}), title2 && /* @__PURE__ */ React.createElement("title", null, title2), props.children);
|
|
12295
|
+
};
|
|
12296
|
+
return IconContext !== void 0 ? /* @__PURE__ */ React.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
|
12297
|
+
}
|
|
12298
|
+
function RiArrowDownLine(props) {
|
|
12299
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z" }, "child": [] }] })(props);
|
|
12300
|
+
}
|
|
12301
|
+
function RiArrowUpLine(props) {
|
|
12302
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z" }, "child": [] }] })(props);
|
|
12303
|
+
}
|
|
12304
|
+
function RiCalendarLine(props) {
|
|
12305
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z" }, "child": [] }] })(props);
|
|
12306
|
+
}
|
|
12307
|
+
function RiQrCodeLine(props) {
|
|
12308
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M16 17V16H13V13H16V15H18V17H17V19H15V21H13V18H15V17H16ZM21 21H17V19H19V17H21V21ZM3 3H11V11H3V3ZM5 5V9H9V5H5ZM13 3H21V11H13V3ZM15 5V9H19V5H15ZM3 13H11V21H3V13ZM5 15V19H9V15H5ZM18 13H21V15H18V13ZM6 6H8V8H6V6ZM6 16H8V18H6V16ZM16 6H18V8H16V6Z" }, "child": [] }] })(props);
|
|
12309
|
+
}
|
|
12310
|
+
function RiFileCopyLine(props) {
|
|
12311
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z" }, "child": [] }] })(props);
|
|
12312
|
+
}
|
|
12313
|
+
function RiAlignJustify(props) {
|
|
12314
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z" }, "child": [] }] })(props);
|
|
12315
|
+
}
|
|
12316
|
+
function RiHashtag(props) {
|
|
12317
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M7.78428 14L8.2047 10H4V8H8.41491L8.94043 3H10.9514L10.4259 8H14.4149L14.9404 3H16.9514L16.4259 8H20V10H16.2157L15.7953 14H20V16H15.5851L15.0596 21H13.0486L13.5741 16H9.58509L9.05957 21H7.04855L7.57407 16H4V14H7.78428ZM9.7953 14H13.7843L14.2047 10H10.2157L9.7953 14Z" }, "child": [] }] })(props);
|
|
12318
|
+
}
|
|
12319
|
+
function RiInputField(props) {
|
|
12320
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z" }, "child": [] }] })(props);
|
|
12321
|
+
}
|
|
12322
|
+
function RiListCheck(props) {
|
|
12323
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M8 4H21V6H8V4ZM3 3.5H6V6.5H3V3.5ZM3 10.5H6V13.5H3V10.5ZM3 17.5H6V20.5H3V17.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z" }, "child": [] }] })(props);
|
|
12324
|
+
}
|
|
12325
|
+
function RiImageLine(props) {
|
|
12326
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918ZM20 15V5H4V19L14 9L20 15ZM20 17.8284L14 11.8284L6.82843 19H20V17.8284ZM8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11Z" }, "child": [] }] })(props);
|
|
12327
|
+
}
|
|
12328
|
+
function RiCheckboxCircleLine(props) {
|
|
12329
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
|
|
12330
|
+
}
|
|
12331
|
+
function RiCheckboxLine(props) {
|
|
12332
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z" }, "child": [] }] })(props);
|
|
12333
|
+
}
|
|
12334
|
+
function RiDeleteBin2Line(props) {
|
|
12335
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM13.4142 13.9997L15.182 15.7675L13.7678 17.1817L12 15.4139L10.2322 17.1817L8.81802 15.7675L10.5858 13.9997L8.81802 12.232L10.2322 10.8178L12 12.5855L13.7678 10.8178L15.182 12.232L13.4142 13.9997ZM9 4V6H15V4H9Z" }, "child": [] }] })(props);
|
|
12336
|
+
}
|
|
12337
|
+
function RiMenuFoldLine(props) {
|
|
12338
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M21 17.9995V19.9995H3V17.9995H21ZM6.59619 3.90332L8.01041 5.31753L4.82843 8.49951L8.01041 11.6815L6.59619 13.0957L2 8.49951L6.59619 3.90332ZM21 10.9995V12.9995H12V10.9995H21ZM21 3.99951V5.99951H12V3.99951H21Z" }, "child": [] }] })(props);
|
|
12339
|
+
}
|
|
12340
|
+
function RiUpload2Line(props) {
|
|
12341
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM13 9V16H11V9H6L12 3L18 9H13Z" }, "child": [] }] })(props);
|
|
12342
|
+
}
|
|
12343
|
+
const emptyBooleanField = {
|
|
12344
|
+
...emptyBaseField,
|
|
12345
|
+
type: "boolean"
|
|
12346
|
+
};
|
|
12347
|
+
const _BooleanField = class _BooleanField extends BaseField {
|
|
12348
|
+
constructor(options) {
|
|
12349
|
+
super({ ...options, type: "boolean" });
|
|
12350
|
+
__publicField(this, "onlyValidateAfterTouched", false);
|
|
12351
|
+
}
|
|
12352
|
+
// if a BooleanField is required, `false` is considered blank
|
|
12353
|
+
isBlank(value) {
|
|
12354
|
+
return this.required && !value;
|
|
12355
|
+
}
|
|
12356
|
+
getValueFromChangeEvent(event) {
|
|
12357
|
+
if (typeof event === "boolean")
|
|
12358
|
+
return event;
|
|
12359
|
+
return event.target.checked;
|
|
12360
|
+
}
|
|
12361
|
+
serialize() {
|
|
12362
|
+
return super._serialize();
|
|
12363
|
+
}
|
|
12364
|
+
static deserialize(data) {
|
|
12365
|
+
if (data.type !== "boolean")
|
|
12366
|
+
throw new Error("Type mismatch.");
|
|
12367
|
+
return new _BooleanField(data);
|
|
12368
|
+
}
|
|
12369
|
+
getInput(props) {
|
|
12370
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BooleanInput, { ...props, field: this });
|
|
12371
|
+
}
|
|
12372
|
+
};
|
|
12373
|
+
__publicField(_BooleanField, "fieldTypeName", "Checkbox");
|
|
12374
|
+
__publicField(_BooleanField, "fieldTypeDescription", "Perfect for both optional and required yes/no questions.");
|
|
12375
|
+
__publicField(_BooleanField, "Icon", RiCheckboxCircleLine);
|
|
12376
|
+
let BooleanField = _BooleanField;
|
|
12293
12377
|
const NumberInput = React.memo((props) => {
|
|
12294
12378
|
const [{ inputId, labelId, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
|
|
12295
12379
|
let [{ helpText, label }] = useFormikInput(props);
|
|
@@ -13395,7 +13479,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13395
13479
|
] }),
|
|
13396
13480
|
value && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "jade", size: "1", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiCheckLine", style: { verticalAlign: "bottom" } }) })
|
|
13397
13481
|
] }),
|
|
13398
|
-
value && /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { width: "max-content", gap: "2", align: "center", children: [
|
|
13482
|
+
!!value && /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { width: "max-content", gap: "2", align: "center", children: [
|
|
13399
13483
|
/* @__PURE__ */ jsxRuntime.jsx(Code, { color: "gray", highContrast: true, children: value }),
|
|
13400
13484
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13401
13485
|
blocks.IconButton,
|
|
@@ -13435,9 +13519,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13435
13519
|
}
|
|
13436
13520
|
);
|
|
13437
13521
|
setIsScannerLoading(true);
|
|
13438
|
-
qrScanner.start().
|
|
13439
|
-
setIsScannerLoading(false);
|
|
13440
|
-
}).catch(() => {
|
|
13522
|
+
void qrScanner.start().finally(() => {
|
|
13441
13523
|
setIsScannerLoading(false);
|
|
13442
13524
|
});
|
|
13443
13525
|
}, [onQrScan]);
|
|
@@ -16598,7 +16680,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16598
16680
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
16599
16681
|
exports2.APIError = APIError;
|
|
16600
16682
|
exports2.AgentService = AgentService;
|
|
16601
|
-
exports2.
|
|
16683
|
+
exports2.AttachmentModel = AttachmentModel;
|
|
16602
16684
|
exports2.AuthService = AuthService;
|
|
16603
16685
|
exports2.BaseApiService = BaseApiService;
|
|
16604
16686
|
exports2.BaseField = BaseField;
|
|
@@ -16609,15 +16691,18 @@ var __publicField = (obj, key, value) => {
|
|
|
16609
16691
|
exports2.ColorPicker = ColorPicker;
|
|
16610
16692
|
exports2.Colors = Colors;
|
|
16611
16693
|
exports2.ColorsToString = ColorsToString;
|
|
16694
|
+
exports2.ComponentAttachmentService = ComponentAttachmentService;
|
|
16612
16695
|
exports2.ComponentService = ComponentService;
|
|
16613
16696
|
exports2.ComponentStageColors = ComponentStageColors;
|
|
16614
16697
|
exports2.ComponentStageCompletionService = ComponentStageCompletionService;
|
|
16615
16698
|
exports2.ComponentStageService = ComponentStageService;
|
|
16699
|
+
exports2.ComponentTypeAttachmentService = ComponentTypeAttachmentService;
|
|
16616
16700
|
exports2.ComponentTypeService = ComponentTypeService;
|
|
16617
16701
|
exports2.DEFAULT_ISSUE_PRIORITY = DEFAULT_ISSUE_PRIORITY;
|
|
16618
16702
|
exports2.DEFAULT_ISSUE_STATUS = DEFAULT_ISSUE_STATUS;
|
|
16619
16703
|
exports2.DateField = DateField;
|
|
16620
16704
|
exports2.DateInput = DateInput;
|
|
16705
|
+
exports2.DocumentAttachmentService = DocumentAttachmentService;
|
|
16621
16706
|
exports2.DocumentService = DocumentService;
|
|
16622
16707
|
exports2.EmailDomainsService = EmailDomainsService;
|
|
16623
16708
|
exports2.EmailVerificationService = EmailVerificationService;
|
|
@@ -16641,6 +16726,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16641
16726
|
exports2.InputWithHelpText = InputWithHelpText;
|
|
16642
16727
|
exports2.InputWithLabel = InputWithLabel;
|
|
16643
16728
|
exports2.InputWithLabelAndHelpText = InputWithLabelAndHelpText;
|
|
16729
|
+
exports2.IssueAttachmentService = IssueAttachmentService;
|
|
16644
16730
|
exports2.IssueCommentService = IssueCommentService;
|
|
16645
16731
|
exports2.IssuePriority = IssuePriority;
|
|
16646
16732
|
exports2.IssueService = IssueService;
|
|
@@ -16673,6 +16759,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16673
16759
|
exports2.PatchFormProvider = PatchFormProvider;
|
|
16674
16760
|
exports2.ProjectAccessLevel = ProjectAccessLevel;
|
|
16675
16761
|
exports2.ProjectAccessService = ProjectAccessService;
|
|
16762
|
+
exports2.ProjectAttachmentService = ProjectAttachmentService;
|
|
16676
16763
|
exports2.ProjectFileService = ProjectFileService;
|
|
16677
16764
|
exports2.ProjectService = ProjectService;
|
|
16678
16765
|
exports2.ProjectType = ProjectType;
|
|
@@ -16907,6 +16994,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16907
16994
|
exports2.removeFavouriteProjectId = removeFavouriteProjectId;
|
|
16908
16995
|
exports2.removeIssue = removeIssue;
|
|
16909
16996
|
exports2.removeIssueAttachment = removeIssueAttachment;
|
|
16997
|
+
exports2.removeIssueAttachments = removeIssueAttachments;
|
|
16910
16998
|
exports2.removeIssueComment = removeIssueComment;
|
|
16911
16999
|
exports2.removeIssueComments = removeIssueComments;
|
|
16912
17000
|
exports2.removeIssueType = removeIssueType;
|
|
@@ -17084,6 +17172,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17084
17172
|
exports2.selectProjectAccessForUser = selectProjectAccessForUser;
|
|
17085
17173
|
exports2.selectProjectAccessUserMapping = selectProjectAccessUserMapping;
|
|
17086
17174
|
exports2.selectProjectAccesses = selectProjectAccesses;
|
|
17175
|
+
exports2.selectProjectAttachment = selectProjectAttachment;
|
|
17087
17176
|
exports2.selectProjectAttachmentMapping = selectProjectAttachmentMapping;
|
|
17088
17177
|
exports2.selectProjectFileVisibility = selectProjectFileVisibility;
|
|
17089
17178
|
exports2.selectProjectFiles = selectProjectFiles;
|
|
@@ -17133,7 +17222,9 @@ var __publicField = (obj, key, value) => {
|
|
|
17133
17222
|
exports2.setAppearance = setAppearance;
|
|
17134
17223
|
exports2.setCategories = setCategories;
|
|
17135
17224
|
exports2.setCenterMapToProject = setCenterMapToProject;
|
|
17225
|
+
exports2.setComponentAttachment = setComponentAttachment;
|
|
17136
17226
|
exports2.setComponentAttachments = setComponentAttachments;
|
|
17227
|
+
exports2.setComponentTypeAttachment = setComponentTypeAttachment;
|
|
17137
17228
|
exports2.setComponentTypeAttachments = setComponentTypeAttachments;
|
|
17138
17229
|
exports2.setComponentTypes = setComponentTypes;
|
|
17139
17230
|
exports2.setComponents = setComponents;
|
|
@@ -17141,6 +17232,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17141
17232
|
exports2.setConversations = setConversations;
|
|
17142
17233
|
exports2.setCreateProjectType = setCreateProjectType;
|
|
17143
17234
|
exports2.setCurrentUser = setCurrentUser;
|
|
17235
|
+
exports2.setDocumentAttachment = setDocumentAttachment;
|
|
17144
17236
|
exports2.setDocumentAttachments = setDocumentAttachments;
|
|
17145
17237
|
exports2.setDocuments = setDocuments;
|
|
17146
17238
|
exports2.setEmailDomains = setEmailDomains;
|
|
@@ -17157,6 +17249,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17157
17249
|
exports2.setIsFetchingInitialData = setIsFetchingInitialData;
|
|
17158
17250
|
exports2.setIsImportingProjectFile = setIsImportingProjectFile;
|
|
17159
17251
|
exports2.setIsLoading = setIsLoading;
|
|
17252
|
+
exports2.setIssueAttachment = setIssueAttachment;
|
|
17160
17253
|
exports2.setIssueAttachments = setIssueAttachments;
|
|
17161
17254
|
exports2.setIssueComment = setIssueComment;
|
|
17162
17255
|
exports2.setIssueComments = setIssueComments;
|
|
@@ -17171,6 +17264,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17171
17264
|
exports2.setOrganizations = setOrganizations;
|
|
17172
17265
|
exports2.setProfilePicture = setProfilePicture;
|
|
17173
17266
|
exports2.setProjectAccesses = setProjectAccesses;
|
|
17267
|
+
exports2.setProjectAttachment = setProjectAttachment;
|
|
17174
17268
|
exports2.setProjectAttachments = setProjectAttachments;
|
|
17175
17269
|
exports2.setProjectFileVisible = setProjectFileVisible;
|
|
17176
17270
|
exports2.setProjects = setProjects;
|
|
@@ -17205,21 +17299,26 @@ var __publicField = (obj, key, value) => {
|
|
|
17205
17299
|
exports2.updateActiveOrganization = updateActiveOrganization;
|
|
17206
17300
|
exports2.updateComponent = updateComponent;
|
|
17207
17301
|
exports2.updateComponentAttachment = updateComponentAttachment;
|
|
17302
|
+
exports2.updateComponentAttachments = updateComponentAttachments;
|
|
17208
17303
|
exports2.updateComponentTypeAttachment = updateComponentTypeAttachment;
|
|
17304
|
+
exports2.updateComponentTypeAttachments = updateComponentTypeAttachments;
|
|
17209
17305
|
exports2.updateConversation = updateConversation;
|
|
17210
17306
|
exports2.updateDocumentAttachment = updateDocumentAttachment;
|
|
17307
|
+
exports2.updateDocumentAttachments = updateDocumentAttachments;
|
|
17211
17308
|
exports2.updateDocuments = updateDocuments;
|
|
17212
17309
|
exports2.updateFormSubmission = updateFormSubmission;
|
|
17213
17310
|
exports2.updateFormSubmissionAttachments = updateFormSubmissionAttachments;
|
|
17214
17311
|
exports2.updateFormSubmissions = updateFormSubmissions;
|
|
17215
17312
|
exports2.updateIssue = updateIssue;
|
|
17216
17313
|
exports2.updateIssueAttachment = updateIssueAttachment;
|
|
17314
|
+
exports2.updateIssueAttachments = updateIssueAttachments;
|
|
17217
17315
|
exports2.updateIssueType = updateIssueType;
|
|
17218
17316
|
exports2.updateLicense = updateLicense;
|
|
17219
17317
|
exports2.updateOrCreateProject = updateOrCreateProject;
|
|
17220
17318
|
exports2.updateOrganizationAccess = updateOrganizationAccess;
|
|
17221
17319
|
exports2.updateProjectAccess = updateProjectAccess;
|
|
17222
17320
|
exports2.updateProjectAttachment = updateProjectAttachment;
|
|
17321
|
+
exports2.updateProjectAttachments = updateProjectAttachments;
|
|
17223
17322
|
exports2.updateStages = updateStages;
|
|
17224
17323
|
exports2.updateTeam = updateTeam;
|
|
17225
17324
|
exports2.useAppDispatch = useAppDispatch;
|