@lokalise/harmony 2.1.0-exp-testingContracts.3 → 2.1.0-exp-testingContracts.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/harmony.cjs +1 -0
- package/dist/harmony.cjs.map +1 -1
- package/dist/harmony.mjs +2 -1
- package/dist/harmony103.cjs +1 -1
- package/dist/harmony103.mjs +1 -1
- package/dist/harmony104.cjs +7 -7
- package/dist/harmony104.mjs +7 -7
- package/dist/harmony106.cjs +2 -2
- package/dist/harmony106.mjs +2 -2
- package/dist/harmony107.cjs +165 -2
- package/dist/harmony107.cjs.map +1 -1
- package/dist/harmony107.mjs +166 -3
- package/dist/harmony107.mjs.map +1 -1
- package/dist/harmony108.cjs +42 -16
- package/dist/harmony108.cjs.map +1 -1
- package/dist/harmony108.mjs +42 -16
- package/dist/harmony108.mjs.map +1 -1
- package/dist/harmony109.cjs +13 -75
- package/dist/harmony109.cjs.map +1 -1
- package/dist/harmony109.mjs +13 -75
- package/dist/harmony109.mjs.map +1 -1
- package/dist/harmony110.cjs +2 -11
- package/dist/harmony110.cjs.map +1 -1
- package/dist/harmony110.mjs +3 -12
- package/dist/harmony110.mjs.map +1 -1
- package/dist/harmony111.cjs +18 -34
- package/dist/harmony111.cjs.map +1 -1
- package/dist/harmony111.mjs +18 -34
- package/dist/harmony111.mjs.map +1 -1
- package/dist/harmony112.cjs +75 -8
- package/dist/harmony112.cjs.map +1 -1
- package/dist/harmony112.mjs +75 -8
- package/dist/harmony112.mjs.map +1 -1
- package/dist/harmony113.cjs +11 -46
- package/dist/harmony113.cjs.map +1 -1
- package/dist/harmony113.mjs +11 -46
- package/dist/harmony113.mjs.map +1 -1
- package/dist/harmony114.cjs +35 -10
- package/dist/harmony114.cjs.map +1 -1
- package/dist/harmony114.mjs +34 -9
- package/dist/harmony114.mjs.map +1 -1
- package/dist/harmony115.cjs +9 -14
- package/dist/harmony115.cjs.map +1 -1
- package/dist/harmony115.mjs +9 -14
- package/dist/harmony115.mjs.map +1 -1
- package/dist/harmony116.cjs +44 -163
- package/dist/harmony116.cjs.map +1 -1
- package/dist/harmony116.mjs +44 -163
- package/dist/harmony116.mjs.map +1 -1
- package/dist/harmony117.cjs +9 -44
- package/dist/harmony117.cjs.map +1 -1
- package/dist/harmony117.mjs +8 -43
- package/dist/harmony117.mjs.map +1 -1
- package/dist/harmony118.cjs +9 -10
- package/dist/harmony118.cjs.map +1 -1
- package/dist/harmony118.mjs +11 -12
- package/dist/harmony118.mjs.map +1 -1
- package/dist/harmony119.cjs +20 -11
- package/dist/harmony119.cjs.map +1 -1
- package/dist/harmony119.mjs +20 -11
- package/dist/harmony119.mjs.map +1 -1
- package/dist/harmony120.cjs +10 -9
- package/dist/harmony120.cjs.map +1 -1
- package/dist/harmony120.mjs +12 -11
- package/dist/harmony120.mjs.map +1 -1
- package/dist/harmony121.cjs +11 -20
- package/dist/harmony121.cjs.map +1 -1
- package/dist/harmony121.mjs +11 -20
- package/dist/harmony121.mjs.map +1 -1
- package/dist/harmony122.cjs +2 -2
- package/dist/harmony122.mjs +2 -2
- package/dist/harmony123.cjs +20 -87
- package/dist/harmony123.cjs.map +1 -1
- package/dist/harmony123.mjs +20 -87
- package/dist/harmony123.mjs.map +1 -1
- package/dist/harmony124.cjs +7 -30
- package/dist/harmony124.cjs.map +1 -1
- package/dist/harmony124.mjs +7 -30
- package/dist/harmony124.mjs.map +1 -1
- package/dist/harmony125.cjs +17 -20
- package/dist/harmony125.cjs.map +1 -1
- package/dist/harmony125.mjs +17 -20
- package/dist/harmony125.mjs.map +1 -1
- package/dist/harmony126.cjs +8 -7
- package/dist/harmony126.cjs.map +1 -1
- package/dist/harmony126.mjs +8 -7
- package/dist/harmony126.mjs.map +1 -1
- package/dist/harmony127.cjs +7 -16
- package/dist/harmony127.cjs.map +1 -1
- package/dist/harmony127.mjs +7 -16
- package/dist/harmony127.mjs.map +1 -1
- package/dist/harmony128.cjs +14 -7
- package/dist/harmony128.cjs.map +1 -1
- package/dist/harmony128.mjs +14 -7
- package/dist/harmony128.mjs.map +1 -1
- package/dist/harmony129.cjs +86 -7
- package/dist/harmony129.cjs.map +1 -1
- package/dist/harmony129.mjs +86 -7
- package/dist/harmony129.mjs.map +1 -1
- package/dist/harmony130.cjs +30 -15
- package/dist/harmony130.cjs.map +1 -1
- package/dist/harmony130.mjs +30 -15
- package/dist/harmony130.mjs.map +1 -1
- package/dist/harmony131.cjs +5 -9
- package/dist/harmony131.cjs.map +1 -1
- package/dist/harmony131.mjs +5 -9
- package/dist/harmony131.mjs.map +1 -1
- package/dist/harmony132.cjs +6 -13
- package/dist/harmony132.cjs.map +1 -1
- package/dist/harmony132.mjs +5 -12
- package/dist/harmony132.mjs.map +1 -1
- package/dist/harmony133.cjs +9 -15
- package/dist/harmony133.cjs.map +1 -1
- package/dist/harmony133.mjs +8 -14
- package/dist/harmony133.mjs.map +1 -1
- package/dist/harmony134.cjs +6 -13
- package/dist/harmony134.cjs.map +1 -1
- package/dist/harmony134.mjs +8 -15
- package/dist/harmony134.mjs.map +1 -1
- package/dist/harmony135.cjs +12 -7
- package/dist/harmony135.cjs.map +1 -1
- package/dist/harmony135.mjs +14 -9
- package/dist/harmony135.mjs.map +1 -1
- package/dist/harmony136.cjs +13 -20
- package/dist/harmony136.cjs.map +1 -1
- package/dist/harmony136.mjs +15 -22
- package/dist/harmony136.mjs.map +1 -1
- package/dist/harmony137.cjs +7 -9
- package/dist/harmony137.cjs.map +1 -1
- package/dist/harmony137.mjs +9 -11
- package/dist/harmony137.mjs.map +1 -1
- package/dist/harmony138.cjs +18 -30
- package/dist/harmony138.cjs.map +1 -1
- package/dist/harmony138.mjs +20 -32
- package/dist/harmony138.mjs.map +1 -1
- package/dist/harmony139.cjs +6 -6
- package/dist/harmony139.cjs.map +1 -1
- package/dist/harmony139.mjs +6 -6
- package/dist/harmony139.mjs.map +1 -1
- package/dist/harmony140.cjs +29 -13
- package/dist/harmony140.cjs.map +1 -1
- package/dist/harmony140.mjs +30 -14
- package/dist/harmony140.mjs.map +1 -1
- package/dist/harmony141.cjs +7 -31
- package/dist/harmony141.cjs.map +1 -1
- package/dist/harmony141.mjs +8 -32
- package/dist/harmony141.mjs.map +1 -1
- package/dist/harmony142.cjs +22 -21
- package/dist/harmony142.cjs.map +1 -1
- package/dist/harmony142.mjs +21 -20
- package/dist/harmony142.mjs.map +1 -1
- package/dist/harmony143.cjs +30 -15
- package/dist/harmony143.cjs.map +1 -1
- package/dist/harmony143.mjs +32 -17
- package/dist/harmony143.mjs.map +1 -1
- package/dist/harmony144.cjs +18 -3
- package/dist/harmony144.cjs.map +1 -1
- package/dist/harmony144.mjs +18 -3
- package/dist/harmony144.mjs.map +1 -1
- package/dist/harmony145.cjs +21 -15
- package/dist/harmony145.cjs.map +1 -1
- package/dist/harmony145.mjs +20 -14
- package/dist/harmony145.mjs.map +1 -1
- package/dist/harmony146.cjs +6 -5
- package/dist/harmony146.cjs.map +1 -1
- package/dist/harmony146.mjs +6 -5
- package/dist/harmony147.cjs +15 -5
- package/dist/harmony147.cjs.map +1 -1
- package/dist/harmony147.mjs +15 -5
- package/dist/harmony147.mjs.map +1 -1
- package/dist/harmony149.cjs +1 -1
- package/dist/harmony149.mjs +1 -1
- package/dist/harmony150.cjs +1 -1
- package/dist/harmony150.mjs +1 -1
- package/dist/harmony151.cjs +1 -1
- package/dist/harmony151.mjs +1 -1
- package/dist/harmony152.cjs +3 -3
- package/dist/harmony152.mjs +3 -3
- package/dist/harmony153.cjs +3 -3
- package/dist/harmony153.mjs +3 -3
- package/dist/harmony154.cjs +1 -1
- package/dist/harmony154.mjs +1 -1
- package/dist/harmony157.cjs +1 -1
- package/dist/harmony157.mjs +1 -1
- package/dist/harmony158.cjs +2 -2
- package/dist/harmony158.mjs +2 -2
- package/dist/harmony167.cjs +13 -32
- package/dist/harmony167.cjs.map +1 -1
- package/dist/harmony167.mjs +13 -32
- package/dist/harmony167.mjs.map +1 -1
- package/dist/harmony168.cjs +14 -12
- package/dist/harmony168.cjs.map +1 -1
- package/dist/harmony168.mjs +14 -12
- package/dist/harmony168.mjs.map +1 -1
- package/dist/harmony169.cjs +14 -13
- package/dist/harmony169.cjs.map +1 -1
- package/dist/harmony169.mjs +14 -13
- package/dist/harmony169.mjs.map +1 -1
- package/dist/harmony17.cjs +1 -1
- package/dist/harmony17.mjs +1 -1
- package/dist/harmony170.cjs +31 -15
- package/dist/harmony170.cjs.map +1 -1
- package/dist/harmony170.mjs +31 -15
- package/dist/harmony170.mjs.map +1 -1
- package/dist/harmony171.cjs +1 -1
- package/dist/harmony171.mjs +1 -1
- package/dist/harmony173.cjs +3 -3
- package/dist/harmony173.mjs +3 -3
- package/dist/harmony175.cjs +6 -4
- package/dist/harmony175.cjs.map +1 -1
- package/dist/harmony175.mjs +6 -4
- package/dist/harmony175.mjs.map +1 -1
- package/dist/harmony176.cjs +11 -5
- package/dist/harmony176.cjs.map +1 -1
- package/dist/harmony176.mjs +11 -5
- package/dist/harmony176.mjs.map +1 -1
- package/dist/harmony177.cjs +31 -11
- package/dist/harmony177.cjs.map +1 -1
- package/dist/harmony177.mjs +31 -11
- package/dist/harmony177.mjs.map +1 -1
- package/dist/harmony178.cjs +10 -28
- package/dist/harmony178.cjs.map +1 -1
- package/dist/harmony178.mjs +10 -28
- package/dist/harmony178.mjs.map +1 -1
- package/dist/harmony179.cjs +4 -14
- package/dist/harmony179.cjs.map +1 -1
- package/dist/harmony179.mjs +4 -14
- package/dist/harmony179.mjs.map +1 -1
- package/dist/harmony20.cjs +1 -1
- package/dist/harmony20.mjs +1 -1
- package/dist/harmony28.cjs +1 -1
- package/dist/harmony28.mjs +1 -1
- package/dist/harmony29.cjs +1 -1
- package/dist/harmony29.mjs +1 -1
- package/dist/harmony32.cjs +1 -1
- package/dist/harmony32.mjs +1 -1
- package/dist/harmony33.cjs +1 -1
- package/dist/harmony33.mjs +1 -1
- package/dist/harmony34.cjs +1 -1
- package/dist/harmony34.mjs +1 -1
- package/dist/harmony39.cjs +1 -1
- package/dist/harmony39.mjs +1 -1
- package/dist/harmony40.cjs +1 -1
- package/dist/harmony40.mjs +1 -1
- package/dist/harmony41.cjs +1 -1
- package/dist/harmony41.mjs +1 -1
- package/dist/harmony42.cjs +2 -2
- package/dist/harmony42.mjs +2 -2
- package/dist/harmony43.cjs +2 -2
- package/dist/harmony43.mjs +2 -2
- package/dist/harmony44.cjs +1 -1
- package/dist/harmony44.mjs +1 -1
- package/dist/harmony90.cjs +2 -0
- package/dist/harmony90.cjs.map +1 -1
- package/dist/harmony90.mjs +2 -0
- package/dist/harmony90.mjs.map +1 -1
- package/dist/harmony97.cjs +2 -2
- package/dist/harmony97.mjs +2 -2
- package/dist/harmony99.cjs +2 -2
- package/dist/harmony99.mjs +2 -2
- package/dist/types/src/features/auth/frontend/services/generateTokenFromClassicSession.d.ts +1 -4
- package/dist/types/src/features/auth/frontend/services/refreshExpiredToken.d.ts +1 -4
- package/dist/types/src/features/publicApi/TESTING_CONTRACTS.d.ts +2 -56
- package/dist/types/src/features/publicApi/contributors.d.ts +5 -260
- package/dist/types/src/features/publicApi/languages.d.ts +3 -106
- package/dist/types/src/features/publicApi/permissionTemplates.d.ts +1 -54
- package/dist/types/src/features/publicApi/projects.d.ts +6 -520
- package/dist/types/src/features/publicApi/score.d.ts +3 -102
- package/dist/types/src/features/publicApi/team.d.ts +2 -102
- package/dist/types/src/features/publicApi/teamUsers.d.ts +3 -125
- package/dist/types/src/features/publicApi/userToken.d.ts +1 -19
- package/package.json +3 -3
package/dist/harmony108.mjs
CHANGED
|
@@ -1,21 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { useCallback, useMemo } from "react";
|
|
2
|
+
import { useNavigationClient } from "./harmony16.mjs";
|
|
3
|
+
import { navigationItems } from "./harmony130.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 [];
|
|
15
16
|
}
|
|
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]);
|
|
17
43
|
};
|
|
18
44
|
export {
|
|
19
|
-
|
|
45
|
+
useNextgenNavigation
|
|
20
46
|
};
|
|
21
47
|
//# sourceMappingURL=harmony108.mjs.map
|
package/dist/harmony108.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony108.mjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"harmony108.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;"}
|
package/dist/harmony109.cjs
CHANGED
|
@@ -1,79 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const TeamMenuItem = require("./harmony138.cjs");
|
|
11
|
-
const TeamSettingsMenuItem = require("./harmony139.cjs");
|
|
12
|
-
const TeamSwitch = require("./harmony140.cjs");
|
|
13
|
-
const UpgradeMenuItem = require("./harmony141.cjs");
|
|
14
|
-
const useSidebar = require("./harmony110.cjs");
|
|
15
|
-
const louis = require("@lokalise/louis");
|
|
16
|
-
const permissions = require("./harmony111.cjs");
|
|
17
|
-
const clsx = require("./harmony93.cjs");
|
|
18
|
-
const ProfileMenu_module = require("./harmony142.cjs");
|
|
19
|
-
const UpgradeIcon = require("./harmony143.cjs");
|
|
20
|
-
const ProfileMenu = ({ config }) => {
|
|
21
|
-
const {
|
|
22
|
-
jwt,
|
|
23
|
-
data: { currentTeam }
|
|
24
|
-
} = useSidebar.useSidebar();
|
|
25
|
-
const {
|
|
26
|
-
darkModeToggle,
|
|
27
|
-
teamSwitch,
|
|
28
|
-
createTeam,
|
|
29
|
-
createTeamPlaceholder,
|
|
30
|
-
upgradeMenuItem,
|
|
31
|
-
profileSettings
|
|
32
|
-
} = config;
|
|
33
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
-
louis.Menu,
|
|
35
|
-
{
|
|
36
|
-
menuButton: () => {
|
|
37
|
-
var _a;
|
|
38
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("button", { className: ProfileMenu_module.default.profileButton, "aria-label": "Profile menu", type: "button", children: [
|
|
39
|
-
((_a = currentTeam.result) == null ? void 0 : _a.logoUrl) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
40
|
-
"img",
|
|
41
|
-
{
|
|
42
|
-
src: currentTeam.result.logoUrl,
|
|
43
|
-
className: clsx.clsx(ProfileMenu_module.default.profileImage, {
|
|
44
|
-
[ProfileMenu_module.default.profileImageHighlight]: permissions.canUpgradePlan(jwt)
|
|
45
|
-
}),
|
|
46
|
-
alt: "Team Logo"
|
|
47
|
-
}
|
|
48
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
-
"div",
|
|
50
|
-
{
|
|
51
|
-
className: clsx.clsx(ProfileMenu_module.default.userIconWrapper, "flex-row", "align-center", "items-center", {
|
|
52
|
-
[ProfileMenu_module.default.profileImageHighlight]: permissions.canUpgradePlan(jwt)
|
|
53
|
-
}),
|
|
54
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(louis.UserIcon, { size: "25px" })
|
|
55
|
-
}
|
|
56
|
-
),
|
|
57
|
-
permissions.canUpgradePlan(jwt) && /* @__PURE__ */ jsxRuntime.jsx(UpgradeIcon.UpgradeIcon, { className: ProfileMenu_module.default.profileImageUpgradeIcon })
|
|
58
|
-
] });
|
|
59
|
-
},
|
|
60
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(louis.MenuList, { placement: "right-end", className: ProfileMenu_module.default.menuContainer, children: [
|
|
61
|
-
teamSwitch && /* @__PURE__ */ jsxRuntime.jsx(TeamSwitch.TeamSwitch, { onSwitchTeam: teamSwitch.onSwitchTeam }),
|
|
62
|
-
createTeam && /* @__PURE__ */ jsxRuntime.jsx(CreateNewTeam.CreateNewTeam, { onCreateTeam: createTeam.onCreateTeam }),
|
|
63
|
-
createTeamPlaceholder && /* @__PURE__ */ jsxRuntime.jsx(CreateNewTeamPlaceholder.CreateNewTeamPlaceholder, { onClick: createTeamPlaceholder.onClick }),
|
|
64
|
-
/* @__PURE__ */ jsxRuntime.jsx(TeamMenuItem.TeamMenuItem, {}),
|
|
65
|
-
upgradeMenuItem && /* @__PURE__ */ jsxRuntime.jsx(UpgradeMenuItem.UpgradeMenuItem, { href: upgradeMenuItem.href }),
|
|
66
|
-
/* @__PURE__ */ jsxRuntime.jsx(BillingMenuItem.BillingMenuItem, {}),
|
|
67
|
-
/* @__PURE__ */ jsxRuntime.jsx(TeamSettingsMenuItem.TeamSettingsMenuItem, {}),
|
|
68
|
-
/* @__PURE__ */ jsxRuntime.jsx(ProviderMenuItem.ProviderMenuItem, {}),
|
|
69
|
-
/* @__PURE__ */ jsxRuntime.jsx(louis.MenuDivider, {}),
|
|
70
|
-
/* @__PURE__ */ jsxRuntime.jsx(ProfileSettingsMenuItem.ProfileSettingsMenuItem, { ...profileSettings ?? {} }),
|
|
71
|
-
darkModeToggle && /* @__PURE__ */ jsxRuntime.jsx(DarkModeToggle.DarkModeToggle, { ...darkModeToggle }),
|
|
72
|
-
(permissions.canAccessProfileSettings(jwt) || darkModeToggle) && /* @__PURE__ */ jsxRuntime.jsx(louis.MenuDivider, {}),
|
|
73
|
-
/* @__PURE__ */ jsxRuntime.jsx(louis.MenuItem, { href: "/login?action=logout", children: "Logout" })
|
|
74
|
-
] })
|
|
75
|
-
}
|
|
76
|
-
);
|
|
6
|
+
const jwtTokenPayload = require("./harmony20.cjs");
|
|
7
|
+
const _NewJwtIssuedEvent = class _NewJwtIssuedEvent extends CustomEvent {
|
|
8
|
+
constructor(token) {
|
|
9
|
+
super(_NewJwtIssuedEvent.eventName, {
|
|
10
|
+
detail: { token, payload: jwtTokenPayload.parseJwtTokenPayload(token.accessToken) }
|
|
11
|
+
});
|
|
12
|
+
}
|
|
77
13
|
};
|
|
78
|
-
|
|
14
|
+
__publicField(_NewJwtIssuedEvent, "eventName", "new-jwt-issued");
|
|
15
|
+
let NewJwtIssuedEvent = _NewJwtIssuedEvent;
|
|
16
|
+
exports.NewJwtIssuedEvent = NewJwtIssuedEvent;
|
|
79
17
|
//# sourceMappingURL=harmony109.cjs.map
|
package/dist/harmony109.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony109.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"harmony109.cjs","sources":["../src/features/auth/frontend/events/NewJwtIssuedEvent.ts"],"sourcesContent":["import type { JwtTokenPayload } from '@features/auth/core/types/jwtTokenPayload'\nimport { parseJwtTokenPayload } from '@features/auth/core/utils/jwtTokenPayload'\nimport type { JwtToken } from '@features/publicApi/types/userTokenTypes'\n\ntype NewJwtIssuedEventDetail = {\n\ttoken: JwtToken\n\tpayload: JwtTokenPayload | undefined\n}\n\n/**\n * This event is emitted when a new JWT token is issued or refreshed.\n */\nexport class NewJwtIssuedEvent extends CustomEvent<NewJwtIssuedEventDetail> {\n\tstatic readonly eventName = 'new-jwt-issued' as const\n\n\tconstructor(token: JwtToken) {\n\t\tsuper(NewJwtIssuedEvent.eventName, {\n\t\t\tdetail: { token, payload: parseJwtTokenPayload(token.accessToken) },\n\t\t})\n\t}\n}\n\nexport const isNewJwtIssuedEvent = (event: Event): event is NewJwtIssuedEvent =>\n\tevent.type === NewJwtIssuedEvent.eventName\n\ndeclare global {\n\tinterface WindowEventMap {\n\t\t[NewJwtIssuedEvent.eventName]: NewJwtIssuedEvent\n\t}\n}\n"],"names":["parseJwtTokenPayload"],"mappings":";;;;;;AAYO,MAAM,qBAAN,MAAM,2BAA0B,YAAqC;AAAA,EAG3E,YAAY,OAAiB;AAC5B,UAAM,mBAAkB,WAAW;AAAA,MAClC,QAAQ,EAAE,OAAO,SAASA,gBAAAA,qBAAqB,MAAM,WAAW,EAAE;AAAA,IAAA,CAClE;AAAA,EAAA;AAEH;AAPC,cADY,oBACI,aAAY;AADtB,IAAM,oBAAN;;"}
|
package/dist/harmony109.mjs
CHANGED
|
@@ -1,79 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { UpgradeMenuItem } from "./harmony141.mjs";
|
|
12
|
-
import { useSidebar } from "./harmony110.mjs";
|
|
13
|
-
import { Menu, MenuList, MenuDivider, MenuItem, UserIcon } from "@lokalise/louis";
|
|
14
|
-
import { canAccessProfileSettings, canUpgradePlan } from "./harmony111.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",
|
|
39
|
-
{
|
|
40
|
-
src: currentTeam.result.logoUrl,
|
|
41
|
-
className: clsx(styles.profileImage, {
|
|
42
|
-
[styles.profileImageHighlight]: canUpgradePlan(jwt)
|
|
43
|
-
}),
|
|
44
|
-
alt: "Team Logo"
|
|
45
|
-
}
|
|
46
|
-
) : /* @__PURE__ */ jsx(
|
|
47
|
-
"div",
|
|
48
|
-
{
|
|
49
|
-
className: clsx(styles.userIconWrapper, "flex-row", "align-center", "items-center", {
|
|
50
|
-
[styles.profileImageHighlight]: canUpgradePlan(jwt)
|
|
51
|
-
}),
|
|
52
|
-
children: /* @__PURE__ */ jsx(UserIcon, { size: "25px" })
|
|
53
|
-
}
|
|
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
|
-
);
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { parseJwtTokenPayload } from "./harmony20.mjs";
|
|
5
|
+
const _NewJwtIssuedEvent = class _NewJwtIssuedEvent extends CustomEvent {
|
|
6
|
+
constructor(token) {
|
|
7
|
+
super(_NewJwtIssuedEvent.eventName, {
|
|
8
|
+
detail: { token, payload: parseJwtTokenPayload(token.accessToken) }
|
|
9
|
+
});
|
|
10
|
+
}
|
|
75
11
|
};
|
|
12
|
+
__publicField(_NewJwtIssuedEvent, "eventName", "new-jwt-issued");
|
|
13
|
+
let NewJwtIssuedEvent = _NewJwtIssuedEvent;
|
|
76
14
|
export {
|
|
77
|
-
|
|
15
|
+
NewJwtIssuedEvent
|
|
78
16
|
};
|
|
79
17
|
//# sourceMappingURL=harmony109.mjs.map
|
package/dist/harmony109.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony109.mjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"harmony109.mjs","sources":["../src/features/auth/frontend/events/NewJwtIssuedEvent.ts"],"sourcesContent":["import type { JwtTokenPayload } from '@features/auth/core/types/jwtTokenPayload'\nimport { parseJwtTokenPayload } from '@features/auth/core/utils/jwtTokenPayload'\nimport type { JwtToken } from '@features/publicApi/types/userTokenTypes'\n\ntype NewJwtIssuedEventDetail = {\n\ttoken: JwtToken\n\tpayload: JwtTokenPayload | undefined\n}\n\n/**\n * This event is emitted when a new JWT token is issued or refreshed.\n */\nexport class NewJwtIssuedEvent extends CustomEvent<NewJwtIssuedEventDetail> {\n\tstatic readonly eventName = 'new-jwt-issued' as const\n\n\tconstructor(token: JwtToken) {\n\t\tsuper(NewJwtIssuedEvent.eventName, {\n\t\t\tdetail: { token, payload: parseJwtTokenPayload(token.accessToken) },\n\t\t})\n\t}\n}\n\nexport const isNewJwtIssuedEvent = (event: Event): event is NewJwtIssuedEvent =>\n\tevent.type === NewJwtIssuedEvent.eventName\n\ndeclare global {\n\tinterface WindowEventMap {\n\t\t[NewJwtIssuedEvent.eventName]: NewJwtIssuedEvent\n\t}\n}\n"],"names":[],"mappings":";;;;AAYO,MAAM,qBAAN,MAAM,2BAA0B,YAAqC;AAAA,EAG3E,YAAY,OAAiB;AAC5B,UAAM,mBAAkB,WAAW;AAAA,MAClC,QAAQ,EAAE,OAAO,SAAS,qBAAqB,MAAM,WAAW,EAAE;AAAA,IAAA,CAClE;AAAA,EAAA;AAEH;AAPC,cADY,oBACI,aAAY;AADtB,IAAM,oBAAN;"}
|
package/dist/harmony110.cjs
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const SidebarContext = require("./harmony107.cjs");
|
|
4
3
|
const React = require("react");
|
|
5
|
-
const
|
|
6
|
-
|
|
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;
|
|
13
|
-
};
|
|
14
|
-
exports.useSidebar = useSidebar;
|
|
4
|
+
const SidebarContext = React.createContext({});
|
|
5
|
+
exports.SidebarContext = SidebarContext;
|
|
15
6
|
//# sourceMappingURL=harmony110.cjs.map
|
package/dist/harmony110.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony110.cjs","sources":["../src/components/Sidebar/
|
|
1
|
+
{"version":3,"file":"harmony110.cjs","sources":["../src/components/Sidebar/SidebarContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { SidebarContextProps } from './types'\n\nexport const SidebarContext = createContext({} as SidebarContextProps)\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":["createContext"],"mappings":";;;AAGa,MAAA,iBAAiBA,MAAc,cAAA,CAAyB,CAAA;;"}
|
package/dist/harmony110.mjs
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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;
|
|
11
|
-
};
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
const SidebarContext = createContext({});
|
|
12
3
|
export {
|
|
13
|
-
|
|
4
|
+
SidebarContext
|
|
14
5
|
};
|
|
15
6
|
//# sourceMappingURL=harmony110.mjs.map
|
package/dist/harmony110.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony110.mjs","sources":["../src/components/Sidebar/
|
|
1
|
+
{"version":3,"file":"harmony110.mjs","sources":["../src/components/Sidebar/SidebarContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { SidebarContextProps } from './types'\n\nexport const SidebarContext = createContext({} as SidebarContextProps)\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":";AAGa,MAAA,iBAAiB,cAAc,CAAyB,CAAA;"}
|
package/dist/harmony111.cjs
CHANGED
|
@@ -1,37 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 clsx = require("./harmony93.cjs");
|
|
6
|
+
const IconLink_module = require("./harmony133.cjs");
|
|
7
|
+
const IconLink = ({ label, to, icon: Icon }) => {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntime.jsx(louis.Tooltip, { placement: "right", tooltip: label, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
|
+
louis.Link,
|
|
10
|
+
{
|
|
11
|
+
"aria-label": label,
|
|
12
|
+
className: clsx.clsx(IconLink_module.default.link, {
|
|
13
|
+
[IconLink_module.default.active]: typeof window !== "undefined" && window.location.pathname.startsWith(to)
|
|
14
|
+
}),
|
|
15
|
+
href: to,
|
|
16
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: "25px" })
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
19
|
+
};
|
|
20
|
+
exports.IconLink = IconLink;
|
|
37
21
|
//# sourceMappingURL=harmony111.cjs.map
|
package/dist/harmony111.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony111.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"harmony111.cjs","sources":["../src/components/Sidebar/Widgets/IconLink/IconLink.tsx"],"sourcesContent":["import { Link, type SvgIconProps, Tooltip } from '@lokalise/louis'\nimport clsx from 'clsx'\nimport type { FC } from 'react'\nimport styles from './IconLink.module.css'\n\ntype IconLinkProps = {\n\t/** URL destination for the link */\n\tto: string\n\t/** Text to display in the tooltip when hovering over the icon */\n\tlabel: string\n\t/** Icon component from @lokalise/louis to display */\n\ticon: FC<SvgIconProps>\n}\n\n/**\n * A navigation link component that displays an icon with a tooltip.\n * When hovered, shows a tooltip with the label text.\n * The link is highlighted when the current URL matches its destination.\n *\n * @example\n * ```tsx\n * <IconLink to=\"/projects\" label=\"Projects\" icon={FolderOpenIcon} />\n * ```\n */\nexport const IconLink = ({ label, to, icon: Icon }: IconLinkProps) => {\n\treturn (\n\t\t<Tooltip placement=\"right\" tooltip={label}>\n\t\t\t<Link\n\t\t\t\taria-label={label}\n\t\t\t\tclassName={clsx(styles.link, {\n\t\t\t\t\t[styles.active]: typeof window !== 'undefined' && window.location.pathname.startsWith(to),\n\t\t\t\t})}\n\t\t\t\thref={to}\n\t\t\t>\n\t\t\t\t<Icon size=\"25px\" />\n\t\t\t</Link>\n\t\t</Tooltip>\n\t)\n}\n"],"names":["jsx","Tooltip","Link","clsx","styles"],"mappings":";;;;;;AAwBO,MAAM,WAAW,CAAC,EAAE,OAAO,IAAI,MAAM,WAA0B;AACrE,SACEA,2BAAA,IAAAC,MAAA,SAAA,EAAQ,WAAU,SAAQ,SAAS,OACnC,UAAAD,2BAAA;AAAA,IAACE,MAAA;AAAA,IAAA;AAAA,MACA,cAAY;AAAA,MACZ,WAAWC,KAAAA,KAAKC,gBAAA,QAAO,MAAM;AAAA,QAC5B,CAACA,gBAAO,QAAA,MAAM,GAAG,OAAO,WAAW,eAAe,OAAO,SAAS,SAAS,WAAW,EAAE;AAAA,MAAA,CACxF;AAAA,MACD,MAAM;AAAA,MAEN,UAAAJ,2BAAAA,IAAC,MAAK,EAAA,MAAK,OAAO,CAAA;AAAA,IAAA;AAAA,EAAA,GAEpB;AAEF;;"}
|
package/dist/harmony111.mjs
CHANGED
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
|
|
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 { Tooltip, Link } from "@lokalise/louis";
|
|
3
|
+
import { clsx } from "./harmony93.mjs";
|
|
4
|
+
import styles from "./harmony133.mjs";
|
|
5
|
+
const IconLink = ({ label, to, icon: Icon }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(Tooltip, { placement: "right", tooltip: label, children: /* @__PURE__ */ jsx(
|
|
7
|
+
Link,
|
|
8
|
+
{
|
|
9
|
+
"aria-label": label,
|
|
10
|
+
className: clsx(styles.link, {
|
|
11
|
+
[styles.active]: typeof window !== "undefined" && window.location.pathname.startsWith(to)
|
|
12
|
+
}),
|
|
13
|
+
href: to,
|
|
14
|
+
children: /* @__PURE__ */ jsx(Icon, { size: "25px" })
|
|
15
|
+
}
|
|
16
|
+
) });
|
|
17
|
+
};
|
|
27
18
|
export {
|
|
28
|
-
|
|
29
|
-
canAccessProviderDashboard,
|
|
30
|
-
canAccessReporting,
|
|
31
|
-
canAccessStyleGuide,
|
|
32
|
-
canAccessTeamSettings,
|
|
33
|
-
canChangeBilling,
|
|
34
|
-
canCreateTeam,
|
|
35
|
-
canUpgradePlan
|
|
19
|
+
IconLink
|
|
36
20
|
};
|
|
37
21
|
//# sourceMappingURL=harmony111.mjs.map
|
package/dist/harmony111.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony111.mjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"harmony111.mjs","sources":["../src/components/Sidebar/Widgets/IconLink/IconLink.tsx"],"sourcesContent":["import { Link, type SvgIconProps, Tooltip } from '@lokalise/louis'\nimport clsx from 'clsx'\nimport type { FC } from 'react'\nimport styles from './IconLink.module.css'\n\ntype IconLinkProps = {\n\t/** URL destination for the link */\n\tto: string\n\t/** Text to display in the tooltip when hovering over the icon */\n\tlabel: string\n\t/** Icon component from @lokalise/louis to display */\n\ticon: FC<SvgIconProps>\n}\n\n/**\n * A navigation link component that displays an icon with a tooltip.\n * When hovered, shows a tooltip with the label text.\n * The link is highlighted when the current URL matches its destination.\n *\n * @example\n * ```tsx\n * <IconLink to=\"/projects\" label=\"Projects\" icon={FolderOpenIcon} />\n * ```\n */\nexport const IconLink = ({ label, to, icon: Icon }: IconLinkProps) => {\n\treturn (\n\t\t<Tooltip placement=\"right\" tooltip={label}>\n\t\t\t<Link\n\t\t\t\taria-label={label}\n\t\t\t\tclassName={clsx(styles.link, {\n\t\t\t\t\t[styles.active]: typeof window !== 'undefined' && window.location.pathname.startsWith(to),\n\t\t\t\t})}\n\t\t\t\thref={to}\n\t\t\t>\n\t\t\t\t<Icon size=\"25px\" />\n\t\t\t</Link>\n\t\t</Tooltip>\n\t)\n}\n"],"names":[],"mappings":";;;;AAwBO,MAAM,WAAW,CAAC,EAAE,OAAO,IAAI,MAAM,WAA0B;AACrE,SACE,oBAAA,SAAA,EAAQ,WAAU,SAAQ,SAAS,OACnC,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,cAAY;AAAA,MACZ,WAAW,KAAK,OAAO,MAAM;AAAA,QAC5B,CAAC,OAAO,MAAM,GAAG,OAAO,WAAW,eAAe,OAAO,SAAS,SAAS,WAAW,EAAE;AAAA,MAAA,CACxF;AAAA,MACD,MAAM;AAAA,MAEN,UAAA,oBAAC,MAAK,EAAA,MAAK,OAAO,CAAA;AAAA,IAAA;AAAA,EAAA,GAEpB;AAEF;"}
|