@zextras/carbonio-shell-ui 9.0.1 → 10.0.0-devel.1738847815855

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.
Files changed (161) hide show
  1. package/THIRDPARTIES +431 -0
  2. package/lib/boot/app/app-context-provider.d.ts +5 -0
  3. package/lib/boot/app/app-context-provider.js +5 -0
  4. package/lib/boot/app/app-context-provider.js.map +1 -1
  5. package/lib/boot/app/app-dependant-exports.d.ts +1 -2
  6. package/lib/boot/app/app-dependant-exports.js +0 -1
  7. package/lib/boot/app/app-dependant-exports.js.map +1 -1
  8. package/lib/boot/app/app-direct-exports.d.ts +20 -8
  9. package/lib/boot/app/app-direct-exports.js +20 -30
  10. package/lib/boot/app/app-direct-exports.js.map +1 -1
  11. package/lib/boot/app/app-error-catcher.js +17 -7
  12. package/lib/boot/app/app-error-catcher.js.map +1 -1
  13. package/lib/constants/index.d.ts +4 -54
  14. package/lib/constants/index.js +6 -63
  15. package/lib/constants/index.js.map +1 -1
  16. package/lib/constants/locales.d.ts +6 -87
  17. package/lib/constants/locales.js +87 -23
  18. package/lib/constants/locales.js.map +1 -1
  19. package/lib/dark-mode/use-dark-reader-result-value.js +4 -5
  20. package/lib/dark-mode/use-dark-reader-result-value.js.map +1 -1
  21. package/lib/history/hooks.d.ts +2 -2
  22. package/lib/history/hooks.js +2 -2
  23. package/lib/history/hooks.js.map +1 -1
  24. package/lib/lib.d.ts +9 -10
  25. package/lib/lib.js +1 -2
  26. package/lib/lib.js.map +1 -1
  27. package/lib/network/edit-settings.d.ts +1 -1
  28. package/lib/network/fetch-utils.d.ts +1 -1
  29. package/lib/network/fetch.d.ts +10 -4
  30. package/lib/network/fetch.js +18 -4
  31. package/lib/network/fetch.js.map +1 -1
  32. package/lib/network/logout.d.ts +1 -0
  33. package/lib/network/logout.js +29 -0
  34. package/lib/network/logout.js.map +1 -0
  35. package/lib/network/utils.js +2 -3
  36. package/lib/network/utils.js.map +1 -1
  37. package/lib/settings/components/settings-header.js +17 -7
  38. package/lib/settings/components/settings-header.js.map +1 -1
  39. package/lib/shell/creation-button.js +24 -8
  40. package/lib/shell/creation-button.js.map +1 -1
  41. package/lib/shell/hooks/useLocalStorage.js +2 -2
  42. package/lib/shell/hooks/useLocalStorage.js.map +1 -1
  43. package/lib/store/account/hooks.js +2 -1
  44. package/lib/store/account/hooks.js.map +1 -1
  45. package/lib/store/account/utils.js +4 -5
  46. package/lib/store/account/utils.js.map +1 -1
  47. package/lib/store/app/hooks.d.ts +0 -5
  48. package/lib/store/app/hooks.js +1 -11
  49. package/lib/store/app/hooks.js.map +1 -1
  50. package/lib/store/app/store.d.ts +2 -4
  51. package/lib/store/app/store.js +5 -28
  52. package/lib/store/app/store.js.map +1 -1
  53. package/lib/store/app/utils.d.ts +2 -3
  54. package/lib/store/app/utils.js +1 -14
  55. package/lib/store/app/utils.js.map +1 -1
  56. package/lib/store/boards/hooks.js +17 -7
  57. package/lib/store/boards/hooks.js.map +1 -1
  58. package/lib/store/boards/store.d.ts +4 -4
  59. package/lib/store/i18n/store.js +14 -4
  60. package/lib/store/i18n/store.js.map +1 -1
  61. package/lib/store/integrations/composer.d.ts +1 -1
  62. package/lib/store/integrations/composer.js +17 -7
  63. package/lib/store/integrations/composer.js.map +1 -1
  64. package/lib/store/integrations/getters.d.ts +4 -4
  65. package/lib/store/integrations/getters.js +3 -1
  66. package/lib/store/integrations/getters.js.map +1 -1
  67. package/lib/store/integrations/hooks.d.ts +4 -4
  68. package/lib/store/integrations/hooks.js.map +1 -1
  69. package/lib/store/integrations/utils.d.ts +2 -2
  70. package/lib/store/integrations/utils.js +12 -8
  71. package/lib/store/integrations/utils.js.map +1 -1
  72. package/lib/store/login/getters.js +2 -3
  73. package/lib/store/login/getters.js.map +1 -1
  74. package/lib/store/login/hooks.js +4 -4
  75. package/lib/store/login/hooks.js.map +1 -1
  76. package/lib/store/network/hooks.js +4 -2
  77. package/lib/store/network/hooks.js.map +1 -1
  78. package/lib/store/network/utils.d.ts +1 -2
  79. package/lib/store/network/utils.js +4 -40
  80. package/lib/store/network/utils.js.map +1 -1
  81. package/lib/types/apps/index.d.ts +2 -15
  82. package/lib/types/misc/index.d.ts +0 -44
  83. package/lib/types/network/index.d.ts +6 -31
  84. package/lib/types/network/soap.d.ts +1 -0
  85. package/lib/types/network/soap.js +4 -0
  86. package/lib/types/network/soap.js.map +1 -1
  87. package/lib/types/tags/index.d.ts +0 -4
  88. package/lib/types/theme.d.ts +10 -0
  89. package/lib/types/{search/items.js → theme.js} +1 -1
  90. package/lib/types/theme.js.map +1 -0
  91. package/lib/ui-extras/app-link.js +17 -7
  92. package/lib/ui-extras/app-link.js.map +1 -1
  93. package/lib/ui-extras/auth-guard.d.ts +5 -0
  94. package/lib/ui-extras/auth-guard.js +14 -0
  95. package/lib/ui-extras/auth-guard.js.map +1 -0
  96. package/lib/ui-extras/nav-guard.js +17 -7
  97. package/lib/ui-extras/nav-guard.js.map +1 -1
  98. package/lib/utility-bar/bar.d.ts +19 -0
  99. package/lib/utility-bar/bar.js +129 -0
  100. package/lib/utility-bar/bar.js.map +1 -0
  101. package/lib/utility-bar/store.d.ts +2 -0
  102. package/lib/utility-bar/store.js +19 -0
  103. package/lib/utility-bar/store.js.map +1 -0
  104. package/lib/utility-bar/utils.d.ts +4 -0
  105. package/lib/utility-bar/utils.js +30 -0
  106. package/lib/utility-bar/utils.js.map +1 -0
  107. package/lib/utils/typeUtils.d.ts +0 -1
  108. package/lib/utils/utils.d.ts +0 -3
  109. package/lib/utils/utils.js +4 -6
  110. package/lib/utils/utils.js.map +1 -1
  111. package/package.json +29 -27
  112. package/lib/network/tags.d.ts +0 -27
  113. package/lib/network/tags.js +0 -31
  114. package/lib/network/tags.js.map +0 -1
  115. package/lib/search/run-search.d.ts +0 -2
  116. package/lib/search/run-search.js +0 -17
  117. package/lib/search/run-search.js.map +0 -1
  118. package/lib/search/search-store.d.ts +0 -2
  119. package/lib/search/search-store.js +0 -20
  120. package/lib/search/search-store.js.map +0 -1
  121. package/lib/search/useSearchModule.d.ts +0 -3
  122. package/lib/search/useSearchModule.js +0 -21
  123. package/lib/search/useSearchModule.js.map +0 -1
  124. package/lib/store/folder/hooks.d.ts +0 -21
  125. package/lib/store/folder/hooks.js +0 -77
  126. package/lib/store/folder/hooks.js.map +0 -1
  127. package/lib/store/folder/index.d.ts +0 -2
  128. package/lib/store/folder/index.js +0 -24
  129. package/lib/store/folder/index.js.map +0 -1
  130. package/lib/store/folder/store.d.ts +0 -2
  131. package/lib/store/folder/store.js +0 -20
  132. package/lib/store/folder/store.js.map +0 -1
  133. package/lib/store/folder/utils.d.ts +0 -16
  134. package/lib/store/folder/utils.js +0 -53
  135. package/lib/store/folder/utils.js.map +0 -1
  136. package/lib/store/tags/hooks.d.ts +0 -3
  137. package/lib/store/tags/hooks.js +0 -15
  138. package/lib/store/tags/hooks.js.map +0 -1
  139. package/lib/store/tags/index.d.ts +0 -2
  140. package/lib/store/tags/index.js +0 -24
  141. package/lib/store/tags/index.js.map +0 -1
  142. package/lib/store/tags/store.d.ts +0 -2
  143. package/lib/store/tags/store.js +0 -18
  144. package/lib/store/tags/store.js.map +0 -1
  145. package/lib/types/folder/index.d.ts +0 -29
  146. package/lib/types/folder/index.js +0 -8
  147. package/lib/types/folder/index.js.map +0 -1
  148. package/lib/types/search/index.d.ts +0 -11
  149. package/lib/types/search/index.js +0 -23
  150. package/lib/types/search/index.js.map +0 -1
  151. package/lib/types/search/items.d.ts +0 -6
  152. package/lib/types/search/items.js.map +0 -1
  153. package/lib/types/workers/index.d.ts +0 -17
  154. package/lib/types/workers/index.js +0 -3
  155. package/lib/types/workers/index.js.map +0 -1
  156. package/lib/ui-extras/spinner.d.ts +0 -2
  157. package/lib/ui-extras/spinner.js +0 -18
  158. package/lib/ui-extras/spinner.js.map +0 -1
  159. package/lib/workers/index.d.ts +0 -2
  160. package/lib/workers/index.js +0 -15
  161. package/lib/workers/index.js.map +0 -1
