@lokalise/harmony 2.1.0-exp-testingContracts.1 → 2.1.0-exp-testingContracts.3

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 (345) hide show
  1. package/dist/harmony.cjs +0 -1
  2. package/dist/harmony.cjs.map +1 -1
  3. package/dist/harmony.mjs +1 -2
  4. package/dist/harmony103.cjs +1 -1
  5. package/dist/harmony103.mjs +1 -1
  6. package/dist/harmony104.cjs +7 -7
  7. package/dist/harmony104.mjs +7 -7
  8. package/dist/harmony106.cjs +2 -2
  9. package/dist/harmony106.mjs +2 -2
  10. package/dist/harmony107.cjs +2 -165
  11. package/dist/harmony107.cjs.map +1 -1
  12. package/dist/harmony107.mjs +3 -166
  13. package/dist/harmony107.mjs.map +1 -1
  14. package/dist/harmony108.cjs +16 -42
  15. package/dist/harmony108.cjs.map +1 -1
  16. package/dist/harmony108.mjs +16 -42
  17. package/dist/harmony108.mjs.map +1 -1
  18. package/dist/harmony109.cjs +75 -13
  19. package/dist/harmony109.cjs.map +1 -1
  20. package/dist/harmony109.mjs +75 -13
  21. package/dist/harmony109.mjs.map +1 -1
  22. package/dist/harmony110.cjs +10 -10
  23. package/dist/harmony110.cjs.map +1 -1
  24. package/dist/harmony110.mjs +10 -10
  25. package/dist/harmony110.mjs.map +1 -1
  26. package/dist/harmony111.cjs +35 -13
  27. package/dist/harmony111.cjs.map +1 -1
  28. package/dist/harmony111.mjs +34 -12
  29. package/dist/harmony111.mjs.map +1 -1
  30. package/dist/harmony112.cjs +8 -10
  31. package/dist/harmony112.cjs.map +1 -1
  32. package/dist/harmony112.mjs +9 -11
  33. package/dist/harmony112.mjs.map +1 -1
  34. package/dist/harmony113.cjs +47 -21
  35. package/dist/harmony113.cjs.map +1 -1
  36. package/dist/harmony113.mjs +46 -20
  37. package/dist/harmony113.mjs.map +1 -1
  38. package/dist/harmony114.cjs +10 -4
  39. package/dist/harmony114.cjs.map +1 -1
  40. package/dist/harmony114.mjs +9 -3
  41. package/dist/harmony114.mjs.map +1 -1
  42. package/dist/harmony115.cjs +13 -17
  43. package/dist/harmony115.cjs.map +1 -1
  44. package/dist/harmony115.mjs +13 -17
  45. package/dist/harmony115.mjs.map +1 -1
  46. package/dist/harmony116.cjs +161 -71
  47. package/dist/harmony116.cjs.map +1 -1
  48. package/dist/harmony116.mjs +161 -71
  49. package/dist/harmony116.mjs.map +1 -1
  50. package/dist/harmony117.cjs +42 -10
  51. package/dist/harmony117.cjs.map +1 -1
  52. package/dist/harmony117.mjs +43 -11
  53. package/dist/harmony117.mjs.map +1 -1
  54. package/dist/harmony118.cjs +12 -34
  55. package/dist/harmony118.cjs.map +1 -1
  56. package/dist/harmony118.mjs +12 -34
  57. package/dist/harmony118.mjs.map +1 -1
  58. package/dist/harmony119.cjs +13 -10
  59. package/dist/harmony119.cjs.map +1 -1
  60. package/dist/harmony119.mjs +12 -9
  61. package/dist/harmony119.mjs.map +1 -1
  62. package/dist/harmony120.cjs +9 -45
  63. package/dist/harmony120.cjs.map +1 -1
  64. package/dist/harmony120.mjs +11 -47
  65. package/dist/harmony120.mjs.map +1 -1
  66. package/dist/harmony121.cjs +20 -8
  67. package/dist/harmony121.cjs.map +1 -1
  68. package/dist/harmony121.mjs +20 -8
  69. package/dist/harmony121.mjs.map +1 -1
  70. package/dist/harmony123.cjs +87 -7
  71. package/dist/harmony123.cjs.map +1 -1
  72. package/dist/harmony123.mjs +87 -7
  73. package/dist/harmony123.mjs.map +1 -1
  74. package/dist/harmony124.cjs +30 -17
  75. package/dist/harmony124.cjs.map +1 -1
  76. package/dist/harmony124.mjs +30 -17
  77. package/dist/harmony124.mjs.map +1 -1
  78. package/dist/harmony125.cjs +20 -8
  79. package/dist/harmony125.cjs.map +1 -1
  80. package/dist/harmony125.mjs +20 -8
  81. package/dist/harmony125.mjs.map +1 -1
  82. package/dist/harmony126.cjs +7 -8
  83. package/dist/harmony126.cjs.map +1 -1
  84. package/dist/harmony126.mjs +7 -8
  85. package/dist/harmony126.mjs.map +1 -1
  86. package/dist/harmony127.cjs +16 -14
  87. package/dist/harmony127.cjs.map +1 -1
  88. package/dist/harmony127.mjs +16 -14
  89. package/dist/harmony127.mjs.map +1 -1
  90. package/dist/harmony128.cjs +8 -20
  91. package/dist/harmony128.cjs.map +1 -1
  92. package/dist/harmony128.mjs +8 -20
  93. package/dist/harmony128.mjs.map +1 -1
  94. package/dist/harmony129.cjs +7 -86
  95. package/dist/harmony129.cjs.map +1 -1
  96. package/dist/harmony129.mjs +7 -86
  97. package/dist/harmony129.mjs.map +1 -1
  98. package/dist/harmony130.cjs +15 -30
  99. package/dist/harmony130.cjs.map +1 -1
  100. package/dist/harmony130.mjs +15 -30
  101. package/dist/harmony130.mjs.map +1 -1
  102. package/dist/harmony132.cjs +2 -2
  103. package/dist/harmony132.mjs +2 -2
  104. package/dist/harmony133.cjs +2 -2
  105. package/dist/harmony133.mjs +2 -2
  106. package/dist/harmony134.cjs +3 -3
  107. package/dist/harmony134.mjs +3 -3
  108. package/dist/harmony135.cjs +1 -1
  109. package/dist/harmony135.mjs +1 -1
  110. package/dist/harmony136.cjs +3 -3
  111. package/dist/harmony136.mjs +3 -3
  112. package/dist/harmony137.cjs +2 -2
  113. package/dist/harmony137.mjs +2 -2
  114. package/dist/harmony138.cjs +2 -2
  115. package/dist/harmony138.mjs +2 -2
  116. package/dist/harmony139.cjs +2 -2
  117. package/dist/harmony139.mjs +2 -2
  118. package/dist/harmony140.cjs +2 -2
  119. package/dist/harmony140.mjs +2 -2
  120. package/dist/harmony141.cjs +3 -3
  121. package/dist/harmony141.mjs +3 -3
  122. package/dist/harmony143.cjs +1 -1
  123. package/dist/harmony143.mjs +1 -1
  124. package/dist/harmony148.cjs +10 -3
  125. package/dist/harmony148.cjs.map +1 -1
  126. package/dist/harmony148.mjs +10 -3
  127. package/dist/harmony148.mjs.map +1 -1
  128. package/dist/harmony149.cjs +3 -3
  129. package/dist/harmony149.cjs.map +1 -1
  130. package/dist/harmony149.mjs +3 -3
  131. package/dist/harmony149.mjs.map +1 -1
  132. package/dist/harmony150.cjs +3 -3
  133. package/dist/harmony150.cjs.map +1 -1
  134. package/dist/harmony150.mjs +3 -3
  135. package/dist/harmony150.mjs.map +1 -1
  136. package/dist/harmony151.cjs +3 -14
  137. package/dist/harmony151.cjs.map +1 -1
  138. package/dist/harmony151.mjs +3 -14
  139. package/dist/harmony151.mjs.map +1 -1
  140. package/dist/harmony152.cjs +7 -7
  141. package/dist/harmony152.cjs.map +1 -1
  142. package/dist/harmony152.mjs +7 -7
  143. package/dist/harmony152.mjs.map +1 -1
  144. package/dist/harmony153.cjs +14 -3
  145. package/dist/harmony153.cjs.map +1 -1
  146. package/dist/harmony153.mjs +14 -3
  147. package/dist/harmony153.mjs.map +1 -1
  148. package/dist/harmony154.cjs +3 -10
  149. package/dist/harmony154.cjs.map +1 -1
  150. package/dist/harmony154.mjs +3 -10
  151. package/dist/harmony154.mjs.map +1 -1
  152. package/dist/harmony160.cjs +9 -32
  153. package/dist/harmony160.cjs.map +1 -1
  154. package/dist/harmony160.mjs +8 -31
  155. package/dist/harmony160.mjs.map +1 -1
  156. package/dist/harmony161.cjs +3 -6
  157. package/dist/harmony161.cjs.map +1 -1
  158. package/dist/harmony161.mjs +3 -6
  159. package/dist/harmony161.mjs.map +1 -1
  160. package/dist/harmony162.cjs +6 -3
  161. package/dist/harmony162.cjs.map +1 -1
  162. package/dist/harmony162.mjs +6 -3
  163. package/dist/harmony162.mjs.map +1 -1
  164. package/dist/harmony163.cjs +21 -6
  165. package/dist/harmony163.cjs.map +1 -1
  166. package/dist/harmony163.mjs +21 -6
  167. package/dist/harmony163.mjs.map +1 -1
  168. package/dist/harmony164.cjs +3 -21
  169. package/dist/harmony164.cjs.map +1 -1
  170. package/dist/harmony164.mjs +3 -21
  171. package/dist/harmony164.mjs.map +1 -1
  172. package/dist/harmony165.cjs +9 -3
  173. package/dist/harmony165.cjs.map +1 -1
  174. package/dist/harmony165.mjs +9 -3
  175. package/dist/harmony165.mjs.map +1 -1
  176. package/dist/harmony166.cjs +3 -9
  177. package/dist/harmony166.cjs.map +1 -1
  178. package/dist/harmony166.mjs +3 -9
  179. package/dist/harmony166.mjs.map +1 -1
  180. package/dist/harmony167.cjs +32 -6
  181. package/dist/harmony167.cjs.map +1 -1
  182. package/dist/harmony167.mjs +31 -5
  183. package/dist/harmony167.mjs.map +1 -1
  184. package/dist/harmony168.cjs +1 -1
  185. package/dist/harmony168.mjs +1 -1
  186. package/dist/harmony169.cjs +1 -1
  187. package/dist/harmony169.mjs +1 -1
  188. package/dist/harmony17.cjs +1 -1
  189. package/dist/harmony17.mjs +1 -1
  190. package/dist/harmony170.cjs +2 -2
  191. package/dist/harmony170.mjs +2 -2
  192. package/dist/harmony171.cjs +11 -4
  193. package/dist/harmony171.cjs.map +1 -1
  194. package/dist/harmony171.mjs +11 -4
  195. package/dist/harmony171.mjs.map +1 -1
  196. package/dist/harmony172.cjs +15 -10
  197. package/dist/harmony172.cjs.map +1 -1
  198. package/dist/harmony172.mjs +15 -10
  199. package/dist/harmony172.mjs.map +1 -1
  200. package/dist/harmony173.cjs +18 -13
  201. package/dist/harmony173.cjs.map +1 -1
  202. package/dist/harmony173.mjs +18 -13
  203. package/dist/harmony173.mjs.map +1 -1
  204. package/dist/harmony174.cjs +10 -19
  205. package/dist/harmony174.cjs.map +1 -1
  206. package/dist/harmony174.mjs +10 -19
  207. package/dist/harmony174.mjs.map +1 -1
  208. package/dist/harmony175.cjs +4 -12
  209. package/dist/harmony175.cjs.map +1 -1
  210. package/dist/harmony175.mjs +4 -12
  211. package/dist/harmony175.mjs.map +1 -1
  212. package/dist/harmony20.cjs +1 -1
  213. package/dist/harmony20.mjs +1 -1
  214. package/dist/harmony28.cjs +1 -1
  215. package/dist/harmony28.mjs +1 -1
  216. package/dist/harmony29.cjs +1 -1
  217. package/dist/harmony29.mjs +1 -1
  218. package/dist/harmony32.cjs +1 -1
  219. package/dist/harmony32.mjs +1 -1
  220. package/dist/harmony33.cjs +1 -1
  221. package/dist/harmony33.mjs +1 -1
  222. package/dist/harmony34.cjs +1 -1
  223. package/dist/harmony34.mjs +1 -1
  224. package/dist/harmony39.cjs +1 -1
  225. package/dist/harmony39.mjs +1 -1
  226. package/dist/harmony40.cjs +1 -1
  227. package/dist/harmony40.mjs +1 -1
  228. package/dist/harmony41.cjs +1 -1
  229. package/dist/harmony41.mjs +1 -1
  230. package/dist/harmony42.cjs +2 -2
  231. package/dist/harmony42.mjs +2 -2
  232. package/dist/harmony43.cjs +2 -2
  233. package/dist/harmony43.mjs +2 -2
  234. package/dist/harmony44.cjs +1 -1
  235. package/dist/harmony44.mjs +1 -1
  236. package/dist/harmony53.cjs +3 -3
  237. package/dist/harmony53.cjs.map +1 -1
  238. package/dist/harmony53.mjs +1 -1
  239. package/dist/harmony53.mjs.map +1 -1
  240. package/dist/harmony78.cjs +74 -74
  241. package/dist/harmony78.cjs.map +1 -1
  242. package/dist/harmony78.mjs +1 -1
  243. package/dist/harmony78.mjs.map +1 -1
  244. package/dist/harmony79.cjs +52 -52
  245. package/dist/harmony79.cjs.map +1 -1
  246. package/dist/harmony79.mjs +1 -1
  247. package/dist/harmony79.mjs.map +1 -1
  248. package/dist/harmony80.cjs +4 -4
  249. package/dist/harmony80.cjs.map +1 -1
  250. package/dist/harmony80.mjs +1 -1
  251. package/dist/harmony80.mjs.map +1 -1
  252. package/dist/harmony81.cjs +18 -18
  253. package/dist/harmony81.cjs.map +1 -1
  254. package/dist/harmony81.mjs +1 -1
  255. package/dist/harmony81.mjs.map +1 -1
  256. package/dist/harmony82.cjs +15 -15
  257. package/dist/harmony82.cjs.map +1 -1
  258. package/dist/harmony82.mjs +1 -1
  259. package/dist/harmony82.mjs.map +1 -1
  260. package/dist/harmony83.cjs +96 -96
  261. package/dist/harmony83.cjs.map +1 -1
  262. package/dist/harmony83.mjs +1 -1
  263. package/dist/harmony83.mjs.map +1 -1
  264. package/dist/harmony84.cjs +24 -24
  265. package/dist/harmony84.cjs.map +1 -1
  266. package/dist/harmony84.mjs +1 -1
  267. package/dist/harmony84.mjs.map +1 -1
  268. package/dist/harmony85.cjs +14 -14
  269. package/dist/harmony85.cjs.map +1 -1
  270. package/dist/harmony85.mjs +1 -1
  271. package/dist/harmony85.mjs.map +1 -1
  272. package/dist/harmony86.cjs +2 -2
  273. package/dist/harmony86.cjs.map +1 -1
  274. package/dist/harmony86.mjs +1 -1
  275. package/dist/harmony86.mjs.map +1 -1
  276. package/dist/harmony87.cjs +40 -40
  277. package/dist/harmony87.cjs.map +1 -1
  278. package/dist/harmony87.mjs +1 -1
  279. package/dist/harmony87.mjs.map +1 -1
  280. package/dist/harmony88.cjs +27 -27
  281. package/dist/harmony88.cjs.map +1 -1
  282. package/dist/harmony88.mjs +1 -1
  283. package/dist/harmony88.mjs.map +1 -1
  284. package/dist/harmony89.cjs +10 -10
  285. package/dist/harmony89.cjs.map +1 -1
  286. package/dist/harmony89.mjs +1 -1
  287. package/dist/harmony89.mjs.map +1 -1
  288. package/dist/harmony90.cjs +1 -3
  289. package/dist/harmony90.cjs.map +1 -1
  290. package/dist/harmony90.mjs +2 -4
  291. package/dist/harmony90.mjs.map +1 -1
  292. package/dist/harmony97.cjs +2 -2
  293. package/dist/harmony97.mjs +2 -2
  294. package/dist/harmony99.cjs +2 -2
  295. package/dist/harmony99.mjs +2 -2
  296. package/dist/types/src/features/auth/core/types/jwtTokenPayload.d.ts +8 -35
  297. package/dist/types/src/features/auth/core/types/jwtTokenPayload.fixture.d.ts +1 -1
  298. package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedProjectContributor.d.ts +4 -4
  299. package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedUser.d.ts +3 -3
  300. package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts +1 -1
  301. package/dist/types/src/features/auth/frontend/services/generateTokenFromClassicSession.d.ts +4 -1
  302. package/dist/types/src/features/auth/frontend/services/refreshExpiredToken.d.ts +4 -1
  303. package/dist/types/src/features/navigation/hooks/useNavigationQueries.d.ts +56 -56
  304. package/dist/types/src/features/publicApi/TESTING_CONTRACTS.d.ts +57 -2
  305. package/dist/types/src/features/publicApi/contributors.d.ts +260 -5
  306. package/dist/types/src/features/publicApi/hooks/useAddContributorsMutation.d.ts +7 -7
  307. package/dist/types/src/features/publicApi/hooks/useAddLanguagesToProjectMutation.d.ts +2 -2
  308. package/dist/types/src/features/publicApi/hooks/useCreateProjectMutation.d.ts +14 -14
  309. package/dist/types/src/features/publicApi/hooks/useCreateScoreMutation.d.ts +3 -3
  310. package/dist/types/src/features/publicApi/hooks/useGetProjectPermissionMetaQuery.d.ts +1 -1
  311. package/dist/types/src/features/publicApi/hooks/useGetScoreQuery.d.ts +1 -1
  312. package/dist/types/src/features/publicApi/hooks/useGetTeamUsersQuery.d.ts +1 -1
  313. package/dist/types/src/features/publicApi/hooks/useGetUserTokenQuery.d.ts +1 -1
  314. package/dist/types/src/features/publicApi/hooks/useListContributorsQuery.d.ts +1 -1
  315. package/dist/types/src/features/publicApi/hooks/useListPermissionTemplates.d.ts +1 -1
  316. package/dist/types/src/features/publicApi/hooks/useListProjectLanguagesQuery.d.ts +1 -1
  317. package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +2 -2
  318. package/dist/types/src/features/publicApi/hooks/useListTeamUsersQuery.d.ts +1 -1
  319. package/dist/types/src/features/publicApi/hooks/useListTeamsQuery.d.ts +2 -2
  320. package/dist/types/src/features/publicApi/hooks/useRetrieveContributorQuery.d.ts +3 -3
  321. package/dist/types/src/features/publicApi/hooks/useRetrieveProjectQuery.d.ts +1 -1
  322. package/dist/types/src/features/publicApi/hooks/useRetrieveTeamQuery.d.ts +1 -1
  323. package/dist/types/src/features/publicApi/hooks/useRetrieveUserPermissions.d.ts +2 -2
  324. package/dist/types/src/features/publicApi/hooks/useUpdateContributorMutation.d.ts +5 -5
  325. package/dist/types/src/features/publicApi/hooks/useUpdateProjectMutation.d.ts +13 -13
  326. package/dist/types/src/features/publicApi/languages.d.ts +106 -3
  327. package/dist/types/src/features/publicApi/permissionTemplates.d.ts +54 -1
  328. package/dist/types/src/features/publicApi/projects.d.ts +520 -6
  329. package/dist/types/src/features/publicApi/score.d.ts +102 -3
  330. package/dist/types/src/features/publicApi/team.d.ts +102 -2
  331. package/dist/types/src/features/publicApi/teamUsers.d.ts +125 -3
  332. package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +84 -834
  333. package/dist/types/src/features/publicApi/types/languageTypes.d.ts +22 -212
  334. package/dist/types/src/features/publicApi/types/paginationTypes.d.ts +2 -8
  335. package/dist/types/src/features/publicApi/types/permissionTemplateTypes.d.ts +71 -76
  336. package/dist/types/src/features/publicApi/types/permissionTypes.d.ts +48 -24
  337. package/dist/types/src/features/publicApi/types/projectTypes.d.ts +211 -1097
  338. package/dist/types/src/features/publicApi/types/scoreTypes.d.ts +32 -96
  339. package/dist/types/src/features/publicApi/types/sharedTypes.d.ts +30 -126
  340. package/dist/types/src/features/publicApi/types/teamRoleTypes.d.ts +7 -2
  341. package/dist/types/src/features/publicApi/types/teamTypes.d.ts +65 -328
  342. package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +91 -208
  343. package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +9 -39
  344. package/dist/types/src/features/publicApi/userToken.d.ts +19 -1
  345. package/package.json +4 -4
