@lokalise/harmony 2.0.6 → 2.0.8
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/harmony102.cjs +1 -1
- package/dist/harmony102.mjs +1 -1
- package/dist/harmony103.cjs +7 -7
- package/dist/harmony103.mjs +7 -7
- package/dist/harmony105.cjs +2 -2
- package/dist/harmony105.mjs +2 -2
- package/dist/harmony106.cjs +14 -3
- package/dist/harmony106.cjs.map +1 -1
- package/dist/harmony106.mjs +14 -3
- package/dist/harmony106.mjs.map +1 -1
- package/dist/harmony107.cjs +3 -18
- package/dist/harmony107.cjs.map +1 -1
- package/dist/harmony107.mjs +3 -18
- package/dist/harmony107.mjs.map +1 -1
- package/dist/harmony108.cjs +12 -70
- package/dist/harmony108.cjs.map +1 -1
- package/dist/harmony108.mjs +14 -72
- package/dist/harmony108.mjs.map +1 -1
- package/dist/harmony109.cjs +75 -11
- package/dist/harmony109.cjs.map +1 -1
- package/dist/harmony109.mjs +75 -11
- package/dist/harmony109.mjs.map +1 -1
- package/dist/harmony110.cjs +12 -34
- package/dist/harmony110.cjs.map +1 -1
- package/dist/harmony110.mjs +12 -34
- package/dist/harmony110.mjs.map +1 -1
- package/dist/harmony111.cjs +34 -9
- package/dist/harmony111.cjs.map +1 -1
- package/dist/harmony111.mjs +34 -9
- package/dist/harmony111.mjs.map +1 -1
- package/dist/harmony112.cjs +8 -46
- package/dist/harmony112.cjs.map +1 -1
- package/dist/harmony112.mjs +9 -47
- package/dist/harmony112.mjs.map +1 -1
- package/dist/harmony113.cjs +47 -9
- package/dist/harmony113.cjs.map +1 -1
- package/dist/harmony113.mjs +46 -8
- package/dist/harmony113.mjs.map +1 -1
- package/dist/harmony114.cjs +9 -12
- package/dist/harmony114.cjs.map +1 -1
- package/dist/harmony114.mjs +8 -11
- package/dist/harmony114.mjs.map +1 -1
- package/dist/harmony115.cjs +166 -12
- package/dist/harmony115.cjs.map +1 -1
- package/dist/harmony115.mjs +165 -11
- package/dist/harmony115.mjs.map +1 -1
- package/dist/harmony116.cjs +44 -11
- package/dist/harmony116.cjs.map +1 -1
- package/dist/harmony116.mjs +44 -11
- package/dist/harmony116.mjs.map +1 -1
- package/dist/harmony117.cjs +12 -21
- package/dist/harmony117.cjs.map +1 -1
- package/dist/harmony117.mjs +11 -20
- package/dist/harmony117.mjs.map +1 -1
- package/dist/harmony118.cjs +12 -166
- package/dist/harmony118.cjs.map +1 -1
- package/dist/harmony118.mjs +11 -165
- package/dist/harmony118.mjs.map +1 -1
- package/dist/harmony119.cjs +11 -44
- package/dist/harmony119.cjs.map +1 -1
- package/dist/harmony119.mjs +11 -44
- package/dist/harmony119.mjs.map +1 -1
- package/dist/harmony120.cjs +21 -14
- package/dist/harmony120.cjs.map +1 -1
- package/dist/harmony120.mjs +20 -13
- package/dist/harmony120.mjs.map +1 -1
- package/dist/harmony122.cjs.map +1 -1
- package/dist/harmony122.mjs.map +1 -1
- package/dist/harmony129.cjs +2 -2
- package/dist/harmony129.mjs +2 -2
- package/dist/harmony130.cjs +2 -2
- package/dist/harmony130.mjs +2 -2
- package/dist/harmony131.cjs +2 -2
- package/dist/harmony131.mjs +2 -2
- package/dist/harmony133.cjs +2 -2
- package/dist/harmony133.mjs +2 -2
- package/dist/harmony134.cjs +2 -2
- package/dist/harmony134.mjs +2 -2
- package/dist/harmony135.cjs +1 -1
- package/dist/harmony135.mjs +1 -1
- package/dist/harmony136.cjs +2 -2
- package/dist/harmony136.mjs +2 -2
- package/dist/harmony137.cjs +1 -1
- package/dist/harmony137.mjs +1 -1
- package/dist/harmony138.cjs +2 -2
- package/dist/harmony138.mjs +2 -2
- package/dist/harmony143.cjs +1 -1
- package/dist/harmony143.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/harmony165.cjs +30 -8
- package/dist/harmony165.cjs.map +1 -1
- package/dist/harmony165.mjs +30 -8
- package/dist/harmony165.mjs.map +1 -1
- package/dist/harmony166.cjs +8 -30
- package/dist/harmony166.cjs.map +1 -1
- package/dist/harmony166.mjs +8 -30
- package/dist/harmony166.mjs.map +1 -1
- package/dist/harmony17.cjs +1 -1
- package/dist/harmony17.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/harmony34.cjs.map +1 -1
- package/dist/harmony34.mjs.map +1 -1
- package/dist/harmony88.cjs +2 -2
- package/dist/harmony88.cjs.map +1 -1
- package/dist/harmony88.mjs +2 -2
- package/dist/harmony88.mjs.map +1 -1
- package/dist/harmony96.cjs +2 -2
- package/dist/harmony96.mjs +2 -2
- package/dist/harmony98.cjs +2 -2
- package/dist/harmony98.mjs +2 -2
- package/dist/types/src/features/permissions/components/ProjectActionResolverContextProvider.d.ts +2 -2
- package/dist/types/src/features/permissions/context/ActionsContext.d.ts +2 -2
- package/dist/types/src/features/publicApi/teamUsers.d.ts +2 -2
- package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +4 -4
- package/package.json +1 -1
package/dist/harmony102.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
|
-
const SidebarContext = require("./
|
|
5
|
+
const SidebarContext = require("./harmony107.cjs");
|
|
6
6
|
const SidebarProvider = ({
|
|
7
7
|
data,
|
|
8
8
|
jwt,
|
package/dist/harmony102.mjs
CHANGED
package/dist/harmony103.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const IconLink = require("./
|
|
5
|
-
const ProfileMenu = require("./
|
|
6
|
-
const useSidebar = require("./
|
|
4
|
+
const IconLink = require("./harmony108.cjs");
|
|
5
|
+
const ProfileMenu = require("./harmony109.cjs");
|
|
6
|
+
const useSidebar = require("./harmony110.cjs");
|
|
7
7
|
const louis = require("@lokalise/louis");
|
|
8
|
-
const permissions = require("./
|
|
9
|
-
const Avatar = require("./
|
|
10
|
-
const HelpMenu = require("./
|
|
11
|
-
const SidebarContent_module = require("./
|
|
8
|
+
const permissions = require("./harmony111.cjs");
|
|
9
|
+
const Avatar = require("./harmony112.cjs");
|
|
10
|
+
const HelpMenu = require("./harmony113.cjs");
|
|
11
|
+
const SidebarContent_module = require("./harmony114.cjs");
|
|
12
12
|
const SidebarContent = ({ widgetsConfig, children, ...navProps }) => {
|
|
13
13
|
const sidebarContextProps = useSidebar.useSidebar();
|
|
14
14
|
const { jwt } = sidebarContextProps;
|
package/dist/harmony103.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { IconLink } from "./
|
|
3
|
-
import { ProfileMenu } from "./
|
|
4
|
-
import { useSidebar } from "./
|
|
2
|
+
import { IconLink } from "./harmony108.mjs";
|
|
3
|
+
import { ProfileMenu } from "./harmony109.mjs";
|
|
4
|
+
import { useSidebar } from "./harmony110.mjs";
|
|
5
5
|
import { Skeleton, Rectangle, ProjectIcon, ShoppingBagIcon, StyleguideIcon, ChartLineIcon } from "@lokalise/louis";
|
|
6
|
-
import { canAccessStyleGuide, canAccessReporting } from "./
|
|
7
|
-
import { Avatar } from "./
|
|
8
|
-
import { HelpMenu } from "./
|
|
9
|
-
import styles from "./
|
|
6
|
+
import { canAccessStyleGuide, canAccessReporting } from "./harmony111.mjs";
|
|
7
|
+
import { Avatar } from "./harmony112.mjs";
|
|
8
|
+
import { HelpMenu } from "./harmony113.mjs";
|
|
9
|
+
import styles from "./harmony114.mjs";
|
|
10
10
|
const SidebarContent = ({ widgetsConfig, children, ...navProps }) => {
|
|
11
11
|
const sidebarContextProps = useSidebar();
|
|
12
12
|
const { jwt } = sidebarContextProps;
|
package/dist/harmony105.cjs
CHANGED
|
@@ -4,8 +4,8 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const louis = require("@lokalise/louis");
|
|
5
5
|
const reactTable = require("@tanstack/react-table");
|
|
6
6
|
const clsx = require("./harmony92.cjs");
|
|
7
|
-
const SortingIcon = require("./
|
|
8
|
-
const TableHeaderCell_module = require("./
|
|
7
|
+
const SortingIcon = require("./harmony117.cjs");
|
|
8
|
+
const TableHeaderCell_module = require("./harmony118.cjs");
|
|
9
9
|
const TableHeaderCell = ({
|
|
10
10
|
header,
|
|
11
11
|
align = "left",
|
package/dist/harmony105.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { TableHeaderCell as TableHeaderCell$1 } from "@lokalise/louis";
|
|
3
3
|
import { flexRender } from "@tanstack/react-table";
|
|
4
4
|
import { clsx } from "./harmony92.mjs";
|
|
5
|
-
import { SortingIcon } from "./
|
|
6
|
-
import styles from "./
|
|
5
|
+
import { SortingIcon } from "./harmony117.mjs";
|
|
6
|
+
import styles from "./harmony118.mjs";
|
|
7
7
|
const TableHeaderCell = ({
|
|
8
8
|
header,
|
|
9
9
|
align = "left",
|
package/dist/harmony106.cjs
CHANGED
|
@@ -1,6 +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
|
+
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
|
+
}
|
|
13
|
+
};
|
|
14
|
+
__publicField(_NewJwtIssuedEvent, "eventName", "new-jwt-issued");
|
|
15
|
+
let NewJwtIssuedEvent = _NewJwtIssuedEvent;
|
|
16
|
+
exports.NewJwtIssuedEvent = NewJwtIssuedEvent;
|
|
6
17
|
//# sourceMappingURL=harmony106.cjs.map
|
package/dist/harmony106.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony106.cjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"harmony106.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/harmony106.mjs
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
}
|
|
11
|
+
};
|
|
12
|
+
__publicField(_NewJwtIssuedEvent, "eventName", "new-jwt-issued");
|
|
13
|
+
let NewJwtIssuedEvent = _NewJwtIssuedEvent;
|
|
3
14
|
export {
|
|
4
|
-
|
|
15
|
+
NewJwtIssuedEvent
|
|
5
16
|
};
|
|
6
17
|
//# sourceMappingURL=harmony106.mjs.map
|
package/dist/harmony106.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony106.mjs","sources":["../src/
|
|
1
|
+
{"version":3,"file":"harmony106.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/harmony107.cjs
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const IconLink_module = require("./harmony128.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;
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const SidebarContext = React.createContext({});
|
|
5
|
+
exports.SidebarContext = SidebarContext;
|
|
21
6
|
//# sourceMappingURL=harmony107.cjs.map
|
package/dist/harmony107.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony107.cjs","sources":["../src/components/Sidebar/
|
|
1
|
+
{"version":3,"file":"harmony107.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/harmony107.mjs
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { clsx } from "./harmony92.mjs";
|
|
4
|
-
import styles from "./harmony128.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
|
-
};
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
const SidebarContext = createContext({});
|
|
18
3
|
export {
|
|
19
|
-
|
|
4
|
+
SidebarContext
|
|
20
5
|
};
|
|
21
6
|
//# sourceMappingURL=harmony107.mjs.map
|
package/dist/harmony107.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony107.mjs","sources":["../src/components/Sidebar/
|
|
1
|
+
{"version":3,"file":"harmony107.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/harmony108.cjs
CHANGED
|
@@ -1,79 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const BillingMenuItem = require("./harmony129.cjs");
|
|
5
|
-
const CreateNewTeam = require("./harmony130.cjs");
|
|
6
|
-
const CreateNewTeamPlaceholder = require("./harmony131.cjs");
|
|
7
|
-
const DarkModeToggle = require("./harmony132.cjs");
|
|
8
|
-
const ProfileSettingsMenuItem = require("./harmony133.cjs");
|
|
9
|
-
const ProviderMenuItem = require("./harmony134.cjs");
|
|
10
|
-
const TeamMenuItem = require("./harmony135.cjs");
|
|
11
|
-
const TeamSettingsMenuItem = require("./harmony136.cjs");
|
|
12
|
-
const TeamSwitch = require("./harmony137.cjs");
|
|
13
|
-
const UpgradeMenuItem = require("./harmony138.cjs");
|
|
14
|
-
const useSidebar = require("./harmony109.cjs");
|
|
15
4
|
const louis = require("@lokalise/louis");
|
|
16
|
-
const permissions = require("./harmony110.cjs");
|
|
17
5
|
const clsx = require("./harmony92.cjs");
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
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,
|
|
6
|
+
const IconLink_module = require("./harmony128.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,
|
|
35
10
|
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
] })
|
|
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" })
|
|
75
17
|
}
|
|
76
|
-
);
|
|
18
|
+
) });
|
|
77
19
|
};
|
|
78
|
-
exports.
|
|
20
|
+
exports.IconLink = IconLink;
|
|
79
21
|
//# sourceMappingURL=harmony108.cjs.map
|
package/dist/harmony108.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony108.cjs","sources":["../src/components/Sidebar/Widgets/
|
|
1
|
+
{"version":3,"file":"harmony108.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/harmony108.mjs
CHANGED
|
@@ -1,79 +1,21 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
3
|
-
import { CreateNewTeam } from "./harmony130.mjs";
|
|
4
|
-
import { CreateNewTeamPlaceholder } from "./harmony131.mjs";
|
|
5
|
-
import { DarkModeToggle } from "./harmony132.mjs";
|
|
6
|
-
import { ProfileSettingsMenuItem } from "./harmony133.mjs";
|
|
7
|
-
import { ProviderMenuItem } from "./harmony134.mjs";
|
|
8
|
-
import { TeamMenuItem } from "./harmony135.mjs";
|
|
9
|
-
import { TeamSettingsMenuItem } from "./harmony136.mjs";
|
|
10
|
-
import { TeamSwitch } from "./harmony137.mjs";
|
|
11
|
-
import { UpgradeMenuItem } from "./harmony138.mjs";
|
|
12
|
-
import { useSidebar } from "./harmony109.mjs";
|
|
13
|
-
import { Menu, MenuList, MenuDivider, MenuItem, UserIcon } from "@lokalise/louis";
|
|
14
|
-
import { canAccessProfileSettings, canUpgradePlan } from "./harmony110.mjs";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip, Link } from "@lokalise/louis";
|
|
15
3
|
import { clsx } from "./harmony92.mjs";
|
|
16
|
-
import styles from "./
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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,
|
|
4
|
+
import styles from "./harmony128.mjs";
|
|
5
|
+
const IconLink = ({ label, to, icon: Icon }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(Tooltip, { placement: "right", tooltip: label, children: /* @__PURE__ */ jsx(
|
|
7
|
+
Link,
|
|
33
8
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
] })
|
|
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" })
|
|
73
15
|
}
|
|
74
|
-
);
|
|
16
|
+
) });
|
|
75
17
|
};
|
|
76
18
|
export {
|
|
77
|
-
|
|
19
|
+
IconLink
|
|
78
20
|
};
|
|
79
21
|
//# sourceMappingURL=harmony108.mjs.map
|
package/dist/harmony108.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony108.mjs","sources":["../src/components/Sidebar/Widgets/
|
|
1
|
+
{"version":3,"file":"harmony108.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;"}
|
package/dist/harmony109.cjs
CHANGED
|
@@ -1,15 +1,79 @@
|
|
|
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
|
-
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const BillingMenuItem = require("./harmony129.cjs");
|
|
5
|
+
const CreateNewTeam = require("./harmony130.cjs");
|
|
6
|
+
const CreateNewTeamPlaceholder = require("./harmony131.cjs");
|
|
7
|
+
const DarkModeToggle = require("./harmony132.cjs");
|
|
8
|
+
const ProfileSettingsMenuItem = require("./harmony133.cjs");
|
|
9
|
+
const ProviderMenuItem = require("./harmony134.cjs");
|
|
10
|
+
const TeamMenuItem = require("./harmony135.cjs");
|
|
11
|
+
const TeamSettingsMenuItem = require("./harmony136.cjs");
|
|
12
|
+
const TeamSwitch = require("./harmony137.cjs");
|
|
13
|
+
const UpgradeMenuItem = require("./harmony138.cjs");
|
|
14
|
+
const useSidebar = require("./harmony110.cjs");
|
|
15
|
+
const louis = require("@lokalise/louis");
|
|
16
|
+
const permissions = require("./harmony111.cjs");
|
|
17
|
+
const clsx = require("./harmony92.cjs");
|
|
18
|
+
const ProfileMenu_module = require("./harmony139.cjs");
|
|
19
|
+
const UpgradeIcon = require("./harmony140.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
|
+
);
|
|
13
77
|
};
|
|
14
|
-
exports.
|
|
78
|
+
exports.ProfileMenu = ProfileMenu;
|
|
15
79
|
//# sourceMappingURL=harmony109.cjs.map
|
package/dist/harmony109.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony109.cjs","sources":["../src/components/Sidebar/
|
|
1
|
+
{"version":3,"file":"harmony109.cjs","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":["useSidebar","jsx","Menu","jsxs","styles","clsx","canUpgradePlan","UserIcon","UpgradeIcon","MenuList","TeamSwitch","CreateNewTeam","CreateNewTeamPlaceholder","TeamMenuItem","UpgradeMenuItem","BillingMenuItem","TeamSettingsMenuItem","ProviderMenuItem","MenuDivider","ProfileSettingsMenuItem","DarkModeToggle","canAccessProfileSettings","MenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;AAkCO,MAAM,cAAc,CAAC,EAAE,aAA+B;AACtD,QAAA;AAAA,IACL;AAAA,IACA,MAAM,EAAE,YAAY;AAAA,MACjBA,sBAAW;AAET,QAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACG;AAGH,SAAAC,2BAAA;AAAA,IAACC,MAAA;AAAA,IAAA;AAAA,MACA,YAAY,MACXC;;AAAAA,0CAAAA,KAAC,UAAO,EAAA,WAAWC,mBAAAA,QAAO,eAAe,cAAW,gBAAe,MAAK,UACtE,UAAA;AAAA,YAAA,iBAAY,WAAZ,mBAAoB,WACpBH,2BAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACA,KAAK,YAAY,OAAO;AAAA,cACxB,WAAWI,KAAAA,KAAKD,mBAAA,QAAO,cAAc;AAAA,gBACpC,CAACA,mBAAA,QAAO,qBAAqB,GAAGE,YAAAA,eAAe,GAAG;AAAA,cAAA,CAClD;AAAA,cACD,KAAI;AAAA,YAAA;AAAA,UAAA,IAGLL,2BAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACA,WAAWI,KAAK,KAAAD,mBAAA,QAAO,iBAAiB,YAAY,gBAAgB,gBAAgB;AAAA,gBACnF,CAACA,mBAAA,QAAO,qBAAqB,GAAGE,YAAAA,eAAe,GAAG;AAAA,cAAA,CAClD;AAAA,cAED,UAAAL,2BAAAA,IAACM,MAAAA,UAAS,EAAA,MAAK,OAAO,CAAA;AAAA,YAAA;AAAA,UACvB;AAAA,UAEAD,2BAAe,GAAG,oCAAME,YAAY,aAAA,EAAA,WAAWJ,2BAAO,wBAAyB,CAAA;AAAA,QAAA,GACjF;AAAA;AAAA,MAGD,0CAACK,MAAS,UAAA,EAAA,WAAU,aAAY,WAAWL,mBAAAA,QAAO,eAChD,UAAA;AAAA,QAAA,cAAeH,2BAAA,IAAAS,WAAA,YAAA,EAAW,cAAc,WAAW,cAAc;AAAA,QACjE,cAAcT,2BAAA,IAACU,cAAc,eAAA,EAAA,cAAc,WAAW,cAAc;AAAA,QACpE,yBACAV,2BAAA,IAACW,yBAAyB,0BAAA,EAAA,SAAS,sBAAsB,SAAS;AAAA,uCAElEC,aAAa,cAAA,EAAA;AAAA,QACb,mBAAmBZ,2BAAA,IAACa,gBAAgB,iBAAA,EAAA,MAAM,gBAAgB,MAAM;AAAA,uCAChEC,gBAAgB,iBAAA,EAAA;AAAA,uCAChBC,qBAAqB,sBAAA,EAAA;AAAA,uCACrBC,iBAAiB,kBAAA,EAAA;AAAA,uCACjBC,MAAY,aAAA,EAAA;AAAA,QAEZjB,2BAAAA,IAAAkB,wBAAAA,yBAAA,EAAyB,GAAI,mBAAmB,CAAK,EAAA,CAAA;AAAA,QACrD,kBAAkBlB,2BAAAA,IAACmB,eAAAA,gBAAgB,EAAA,GAAG,eAAgB,CAAA;AAAA,SACrDC,YAAAA,yBAAyB,GAAG,KAAK,kDAAoBH,MAAY,aAAA,EAAA;AAAA,QAElEjB,2BAAA,IAAAqB,MAAA,UAAA,EAAS,MAAK,wBAAuB,UAAM,SAAA,CAAA;AAAA,MAAA,EAC7C,CAAA;AAAA,IAAA;AAAA,EACD;AAEF;;"}
|