@@ -3,13 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useIsCarbonioCE = exports.useLogo = void 0;
6
+ exports.useLogo = useLogo;
7
+ exports.useIsCarbonioCE = useIsCarbonioCE;
7
8
  const react_1 = require("react");
8
9
  const store_1 = require("./store");
9
10
  const carbonio_svg_1 = __importDefault(require("../../../assets/carbonio.svg"));
10
11
  const use_dark_mode_1 = require("../../dark-mode/use-dark-mode");
11
12
  function useLogo() {
12
- const { carbonioWebUiAppLogo, carbonioWebUiDarkAppLogo } = (0, store_1.useLoginConfigStore)();
13
+ const carbonioWebUiAppLogo = (0, store_1.useLoginConfigStore)((s) => s.carbonioWebUiAppLogo);
14
+ const carbonioWebUiDarkAppLogo = (0, store_1.useLoginConfigStore)((s) => s.carbonioWebUiDarkAppLogo);
13
15
  const { darkModeEnabled } = (0, use_dark_mode_1.useDarkMode)();
14
16
  return (0, react_1.useMemo)(() => {
15
17
  if (darkModeEnabled) {
@@ -18,12 +20,10 @@ function useLogo() {
18
20
  return carbonioWebUiAppLogo ?? carbonioWebUiDarkAppLogo ?? carbonio_svg_1.default;
19
21
  }, [carbonioWebUiDarkAppLogo, carbonioWebUiAppLogo, darkModeEnabled]);
20
22
  }
21
- exports.useLogo = useLogo;
22
23
  /**
23
24
  * Hook useful to know if is Carbonio CE or not
24
25
  */
25
26
  function useIsCarbonioCE() {
26
27
  return (0, store_1.useLoginConfigStore)((state) => state.isCarbonioCE);
27
28
  }
28
- exports.useIsCarbonioCE = useIsCarbonioCE;
29
29
  //# sourceMappingURL=hooks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/store/login/hooks.ts"],"names":[],"mappings":";;;;;;AAMA,iCAAgC;AAEhC,mCAA8C;AAC9C,gFAAuD;AACvD,iEAA4D;AAE5D,SAAgB,OAAO;IACtB,MAAM,EAAE,oBAAoB,E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,EAAE,CAAC,wBAAwB,EAAE,oBAAoB,EAAE,eAAe,CAAC,CAAC,CAAC;AACvE,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe;IAC9B,OAAO,IAAA,2BAAmB,EAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAC3D,CAAC"}
@@ -7,8 +7,10 @@ exports.useRefresh = exports.useNotify = void 0;
7
7
  * SPDX-License-Identifier: AGPL-3.0-only
8
8
  */
9
9
  const store_1 = require("./store");
10
- const useNotify = () => (0, store_1.useNetworkStore)((s) => s.notify ?? []);
10
+ const FALLBACK_NOTIFY = [];
11
+ const FALLBACK_REFRESH = {};
12
+ const useNotify = () => (0, store_1.useNetworkStore)((s) => s.notify ?? FALLBACK_NOTIFY);
11
13
  exports.useNotify = useNotify;
12
- const useRefresh = () => (0, store_1.useNetworkStore)((s) => s.refresh ?? {});
14
+ const useRefresh = () => (0, store_1.useNetworkStore)((s) => s.refresh ?? FALLBACK_REFRESH);
13
15
  exports.useRefresh = useRefresh;
14
16
  //# sourceMappingURL=hooks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/store/network/hooks.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mCAA0C;AAGnC,MAAM,SAAS,GAAG,GAAiB,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;AAAvE,QAAA,SAAS,aAA8D;AAC7E,MAAM,UAAU,GAAG,GAAgB,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;AAAxE,QAAA,UAAU,cAA8D"}
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/store/network/hooks.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mCAA0C;AAG1C,MAAM,eAAe,GAAiB,EAAE,CAAC;AACzC,MAAM,gBAAgB,GAAgB,EAAE,CAAC;AAClC,MAAM,SAAS,GAAG,GAAiB,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,eAAe,CAAC,CAAC;AAApF,QAAA,SAAS,aAA2E;AAC1F,MAAM,UAAU,GAAG,GAAgB,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC;AAAtF,QAAA,UAAU,cAA4E"}
@@ -1,6 +1,6 @@
1
1
  import type { NoOpResponse } from '../../network/fetch';
2
2
  import type { AccountSettings } from '../../types/account';
3
- import type { RawSoapResponse, SoapContext } from '../../types/network';
3
+ import type { RawSoapResponse } from '../../types/network';
4
4
  export declare const parsePollingInterval: (settings: AccountSettings) => number;
5
5
  /**
6
6
  * Return the polling interval for the next NoOp request.
@@ -10,4 +10,3 @@ export declare const parsePollingInterval: (settings: AccountSettings) => number
10
10
  export declare const getPollingInterval: (res: RawSoapResponse<{
11
11
  NoOpResponse?: NoOpResponse;
12
12
  }>) => number;
13
- export declare const handleSync: ({ refresh, notify }: SoapContext) => Promise<void>;
@@ -5,24 +5,19 @@
5
5
  * SPDX-License-Identifier: AGPL-3.0-only
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.handleSync = exports.getPollingInterval = exports.parsePollingInterval = void 0;
9
- const lodash_1 = require("lodash");
10
- const store_1 = require("./store");
11
- const workers_1 = require("../../workers");
8
+ exports.getPollingInterval = exports.parsePollingInterval = void 0;
12
9
  const account_1 = require("../account");
13
- const folder_1 = require("../folder");
14
- const tags_1 = require("../tags");
15
10
  /**
16
11
  * Polling interval to use if the long polling delay
17
12
  * is not allowed for the user
18
13
  */
19
- const POLLING_NOWAIT_INTERVAL = 10000;
14
+ const POLLING_NOWAIT_INTERVAL = 10_000;
20
15
  /**
21
16
  * Polling interval to use if a previous request failed
22
17
  * with a 500 error
23
18
  */
24
- const POLLING_RETRY_INTERVAL = 60000;
25
- const POLLING_INVALID_DURATION = 30000;
19
+ const POLLING_RETRY_INTERVAL = 60_000;
20
+ const POLLING_INVALID_DURATION = 30_000;
26
21
  const LONG_POLLING_MARKER_VALUE = 500;
27
22
  const parsePollingInterval = (settings) => {
28
23
  const pollingPref = settings.prefs?.zimbraPrefMailPollingInterval ?? '';
@@ -70,35 +65,4 @@ const getPollingInterval = (res) => {
70
65
  return (0, exports.parsePollingInterval)(settings);
71
66
  };
72
67
  exports.getPollingInterval = getPollingInterval;
73
- const handleSync = ({ refresh, notify }) => new Promise((r) => {
74
- const { seq } = store_1.useNetworkStore.getState();
75
- if (refresh) {
76
- workers_1.tagWorker.postMessage({
77
- op: 'refresh',
78
- tags: refresh.tags
79
- });
80
- workers_1.folderWorker.postMessage({
81
- op: 'refresh',
82
- folder: refresh.folder ?? []
83
- });
84
- }
85
- if (notify?.length) {
86
- (0, lodash_1.forEach)(notify, (item) => {
87
- if (item.seq > seq) {
88
- workers_1.tagWorker.postMessage({
89
- op: 'notify',
90
- notify: item,
91
- state: tags_1.useTagStore.getState().tags
92
- });
93
- workers_1.folderWorker.postMessage({
94
- op: 'notify',
95
- notify: item,
96
- state: folder_1.useFolderStore.getState().folders
97
- });
98
- }
99
- });
100
- }
101
- r();
102
- });
103
- exports.handleSync = handleSync;
104
68
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/store/network/utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mCAAiC;AAEjC,mCAA0C;AAI1C,2CAAwD;AACxD,wCAA6C;AAC7C,sCAA2C;AAC3C,kCAAsC;AAEtC;;;GAGG;AACH,MAAM,uBAAuB,GAAG,KAAM,CAAC;AAEvC;;;GAGG;AACH,MAAM,sBAAsB,GAAG,KAAM,CAAC;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,OAAO,YAAY,CAAC;QACrB,KAAK,SAAS,CAAC;QACf,KAAK,GAAG;YACP,OAAO,YAAY,GAAG,IAAI,CAAC;QAC5B,KAAK,GAAG;YACP,OAAO,YAAY,GAAG,EAAE,GAAG,IAAI,CAAC;QACjC,KAAK,GAAG;YACP,OAAO,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACtC,KAAK,GAAG;YACP,OAAO,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAC3C;YACC,OAAO,wBAAwB,CAAC;IAClC,CAAC;AACF,CAAC,CAAC;AA7BW,QAAA,oBAAoB,wBA6B/B;AAEF;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CACjC,GAEE,EACO,EAAE;IACX,MAAM,EAAE,QAAQ,EAAE,GAAG,yBAAe,CAAC,QAAQ,EAAE,CAAC;IAChD,MAAM,cAAc,GACnB,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC;IAC7E,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,IAAI,OAAO,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;IAChE,IAAI,KAAK,EAAE,CAAC;QACX,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IACD,IAAI,cAAc,EAAE,CAAC;QACpB,OAAO,uBAAuB,CAAC;IAChC,CAAC;IACD,OAAO,IAAA,4BAAoB,EAAC,QAAQ,CAAC,CAAC;AACvC,CAAC,CAAC;AAhBW,QAAA,kBAAkB,sBAgB7B"}
@@ -1,7 +1,6 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import type React from 'react';
3
- import type { DefaultTheme } from 'styled-components';
4
- import type { QueryChip } from '../search';
3
+ import type { Theme } from '@zextras/carbonio-design-system';
5
4
  export type CarbonioModule = {
6
5
  commit: string;
7
6
  description: string;
@@ -26,7 +25,7 @@ export type BadgeInfo = {
26
25
  icon?: string;
27
26
  count?: number;
28
27
  showCount?: boolean;
29
- color?: keyof DefaultTheme['palette'];
28
+ color?: keyof Theme['palette'];
30
29
  };
31
30
  export type CarbonioView<P> = {
32
31
  id: string;
@@ -52,13 +51,6 @@ export type SecondaryBarComponentProps = {
52
51
  export type AppViewComponentProps = {};
53
52
  export type BoardViewComponentProps = {};
54
53
  export type SettingsViewProps = {};
55
- export type SearchViewProps = {
56
- useQuery: () => [QueryChip[], Function];
57
- ResultsHeader: React.ComponentType<{
58
- label: string;
59
- }>;
60
- useDisableSearch: () => [boolean, Function];
61
- };
62
54
  export type PrimaryAccessoryViewProps = {};
63
55
  export type SecondaryAccessoryViewProps = {
64
56
  expanded: boolean;
@@ -93,11 +85,6 @@ export type SettingsView = CarbonioView<SettingsViewProps> & {
93
85
  position: number;
94
86
  subSections?: Array<SettingsSubSection>;
95
87
  };
96
- export type SearchView = CarbonioView<SearchViewProps> & {
97
- icon: string;
98
- label: string;
99
- position: number;
100
- };
101
88
  export type PrimaryAccessoryView = CarbonioAccessoryView<PrimaryAccessoryViewProps> & {
102
89
  component: string | ComponentType;
103
90
  onClick?: (ev: KeyboardEvent | React.MouseEvent<HTMLButtonElement> | undefined) => void;
@@ -1,7 +1,5 @@
1
- import type { ComponentType } from 'react';
2
1
  import type { To } from 'history';
3
2
  import type { PanelMode } from '../apps';
4
- import type { Folder } from '../folder';
5
3
  export type HistoryParams = {
6
4
  path: To;
7
5
  route?: string;
@@ -23,34 +21,6 @@ export type AccountProps = {
23
21
  personaLabel?: string;
24
22
  identityId?: string;
25
23
  };
26
- /** @deprecated */
27
- export type IdentityProps = {
28
- id: string;
29
- /**
30
- * Type of the identity
31
- */
32
- flgType: 'primary' | 'persona' | 'IMAP' | 'POP';
33
- /**
34
- * Localized description of the type of identity
35
- */
36
- type: string;
37
- /**
38
- * is a number while you are creating a new one
39
- */
40
- identityId: string | number;
41
- fromAddress?: string;
42
- identityName?: string;
43
- fromDisplay?: string;
44
- recoveryAccount?: string;
45
- replyToDisplay?: string;
46
- replyToAddress?: string;
47
- replyToEnabled?: string;
48
- saveToSent?: string;
49
- sentMailFolder?: string;
50
- whenInFoldersEnabled?: string;
51
- whenSentToEnabled?: string;
52
- whenSentToAddresses?: string;
53
- };
54
24
  type Meta<T extends Record<string, unknown>> = {
55
25
  section?: string;
56
26
  _attrs: T;
@@ -129,18 +99,4 @@ export type SearchFolderFields = {
129
99
  types?: string;
130
100
  };
131
101
  export type SortBy = 'dateDesc' | 'dateAsc' | 'idDesc' | 'idAsc' | 'subjDesc' | 'subjAsc' | 'nameDesc' | 'nameAsc' | 'durDesc' | 'durAsc' | 'none' | 'taskDueAsc' | 'taskDueDesc' | 'taskStatusAsc' | 'taskStatusDesc' | 'taskPercCompletedAsc' | 'taskPercCompletedDesc' | 'rcptAsc' | 'rcptDesc' | 'readAsc' | 'readDesc';
132
- export type AccordionFolder = {
133
- id: string;
134
- label: string;
135
- folder: Folder;
136
- CustomComponent: ComponentType<{
137
- folder: Folder;
138
- }>;
139
- items: Array<AccordionFolder>;
140
- };
141
- export type TreeNode<T> = T & {
142
- id: string;
143
- children: TreeNode<T>[];
144
- parent?: TreeNode<T>;
145
- };
146
102
  export {};
@@ -1,6 +1,5 @@
1
- /// <reference types="node" />
2
1
  import type { AccountACEInfo } from './entities';
3
- import type { SoapBody, SoapContext } from './soap';
2
+ import type { SoapBody, SoapContext, SoapFault } from './soap';
4
3
  import type { JSNS } from '../../constants';
5
4
  import type { Exactify, RequireAtLeastOne, ValueOf } from '../../utils/typeUtils';
6
5
  import type { AccountRights, AccountSettingsPrefs, Identity, IdentityAttrs, Signature, ZimletProp } from '../account';
@@ -66,34 +65,6 @@ export type PermissionsMods = {
66
65
  new: AccountACEInfo;
67
66
  };
68
67
  };
69
- /**
70
- * @deprecated
71
- */
72
- export type CreateIdentityProps = {
73
- requestId: number;
74
- /** name of the identity */
75
- zimbraPrefIdentityName: string | undefined;
76
- /** personal part of email address put in from header */
77
- zimbraPrefFromDisplay: string | undefined;
78
- /** email address to put in from header. Deprecated on data source as of bug 67068. */
79
- zimbraPrefFromAddress: string | undefined;
80
- /** Type of the email address from header. (sendAs or sendOnBehalfOf) */
81
- zimbraPrefFromAddressType: 'sendAs' | 'sendOnBehalfOf';
82
- /** TRUE if we should set a reply-to header */
83
- zimbraPrefReplyToEnabled: 'TRUE' | 'FALSE' | undefined;
84
- /** personal part of email address put in reply-to header */
85
- zimbraPrefReplyToDisplay: string | undefined;
86
- /** address to put in reply-to header */
87
- zimbraPrefReplyToAddress: string | undefined;
88
- /** default mail signature for account/identity/dataSource */
89
- zimbraPrefDefaultSignatureId: string | undefined;
90
- /** forward/reply signature id for account/identity/dataSource */
91
- zimbraPrefForwardReplySignatureId: string | undefined;
92
- /** TRUE if we should look at zimbraPrefWhenSentToAddresses (deprecatedSince 5.0 in account) */
93
- zimbraPrefWhenSentToEnabled: string | undefined;
94
- /** TRUE if we should look at zimbraPrefWhenInFolderIds (deprecatedSince 5.0 in account) */
95
- zimbraPrefWhenInFoldersEnabled: string | undefined;
96
- };
97
68
  export type CreateIdentityResponse = {
98
69
  identity: [Identity];
99
70
  };
@@ -147,11 +118,13 @@ export type CreateIdentityRequest = SoapBody<{
147
118
  name?: string;
148
119
  _attrs: IdentityAttrs;
149
120
  };
121
+ requestId?: string;
150
122
  }>;
151
123
  export type ModifyIdentityRequest = SoapBody<{
152
124
  identity: {
153
125
  _attrs?: IdentityAttrs;
154
126
  } & RequireAtLeastOne<Pick<Identity, 'id' | 'name'>>;
127
+ requestId?: string;
155
128
  }>;
156
129
  export type DeleteIdentityRequest = SoapBody<{
157
130
  identity: {
@@ -168,5 +141,7 @@ export type ModifyPropertiesRequest = SoapBody<{
168
141
  }>;
169
142
  }>;
170
143
  export type BatchRequest<T extends Exactify<Record<`${string}Request`, unknown>, T> = Record<`${string}Request`, unknown>> = SoapBody<T>;
171
- export type BatchResponse<T extends Exactify<Record<`${string}Response`, unknown>, T> = Record<`${string}Response`, unknown>> = SoapBody<T>;
144
+ export type BatchResponse<T extends Exactify<Record<`${string}Response`, unknown>, T> = Record<`${string}Response`, unknown>> = SoapBody<T> & {
145
+ Fault?: SoapFault[];
146
+ };
172
147
  export type NameSpace = ValueOf<typeof JSNS>;
@@ -44,6 +44,7 @@ export type ErrorSoapResponse = {
44
44
  Header: SoapHeader;
45
45
  };
46
46
  export type RawSoapResponse<R extends Record<string, unknown>> = RawSuccessSoapResponse<R> | RawErrorSoapResponse;
47
+ export declare function isRawErrorSoapResponse(item: RawSoapResponse<Record<string, unknown>>): item is RawErrorSoapResponse;
47
48
  export type SoapResponse<R> = SuccessSoapResponse<R> | ErrorSoapResponse;
48
49
  export type SoapRequest<R extends Record<string, unknown>> = {
49
50
  Body: Record<string, SoapBody<R>>;
@@ -5,4 +5,8 @@
5
5
  * SPDX-License-Identifier: AGPL-3.0-only
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.isRawErrorSoapResponse = isRawErrorSoapResponse;
9
+ function isRawErrorSoapResponse(item) {
10
+ return item.Body.Fault !== undefined;
11
+ }
8
12
  //# sourceMappingURL=soap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"soap.js","sourceRoot":"","sources":["../../../src/types/network/soap.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
1
+ {"version":3,"file":"soap.js","sourceRoot":"","sources":["../../../src/types/network/soap.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA6DH,wDAIC;AAJD,SAAgB,sBAAsB,CACrC,IAA8C;IAE9C,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC;AACtC,CAAC"}
@@ -6,7 +6,3 @@ export type Tag = {
6
6
  u?: number;
7
7
  n?: number;
8
8
  };
9
- export type Tags = Record<string, Tag>;
10
- export type TagState = {
11
- tags: Tags;
12
- };
@@ -0,0 +1,10 @@
1
+ import type { CSSProperties } from 'react';
2
+ declare module '@zextras/carbonio-design-system' {
3
+ interface Theme {
4
+ globalCursors: CSSProperties['cursor'][];
5
+ }
6
+ interface Palette {
7
+ shared: ThemeColorObj;
8
+ linked: ThemeColorObj;
9
+ }
10
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=items.js.map
3
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/types/theme.ts"],"names":[],"mappings":""}
@@ -20,13 +20,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
20
20
  }) : function(o, v) {
21
21
  o["default"] = v;
22
22
  });
23
- var __importStar = (this && this.__importStar) || function (mod) {
24
- if (mod && mod.__esModule) return mod;
25
- var result = {};
26
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
27
- __setModuleDefault(result, mod);
28
- return result;
29
- };
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
+ })();
30
40
  Object.defineProperty(exports, "__esModule", { value: true });
31
41
  exports.AppLink = void 0;
32
42
  const react_1 = __importStar(require("react"));
@@ -1 +1 @@
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"}
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"}
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from 'react';
2
+ export type AuthGuardProps = {
3
+ children: ReactNode;
4
+ };
5
+ export declare const AuthGuard: ({ children }: AuthGuardProps) => ReactNode;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AuthGuard = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const account_1 = require("../store/account");
9
+ const AuthGuard = ({ children }) => {
10
+ const isAuthenticated = (0, account_1.useAuthenticated)();
11
+ return isAuthenticated ? react_1.default.createElement(react_1.default.Fragment, null, children) : null;
12
+ };
13
+ exports.AuthGuard = AuthGuard;
14
+ //# sourceMappingURL=auth-guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-guard.js","sourceRoot":"","sources":["../../src/ui-extras/auth-guard.tsx"],"names":[],"mappings":";;;;;;AAMA,kDAA0B;AAE1B,8CAAoD;AAM7C,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAkB,EAAa,EAAE;IACpE,MAAM,eAAe,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAE3C,OAAO,eAAe,CAAC,CAAC,CAAC,8DAAG,QAAQ,CAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC,CAAC;AAJW,QAAA,SAAS,aAIpB"}
@@ -20,13 +20,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
20
20
  }) : function(o, v) {
21
21
  o["default"] = v;
22
22
  });
23
- var __importStar = (this && this.__importStar) || function (mod) {
24
- if (mod && mod.__esModule) return mod;
25
- var result = {};
26
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
27
- __setModuleDefault(result, mod);
28
- return result;
29
- };
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
+ })();
30
40
  Object.defineProperty(exports, "__esModule", { value: true });
31
41
  exports.RouteLeavingGuard = void 0;
32
42
  const react_1 = __importStar(require("react"));
@@ -1 +1 @@
1
- {"version":3,"file":"nav-guard.js","sourceRoot":"","sources":["../../src/ui-extras/nav-guard.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAsE;AAGtE,4EAAgE;AAEhE,mCAAgC;AAChC,uDAAsD;AAEtD,+CAA2C;AASpC,MAAM,iBAAiB,GAAG,CAAC,EACjC,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,YAAY,GAAG,KAAK,EACI,EAAqB,EAAE;IAC/C,MAAM,OAAO,GAAG,IAAA,6BAAU,GAAE,CAAC;IAC7B,MAAM,mBAAmB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACvE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IACxD,MAAM,eAAe,GAAG,IAAA,cAAM,EAAC,mBAAmB,CAAC,CAAC;IACpD,MAAM,sBAAsB,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,IAAA,YAAI,GAAE,CAAC;IACjB,MAAM,MAAM,GAAG,IAAA,mBAAW,EAAC,GAAS,EAAE;QACrC,eAAe,CAAC,KAAK,CAAC,CAAC;QACvB,sBAAsB,CAAC,OAAO,GAAG,KAAK,CAAC;IACxC,CAAC,EAAE,EAAE,CAAC,CAAC;I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CAAC,CAAC,oBAAoB,EAAE,cAAc,CAAC,EAErF,cAAc,EACb,CAAC,YAAY,CAAC,CAAC,CAAC,CACf,8BAAC,+BAAM,IACN,KAAK,EAAC,WAAW,EACjB,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC,EAClC,OAAO,EAAE,MAAM,GACd,CACF,CAAC,CAAC,CAAC,SAAS,IAGb,QAAQ,CACF,CACN,CACH,CAAC;AACH,CAAC,CAAC;AA1GW,QAAA,iBAAiB,qBA0G5B"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import type { DropdownItem } from '@zextras/carbonio-design-system';
3
+ import type { UtilityView } from '../types/apps';
4
+ import type { Action } from '../types/integrations';
5
+ export interface UtilityBarItemProps {
6
+ view: UtilityView;
7
+ }
8
+ /**
9
+ * Interface representing an account menu action.
10
+ *
11
+ * This interface extends the `Action` interface and omits the `label` and `onClick` properties
12
+ * from the `DropdownItem` interface. It includes an `execute` function and a `position` property.
13
+ *
14
+ */
15
+ export interface AccountMenuAction extends Action, Omit<DropdownItem, 'label' | 'onClick'> {
16
+ execute: NonNullable<DropdownItem['onClick']>;
17
+ position: number;
18
+ }
19
+ export declare const ShellUtilityBar: () => React.JSX.Element;
@@ -0,0 +1,129 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ShellUtilityBar = void 0;
37
+ /*
38
+ * SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com>
39
+ *
40
+ * SPDX-License-Identifier: AGPL-3.0-only
41
+ */
42
+ const react_1 = __importStar(require("react"));
43
+ const carbonio_design_system_1 = require("@zextras/carbonio-design-system");
44
+ const lodash_1 = require("lodash");
45
+ const store_1 = require("./store");
46
+ const utils_1 = require("./utils");
47
+ const constants_1 = require("../constants");
48
+ const logout_1 = require("../network/logout");
49
+ const account_1 = require("../store/account");
50
+ const hooks_1 = require("../store/i18n/hooks");
51
+ const hooks_2 = require("../store/integrations/hooks");
52
+ const tracker_1 = require("../tracker/tracker");
53
+ const UtilityBarItem = ({ view }) => {
54
+ const { mode, setMode, current, setCurrent } = (0, store_1.useUtilityBarStore)();
55
+ const onClick = (0, react_1.useCallback)(() => {
56
+ setMode((current !== view.id && 'open') || (mode !== 'open' && 'open') || 'closed');
57
+ setCurrent(view.id);
58
+ }, [current, mode, setCurrent, setMode, view.id]);
59
+ if (typeof view.button === 'string') {
60
+ return (react_1.default.createElement(carbonio_design_system_1.Tooltip, { label: view.label, placement: "bottom-end" },
61
+ react_1.default.createElement(carbonio_design_system_1.IconButton, { icon: view.button, iconColor: current === view.id ? 'primary' : 'text', onClick: onClick, size: "large" })));
62
+ }
63
+ return react_1.default.createElement(view.button, { mode: mode, setMode: setMode });
64
+ };
65
+ const ShellUtilityBar = () => {
66
+ const views = (0, utils_1.useUtilityViews)();
67
+ const t = (0, hooks_1.getT)();
68
+ const account = (0, account_1.useAccountStore)((s) => s.account);
69
+ const updateViews = (0, react_1.useCallback)(() => {
70
+ const updateViewEvent = new CustomEvent(constants_1.CUSTOM_EVENTS.updateView);
71
+ window.dispatchEvent(updateViewEvent);
72
+ }, []);
73
+ const { reset } = (0, tracker_1.useTracker)();
74
+ const actions = (0, hooks_2.useActions)(undefined, constants_1.ACTION_TYPES.ACCOUNT_MENU);
75
+ const accountMenuItems = (0, react_1.useMemo)(() => actions
76
+ .toSorted((a, b) => a.position - b.position)
77
+ .map(({ execute, position: _position, ...action }) => ({
78
+ onClick: execute,
79
+ ...action
80
+ })), [actions]);
81
+ const accountItems = (0, react_1.useMemo)(() => [
82
+ {
83
+ id: 'account',
84
+ label: account?.displayName ?? 'Account',
85
+ disabled: true
86
+ },
87
+ {
88
+ id: 'email',
89
+ label: account?.name ?? '',
90
+ disabled: true
91
+ },
92
+ {
93
+ type: 'divider',
94
+ id: 'divider',
95
+ label: 'divider'
96
+ },
97
+ {
98
+ id: 'update',
99
+ label: t('label.update_view', 'Update view'),
100
+ onClick: updateViews,
101
+ icon: 'Refresh'
102
+ },
103
+ ...accountMenuItems,
104
+ {
105
+ id: 'docs',
106
+ label: t('label.documentation', 'Documentation'),
107
+ onClick: lodash_1.noop,
108
+ disabled: true,
109
+ icon: 'InfoOutline'
110
+ },
111
+ {
112
+ id: 'logout',
113
+ label: t('label.logout', 'Logout'),
114
+ onClick: () => {
115
+ reset();
116
+ (0, logout_1.logout)();
117
+ },
118
+ icon: 'LogOut'
119
+ }
120
+ ], [account?.displayName, account?.name, accountMenuItems, reset, t, updateViews]);
121
+ const viewItems = (0, react_1.useMemo)(() => (0, lodash_1.map)(views, (view) => react_1.default.createElement(UtilityBarItem, { view: view, key: view.id })), [views]);
122
+ return (react_1.default.createElement(carbonio_design_system_1.Container, { orientation: "horizontal", width: "fit" },
123
+ viewItems,
124
+ react_1.default.createElement(carbonio_design_system_1.Tooltip, { label: account?.displayName ?? account?.name, placement: "bottom-end" },
125
+ react_1.default.createElement(carbonio_design_system_1.Dropdown, { items: accountItems, maxWidth: "18.75rem", disableAutoFocus: true },
126
+ react_1.default.createElement(carbonio_design_system_1.IconButton, { icon: "PersonOutline", size: "large", onClick: lodash_1.noop })))));
127
+ };
128
+ exports.ShellUtilityBar = ShellUtilityBar;
129
+ //# sourceMappingURL=bar.js.map