@@ -1,79 +1,169 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { BillingMenuItem } from "./harmony132.mjs";
3
- import { CreateNewTeam } from "./harmony133.mjs";
4
- import { CreateNewTeamPlaceholder } from "./harmony134.mjs";
5
- import { DarkModeToggle } from "./harmony135.mjs";
6
- import { ProfileSettingsMenuItem } from "./harmony136.mjs";
7
- import { ProviderMenuItem } from "./harmony137.mjs";
8
- import { TeamMenuItem } from "./harmony138.mjs";
9
- import { TeamSettingsMenuItem } from "./harmony139.mjs";
10
- import { TeamSwitch } from "./harmony140.mjs";
11
- import { UpgradeMenuItem } from "./harmony141.mjs";
12
- import { useSidebar } from "./harmony117.mjs";
13
- import { Menu, MenuList, MenuDivider, MenuItem, UserIcon } from "@lokalise/louis";
14
- import { canAccessProfileSettings, canUpgradePlan } from "./harmony118.mjs";
15
- import { clsx } from "./harmony93.mjs";
16
- import styles from "./harmony142.mjs";
17
- import { UpgradeIcon } from "./harmony143.mjs";
18
- const ProfileMenu = ({ config }) => {
19
- const {
20
- jwt,
21
- data: { currentTeam }
22
- } = useSidebar();
23
- const {
24
- darkModeToggle,
25
- teamSwitch,
26
- createTeam,
27
- createTeamPlaceholder,
28
- upgradeMenuItem,
29
- profileSettings
30
- } = config;
31
- return /* @__PURE__ */ jsx(
32
- Menu,
33
- {
34
- menuButton: () => {
35
- var _a;
36
- return /* @__PURE__ */ jsxs("button", { className: styles.profileButton, "aria-label": "Profile menu", type: "button", children: [
37
- ((_a = currentTeam.result) == null ? void 0 : _a.logoUrl) ? /* @__PURE__ */ jsx(
38
- "img",
1
+ import { useMemo } from "react";
2
+ import { useNavigationClient } from "./harmony16.mjs";
3
+ import { getProjectNavigationVisibilityMap } from "./harmony123.mjs";
4
+ const useExpertNavigation = (enabled, project, contributor) => {
5
+ const adminRights = (contributor == null ? void 0 : contributor.admin_rights) || [];
6
+ const marketingSupportProjectSelectedAppSlug = "selected-app-slug";
7
+ const navigationClient = useNavigationClient();
8
+ const expertUrl = navigationClient.getExpertUrl();
9
+ return useMemo(() => {
10
+ if (!project || !enabled) {
11
+ return [];
12
+ }
13
+ const navigationVisibility = getProjectNavigationVisibilityMap(
14
+ project,
15
+ adminRights,
16
+ () => true
17
+ );
18
+ const appsNavigationItem = {
19
+ key: "apps",
20
+ label: "Apps",
21
+ isActive: (input) => input === "apps",
22
+ link: `${expertUrl}/apps/${project.project_id}/`,
23
+ ...navigationVisibility.apps
24
+ };
25
+ const appsNavigationItemArrInMainMenu = [];
26
+ const appsNavigationItemArrInMoreMenu = [];
27
+ if (project.project_type === "content_integration") {
28
+ appsNavigationItemArrInMoreMenu.push(appsNavigationItem);
29
+ } else {
30
+ appsNavigationItemArrInMainMenu.push(appsNavigationItem);
31
+ }
32
+ return [
33
+ {
34
+ key: "edit",
35
+ label: "Editor",
36
+ link: `${expertUrl}/project/${project.project_id}/`,
37
+ isActive: (input) => input === "edit",
38
+ ...navigationVisibility.editor
39
+ },
40
+ {
41
+ key: "files",
42
+ label: "Files",
43
+ link: `${expertUrl}/files/${project.project_id}/`,
44
+ isActive: (input) => input === "files",
45
+ ...navigationVisibility.files
46
+ },
47
+ ...project.project_type === "content_integration" ? [
48
+ {
49
+ key: "contentManagement",
50
+ label: "Content management",
51
+ isActive: (input) => input === "apps",
52
+ link: `${expertUrl}/apps/${project.project_id}/${marketingSupportProjectSelectedAppSlug}`,
53
+ ...navigationVisibility.contentManagement
54
+ }
55
+ ] : [
56
+ {
57
+ key: "upload",
58
+ label: "Upload",
59
+ link: `${expertUrl}/upload/${project.project_id}/`,
60
+ isActive: (input) => input === "upload",
61
+ ...navigationVisibility.upload
62
+ },
63
+ {
64
+ key: "download",
65
+ label: "Download",
66
+ link: `${expertUrl}/download/${project.project_id}/`,
67
+ isActive: (input) => input === "download",
68
+ ...navigationVisibility.download
69
+ }
70
+ ],
71
+ {
72
+ key: "tasks",
73
+ label: "Tasks",
74
+ link: `${expertUrl}/tasks/${project.project_id}/`,
75
+ isActive: (input) => input === "tasks",
76
+ // TODO: Add task count
77
+ // badge: taskCount,
78
+ ...navigationVisibility.tasks
79
+ },
80
+ {
81
+ key: "workflows",
82
+ label: "Workflows",
83
+ link: `${expertUrl}/workflows/${project.project_id}/`,
84
+ isActive: (input) => input === "workflows",
85
+ novel: "New",
86
+ onClick: () => {
87
+ window.location.assign(`${expertUrl}/workflows/${project.project_id}/`);
88
+ },
89
+ ...navigationVisibility.workflows
90
+ },
91
+ {
92
+ key: "contributors",
93
+ label: "Contributors",
94
+ link: `${expertUrl}/contributors/${project.project_id}/`,
95
+ isActive: (input) => input === "contributors",
96
+ ...navigationVisibility.contributors
97
+ },
98
+ {
99
+ key: "screenshots",
100
+ label: "Screenshots",
101
+ link: `${expertUrl}/screenshots/${project.project_id}/`,
102
+ isActive: (input) => input === "screenshots",
103
+ ...navigationVisibility.screenshots
104
+ },
105
+ {
106
+ key: "glossary",
107
+ label: "Glossary",
108
+ link: `${expertUrl}/glossary/${project.project_id}/`,
109
+ isActive: (input) => input === "glossary",
110
+ ...navigationVisibility.glossary
111
+ },
112
+ ...appsNavigationItemArrInMainMenu,
113
+ {
114
+ key: "more",
115
+ label: "More...",
116
+ isActive: (input) => ["settings", "statistics", "duplicates", "live edit"].includes(input),
117
+ ...navigationVisibility.more,
118
+ dropdown: [
119
+ [
120
+ {
121
+ link: `${expertUrl}/settings/${project.project_id}/`,
122
+ label: "Settings",
123
+ ...navigationVisibility.settings
124
+ },
125
+ {
126
+ link: `${expertUrl}/settings/${project.project_id}/#branches`,
127
+ label: "Branches",
128
+ ...navigationVisibility.branches
129
+ },
130
+ {
131
+ link: `${expertUrl}/settings/${project.project_id}/#ota-bundles`,
132
+ label: "OTA Bundles",
133
+ ...navigationVisibility.otaBundles
134
+ },
39
135
  {
40
- src: currentTeam.result.logoUrl,
41
- className: clsx(styles.profileImage, {
42
- [styles.profileImageHighlight]: canUpgradePlan(jwt)
43
- }),
44
- alt: "Team Logo"
136
+ link: `${expertUrl}/settings/${project.project_id}/#project-automations`,
137
+ label: "Automations",
138
+ ...navigationVisibility.automations
139
+ },
140
+ {
141
+ link: `${expertUrl}/dupes/${project.project_id}/`,
142
+ label: "Duplicate finder",
143
+ ...navigationVisibility.duplicateFinder
45
144
  }
46
- ) : /* @__PURE__ */ jsx(
47
- "div",
145
+ ],
146
+ [
147
+ ...appsNavigationItemArrInMoreMenu,
148
+ {
149
+ // TODO: This could be problematic tab, because it is not a link and we can't just redirect. We need to find a workaround for that.
150
+ label: "Activity",
151
+ onClick: () => {
152
+ },
153
+ ...navigationVisibility.activity
154
+ },
48
155
  {
49
- className: clsx(styles.userIconWrapper, "flex-row", "align-center", "items-center", {
50
- [styles.profileImageHighlight]: canUpgradePlan(jwt)
51
- }),
52
- children: /* @__PURE__ */ jsx(UserIcon, { size: "25px" })
156
+ link: `${expertUrl}/statistics/${project.project_id}/`,
157
+ label: "Statistics",
158
+ ...navigationVisibility.statistics
53
159
  }
54
- ),
55
- canUpgradePlan(jwt) && /* @__PURE__ */ jsx(UpgradeIcon, { className: styles.profileImageUpgradeIcon })
56
- ] });
57
- },
58
- children: /* @__PURE__ */ jsxs(MenuList, { placement: "right-end", className: styles.menuContainer, children: [
59
- teamSwitch && /* @__PURE__ */ jsx(TeamSwitch, { onSwitchTeam: teamSwitch.onSwitchTeam }),
60
- createTeam && /* @__PURE__ */ jsx(CreateNewTeam, { onCreateTeam: createTeam.onCreateTeam }),
61
- createTeamPlaceholder && /* @__PURE__ */ jsx(CreateNewTeamPlaceholder, { onClick: createTeamPlaceholder.onClick }),
62
- /* @__PURE__ */ jsx(TeamMenuItem, {}),
63
- upgradeMenuItem && /* @__PURE__ */ jsx(UpgradeMenuItem, { href: upgradeMenuItem.href }),
64
- /* @__PURE__ */ jsx(BillingMenuItem, {}),
65
- /* @__PURE__ */ jsx(TeamSettingsMenuItem, {}),
66
- /* @__PURE__ */ jsx(ProviderMenuItem, {}),
67
- /* @__PURE__ */ jsx(MenuDivider, {}),
68
- /* @__PURE__ */ jsx(ProfileSettingsMenuItem, { ...profileSettings ?? {} }),
69
- darkModeToggle && /* @__PURE__ */ jsx(DarkModeToggle, { ...darkModeToggle }),
70
- (canAccessProfileSettings(jwt) || darkModeToggle) && /* @__PURE__ */ jsx(MenuDivider, {}),
71
- /* @__PURE__ */ jsx(MenuItem, { href: "/login?action=logout", children: "Logout" })
72
- ] })
73
- }
74
- );
160
+ ]
161
+ ]
162
+ }
163
+ ];
164
+ }, [project, adminRights, enabled, expertUrl]);
75
165
  };
76
166
  export {
77
- ProfileMenu
167
+ useExpertNavigation
78
168
  };
79
169
  //# sourceMappingURL=harmony116.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony116.mjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenu.tsx"],"sourcesContent":["import { BillingMenuItem } from '@components/Sidebar/Widgets/ProfileMenu/BillingMenuItem/BillingMenuItem'\nimport { CreateNewTeam } from '@components/Sidebar/Widgets/ProfileMenu/CreateNewTeam/CreateNewTeam'\nimport { CreateNewTeamPlaceholder } from '@components/Sidebar/Widgets/ProfileMenu/CreateNewTeamPlaceholder/CreateNewTeamPlaceholder'\nimport { DarkModeToggle } from '@components/Sidebar/Widgets/ProfileMenu/DarkModeToggle/DarkModeToggle'\nimport { ProfileSettingsMenuItem } from '@components/Sidebar/Widgets/ProfileMenu/ProfileSettingsMenuItem/ProfileSettingsMenuItem'\nimport { ProviderMenuItem } from '@components/Sidebar/Widgets/ProfileMenu/ProviderMenuItem/ProviderMenuItem'\nimport { TeamMenuItem } from '@components/Sidebar/Widgets/ProfileMenu/TeamMenuItem/TeamMenuItem'\nimport { TeamSettingsMenuItem } from '@components/Sidebar/Widgets/ProfileMenu/TeamSettingsMenuItem/TeamSettingsMenuItem'\nimport { TeamSwitch } from '@components/Sidebar/Widgets/ProfileMenu/TeamSwitch/TeamSwitch'\nimport { UpgradeMenuItem } from '@components/Sidebar/Widgets/ProfileMenu/UpgradeMenuItem/UpgradeMenuItem'\nimport { useSidebar } from '@components/Sidebar/hooks/useSidebar'\nimport type { ProfileMenuConfig } from '@components/Sidebar/types'\nimport { Menu, MenuDivider, MenuItem, MenuList, UserIcon } from '@lokalise/louis'\nimport { canAccessProfileSettings, canUpgradePlan } from '@utils/user/permissions'\nimport clsx from 'clsx'\nimport styles from './ProfileMenu.module.css'\nimport { UpgradeIcon } from './UpgradeIcon/UpgradeIcon'\n\n/**\n * The main profile menu component, displaying team and user actions.\n * Renders optional menu items based on the provided config and user permissions.\n *\n * @example\n * ```\n * <ProfileMenu config={...} />\n * ```\n *\n * @note This component must be used within a Sidebar Context.\n */\n\ntype ProfileMenuProps = {\n\tconfig: ProfileMenuConfig\n}\n\nexport const ProfileMenu = ({ config }: ProfileMenuProps) => {\n\tconst {\n\t\tjwt,\n\t\tdata: { currentTeam },\n\t} = useSidebar()\n\n\tconst {\n\t\tdarkModeToggle,\n\t\tteamSwitch,\n\t\tcreateTeam,\n\t\tcreateTeamPlaceholder,\n\t\tupgradeMenuItem,\n\t\tprofileSettings,\n\t} = config\n\n\treturn (\n\t\t<Menu\n\t\t\tmenuButton={() => (\n\t\t\t\t<button className={styles.profileButton} aria-label=\"Profile menu\" type=\"button\">\n\t\t\t\t\t{currentTeam.result?.logoUrl ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={currentTeam.result.logoUrl}\n\t\t\t\t\t\t\tclassName={clsx(styles.profileImage, {\n\t\t\t\t\t\t\t\t[styles.profileImageHighlight]: canUpgradePlan(jwt),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\talt=\"Team Logo\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={clsx(styles.userIconWrapper, 'flex-row', 'align-center', 'items-center', {\n\t\t\t\t\t\t\t\t[styles.profileImageHighlight]: canUpgradePlan(jwt),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<UserIcon size=\"25px\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t{canUpgradePlan(jwt) && <UpgradeIcon className={styles.profileImageUpgradeIcon} />}\n\t\t\t\t</button>\n\t\t\t)}\n\t\t>\n\t\t\t<MenuList placement=\"right-end\" className={styles.menuContainer}>\n\t\t\t\t{teamSwitch && <TeamSwitch onSwitchTeam={teamSwitch.onSwitchTeam} />}\n\t\t\t\t{createTeam && <CreateNewTeam onCreateTeam={createTeam.onCreateTeam} />}\n\t\t\t\t{createTeamPlaceholder && (\n\t\t\t\t\t<CreateNewTeamPlaceholder onClick={createTeamPlaceholder.onClick} />\n\t\t\t\t)}\n\t\t\t\t<TeamMenuItem />\n\t\t\t\t{upgradeMenuItem && <UpgradeMenuItem href={upgradeMenuItem.href} />}\n\t\t\t\t<BillingMenuItem />\n\t\t\t\t<TeamSettingsMenuItem />\n\t\t\t\t<ProviderMenuItem />\n\t\t\t\t<MenuDivider />\n\n\t\t\t\t<ProfileSettingsMenuItem {...(profileSettings ?? {})} />\n\t\t\t\t{darkModeToggle && <DarkModeToggle {...darkModeToggle} />}\n\t\t\t\t{(canAccessProfileSettings(jwt) || darkModeToggle) && <MenuDivider />}\n\n\t\t\t\t<MenuItem href=\"/login?action=logout\">Logout</MenuItem>\n\t\t\t</MenuList>\n\t\t</Menu>\n\t)\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAkCO,MAAM,cAAc,CAAC,EAAE,aAA+B;AACtD,QAAA;AAAA,IACL;AAAA,IACA,MAAM,EAAE,YAAY;AAAA,MACjB,WAAW;AAET,QAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACG;AAGH,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,YAAY,MACX;;AAAA,oCAAC,UAAO,EAAA,WAAW,OAAO,eAAe,cAAW,gBAAe,MAAK,UACtE,UAAA;AAAA,YAAA,iBAAY,WAAZ,mBAAoB,WACpB;AAAA,YAAC;AAAA,YAAA;AAAA,cACA,KAAK,YAAY,OAAO;AAAA,cACxB,WAAW,KAAK,OAAO,cAAc;AAAA,gBACpC,CAAC,OAAO,qBAAqB,GAAG,eAAe,GAAG;AAAA,cAAA,CAClD;AAAA,cACD,KAAI;AAAA,YAAA;AAAA,UAAA,IAGL;AAAA,YAAC;AAAA,YAAA;AAAA,cACA,WAAW,KAAK,OAAO,iBAAiB,YAAY,gBAAgB,gBAAgB;AAAA,gBACnF,CAAC,OAAO,qBAAqB,GAAG,eAAe,GAAG;AAAA,cAAA,CAClD;AAAA,cAED,UAAA,oBAAC,UAAS,EAAA,MAAK,OAAO,CAAA;AAAA,YAAA;AAAA,UACvB;AAAA,UAEA,eAAe,GAAG,yBAAM,aAAY,EAAA,WAAW,OAAO,wBAAyB,CAAA;AAAA,QAAA,GACjF;AAAA;AAAA,MAGD,+BAAC,UAAS,EAAA,WAAU,aAAY,WAAW,OAAO,eAChD,UAAA;AAAA,QAAA,cAAe,oBAAA,YAAA,EAAW,cAAc,WAAW,cAAc;AAAA,QACjE,cAAc,oBAAC,eAAc,EAAA,cAAc,WAAW,cAAc;AAAA,QACpE,yBACA,oBAAC,0BAAyB,EAAA,SAAS,sBAAsB,SAAS;AAAA,4BAElE,cAAa,EAAA;AAAA,QACb,mBAAmB,oBAAC,iBAAgB,EAAA,MAAM,gBAAgB,MAAM;AAAA,4BAChE,iBAAgB,EAAA;AAAA,4BAChB,sBAAqB,EAAA;AAAA,4BACrB,kBAAiB,EAAA;AAAA,4BACjB,aAAY,EAAA;AAAA,QAEZ,oBAAA,yBAAA,EAAyB,GAAI,mBAAmB,CAAK,EAAA,CAAA;AAAA,QACrD,kBAAkB,oBAAC,gBAAgB,EAAA,GAAG,eAAgB,CAAA;AAAA,SACrD,yBAAyB,GAAG,KAAK,uCAAoB,aAAY,EAAA;AAAA,QAElE,oBAAA,UAAA,EAAS,MAAK,wBAAuB,UAAM,SAAA,CAAA;AAAA,MAAA,EAC7C,CAAA;AAAA,IAAA;AAAA,EACD;AAEF;"}
1
+ {"version":3,"file":"harmony116.mjs","sources":["../src/features/navigation/hooks/useExpertNavigation.ts"],"sourcesContent":["import type { Contributor, Project } from '@features/node'\nimport { useMemo } from 'react'\nimport { useNavigationClient } from '../providers/NavigationClientProvider'\nimport type { NavigationTabsItem } from '../types/navigation'\nimport { getProjectNavigationVisibilityMap } from '../utils/toolbarVisibility'\n\n// TODO: Validate features types\nexport const getIsFeatureEnabled = (features: Record<string, boolean>, name: string) => {\n\tconst featureState = features[name]\n\n\treturn (\n\t\tfeatureState !== null &&\n\t\tfeatureState !== undefined &&\n\t\t[true, 'on', 'true'].includes(featureState)\n\t)\n}\n\n/**\n * Hook to generate legacy navigation items using the existing structure\n * but with context API instead of Redux\n */\nexport const useExpertNavigation = (\n\tenabled: boolean,\n\tproject?: Project,\n\tcontributor?: Contributor,\n) => {\n\t// Use contributor data if provided, otherwise use defaults\n\tconst adminRights = contributor?.admin_rights || []\n\t// TODO: Implement selected app slug, small investigation is needed\n\tconst marketingSupportProjectSelectedAppSlug = 'selected-app-slug'\n\tconst navigationClient = useNavigationClient()\n\tconst expertUrl = navigationClient.getExpertUrl()\n\n\treturn useMemo(() => {\n\t\t// Get data from contexts instead of Redux, or use provided data\n\t\tif (!project || !enabled) {\n\t\t\treturn []\n\t\t}\n\t\t/* TODO: We're missing badges API. We need to get it from the backend or find alternative way to get task count\n\t\t * Fetch tasks and calculate count is not a good idea, because it can have pagination, therefore we can\n\t\t * ask for an additional prop in tasks response: task_count based on branch_id + project_id + task_status\n\t\t */\n\t\t// const taskCount = getTaskCount(project, branch, badges.tasks)\n\n\t\t// TODO: Implement feature flags functionality, most likely separate package\n\t\t// const isFeatureEnabled = (feature: string) => getIsFeatureEnabled(features, feature)\n\n\t\tconst navigationVisibility = getProjectNavigationVisibilityMap(\n\t\t\tproject,\n\t\t\tadminRights,\n\t\t\t() => true /*isFeatureEnabled*/,\n\t\t)\n\n\t\tconst appsNavigationItem: NavigationTabsItem = {\n\t\t\tkey: 'apps',\n\t\t\tlabel: 'Apps',\n\t\t\tisActive: (input: string) => input === 'apps',\n\t\t\tlink: `${expertUrl}/apps/${project.project_id}/`,\n\t\t\t...navigationVisibility.apps,\n\t\t}\n\n\t\tconst appsNavigationItemArrInMainMenu: NavigationTabsItem[] = []\n\t\tconst appsNavigationItemArrInMoreMenu: NavigationTabsItem[] = []\n\n\t\tif (project.project_type === 'content_integration') {\n\t\t\tappsNavigationItemArrInMoreMenu.push(appsNavigationItem)\n\t\t} else {\n\t\t\tappsNavigationItemArrInMainMenu.push(appsNavigationItem)\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tkey: 'edit',\n\t\t\t\tlabel: 'Editor',\n\t\t\t\tlink: `${expertUrl}/project/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'edit',\n\t\t\t\t...navigationVisibility.editor,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'files',\n\t\t\t\tlabel: 'Files',\n\t\t\t\tlink: `${expertUrl}/files/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'files',\n\t\t\t\t...navigationVisibility.files,\n\t\t\t},\n\t\t\t...(project.project_type === 'content_integration'\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'contentManagement',\n\t\t\t\t\t\t\tlabel: 'Content management',\n\t\t\t\t\t\t\tisActive: (input: string) => input === 'apps',\n\t\t\t\t\t\t\tlink: `${expertUrl}/apps/${project.project_id}/${marketingSupportProjectSelectedAppSlug}`,\n\t\t\t\t\t\t\t...navigationVisibility.contentManagement,\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'upload',\n\t\t\t\t\t\t\tlabel: 'Upload',\n\t\t\t\t\t\t\tlink: `${expertUrl}/upload/${project.project_id}/`,\n\t\t\t\t\t\t\tisActive: (input: string) => input === 'upload',\n\t\t\t\t\t\t\t...navigationVisibility.upload,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'download',\n\t\t\t\t\t\t\tlabel: 'Download',\n\t\t\t\t\t\t\tlink: `${expertUrl}/download/${project.project_id}/`,\n\t\t\t\t\t\t\tisActive: (input: string) => input === 'download',\n\t\t\t\t\t\t\t...navigationVisibility.download,\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t{\n\t\t\t\tkey: 'tasks',\n\t\t\t\tlabel: 'Tasks',\n\t\t\t\tlink: `${expertUrl}/tasks/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'tasks',\n\t\t\t\t// TODO: Add task count\n\t\t\t\t// badge: taskCount,\n\t\t\t\t...navigationVisibility.tasks,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'workflows',\n\t\t\t\tlabel: 'Workflows',\n\t\t\t\tlink: `${expertUrl}/workflows/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'workflows',\n\t\t\t\tnovel: 'New',\n\t\t\t\tonClick: () => {\n\t\t\t\t\t// TODO: Resolve analytics globally, most likely separate package\n\t\t\t\t\t// track(AnalyticsEventName.EDITOR_WORKFLOWS_TAB_CLICKED);\n\t\t\t\t\twindow.location.assign(`${expertUrl}/workflows/${project.project_id}/`)\n\t\t\t\t},\n\t\t\t\t...navigationVisibility.workflows,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'contributors',\n\t\t\t\tlabel: 'Contributors',\n\t\t\t\tlink: `${expertUrl}/contributors/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'contributors',\n\t\t\t\t...navigationVisibility.contributors,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'screenshots',\n\t\t\t\tlabel: 'Screenshots',\n\t\t\t\tlink: `${expertUrl}/screenshots/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'screenshots',\n\t\t\t\t...navigationVisibility.screenshots,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'glossary',\n\t\t\t\tlabel: 'Glossary',\n\t\t\t\tlink: `${expertUrl}/glossary/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'glossary',\n\t\t\t\t...navigationVisibility.glossary,\n\t\t\t},\n\t\t\t...appsNavigationItemArrInMainMenu,\n\t\t\t{\n\t\t\t\tkey: 'more',\n\t\t\t\tlabel: 'More...',\n\t\t\t\tisActive: (input: string) =>\n\t\t\t\t\t['settings', 'statistics', 'duplicates', 'live edit'].includes(input),\n\t\t\t\t...navigationVisibility.more,\n\t\t\t\tdropdown: [\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/`,\n\t\t\t\t\t\t\tlabel: 'Settings',\n\t\t\t\t\t\t\t...navigationVisibility.settings,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/#branches`,\n\t\t\t\t\t\t\tlabel: 'Branches',\n\t\t\t\t\t\t\t...navigationVisibility.branches,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/#ota-bundles`,\n\t\t\t\t\t\t\tlabel: 'OTA Bundles',\n\t\t\t\t\t\t\t...navigationVisibility.otaBundles,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/#project-automations`,\n\t\t\t\t\t\t\tlabel: 'Automations',\n\t\t\t\t\t\t\t...navigationVisibility.automations,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/dupes/${project.project_id}/`,\n\t\t\t\t\t\t\tlabel: 'Duplicate finder',\n\t\t\t\t\t\t\t...navigationVisibility.duplicateFinder,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t...appsNavigationItemArrInMoreMenu,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: This could be problematic tab, because it is not a link and we can't just redirect. We need to find a workaround for that.\n\t\t\t\t\t\t\tlabel: 'Activity',\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t// const showActivityEvent = new CustomEvent(\"show-activity\", {\n\t\t\t\t\t\t\t\t// \tdetail: {\n\t\t\t\t\t\t\t\t// \t\tprojectId: project.id,\n\t\t\t\t\t\t\t\t// \t\tbranchId: branch.branchId,\n\t\t\t\t\t\t\t\t// \t\tbranchName: branch.branchName,\n\t\t\t\t\t\t\t\t// \t},\n\t\t\t\t\t\t\t\t// });\n\t\t\t\t\t\t\t\t// document.dispatchEvent(showActivityEvent);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t...navigationVisibility.activity,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/statistics/${project.project_id}/`,\n\t\t\t\t\t\t\tlabel: 'Statistics',\n\t\t\t\t\t\t\t...navigationVisibility.statistics,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t},\n\t\t]\n\t}, [project, adminRights, enabled, expertUrl])\n}\n\n// TODO: Helper function for getting task count from badge data\n// const _getTaskCount = (project: any, branch: any, taskBadges: any) => {\n// \tif (!taskBadges) return 0\n\n// \t// Implementation would depend on your getTaskCountFromTasks utility\n// \t// Simplified version:\n// \tconst projectTasks = taskBadges[project.id] || {}\n// \treturn projectTasks[branch.branchId || 'master'] || 0\n// }\n"],"names":[],"mappings":"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"}
@@ -1,15 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SidebarContext = require("./harmony114.cjs");
4
3
  const React = require("react");
5
- const useSidebar = () => {
6
- const context = React.useContext(SidebarContext.SidebarContext);
7
- if (!context) {
8
- throw new Error(
9
- "You are using useSidebar hook outside its context. Please review your code implementation"
10
- );
11
- }
12
- return context;
4
+ const NavigationClientProvider = require("./harmony16.cjs");
5
+ const navigationSchema = require("./harmony124.cjs");
6
+ const useNextgenNavigation = (activeKey, enabled, project, contributor) => {
7
+ const navigationClient = NavigationClientProvider.useNavigationClient();
8
+ const nextgenUrl = navigationClient.getNextgenUrl();
9
+ const navigate = React.useCallback(
10
+ (path) => {
11
+ window.location.href = `${nextgenUrl}${path}`;
12
+ },
13
+ [nextgenUrl]
14
+ );
15
+ return React.useMemo(() => {
16
+ if (!enabled) {
17
+ return [];
18
+ }
19
+ const projectId = (project == null ? void 0 : project.project_id) || "";
20
+ const context = {
21
+ flags: {},
22
+ // TODO: getFeatureFlags(features),
23
+ pathname: window.location.pathname,
24
+ permissions: []
25
+ };
26
+ return navigationSchema.navigationItems.filter((item) => item.shouldShow ? item.shouldShow(context) : true).map((item) => {
27
+ const disabled = typeof item.disabled === "function" ? item.disabled(context) : !!item.disabled;
28
+ const badge = typeof item.badge === "function" ? item.badge(context) : item.badge;
29
+ const isActive = (input) => item.isActive ? item.isActive(input) : item.key === activeKey || input === item.key;
30
+ return {
31
+ key: item.key,
32
+ label: item.labelKey,
33
+ // You can apply translations here if needed
34
+ icon: item.icon,
35
+ visible: true,
36
+ badge,
37
+ disabled,
38
+ dropdown: item.dropdown,
39
+ isActive,
40
+ link: `${nextgenUrl}${item.path({ projectId })}`,
41
+ onClick: () => navigate(item.path({ projectId }))
42
+ };
43
+ });
44
+ }, [project, activeKey, enabled, navigate, contributor, nextgenUrl]);
13
45
  };
14
- exports.useSidebar = useSidebar;
46
+ exports.useNextgenNavigation = useNextgenNavigation;
15
47
  //# sourceMappingURL=harmony117.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony117.cjs","sources":["../src/components/Sidebar/hooks/useSidebar.ts"],"sourcesContent":["import { SidebarContext } from '@components/Sidebar/SidebarContext'\nimport { useContext } from 'react'\n\nexport const useSidebar = () => {\n\tconst context = useContext(SidebarContext)\n\n\tif (!context) {\n\t\tthrow new Error(\n\t\t\t'You are using useSidebar hook outside its context. Please review your code implementation',\n\t\t)\n\t}\n\n\treturn context\n}\n"],"names":["useContext","SidebarContext"],"mappings":";;;;AAGO,MAAM,aAAa,MAAM;AACzB,QAAA,UAAUA,iBAAWC,6BAAc;AAEzC,MAAI,CAAC,SAAS;AACb,UAAM,IAAI;AAAA,MACT;AAAA,IACD;AAAA,EAAA;AAGM,SAAA;AACR;;"}
1
+ {"version":3,"file":"harmony117.cjs","sources":["../src/features/navigation/hooks/useNextgenNavigation.ts"],"sourcesContent":["import type { Contributor, Project } from '@features/node'\nimport { useCallback, useMemo } from 'react'\nimport { useNavigationClient } from '../providers/NavigationClientProvider'\n// TODO: react-router-dom as peer dependencies works only inside next-gen apps. It shouldn't be like that.\n// Because of that we can't use THE WHOLE package in legacy apps, therefore it should be implemented in legacy apps as well(almost impossible),\n// so this dependency should be installed as direct dependency. or we should think about other options\n// import { useNavigate } from \"react-router-dom\";\nimport { navigationItems } from '../schemas/navigationSchema'\n\n// TODO: Unify navigation items for next-gen and legacy apps\n/**\n * Hook to generate navigation items for new applications\n */\nexport const useNextgenNavigation = (\n\tactiveKey: string,\n\tenabled: boolean,\n\tproject?: Project,\n\tcontributor?: Contributor,\n) => {\n\tconst navigationClient = useNavigationClient()\n\tconst nextgenUrl = navigationClient.getNextgenUrl()\n\n\tconst navigate = useCallback(\n\t\t(path: string) => {\n\t\t\t// TODO: Define navigate logic here\n\t\t\twindow.location.href = `${nextgenUrl}${path}`\n\t\t},\n\t\t[nextgenUrl],\n\t)\n\n\treturn useMemo(() => {\n\t\tif (!enabled) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst projectId = project?.project_id || ''\n\n\t\t// Context for filtering and transforming navigation items\n\t\tconst context = {\n\t\t\tflags: {}, // TODO: getFeatureFlags(features),\n\t\t\tpathname: window.location.pathname,\n\t\t\tpermissions: contributor?.admin_rights || [],\n\t\t}\n\n\t\t// Filter and map items\n\t\treturn (\n\t\t\tnavigationItems\n\t\t\t\t// Filter based on conditions\n\t\t\t\t.filter((item) => (item.shouldShow ? item.shouldShow(context) : true))\n\t\t\t\t// Map to NavigationTabsItem shape\n\t\t\t\t.map((item) => {\n\t\t\t\t\tconst disabled =\n\t\t\t\t\t\ttypeof item.disabled === 'function' ? item.disabled(context) : !!item.disabled\n\n\t\t\t\t\tconst badge = typeof item.badge === 'function' ? item.badge(context) : item.badge\n\n\t\t\t\t\t// Create isActive function\n\t\t\t\t\tconst isActive = (input: string) =>\n\t\t\t\t\t\titem.isActive ? item.isActive(input) : item.key === activeKey || input === item.key\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: item.key,\n\t\t\t\t\t\tlabel: item.labelKey, // You can apply translations here if needed\n\t\t\t\t\t\ticon: item.icon,\n\t\t\t\t\t\tvisible: true,\n\t\t\t\t\t\tbadge,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\tdropdown: item.dropdown,\n\t\t\t\t\t\tisActive,\n\t\t\t\t\t\tlink: `${nextgenUrl}${item.path({ projectId })}`,\n\t\t\t\t\t\tonClick: () => navigate(item.path({ projectId })),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t)\n\t}, [project, activeKey, enabled, navigate, contributor, nextgenUrl])\n}\n\n// TODO: Helper to convert features to flags format\n// const getFeatureFlags = (features) => {\n// \tif (!features) return {}\n//\n// \t// Convert features to the format expected by navigation schema\n// \treturn Object.keys(features).reduce((flags, key) => {\n// \t\tflags[key] = features[key] ? 'on' : 'off'\n// \t\treturn flags\n// \t}, {})\n// }\n"],"names":["useNavigationClient","useCallback","useMemo","navigationItems"],"mappings":";;;;;AAaO,MAAM,uBAAuB,CACnC,WACA,SACA,SACA,gBACI;AACJ,QAAM,mBAAmBA,yBAAAA,oBAAoB;AACvC,QAAA,aAAa,iBAAiB,cAAc;AAElD,QAAM,WAAWC,MAAA;AAAA,IAChB,CAAC,SAAiB;AAEjB,aAAO,SAAS,OAAO,GAAG,UAAU,GAAG,IAAI;AAAA,IAC5C;AAAA,IACA,CAAC,UAAU;AAAA,EACZ;AAEA,SAAOC,cAAQ,MAAM;AACpB,QAAI,CAAC,SAAS;AACb,aAAO,CAAC;AAAA,IAAA;AAGH,UAAA,aAAY,mCAAS,eAAc;AAGzC,UAAM,UAAU;AAAA,MACf,OAAO,CAAC;AAAA;AAAA,MACR,UAAU,OAAO,SAAS;AAAA,MAC1B,aAA0C,CAAA;AAAA,IAC3C;AAGA,WACCC,iBAEE,gBAAA,OAAO,CAAC,SAAU,KAAK,aAAa,KAAK,WAAW,OAAO,IAAI,IAAK,EAEpE,IAAI,CAAC,SAAS;AACR,YAAA,WACL,OAAO,KAAK,aAAa,aAAa,KAAK,SAAS,OAAO,IAAI,CAAC,CAAC,KAAK;AAEjE,YAAA,QAAQ,OAAO,KAAK,UAAU,aAAa,KAAK,MAAM,OAAO,IAAI,KAAK;AAG5E,YAAM,WAAW,CAAC,UACjB,KAAK,WAAW,KAAK,SAAS,KAAK,IAAI,KAAK,QAAQ,aAAa,UAAU,KAAK;AAE1E,aAAA;AAAA,QACN,KAAK,KAAK;AAAA,QACV,OAAO,KAAK;AAAA;AAAA,QACZ,MAAM,KAAK;AAAA,QACX,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,QACf;AAAA,QACA,MAAM,GAAG,UAAU,GAAG,KAAK,KAAK,EAAE,UAAW,CAAA,CAAC;AAAA,QAC9C,SAAS,MAAM,SAAS,KAAK,KAAK,EAAE,UAAA,CAAW,CAAC;AAAA,MACjD;AAAA,IAAA,CACA;AAAA,EAAA,GAED,CAAC,SAAS,WAAW,SAAS,UAAU,aAAa,UAAU,CAAC;AACpE;;"}
@@ -1,15 +1,47 @@
1
- import { SidebarContext } from "./harmony114.mjs";
2
- import { useContext } from "react";
3
- const useSidebar = () => {
4
- const context = useContext(SidebarContext);
5
- if (!context) {
6
- throw new Error(
7
- "You are using useSidebar hook outside its context. Please review your code implementation"
8
- );
9
- }
10
- return context;
1
+ import { useCallback, useMemo } from "react";
2
+ import { useNavigationClient } from "./harmony16.mjs";
3
+ import { navigationItems } from "./harmony124.mjs";
4
+ const useNextgenNavigation = (activeKey, enabled, project, contributor) => {
5
+ const navigationClient = useNavigationClient();
6
+ const nextgenUrl = navigationClient.getNextgenUrl();
7
+ const navigate = useCallback(
8
+ (path) => {
9
+ window.location.href = `${nextgenUrl}${path}`;
10
+ },
11
+ [nextgenUrl]
12
+ );
13
+ return useMemo(() => {
14
+ if (!enabled) {
15
+ return [];
16
+ }
17
+ const projectId = (project == null ? void 0 : project.project_id) || "";
18
+ const context = {
19
+ flags: {},
20
+ // TODO: getFeatureFlags(features),
21
+ pathname: window.location.pathname,
22
+ permissions: []
23
+ };
24
+ return navigationItems.filter((item) => item.shouldShow ? item.shouldShow(context) : true).map((item) => {
25
+ const disabled = typeof item.disabled === "function" ? item.disabled(context) : !!item.disabled;
26
+ const badge = typeof item.badge === "function" ? item.badge(context) : item.badge;
27
+ const isActive = (input) => item.isActive ? item.isActive(input) : item.key === activeKey || input === item.key;
28
+ return {
29
+ key: item.key,
30
+ label: item.labelKey,
31
+ // You can apply translations here if needed
32
+ icon: item.icon,
33
+ visible: true,
34
+ badge,
35
+ disabled,
36
+ dropdown: item.dropdown,
37
+ isActive,
38
+ link: `${nextgenUrl}${item.path({ projectId })}`,
39
+ onClick: () => navigate(item.path({ projectId }))
40
+ };
41
+ });
42
+ }, [project, activeKey, enabled, navigate, contributor, nextgenUrl]);
11
43
  };
12
44
  export {
13
- useSidebar
45
+ useNextgenNavigation
14
46
  };
15
47
  //# sourceMappingURL=harmony117.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony117.mjs","sources":["../src/components/Sidebar/hooks/useSidebar.ts"],"sourcesContent":["import { SidebarContext } from '@components/Sidebar/SidebarContext'\nimport { useContext } from 'react'\n\nexport const useSidebar = () => {\n\tconst context = useContext(SidebarContext)\n\n\tif (!context) {\n\t\tthrow new Error(\n\t\t\t'You are using useSidebar hook outside its context. Please review your code implementation',\n\t\t)\n\t}\n\n\treturn context\n}\n"],"names":[],"mappings":";;AAGO,MAAM,aAAa,MAAM;AACzB,QAAA,UAAU,WAAW,cAAc;AAEzC,MAAI,CAAC,SAAS;AACb,UAAM,IAAI;AAAA,MACT;AAAA,IACD;AAAA,EAAA;AAGM,SAAA;AACR;"}
1
+ {"version":3,"file":"harmony117.mjs","sources":["../src/features/navigation/hooks/useNextgenNavigation.ts"],"sourcesContent":["import type { Contributor, Project } from '@features/node'\nimport { useCallback, useMemo } from 'react'\nimport { useNavigationClient } from '../providers/NavigationClientProvider'\n// TODO: react-router-dom as peer dependencies works only inside next-gen apps. It shouldn't be like that.\n// Because of that we can't use THE WHOLE package in legacy apps, therefore it should be implemented in legacy apps as well(almost impossible),\n// so this dependency should be installed as direct dependency. or we should think about other options\n// import { useNavigate } from \"react-router-dom\";\nimport { navigationItems } from '../schemas/navigationSchema'\n\n// TODO: Unify navigation items for next-gen and legacy apps\n/**\n * Hook to generate navigation items for new applications\n */\nexport const useNextgenNavigation = (\n\tactiveKey: string,\n\tenabled: boolean,\n\tproject?: Project,\n\tcontributor?: Contributor,\n) => {\n\tconst navigationClient = useNavigationClient()\n\tconst nextgenUrl = navigationClient.getNextgenUrl()\n\n\tconst navigate = useCallback(\n\t\t(path: string) => {\n\t\t\t// TODO: Define navigate logic here\n\t\t\twindow.location.href = `${nextgenUrl}${path}`\n\t\t},\n\t\t[nextgenUrl],\n\t)\n\n\treturn useMemo(() => {\n\t\tif (!enabled) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst projectId = project?.project_id || ''\n\n\t\t// Context for filtering and transforming navigation items\n\t\tconst context = {\n\t\t\tflags: {}, // TODO: getFeatureFlags(features),\n\t\t\tpathname: window.location.pathname,\n\t\t\tpermissions: contributor?.admin_rights || [],\n\t\t}\n\n\t\t// Filter and map items\n\t\treturn (\n\t\t\tnavigationItems\n\t\t\t\t// Filter based on conditions\n\t\t\t\t.filter((item) => (item.shouldShow ? item.shouldShow(context) : true))\n\t\t\t\t// Map to NavigationTabsItem shape\n\t\t\t\t.map((item) => {\n\t\t\t\t\tconst disabled =\n\t\t\t\t\t\ttypeof item.disabled === 'function' ? item.disabled(context) : !!item.disabled\n\n\t\t\t\t\tconst badge = typeof item.badge === 'function' ? item.badge(context) : item.badge\n\n\t\t\t\t\t// Create isActive function\n\t\t\t\t\tconst isActive = (input: string) =>\n\t\t\t\t\t\titem.isActive ? item.isActive(input) : item.key === activeKey || input === item.key\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: item.key,\n\t\t\t\t\t\tlabel: item.labelKey, // You can apply translations here if needed\n\t\t\t\t\t\ticon: item.icon,\n\t\t\t\t\t\tvisible: true,\n\t\t\t\t\t\tbadge,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\tdropdown: item.dropdown,\n\t\t\t\t\t\tisActive,\n\t\t\t\t\t\tlink: `${nextgenUrl}${item.path({ projectId })}`,\n\t\t\t\t\t\tonClick: () => navigate(item.path({ projectId })),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t)\n\t}, [project, activeKey, enabled, navigate, contributor, nextgenUrl])\n}\n\n// TODO: Helper to convert features to flags format\n// const getFeatureFlags = (features) => {\n// \tif (!features) return {}\n//\n// \t// Convert features to the format expected by navigation schema\n// \treturn Object.keys(features).reduce((flags, key) => {\n// \t\tflags[key] = features[key] ? 'on' : 'off'\n// \t\treturn flags\n// \t}, {})\n// }\n"],"names":[],"mappings":";;;AAaO,MAAM,uBAAuB,CACnC,WACA,SACA,SACA,gBACI;AACJ,QAAM,mBAAmB,oBAAoB;AACvC,QAAA,aAAa,iBAAiB,cAAc;AAElD,QAAM,WAAW;AAAA,IAChB,CAAC,SAAiB;AAEjB,aAAO,SAAS,OAAO,GAAG,UAAU,GAAG,IAAI;AAAA,IAC5C;AAAA,IACA,CAAC,UAAU;AAAA,EACZ;AAEA,SAAO,QAAQ,MAAM;AACpB,QAAI,CAAC,SAAS;AACb,aAAO,CAAC;AAAA,IAAA;AAGH,UAAA,aAAY,mCAAS,eAAc;AAGzC,UAAM,UAAU;AAAA,MACf,OAAO,CAAC;AAAA;AAAA,MACR,UAAU,OAAO,SAAS;AAAA,MAC1B,aAA0C,CAAA;AAAA,IAC3C;AAGA,WACC,gBAEE,OAAO,CAAC,SAAU,KAAK,aAAa,KAAK,WAAW,OAAO,IAAI,IAAK,EAEpE,IAAI,CAAC,SAAS;AACR,YAAA,WACL,OAAO,KAAK,aAAa,aAAa,KAAK,SAAS,OAAO,IAAI,CAAC,CAAC,KAAK;AAEjE,YAAA,QAAQ,OAAO,KAAK,UAAU,aAAa,KAAK,MAAM,OAAO,IAAI,KAAK;AAG5E,YAAM,WAAW,CAAC,UACjB,KAAK,WAAW,KAAK,SAAS,KAAK,IAAI,KAAK,QAAQ,aAAa,UAAU,KAAK;AAE1E,aAAA;AAAA,QACN,KAAK,KAAK;AAAA,QACV,OAAO,KAAK;AAAA;AAAA,QACZ,MAAM,KAAK;AAAA,QACX,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,QACf;AAAA,QACA,MAAM,GAAG,UAAU,GAAG,KAAK,KAAK,EAAE,UAAW,CAAA,CAAC;AAAA,QAC9C,SAAS,MAAM,SAAS,KAAK,KAAK,EAAE,UAAA,CAAW,CAAC;AAAA,MACjD;AAAA,IAAA,CACA;AAAA,EAAA,GAED,CAAC,SAAS,WAAW,SAAS,UAAU,aAAa,UAAU,CAAC;AACpE;"}
@@ -1,37 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const plan = require("./harmony11.cjs");
4
- const withJwtCheck = (checkFn) => (jwtPayload) => !!jwtPayload && checkFn(jwtPayload);
5
- const canAccessStyleGuide = withJwtCheck(
6
- (jwt) => ["admin", "biller", "owner"].includes(jwt.userTeamRole)
7
- );
8
- const canAccessReporting = withJwtCheck(
9
- (jwt) => ["admin", "owner"].includes(jwt.userTeamRole)
10
- );
11
- const canAccessTeamSettings = withJwtCheck(
12
- (jwt) => ["admin", "biller", "owner"].includes(jwt.userTeamRole) && jwt.isFullyAuthenticated && !jwt.isEndOfTrialActive
13
- );
14
- const canCreateTeam = withJwtCheck(
15
- (jwt) => ["admin", "owner"].includes(jwt.userTeamRole) && jwt.isFullyAuthenticated && !jwt.isEndOfTrialActive
16
- );
17
- const canUpgradePlan = withJwtCheck(
18
- (jwt) => ["owner", "biller"].includes(jwt.userTeamRole) && jwt.isFullyAuthenticated && (plan.isFreePlan(jwt.planId) || plan.isTrialPlan(jwt.planId))
19
- );
20
- const canChangeBilling = withJwtCheck(
21
- (jwt) => ["admin", "owner", "biller"].includes(jwt.userTeamRole) && jwt.isFullyAuthenticated && !jwt.isTeamSuspended && !jwt.isEndOfTrialActive
22
- );
23
- const canAccessProviderDashboard = withJwtCheck(
24
- (jwt) => jwt.isProviderAlpha && !jwt.isTeamSuspended && jwt.isFullyAuthenticated
25
- );
26
- const canAccessProfileSettings = withJwtCheck(
27
- (jwt) => !jwt.isEndOfTrialActive && !jwt.isTeamSuspended
28
- );
29
- exports.canAccessProfileSettings = canAccessProfileSettings;
30
- exports.canAccessProviderDashboard = canAccessProviderDashboard;
31
- exports.canAccessReporting = canAccessReporting;
32
- exports.canAccessStyleGuide = canAccessStyleGuide;
33
- exports.canAccessTeamSettings = canAccessTeamSettings;
34
- exports.canChangeBilling = canChangeBilling;
35
- exports.canCreateTeam = canCreateTeam;
36
- exports.canUpgradePlan = canUpgradePlan;
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const louis = require("@lokalise/louis");
5
+ const SortingIcon = ({ direction }) => {
6
+ if (direction === "asc") {
7
+ return /* @__PURE__ */ jsxRuntime.jsx(louis.SortAscendingIcon, { ariaLabel: "ascending sorting" });
8
+ }
9
+ if (direction === "desc") {
10
+ return /* @__PURE__ */ jsxRuntime.jsx(louis.SortDescendingIcon, { ariaLabel: "descending sorting" });
11
+ }
12
+ return /* @__PURE__ */ jsxRuntime.jsx(louis.SortIcon, { ariaLabel: "sorting" });
13
+ };
14
+ exports.SortingIcon = SortingIcon;
37
15
  //# sourceMappingURL=harmony118.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony118.cjs","sources":["../src/utils/user/permissions.ts"],"sourcesContent":["import type { JwtTokenPayload } from '@features/auth/core/types/jwtTokenPayload'\nimport { isFreePlan, isTrialPlan } from '@utils'\n\ntype JwtCheckFn = (jwt: JwtTokenPayload) => boolean\n\nconst withJwtCheck =\n\t(checkFn: JwtCheckFn) =>\n\t(jwtPayload: JwtTokenPayload | null | undefined): boolean =>\n\t\t!!jwtPayload && checkFn(jwtPayload)\n\nexport const canAccessStyleGuide = withJwtCheck((jwt) =>\n\t['admin', 'biller', 'owner'].includes(jwt.userTeamRole),\n)\n\nexport const canAccessReporting = withJwtCheck((jwt) =>\n\t['admin', 'owner'].includes(jwt.userTeamRole),\n)\n\nexport const canAccessTeamSettings = withJwtCheck(\n\t(jwt) =>\n\t\t['admin', 'biller', 'owner'].includes(jwt.userTeamRole) &&\n\t\tjwt.isFullyAuthenticated &&\n\t\t!jwt.isEndOfTrialActive,\n)\n\nexport const canCreateTeam = withJwtCheck(\n\t(jwt) =>\n\t\t['admin', 'owner'].includes(jwt.userTeamRole) &&\n\t\tjwt.isFullyAuthenticated &&\n\t\t!jwt.isEndOfTrialActive,\n)\n\nexport const canUpgradePlan = withJwtCheck(\n\t(jwt) =>\n\t\t['owner', 'biller'].includes(jwt.userTeamRole) &&\n\t\tjwt.isFullyAuthenticated &&\n\t\t(isFreePlan(jwt.planId) || isTrialPlan(jwt.planId)),\n)\n\nexport const canChangeBilling = withJwtCheck(\n\t(jwt) =>\n\t\t['admin', 'owner', 'biller'].includes(jwt.userTeamRole) &&\n\t\tjwt.isFullyAuthenticated &&\n\t\t!jwt.isTeamSuspended &&\n\t\t!jwt.isEndOfTrialActive,\n)\n\nexport const canAccessProviderDashboard = withJwtCheck(\n\t(jwt) => jwt.isProviderAlpha && !jwt.isTeamSuspended && jwt.isFullyAuthenticated,\n)\n\nexport const canAccessProfileSettings = withJwtCheck(\n\t(jwt) => !jwt.isEndOfTrialActive && !jwt.isTeamSuspended,\n)\n"],"names":["isFreePlan","isTrialPlan"],"mappings":";;;AAKA,MAAM,eACL,CAAC,YACD,CAAC,eACA,CAAC,CAAC,cAAc,QAAQ,UAAU;AAE7B,MAAM,sBAAsB;AAAA,EAAa,CAAC,QAChD,CAAC,SAAS,UAAU,OAAO,EAAE,SAAS,IAAI,YAAY;AACvD;AAEO,MAAM,qBAAqB;AAAA,EAAa,CAAC,QAC/C,CAAC,SAAS,OAAO,EAAE,SAAS,IAAI,YAAY;AAC7C;AAEO,MAAM,wBAAwB;AAAA,EACpC,CAAC,QACA,CAAC,SAAS,UAAU,OAAO,EAAE,SAAS,IAAI,YAAY,KACtD,IAAI,wBACJ,CAAC,IAAI;AACP;AAEO,MAAM,gBAAgB;AAAA,EAC5B,CAAC,QACA,CAAC,SAAS,OAAO,EAAE,SAAS,IAAI,YAAY,KAC5C,IAAI,wBACJ,CAAC,IAAI;AACP;AAEO,MAAM,iBAAiB;AAAA,EAC7B,CAAC,QACA,CAAC,SAAS,QAAQ,EAAE,SAAS,IAAI,YAAY,KAC7C,IAAI,yBACHA,KAAW,WAAA,IAAI,MAAM,KAAKC,KAAA,YAAY,IAAI,MAAM;AACnD;AAEO,MAAM,mBAAmB;AAAA,EAC/B,CAAC,QACA,CAAC,SAAS,SAAS,QAAQ,EAAE,SAAS,IAAI,YAAY,KACtD,IAAI,wBACJ,CAAC,IAAI,mBACL,CAAC,IAAI;AACP;AAEO,MAAM,6BAA6B;AAAA,EACzC,CAAC,QAAQ,IAAI,mBAAmB,CAAC,IAAI,mBAAmB,IAAI;AAC7D;AAEO,MAAM,2BAA2B;AAAA,EACvC,CAAC,QAAQ,CAAC,IAAI,sBAAsB,CAAC,IAAI;AAC1C;;;;;;;;;"}
1
+ {"version":3,"file":"harmony118.cjs","sources":["../src/components/Table/components/SortingIcon.tsx"],"sourcesContent":["import { SortAscendingIcon, SortDescendingIcon, SortIcon } from '@lokalise/louis'\nimport type { SortDirection } from '@tanstack/react-table'\n\ntype SortingIconProps = {\n\tdirection: SortDirection | false\n}\n\nexport const SortingIcon = ({ direction }: SortingIconProps) => {\n\tif (direction === 'asc') {\n\t\treturn <SortAscendingIcon ariaLabel=\"ascending sorting\" />\n\t}\n\tif (direction === 'desc') {\n\t\treturn <SortDescendingIcon ariaLabel=\"descending sorting\" />\n\t}\n\treturn <SortIcon ariaLabel=\"sorting\" />\n}\n"],"names":["jsx","SortAscendingIcon","SortDescendingIcon","SortIcon"],"mappings":";;;;AAOO,MAAM,cAAc,CAAC,EAAE,gBAAkC;AAC/D,MAAI,cAAc,OAAO;AACjB,WAAAA,2BAAA,IAACC,MAAkB,mBAAA,EAAA,WAAU,oBAAoB,CAAA;AAAA,EAAA;AAEzD,MAAI,cAAc,QAAQ;AAClB,WAAAD,2BAAA,IAACE,MAAmB,oBAAA,EAAA,WAAU,qBAAqB,CAAA;AAAA,EAAA;AAEpD,SAAAF,2BAAA,IAACG,MAAS,UAAA,EAAA,WAAU,UAAU,CAAA;AACtC;;"}
@@ -1,37 +1,15 @@
1
- import { isFreePlan, isTrialPlan } from "./harmony11.mjs";
2
- const withJwtCheck = (checkFn) => (jwtPayload) => !!jwtPayload && checkFn(jwtPayload);
3
- const canAccessStyleGuide = withJwtCheck(
4
- (jwt) => ["admin", "biller", "owner"].includes(jwt.userTeamRole)
5
- );
6
- const canAccessReporting = withJwtCheck(
7
- (jwt) => ["admin", "owner"].includes(jwt.userTeamRole)
8
- );
9
- const canAccessTeamSettings = withJwtCheck(
10
- (jwt) => ["admin", "biller", "owner"].includes(jwt.userTeamRole) && jwt.isFullyAuthenticated && !jwt.isEndOfTrialActive
11
- );
12
- const canCreateTeam = withJwtCheck(
13
- (jwt) => ["admin", "owner"].includes(jwt.userTeamRole) && jwt.isFullyAuthenticated && !jwt.isEndOfTrialActive
14
- );
15
- const canUpgradePlan = withJwtCheck(
16
- (jwt) => ["owner", "biller"].includes(jwt.userTeamRole) && jwt.isFullyAuthenticated && (isFreePlan(jwt.planId) || isTrialPlan(jwt.planId))
17
- );
18
- const canChangeBilling = withJwtCheck(
19
- (jwt) => ["admin", "owner", "biller"].includes(jwt.userTeamRole) && jwt.isFullyAuthenticated && !jwt.isTeamSuspended && !jwt.isEndOfTrialActive
20
- );
21
- const canAccessProviderDashboard = withJwtCheck(
22
- (jwt) => jwt.isProviderAlpha && !jwt.isTeamSuspended && jwt.isFullyAuthenticated
23
- );
24
- const canAccessProfileSettings = withJwtCheck(
25
- (jwt) => !jwt.isEndOfTrialActive && !jwt.isTeamSuspended
26
- );
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { SortAscendingIcon, SortDescendingIcon, SortIcon } from "@lokalise/louis";
3
+ const SortingIcon = ({ direction }) => {
4
+ if (direction === "asc") {
5
+ return /* @__PURE__ */ jsx(SortAscendingIcon, { ariaLabel: "ascending sorting" });
6
+ }
7
+ if (direction === "desc") {
8
+ return /* @__PURE__ */ jsx(SortDescendingIcon, { ariaLabel: "descending sorting" });
9
+ }
10
+ return /* @__PURE__ */ jsx(SortIcon, { ariaLabel: "sorting" });
11
+ };
27
12
  export {
28
- canAccessProfileSettings,
29
- canAccessProviderDashboard,
30
- canAccessReporting,
31
- canAccessStyleGuide,
32
- canAccessTeamSettings,
33
- canChangeBilling,
34
- canCreateTeam,
35
- canUpgradePlan
13
+ SortingIcon
36
14
  };
37
15
  //# sourceMappingURL=harmony118.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony118.mjs","sources":["../src/utils/user/permissions.ts"],"sourcesContent":["import type { JwtTokenPayload } from '@features/auth/core/types/jwtTokenPayload'\nimport { isFreePlan, isTrialPlan } from '@utils'\n\ntype JwtCheckFn = (jwt: JwtTokenPayload) => boolean\n\nconst withJwtCheck =\n\t(checkFn: JwtCheckFn) =>\n\t(jwtPayload: JwtTokenPayload | null | undefined): boolean =>\n\t\t!!jwtPayload && checkFn(jwtPayload)\n\nexport const canAccessStyleGuide = withJwtCheck((jwt) =>\n\t['admin', 'biller', 'owner'].includes(jwt.userTeamRole),\n)\n\nexport const canAccessReporting = withJwtCheck((jwt) =>\n\t['admin', 'owner'].includes(jwt.userTeamRole),\n)\n\nexport const canAccessTeamSettings = withJwtCheck(\n\t(jwt) =>\n\t\t['admin', 'biller', 'owner'].includes(jwt.userTeamRole) &&\n\t\tjwt.isFullyAuthenticated &&\n\t\t!jwt.isEndOfTrialActive,\n)\n\nexport const canCreateTeam = withJwtCheck(\n\t(jwt) =>\n\t\t['admin', 'owner'].includes(jwt.userTeamRole) &&\n\t\tjwt.isFullyAuthenticated &&\n\t\t!jwt.isEndOfTrialActive,\n)\n\nexport const canUpgradePlan = withJwtCheck(\n\t(jwt) =>\n\t\t['owner', 'biller'].includes(jwt.userTeamRole) &&\n\t\tjwt.isFullyAuthenticated &&\n\t\t(isFreePlan(jwt.planId) || isTrialPlan(jwt.planId)),\n)\n\nexport const canChangeBilling = withJwtCheck(\n\t(jwt) =>\n\t\t['admin', 'owner', 'biller'].includes(jwt.userTeamRole) &&\n\t\tjwt.isFullyAuthenticated &&\n\t\t!jwt.isTeamSuspended &&\n\t\t!jwt.isEndOfTrialActive,\n)\n\nexport const canAccessProviderDashboard = withJwtCheck(\n\t(jwt) => jwt.isProviderAlpha && !jwt.isTeamSuspended && jwt.isFullyAuthenticated,\n)\n\nexport const canAccessProfileSettings = withJwtCheck(\n\t(jwt) => !jwt.isEndOfTrialActive && !jwt.isTeamSuspended,\n)\n"],"names":[],"mappings":";AAKA,MAAM,eACL,CAAC,YACD,CAAC,eACA,CAAC,CAAC,cAAc,QAAQ,UAAU;AAE7B,MAAM,sBAAsB;AAAA,EAAa,CAAC,QAChD,CAAC,SAAS,UAAU,OAAO,EAAE,SAAS,IAAI,YAAY;AACvD;AAEO,MAAM,qBAAqB;AAAA,EAAa,CAAC,QAC/C,CAAC,SAAS,OAAO,EAAE,SAAS,IAAI,YAAY;AAC7C;AAEO,MAAM,wBAAwB;AAAA,EACpC,CAAC,QACA,CAAC,SAAS,UAAU,OAAO,EAAE,SAAS,IAAI,YAAY,KACtD,IAAI,wBACJ,CAAC,IAAI;AACP;AAEO,MAAM,gBAAgB;AAAA,EAC5B,CAAC,QACA,CAAC,SAAS,OAAO,EAAE,SAAS,IAAI,YAAY,KAC5C,IAAI,wBACJ,CAAC,IAAI;AACP;AAEO,MAAM,iBAAiB;AAAA,EAC7B,CAAC,QACA,CAAC,SAAS,QAAQ,EAAE,SAAS,IAAI,YAAY,KAC7C,IAAI,yBACH,WAAW,IAAI,MAAM,KAAK,YAAY,IAAI,MAAM;AACnD;AAEO,MAAM,mBAAmB;AAAA,EAC/B,CAAC,QACA,CAAC,SAAS,SAAS,QAAQ,EAAE,SAAS,IAAI,YAAY,KACtD,IAAI,wBACJ,CAAC,IAAI,mBACL,CAAC,IAAI;AACP;AAEO,MAAM,6BAA6B;AAAA,EACzC,CAAC,QAAQ,IAAI,mBAAmB,CAAC,IAAI,mBAAmB,IAAI;AAC7D;AAEO,MAAM,2BAA2B;AAAA,EACvC,CAAC,QAAQ,CAAC,IAAI,sBAAsB,CAAC,IAAI;AAC1C;"}
1
+ {"version":3,"file":"harmony118.mjs","sources":["../src/components/Table/components/SortingIcon.tsx"],"sourcesContent":["import { SortAscendingIcon, SortDescendingIcon, SortIcon } from '@lokalise/louis'\nimport type { SortDirection } from '@tanstack/react-table'\n\ntype SortingIconProps = {\n\tdirection: SortDirection | false\n}\n\nexport const SortingIcon = ({ direction }: SortingIconProps) => {\n\tif (direction === 'asc') {\n\t\treturn <SortAscendingIcon ariaLabel=\"ascending sorting\" />\n\t}\n\tif (direction === 'desc') {\n\t\treturn <SortDescendingIcon ariaLabel=\"descending sorting\" />\n\t}\n\treturn <SortIcon ariaLabel=\"sorting\" />\n}\n"],"names":[],"mappings":";;AAOO,MAAM,cAAc,CAAC,EAAE,gBAAkC;AAC/D,MAAI,cAAc,OAAO;AACjB,WAAA,oBAAC,mBAAkB,EAAA,WAAU,oBAAoB,CAAA;AAAA,EAAA;AAEzD,MAAI,cAAc,QAAQ;AAClB,WAAA,oBAAC,oBAAmB,EAAA,WAAU,qBAAqB,CAAA;AAAA,EAAA;AAEpD,SAAA,oBAAC,UAAS,EAAA,WAAU,UAAU,CAAA;AACtC;"}
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const Avatar_module = require("./harmony144.cjs");
5
- const Avatar = ({
6
- src,
7
- href = "/",
8
- ariaLabel = "Lokalise App Home",
9
- alt = "Lokalise Logo"
10
- }) => /* @__PURE__ */ jsxRuntime.jsx("a", { className: Avatar_module.default.logoLink, href, "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt }) });
11
- exports.Avatar = Avatar;
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const headerSortButton = "_headerSortButton_b5tlh_1";
4
+ const centeredCell = "_centeredCell_b5tlh_15";
5
+ const rightAlignedCell = "_rightAlignedCell_b5tlh_19";
6
+ const styles = {
7
+ headerSortButton,
8
+ centeredCell,
9
+ rightAlignedCell
10
+ };
11
+ exports.centeredCell = centeredCell;
12
+ exports.default = styles;
13
+ exports.headerSortButton = headerSortButton;
14
+ exports.rightAlignedCell = rightAlignedCell;
12
15
  //# sourceMappingURL=harmony119.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony119.cjs","sources":["../src/components/Sidebar/Widgets/Avatar/Avatar.tsx"],"sourcesContent":["import styles from './Avatar.module.css'\n\ntype AvatarProps = {\n\t/** URL of the avatar/logo image */\n\tsrc: string\n\t/** Link destination when avatar is clicked. Defaults to '/' */\n\thref?: string\n\t/** Accessibility label for the avatar link. Defaults to 'Home' */\n\tariaLabel?: string\n\t/** Alt text for the avatar image. Defaults to 'Lokalise' */\n\talt?: string\n}\n\n/**\n * Display company main avatar / logo in the top section of the Sidebar.\n * Used as the main branding element and home navigation link.\n *\n * @example\n * ```\n * <Avatar src=\"/logo.png\" href=\"/\" ariaLabel=\"Home\" alt=\"\" />\n * ```\n */\n\nexport const Avatar = ({\n\tsrc,\n\thref = '/',\n\tariaLabel = 'Lokalise App Home',\n\talt = 'Lokalise Logo',\n}: AvatarProps) => (\n\t<a className={styles.logoLink} href={href} aria-label={ariaLabel}>\n\t\t<img src={src} alt={alt} />\n\t</a>\n)\n"],"names":["jsx","styles"],"mappings":";;;;AAuBO,MAAM,SAAS,CAAC;AAAA,EACtB;AAAA,EACA,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,MAAM;AACP,MACEA,2BAAAA,IAAA,KAAA,EAAE,WAAWC,cAAA,QAAO,UAAU,MAAY,cAAY,WACtD,UAACD,2BAAAA,IAAA,OAAA,EAAI,KAAU,IAAA,CAAU,EAC1B,CAAA;;"}
1
+ {"version":3,"file":"harmony119.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}