@lokalise/harmony 2.0.1 → 2.0.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.
- package/dist/harmony.cjs +2 -1
- package/dist/harmony.cjs.map +1 -1
- package/dist/harmony.mjs +3 -2
- package/dist/harmony103.cjs +2 -1
- package/dist/harmony103.cjs.map +1 -1
- package/dist/harmony103.mjs +4 -3
- package/dist/harmony103.mjs.map +1 -1
- package/dist/harmony110.cjs +1 -1
- package/dist/harmony110.mjs +1 -1
- package/dist/harmony111.cjs +12 -12
- package/dist/harmony111.mjs +12 -12
- package/dist/harmony113.cjs +4 -0
- package/dist/harmony113.cjs.map +1 -1
- package/dist/harmony113.mjs +4 -0
- package/dist/harmony113.mjs.map +1 -1
- package/dist/harmony114.cjs +1 -1
- package/dist/harmony114.mjs +1 -1
- package/dist/harmony115.cjs +1 -1
- package/dist/harmony115.mjs +1 -1
- package/dist/harmony121.cjs +99 -20
- package/dist/harmony121.cjs.map +1 -1
- package/dist/harmony121.mjs +82 -20
- package/dist/harmony121.mjs.map +1 -1
- package/dist/harmony126.cjs +6 -6
- package/dist/harmony126.mjs +6 -6
- package/dist/harmony127.cjs +1 -1
- package/dist/harmony127.mjs +1 -1
- package/dist/harmony129.cjs +21 -10
- package/dist/harmony129.cjs.map +1 -1
- package/dist/harmony129.mjs +20 -9
- package/dist/harmony129.mjs.map +1 -1
- package/dist/harmony130.cjs +9 -12
- package/dist/harmony130.cjs.map +1 -1
- package/dist/harmony130.mjs +8 -11
- package/dist/harmony130.mjs.map +1 -1
- package/dist/harmony131.cjs +4 -7
- package/dist/harmony131.cjs.map +1 -1
- package/dist/harmony131.mjs +7 -10
- package/dist/harmony131.mjs.map +1 -1
- package/dist/harmony132.cjs +3 -7
- package/dist/harmony132.cjs.map +1 -1
- package/dist/harmony132.mjs +3 -7
- package/dist/harmony132.mjs.map +1 -1
- package/dist/harmony133.cjs +16 -7
- package/dist/harmony133.cjs.map +1 -1
- package/dist/harmony133.mjs +18 -9
- package/dist/harmony133.mjs.map +1 -1
- package/dist/harmony134.cjs +7 -23
- package/dist/harmony134.cjs.map +1 -1
- package/dist/harmony134.mjs +8 -24
- package/dist/harmony134.mjs.map +1 -1
- package/dist/harmony135.cjs +18 -4
- package/dist/harmony135.cjs.map +1 -1
- package/dist/harmony135.mjs +20 -6
- package/dist/harmony135.mjs.map +1 -1
- package/dist/harmony136.cjs +6 -32
- package/dist/harmony136.cjs.map +1 -1
- package/dist/harmony136.mjs +8 -34
- package/dist/harmony136.mjs.map +1 -1
- package/dist/harmony137.cjs +32 -6
- package/dist/harmony137.cjs.map +1 -1
- package/dist/harmony137.mjs +34 -8
- package/dist/harmony137.mjs.map +1 -1
- package/dist/harmony138.cjs +7 -17
- package/dist/harmony138.cjs.map +1 -1
- package/dist/harmony138.mjs +7 -17
- package/dist/harmony138.mjs.map +1 -1
- package/dist/harmony139.cjs +12 -26
- package/dist/harmony139.cjs.map +1 -1
- package/dist/harmony139.mjs +13 -27
- package/dist/harmony139.mjs.map +1 -1
- package/dist/harmony140.cjs +36 -21
- package/dist/harmony140.cjs.map +1 -1
- package/dist/harmony140.mjs +35 -20
- package/dist/harmony140.mjs.map +1 -1
- package/dist/harmony141.cjs +21 -21
- package/dist/harmony141.cjs.map +1 -1
- package/dist/harmony141.mjs +20 -20
- package/dist/harmony141.mjs.map +1 -1
- package/dist/harmony142.cjs +21 -6
- package/dist/harmony142.cjs.map +1 -1
- package/dist/harmony142.mjs +20 -5
- package/dist/harmony142.mjs.map +1 -1
- package/dist/harmony143.cjs +3 -12
- package/dist/harmony143.cjs.map +1 -1
- package/dist/harmony143.mjs +3 -12
- package/dist/harmony143.mjs.map +1 -1
- package/dist/harmony144.cjs +15 -99
- package/dist/harmony144.cjs.map +1 -1
- package/dist/harmony144.mjs +14 -81
- package/dist/harmony144.mjs.map +1 -1
- package/dist/harmony145.cjs +6 -4
- package/dist/harmony145.cjs.map +1 -1
- package/dist/harmony145.mjs +5 -3
- package/dist/harmony145.mjs.map +1 -1
- package/dist/harmony146.cjs +6 -4
- package/dist/harmony146.cjs.map +1 -1
- package/dist/harmony146.mjs +5 -3
- package/dist/harmony146.mjs.map +1 -1
- package/dist/harmony147.cjs +10 -3
- package/dist/harmony147.cjs.map +1 -1
- package/dist/harmony147.mjs +10 -3
- package/dist/harmony147.mjs.map +1 -1
- package/dist/harmony148.cjs +2 -13
- package/dist/harmony148.cjs.map +1 -1
- package/dist/harmony148.mjs +2 -13
- package/dist/harmony148.mjs.map +1 -1
- package/dist/harmony149.cjs +2 -13
- package/dist/harmony149.cjs.map +1 -1
- package/dist/harmony149.mjs +2 -13
- package/dist/harmony149.mjs.map +1 -1
- package/dist/harmony150.cjs +3 -3
- package/dist/harmony150.cjs.map +1 -1
- package/dist/harmony150.mjs +3 -3
- package/dist/harmony150.mjs.map +1 -1
- package/dist/harmony151.cjs +14 -10
- package/dist/harmony151.cjs.map +1 -1
- package/dist/harmony151.mjs +14 -10
- package/dist/harmony151.mjs.map +1 -1
- package/dist/harmony152.cjs +15 -6
- package/dist/harmony152.cjs.map +1 -1
- package/dist/harmony152.mjs +14 -5
- package/dist/harmony152.mjs.map +1 -1
- package/dist/harmony153.cjs +4 -6
- package/dist/harmony153.cjs.map +1 -1
- package/dist/harmony153.mjs +3 -5
- package/dist/harmony153.mjs.map +1 -1
- package/dist/harmony154.cjs +9 -32
- package/dist/harmony154.cjs.map +1 -1
- package/dist/harmony154.mjs +8 -31
- package/dist/harmony154.mjs.map +1 -1
- package/dist/harmony155.cjs +3 -6
- package/dist/harmony155.cjs.map +1 -1
- package/dist/harmony155.mjs +3 -6
- package/dist/harmony155.mjs.map +1 -1
- package/dist/harmony156.cjs +6 -3
- package/dist/harmony156.cjs.map +1 -1
- package/dist/harmony156.mjs +6 -3
- package/dist/harmony156.mjs.map +1 -1
- package/dist/harmony157.cjs +21 -6
- package/dist/harmony157.cjs.map +1 -1
- package/dist/harmony157.mjs +21 -6
- package/dist/harmony157.mjs.map +1 -1
- package/dist/harmony158.cjs +3 -21
- package/dist/harmony158.cjs.map +1 -1
- package/dist/harmony158.mjs +3 -21
- package/dist/harmony158.mjs.map +1 -1
- package/dist/harmony159.cjs +9 -3
- package/dist/harmony159.cjs.map +1 -1
- package/dist/harmony159.mjs +9 -3
- package/dist/harmony159.mjs.map +1 -1
- package/dist/harmony160.cjs +3 -9
- package/dist/harmony160.cjs.map +1 -1
- package/dist/harmony160.mjs +3 -9
- package/dist/harmony160.mjs.map +1 -1
- package/dist/harmony161.cjs +97 -7
- package/dist/harmony161.cjs.map +1 -1
- package/dist/harmony161.mjs +96 -6
- package/dist/harmony161.mjs.map +1 -1
- package/dist/harmony162.cjs +11 -94
- package/dist/harmony162.cjs.map +1 -1
- package/dist/harmony162.mjs +11 -94
- package/dist/harmony162.mjs.map +1 -1
- package/dist/harmony163.cjs +13 -12
- package/dist/harmony163.cjs.map +1 -1
- package/dist/harmony163.mjs +13 -12
- package/dist/harmony163.mjs.map +1 -1
- package/dist/harmony164.cjs +35 -13
- package/dist/harmony164.cjs.map +1 -1
- package/dist/harmony164.mjs +35 -13
- package/dist/harmony164.mjs.map +1 -1
- package/dist/harmony165.cjs +24 -32
- package/dist/harmony165.cjs.map +1 -1
- package/dist/harmony165.mjs +24 -32
- package/dist/harmony165.mjs.map +1 -1
- package/dist/harmony166.cjs +31 -27
- package/dist/harmony166.cjs.map +1 -1
- package/dist/harmony166.mjs +31 -27
- package/dist/harmony166.mjs.map +1 -1
- package/dist/harmony167.cjs +13 -4
- package/dist/harmony167.cjs.map +1 -1
- package/dist/harmony167.mjs +13 -4
- 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/harmony170.cjs +10 -15
- package/dist/harmony170.cjs.map +1 -1
- package/dist/harmony170.mjs +10 -15
- package/dist/harmony170.mjs.map +1 -1
- package/dist/harmony171.cjs +15 -10
- package/dist/harmony171.cjs.map +1 -1
- package/dist/harmony171.mjs +15 -10
- package/dist/harmony171.mjs.map +1 -1
- package/dist/harmony172.cjs +18 -13
- package/dist/harmony172.cjs.map +1 -1
- package/dist/harmony172.mjs +18 -13
- package/dist/harmony172.mjs.map +1 -1
- package/dist/harmony173.cjs +10 -19
- package/dist/harmony173.cjs.map +1 -1
- package/dist/harmony173.mjs +10 -19
- package/dist/harmony173.mjs.map +1 -1
- package/dist/harmony174.cjs +4 -12
- package/dist/harmony174.cjs.map +1 -1
- package/dist/harmony174.mjs +4 -12
- package/dist/harmony174.mjs.map +1 -1
- package/dist/harmony176.cjs +1 -1
- package/dist/harmony176.mjs +1 -1
- package/dist/harmony20.cjs +1 -1
- package/dist/harmony20.mjs +1 -1
- package/dist/harmony81.cjs +21 -1
- package/dist/harmony81.cjs.map +1 -1
- package/dist/harmony81.mjs +21 -1
- package/dist/harmony81.mjs.map +1 -1
- package/dist/harmony82.cjs +0 -19
- package/dist/harmony82.cjs.map +1 -1
- package/dist/harmony82.mjs +0 -19
- package/dist/harmony82.mjs.map +1 -1
- package/dist/harmony88.cjs +12 -9
- package/dist/harmony88.cjs.map +1 -1
- package/dist/harmony88.mjs +12 -9
- package/dist/harmony88.mjs.map +1 -1
- package/dist/harmony94.cjs +1 -1
- package/dist/harmony94.mjs +1 -1
- package/dist/types/src/components/Sidebar/types.d.ts +4 -0
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedProjectContributor.d.ts +1 -1
- package/dist/types/src/features/navigation/hooks/useNavigationQueries.d.ts +3 -3
- package/dist/types/src/features/publicApi/contributors.d.ts +16 -16
- package/dist/types/src/features/publicApi/hooks/useAddContributorsMutation.d.ts +1 -1
- package/dist/types/src/features/publicApi/hooks/useGetProjectPermissionMetaQuery.d.ts +2 -2
- package/dist/types/src/features/publicApi/hooks/useListContributorsQuery.d.ts +1 -1
- package/dist/types/src/features/publicApi/hooks/useRetrieveContributorQuery.d.ts +1 -1
- package/dist/types/src/features/publicApi/hooks/useRetrieveUserPermissions.d.ts +1 -1
- package/dist/types/src/features/publicApi/hooks/useUpdateContributorMutation.d.ts +1 -1
- package/dist/types/src/features/publicApi/projects.d.ts +4 -4
- package/dist/types/src/features/publicApi/teamUsers.d.ts +6 -6
- package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +18 -18
- package/dist/types/src/features/publicApi/types/permissionTemplateTypes.d.ts +2 -2
- package/dist/types/src/features/publicApi/types/permissionTypes.d.ts +0 -1
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +4 -4
- package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +10 -10
- package/package.json +1 -1
package/dist/harmony.cjs
CHANGED
|
@@ -246,8 +246,9 @@ exports.LIST_PROJECT_LANGUAGES_RESPONSE_SCHEMA = languageTypes.LIST_PROJECT_LANG
|
|
|
246
246
|
exports.PAGINATION_QUERY_PARAMS_SCHEMA = paginationTypes.PAGINATION_QUERY_PARAMS_SCHEMA;
|
|
247
247
|
exports.LIST_PERMISSION_TEMPLATES_PATH_PARAMS = permissionTemplateTypes.LIST_PERMISSION_TEMPLATES_PATH_PARAMS;
|
|
248
248
|
exports.LIST_PERMISSION_TEMPLATES_RESPONSE = permissionTemplateTypes.LIST_PERMISSION_TEMPLATES_RESPONSE;
|
|
249
|
+
exports.PERMISSIONS = permissionTemplateTypes.PERMISSIONS;
|
|
250
|
+
exports.PERMISSION_SCHEMA = permissionTemplateTypes.PERMISSION_SCHEMA;
|
|
249
251
|
exports.PERMISSION_TEMPLATE_SCHEMA = permissionTemplateTypes.PERMISSION_TEMPLATE_SCHEMA;
|
|
250
|
-
exports.PERMISSIONS = permissionTypes.PERMISSIONS;
|
|
251
252
|
exports.PERMISSION_DETAILS_SCHEMA = permissionTypes.PERMISSION_DETAILS_SCHEMA;
|
|
252
253
|
exports.PERMISSION_ID_SCHEMA = permissionTypes.PERMISSION_ID_SCHEMA;
|
|
253
254
|
exports.PERMISSION_SCOPE_SCHEMA = permissionTypes.PERMISSION_SCOPE_SCHEMA;
|
package/dist/harmony.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"harmony.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/harmony.mjs
CHANGED
|
@@ -77,8 +77,8 @@ import { useUpdateProjectMutation } from "./harmony77.mjs";
|
|
|
77
77
|
import { ADD_CONTRIBUTORS_PATH_PARAMS_SCHEMA, ADD_CONTRIBUTORS_REQUEST_BODY_SCHEMA, ADD_CONTRIBUTORS_RESPONSE_SCHEMA, CONTRIBUTOR_API_BASE_HEADER_SCHEMA, CONTRIBUTOR_LANGUAGE_SCHEMA, CONTRIBUTOR_SCHEMA, DELETE_CONTRIBUTOR_PATH_PARAMS_SCHEMA, DELETE_CONTRIBUTOR_RESPONSE_SCHEMA, LIST_CONTRIBUTORS_PATH_PARAMS_SCHEMA, LIST_CONTRIBUTORS_RESPONSE_SCHEMA, RETRIEVE_CONTRIBUTOR_PATH_PARAMS_SCHEMA, RETRIEVE_CONTRIBUTOR_RESPONSE_SCHEMA, UPDATE_CONTRIBUTORS_PATH_PARAMS_SCHEMA, UPDATE_CONTRIBUTORS_REQUEST_BODY_SCHEMA, UPDATE_CONTRIBUTORS_RESPONSE_SCHEMA } from "./harmony78.mjs";
|
|
78
78
|
import { ADD_LANGUAGES_TO_PROJECT_PATH_PARAMS_SCHEMA, ADD_LANGUAGES_TO_PROJECT_REQUEST_BODY_SCHEMA, ADD_LANGUAGES_TO_PROJECT_RESPONSE_SCHEMA, BULK_UPDATE_PROJECT_LANGUAGES_PATH_PARAMS_SCHEMA, BULK_UPDATE_PROJECT_LANGUAGES_REQUEST_BODY_SCHEMA, BULK_UPDATE_PROJECT_LANGUAGES_RESPONSE_SCHEMA, LANGUAGE_ISO_SCHEMA, LANGUAGE_SCHEMA, LANGUAGE_STATISTICS_SCHEMA, LIST_PROJECT_LANGUAGES_PATH_PARAMS_SCHEMA, LIST_PROJECT_LANGUAGES_RESPONSE_SCHEMA } from "./harmony79.mjs";
|
|
79
79
|
import { PAGINATION_QUERY_PARAMS_SCHEMA } from "./harmony80.mjs";
|
|
80
|
-
import { LIST_PERMISSION_TEMPLATES_PATH_PARAMS, LIST_PERMISSION_TEMPLATES_RESPONSE, PERMISSION_TEMPLATE_SCHEMA } from "./harmony81.mjs";
|
|
81
|
-
import {
|
|
80
|
+
import { LIST_PERMISSION_TEMPLATES_PATH_PARAMS, LIST_PERMISSION_TEMPLATES_RESPONSE, PERMISSIONS, PERMISSION_SCHEMA, PERMISSION_TEMPLATE_SCHEMA } from "./harmony81.mjs";
|
|
81
|
+
import { PERMISSION_DETAILS_SCHEMA, PERMISSION_ID_SCHEMA, PERMISSION_SCOPE_SCHEMA } from "./harmony82.mjs";
|
|
82
82
|
import { CREATE_PROJECT_REQUEST_BODY_SCHEMA, DELETE_PROJECT_RESPONSE_SCHEMA, GET_PROJECT_PERMISSION_META_RESPONSE_BODY_SCHEMA, LIST_PROJECTS_REQUEST_QUERY_SCHEMA, LIST_PROJECTS_SUCCESS_RESPONSE_BODY, PROJECT_API_BASE_HEADERS_SCHEMA, PROJECT_ID_OR_UUID_SCHEMA, PROJECT_ID_PATH_PARAM_SCHEMA, PROJECT_ID_SCHEMA, PROJECT_QA_ISSUES_SCHEMA, PROJECT_SCHEMA, PROJECT_SETTINGS_SCHEMA, PROJECT_STATISTICS_SCHEMA, PROJECT_TYPE_SCHEMA, UPDATE_PROJECT_REQUEST_BODY_SCHEMA } from "./harmony83.mjs";
|
|
83
83
|
import { CREATE_SCORE_REQUEST_BODY_SCHEMA, CREATE_SCORE_RESPONSE_SCHEMA, DELETE_SCORE_RESPONSE_SCHEMA, GET_SCORE_RESPONSE_SCHEMA, ISSUE_SCHEMA, SCORE_REQUEST_QUERY_SCHEMA, SEVERITY_ENUM } from "./harmony84.mjs";
|
|
84
84
|
import { API_PLUGIN_HEADER_SCHEMA, APU_TOKEN_AUTH_HEADER_SCHEMA, AUTHENTICATION_HEADERS_SCHEMA, AUTHORIZATION_HEADER_SCHEMA, BASE_API_ENDPOINT_HEADER_SCHEMA } from "./harmony85.mjs";
|
|
@@ -155,6 +155,7 @@ export {
|
|
|
155
155
|
PERMISSIONS,
|
|
156
156
|
PERMISSION_DETAILS_SCHEMA,
|
|
157
157
|
PERMISSION_ID_SCHEMA,
|
|
158
|
+
PERMISSION_SCHEMA,
|
|
158
159
|
PERMISSION_SCOPE_SCHEMA,
|
|
159
160
|
PERMISSION_TEMPLATE_SCHEMA,
|
|
160
161
|
PROJECT_API_BASE_HEADERS_SCHEMA,
|
package/dist/harmony103.cjs
CHANGED
|
@@ -12,7 +12,7 @@ const SidebarContent_module = require("./harmony116.cjs");
|
|
|
12
12
|
const SidebarContent = ({ widgetsConfig, children, ...navProps }) => {
|
|
13
13
|
const sidebarContextProps = useSidebar.useSidebar();
|
|
14
14
|
const { jwt } = sidebarContextProps;
|
|
15
|
-
const { avatar } = widgetsConfig;
|
|
15
|
+
const { avatar, styleGuide } = widgetsConfig;
|
|
16
16
|
return /* @__PURE__ */ jsxRuntime.jsxs("nav", { ...navProps, className: SidebarContent_module.default.sidebarContainer, children: [
|
|
17
17
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
18
18
|
/* @__PURE__ */ jsxRuntime.jsx(Avatar.Avatar, { ...avatar }),
|
|
@@ -26,6 +26,7 @@ const SidebarContent = ({ widgetsConfig, children, ...navProps }) => {
|
|
|
26
26
|
)) }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: jwt && !jwt.isEndOfTrialActive && !jwt.isTeamSuspended && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
27
27
|
/* @__PURE__ */ jsxRuntime.jsx(IconLink.IconLink, { to: "/projects", label: "Projects", icon: louis.ProjectIcon }),
|
|
28
28
|
/* @__PURE__ */ jsxRuntime.jsx(IconLink.IconLink, { to: "/order", label: "Order", icon: louis.ShoppingBagIcon }),
|
|
29
|
+
(styleGuide == null ? void 0 : styleGuide.enabled) && permissions.canAccessStyleGuide(jwt) && /* @__PURE__ */ jsxRuntime.jsx(IconLink.IconLink, { to: "/style-guide", label: "Style Guide", icon: louis.StyleguideIcon }),
|
|
29
30
|
permissions.canAccessReporting(jwt) && /* @__PURE__ */ jsxRuntime.jsx(IconLink.IconLink, { to: "/analytics", label: "Analytics", icon: louis.ChartLineIcon })
|
|
30
31
|
] }) }),
|
|
31
32
|
/* @__PURE__ */ jsxRuntime.jsx(HelpMenu.HelpMenu, { ...widgetsConfig.helpMenu })
|
package/dist/harmony103.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony103.cjs","sources":["../src/components/Sidebar/SidebarContent/SidebarContent.tsx"],"sourcesContent":["import { IconLink } from '@components/Sidebar/Widgets/IconLink/IconLink'\nimport { ProfileMenu } from '@components/Sidebar/Widgets/ProfileMenu/ProfileMenu'\nimport { useSidebar } from '@components/Sidebar/hooks/useSidebar'\nimport type { SidebarWidgetsConfig } from '@components/Sidebar/types'\nimport type { SidebarContextProps } from '@components/Sidebar/types'\nimport {
|
|
1
|
+
{"version":3,"file":"harmony103.cjs","sources":["../src/components/Sidebar/SidebarContent/SidebarContent.tsx"],"sourcesContent":["import { IconLink } from '@components/Sidebar/Widgets/IconLink/IconLink'\nimport { ProfileMenu } from '@components/Sidebar/Widgets/ProfileMenu/ProfileMenu'\nimport { useSidebar } from '@components/Sidebar/hooks/useSidebar'\nimport type { SidebarWidgetsConfig } from '@components/Sidebar/types'\nimport type { SidebarContextProps } from '@components/Sidebar/types'\nimport {\n\tChartLineIcon,\n\tProjectIcon,\n\tRectangle,\n\tShoppingBagIcon,\n\tSkeleton,\n\tStyleguideIcon,\n} from '@lokalise/louis'\nimport { canAccessReporting, canAccessStyleGuide } from '@utils/user/permissions'\nimport type { HTMLProps, ReactNode } from 'react'\nimport { Avatar } from '../Widgets/Avatar/Avatar'\nimport { HelpMenu } from '../Widgets/HelpMenu/HelpMenu'\nimport styles from './SidebarContent.module.css'\n\nexport type SidebarContentProps = Omit<HTMLProps<HTMLElement>, 'children'> & {\n\twidgetsConfig: SidebarWidgetsConfig\n\tchildren?: ((props: SidebarContextProps) => ReactNode) | ReactNode\n}\n\nexport const SidebarContent = ({ widgetsConfig, children, ...navProps }: SidebarContentProps) => {\n\tconst sidebarContextProps = useSidebar()\n\n\tconst { jwt } = sidebarContextProps\n\n\tconst { avatar, styleGuide } = widgetsConfig\n\n\treturn (\n\t\t<nav {...navProps} className={styles.sidebarContainer}>\n\t\t\t<div>\n\t\t\t\t<Avatar {...avatar} />\n\n\t\t\t\t{!jwt ? (\n\t\t\t\t\t<Skeleton description={'Top Section Loader'} animated className={styles.sidebarSkeleton}>\n\t\t\t\t\t\t{Array.from({ length: 3 }).map(() => (\n\t\t\t\t\t\t\t<Rectangle\n\t\t\t\t\t\t\t\tkey={`sidebar-top-widget-loader-${crypto.randomUUID()}`}\n\t\t\t\t\t\t\t\theight={40}\n\t\t\t\t\t\t\t\twidth={40}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Skeleton>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{jwt && !jwt.isEndOfTrialActive && !jwt.isTeamSuspended && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{/** TODO - All URLs should be pointing to Expert here. We need resolve URL function to deal with this */}\n\t\t\t\t\t\t\t\t<IconLink to=\"/projects\" label={'Projects'} icon={ProjectIcon} />\n\t\t\t\t\t\t\t\t<IconLink to=\"/order\" label=\"Order\" icon={ShoppingBagIcon} />\n\n\t\t\t\t\t\t\t\t{styleGuide?.enabled && canAccessStyleGuide(jwt) && (\n\t\t\t\t\t\t\t\t\t<IconLink to=\"/style-guide\" label=\"Style Guide\" icon={StyleguideIcon} />\n\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t\t{canAccessReporting(jwt) && (\n\t\t\t\t\t\t\t\t\t<IconLink to=\"/analytics\" label=\"Analytics\" icon={ChartLineIcon} />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t<HelpMenu {...widgetsConfig.helpMenu} />\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t{children && typeof children === 'function' ? children(sidebarContextProps) : children}\n\t\t\t\t<ProfileMenu config={widgetsConfig.profileMenu} />\n\t\t\t</div>\n\t\t</nav>\n\t)\n}\n"],"names":["useSidebar","styles","jsxs","jsx","Avatar","Skeleton","Rectangle","Fragment","IconLink","ProjectIcon","ShoppingBagIcon","canAccessStyleGuide","StyleguideIcon","canAccessReporting","ChartLineIcon","HelpMenu","ProfileMenu"],"mappings":";;;;;;;;;;;AAwBO,MAAM,iBAAiB,CAAC,EAAE,eAAe,UAAU,GAAG,eAAoC;AAChG,QAAM,sBAAsBA,WAAAA,WAAW;AAEjC,QAAA,EAAE,QAAQ;AAEV,QAAA,EAAE,QAAQ,WAAA,IAAe;AAE/B,yCACE,OAAK,EAAA,GAAG,UAAU,WAAWC,8BAAO,kBACpC,UAAA;AAAA,IAAAC,gCAAC,OACA,EAAA,UAAA;AAAA,MAACC,2BAAAA,IAAAC,OAAA,QAAA,EAAQ,GAAG,QAAQ;AAAA,MAEnB,CAAC,MACDD,2BAAA,IAACE,kBAAS,aAAa,sBAAsB,UAAQ,MAAC,WAAWJ,sBAAAA,QAAO,iBACtE,UAAA,MAAM,KAAK,EAAE,QAAQ,EAAG,CAAA,EAAE,IAAI,MAC9BE,2BAAA;AAAA,QAACG,MAAA;AAAA,QAAA;AAAA,UAEA,QAAQ;AAAA,UACR,OAAO;AAAA,QAAA;AAAA,QAFF,6BAA6B,OAAO,YAAY;AAAA,MAAA,CAItD,EACF,CAAA,IAGEH,2BAAA,IAAAI,WAAA,UAAA,EAAA,UAAA,OAAO,CAAC,IAAI,sBAAsB,CAAC,IAAI,mBAGtCL,2BAAAA,KAAAK,WAAAA,UAAA,EAAA,UAAA;AAAA,QAAAJ,+BAACK,SAAAA,YAAS,IAAG,aAAY,OAAO,YAAY,MAAMC,MAAAA,aAAa;AAAA,uCAC9DD,SAAAA,UAAS,EAAA,IAAG,UAAS,OAAM,SAAQ,MAAME,MAAAA,iBAAiB;AAAA,SAE1D,yCAAY,YAAWC,YAAAA,oBAAoB,GAAG,KAC9CR,2BAAA,IAACK,SAAS,UAAA,EAAA,IAAG,gBAAe,OAAM,eAAc,MAAMI,MAAgB,eAAA,CAAA;AAAA,QAGtEC,YAAAA,mBAAmB,GAAG,KACrBV,2BAAA,IAAAK,mBAAA,EAAS,IAAG,cAAa,OAAM,aAAY,MAAMM,MAAAA,cAAe,CAAA;AAAA,MAAA,EAAA,CAEnE,EAEF,CAAA;AAAA,MAEAX,2BAAAA,IAAAY,SAAA,UAAA,EAAU,GAAG,cAAc,SAAU,CAAA;AAAA,IAAA,GACvC;AAAA,oCACC,OACC,EAAA,UAAA;AAAA,MAAA,YAAY,OAAO,aAAa,aAAa,SAAS,mBAAmB,IAAI;AAAA,MAC7EZ,2BAAAA,IAAAa,YAAAA,aAAA,EAAY,QAAQ,cAAc,YAAa,CAAA;AAAA,IAAA,EACjD,CAAA;AAAA,EAAA,GACD;AAEF;;"}
|
package/dist/harmony103.mjs
CHANGED
|
@@ -2,15 +2,15 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { IconLink } from "./harmony110.mjs";
|
|
3
3
|
import { ProfileMenu } from "./harmony111.mjs";
|
|
4
4
|
import { useSidebar } from "./harmony112.mjs";
|
|
5
|
-
import { Skeleton, Rectangle, ProjectIcon, ShoppingBagIcon, ChartLineIcon } from "@lokalise/louis";
|
|
6
|
-
import { canAccessReporting } from "./harmony113.mjs";
|
|
5
|
+
import { Skeleton, Rectangle, ProjectIcon, ShoppingBagIcon, StyleguideIcon, ChartLineIcon } from "@lokalise/louis";
|
|
6
|
+
import { canAccessStyleGuide, canAccessReporting } from "./harmony113.mjs";
|
|
7
7
|
import { Avatar } from "./harmony114.mjs";
|
|
8
8
|
import { HelpMenu } from "./harmony115.mjs";
|
|
9
9
|
import styles from "./harmony116.mjs";
|
|
10
10
|
const SidebarContent = ({ widgetsConfig, children, ...navProps }) => {
|
|
11
11
|
const sidebarContextProps = useSidebar();
|
|
12
12
|
const { jwt } = sidebarContextProps;
|
|
13
|
-
const { avatar } = widgetsConfig;
|
|
13
|
+
const { avatar, styleGuide } = widgetsConfig;
|
|
14
14
|
return /* @__PURE__ */ jsxs("nav", { ...navProps, className: styles.sidebarContainer, children: [
|
|
15
15
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
16
16
|
/* @__PURE__ */ jsx(Avatar, { ...avatar }),
|
|
@@ -24,6 +24,7 @@ const SidebarContent = ({ widgetsConfig, children, ...navProps }) => {
|
|
|
24
24
|
)) }) : /* @__PURE__ */ jsx(Fragment, { children: jwt && !jwt.isEndOfTrialActive && !jwt.isTeamSuspended && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
25
|
/* @__PURE__ */ jsx(IconLink, { to: "/projects", label: "Projects", icon: ProjectIcon }),
|
|
26
26
|
/* @__PURE__ */ jsx(IconLink, { to: "/order", label: "Order", icon: ShoppingBagIcon }),
|
|
27
|
+
(styleGuide == null ? void 0 : styleGuide.enabled) && canAccessStyleGuide(jwt) && /* @__PURE__ */ jsx(IconLink, { to: "/style-guide", label: "Style Guide", icon: StyleguideIcon }),
|
|
27
28
|
canAccessReporting(jwt) && /* @__PURE__ */ jsx(IconLink, { to: "/analytics", label: "Analytics", icon: ChartLineIcon })
|
|
28
29
|
] }) }),
|
|
29
30
|
/* @__PURE__ */ jsx(HelpMenu, { ...widgetsConfig.helpMenu })
|
package/dist/harmony103.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony103.mjs","sources":["../src/components/Sidebar/SidebarContent/SidebarContent.tsx"],"sourcesContent":["import { IconLink } from '@components/Sidebar/Widgets/IconLink/IconLink'\nimport { ProfileMenu } from '@components/Sidebar/Widgets/ProfileMenu/ProfileMenu'\nimport { useSidebar } from '@components/Sidebar/hooks/useSidebar'\nimport type { SidebarWidgetsConfig } from '@components/Sidebar/types'\nimport type { SidebarContextProps } from '@components/Sidebar/types'\nimport {
|
|
1
|
+
{"version":3,"file":"harmony103.mjs","sources":["../src/components/Sidebar/SidebarContent/SidebarContent.tsx"],"sourcesContent":["import { IconLink } from '@components/Sidebar/Widgets/IconLink/IconLink'\nimport { ProfileMenu } from '@components/Sidebar/Widgets/ProfileMenu/ProfileMenu'\nimport { useSidebar } from '@components/Sidebar/hooks/useSidebar'\nimport type { SidebarWidgetsConfig } from '@components/Sidebar/types'\nimport type { SidebarContextProps } from '@components/Sidebar/types'\nimport {\n\tChartLineIcon,\n\tProjectIcon,\n\tRectangle,\n\tShoppingBagIcon,\n\tSkeleton,\n\tStyleguideIcon,\n} from '@lokalise/louis'\nimport { canAccessReporting, canAccessStyleGuide } from '@utils/user/permissions'\nimport type { HTMLProps, ReactNode } from 'react'\nimport { Avatar } from '../Widgets/Avatar/Avatar'\nimport { HelpMenu } from '../Widgets/HelpMenu/HelpMenu'\nimport styles from './SidebarContent.module.css'\n\nexport type SidebarContentProps = Omit<HTMLProps<HTMLElement>, 'children'> & {\n\twidgetsConfig: SidebarWidgetsConfig\n\tchildren?: ((props: SidebarContextProps) => ReactNode) | ReactNode\n}\n\nexport const SidebarContent = ({ widgetsConfig, children, ...navProps }: SidebarContentProps) => {\n\tconst sidebarContextProps = useSidebar()\n\n\tconst { jwt } = sidebarContextProps\n\n\tconst { avatar, styleGuide } = widgetsConfig\n\n\treturn (\n\t\t<nav {...navProps} className={styles.sidebarContainer}>\n\t\t\t<div>\n\t\t\t\t<Avatar {...avatar} />\n\n\t\t\t\t{!jwt ? (\n\t\t\t\t\t<Skeleton description={'Top Section Loader'} animated className={styles.sidebarSkeleton}>\n\t\t\t\t\t\t{Array.from({ length: 3 }).map(() => (\n\t\t\t\t\t\t\t<Rectangle\n\t\t\t\t\t\t\t\tkey={`sidebar-top-widget-loader-${crypto.randomUUID()}`}\n\t\t\t\t\t\t\t\theight={40}\n\t\t\t\t\t\t\t\twidth={40}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Skeleton>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{jwt && !jwt.isEndOfTrialActive && !jwt.isTeamSuspended && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{/** TODO - All URLs should be pointing to Expert here. We need resolve URL function to deal with this */}\n\t\t\t\t\t\t\t\t<IconLink to=\"/projects\" label={'Projects'} icon={ProjectIcon} />\n\t\t\t\t\t\t\t\t<IconLink to=\"/order\" label=\"Order\" icon={ShoppingBagIcon} />\n\n\t\t\t\t\t\t\t\t{styleGuide?.enabled && canAccessStyleGuide(jwt) && (\n\t\t\t\t\t\t\t\t\t<IconLink to=\"/style-guide\" label=\"Style Guide\" icon={StyleguideIcon} />\n\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t\t{canAccessReporting(jwt) && (\n\t\t\t\t\t\t\t\t\t<IconLink to=\"/analytics\" label=\"Analytics\" icon={ChartLineIcon} />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t<HelpMenu {...widgetsConfig.helpMenu} />\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t{children && typeof children === 'function' ? children(sidebarContextProps) : children}\n\t\t\t\t<ProfileMenu config={widgetsConfig.profileMenu} />\n\t\t\t</div>\n\t\t</nav>\n\t)\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBO,MAAM,iBAAiB,CAAC,EAAE,eAAe,UAAU,GAAG,eAAoC;AAChG,QAAM,sBAAsB,WAAW;AAEjC,QAAA,EAAE,QAAQ;AAEV,QAAA,EAAE,QAAQ,WAAA,IAAe;AAE/B,8BACE,OAAK,EAAA,GAAG,UAAU,WAAW,OAAO,kBACpC,UAAA;AAAA,IAAA,qBAAC,OACA,EAAA,UAAA;AAAA,MAAC,oBAAA,QAAA,EAAQ,GAAG,QAAQ;AAAA,MAEnB,CAAC,MACD,oBAAC,YAAS,aAAa,sBAAsB,UAAQ,MAAC,WAAW,OAAO,iBACtE,UAAA,MAAM,KAAK,EAAE,QAAQ,EAAG,CAAA,EAAE,IAAI,MAC9B;AAAA,QAAC;AAAA,QAAA;AAAA,UAEA,QAAQ;AAAA,UACR,OAAO;AAAA,QAAA;AAAA,QAFF,6BAA6B,OAAO,YAAY;AAAA,MAAA,CAItD,EACF,CAAA,IAGE,oBAAA,UAAA,EAAA,UAAA,OAAO,CAAC,IAAI,sBAAsB,CAAC,IAAI,mBAGtC,qBAAA,UAAA,EAAA,UAAA;AAAA,QAAA,oBAAC,YAAS,IAAG,aAAY,OAAO,YAAY,MAAM,aAAa;AAAA,4BAC9D,UAAS,EAAA,IAAG,UAAS,OAAM,SAAQ,MAAM,iBAAiB;AAAA,SAE1D,yCAAY,YAAW,oBAAoB,GAAG,KAC9C,oBAAC,UAAS,EAAA,IAAG,gBAAe,OAAM,eAAc,MAAM,eAAgB,CAAA;AAAA,QAGtE,mBAAmB,GAAG,KACrB,oBAAA,UAAA,EAAS,IAAG,cAAa,OAAM,aAAY,MAAM,cAAe,CAAA;AAAA,MAAA,EAAA,CAEnE,EAEF,CAAA;AAAA,MAEA,oBAAA,UAAA,EAAU,GAAG,cAAc,SAAU,CAAA;AAAA,IAAA,GACvC;AAAA,yBACC,OACC,EAAA,UAAA;AAAA,MAAA,YAAY,OAAO,aAAa,aAAa,SAAS,mBAAmB,IAAI;AAAA,MAC7E,oBAAA,aAAA,EAAY,QAAQ,cAAc,YAAa,CAAA;AAAA,IAAA,EACjD,CAAA;AAAA,EAAA,GACD;AAEF;"}
|
package/dist/harmony110.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const louis = require("@lokalise/louis");
|
|
5
5
|
const clsx = require("./harmony92.cjs");
|
|
6
|
-
const IconLink_module = require("./
|
|
6
|
+
const IconLink_module = require("./harmony130.cjs");
|
|
7
7
|
const IconLink = ({ label, to, icon: Icon }) => {
|
|
8
8
|
return /* @__PURE__ */ jsxRuntime.jsx(louis.Tooltip, { placement: "right", tooltip: label, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
9
|
louis.Link,
|
package/dist/harmony110.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip, Link } from "@lokalise/louis";
|
|
3
3
|
import { clsx } from "./harmony92.mjs";
|
|
4
|
-
import styles from "./
|
|
4
|
+
import styles from "./harmony130.mjs";
|
|
5
5
|
const IconLink = ({ label, to, icon: Icon }) => {
|
|
6
6
|
return /* @__PURE__ */ jsx(Tooltip, { placement: "right", tooltip: label, children: /* @__PURE__ */ jsx(
|
|
7
7
|
Link,
|
package/dist/harmony111.cjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
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("./
|
|
5
|
-
const CreateNewTeam = require("./
|
|
6
|
-
const CreateNewTeamPlaceholder = require("./
|
|
7
|
-
const DarkModeToggle = require("./
|
|
8
|
-
const ProfileSettingsMenuItem = require("./
|
|
9
|
-
const ProviderMenuItem = require("./
|
|
10
|
-
const TeamMenuItem = require("./
|
|
11
|
-
const TeamSettingsMenuItem = require("./
|
|
12
|
-
const TeamSwitch = require("./
|
|
13
|
-
const UpgradeMenuItem = require("./
|
|
4
|
+
const BillingMenuItem = require("./harmony131.cjs");
|
|
5
|
+
const CreateNewTeam = require("./harmony132.cjs");
|
|
6
|
+
const CreateNewTeamPlaceholder = require("./harmony133.cjs");
|
|
7
|
+
const DarkModeToggle = require("./harmony134.cjs");
|
|
8
|
+
const ProfileSettingsMenuItem = require("./harmony135.cjs");
|
|
9
|
+
const ProviderMenuItem = require("./harmony136.cjs");
|
|
10
|
+
const TeamMenuItem = require("./harmony137.cjs");
|
|
11
|
+
const TeamSettingsMenuItem = require("./harmony138.cjs");
|
|
12
|
+
const TeamSwitch = require("./harmony139.cjs");
|
|
13
|
+
const UpgradeMenuItem = require("./harmony140.cjs");
|
|
14
14
|
const useSidebar = require("./harmony112.cjs");
|
|
15
15
|
const louis = require("@lokalise/louis");
|
|
16
16
|
const permissions = require("./harmony113.cjs");
|
|
17
17
|
const clsx = require("./harmony92.cjs");
|
|
18
|
-
const ProfileMenu_module = require("./
|
|
19
|
-
const UpgradeIcon = require("./
|
|
18
|
+
const ProfileMenu_module = require("./harmony141.cjs");
|
|
19
|
+
const UpgradeIcon = require("./harmony142.cjs");
|
|
20
20
|
const ProfileMenu = ({ config }) => {
|
|
21
21
|
const {
|
|
22
22
|
jwt,
|
package/dist/harmony111.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { BillingMenuItem } from "./
|
|
3
|
-
import { CreateNewTeam } from "./
|
|
4
|
-
import { CreateNewTeamPlaceholder } from "./
|
|
5
|
-
import { DarkModeToggle } from "./
|
|
6
|
-
import { ProfileSettingsMenuItem } from "./
|
|
7
|
-
import { ProviderMenuItem } from "./
|
|
8
|
-
import { TeamMenuItem } from "./
|
|
9
|
-
import { TeamSettingsMenuItem } from "./
|
|
10
|
-
import { TeamSwitch } from "./
|
|
11
|
-
import { UpgradeMenuItem } from "./
|
|
2
|
+
import { BillingMenuItem } from "./harmony131.mjs";
|
|
3
|
+
import { CreateNewTeam } from "./harmony132.mjs";
|
|
4
|
+
import { CreateNewTeamPlaceholder } from "./harmony133.mjs";
|
|
5
|
+
import { DarkModeToggle } from "./harmony134.mjs";
|
|
6
|
+
import { ProfileSettingsMenuItem } from "./harmony135.mjs";
|
|
7
|
+
import { ProviderMenuItem } from "./harmony136.mjs";
|
|
8
|
+
import { TeamMenuItem } from "./harmony137.mjs";
|
|
9
|
+
import { TeamSettingsMenuItem } from "./harmony138.mjs";
|
|
10
|
+
import { TeamSwitch } from "./harmony139.mjs";
|
|
11
|
+
import { UpgradeMenuItem } from "./harmony140.mjs";
|
|
12
12
|
import { useSidebar } from "./harmony112.mjs";
|
|
13
13
|
import { Menu, MenuList, MenuDivider, MenuItem, UserIcon } from "@lokalise/louis";
|
|
14
14
|
import { canAccessProfileSettings, canUpgradePlan } from "./harmony113.mjs";
|
|
15
15
|
import { clsx } from "./harmony92.mjs";
|
|
16
|
-
import styles from "./
|
|
17
|
-
import { UpgradeIcon } from "./
|
|
16
|
+
import styles from "./harmony141.mjs";
|
|
17
|
+
import { UpgradeIcon } from "./harmony142.mjs";
|
|
18
18
|
const ProfileMenu = ({ config }) => {
|
|
19
19
|
const {
|
|
20
20
|
jwt,
|
package/dist/harmony113.cjs
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const plan = require("./harmony11.cjs");
|
|
4
4
|
const withJwtCheck = (checkFn) => (jwtPayload) => !!jwtPayload && checkFn(jwtPayload);
|
|
5
|
+
const canAccessStyleGuide = withJwtCheck(
|
|
6
|
+
(jwt) => ["admin", "biller", "owner"].includes(jwt.userTeamRole)
|
|
7
|
+
);
|
|
5
8
|
const canAccessReporting = withJwtCheck(
|
|
6
9
|
(jwt) => ["admin", "owner"].includes(jwt.userTeamRole)
|
|
7
10
|
);
|
|
@@ -26,6 +29,7 @@ const canAccessProfileSettings = withJwtCheck(
|
|
|
26
29
|
exports.canAccessProfileSettings = canAccessProfileSettings;
|
|
27
30
|
exports.canAccessProviderDashboard = canAccessProviderDashboard;
|
|
28
31
|
exports.canAccessReporting = canAccessReporting;
|
|
32
|
+
exports.canAccessStyleGuide = canAccessStyleGuide;
|
|
29
33
|
exports.canAccessTeamSettings = canAccessTeamSettings;
|
|
30
34
|
exports.canChangeBilling = canChangeBilling;
|
|
31
35
|
exports.canCreateTeam = canCreateTeam;
|
package/dist/harmony113.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony113.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;
|
|
1
|
+
{"version":3,"file":"harmony113.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;;;;;;;;;"}
|
package/dist/harmony113.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { isFreePlan, isTrialPlan } from "./harmony11.mjs";
|
|
2
2
|
const withJwtCheck = (checkFn) => (jwtPayload) => !!jwtPayload && checkFn(jwtPayload);
|
|
3
|
+
const canAccessStyleGuide = withJwtCheck(
|
|
4
|
+
(jwt) => ["admin", "biller", "owner"].includes(jwt.userTeamRole)
|
|
5
|
+
);
|
|
3
6
|
const canAccessReporting = withJwtCheck(
|
|
4
7
|
(jwt) => ["admin", "owner"].includes(jwt.userTeamRole)
|
|
5
8
|
);
|
|
@@ -25,6 +28,7 @@ export {
|
|
|
25
28
|
canAccessProfileSettings,
|
|
26
29
|
canAccessProviderDashboard,
|
|
27
30
|
canAccessReporting,
|
|
31
|
+
canAccessStyleGuide,
|
|
28
32
|
canAccessTeamSettings,
|
|
29
33
|
canChangeBilling,
|
|
30
34
|
canCreateTeam,
|
package/dist/harmony113.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony113.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;
|
|
1
|
+
{"version":3,"file":"harmony113.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;"}
|
package/dist/harmony114.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const Avatar_module = require("./
|
|
4
|
+
const Avatar_module = require("./harmony143.cjs");
|
|
5
5
|
const Avatar = ({
|
|
6
6
|
src,
|
|
7
7
|
href = "/",
|
package/dist/harmony114.mjs
CHANGED
package/dist/harmony115.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const louis = require("@lokalise/louis");
|
|
5
5
|
const clsx = require("./harmony92.cjs");
|
|
6
|
-
const HelpMenu_module = require("./
|
|
6
|
+
const HelpMenu_module = require("./harmony144.cjs");
|
|
7
7
|
const HelpMenu = ({ contactSupport, keyboardShortcuts }) => {
|
|
8
8
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
9
|
louis.Menu,
|
package/dist/harmony115.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Menu, MenuList, MenuItem, MenuDivider, Tooltip, HelpCenterIcon } from "@lokalise/louis";
|
|
3
3
|
import { clsx } from "./harmony92.mjs";
|
|
4
|
-
import styles from "./
|
|
4
|
+
import styles from "./harmony144.mjs";
|
|
5
5
|
const HelpMenu = ({ contactSupport, keyboardShortcuts }) => {
|
|
6
6
|
return /* @__PURE__ */ jsx(
|
|
7
7
|
Menu,
|
package/dist/harmony121.cjs
CHANGED
|
@@ -1,23 +1,102 @@
|
|
|
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
|
-
}
|
|
22
|
-
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const debounce = require("./harmony145.cjs");
|
|
5
|
+
const throttle = require("./harmony146.cjs");
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
|
+
if (e) {
|
|
9
|
+
for (const k in e) {
|
|
10
|
+
if (k !== "default") {
|
|
11
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: () => e[k]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
23
|
+
const patchResizeCallback = (resizeCallback, refreshMode, refreshRate, refreshOptions) => {
|
|
24
|
+
switch (refreshMode) {
|
|
25
|
+
case "debounce":
|
|
26
|
+
return debounce.default(resizeCallback, refreshRate, refreshOptions);
|
|
27
|
+
case "throttle":
|
|
28
|
+
return throttle.default(resizeCallback, refreshRate, refreshOptions);
|
|
29
|
+
default:
|
|
30
|
+
return resizeCallback;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const useCallbackRef = (
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
+
(callback) => {
|
|
36
|
+
const callbackRef = React__namespace.useRef(callback);
|
|
37
|
+
React__namespace.useEffect(() => {
|
|
38
|
+
callbackRef.current = callback;
|
|
39
|
+
});
|
|
40
|
+
return React__namespace.useMemo(() => (...args) => {
|
|
41
|
+
var _a;
|
|
42
|
+
return (_a = callbackRef.current) === null || _a === void 0 ? void 0 : _a.call(callbackRef, ...args);
|
|
43
|
+
}, []);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
const useRefProxy = (
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
(targetRef) => {
|
|
49
|
+
const [refElement, setRefElement] = React__namespace.useState((targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) || null);
|
|
50
|
+
if (targetRef) {
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
if (targetRef.current !== refElement) {
|
|
53
|
+
setRefElement(targetRef.current);
|
|
54
|
+
}
|
|
55
|
+
}, 0);
|
|
56
|
+
}
|
|
57
|
+
const refProxy = React__namespace.useMemo(() => new Proxy((node) => {
|
|
58
|
+
if (node !== refElement) {
|
|
59
|
+
setRefElement(node);
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
get(target, prop) {
|
|
63
|
+
if (prop === "current") {
|
|
64
|
+
return refElement;
|
|
65
|
+
}
|
|
66
|
+
return target[prop];
|
|
67
|
+
},
|
|
68
|
+
set(target, prop, value) {
|
|
69
|
+
if (prop === "current") {
|
|
70
|
+
setRefElement(value);
|
|
71
|
+
} else {
|
|
72
|
+
target[prop] = value;
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}), [refElement]);
|
|
77
|
+
return { refProxy, refElement, setRefElement };
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
const getDimensions = (entry, box) => {
|
|
81
|
+
if (box === "border-box") {
|
|
82
|
+
return {
|
|
83
|
+
width: entry.borderBoxSize[0].inlineSize,
|
|
84
|
+
height: entry.borderBoxSize[0].blockSize
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (box === "content-box") {
|
|
88
|
+
return {
|
|
89
|
+
width: entry.contentBoxSize[0].inlineSize,
|
|
90
|
+
height: entry.contentBoxSize[0].blockSize
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
width: entry.contentRect.width,
|
|
95
|
+
height: entry.contentRect.height
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
exports.getDimensions = getDimensions;
|
|
99
|
+
exports.patchResizeCallback = patchResizeCallback;
|
|
100
|
+
exports.useCallbackRef = useCallbackRef;
|
|
101
|
+
exports.useRefProxy = useRefProxy;
|
|
23
102
|
//# sourceMappingURL=harmony121.cjs.map
|
package/dist/harmony121.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony121.cjs","sources":["../
|
|
1
|
+
{"version":3,"file":"harmony121.cjs","sources":["../node_modules/react-resize-detector/build/utils.js"],"sourcesContent":["import * as React from 'react';\nimport debounce from 'lodash/debounce.js';\nimport throttle from 'lodash/throttle.js';\n\n/**\n * Wraps the resize callback with a lodash debounce / throttle based on the refresh mode\n */\nconst patchResizeCallback = (resizeCallback, refreshMode, refreshRate, refreshOptions) => {\n switch (refreshMode) {\n case 'debounce':\n return debounce(resizeCallback, refreshRate, refreshOptions);\n case 'throttle':\n return throttle(resizeCallback, refreshRate, refreshOptions);\n default:\n return resizeCallback;\n }\n};\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nconst useCallbackRef = \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(callback) => {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => ((...args) => { var _a; return (_a = callbackRef.current) === null || _a === void 0 ? void 0 : _a.call(callbackRef, ...args); }), []);\n};\n/** `useRef` hook doesn't handle conditional rendering or dynamic ref changes.\n * This hook creates a proxy that ensures that `refElement` is updated whenever the ref is changed. */\nconst useRefProxy = \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(targetRef) => {\n // we are going to use this ref to store the last element that was passed to the hook\n const [refElement, setRefElement] = React.useState((targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) || null);\n // if targetRef is passed, we need to update the refElement\n // we have to use setTimeout because ref get assigned after the hook is called\n // in the future releases we are going to remove targetRef and force users to use ref returned by the hook\n if (targetRef) {\n setTimeout(() => {\n if (targetRef.current !== refElement) {\n setRefElement(targetRef.current);\n }\n }, 0);\n }\n // this is a memo that will be called every time the ref is changed\n // This proxy will properly call setState either when the ref is called as a function or when `.current` is set\n // we call setState inside to trigger rerender\n const refProxy = React.useMemo(() => new Proxy((node) => {\n if (node !== refElement) {\n setRefElement(node);\n }\n }, {\n get(target, prop) {\n if (prop === 'current') {\n return refElement;\n }\n return target[prop];\n },\n set(target, prop, value) {\n if (prop === 'current') {\n setRefElement(value);\n }\n else {\n target[prop] = value;\n }\n return true;\n },\n }), [refElement]);\n return { refProxy, refElement, setRefElement };\n};\n/** Calculates the dimensions of the element based on the current box model.\n * @see https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/The_box_model\n */\nconst getDimensions = (entry, box) => {\n // Value\t Border\t Padding\t Inner Content\n // ---------------------------------------------------\n // 'border-box'\t Yes\t Yes\t Yes\n // 'content-box'\t No\t No\t Yes\n // undefined No\t No?\t Yes\n if (box === 'border-box') {\n return {\n width: entry.borderBoxSize[0].inlineSize,\n height: entry.borderBoxSize[0].blockSize,\n };\n }\n if (box === 'content-box') {\n return {\n width: entry.contentBoxSize[0].inlineSize,\n height: entry.contentBoxSize[0].blockSize,\n };\n }\n return {\n width: entry.contentRect.width,\n height: entry.contentRect.height,\n };\n};\n\nexport { getDimensions, patchResizeCallback, useCallbackRef, useRefProxy };\n//# sourceMappingURL=utils.js.map\n"],"names":["debounce","throttle","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOK,MAAC,sBAAsB,CAAC,gBAAgB,aAAa,aAAa,mBAAmB;AACtF,UAAQ,aAAW;AAAA,IACf,KAAK;AACD,aAAOA,iBAAS,gBAAgB,aAAa,cAAc;AAAA,IAC/D,KAAK;AACD,aAAOC,iBAAS,gBAAgB,aAAa,cAAc;AAAA,IAC/D;AACI,aAAO;AAAA,EACnB;AACA;AAKK,MAAC;AAAA;AAAA,EAEN,CAAC,aAAa;AACV,UAAM,cAAcC,iBAAM,OAAO,QAAQ;AACzCA,qBAAM,UAAU,MAAM;AAClB,kBAAY,UAAU;AAAA,IAC9B,CAAK;AACD,WAAOA,iBAAM,QAAQ,MAAO,IAAI,SAAS;AAAE,UAAI;AAAI,cAAQ,KAAK,YAAY,aAAa,QAAQ,OAAO,SAAS,SAAS,GAAG,KAAK,aAAa,GAAG,IAAI;AAAA,IAAI,GAAG,CAAA,CAAE;AAAA,EACnK;AAAA;AAGK,MAAC;AAAA;AAAA,EAEN,CAAC,cAAc;AAEX,UAAM,CAAC,YAAY,aAAa,IAAIA,iBAAM,UAAU,cAAc,QAAQ,cAAc,SAAS,SAAS,UAAU,YAAY,IAAI;AAIpI,QAAI,WAAW;AACX,iBAAW,MAAM;AACb,YAAI,UAAU,YAAY,YAAY;AAClC,wBAAc,UAAU,OAAO;AAAA,QAC/C;AAAA,MACS,GAAE,CAAC;AAAA,IACZ;AAII,UAAM,WAAWA,iBAAM,QAAQ,MAAM,IAAI,MAAM,CAAC,SAAS;AACrD,UAAI,SAAS,YAAY;AACrB,sBAAc,IAAI;AAAA,MAC9B;AAAA,IACA,GAAO;AAAA,MACC,IAAI,QAAQ,MAAM;AACd,YAAI,SAAS,WAAW;AACpB,iBAAO;AAAA,QACvB;AACY,eAAO,OAAO,IAAI;AAAA,MACrB;AAAA,MACD,IAAI,QAAQ,MAAM,OAAO;AACrB,YAAI,SAAS,WAAW;AACpB,wBAAc,KAAK;AAAA,QACnC,OACiB;AACD,iBAAO,IAAI,IAAI;AAAA,QAC/B;AACY,eAAO;AAAA,MACV;AAAA,IACT,CAAK,GAAG,CAAC,UAAU,CAAC;AAChB,WAAO,EAAE,UAAU,YAAY,cAAe;AAAA,EAClD;AAAA;AAIK,MAAC,gBAAgB,CAAC,OAAO,QAAQ;AAMlC,MAAI,QAAQ,cAAc;AACtB,WAAO;AAAA,MACH,OAAO,MAAM,cAAc,CAAC,EAAE;AAAA,MAC9B,QAAQ,MAAM,cAAc,CAAC,EAAE;AAAA,IAClC;AAAA,EACT;AACI,MAAI,QAAQ,eAAe;AACvB,WAAO;AAAA,MACH,OAAO,MAAM,eAAe,CAAC,EAAE;AAAA,MAC/B,QAAQ,MAAM,eAAe,CAAC,EAAE;AAAA,IACnC;AAAA,EACT;AACI,SAAO;AAAA,IACH,OAAO,MAAM,YAAY;AAAA,IACzB,QAAQ,MAAM,YAAY;AAAA,EAC7B;AACL;;;;;","x_google_ignoreList":[0]}
|
package/dist/harmony121.mjs
CHANGED
|
@@ -1,23 +1,85 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import debounce from "./harmony145.mjs";
|
|
3
|
+
import throttle from "./harmony146.mjs";
|
|
4
|
+
const patchResizeCallback = (resizeCallback, refreshMode, refreshRate, refreshOptions) => {
|
|
5
|
+
switch (refreshMode) {
|
|
6
|
+
case "debounce":
|
|
7
|
+
return debounce(resizeCallback, refreshRate, refreshOptions);
|
|
8
|
+
case "throttle":
|
|
9
|
+
return throttle(resizeCallback, refreshRate, refreshOptions);
|
|
10
|
+
default:
|
|
11
|
+
return resizeCallback;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const useCallbackRef = (
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
(callback) => {
|
|
17
|
+
const callbackRef = React.useRef(callback);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
callbackRef.current = callback;
|
|
20
|
+
});
|
|
21
|
+
return React.useMemo(() => (...args) => {
|
|
22
|
+
var _a;
|
|
23
|
+
return (_a = callbackRef.current) === null || _a === void 0 ? void 0 : _a.call(callbackRef, ...args);
|
|
24
|
+
}, []);
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const useRefProxy = (
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
(targetRef) => {
|
|
30
|
+
const [refElement, setRefElement] = React.useState((targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) || null);
|
|
31
|
+
if (targetRef) {
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
if (targetRef.current !== refElement) {
|
|
34
|
+
setRefElement(targetRef.current);
|
|
35
|
+
}
|
|
36
|
+
}, 0);
|
|
37
|
+
}
|
|
38
|
+
const refProxy = React.useMemo(() => new Proxy((node) => {
|
|
39
|
+
if (node !== refElement) {
|
|
40
|
+
setRefElement(node);
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
get(target, prop) {
|
|
44
|
+
if (prop === "current") {
|
|
45
|
+
return refElement;
|
|
46
|
+
}
|
|
47
|
+
return target[prop];
|
|
48
|
+
},
|
|
49
|
+
set(target, prop, value) {
|
|
50
|
+
if (prop === "current") {
|
|
51
|
+
setRefElement(value);
|
|
52
|
+
} else {
|
|
53
|
+
target[prop] = value;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
}), [refElement]);
|
|
58
|
+
return { refProxy, refElement, setRefElement };
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
const getDimensions = (entry, box) => {
|
|
62
|
+
if (box === "border-box") {
|
|
63
|
+
return {
|
|
64
|
+
width: entry.borderBoxSize[0].inlineSize,
|
|
65
|
+
height: entry.borderBoxSize[0].blockSize
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (box === "content-box") {
|
|
69
|
+
return {
|
|
70
|
+
width: entry.contentBoxSize[0].inlineSize,
|
|
71
|
+
height: entry.contentBoxSize[0].blockSize
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
width: entry.contentRect.width,
|
|
76
|
+
height: entry.contentRect.height
|
|
77
|
+
};
|
|
78
|
+
};
|
|
20
79
|
export {
|
|
21
|
-
|
|
80
|
+
getDimensions,
|
|
81
|
+
patchResizeCallback,
|
|
82
|
+
useCallbackRef,
|
|
83
|
+
useRefProxy
|
|
22
84
|
};
|
|
23
85
|
//# sourceMappingURL=harmony121.mjs.map
|