@overmap-ai/core 1.0.57-component-asset-renames.0 → 1.0.57-export-overmap-reducer.0
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/LICENSE +1 -0
- package/dist/contexts/overmap.d.ts +2 -2
- package/dist/contexts/sdk/globals.d.ts +3 -3
- package/dist/contexts/sdk/sdk.d.ts +2 -2
- package/dist/overmap-core.js +55 -336
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +56 -337
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/sdk.d.ts +4 -4
- package/dist/sdk/services/AgentService.d.ts +2 -21
- package/dist/store/index.d.ts +0 -1
- package/dist/store/slices/agentsSlice.d.ts +3 -3
- package/dist/store/slices/assetSlice.d.ts +6 -6
- package/dist/store/slices/assetStageCompletionSlice.d.ts +2 -2
- package/dist/store/slices/assetStageSlice.d.ts +3 -3
- package/dist/store/slices/assetTypeSlice.d.ts +4 -4
- package/dist/store/slices/authSlice.d.ts +3 -3
- package/dist/store/slices/categorySlice.d.ts +5 -5
- package/dist/store/slices/documentSlice.d.ts +6 -6
- package/dist/store/slices/formRevisionSlice.d.ts +2 -2
- package/dist/store/slices/issueSlice.d.ts +14 -14
- package/dist/store/slices/mapSlice.d.ts +4 -4
- package/dist/store/slices/organizationAccessSlice.d.ts +3 -3
- package/dist/store/slices/outboxSlice.d.ts +3 -3
- package/dist/store/slices/projectAccessSlice.d.ts +2 -2
- package/dist/store/slices/projectFileSlice.d.ts +3 -3
- package/dist/store/slices/projectSlice.d.ts +8 -8
- package/dist/store/slices/rehydratedSlice.d.ts +2 -2
- package/dist/store/slices/settingsSlice.d.ts +9 -9
- package/dist/store/slices/userSlice.d.ts +4 -4
- package/dist/store/slices/workspaceSlice.d.ts +2 -2
- package/dist/store/store.d.ts +3 -36
- package/dist/typings/models/access.d.ts +1 -0
- package/dist/typings/models/store.d.ts +2 -3
- package/dist/typings/store.d.ts +4 -4
- package/dist/utils/utils.d.ts +3 -3
- package/package.json +1 -1
- package/dist/store/hooks.d.ts +0 -4
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
UNLICENSED (ALL RIGHTS RESERVED)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ToolkitStore } from "@reduxjs/toolkit/dist/configureStore";
|
|
3
|
-
import {
|
|
3
|
+
import { OvermapRootState } from "../typings";
|
|
4
4
|
interface OvermapProviderProps {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
production?: boolean;
|
|
7
7
|
disableDefaultTheme?: boolean;
|
|
8
|
-
store: ToolkitStore<
|
|
8
|
+
store: ToolkitStore<OvermapRootState>;
|
|
9
9
|
}
|
|
10
10
|
declare const OvermapContext: React.Context<null>;
|
|
11
11
|
declare const OvermapProvider: (props: OvermapProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ToolkitStore } from "@reduxjs/toolkit/dist/configureStore";
|
|
2
|
-
import {
|
|
3
|
-
export declare function setClientStore(store: ToolkitStore<
|
|
4
|
-
export declare function getClientStore(): ToolkitStore<
|
|
2
|
+
import { OvermapRootState } from "../../typings";
|
|
3
|
+
export declare function setClientStore(store: ToolkitStore<OvermapRootState>): void;
|
|
4
|
+
export declare function getClientStore(): ToolkitStore<OvermapRootState> | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { OvermapSDK } from "../../sdk";
|
|
3
3
|
import { ToolkitStore } from "@reduxjs/toolkit/dist/configureStore";
|
|
4
|
-
import {
|
|
4
|
+
import { OvermapRootState } from "../../typings";
|
|
5
5
|
export interface ISDKContext {
|
|
6
6
|
sdk: OvermapSDK;
|
|
7
7
|
}
|
|
8
8
|
interface SDKProviderProps {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
API_URL: string;
|
|
11
|
-
store: ToolkitStore<
|
|
11
|
+
store: ToolkitStore<OvermapRootState>;
|
|
12
12
|
}
|
|
13
13
|
declare const SDKContext: React.Context<ISDKContext>;
|
|
14
14
|
declare const SDKProvider: React.MemoExoticComponent<({ children, API_URL, store }: SDKProviderProps) => import("react/jsx-runtime").JSX.Element>;
|
package/dist/overmap-core.js
CHANGED
|
@@ -15,11 +15,11 @@ import { offline as offline$1 } from "@redux-offline/redux-offline";
|
|
|
15
15
|
import offlineConfig from "@redux-offline/redux-offline/lib/defaults";
|
|
16
16
|
import localforage from "localforage";
|
|
17
17
|
import createMigration from "redux-persist-migrate";
|
|
18
|
-
import { createSlice, createSelector, combineReducers,
|
|
18
|
+
import { createSlice, createSelector, combineReducers, createNextState } from "@reduxjs/toolkit";
|
|
19
19
|
import request from "superagent";
|
|
20
|
-
import { shallowEqual as shallowEqual$1, useDispatch, useSelector } from "react-redux";
|
|
21
20
|
import { v4 } from "uuid";
|
|
22
21
|
import ColorCls from "color";
|
|
22
|
+
import { shallowEqual as shallowEqual$1, useSelector } from "react-redux";
|
|
23
23
|
import jwtDecode from "jwt-decode";
|
|
24
24
|
import { RESET_STATE } from "@redux-offline/redux-offline/lib/constants";
|
|
25
25
|
import { openDB } from "idb";
|
|
@@ -384,257 +384,6 @@ function downloadFile(file) {
|
|
|
384
384
|
const blob = new Blob([file]);
|
|
385
385
|
saveAs(blob, file.name);
|
|
386
386
|
}
|
|
387
|
-
const global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
|
|
388
|
-
function defaultSetTimout() {
|
|
389
|
-
throw new Error("setTimeout has not been defined");
|
|
390
|
-
}
|
|
391
|
-
function defaultClearTimeout() {
|
|
392
|
-
throw new Error("clearTimeout has not been defined");
|
|
393
|
-
}
|
|
394
|
-
var cachedSetTimeout = defaultSetTimout;
|
|
395
|
-
var cachedClearTimeout = defaultClearTimeout;
|
|
396
|
-
if (typeof global$1.setTimeout === "function") {
|
|
397
|
-
cachedSetTimeout = setTimeout;
|
|
398
|
-
}
|
|
399
|
-
if (typeof global$1.clearTimeout === "function") {
|
|
400
|
-
cachedClearTimeout = clearTimeout;
|
|
401
|
-
}
|
|
402
|
-
function runTimeout(fun) {
|
|
403
|
-
if (cachedSetTimeout === setTimeout) {
|
|
404
|
-
return setTimeout(fun, 0);
|
|
405
|
-
}
|
|
406
|
-
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
407
|
-
cachedSetTimeout = setTimeout;
|
|
408
|
-
return setTimeout(fun, 0);
|
|
409
|
-
}
|
|
410
|
-
try {
|
|
411
|
-
return cachedSetTimeout(fun, 0);
|
|
412
|
-
} catch (e) {
|
|
413
|
-
try {
|
|
414
|
-
return cachedSetTimeout.call(null, fun, 0);
|
|
415
|
-
} catch (e2) {
|
|
416
|
-
return cachedSetTimeout.call(this, fun, 0);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
function runClearTimeout(marker) {
|
|
421
|
-
if (cachedClearTimeout === clearTimeout) {
|
|
422
|
-
return clearTimeout(marker);
|
|
423
|
-
}
|
|
424
|
-
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
425
|
-
cachedClearTimeout = clearTimeout;
|
|
426
|
-
return clearTimeout(marker);
|
|
427
|
-
}
|
|
428
|
-
try {
|
|
429
|
-
return cachedClearTimeout(marker);
|
|
430
|
-
} catch (e) {
|
|
431
|
-
try {
|
|
432
|
-
return cachedClearTimeout.call(null, marker);
|
|
433
|
-
} catch (e2) {
|
|
434
|
-
return cachedClearTimeout.call(this, marker);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
var queue = [];
|
|
439
|
-
var draining = false;
|
|
440
|
-
var currentQueue;
|
|
441
|
-
var queueIndex = -1;
|
|
442
|
-
function cleanUpNextTick() {
|
|
443
|
-
if (!draining || !currentQueue) {
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
draining = false;
|
|
447
|
-
if (currentQueue.length) {
|
|
448
|
-
queue = currentQueue.concat(queue);
|
|
449
|
-
} else {
|
|
450
|
-
queueIndex = -1;
|
|
451
|
-
}
|
|
452
|
-
if (queue.length) {
|
|
453
|
-
drainQueue();
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
function drainQueue() {
|
|
457
|
-
if (draining) {
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
var timeout = runTimeout(cleanUpNextTick);
|
|
461
|
-
draining = true;
|
|
462
|
-
var len = queue.length;
|
|
463
|
-
while (len) {
|
|
464
|
-
currentQueue = queue;
|
|
465
|
-
queue = [];
|
|
466
|
-
while (++queueIndex < len) {
|
|
467
|
-
if (currentQueue) {
|
|
468
|
-
currentQueue[queueIndex].run();
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
queueIndex = -1;
|
|
472
|
-
len = queue.length;
|
|
473
|
-
}
|
|
474
|
-
currentQueue = null;
|
|
475
|
-
draining = false;
|
|
476
|
-
runClearTimeout(timeout);
|
|
477
|
-
}
|
|
478
|
-
function nextTick(fun) {
|
|
479
|
-
var args = new Array(arguments.length - 1);
|
|
480
|
-
if (arguments.length > 1) {
|
|
481
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
482
|
-
args[i - 1] = arguments[i];
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
queue.push(new Item(fun, args));
|
|
486
|
-
if (queue.length === 1 && !draining) {
|
|
487
|
-
runTimeout(drainQueue);
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
function Item(fun, array) {
|
|
491
|
-
this.fun = fun;
|
|
492
|
-
this.array = array;
|
|
493
|
-
}
|
|
494
|
-
Item.prototype.run = function() {
|
|
495
|
-
this.fun.apply(null, this.array);
|
|
496
|
-
};
|
|
497
|
-
var title$1 = "browser";
|
|
498
|
-
var platform = "browser";
|
|
499
|
-
var browser = true;
|
|
500
|
-
var env = {};
|
|
501
|
-
var argv = [];
|
|
502
|
-
var version = "";
|
|
503
|
-
var versions = {};
|
|
504
|
-
var release = {};
|
|
505
|
-
var config = {};
|
|
506
|
-
function noop() {
|
|
507
|
-
}
|
|
508
|
-
var on = noop;
|
|
509
|
-
var addListener = noop;
|
|
510
|
-
var once = noop;
|
|
511
|
-
var off = noop;
|
|
512
|
-
var removeListener = noop;
|
|
513
|
-
var removeAllListeners = noop;
|
|
514
|
-
var emit = noop;
|
|
515
|
-
function binding(name) {
|
|
516
|
-
throw new Error("process.binding is not supported");
|
|
517
|
-
}
|
|
518
|
-
function cwd() {
|
|
519
|
-
return "/";
|
|
520
|
-
}
|
|
521
|
-
function chdir(dir) {
|
|
522
|
-
throw new Error("process.chdir is not supported");
|
|
523
|
-
}
|
|
524
|
-
function umask() {
|
|
525
|
-
return 0;
|
|
526
|
-
}
|
|
527
|
-
var performance = global$1.performance || {};
|
|
528
|
-
var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function() {
|
|
529
|
-
return (/* @__PURE__ */ new Date()).getTime();
|
|
530
|
-
};
|
|
531
|
-
function hrtime(previousTimestamp) {
|
|
532
|
-
var clocktime = performanceNow.call(performance) * 1e-3;
|
|
533
|
-
var seconds = Math.floor(clocktime);
|
|
534
|
-
var nanoseconds = Math.floor(clocktime % 1 * 1e9);
|
|
535
|
-
if (previousTimestamp) {
|
|
536
|
-
seconds = seconds - previousTimestamp[0];
|
|
537
|
-
nanoseconds = nanoseconds - previousTimestamp[1];
|
|
538
|
-
if (nanoseconds < 0) {
|
|
539
|
-
seconds--;
|
|
540
|
-
nanoseconds += 1e9;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
return [seconds, nanoseconds];
|
|
544
|
-
}
|
|
545
|
-
var startTime = /* @__PURE__ */ new Date();
|
|
546
|
-
function uptime() {
|
|
547
|
-
var currentTime = /* @__PURE__ */ new Date();
|
|
548
|
-
var dif = currentTime - startTime;
|
|
549
|
-
return dif / 1e3;
|
|
550
|
-
}
|
|
551
|
-
var browser$1 = {
|
|
552
|
-
nextTick,
|
|
553
|
-
title: title$1,
|
|
554
|
-
browser,
|
|
555
|
-
env,
|
|
556
|
-
argv,
|
|
557
|
-
version,
|
|
558
|
-
versions,
|
|
559
|
-
on,
|
|
560
|
-
addListener,
|
|
561
|
-
once,
|
|
562
|
-
off,
|
|
563
|
-
removeListener,
|
|
564
|
-
removeAllListeners,
|
|
565
|
-
emit,
|
|
566
|
-
binding,
|
|
567
|
-
cwd,
|
|
568
|
-
chdir,
|
|
569
|
-
umask,
|
|
570
|
-
hrtime,
|
|
571
|
-
platform,
|
|
572
|
-
release,
|
|
573
|
-
config,
|
|
574
|
-
uptime
|
|
575
|
-
};
|
|
576
|
-
function _typeof(o) {
|
|
577
|
-
"@babel/helpers - typeof";
|
|
578
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
579
|
-
return typeof o2;
|
|
580
|
-
} : function(o2) {
|
|
581
|
-
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
582
|
-
}, _typeof(o);
|
|
583
|
-
}
|
|
584
|
-
function _toPrimitive$1(input, hint) {
|
|
585
|
-
if (_typeof(input) !== "object" || input === null)
|
|
586
|
-
return input;
|
|
587
|
-
var prim = input[Symbol.toPrimitive];
|
|
588
|
-
if (prim !== void 0) {
|
|
589
|
-
var res = prim.call(input, hint || "default");
|
|
590
|
-
if (_typeof(res) !== "object")
|
|
591
|
-
return res;
|
|
592
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
593
|
-
}
|
|
594
|
-
return (hint === "string" ? String : Number)(input);
|
|
595
|
-
}
|
|
596
|
-
function _toPropertyKey$1(arg) {
|
|
597
|
-
var key = _toPrimitive$1(arg, "string");
|
|
598
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
599
|
-
}
|
|
600
|
-
function _defineProperty$1(obj, key, value) {
|
|
601
|
-
key = _toPropertyKey$1(key);
|
|
602
|
-
if (key in obj) {
|
|
603
|
-
Object.defineProperty(obj, key, {
|
|
604
|
-
value,
|
|
605
|
-
enumerable: true,
|
|
606
|
-
configurable: true,
|
|
607
|
-
writable: true
|
|
608
|
-
});
|
|
609
|
-
} else {
|
|
610
|
-
obj[key] = value;
|
|
611
|
-
}
|
|
612
|
-
return obj;
|
|
613
|
-
}
|
|
614
|
-
function ownKeys$1(e, r) {
|
|
615
|
-
var t = Object.keys(e);
|
|
616
|
-
if (Object.getOwnPropertySymbols) {
|
|
617
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
618
|
-
r && (o = o.filter(function(r2) {
|
|
619
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
620
|
-
})), t.push.apply(t, o);
|
|
621
|
-
}
|
|
622
|
-
return t;
|
|
623
|
-
}
|
|
624
|
-
function _objectSpread2(e) {
|
|
625
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
626
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
627
|
-
r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) {
|
|
628
|
-
_defineProperty$1(e, r2, t[r2]);
|
|
629
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) {
|
|
630
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
return e;
|
|
634
|
-
}
|
|
635
|
-
function formatProdErrorMessage(code) {
|
|
636
|
-
return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or use the non-minified dev environment for full errors. ";
|
|
637
|
-
}
|
|
638
387
|
var randomString = function randomString2() {
|
|
639
388
|
return Math.random().toString(36).substring(7).split("").join(".");
|
|
640
389
|
};
|
|
@@ -663,32 +412,6 @@ function compose() {
|
|
|
663
412
|
};
|
|
664
413
|
});
|
|
665
414
|
}
|
|
666
|
-
function applyMiddleware() {
|
|
667
|
-
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
668
|
-
middlewares[_key] = arguments[_key];
|
|
669
|
-
}
|
|
670
|
-
return function(createStore) {
|
|
671
|
-
return function() {
|
|
672
|
-
var store = createStore.apply(void 0, arguments);
|
|
673
|
-
var _dispatch = function dispatch() {
|
|
674
|
-
throw new Error(browser$1.env.NODE_ENV === "production" ? formatProdErrorMessage(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.");
|
|
675
|
-
};
|
|
676
|
-
var middlewareAPI = {
|
|
677
|
-
getState: store.getState,
|
|
678
|
-
dispatch: function dispatch() {
|
|
679
|
-
return _dispatch.apply(void 0, arguments);
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
var chain = middlewares.map(function(middleware) {
|
|
683
|
-
return middleware(middlewareAPI);
|
|
684
|
-
});
|
|
685
|
-
_dispatch = compose.apply(void 0, chain)(store.dispatch);
|
|
686
|
-
return _objectSpread2(_objectSpread2({}, store), {}, {
|
|
687
|
-
dispatch: _dispatch
|
|
688
|
-
});
|
|
689
|
-
};
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
415
|
var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
|
|
693
416
|
HttpMethod2["GET"] = "GET";
|
|
694
417
|
HttpMethod2["POST"] = "POST";
|
|
@@ -1967,9 +1690,12 @@ const selectStage = restructureCreateSelectorWithArgs(
|
|
|
1967
1690
|
return stageMapping[stageId];
|
|
1968
1691
|
})
|
|
1969
1692
|
);
|
|
1970
|
-
const selectStages = createSelector(
|
|
1971
|
-
|
|
1972
|
-
|
|
1693
|
+
const selectStages = createSelector(
|
|
1694
|
+
[selectStageMapping],
|
|
1695
|
+
(stageMapping) => {
|
|
1696
|
+
return Object.values(stageMapping);
|
|
1697
|
+
}
|
|
1698
|
+
);
|
|
1973
1699
|
const selectStagesFromAssetTypeIds = restructureCreateSelectorWithArgs(
|
|
1974
1700
|
createSelector([selectStages, (_state, assetTypeIds) => assetTypeIds], (stages, assetTypeIds) => {
|
|
1975
1701
|
const assetTypeIdsSet = new Set(assetTypeIds);
|
|
@@ -2393,9 +2119,12 @@ const selectCommentsOfIssue = restructureCreateSelectorWithArgs(
|
|
|
2393
2119
|
);
|
|
2394
2120
|
const selectIssueUpdateMapping = (state) => state.issueReducer.updates;
|
|
2395
2121
|
const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
|
|
2396
|
-
createSelector(
|
|
2397
|
-
|
|
2398
|
-
|
|
2122
|
+
createSelector(
|
|
2123
|
+
[selectIssueUpdateMapping, (_state, issueId) => issueId],
|
|
2124
|
+
(updates, issueId) => {
|
|
2125
|
+
return Object.values(updates).filter((update) => update.issue === issueId);
|
|
2126
|
+
}
|
|
2127
|
+
)
|
|
2399
2128
|
);
|
|
2400
2129
|
const selectAttachmentsOfIssue = restructureCreateSelectorWithArgs(
|
|
2401
2130
|
createSelector(
|
|
@@ -3703,11 +3432,14 @@ const selectLatestFormRevisionOfForm = restructureCreateSelectorWithArgs(
|
|
|
3703
3432
|
})
|
|
3704
3433
|
);
|
|
3705
3434
|
const selectFormRevisionsOfForm = restructureCreateSelectorWithArgs(
|
|
3706
|
-
createSelector(
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3435
|
+
createSelector(
|
|
3436
|
+
[selectFormRevisions, (_state, formId2) => formId2],
|
|
3437
|
+
(revisions, formId2) => {
|
|
3438
|
+
return revisions.filter((revision) => {
|
|
3439
|
+
return revision.form === formId2;
|
|
3440
|
+
});
|
|
3441
|
+
}
|
|
3442
|
+
)
|
|
3711
3443
|
);
|
|
3712
3444
|
const selectLatestFormRevisionsOfAssetTypes = restructureCreateSelectorWithArgs(
|
|
3713
3445
|
createSelector(
|
|
@@ -4592,7 +4324,7 @@ function handleWorkspaceRemoval(draft, action) {
|
|
|
4592
4324
|
form.index_workspace = mainWorkspace.offline_id;
|
|
4593
4325
|
}
|
|
4594
4326
|
}
|
|
4595
|
-
const
|
|
4327
|
+
const overmapRootReducer = (state, action) => {
|
|
4596
4328
|
if (action.type === "auth/setLoggedIn" && !action.payload) {
|
|
4597
4329
|
return overmapReducer(void 0, action);
|
|
4598
4330
|
}
|
|
@@ -4680,17 +4412,6 @@ const customConfig = {
|
|
|
4680
4412
|
};
|
|
4681
4413
|
const migration = createMigration(manifest, VERSION_REDUCER_KEY);
|
|
4682
4414
|
const overmapEnhancer = compose(offline$1(customConfig), migration);
|
|
4683
|
-
const defaultStore = configureStore({
|
|
4684
|
-
reducer: rootReducer,
|
|
4685
|
-
enhancers: [compose(applyMiddleware(), overmapEnhancer)],
|
|
4686
|
-
middleware: (getDefaultMiddleware) => {
|
|
4687
|
-
return getDefaultMiddleware({
|
|
4688
|
-
// TODO: Enable periodically to find problems
|
|
4689
|
-
serializableCheck: false,
|
|
4690
|
-
immutableCheck: false
|
|
4691
|
-
});
|
|
4692
|
-
}
|
|
4693
|
-
});
|
|
4694
4415
|
function extractResponseFromError(error2) {
|
|
4695
4416
|
function isResponse(response) {
|
|
4696
4417
|
const knownKeys = ["ok", "redirect", "clientError", "serverError", "error"];
|
|
@@ -4994,8 +4715,6 @@ function retry(_action, _retries) {
|
|
|
4994
4715
|
getClientStore().dispatch(_setLatestRetryTime((/* @__PURE__ */ new Date()).getTime()));
|
|
4995
4716
|
return OUTBOX_RETRY_DELAY;
|
|
4996
4717
|
}
|
|
4997
|
-
const useAppDispatch = () => useDispatch();
|
|
4998
|
-
const useAppSelector = useSelector;
|
|
4999
4718
|
const EXPIRING_SOON_THRESHOLD = 1800;
|
|
5000
4719
|
function parseTokens(response) {
|
|
5001
4720
|
if (!response.access)
|
|
@@ -8288,13 +8007,16 @@ class AgentService extends BaseApiService {
|
|
|
8288
8007
|
queryParams: { conversation_id: conversationId }
|
|
8289
8008
|
}).then((response) => {
|
|
8290
8009
|
const conversation = store.getState().agentsReducer.conversations[conversationId];
|
|
8291
|
-
if (!conversation) {
|
|
8010
|
+
if (!(conversation == null ? void 0 : conversation.offline_id)) {
|
|
8292
8011
|
throw new Error("Conversation not found");
|
|
8293
8012
|
}
|
|
8013
|
+
if (!Array.isArray(response)) {
|
|
8014
|
+
response = [response];
|
|
8015
|
+
}
|
|
8294
8016
|
store.dispatch(
|
|
8295
8017
|
updateConversation({
|
|
8296
|
-
|
|
8297
|
-
tiptap_content: [...conversation.tiptap_content || [], response
|
|
8018
|
+
...conversation,
|
|
8019
|
+
tiptap_content: [...conversation.tiptap_content || [], ...response]
|
|
8298
8020
|
})
|
|
8299
8021
|
);
|
|
8300
8022
|
});
|
|
@@ -14354,7 +14076,7 @@ const FileViewerContext = createContext(() => {
|
|
|
14354
14076
|
const useFileViewer = () => useContext(FileViewerContext);
|
|
14355
14077
|
const FileViewerProvider = memo((props) => {
|
|
14356
14078
|
const { children } = props;
|
|
14357
|
-
const [
|
|
14079
|
+
const [config, setConfig] = useState(null);
|
|
14358
14080
|
const [fileType, setFileType] = useState(null);
|
|
14359
14081
|
const closeFileViewer = useCallback(() => {
|
|
14360
14082
|
setConfig(null);
|
|
@@ -14367,16 +14089,16 @@ const FileViewerProvider = memo((props) => {
|
|
|
14367
14089
|
[closeFileViewer]
|
|
14368
14090
|
);
|
|
14369
14091
|
const handleClose = useCallback(() => {
|
|
14370
|
-
if (!
|
|
14092
|
+
if (!config)
|
|
14371
14093
|
return;
|
|
14372
|
-
if (
|
|
14373
|
-
|
|
14094
|
+
if (config.onClose)
|
|
14095
|
+
config.onClose();
|
|
14374
14096
|
closeFileViewer();
|
|
14375
|
-
}, [closeFileViewer,
|
|
14097
|
+
}, [closeFileViewer, config]);
|
|
14376
14098
|
useEffect(() => {
|
|
14377
|
-
if (!
|
|
14099
|
+
if (!config)
|
|
14378
14100
|
return;
|
|
14379
|
-
const { file } =
|
|
14101
|
+
const { file } = config;
|
|
14380
14102
|
if (SUPPORTED_SPREADSHEET_FILE_EXTENSIONS.includes(file.type)) {
|
|
14381
14103
|
setFileType("spreadsheet");
|
|
14382
14104
|
return;
|
|
@@ -14389,14 +14111,14 @@ const FileViewerProvider = memo((props) => {
|
|
|
14389
14111
|
setFileType("image");
|
|
14390
14112
|
return;
|
|
14391
14113
|
}
|
|
14392
|
-
}, [
|
|
14114
|
+
}, [config]);
|
|
14393
14115
|
const value = useMemo(() => openFileViewer, [openFileViewer]);
|
|
14394
14116
|
return /* @__PURE__ */ jsxs(FileViewerContext.Provider, { value, children: [
|
|
14395
14117
|
children,
|
|
14396
|
-
|
|
14397
|
-
fileType === "spreadsheet" && /* @__PURE__ */ jsx(SpreadsheetViewer, { file:
|
|
14398
|
-
fileType === "pdf" && /* @__PURE__ */ jsx(PDFViewer, { file:
|
|
14399
|
-
fileType === "image" && /* @__PURE__ */ jsx(ImageViewer, { file:
|
|
14118
|
+
config && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14119
|
+
fileType === "spreadsheet" && /* @__PURE__ */ jsx(SpreadsheetViewer, { file: config.file, onDelete: config.onDelete, onClose: handleClose }),
|
|
14120
|
+
fileType === "pdf" && /* @__PURE__ */ jsx(PDFViewer, { file: config.file, onDelete: config.onDelete, onClose: handleClose }),
|
|
14121
|
+
fileType === "image" && /* @__PURE__ */ jsx(ImageViewer, { file: config.file, onDelete: config.onDelete, onClose: handleClose })
|
|
14400
14122
|
] })
|
|
14401
14123
|
] });
|
|
14402
14124
|
});
|
|
@@ -15095,7 +14817,7 @@ const initialFormValues = (fields, values) => {
|
|
|
15095
14817
|
};
|
|
15096
14818
|
const useAttachImagesToFormRevisionFields = (revision) => {
|
|
15097
14819
|
const { sdk } = useSDK();
|
|
15098
|
-
const attachments =
|
|
14820
|
+
const attachments = useSelector(selectAttachmentsOfFormRevision((revision == null ? void 0 : revision.offline_id) ?? ""));
|
|
15099
14821
|
return useMemo(() => {
|
|
15100
14822
|
if (!revision || !attachments)
|
|
15101
14823
|
return revision;
|
|
@@ -15177,7 +14899,7 @@ const FormRenderer = memo(
|
|
|
15177
14899
|
const FormSubmissionViewer = memo(
|
|
15178
14900
|
forwardRef((props, ref) => {
|
|
15179
14901
|
const { submission, showFormDescription = false, showFormTitle = true } = props;
|
|
15180
|
-
const revision =
|
|
14902
|
+
const revision = useSelector(selectFormRevision(submission.form_revision));
|
|
15181
14903
|
const { sdk } = useSDK();
|
|
15182
14904
|
if (!revision) {
|
|
15183
14905
|
throw new Error(
|
|
@@ -15242,8 +14964,8 @@ const FormBrowser = memo(
|
|
|
15242
14964
|
}
|
|
15243
14965
|
return ret;
|
|
15244
14966
|
}, [filter, maxResults, ownerFilter]);
|
|
15245
|
-
const userForms =
|
|
15246
|
-
const userFormMapping =
|
|
14967
|
+
const userForms = useSelector(selectFilteredForms(ownerFilterOptions)) ?? [];
|
|
14968
|
+
const userFormMapping = useSelector(selectFormMapping);
|
|
15247
14969
|
const attachableUserForms = userForms.filter((form) => !form.asset_type && !form.issue_type);
|
|
15248
14970
|
const attachableUserFormMapping = Object.values(userFormMapping).filter(
|
|
15249
14971
|
(form) => !form.asset_type
|
|
@@ -15276,7 +14998,7 @@ const FormBrowser = memo(
|
|
|
15276
14998
|
const handleChange = useCallback((e) => {
|
|
15277
14999
|
setFilter(e.currentTarget.value);
|
|
15278
15000
|
}, []);
|
|
15279
|
-
const numberOfForms =
|
|
15001
|
+
const numberOfForms = useSelector(selectGeneralFormCount) || 0;
|
|
15280
15002
|
const numberOfHiddenForms = numberOfForms - attachableUserForms.length;
|
|
15281
15003
|
const overflowMessage = attachableUserForms.length == maxResults && numberOfHiddenForms > 0 ? `Only the first ${maxResults} results are shown (${numberOfHiddenForms} hidden)` : numberOfHiddenForms > 0 && `${numberOfHiddenForms} hidden forms`;
|
|
15282
15004
|
return /* @__PURE__ */ jsxs(Flex$1, { ref, direction: "column", gap: "2", children: [
|
|
@@ -15311,9 +15033,9 @@ const FormBrowser = memo(
|
|
|
15311
15033
|
const FormBrowserEntry = (props) => {
|
|
15312
15034
|
var _a2;
|
|
15313
15035
|
const { form, onSelectForm, isFavoriteEditable, handleToggleFavorite } = props;
|
|
15314
|
-
const ownerOrganization = (_a2 =
|
|
15315
|
-
const ownerUser =
|
|
15316
|
-
const currentUserId =
|
|
15036
|
+
const ownerOrganization = (_a2 = useSelector(selectOrganization(form.owner_organization || -1))) == null ? void 0 : _a2.name;
|
|
15037
|
+
const ownerUser = useSelector(selectUser(form.owner_user || -1));
|
|
15038
|
+
const currentUserId = useSelector(selectCurrentUser).id;
|
|
15317
15039
|
const ownedByCurrentUser = !!ownerUser && ownerUser.id === currentUserId;
|
|
15318
15040
|
const owner = ownerOrganization ?? (ownedByCurrentUser ? "You" : ownerUser == null ? void 0 : ownerUser.username) ?? "Unknown";
|
|
15319
15041
|
const handleFavoriteClick = useCallback(
|
|
@@ -15368,15 +15090,15 @@ const styles$2 = {
|
|
|
15368
15090
|
const FormSubmissionBrowserEntry = memo((props) => {
|
|
15369
15091
|
var _a2;
|
|
15370
15092
|
const { submission, onSubmissionClick, compact, labelType, rowDecorator } = props;
|
|
15371
|
-
const currentUser =
|
|
15372
|
-
const createdBy =
|
|
15093
|
+
const currentUser = useSelector(selectCurrentUser);
|
|
15094
|
+
const createdBy = useSelector(selectUser("created_by" in submission ? submission.created_by : currentUser.id));
|
|
15373
15095
|
const dateToUse = submission.submitted_at;
|
|
15374
15096
|
const formattedDateTime = getLocalDateString(dateToUse);
|
|
15375
|
-
const revision =
|
|
15097
|
+
const revision = useSelector(selectFormRevision(submission.form_revision));
|
|
15376
15098
|
if (!revision) {
|
|
15377
15099
|
throw new Error(`Could not find revision ${submission.form_revision} for submission ${submission.offline_id}.`);
|
|
15378
15100
|
}
|
|
15379
|
-
const latestRevisionNumber = (_a2 =
|
|
15101
|
+
const latestRevisionNumber = (_a2 = useSelector(selectLatestFormRevisionOfForm(revision.form))) == null ? void 0 : _a2.revision;
|
|
15380
15102
|
const creatorProfileSrc = useFileSrc({
|
|
15381
15103
|
file: (createdBy == null ? void 0 : createdBy.profile.file) ?? null,
|
|
15382
15104
|
fileSha1: (createdBy == null ? void 0 : createdBy.profile.file_sha1) ?? null
|
|
@@ -15420,7 +15142,7 @@ const FormSubmissionBrowser = memo((props) => {
|
|
|
15420
15142
|
if (!!formId2 === !!propSubmissions) {
|
|
15421
15143
|
throw new Error("Either formId or submissions must be provided, but not both.");
|
|
15422
15144
|
}
|
|
15423
|
-
const submissions =
|
|
15145
|
+
const submissions = useSelector(propSubmissions ? () => propSubmissions : selectFormSubmissionsOfForm(formId2));
|
|
15424
15146
|
const sortedSubmissions = useMemo(
|
|
15425
15147
|
() => submissions == null ? void 0 : submissions.sort((a, b) => {
|
|
15426
15148
|
return a.submitted_at.localeCompare(b.submitted_at);
|
|
@@ -16838,7 +16560,6 @@ export {
|
|
|
16838
16560
|
createOfflineAction,
|
|
16839
16561
|
createPointMarker,
|
|
16840
16562
|
defaultBadgeColor,
|
|
16841
|
-
defaultStore,
|
|
16842
16563
|
deleteAssetType,
|
|
16843
16564
|
deleteForm,
|
|
16844
16565
|
deleteFormRevision,
|
|
@@ -16938,6 +16659,7 @@ export {
|
|
|
16938
16659
|
overmapEnhancer,
|
|
16939
16660
|
overmapReducer,
|
|
16940
16661
|
overmapReducers,
|
|
16662
|
+
overmapRootReducer,
|
|
16941
16663
|
patchCategory,
|
|
16942
16664
|
performRequest,
|
|
16943
16665
|
primaryColor,
|
|
@@ -16989,7 +16711,6 @@ export {
|
|
|
16989
16711
|
resetRecentIssues,
|
|
16990
16712
|
resetStore,
|
|
16991
16713
|
restructureCreateSelectorWithArgs,
|
|
16992
|
-
rootReducer,
|
|
16993
16714
|
saveActiveProjectFileBounds,
|
|
16994
16715
|
searchIssues,
|
|
16995
16716
|
selectAccessToken,
|
|
@@ -17290,8 +17011,6 @@ export {
|
|
|
17290
17011
|
updateProjectAttachments,
|
|
17291
17012
|
updateStages,
|
|
17292
17013
|
updateTeam,
|
|
17293
|
-
useAppDispatch,
|
|
17294
|
-
useAppSelector,
|
|
17295
17014
|
useFieldInput,
|
|
17296
17015
|
useFieldInputs,
|
|
17297
17016
|
useFileSrc,
|