@zextras/carbonio-shell-ui 10.0.0-devel.1738847815855 → 10.0.0-devel.1741258975575
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/lib/boot/app/app-dependant-exports.d.ts +0 -7
- package/lib/boot/app/app-dependant-exports.js +1 -10
- package/lib/boot/app/app-dependant-exports.js.map +1 -1
- package/lib/boot/app/app-direct-exports.d.ts +1 -1
- package/lib/boot/app/app-direct-exports.js +2 -9
- package/lib/boot/app/app-direct-exports.js.map +1 -1
- package/lib/constants/index.js +2 -2
- package/lib/constants/index.js.map +1 -1
- package/lib/history/hooks.d.ts +0 -10
- package/lib/history/hooks.js +1 -51
- package/lib/history/hooks.js.map +1 -1
- package/lib/lib.d.ts +0 -5
- package/lib/lib.js +0 -1
- package/lib/lib.js.map +1 -1
- package/lib/settings/components/settings-header.js +5 -9
- package/lib/settings/components/settings-header.js.map +1 -1
- package/lib/shell/creation-button.d.ts +1 -1
- package/lib/shell/creation-button.js.map +1 -1
- package/lib/store/app/hooks.d.ts +0 -1
- package/lib/store/app/hooks.js +1 -3
- package/lib/store/app/hooks.js.map +1 -1
- package/lib/types/misc/index.d.ts +1 -1
- package/lib/ui-extras/nav-guard.d.ts +1 -1
- package/lib/ui-extras/nav-guard.js +22 -40
- package/lib/ui-extras/nav-guard.js.map +1 -1
- package/package.json +3 -6
- package/lib/store/context-bridge.d.ts +0 -11
- package/lib/store/context-bridge.js +0 -34
- package/lib/store/context-bridge.js.map +0 -1
- package/lib/ui-extras/app-link.d.ts +0 -6
- package/lib/ui-extras/app-link.js +0 -50
- package/lib/ui-extras/app-link.js.map +0 -1
|
@@ -3,7 +3,6 @@ import { getSoapFetch, getXmlSoapFetch } from '../../network/fetch';
|
|
|
3
3
|
import type { AppActions as StoreAppSetters } from '../../store/app';
|
|
4
4
|
import { getApp, getAppContext, getAppContextHook, getAppHook } from '../../store/app';
|
|
5
5
|
import { addBoard } from '../../store/boards';
|
|
6
|
-
import type { ContextBridgeState } from '../../store/context-bridge';
|
|
7
6
|
import { getI18n, getTFunction } from '../../store/i18n/hooks';
|
|
8
7
|
import type { IntegrationActions } from '../../store/integrations/store';
|
|
9
8
|
import type { AppRouteDescriptor, BoardView, CarbonioModule, PrimaryAccessoryView, SecondaryAccessoryView, SettingsView, UtilityView } from '../../types/apps';
|
|
@@ -26,11 +25,5 @@ export type AppDependantExports = {
|
|
|
26
25
|
useApp: ReturnType<typeof getAppHook>;
|
|
27
26
|
getApp: ReturnType<typeof getApp>;
|
|
28
27
|
addBoard: ReturnType<typeof addBoard>;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated Use hooks to access to functions which require context
|
|
31
|
-
*/
|
|
32
|
-
getBridgedFunctions: () => ContextBridgeState['functions'] & {
|
|
33
|
-
[K in keyof ContextBridgeState['packageDependentFunctions']]: ReturnType<ContextBridgeState['packageDependentFunctions'][K]>;
|
|
34
|
-
};
|
|
35
28
|
};
|
|
36
29
|
export declare const getAppDependantExports: (pkg: CarbonioModule) => AppDependantExports;
|
|
@@ -6,13 +6,11 @@ exports.getAppDependantExports = void 0;
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
8
8
|
*/
|
|
9
|
-
const lodash_1 = require("lodash");
|
|
10
9
|
const edit_settings_1 = require("../../network/edit-settings");
|
|
11
10
|
const fetch_1 = require("../../network/fetch");
|
|
12
11
|
const app_1 = require("../../store/app");
|
|
13
12
|
const utils_1 = require("../../store/app/utils");
|
|
14
13
|
const boards_1 = require("../../store/boards");
|
|
15
|
-
const context_bridge_1 = require("../../store/context-bridge");
|
|
16
14
|
const hooks_1 = require("../../store/i18n/hooks");
|
|
17
15
|
const store_1 = require("../../store/integrations/store");
|
|
18
16
|
const getAppDependantExports = (pkg) => {
|
|
@@ -36,14 +34,7 @@ const getAppDependantExports = (pkg) => {
|
|
|
36
34
|
getAppContext: (0, app_1.getAppContext)(pkg.name),
|
|
37
35
|
useApp: (0, app_1.getAppHook)(pkg.name),
|
|
38
36
|
getApp: (0, app_1.getApp)(pkg.name),
|
|
39
|
-
addBoard: (0, boards_1.addBoard)(pkg.name)
|
|
40
|
-
getBridgedFunctions: () => {
|
|
41
|
-
const { packageDependentFunctions, functions } = context_bridge_1.useContextBridge.getState();
|
|
42
|
-
return {
|
|
43
|
-
...functions,
|
|
44
|
-
...(0, lodash_1.reduce)(packageDependentFunctions, (acc, f, name) => ({ ...acc, [name]: f(pkg.name) }), {})
|
|
45
|
-
};
|
|
46
|
-
}
|
|
37
|
+
addBoard: (0, boards_1.addBoard)(pkg.name)
|
|
47
38
|
};
|
|
48
39
|
};
|
|
49
40
|
exports.getAppDependantExports = getAppDependantExports;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-dependant-exports.js","sourceRoot":"","sources":["../../../src/boot/app/app-dependant-exports.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH
|
|
1
|
+
{"version":3,"file":"app-dependant-exports.js","sourceRoot":"","sources":["../../../src/boot/app/app-dependant-exports.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,+DAAoE;AACpE,+CAAoE;AAEpE,yCAAoG;AACpG,iDAO+B;AAC/B,+CAA8C;AAC9C,kDAA+D;AAE/D,0DAAsE;AAoC/D,MAAM,sBAAsB,GAAG,CAAC,GAAmB,EAAuB,EAAE;IAClF,MAAM,QAAQ,GAAG,iBAAW,CAAC,QAAQ,EAAE,CAAC;IACxC,MAAM,YAAY,GAAG,4BAAoB,CAAC,QAAQ,EAAE,CAAC;IACrD,OAAO;QACN,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC;QAC/C,QAAQ,EAAE,CAAC,KAAkC,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAA,sBAAc,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/F,YAAY,EAAE,CAAC,IAA4B,EAAE,EAAE,CAC9C,QAA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AE,IAAA,iBAAQ,EAAC,GAAG,CAAC,IAAI,CAAC;KAC5B,CAAC;AACH,CAAC,CAAC;AA5BW,QAAA,sBAAsB,0BA4BjC"}
|
|
@@ -11,7 +11,7 @@ export declare const registerFunctions: (...items: Array<{
|
|
|
11
11
|
export { getUserAccount, getUserAccounts, getUserSetting, getUserSettings, useUserAccount, useUserAccounts, useUserSetting, useUserSettings, useUserRight, useUserRights, getUserRight, getUserRights, useAuthenticated, updateSettings, updateAccount } from '../../store/account';
|
|
12
12
|
export { useNotify, useRefresh } from '../../store/network';
|
|
13
13
|
export { closeBoard, updateBoard, updateBoardContext, getBoardById, getBoardContextById, useBoardContextById, useBoardById, useBoard, minimizeBoards, expandBoards, reopenBoards, setCurrentBoard, useBoardHooks } from '../../store/boards';
|
|
14
|
-
export {
|
|
14
|
+
export { useCurrentRoute } from '../../history/hooks';
|
|
15
15
|
export { getNotificationManager } from '../../notification/NotificationManager';
|
|
16
16
|
export { useLocalStorage } from '../../shell/hooks/useLocalStorage';
|
|
17
17
|
export declare const updatePrimaryBadge: (badge: Partial<import("../../lib").BadgeInfo>, id: string) => void, setRouteVisibility: (id: string, visible: boolean) => void, removeRoute: (id: string) => void, removeBoardView: (id: string) => void, removeSettingsView: (id: string) => void, removeUtilityView: (id: string) => void, removePrimaryAccessoryView: (id: string) => void, removeSecondaryAccessoryView: (id: string) => void,
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
var _a, _b;
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
exports.soapFetchV2 = exports.AuthGuard = exports.AppContextProvider = exports.useTracker = exports.useIsCarbonioCE = exports.upsertApp = exports.removeSecondaryAccessoryView = exports.removePrimaryAccessoryView = exports.removeUtilityView = exports.removeSettingsView =
|
|
9
|
+
exports.removeBoardView = exports.removeRoute = exports.setRouteVisibility = exports.updatePrimaryBadge = exports.useLocalStorage = exports.getNotificationManager = exports.useCurrentRoute = exports.useBoardHooks = exports.setCurrentBoard = exports.reopenBoards = exports.expandBoards = exports.minimizeBoards = exports.useBoard = exports.useBoardById = exports.useBoardContextById = exports.getBoardContextById = exports.getBoardById = exports.updateBoardContext = exports.updateBoard = exports.closeBoard = exports.useRefresh = exports.useNotify = exports.updateAccount = exports.updateSettings = exports.useAuthenticated = exports.getUserRights = exports.getUserRight = exports.useUserRights = exports.useUserRight = exports.useUserSettings = exports.useUserSetting = exports.useUserAccounts = exports.useUserAccount = exports.getUserSettings = exports.getUserSetting = exports.getUserAccounts = exports.getUserAccount = exports.removeComponents = exports.removeActions = exports.registerActions = exports.removeFunctions = exports.registerFunctions = exports.getIntegratedFunction = exports.getIntegratedComponent = exports.getActions = exports.getAction = exports.useIntegratedFunction = exports.useIntegratedComponent = exports.useActions = exports.useAction = void 0;
|
|
10
|
+
exports.soapFetchV2 = exports.AuthGuard = exports.AppContextProvider = exports.useTracker = exports.useIsCarbonioCE = exports.upsertApp = exports.removeSecondaryAccessoryView = exports.removePrimaryAccessoryView = exports.removeUtilityView = exports.removeSettingsView = void 0;
|
|
11
11
|
const app_1 = require("../../store/app");
|
|
12
12
|
const store_1 = require("../../store/integrations/store");
|
|
13
13
|
var hooks_1 = require("../../store/integrations/hooks");
|
|
@@ -55,14 +55,7 @@ Object.defineProperty(exports, "reopenBoards", { enumerable: true, get: function
|
|
|
55
55
|
Object.defineProperty(exports, "setCurrentBoard", { enumerable: true, get: function () { return boards_1.setCurrentBoard; } });
|
|
56
56
|
Object.defineProperty(exports, "useBoardHooks", { enumerable: true, get: function () { return boards_1.useBoardHooks; } });
|
|
57
57
|
var hooks_2 = require("../../history/hooks");
|
|
58
|
-
Object.defineProperty(exports, "usePushHistoryCallback", { enumerable: true, get: function () { return hooks_2.usePushHistoryCallback; } });
|
|
59
|
-
Object.defineProperty(exports, "useGoBackHistoryCallback", { enumerable: true, get: function () { return hooks_2.useGoBackHistoryCallback; } });
|
|
60
|
-
Object.defineProperty(exports, "useReplaceHistoryCallback", { enumerable: true, get: function () { return hooks_2.useReplaceHistoryCallback; } });
|
|
61
|
-
Object.defineProperty(exports, "getCurrentRoute", { enumerable: true, get: function () { return hooks_2.getCurrentRoute; } });
|
|
62
58
|
Object.defineProperty(exports, "useCurrentRoute", { enumerable: true, get: function () { return hooks_2.useCurrentRoute; } });
|
|
63
|
-
Object.defineProperty(exports, "replaceHistory", { enumerable: true, get: function () { return hooks_2.replaceHistory; } });
|
|
64
|
-
Object.defineProperty(exports, "goBackHistory", { enumerable: true, get: function () { return hooks_2.goBackHistory; } });
|
|
65
|
-
Object.defineProperty(exports, "pushHistory", { enumerable: true, get: function () { return hooks_2.pushHistory; } });
|
|
66
59
|
var NotificationManager_1 = require("../../notification/NotificationManager");
|
|
67
60
|
Object.defineProperty(exports, "getNotificationManager", { enumerable: true, get: function () { return NotificationManager_1.getNotificationManager; } });
|
|
68
61
|
var useLocalStorage_1 = require("../../shell/hooks/useLocalStorage");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-direct-exports.js","sourceRoot":"","sources":["../../../src/boot/app/app-direct-exports.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAEH,yCAA8C;AAC9C,0DAAsE;AAEtE,wDAKwC;AAJvC,kGAAA,SAAS,OAAA;AACT,mGAAA,UAAU,OAAA;AACV,+GAAA,sBAAsB,OAAA;AACtB,8GAAA,qBAAqB,OAAA;AAGtB,4DAK0C;AAJzC,oGAAA,SAAS,OAAA;AACT,qGAAA,UAAU,OAAA;AACV,iHAAA,sBAAsB,OAAA;AACtB,gHAAA,qBAAqB,OAAA;AAGT,KAMT,4BAAoB,CAAC,QAAQ,EAAE,EALlC,yBAAiB,yBACjB,uBAAe,uBACf,uBAAe,uBACf,qBAAa,qBACb,wBAAgB,uBACmB;AAEpC,+CAgB6B;AAf5B,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AACf,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AAC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AA9C,uGAAA,SAAS,OAAA;AAClB,6CAAkD;AAAzC,oGAAA,WAAW,OAAA"}
|
package/lib/constants/index.js
CHANGED
|
@@ -47,8 +47,8 @@ exports.darkReaderDynamicThemeFixes = {
|
|
|
47
47
|
ignoreInlineStyle: ['.tox-menu *'],
|
|
48
48
|
disableStyleSheetsProxy: false
|
|
49
49
|
};
|
|
50
|
-
const base = '/carbonio
|
|
51
|
-
const focusModeBase = `${base}focus-mode`;
|
|
50
|
+
const base = '/carbonio';
|
|
51
|
+
const focusModeBase = `${base}/focus-mode`;
|
|
52
52
|
exports.IS_FOCUS_MODE = window.location.pathname.startsWith(focusModeBase);
|
|
53
53
|
exports.BASENAME = exports.IS_FOCUS_MODE ? focusModeBase : base;
|
|
54
54
|
exports.EMAIL_VALIDATION_REGEX =
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;AAOa,QAAA,YAAY,GAAG,mBAAmB,CAAC;AACnC,QAAA,eAAe,GAAG,UAAU,CAAC;AAE7B,QAAA,YAAY,GAAG;IAC3B,0GAA0G;IAC1G,YAAY,EAAE,cAAc;IAC5B,0GAA0G;IAC1G,iBAAiB,EAAE,mBAAmB;IACtC,0GAA0G;IAC1G,OAAO,EAAE,SAAS;IAClB,0GAA0G;IAC1G,YAAY,EAAE,cAAc;IAC5B,0GAA0G;IAC1G,OAAO,EAAE,SAAS;IAClB,0GAA0G;IAC1G,YAAY,EAAE,cAAc;IAC5B,0GAA0G;IAC1G,MAAM,EAAE,QAAQ;IAChB,0GAA0G;IAC1G,WAAW,EAAE,aAAa;IAC1B,0GAA0G;IAC1G,WAAW,EAAE,aAAa;IAC1B,0GAA0G;IAC1G,gBAAgB,EAAE,kBAAkB;IACpC,0GAA0G;IAC1G,MAAM,EAAE,QAAQ;IAChB,0GAA0G;IAC1G,WAAW,EAAE,aAAa;IAC1B,0GAA0G;IAC1G,QAAQ,EAAE,UAA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,mEAAmE,CAAC;AAEpG;;GAEG;AACU,QAAA,iBAAiB,GAAG;IAChC,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACL,CAAC;AAEE,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAC9B,QAAA,iBAAiB,GAAG,WAAW,CAAC;AAChC,QAAA,mBAAmB,GAAG,MAAM,CAAC;AAC7B,QAAA,eAAe,GAAG,mBAAmB,CAAC;AACtC,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAC5B,QAAA,oBAAoB,GAAG;IACnC,GAAG,EAAE,EAAE;IACP,IAAI,EAAE,EAAE;CACR,CAAC;AAEW,QAAA,0BAA0B,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACjE,QAAA,aAAa,GAAG,EAAE,UAAU,EAAE,YAAY,EAAW,CAAC;AAEtD,QAAA,IAAI,GAAG;IACnB,OAAO,EAAE,mBAAmB;IAC5B,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,gBAAgB;CACb,CAAC"}
|
package/lib/history/hooks.d.ts
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import type { To } from 'history';
|
|
2
1
|
import type { AppRoute } from '../types/apps';
|
|
3
|
-
import type { HistoryParams } from '../types/misc';
|
|
4
2
|
export declare const useCurrentRoute: () => AppRoute | undefined;
|
|
5
|
-
export declare const getCurrentRoute: () => AppRoute | undefined;
|
|
6
|
-
export declare const parseParams: (params: HistoryParams) => To;
|
|
7
|
-
export declare const usePushHistoryCallback: () => ((params: HistoryParams) => void);
|
|
8
|
-
export declare const useReplaceHistoryCallback: () => ((params: HistoryParams) => void);
|
|
9
|
-
export declare function useGoBackHistoryCallback(): () => void;
|
|
10
|
-
export declare const pushHistory: (params: HistoryParams) => void;
|
|
11
|
-
export declare const replaceHistory: (params: HistoryParams) => void;
|
|
12
|
-
export declare const goBackHistory: () => void;
|
package/lib/history/hooks.js
CHANGED
|
@@ -5,65 +5,15 @@
|
|
|
5
5
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
9
|
-
exports.useGoBackHistoryCallback = useGoBackHistoryCallback;
|
|
8
|
+
exports.useCurrentRoute = void 0;
|
|
10
9
|
const react_1 = require("react");
|
|
11
10
|
const lodash_1 = require("lodash");
|
|
12
11
|
const react_router_dom_1 = require("react-router-dom");
|
|
13
12
|
const app_1 = require("../store/app");
|
|
14
|
-
const context_bridge_1 = require("../store/context-bridge");
|
|
15
13
|
const useCurrentRoute = () => {
|
|
16
14
|
const location = (0, react_router_dom_1.useLocation)();
|
|
17
15
|
const routes = (0, app_1.useRoutes)();
|
|
18
16
|
return (0, react_1.useMemo)(() => (0, lodash_1.find)(routes, ({ route }) => (0, lodash_1.startsWith)((0, lodash_1.trim)(location.pathname, '/'), route)), [location.pathname, routes]);
|
|
19
17
|
};
|
|
20
18
|
exports.useCurrentRoute = useCurrentRoute;
|
|
21
|
-
const getCurrentRoute = () => {
|
|
22
|
-
const history = context_bridge_1.useContextBridge.getState().functions.getHistory?.();
|
|
23
|
-
const routes = (0, app_1.getRoutes)();
|
|
24
|
-
return (0, lodash_1.find)(routes, (r) => (0, lodash_1.startsWith)((0, lodash_1.trim)(history.location.pathname, '/'), r.route));
|
|
25
|
-
};
|
|
26
|
-
exports.getCurrentRoute = getCurrentRoute;
|
|
27
|
-
const parseParams = (params) => {
|
|
28
|
-
if (typeof params === 'string') {
|
|
29
|
-
return (0, lodash_1.replace)(`/${(0, exports.getCurrentRoute)()?.route}/${params}`, '//', '/');
|
|
30
|
-
}
|
|
31
|
-
const routeToApply = params.route
|
|
32
|
-
? (0, lodash_1.find)((0, app_1.getRoutes)(), (r) => r.id === params.route || r.route === params.route)
|
|
33
|
-
: (0, exports.getCurrentRoute)();
|
|
34
|
-
return typeof params.path === 'string'
|
|
35
|
-
? (0, lodash_1.replace)(`/${routeToApply?.route}/${params.path}`, '//', '/')
|
|
36
|
-
: {
|
|
37
|
-
search: params.path.search,
|
|
38
|
-
hash: params.path.hash,
|
|
39
|
-
pathname: (0, lodash_1.replace)(`/${routeToApply?.route}/${params.path.pathname}`, '//', '/')
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
exports.parseParams = parseParams;
|
|
43
|
-
const usePushHistoryCallback = () => {
|
|
44
|
-
const history = (0, react_router_dom_1.useHistory)();
|
|
45
|
-
return (0, react_1.useCallback)((params) => history.push((0, exports.parseParams)(params)), [history]);
|
|
46
|
-
};
|
|
47
|
-
exports.usePushHistoryCallback = usePushHistoryCallback;
|
|
48
|
-
const useReplaceHistoryCallback = () => {
|
|
49
|
-
const history = (0, react_router_dom_1.useHistory)();
|
|
50
|
-
return (0, react_1.useCallback)((params) => history.replace((0, exports.parseParams)(params)), [history]);
|
|
51
|
-
};
|
|
52
|
-
exports.useReplaceHistoryCallback = useReplaceHistoryCallback;
|
|
53
|
-
function useGoBackHistoryCallback() {
|
|
54
|
-
const history = (0, react_router_dom_1.useHistory)();
|
|
55
|
-
return history.goBack;
|
|
56
|
-
}
|
|
57
|
-
const pushHistory = (params) => {
|
|
58
|
-
const history = context_bridge_1.useContextBridge.getState().functions.getHistory?.();
|
|
59
|
-
history.push((0, exports.parseParams)(params));
|
|
60
|
-
};
|
|
61
|
-
exports.pushHistory = pushHistory;
|
|
62
|
-
const replaceHistory = (params) => {
|
|
63
|
-
const history = context_bridge_1.useContextBridge.getState().functions.getHistory?.();
|
|
64
|
-
history.replace((0, exports.parseParams)(params));
|
|
65
|
-
};
|
|
66
|
-
exports.replaceHistory = replaceHistory;
|
|
67
|
-
const goBackHistory = () => context_bridge_1.useContextBridge.getState().functions.getHistory?.().goBack();
|
|
68
|
-
exports.goBackHistory = goBackHistory;
|
|
69
19
|
//# sourceMappingURL=hooks.js.map
|
package/lib/history/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/history/hooks.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/history/hooks.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAAgC;AAEhC,mCAAgD;AAChD,uDAA+C;AAE/C,sCAAyC;AAGlC,MAAM,eAAe,GAAG,GAAyB,EAAE;IACzD,MAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,IAAA,eAAS,GAAE,CAAC;IAC3B,OAAO,IAAA,eAAO,EACb,GAAG,EAAE,CAAC,IAAA,aAAI,EAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAA,mBAAU,EAAC,IAAA,aAAI,EAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,EAClF,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAC3B,CAAC;AACH,CAAC,CAAC;AAPW,QAAA,eAAe,mBAO1B"}
|
package/lib/lib.d.ts
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
import type { AppDependantExports } from './boot/app/app-dependant-exports';
|
|
15
15
|
import type { report as reportApp } from './reporting/functions';
|
|
16
16
|
export * from './constants';
|
|
17
|
-
export * from './ui-extras/app-link';
|
|
18
17
|
export * from './settings/components/settings-header';
|
|
19
18
|
export * from './boot/app/app-direct-exports';
|
|
20
19
|
export declare const report: ReturnType<typeof reportApp>;
|
|
@@ -45,10 +44,6 @@ export declare const getAppContext: AppDependantExports['getAppContext'];
|
|
|
45
44
|
export declare const useApp: AppDependantExports['useApp'];
|
|
46
45
|
export declare const getApp: AppDependantExports['getApp'];
|
|
47
46
|
export declare const addBoard: AppDependantExports['addBoard'];
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Use hooks to access to functions which require context
|
|
50
|
-
*/
|
|
51
|
-
export declare const getBridgedFunctions: AppDependantExports['getBridgedFunctions'];
|
|
52
47
|
export type { PrimaryBarComponentProps, SecondaryBarComponentProps, UtilityBarComponentProps, BoardViewComponentProps, AppViewComponentProps, SettingsViewProps, PrimaryAccessoryViewProps, SecondaryAccessoryViewProps, SettingsSubSection, BadgeInfo } from './types/apps';
|
|
53
48
|
export type { BooleanString, GeneralizedTime, Duration, Account, AccountSettings, AccountSettingsPrefs, Identity, IdentityAttrs } from './types/account';
|
|
54
49
|
export type { Board } from './types/boards';
|
package/lib/lib.js
CHANGED
|
@@ -21,7 +21,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
// TODO: export only what is useful and not internal constants
|
|
23
23
|
__exportStar(require("./constants"), exports);
|
|
24
|
-
__exportStar(require("./ui-extras/app-link"), exports);
|
|
25
24
|
__exportStar(require("./settings/components/settings-header"), exports);
|
|
26
25
|
__exportStar(require("./boot/app/app-direct-exports"), exports);
|
|
27
26
|
require("./types/theme");
|
package/lib/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAmBH,8DAA8D;AAC9D,8CAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAmBH,8DAA8D;AAC9D,8CAA4B;AAC5B,wEAAsD;AACtD,gEAA8C;AA8F9C,yBAAuB"}
|
|
@@ -55,8 +55,8 @@ const CustomBreadcrumbs = (0, styled_components_1.default)(carbonio_design_syste
|
|
|
55
55
|
`;
|
|
56
56
|
const SettingsHeader = ({ onSave, onCancel, isDirty, title }) => {
|
|
57
57
|
const t = (0, hooks_1.getT)();
|
|
58
|
-
const
|
|
59
|
-
const
|
|
58
|
+
const [searchParams] = (0, react_router_dom_1.useSearchParams)();
|
|
59
|
+
const section = (0, react_1.useMemo)(() => searchParams.get('section'), [searchParams]);
|
|
60
60
|
const crumbs = (0, react_1.useMemo)(() => [
|
|
61
61
|
{
|
|
62
62
|
id: 'settings',
|
|
@@ -69,15 +69,11 @@ const SettingsHeader = ({ onSave, onCancel, isDirty, title }) => {
|
|
|
69
69
|
className: 'breadcrumbCrumb'
|
|
70
70
|
}
|
|
71
71
|
], [t, title]);
|
|
72
|
-
const search = history.location?.search;
|
|
73
72
|
(0, react_1.useEffect)(() => {
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
setTimeout(() => document
|
|
77
|
-
.querySelector(`#${history.location.search}`.replace('?section=', ''))
|
|
78
|
-
?.scrollIntoView(), 1);
|
|
73
|
+
if (section) {
|
|
74
|
+
setTimeout(() => document.getElementById(section)?.scrollIntoView(), 1);
|
|
79
75
|
}
|
|
80
|
-
}, [
|
|
76
|
+
}, [section]);
|
|
81
77
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
82
78
|
react_1.default.createElement(nav_guard_1.RouteLeavingGuard, { when: isDirty, onSave: onSave },
|
|
83
79
|
react_1.default.createElement(carbonio_design_system_1.Text, null, t('label.unsaved_changes_line1', 'Are you sure you want to leave this page without saving?')),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-header.js","sourceRoot":"","sources":["../../../src/settings/components/settings-header.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAkD;AAElD,4EASyC;AACzC,
|
|
1
|
+
{"version":3,"file":"settings-header.js","sourceRoot":"","sources":["../../../src/settings/components/settings-header.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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6BAAI,QAAE,CAAC,CAAC,6BAA6B,EAAE,uCAAuC,CAAC,CAAQ,CACrE;QACpB,8BAAC,kCAAS,IACT,WAAW,EAAC,UAAU,EACtB,aAAa,EAAC,cAAc,EAC5B,UAAU,EAAE,OAAO,EACnB,MAAM,EAAC,KAAK;YAEZ,8BAAC,4BAAG,IAAC,WAAW,EAAC,YAAY,EAAC,KAAK,EAAC,MAAM;gBACzC,8BAAC,4BAAG,IACH,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,EACzB,aAAa,EAAC,YAAY,EAC1B,KAAK,EAAC,KAAK,EACX,cAAc,EAAC,YAAY;oBAE3B,8BAAC,iBAAiB,IAAC,MAAM,EAAE,MAAM,GAAI,CAChC;gBACN,8BAAC,4BAAG,IACH,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,EACzB,KAAK,EAAC,KAAK,EACX,aAAa,EAAC,UAAU,EACxB,cAAc,EAAC,UAAU;oBAEzB,8BAAC,gCAAO,IAAC,KAAK,EAAC,OAAO;wBACrB,8BAAC,+BAAM,IACN,KAAK,EAAE,CAAC,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,EACpD,OAAO,EAAE,QAAQ,EACjB,KAAK,EAAC,WAAW,EACjB,QAAQ,EAAE,CAAC,OAAO,GACjB,CACO;oBACV,8BAAC,+BAAM,IACN,KAAK,EAAE,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,EAC9B,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,OAAO,GACjB,CACG,CACD,CACK;QACZ,8BAAC,gCAAO,OAAG,CACT,CACH,CAAC;AACH,CAAC,CAAC;AAnFW,QAAA,cAAc,kBAmFzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type DropdownItem } from '@zextras/carbonio-design-system';
|
|
3
|
-
import type { Location } from '
|
|
3
|
+
import type { Location } from 'react-router-dom';
|
|
4
4
|
import type { AppRoute } from '../types/apps';
|
|
5
5
|
import type { Action } from '../types/integrations';
|
|
6
6
|
export interface NewAction extends Action, Omit<DropdownItem, 'label' | 'onClick'> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creation-button.js","sourceRoot":"","sources":["../../src/shell/creation-button.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAA8D;AAE9D,4EAMyC;
|
|
1
|
+
{"version":3,"file":"creation-button.js","sourceRoot":"","sources":["../../src/shell/creation-button.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAA8D;AAE9D,4EAMyC;AACzC,mCAA4C;AAE5C,uDAA+C;AAE/C,4CAA4C;AAC5C,4CAAmD;AACnD,sCAA0C;AAC1C,+CAA2C;AAC3C,uDAAyD;AAelD,MAAM,uBAAuB,GAAG,CAAC,EACvC,WAAW,EACX,QAAQ,EACa,EAAqB,EAAE;IAC5C,MAAM,CAAC,GAAG,IAAA,YAAI,GAAE,CAAC;IACjB,MAAM,OAAO,GAAG,IAAA,kBAAU,EACzB,EAAE,WAAW,EAAE,QAAQ,EAAE,EACzB,wBAAY,CAAC,GAAG,CAChB,CAAC;IACF,MAAM,oBAAoB,GAAG,IAAA,eAAO,EAElC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3F,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IACxC,MAAM,aAAa,GAAG,IAAA,eAAO,EAC5B,GAAG,EAAE,CACJ,IAAA,aAAI,EACH,oB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,aAAI,GACZ,CACQ,CACX,CAAC;AACH,CAAC,CAAC;AA3FW,QAAA,uBAAuB,2BA2FlC;AAEF,MAAM,kBAAkB,GAAG,eAAK,CAAC,IAAI,CAAC,+BAAuB,CAAC,CAAC;AAExD,MAAM,cAAc,GAAG,GAAsB,EAAE;IACrD,MAAM,YAAY,GAAG,IAAA,8BAAW,GAAE,CAAC;IACnC,MAAM,WAAW,GAAG,IAAA,uBAAe,GAAE,CAAC;IAEtC,MAAM,gBAAgB,GAAG,CAAC,QAAkB,EAAY,EAAE,CAAC,CAAC;QAC3D,GAAG,QAAQ;QACX,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC9D,GAAG,EAAE,EAAE;KACP,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/E,OAAO,8BAAC,kBAAkB,IAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;AAC7E,CAAC,CAAC;AAZW,QAAA,cAAc,kBAYzB"}
|
package/lib/store/app/hooks.d.ts
CHANGED
|
@@ -5,5 +5,4 @@ export declare const useAppList: () => Array<CarbonioModule>;
|
|
|
5
5
|
export declare const getApp: (appId: string) => () => CarbonioModule | undefined;
|
|
6
6
|
export declare const getAppContextHook: (appId: string) => <T>() => T;
|
|
7
7
|
export declare const getAppContext: (appId: string) => () => unknown;
|
|
8
|
-
export declare const getRoutes: () => Record<string, AppRoute>;
|
|
9
8
|
export declare const useRoutes: () => Record<string, AppRoute>;
|
package/lib/store/app/hooks.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.useRoutes = exports.
|
|
8
|
+
exports.useRoutes = exports.getAppContext = exports.getAppContextHook = exports.getApp = exports.useAppList = exports.useApps = exports.getAppHook = void 0;
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const lodash_1 = require("lodash");
|
|
11
11
|
const store_1 = require("./store");
|
|
@@ -24,8 +24,6 @@ const getAppContextHook = (appId) => () => (0, store_1.useAppStore)((s) => s.app
|
|
|
24
24
|
exports.getAppContextHook = getAppContextHook;
|
|
25
25
|
const getAppContext = (appId) => () => store_1.useAppStore.getState().appContexts[appId];
|
|
26
26
|
exports.getAppContext = getAppContext;
|
|
27
|
-
const getRoutes = () => store_1.useAppStore.getState().routes;
|
|
28
|
-
exports.getRoutes = getRoutes;
|
|
29
27
|
const useRoutes = () => (0, store_1.useAppStore)((s) => s.routes);
|
|
30
28
|
exports.useRoutes = useRoutes;
|
|
31
29
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/store/app/hooks.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAAgC;AAEhC,mCAAgC;AAEhC,mCAAsC;AAG/B,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,GAAmB,EAAE,CACjE,IAAA,mBAAW,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AADtB,QAAA,UAAU,cACY;AAE5B,MAAM,OAAO,GAAG,GAAmC,EAAE,CAAC,IAAA,mBAAW,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAA3E,QAAA,OAAO,WAAoE;AAEjF,MAAM,UAAU,GAAG,GAA0B,EAAE;IACrD,MAAM,IAAI,GAAG,IAAA,eAAO,GAAE,CAAC;IACvB,OAAO,I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AAC;AAA3E,QAAA,OAAO,WAAoE;AAEjF,MAAM,UAAU,GAAG,GAA0B,EAAE;IACrD,MAAM,IAAI,GAAG,IAAA,eAAO,GAAE,CAAC;IACvB,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,eAAM,EAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAC;AAHW,QAAA,UAAU,cAGrB;AAEK,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,GAA+B,EAAE,CACzE,mBAAW,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AADvB,QAAA,MAAM,UACiB;AAE7B,MAAM,iBAAiB,GAC7B,CAAC,KAAa,EAAE,EAAE,CAClB,GAAS,EAAE,CACV,IAAA,mBAAW,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAM,CAAC,CAAC;AAHnC,QAAA,iBAAiB,qBAGkB;AAEzC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,GAAY,EAAE,CAC7D,mBAAW,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAD9B,QAAA,aAAa,iBACiB;AAEpC,MAAM,SAAS,GAAG,GAA6B,EAAE,CAAC,IAAA,mBAAW,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAAzE,QAAA,SAAS,aAAgE"}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { ModalProps } from '@zextras/carbonio-design-system';
|
|
3
3
|
export interface RouteLeavingGuardProps {
|
|
4
4
|
children: ModalProps['children'];
|
|
5
|
-
when
|
|
5
|
+
when: boolean;
|
|
6
6
|
onSave: () => Promise<PromiseSettledResult<Awaited<unknown>>[]>;
|
|
7
7
|
dataHasError?: boolean;
|
|
8
8
|
}
|
|
@@ -42,36 +42,22 @@ exports.RouteLeavingGuard = void 0;
|
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
43
|
const carbonio_design_system_1 = require("@zextras/carbonio-design-system");
|
|
44
44
|
const lodash_1 = require("lodash");
|
|
45
|
+
const react_i18next_1 = require("react-i18next");
|
|
45
46
|
const react_router_dom_1 = require("react-router-dom");
|
|
46
|
-
|
|
47
|
+
function areLocationsDifferent(loc1, loc2) {
|
|
48
|
+
return loc1.pathname !== loc2.pathname || loc1.search !== loc2.search || loc1.hash !== loc2.hash;
|
|
49
|
+
}
|
|
47
50
|
const RouteLeavingGuard = ({ children, when, onSave, dataHasError = false }) => {
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const [t] = (0, react_i18next_1.useTranslation)();
|
|
52
|
+
const blockerFunction = ({ currentLocation, nextLocation }) => {
|
|
53
|
+
const areDifferent = areLocationsDifferent(currentLocation, nextLocation);
|
|
54
|
+
return when && areDifferent;
|
|
55
|
+
};
|
|
56
|
+
// Block navigating elsewhere when data has been entered into the input
|
|
57
|
+
const blocker = (0, react_router_dom_1.useBlocker)(blockerFunction);
|
|
54
58
|
const cancel = (0, react_1.useCallback)(() => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, []);
|
|
58
|
-
const confirmNavigation = (0, react_1.useCallback)(() => {
|
|
59
|
-
confirmedNavigationRef.current = true;
|
|
60
|
-
if (lastLocationRef.current) {
|
|
61
|
-
// Navigate to the previous blocked location with your navigate function
|
|
62
|
-
history.push(lastLocationRef.current);
|
|
63
|
-
}
|
|
64
|
-
}, [history]);
|
|
65
|
-
const handleBlockedNavigation = (0, react_1.useCallback)((nextLocation) => {
|
|
66
|
-
if (!confirmedNavigationRef.current &&
|
|
67
|
-
`${nextLocation.pathname}${nextLocation.search || ''}` !==
|
|
68
|
-
`${history.location.pathname}${history.location.search}`) {
|
|
69
|
-
setModalVisible(true);
|
|
70
|
-
lastLocationRef.current = nextLocation;
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
return true;
|
|
74
|
-
}, [history.location.pathname, history.location.search]);
|
|
59
|
+
blocker.reset?.();
|
|
60
|
+
}, [blocker]);
|
|
75
61
|
const onConfirm = (0, react_1.useCallback)(() => {
|
|
76
62
|
onSave()
|
|
77
63
|
.then((results) => {
|
|
@@ -81,26 +67,22 @@ const RouteLeavingGuard = ({ children, when, onSave, dataHasError = false }) =>
|
|
|
81
67
|
cancel();
|
|
82
68
|
}
|
|
83
69
|
else {
|
|
84
|
-
|
|
85
|
-
confirmNavigation();
|
|
70
|
+
blocker.proceed?.();
|
|
86
71
|
}
|
|
87
72
|
})
|
|
88
73
|
.catch((reason) => {
|
|
89
74
|
console.error(reason);
|
|
90
75
|
cancel();
|
|
91
76
|
});
|
|
92
|
-
}, [
|
|
77
|
+
}, [blocker, cancel, onSave]);
|
|
93
78
|
const onSecondaryAction = (0, react_1.useCallback)(() => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
: t('label.unsaved_changes', 'You have unsaved changes'), onClose: cancel, onConfirm: dataHasError ? onSecondaryAction : onConfirm, confirmLabel: dataHasError
|
|
102
|
-
? t('label.leave_anyway', 'Leave anyway')
|
|
103
|
-
: t('label.save_and_leave', 'Save and leave'), onSecondaryAction: dataHasError ? cancel : onSecondaryAction, secondaryActionLabel: dataHasError ? t('label.cancel', 'Cancel') : t('label.leave_anyway', 'Leave anyway'), optionalFooter: !dataHasError ? (react_1.default.createElement(carbonio_design_system_1.Button, { color: "secondary", type: "outlined", label: t('label.cancel', 'Cancel'), onClick: cancel })) : undefined }, children)));
|
|
79
|
+
blocker.proceed?.();
|
|
80
|
+
}, [blocker]);
|
|
81
|
+
return (react_1.default.createElement(carbonio_design_system_1.Modal, { showCloseIcon: true, closeIconTooltip: t('label.close', 'Close'), open: blocker.state === 'blocked', title: dataHasError
|
|
82
|
+
? t('label.cannot_save_changes', 'Some changes cannot be saved')
|
|
83
|
+
: t('label.unsaved_changes', 'You have unsaved changes'), onClose: cancel, onConfirm: dataHasError ? onSecondaryAction : onConfirm, confirmLabel: dataHasError
|
|
84
|
+
? t('label.leave_anyway', 'Leave anyway')
|
|
85
|
+
: t('label.save_and_leave', 'Save and leave'), onSecondaryAction: dataHasError ? cancel : onSecondaryAction, secondaryActionLabel: dataHasError ? t('label.cancel', 'Cancel') : t('label.leave_anyway', 'Leave anyway'), optionalFooter: !dataHasError ? (react_1.default.createElement(carbonio_design_system_1.Button, { color: "secondary", type: "outlined", label: t('label.cancel', 'Cancel'), onClick: cancel })) : undefined }, children));
|
|
104
86
|
};
|
|
105
87
|
exports.RouteLeavingGuard = RouteLeavingGuard;
|
|
106
88
|
//# sourceMappingURL=nav-guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-guard.js","sourceRoot":"","sources":["../../src/ui-extras/nav-guard.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+
|
|
1
|
+
{"version":3,"file":"nav-guard.js","sourceRoot":"","sources":["../../src/ui-extras/nav-guard.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAA2C;AAG3C,4EAAgE;AAChE,mCAAgC;AAChC,iDAA+C;AAE/C,uDAA8C;AAE9C,SAAS,qBAAqB,CAAC,IAAc,EAAE,IAAc;IAC5D,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;AAClG,CAAC;AASM,MAAM,iBAAiB,GAA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1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zextras/carbonio-shell-ui",
|
|
3
|
-
"version": "10.0.0-devel.
|
|
3
|
+
"version": "10.0.0-devel.1741258975575",
|
|
4
4
|
"description": "The Zextras Carbonio web client",
|
|
5
5
|
"main": "./lib/lib.js",
|
|
6
6
|
"types": "./lib/lib.d.ts",
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"@types/node": "^18.19.67",
|
|
68
68
|
"@types/react": "^18.3.11",
|
|
69
69
|
"@types/react-dom": "^18.3.0",
|
|
70
|
-
"@types/react-router-dom": "^5.3.3",
|
|
71
70
|
"@types/ua-parser-js": "^0.7.39",
|
|
72
71
|
"@types/webpack": "^5.28.5",
|
|
73
72
|
"@types/webpack-env": "^1.18.4",
|
|
@@ -110,7 +109,6 @@
|
|
|
110
109
|
"@zextras/carbonio-ui-preview": "^3.1.1",
|
|
111
110
|
"darkreader": "^4.9.79",
|
|
112
111
|
"date-fns": "^4.1.0",
|
|
113
|
-
"history": "^5.3.0",
|
|
114
112
|
"i18next": "^22.5.1",
|
|
115
113
|
"i18next-chained-backend": "^4.6.2",
|
|
116
114
|
"i18next-http-backend": "^2.5.0",
|
|
@@ -120,8 +118,7 @@
|
|
|
120
118
|
"react": "^18.3.1",
|
|
121
119
|
"react-dom": "^18.3.1",
|
|
122
120
|
"react-i18next": "^12.3.1",
|
|
123
|
-
"react-router-dom": "^
|
|
124
|
-
"react-router-dom-v5-compat": "^6.28.0",
|
|
121
|
+
"react-router-dom": "^6.30.0",
|
|
125
122
|
"styled-components": "^6.1.13",
|
|
126
123
|
"tinymce": "^6.8.4",
|
|
127
124
|
"ua-parser-js": "^1.0.37",
|
|
@@ -135,7 +132,7 @@
|
|
|
135
132
|
"react": "^18.3.1",
|
|
136
133
|
"react-dom": "^18.3.1",
|
|
137
134
|
"react-i18next": "^12.3.1",
|
|
138
|
-
"react-router-dom": "^
|
|
135
|
+
"react-router-dom": "^6.30.0",
|
|
139
136
|
"styled-components": "^6.1.13"
|
|
140
137
|
},
|
|
141
138
|
"peerDependenciesMeta": {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AnyFunction } from '../utils/typeUtils';
|
|
2
|
-
export type PackageDependentFunction = (app: string) => AnyFunction;
|
|
3
|
-
export type ContextBridgeState = {
|
|
4
|
-
packageDependentFunctions: Record<string, PackageDependentFunction>;
|
|
5
|
-
functions: Record<string, AnyFunction>;
|
|
6
|
-
};
|
|
7
|
-
export type ContextBridgeActions = {
|
|
8
|
-
add: (content: Partial<ContextBridgeState>) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const useContextBridge: import("zustand").UseBoundStore<import("zustand").StoreApi<ContextBridgeState & ContextBridgeActions>>;
|
|
11
|
-
export declare const useBridge: (content: Partial<ContextBridgeState>) => void;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* SPDX-FileCopyrightText: 2021 Zextras <https://www.zextras.com>
|
|
4
|
-
*
|
|
5
|
-
* SPDX-License-Identifier: AGPL-3.0-only
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.useBridge = exports.useContextBridge = void 0;
|
|
9
|
-
const lodash_1 = require("lodash");
|
|
10
|
-
const zustand_1 = require("zustand");
|
|
11
|
-
const initialState = {
|
|
12
|
-
packageDependentFunctions: {},
|
|
13
|
-
functions: {}
|
|
14
|
-
};
|
|
15
|
-
// extra currying as suggested in https://github.com/pmndrs/zustand/blob/main/docs/guides/typescript.md#basic-usage
|
|
16
|
-
exports.useContextBridge = (0, zustand_1.create)()((set) => ({
|
|
17
|
-
...initialState,
|
|
18
|
-
add: ({ packageDependentFunctions, functions }) => {
|
|
19
|
-
set((s) => ({
|
|
20
|
-
packageDependentFunctions: (0, lodash_1.reduce)(packageDependentFunctions ?? {}, (acc, f, key) => {
|
|
21
|
-
// eslint-disable-next-line no-param-reassign
|
|
22
|
-
acc[key] = f;
|
|
23
|
-
return acc;
|
|
24
|
-
}, s.packageDependentFunctions),
|
|
25
|
-
functions: (0, lodash_1.reduce)(functions ?? {}, (acc, f, key) => {
|
|
26
|
-
// eslint-disable-next-line no-param-reassign
|
|
27
|
-
acc[key] = f;
|
|
28
|
-
return acc;
|
|
29
|
-
}, s.functions)
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
33
|
-
exports.useBridge = exports.useContextBridge.getState().add;
|
|
34
|
-
//# sourceMappingURL=context-bridge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-bridge.js","sourceRoot":"","sources":["../../src/store/context-bridge.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mCAAgC;AAChC,qCAAiC;AAejC,MAAM,YAAY,GAAuB;IACxC,yBAAyB,EAAE,EAAE;IAC7B,SAAS,EAAE,EAAE;CACb,CAAC;AAEF,mHAAmH;AACtG,QAAA,gBAAgB,GAAG,IAAA,gBAAM,GAA6C,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC7F,GAAG,YAAY;IACf,GAAG,EAAE,CAAC,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAQ,EAAE;QACvD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACX,yBAAyB,EAAE,IAAA,eAAM,EAChC,yBAAyB,IAAI,EAAE,EAC/B,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE;gBACf,6CAA6C;gBAC7C,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACb,OAAO,GAAG,CAAC;YACZ,CAAC,EACD,CAAC,CAAC,yBAAyB,CAC3B;YACD,SAAS,EAAE,IAAA,eAAM,EAChB,SAAS,IAAI,EAAE,EACf,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE;gBACf,6CAA6C;gBAC7C,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACb,OAAO,GAAG,CAAC;YACZ,CAAC,EACD,CAAC,CAAC,SAAS,CACX;SACD,CAAC,CAAC,CAAC;IACL,CAAC;CACD,CAAC,CAAC,CAAC;AAES,QAAA,SAAS,GAAG,wBAAgB,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* SPDX-FileCopyrightText: 2021 Zextras <https://www.zextras.com>
|
|
4
|
-
*
|
|
5
|
-
* SPDX-License-Identifier: AGPL-3.0-only
|
|
6
|
-
*/
|
|
7
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
-
if (k2 === undefined) k2 = k;
|
|
9
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
-
}
|
|
13
|
-
Object.defineProperty(o, k2, desc);
|
|
14
|
-
}) : (function(o, m, k, k2) {
|
|
15
|
-
if (k2 === undefined) k2 = k;
|
|
16
|
-
o[k2] = m[k];
|
|
17
|
-
}));
|
|
18
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
-
}) : function(o, v) {
|
|
21
|
-
o["default"] = v;
|
|
22
|
-
});
|
|
23
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
-
var ownKeys = function(o) {
|
|
25
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
-
var ar = [];
|
|
27
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
-
return ar;
|
|
29
|
-
};
|
|
30
|
-
return ownKeys(o);
|
|
31
|
-
};
|
|
32
|
-
return function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
})();
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.AppLink = void 0;
|
|
42
|
-
const react_1 = __importStar(require("react"));
|
|
43
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
44
|
-
const hooks_1 = require("../history/hooks");
|
|
45
|
-
const AppLink = ({ to, route, ...rest }) => {
|
|
46
|
-
const _to = (0, react_1.useMemo)(() => (0, hooks_1.parseParams)({ path: to, route }), [route, to]);
|
|
47
|
-
return react_1.default.createElement(react_router_dom_1.Link, { style: { textDecoration: 'none' }, to: _to, ...rest });
|
|
48
|
-
};
|
|
49
|
-
exports.AppLink = AppLink;
|
|
50
|
-
//# sourceMappingURL=app-link.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-link.js","sourceRoot":"","sources":["../../src/ui-extras/app-link.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAuC;AAGvC,uDAAkD;AAElD,4CAA+C;AAKxC,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,EAAgB,EAAqB,EAAE;IAClF,MAAM,GAAG,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,mBAAW,EAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IACzE,OAAO,8BAAC,uBAAM,IAAC,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,KAAM,IAAI,GAAI,CAAC;AACzE,CAAC,CAAC;AAHW,QAAA,OAAO,WAGlB"}
|