@zextras/carbonio-shell-ui 7.0.1 → 8.0.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/lib/boot/app/app-dependant-exports.d.ts +37 -0
- package/lib/boot/app/app-dependant-exports.js +51 -0
- package/lib/boot/app/app-dependant-exports.js.map +1 -0
- package/lib/boot/app/{app-loader-functions.d.ts → app-direct-exports.d.ts} +12 -26
- package/lib/boot/app/{app-loader-functions.js → app-direct-exports.js} +43 -59
- package/lib/boot/app/app-direct-exports.js.map +1 -0
- package/lib/boot/posthog.d.ts +8 -0
- package/lib/boot/posthog.js +99 -0
- package/lib/boot/posthog.js.map +1 -0
- package/lib/constants/locales.d.ts +4 -0
- package/lib/constants/locales.js +4 -0
- package/lib/constants/locales.js.map +1 -1
- package/lib/dark-mode/use-dark-mode.d.ts +5 -0
- package/lib/dark-mode/use-dark-mode.js +33 -0
- package/lib/dark-mode/use-dark-mode.js.map +1 -0
- package/lib/dark-mode/use-dark-reader-result-value.d.ts +11 -0
- package/lib/dark-mode/use-dark-reader-result-value.js +37 -0
- package/lib/dark-mode/use-dark-reader-result-value.js.map +1 -0
- package/lib/dark-mode/utils.d.ts +3 -0
- package/lib/dark-mode/utils.js +11 -0
- package/lib/dark-mode/utils.js.map +1 -0
- package/lib/lib.d.ts +28 -39
- package/lib/lib.js +2 -107
- package/lib/lib.js.map +1 -1
- package/lib/network/edit-settings.d.ts +12 -0
- package/lib/network/edit-settings.js +12 -0
- package/lib/network/edit-settings.js.map +1 -1
- package/lib/network/fetch.js +1 -1
- package/lib/network/fetch.js.map +1 -1
- package/lib/store/account/hooks.d.ts +4 -0
- package/lib/store/account/hooks.js +12 -2
- package/lib/store/account/hooks.js.map +1 -1
- package/lib/store/account/index.d.ts +1 -0
- package/lib/store/account/index.js +1 -0
- package/lib/store/account/index.js.map +1 -1
- package/lib/store/account/updaters.d.ts +22 -0
- package/lib/store/account/updaters.js +39 -0
- package/lib/store/account/updaters.js.map +1 -0
- package/lib/store/account/utils.d.ts +6 -0
- package/lib/store/account/utils.js +69 -0
- package/lib/store/account/utils.js.map +1 -0
- package/lib/store/app/store.d.ts +0 -2
- package/lib/store/app/store.js +0 -20
- package/lib/store/app/store.js.map +1 -1
- package/lib/store/app/utils.d.ts +1 -1
- package/lib/store/app/utils.js +6 -10
- package/lib/store/app/utils.js.map +1 -1
- package/lib/store/boards/store.js +1 -2
- package/lib/store/boards/store.js.map +1 -1
- package/lib/store/login/hooks.d.ts +6 -0
- package/lib/store/login/hooks.js +29 -0
- package/lib/store/login/hooks.js.map +1 -0
- package/lib/store/login/store.d.ts +1 -0
- package/lib/store/login/store.js +1 -0
- package/lib/store/login/store.js.map +1 -1
- package/lib/types/account/index.d.ts +12 -5
- package/lib/types/apps/index.d.ts +4 -5
- package/lib/types/boards/index.d.ts +1 -1
- package/lib/types/misc/index.d.ts +1 -11
- package/lib/types/network/index.d.ts +3 -2
- package/lib/types/network/index.js.map +1 -1
- package/lib/types/network/soap.d.ts +4 -1
- package/lib/utils/utils.d.ts +1 -2
- package/lib/utils/utils.js +5 -7
- package/lib/utils/utils.js.map +1 -1
- package/package.json +13 -17
- package/lib/boot/app/app-loader-functions.js.map +0 -1
- package/lib/boot/app/app-loader-setters.d.ts +0 -38
- package/lib/boot/app/app-loader-setters.js +0 -46
- package/lib/boot/app/app-loader-setters.js.map +0 -1
- package/lib/boot/matomo.d.ts +0 -12
- package/lib/boot/matomo.js +0 -22
- package/lib/boot/matomo.js.map +0 -1
- package/lib/boot/tracker.d.ts +0 -11
- package/lib/boot/tracker.js +0 -57
- package/lib/boot/tracker.js.map +0 -1
- package/lib/shell/hooks/useIsMobile.d.ts +0 -4
- package/lib/shell/hooks/useIsMobile.js +0 -22
- package/lib/shell/hooks/useIsMobile.js.map +0 -1
- package/lib/shell/shell-context.d.ts +0 -4
- package/lib/shell/shell-context.js +0 -11
- package/lib/shell/shell-context.js.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getEditSettingsForApp } from '../../network/edit-settings';
|
|
2
|
+
import { getSoapFetch, getXmlSoapFetch } from '../../network/fetch';
|
|
3
|
+
import type { AppActions as StoreAppSetters } from '../../store/app';
|
|
4
|
+
import { getApp, getAppContext, getAppContextHook, getAppHook } from '../../store/app';
|
|
5
|
+
import { addBoard } from '../../store/boards';
|
|
6
|
+
import type { ContextBridgeState } from '../../store/context-bridge';
|
|
7
|
+
import { getI18n, getTFunction } from '../../store/i18n/hooks';
|
|
8
|
+
import type { IntegrationActions } from '../../store/integrations/store';
|
|
9
|
+
import type { AppRouteDescriptor, BoardView, CarbonioModule, PrimaryAccessoryView, SearchView, SecondaryAccessoryView, SettingsView, UtilityView } from '../../types/apps';
|
|
10
|
+
export type AppDependantExports = {
|
|
11
|
+
setAppContext: ReturnType<StoreAppSetters['setAppContext']>;
|
|
12
|
+
addRoute: (data: Partial<AppRouteDescriptor>) => ReturnType<StoreAppSetters['addRoute']>;
|
|
13
|
+
addBoardView: (data: Omit<BoardView, 'app'>) => ReturnType<StoreAppSetters['addBoardView']>;
|
|
14
|
+
addSettingsView: (data: Partial<SettingsView>) => ReturnType<StoreAppSetters['addSettingsView']>;
|
|
15
|
+
addSearchView: (data: Partial<SearchView>) => ReturnType<StoreAppSetters['addSearchView']>;
|
|
16
|
+
addUtilityView: (data: Partial<UtilityView>) => ReturnType<StoreAppSetters['addUtilityView']>;
|
|
17
|
+
addPrimaryAccessoryView: (data: Partial<PrimaryAccessoryView>) => ReturnType<StoreAppSetters['addPrimaryAccessoryView']>;
|
|
18
|
+
addSecondaryAccessoryView: (data: Partial<SecondaryAccessoryView>) => ReturnType<StoreAppSetters['addSecondaryAccessoryView']>;
|
|
19
|
+
registerComponents: ReturnType<IntegrationActions['registerComponents']>;
|
|
20
|
+
editSettings: ReturnType<typeof getEditSettingsForApp>;
|
|
21
|
+
getI18n: ReturnType<typeof getI18n>;
|
|
22
|
+
t: ReturnType<typeof getTFunction>;
|
|
23
|
+
soapFetch: ReturnType<typeof getSoapFetch>;
|
|
24
|
+
xmlSoapFetch: ReturnType<typeof getXmlSoapFetch>;
|
|
25
|
+
useAppContext: ReturnType<typeof getAppContextHook>;
|
|
26
|
+
getAppContext: ReturnType<typeof getAppContext>;
|
|
27
|
+
useApp: ReturnType<typeof getAppHook>;
|
|
28
|
+
getApp: ReturnType<typeof getApp>;
|
|
29
|
+
addBoard: ReturnType<typeof addBoard>;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use hooks to access to functions which require context
|
|
32
|
+
*/
|
|
33
|
+
getBridgedFunctions: () => ContextBridgeState['functions'] & {
|
|
34
|
+
[K in keyof ContextBridgeState['packageDependentFunctions']]: ReturnType<ContextBridgeState['packageDependentFunctions'][K]>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export declare const getAppDependantExports: (pkg: CarbonioModule) => AppDependantExports;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAppDependantExports = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com>
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: AGPL-3.0-only
|
|
8
|
+
*/
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
|
+
const edit_settings_1 = require("../../network/edit-settings");
|
|
11
|
+
const fetch_1 = require("../../network/fetch");
|
|
12
|
+
const app_1 = require("../../store/app");
|
|
13
|
+
const utils_1 = require("../../store/app/utils");
|
|
14
|
+
const boards_1 = require("../../store/boards");
|
|
15
|
+
const context_bridge_1 = require("../../store/context-bridge");
|
|
16
|
+
const hooks_1 = require("../../store/i18n/hooks");
|
|
17
|
+
const store_1 = require("../../store/integrations/store");
|
|
18
|
+
const getAppDependantExports = (pkg) => {
|
|
19
|
+
const appStore = app_1.useAppStore.getState();
|
|
20
|
+
const integrations = store_1.useIntegrationsStore.getState();
|
|
21
|
+
return {
|
|
22
|
+
setAppContext: appStore.setAppContext(pkg.name),
|
|
23
|
+
addRoute: (route) => appStore.addRoute((0, utils_1.normalizeRoute)(route, pkg)),
|
|
24
|
+
addBoardView: (data) => appStore.addBoardView((0, utils_1.normalizeBoardView)(data, pkg)),
|
|
25
|
+
addSettingsView: (data) => appStore.addSettingsView((0, utils_1.normalizeSettingsView)(data, pkg)),
|
|
26
|
+
addSearchView: (data) => appStore.addSearchView((0, utils_1.normalizeSearchView)(data, pkg)),
|
|
27
|
+
addUtilityView: (data) => appStore.addUtilityView((0, utils_1.normalizeUtilityView)(data, pkg)),
|
|
28
|
+
addPrimaryAccessoryView: (data) => appStore.addPrimaryAccessoryView((0, utils_1.normalizePrimaryAccessoryView)(data, pkg)),
|
|
29
|
+
addSecondaryAccessoryView: (data) => appStore.addSecondaryAccessoryView((0, utils_1.normalizeSecondaryAccessoryView)(data, pkg)),
|
|
30
|
+
registerComponents: integrations.registerComponents(pkg.name),
|
|
31
|
+
editSettings: (0, edit_settings_1.getEditSettingsForApp)(pkg.name),
|
|
32
|
+
getI18n: (0, hooks_1.getI18n)(pkg.name),
|
|
33
|
+
t: (0, hooks_1.getTFunction)(pkg.name),
|
|
34
|
+
soapFetch: (0, fetch_1.getSoapFetch)(pkg.name),
|
|
35
|
+
xmlSoapFetch: (0, fetch_1.getXmlSoapFetch)(pkg.name),
|
|
36
|
+
useAppContext: (0, app_1.getAppContextHook)(pkg.name),
|
|
37
|
+
getAppContext: (0, app_1.getAppContext)(pkg.name),
|
|
38
|
+
useApp: (0, app_1.getAppHook)(pkg.name),
|
|
39
|
+
getApp: (0, app_1.getApp)(pkg.name),
|
|
40
|
+
addBoard: (0, boards_1.addBoard)(pkg.name),
|
|
41
|
+
getBridgedFunctions: () => {
|
|
42
|
+
const { packageDependentFunctions, functions } = context_bridge_1.useContextBridge.getState();
|
|
43
|
+
return {
|
|
44
|
+
...functions,
|
|
45
|
+
...(0, lodash_1.reduce)(packageDependentFunctions, (acc, f, name) => ({ ...acc, [name]: f(pkg.name) }), {})
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
exports.getAppDependantExports = getAppDependantExports;
|
|
51
|
+
//# sourceMappingURL=app-dependant-exports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-dependant-exports.js","sourceRoot":"","sources":["../../../src/boot/app/app-dependant-exports.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mCAAgC;AAEhC,+DAAoE;AACpE,+CAAoE;AAEpE,yCAAoG;AACpG,iDAQ+B;AAC/B,+CAA8C;AAE9C,+DAA8D;AAC9D,kDAA+D;AAE/D,0DAAsE;AA8C/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,QAAQ,CAAC,YAAY,CAAC,IAAA,0BAAkB,EAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACrD,eAAe,EAAE,CAAC,IAA2B,EAAE,EAAE,CAChD,QAAQ,CAAC,eAAe,CAAC,IAAA,6BAAqB,EAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAC3D,aAAa,EAAE,CAAC,IAAyB,EAAE,EAAE,CAC5C,QAAQ,CAAC,aAAa,CAAC,IAAA,2BAAmB,EAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACvD,cAAc,EAAE,CA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AAM,EACR,yBAAyB,EACzB,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EACnD,EAAE,CACF;aACD,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC,CAAC;AAzCW,QAAA,sBAAsB,0BAyCjC"}
|
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
import { getSoapFetch, getXmlSoapFetch } from '../../network/fetch';
|
|
2
|
-
import { getApp, getAppContext, getAppHook, getAppContextHook } from '../../store/app';
|
|
3
|
-
import { addBoard } from '../../store/boards';
|
|
4
|
-
import type { ContextBridgeState } from '../../store/context-bridge';
|
|
5
|
-
import { getI18n, getTFunction } from '../../store/i18n/hooks';
|
|
6
|
-
import type { CarbonioModule } from '../../types/apps';
|
|
7
|
-
export type AppDependantFunctions = {
|
|
8
|
-
getI18n: ReturnType<typeof getI18n>;
|
|
9
|
-
t: ReturnType<typeof getTFunction>;
|
|
10
|
-
soapFetch: ReturnType<typeof getSoapFetch>;
|
|
11
|
-
xmlSoapFetch: ReturnType<typeof getXmlSoapFetch>;
|
|
12
|
-
useAppContext: ReturnType<typeof getAppContextHook>;
|
|
13
|
-
getAppContext: ReturnType<typeof getAppContext>;
|
|
14
|
-
useApp: ReturnType<typeof getAppHook>;
|
|
15
|
-
getApp: ReturnType<typeof getApp>;
|
|
16
|
-
addBoard: ReturnType<typeof addBoard>;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use hooks to access to functions which require context
|
|
19
|
-
*/
|
|
20
|
-
getBridgedFunctions: () => ContextBridgeState['functions'] & {
|
|
21
|
-
[K in keyof ContextBridgeState['packageDependentFunctions']]: ReturnType<ContextBridgeState['packageDependentFunctions'][K]>;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export declare const getAppDependantFunctions: (pkg: CarbonioModule) => AppDependantFunctions;
|
|
25
1
|
export { useAction, useActions, useActionsFactory, useActionFactory, useIntegratedComponent, useIntegratedFunction } from '../../store/integrations/hooks';
|
|
26
2
|
export { getAction, getActions, getActionsFactory, getActionFactory, getIntegratedComponent, getIntegratedFunction } from '../../store/integrations/getters';
|
|
27
|
-
export
|
|
3
|
+
export declare const registerFunctions: (...items: {
|
|
4
|
+
id: string;
|
|
5
|
+
fn: import("../../utils/typeUtils").AnyFunction;
|
|
6
|
+
}[]) => void, removeFunctions: (...ids: string[]) => void, registerActions: (...items: {
|
|
7
|
+
id: string;
|
|
8
|
+
action: (target: unknown) => import("../../lib").Action;
|
|
9
|
+
type: string;
|
|
10
|
+
}[]) => void, removeActions: (...ids: string[]) => void, removeComponents: (...ids: string[]) => void;
|
|
11
|
+
export { getUserAccount, getUserAccounts, getUserSetting, getUserSettings, useUserAccount, useUserAccounts, useUserSetting, useUserSettings, useUserRight, useUserRights, getUserRight, getUserRights, useAuthenticated, updateSettings, updateAccount } from '../../store/account';
|
|
28
12
|
export { getTags, useTags } from '../../store/tags';
|
|
29
13
|
export { changeTagColor, createTag, deleteTag, renameTag } from '../../network/tags';
|
|
30
14
|
export { useNotify, useRefresh } from '../../store/network';
|
|
@@ -33,5 +17,7 @@ export { closeBoard, updateBoard, updateBoardContext, getBoardById, getBoardCont
|
|
|
33
17
|
export { usePushHistoryCallback, useGoBackHistoryCallback, useReplaceHistoryCallback, getCurrentRoute, useCurrentRoute, replaceHistory, goBackHistory, pushHistory } from '../../history/hooks';
|
|
34
18
|
export { getNotificationManager } from '../../notification/NotificationManager';
|
|
35
19
|
export { runSearch } from '../../search/run-search';
|
|
36
|
-
export { useIsMobile } from '../../shell/hooks/useIsMobile';
|
|
37
20
|
export { useLocalStorage } from '../../shell/hooks/useLocalStorage';
|
|
21
|
+
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, removeSearchView: (id: string) => void, removeUtilityView: (id: string) => void, removePrimaryAccessoryView: (id: string) => void, removeSecondaryAccessoryView: (id: string) => void;
|
|
22
|
+
export { useIsCarbonioCE } from '../../store/login/hooks';
|
|
23
|
+
export { useTracker } from '../posthog';
|
|
@@ -1,44 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* SPDX-FileCopyrightText:
|
|
3
|
+
* SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com>
|
|
4
4
|
*
|
|
5
5
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
6
6
|
*/
|
|
7
|
+
var _a, _b;
|
|
7
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
const lodash_1 = require("lodash");
|
|
11
|
-
const fetch_1 = require("../../network/fetch");
|
|
9
|
+
exports.useSearchFolders = exports.useSearchFolder = exports.getRoots = exports.useRoots = exports.getRoot = exports.useRoot = exports.useFolders = exports.useFolder = exports.getFolders = exports.getFolder = exports.useRefresh = exports.useNotify = exports.renameTag = exports.deleteTag = exports.createTag = exports.changeTagColor = exports.useTags = exports.getTags = 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.getActionFactory = exports.getActionsFactory = exports.getActions = exports.getAction = exports.useIntegratedFunction = exports.useIntegratedComponent = exports.useActionFactory = exports.useActionsFactory = exports.useActions = exports.useAction = void 0;
|
|
10
|
+
exports.useTracker = exports.useIsCarbonioCE = exports.removeSecondaryAccessoryView = exports.removePrimaryAccessoryView = exports.removeUtilityView = exports.removeSearchView = exports.removeSettingsView = exports.removeBoardView = exports.removeRoute = exports.setRouteVisibility = exports.updatePrimaryBadge = exports.useLocalStorage = exports.runSearch = exports.getNotificationManager = exports.pushHistory = exports.goBackHistory = exports.replaceHistory = exports.useCurrentRoute = exports.getCurrentRoute = exports.useReplaceHistoryCallback = exports.useGoBackHistoryCallback = exports.usePushHistoryCallback = exports.useBoardHooks = exports.setCurrentBoard = exports.reopenBoards = exports.minimizeBoards = exports.useBoard = exports.useBoardById = exports.useBoardContextById = exports.getBoardContextById = exports.getBoardById = exports.updateBoardContext = exports.updateBoard = exports.closeBoard = exports.getRootByUser = exports.useRootByUser = exports.useFoldersAccordionByView = exports.useFoldersByView = exports.getSearchFolders = exports.getSearchFolder = void 0;
|
|
12
11
|
const app_1 = require("../../store/app");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
useAppContext: (0, app_1.getAppContextHook)(pkg.name),
|
|
22
|
-
getAppContext: (0, app_1.getAppContext)(pkg.name),
|
|
23
|
-
useApp: (0, app_1.getAppHook)(pkg.name),
|
|
24
|
-
getApp: (0, app_1.getApp)(pkg.name),
|
|
25
|
-
addBoard: (0, boards_1.addBoard)(pkg.name),
|
|
26
|
-
getBridgedFunctions: () => {
|
|
27
|
-
const { packageDependentFunctions, functions } = context_bridge_1.useContextBridge.getState();
|
|
28
|
-
return {
|
|
29
|
-
...functions,
|
|
30
|
-
...(0, lodash_1.reduce)(packageDependentFunctions, (acc, f, name) => ({ ...acc, [name]: f(pkg.name) }), {})
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
exports.getAppDependantFunctions = getAppDependantFunctions;
|
|
35
|
-
var hooks_2 = require("../../store/integrations/hooks");
|
|
36
|
-
Object.defineProperty(exports, "useAction", { enumerable: true, get: function () { return hooks_2.useAction; } });
|
|
37
|
-
Object.defineProperty(exports, "useActions", { enumerable: true, get: function () { return hooks_2.useActions; } });
|
|
38
|
-
Object.defineProperty(exports, "useActionsFactory", { enumerable: true, get: function () { return hooks_2.useActionsFactory; } });
|
|
39
|
-
Object.defineProperty(exports, "useActionFactory", { enumerable: true, get: function () { return hooks_2.useActionFactory; } });
|
|
40
|
-
Object.defineProperty(exports, "useIntegratedComponent", { enumerable: true, get: function () { return hooks_2.useIntegratedComponent; } });
|
|
41
|
-
Object.defineProperty(exports, "useIntegratedFunction", { enumerable: true, get: function () { return hooks_2.useIntegratedFunction; } });
|
|
12
|
+
const store_1 = require("../../store/integrations/store");
|
|
13
|
+
var hooks_1 = require("../../store/integrations/hooks");
|
|
14
|
+
Object.defineProperty(exports, "useAction", { enumerable: true, get: function () { return hooks_1.useAction; } });
|
|
15
|
+
Object.defineProperty(exports, "useActions", { enumerable: true, get: function () { return hooks_1.useActions; } });
|
|
16
|
+
Object.defineProperty(exports, "useActionsFactory", { enumerable: true, get: function () { return hooks_1.useActionsFactory; } });
|
|
17
|
+
Object.defineProperty(exports, "useActionFactory", { enumerable: true, get: function () { return hooks_1.useActionFactory; } });
|
|
18
|
+
Object.defineProperty(exports, "useIntegratedComponent", { enumerable: true, get: function () { return hooks_1.useIntegratedComponent; } });
|
|
19
|
+
Object.defineProperty(exports, "useIntegratedFunction", { enumerable: true, get: function () { return hooks_1.useIntegratedFunction; } });
|
|
42
20
|
var getters_1 = require("../../store/integrations/getters");
|
|
43
21
|
Object.defineProperty(exports, "getAction", { enumerable: true, get: function () { return getters_1.getAction; } });
|
|
44
22
|
Object.defineProperty(exports, "getActions", { enumerable: true, get: function () { return getters_1.getActions; } });
|
|
@@ -46,6 +24,7 @@ Object.defineProperty(exports, "getActionsFactory", { enumerable: true, get: fun
|
|
|
46
24
|
Object.defineProperty(exports, "getActionFactory", { enumerable: true, get: function () { return getters_1.getActionFactory; } });
|
|
47
25
|
Object.defineProperty(exports, "getIntegratedComponent", { enumerable: true, get: function () { return getters_1.getIntegratedComponent; } });
|
|
48
26
|
Object.defineProperty(exports, "getIntegratedFunction", { enumerable: true, get: function () { return getters_1.getIntegratedFunction; } });
|
|
27
|
+
_a = store_1.useIntegrationsStore.getState(), exports.registerFunctions = _a.registerFunctions, exports.removeFunctions = _a.removeFunctions, exports.registerActions = _a.registerActions, exports.removeActions = _a.removeActions, exports.removeComponents = _a.removeComponents;
|
|
49
28
|
var account_1 = require("../../store/account");
|
|
50
29
|
Object.defineProperty(exports, "getUserAccount", { enumerable: true, get: function () { return account_1.getUserAccount; } });
|
|
51
30
|
Object.defineProperty(exports, "getUserAccounts", { enumerable: true, get: function () { return account_1.getUserAccounts; } });
|
|
@@ -60,6 +39,8 @@ Object.defineProperty(exports, "useUserRights", { enumerable: true, get: functio
|
|
|
60
39
|
Object.defineProperty(exports, "getUserRight", { enumerable: true, get: function () { return account_1.getUserRight; } });
|
|
61
40
|
Object.defineProperty(exports, "getUserRights", { enumerable: true, get: function () { return account_1.getUserRights; } });
|
|
62
41
|
Object.defineProperty(exports, "useAuthenticated", { enumerable: true, get: function () { return account_1.useAuthenticated; } });
|
|
42
|
+
Object.defineProperty(exports, "updateSettings", { enumerable: true, get: function () { return account_1.updateSettings; } });
|
|
43
|
+
Object.defineProperty(exports, "updateAccount", { enumerable: true, get: function () { return account_1.updateAccount; } });
|
|
63
44
|
var tags_1 = require("../../store/tags");
|
|
64
45
|
Object.defineProperty(exports, "getTags", { enumerable: true, get: function () { return tags_1.getTags; } });
|
|
65
46
|
Object.defineProperty(exports, "useTags", { enumerable: true, get: function () { return tags_1.useTags; } });
|
|
@@ -88,34 +69,37 @@ Object.defineProperty(exports, "useFoldersByView", { enumerable: true, get: func
|
|
|
88
69
|
Object.defineProperty(exports, "useFoldersAccordionByView", { enumerable: true, get: function () { return folder_1.useFoldersAccordionByView; } });
|
|
89
70
|
Object.defineProperty(exports, "useRootByUser", { enumerable: true, get: function () { return folder_1.useRootByUser; } });
|
|
90
71
|
Object.defineProperty(exports, "getRootByUser", { enumerable: true, get: function () { return folder_1.getRootByUser; } });
|
|
91
|
-
var
|
|
92
|
-
Object.defineProperty(exports, "closeBoard", { enumerable: true, get: function () { return
|
|
93
|
-
Object.defineProperty(exports, "updateBoard", { enumerable: true, get: function () { return
|
|
94
|
-
Object.defineProperty(exports, "updateBoardContext", { enumerable: true, get: function () { return
|
|
95
|
-
Object.defineProperty(exports, "getBoardById", { enumerable: true, get: function () { return
|
|
96
|
-
Object.defineProperty(exports, "getBoardContextById", { enumerable: true, get: function () { return
|
|
97
|
-
Object.defineProperty(exports, "useBoardContextById", { enumerable: true, get: function () { return
|
|
98
|
-
Object.defineProperty(exports, "useBoardById", { enumerable: true, get: function () { return
|
|
99
|
-
Object.defineProperty(exports, "useBoard", { enumerable: true, get: function () { return
|
|
100
|
-
Object.defineProperty(exports, "minimizeBoards", { enumerable: true, get: function () { return
|
|
101
|
-
Object.defineProperty(exports, "reopenBoards", { enumerable: true, get: function () { return
|
|
102
|
-
Object.defineProperty(exports, "setCurrentBoard", { enumerable: true, get: function () { return
|
|
103
|
-
Object.defineProperty(exports, "useBoardHooks", { enumerable: true, get: function () { return
|
|
104
|
-
var
|
|
105
|
-
Object.defineProperty(exports, "usePushHistoryCallback", { enumerable: true, get: function () { return
|
|
106
|
-
Object.defineProperty(exports, "useGoBackHistoryCallback", { enumerable: true, get: function () { return
|
|
107
|
-
Object.defineProperty(exports, "useReplaceHistoryCallback", { enumerable: true, get: function () { return
|
|
108
|
-
Object.defineProperty(exports, "getCurrentRoute", { enumerable: true, get: function () { return
|
|
109
|
-
Object.defineProperty(exports, "useCurrentRoute", { enumerable: true, get: function () { return
|
|
110
|
-
Object.defineProperty(exports, "replaceHistory", { enumerable: true, get: function () { return
|
|
111
|
-
Object.defineProperty(exports, "goBackHistory", { enumerable: true, get: function () { return
|
|
112
|
-
Object.defineProperty(exports, "pushHistory", { enumerable: true, get: function () { return
|
|
72
|
+
var boards_1 = require("../../store/boards");
|
|
73
|
+
Object.defineProperty(exports, "closeBoard", { enumerable: true, get: function () { return boards_1.closeBoard; } });
|
|
74
|
+
Object.defineProperty(exports, "updateBoard", { enumerable: true, get: function () { return boards_1.updateBoard; } });
|
|
75
|
+
Object.defineProperty(exports, "updateBoardContext", { enumerable: true, get: function () { return boards_1.updateBoardContext; } });
|
|
76
|
+
Object.defineProperty(exports, "getBoardById", { enumerable: true, get: function () { return boards_1.getBoardById; } });
|
|
77
|
+
Object.defineProperty(exports, "getBoardContextById", { enumerable: true, get: function () { return boards_1.getBoardContextById; } });
|
|
78
|
+
Object.defineProperty(exports, "useBoardContextById", { enumerable: true, get: function () { return boards_1.useBoardContextById; } });
|
|
79
|
+
Object.defineProperty(exports, "useBoardById", { enumerable: true, get: function () { return boards_1.useBoardById; } });
|
|
80
|
+
Object.defineProperty(exports, "useBoard", { enumerable: true, get: function () { return boards_1.useBoard; } });
|
|
81
|
+
Object.defineProperty(exports, "minimizeBoards", { enumerable: true, get: function () { return boards_1.minimizeBoards; } });
|
|
82
|
+
Object.defineProperty(exports, "reopenBoards", { enumerable: true, get: function () { return boards_1.reopenBoards; } });
|
|
83
|
+
Object.defineProperty(exports, "setCurrentBoard", { enumerable: true, get: function () { return boards_1.setCurrentBoard; } });
|
|
84
|
+
Object.defineProperty(exports, "useBoardHooks", { enumerable: true, get: function () { return boards_1.useBoardHooks; } });
|
|
85
|
+
var hooks_2 = require("../../history/hooks");
|
|
86
|
+
Object.defineProperty(exports, "usePushHistoryCallback", { enumerable: true, get: function () { return hooks_2.usePushHistoryCallback; } });
|
|
87
|
+
Object.defineProperty(exports, "useGoBackHistoryCallback", { enumerable: true, get: function () { return hooks_2.useGoBackHistoryCallback; } });
|
|
88
|
+
Object.defineProperty(exports, "useReplaceHistoryCallback", { enumerable: true, get: function () { return hooks_2.useReplaceHistoryCallback; } });
|
|
89
|
+
Object.defineProperty(exports, "getCurrentRoute", { enumerable: true, get: function () { return hooks_2.getCurrentRoute; } });
|
|
90
|
+
Object.defineProperty(exports, "useCurrentRoute", { enumerable: true, get: function () { return hooks_2.useCurrentRoute; } });
|
|
91
|
+
Object.defineProperty(exports, "replaceHistory", { enumerable: true, get: function () { return hooks_2.replaceHistory; } });
|
|
92
|
+
Object.defineProperty(exports, "goBackHistory", { enumerable: true, get: function () { return hooks_2.goBackHistory; } });
|
|
93
|
+
Object.defineProperty(exports, "pushHistory", { enumerable: true, get: function () { return hooks_2.pushHistory; } });
|
|
113
94
|
var NotificationManager_1 = require("../../notification/NotificationManager");
|
|
114
95
|
Object.defineProperty(exports, "getNotificationManager", { enumerable: true, get: function () { return NotificationManager_1.getNotificationManager; } });
|
|
115
96
|
var run_search_1 = require("../../search/run-search");
|
|
116
97
|
Object.defineProperty(exports, "runSearch", { enumerable: true, get: function () { return run_search_1.runSearch; } });
|
|
117
|
-
var useIsMobile_1 = require("../../shell/hooks/useIsMobile");
|
|
118
|
-
Object.defineProperty(exports, "useIsMobile", { enumerable: true, get: function () { return useIsMobile_1.useIsMobile; } });
|
|
119
98
|
var useLocalStorage_1 = require("../../shell/hooks/useLocalStorage");
|
|
120
99
|
Object.defineProperty(exports, "useLocalStorage", { enumerable: true, get: function () { return useLocalStorage_1.useLocalStorage; } });
|
|
121
|
-
|
|
100
|
+
_b = app_1.useAppStore.getState(), exports.updatePrimaryBadge = _b.updatePrimaryBadge, exports.setRouteVisibility = _b.setRouteVisibility, exports.removeRoute = _b.removeRoute, exports.removeBoardView = _b.removeBoardView, exports.removeSettingsView = _b.removeSettingsView, exports.removeSearchView = _b.removeSearchView, exports.removeUtilityView = _b.removeUtilityView, exports.removePrimaryAccessoryView = _b.removePrimaryAccessoryView, exports.removeSecondaryAccessoryView = _b.removeSecondaryAccessoryView;
|
|
101
|
+
var hooks_3 = require("../../store/login/hooks");
|
|
102
|
+
Object.defineProperty(exports, "useIsCarbonioCE", { enumerable: true, get: function () { return hooks_3.useIsCarbonioCE; } });
|
|
103
|
+
var posthog_1 = require("../posthog");
|
|
104
|
+
Object.defineProperty(exports, "useTracker", { enumerable: true, get: function () { return posthog_1.useTracker; } });
|
|
105
|
+
//# sourceMappingURL=app-direct-exports.js.map
|
|
@@ -0,0 +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,wDAOwC;AANvC,kGAAA,SAAS,OAAA;AACT,mGAAA,UAAU,OAAA;AACV,0GAAA,iBAAiB,OAAA;AACjB,yGAAA,gBAAgB,OAAA;AAChB,+GAAA,sBAAsB,OAAA;AACtB,8GAAA,qBAAqB,OAAA;AAGtB,4DAO0C;AANzC,oGAAA,SAAS,OAAA;AACT,qGAAA,UAAU,OAAA;AACV,4GAAA,iBAAiB,OAAA;AACjB,2GAAA,gBAAgB,OAAA;AAChB,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;AACf,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AACf,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AACf,uGAAA,YAAY,OAAA;AACZ,wGAAA,aAAa,OAAA;AACb,uGAAA,YAAY,OAAA;AACZ,wGAAA,aAAa,OAAA;AACb,2GAAA,gBAAgB,OAAA;AAChB,yGAAA,cAAc,OAAA;AACd,wGAAA,aAAa,OAAA;AAGd,yCAAoD;AAA3C,+FAAA,OAAO,OAAA;AAAE,+FAAA,OAAO,OAAA;AACzB,2CAAqF;AAA5E,sGAAA,cAAc,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,iGAAA,SAAS,OAAA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AAkB,0BAClB,0BAAkB,0BAClB,mBAAW,mBACX,uBAAe,uBACf,0BAAkB,0BAClB,wBAAgB,wBAChB,yBAAiB,yBACjB,kCAA0B,kCAC1B,oCAA4B,mCACF;AAE3B,iDAA0D;AAAjD,wGAAA,eAAe,OAAA;AAExB,sCAAwC;AAA/B,qGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const TrackerProvider: ({ children }: React.PropsWithChildren<Record<never, never>>) => React.JSX.Element;
|
|
3
|
+
interface Tracker {
|
|
4
|
+
enableTracker: (enable: boolean) => void;
|
|
5
|
+
reset: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useTracker: () => Tracker;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useTracker = exports.TrackerProvider = void 0;
|
|
27
|
+
/*
|
|
28
|
+
* SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com>
|
|
29
|
+
*
|
|
30
|
+
* SPDX-License-Identifier: AGPL-3.0-only
|
|
31
|
+
*/
|
|
32
|
+
const react_1 = __importStar(require("react"));
|
|
33
|
+
const react_2 = require("posthog-js/react");
|
|
34
|
+
const account_1 = require("../store/account");
|
|
35
|
+
const hooks_1 = require("../store/login/hooks");
|
|
36
|
+
const utils_1 = require("../utils/utils");
|
|
37
|
+
const TrackerProvider = ({ children }) => {
|
|
38
|
+
const options = (0, react_1.useMemo)(() => ({
|
|
39
|
+
api_host: 'https://stats.zextras.tools',
|
|
40
|
+
person_profiles: 'identified_only',
|
|
41
|
+
opt_out_capturing_by_default: true,
|
|
42
|
+
disable_session_recording: true,
|
|
43
|
+
disable_surveys: true
|
|
44
|
+
}), []);
|
|
45
|
+
return (react_1.default.createElement(react_2.PostHogProvider, { apiKey: POSTHOG_API_KEY, options: options }, children));
|
|
46
|
+
};
|
|
47
|
+
exports.TrackerProvider = TrackerProvider;
|
|
48
|
+
const hashToSHA256 = async (value) => {
|
|
49
|
+
const encoder = new TextEncoder();
|
|
50
|
+
const data = encoder.encode(value);
|
|
51
|
+
return window.crypto.subtle.digest('SHA-256', data);
|
|
52
|
+
};
|
|
53
|
+
const arrayBufferToBase64 = (buffer) => {
|
|
54
|
+
const bytes = new Uint8Array(buffer);
|
|
55
|
+
const binary = bytes.reduce((res, byte) => res + String.fromCharCode(byte), '');
|
|
56
|
+
return window.btoa(binary);
|
|
57
|
+
};
|
|
58
|
+
const useTracker = () => {
|
|
59
|
+
const postHog = (0, react_2.usePostHog)();
|
|
60
|
+
const isCarbonioCE = (0, hooks_1.useIsCarbonioCE)();
|
|
61
|
+
const [isOptedIn, setIsOptedIn] = (0, react_1.useState)(postHog.has_opted_in_capturing());
|
|
62
|
+
(0, react_1.useEffect)(() => {
|
|
63
|
+
if (isCarbonioCE !== undefined) {
|
|
64
|
+
postHog.setPersonProperties({ is_ce: isCarbonioCE });
|
|
65
|
+
}
|
|
66
|
+
}, [isCarbonioCE, postHog]);
|
|
67
|
+
(0, react_1.useEffect)(() => {
|
|
68
|
+
const newValue = !isCarbonioCE || !isOptedIn;
|
|
69
|
+
if (postHog.config.disable_surveys !== newValue && isCarbonioCE !== undefined) {
|
|
70
|
+
postHog.set_config({ disable_surveys: newValue });
|
|
71
|
+
}
|
|
72
|
+
}, [isCarbonioCE, isOptedIn, postHog]);
|
|
73
|
+
const enableTracker = (0, react_1.useCallback)((enable) => {
|
|
74
|
+
if (!(0, utils_1.getCurrentLocationHost)().includes('127.0.0.1') &&
|
|
75
|
+
!(0, utils_1.getCurrentLocationHost)().includes('localhost')) {
|
|
76
|
+
if (enable) {
|
|
77
|
+
const { account } = account_1.useAccountStore.getState();
|
|
78
|
+
if (account?.id) {
|
|
79
|
+
hashToSHA256(account.id).then((arrayBuffer) => {
|
|
80
|
+
const hashUserId = arrayBufferToBase64(arrayBuffer);
|
|
81
|
+
postHog.identify(hashUserId);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
postHog.opt_in_capturing();
|
|
85
|
+
setIsOptedIn(true);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
postHog.opt_out_capturing();
|
|
89
|
+
setIsOptedIn(false);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, [postHog]);
|
|
93
|
+
const reset = (0, react_1.useCallback)(() => {
|
|
94
|
+
postHog.reset();
|
|
95
|
+
}, [postHog]);
|
|
96
|
+
return { enableTracker, reset };
|
|
97
|
+
};
|
|
98
|
+
exports.useTracker = useTracker;
|
|
99
|
+
//# sourceMappingURL=posthog.js.map
|
|
@@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,CAAC;oBACjB,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;wBAC7C,MAAM,UAAU,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;wBACpD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;oBAC9B,CAAC,CAAC,CAAC;gBACJ,CAAC;gBACD,OAAO,CAAC,gBAAgB,EAAE,CAAC;gBAC3B,YAAY,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;iBAAM,CAAC;gBACP,OAAO,CAAC,iBAAiB,EAAE,CAAC;gBAC5B,YAAY,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;QACF,CAAC;IACF,CAAC,EACD,CAAC,OAAO,CAAC,CACT,CAAC;IAEF,MAAM,KAAK,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC9B,OAAO,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AACjC,CAAC,CAAC;AAhDW,QAAA,UAAU,cAgDrB"}
|
package/lib/constants/locales.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../../src/constants/locales.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAgBU,QAAA,iBAAiB,GAAG;IAChC,KAAK,EAAE;QACN,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,aAAa,EAAE,OAAO;QACtB,aAAa,EAAE,SAAS;KACxB;IACD,EAAE,EAAE;QACH,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,IAAI;KACX;IACD,EAAE,EAAE;QACH,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,OAAO;KACtB;IACD,EAAE,EAAE;QACH,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,IAAI;KACX;IACD,EAAE,EAAE;QACH,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,IAAI;KACX;IACD,EAAE,EAAE;QACH,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,IAAI;KACX;IACD,EAAE,EAAE;QACH,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,IAAI;KACX;IAED,EAAE,EAAE;QACH,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,OAAO;KACtB;IACD,EAAE,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;KACX;IACD,KAAK,EAAE;QACN,IAAI,EAAE,oBAAoB;QAC1B,KAAK,EAAE,OAAO;QACd,aAAa,EAAE,OAAO;KACtB;IAED,EAAE,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;KACX;IACD,EAAE,EAAE;QACH,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,IAAI;KACX;IAED,EAAE,EAAE;QACH,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,IAAI;KACX;IAED,EAAE,EAAE;QACH,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,OAAO;KACtB;IACD,EAAE,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;KACX;IACD,EAAE,EAAE;QACH,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,OAAO;KACtB;IACD,EAAE,EAAE;QACH,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,IAAI;KACX;CACmD,CAAC"}
|
|
1
|
+
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../../src/constants/locales.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAgBU,QAAA,iBAAiB,GAAG;IAChC,KAAK,EAAE;QACN,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,aAAa,EAAE,OAAO;QACtB,aAAa,EAAE,SA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,EAAE;QACH,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,IAAI;KACX;CACmD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDarkMode = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com>
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: AGPL-3.0-only
|
|
8
|
+
*/
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const use_dark_reader_result_value_1 = require("./use-dark-reader-result-value");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
12
|
+
const useDarkMode = () => {
|
|
13
|
+
const darkReaderResultValue = (0, use_dark_reader_result_value_1.useDarkReaderResultValue)();
|
|
14
|
+
const [darkModeEnabled, setDarkModeEnabled] = (0, react_1.useState)(false);
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
if (darkReaderResultValue) {
|
|
17
|
+
setDarkModeEnabled((darkReaderResultValue === 'auto' && (0, utils_1.getPrefersColorSchemeDarkMedia)().matches) ||
|
|
18
|
+
darkReaderResultValue === 'enabled');
|
|
19
|
+
}
|
|
20
|
+
}, [darkReaderResultValue]);
|
|
21
|
+
(0, react_1.useEffect)(() => {
|
|
22
|
+
const setCallback = (event) => {
|
|
23
|
+
setDarkModeEnabled(event.matches);
|
|
24
|
+
};
|
|
25
|
+
(0, utils_1.getPrefersColorSchemeDarkMedia)().addEventListener('change', setCallback);
|
|
26
|
+
return () => {
|
|
27
|
+
(0, utils_1.getPrefersColorSchemeDarkMedia)().removeEventListener('change', setCallback);
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
return { darkModeEnabled, darkReaderStatus: darkReaderResultValue };
|
|
31
|
+
};
|
|
32
|
+
exports.useDarkMode = useDarkMode;
|
|
33
|
+
//# sourceMappingURL=use-dark-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-dark-mode.js","sourceRoot":"","sources":["../../src/dark-mode/use-dark-mode.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,iCAA4C;AAE5C,iFAA0E;AAE1E,mCAAyD;AAElD,MAAM,WAAW,GAAG,GAGzB,EAAE;IACH,MAAM,qBAAqB,GAAG,IAAA,uDAAwB,GAAE,CAAC;IAEzD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAEvE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,IAAI,qBAAqB,EAAE,CAAC;YAC3B,kBAAkB,CACjB,CAAC,qBAAqB,KAAK,MAAM,IAAI,IAAA,sCAA8B,GAAE,CAAC,OAAO,CAAC;gBAC7E,qBAAqB,KAAK,SAAS,CACpC,CAAC;QACH,CAAC;IACF,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAE5B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,MAAM,WAAW,GAAG,CAAC,KAA0B,EAAQ,EAAE;YACxD,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC,CAAC;QACF,IAAA,sCAA8B,GAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QACzE,OAAO,GAAS,EAAE;YACjB,IAAA,sCAA8B,GAAE,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC7E,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;AACrE,CAAC,CAAC;AA5BW,QAAA,WAAW,eA4BtB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DarkReaderPropValues } from './utils';
|
|
2
|
+
import { DARK_READER_PROP_KEY, SHELL_APP_ID } from '../constants';
|
|
3
|
+
import type { ZimletProp } from '../types/account';
|
|
4
|
+
export interface ZappDarkreaderModeZimletProp extends ZimletProp {
|
|
5
|
+
name: typeof DARK_READER_PROP_KEY;
|
|
6
|
+
zimlet: typeof SHELL_APP_ID;
|
|
7
|
+
_content: DarkReaderPropValues;
|
|
8
|
+
}
|
|
9
|
+
export declare function isZappDarkreaderModeZimletProp(prop: ZimletProp): prop is ZappDarkreaderModeZimletProp;
|
|
10
|
+
export declare function isDarkReaderPropValues(maybeDarkReaderPropValue: unknown): maybeDarkReaderPropValue is DarkReaderPropValues;
|
|
11
|
+
export declare function useDarkReaderResultValue(): undefined | DarkReaderPropValues;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com>
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: AGPL-3.0-only
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.useDarkReaderResultValue = exports.isDarkReaderPropValues = exports.isZappDarkreaderModeZimletProp = void 0;
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const lodash_1 = require("lodash");
|
|
11
|
+
const constants_1 = require("../constants");
|
|
12
|
+
const account_1 = require("../store/account");
|
|
13
|
+
const store_1 = require("../store/login/store");
|
|
14
|
+
function isZappDarkreaderModeZimletProp(prop) {
|
|
15
|
+
return prop.name === constants_1.DARK_READER_PROP_KEY && prop.zimlet === constants_1.SHELL_APP_ID;
|
|
16
|
+
}
|
|
17
|
+
exports.isZappDarkreaderModeZimletProp = isZappDarkreaderModeZimletProp;
|
|
18
|
+
function isDarkReaderPropValues(maybeDarkReaderPropValue) {
|
|
19
|
+
return (typeof maybeDarkReaderPropValue === 'string' &&
|
|
20
|
+
constants_1.DARK_READER_VALUES.includes(maybeDarkReaderPropValue));
|
|
21
|
+
}
|
|
22
|
+
exports.isDarkReaderPropValues = isDarkReaderPropValues;
|
|
23
|
+
// return the final calculated value between ZappDarkreaderModeZimletProp value and carbonioWebUiDarkMode config
|
|
24
|
+
function useDarkReaderResultValue() {
|
|
25
|
+
const settings = (0, account_1.useUserSettings)();
|
|
26
|
+
const { carbonioWebUiDarkMode } = (0, store_1.useLoginConfigStore)();
|
|
27
|
+
const settingReceived = (0, react_1.useMemo)(() => (0, lodash_1.size)(settings.prefs) > 0 || (0, lodash_1.size)(settings.attrs) > 0 || (0, lodash_1.size)(settings.props) > 0, [settings]);
|
|
28
|
+
return (0, react_1.useMemo)(() => {
|
|
29
|
+
if (settingReceived) {
|
|
30
|
+
const result = (0, lodash_1.find)(settings.props, (value) => isZappDarkreaderModeZimletProp(value))?._content;
|
|
31
|
+
return result || (carbonioWebUiDarkMode && 'enabled') || 'disabled';
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
}, [settingReceived, settings, carbonioWebUiDarkMode]);
|
|
35
|
+
}
|
|
36
|
+
exports.useDarkReaderResultValue = useDarkReaderResultValue;
|
|
37
|
+
//# sourceMappingURL=use-dark-reader-result-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-dark-reader-result-value.js","sourceRoot":"","sources":["../../src/dark-mode/use-dark-reader-result-value.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAAgC;AAEhC,mCAAoC;AAGpC,4CAAsF;AACtF,8CAAmD;AACnD,gDAA2D;AAS3D,SAAgB,8BAA8B,CAC7C,IAAgB;IAEhB,OAAO,IAAI,CAAC,IAAI,KAAK,gCAAoB,IAAI,IAAI,CAAC,MAAM,KAAK,wBAAY,CAAC;AAC3E,CAAC;AAJD,wEAIC;AAED,SAAgB,sBAAsB,CACrC,wBAAiC;IAEjC,OAAO,CACN,OAAO,wBAAwB,KAAK,QAAQ;QAC5C,8BAAkB,CAAC,QAAQ,CAAC,wBAAgD,CAAC,CAC7E,CAAC;AACH,CAAC;AAPD,wDAOC;AAED,gHAAgH;AAChH,SAAgB,wBAAwB;IACvC,MAAM,QAAQ,GAAG,IAAA,yBAAe,GAAE,CAAC;IACnC,MAAM,EAAE,qBAAqB,EAAE,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAExD,MAAM,eAAe,GAAG,IAAA,eAAO,EAC9B,GAAG,EAAE,CAAC,IAAA,aAAI,EAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAA,aAAI,EAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAA,aAAI,EAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EACtF,CAAC,QAAQ,CAAC,CACV,CAAC;IAEF,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QACnB,IAAI,eAAe,EAAE,CAAC;YACrB,MAAM,MAAM,GAAG,IAAA,aAAI,EAClB,QAAQ,CAAC,KAAK,EACd,CAAC,KAAK,EAAyC,EAAE,CAAC,8BAA8B,CAAC,KAAK,CAAC,CACvF,EAAE,QAAQ,CAAC;YAEZ,OAAO,MAAM,IAAI,CAAC,qBAAqB,IAAI,SAAS,CAAC,IAAI,UAAU,CAAC;QACrE,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC,EAAE,CAAC,eAAe,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC;AACxD,CAAC;AApBD,4DAoBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com>
|
|
4
|
+
*
|
|
5
|
+
* SPDX-License-Identifier: AGPL-3.0-only
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getPrefersColorSchemeDarkMedia = void 0;
|
|
9
|
+
const getPrefersColorSchemeDarkMedia = () => window.matchMedia('(prefers-color-scheme: dark)');
|
|
10
|
+
exports.getPrefersColorSchemeDarkMedia = getPrefersColorSchemeDarkMedia;
|
|
11
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/dark-mode/utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAII,MAAM,8BAA8B,GAAG,GAAmB,EAAE,CAClE,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;AADtC,QAAA,8BAA8B,kCACQ"}
|