@lokalise/harmony 1.29.2 → 1.29.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/harmony85.cjs +11 -2
- package/dist/harmony85.cjs.map +1 -1
- package/dist/harmony85.mjs +11 -2
- package/dist/harmony85.mjs.map +1 -1
- package/package.json +1 -1
package/dist/harmony85.cjs
CHANGED
@@ -9,14 +9,23 @@ const billingRoles = [
|
|
9
9
|
types.SidebarTeamRoles.owner,
|
10
10
|
types.SidebarTeamRoles.admin
|
11
11
|
];
|
12
|
+
const teamSettingsRoles = [
|
13
|
+
types.SidebarTeamRoles.biller,
|
14
|
+
types.SidebarTeamRoles.owner,
|
15
|
+
types.SidebarTeamRoles.admin
|
16
|
+
];
|
17
|
+
const upgradeCtaRoles = [
|
18
|
+
types.SidebarTeamRoles.biller,
|
19
|
+
types.SidebarTeamRoles.owner
|
20
|
+
];
|
12
21
|
const ProfileMenuProvider = ({ children, config }) => {
|
13
22
|
const { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } = config;
|
14
23
|
const currentTeam = teams.find((t) => t.id === currentTeamId);
|
15
24
|
const otherTeams = teams.filter((t) => t.id !== currentTeamId);
|
16
25
|
const canChangeBilling = billingRoles.includes(userTeamRole);
|
17
|
-
const canAccessTeamSettings =
|
26
|
+
const canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole);
|
18
27
|
const isOnFreeOrTrialPlan = plan.isFreePlan(planId) || plan.isTrialPlan(planId);
|
19
|
-
const showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan &&
|
28
|
+
const showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan && upgradeCtaRoles.includes(userTeamRole);
|
20
29
|
const showBillingButton = isFullyAuthenticated && canAccessTeamSettings && canChangeBilling;
|
21
30
|
const allowTeamCreation = isFullyAuthenticated && !isEndOfTrialActive;
|
22
31
|
const providerValue = {
|
package/dist/harmony85.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"harmony85.cjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenuProvider.tsx"],"sourcesContent":["import { isFreePlan, isTrialPlan } from '@utils'\nimport type { PropsWithChildren } from 'react'\nimport { type SidebarTeamRole, SidebarTeamRoles } from '../../types'\nimport { ProfileMenuContext } from './ProfileMenuContext'\nimport type { SidebarProfileMenuConfig } from './types'\n\ntype ProfileMenuProviderProps = PropsWithChildren<{\n\tconfig: SidebarProfileMenuConfig\n}>\n\nconst billingRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nexport const ProfileMenuProvider = ({ children, config }: ProfileMenuProviderProps) => {\n\tconst { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } =\n\t\tconfig\n\n\tconst currentTeam = teams.find((t) => t.id === currentTeamId)\n\n\tconst otherTeams = teams.filter((t) => t.id !== currentTeamId)\n\n\tconst canChangeBilling = billingRoles.includes(userTeamRole)\n\n\tconst canAccessTeamSettings =
|
1
|
+
{"version":3,"file":"harmony85.cjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenuProvider.tsx"],"sourcesContent":["import { isFreePlan, isTrialPlan } from '@utils'\nimport type { PropsWithChildren } from 'react'\nimport { type SidebarTeamRole, SidebarTeamRoles } from '../../types'\nimport { ProfileMenuContext } from './ProfileMenuContext'\nimport type { SidebarProfileMenuConfig } from './types'\n\ntype ProfileMenuProviderProps = PropsWithChildren<{\n\tconfig: SidebarProfileMenuConfig\n}>\n\nconst billingRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nconst teamSettingsRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nconst upgradeCtaRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n]\n\nexport const ProfileMenuProvider = ({ children, config }: ProfileMenuProviderProps) => {\n\tconst { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } =\n\t\tconfig\n\n\tconst currentTeam = teams.find((t) => t.id === currentTeamId)\n\n\tconst otherTeams = teams.filter((t) => t.id !== currentTeamId)\n\n\tconst canChangeBilling = billingRoles.includes(userTeamRole)\n\n\tconst canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole)\n\n\tconst isOnFreeOrTrialPlan = isFreePlan(planId) || isTrialPlan(planId)\n\n\tconst showUpgradeCta =\n\t\tisFullyAuthenticated && isOnFreeOrTrialPlan && upgradeCtaRoles.includes(userTeamRole)\n\n\tconst showBillingButton = isFullyAuthenticated && canAccessTeamSettings && canChangeBilling\n\n\tconst allowTeamCreation = isFullyAuthenticated && !isEndOfTrialActive\n\n\tconst providerValue = {\n\t\t...config,\n\t\tcurrentTeam,\n\t\totherTeams,\n\t\tcanChangeBilling,\n\t\tcanAccessTeamSettings,\n\t\tisOnFreeOrTrialPlan,\n\t\tshowUpgradeCta,\n\t\tshowBillingButton,\n\t\tallowTeamCreation,\n\t}\n\n\treturn <ProfileMenuContext.Provider value={providerValue}>{children}</ProfileMenuContext.Provider>\n}\n"],"names":["SidebarTeamRoles","isFreePlan","isTrialPlan","ProfileMenuContext"],"mappings":";;;;;;AAUA,MAAM,eAA+C;AAAA,EACpDA,MAAAA,iBAAiB;AAAA,EACjBA,MAAAA,iBAAiB;AAAA,EACjBA,uBAAiB;AAClB;AAEA,MAAM,oBAAoD;AAAA,EACzDA,MAAAA,iBAAiB;AAAA,EACjBA,MAAAA,iBAAiB;AAAA,EACjBA,uBAAiB;AAClB;AAEA,MAAM,kBAAkD;AAAA,EACvDA,MAAAA,iBAAiB;AAAA,EACjBA,uBAAiB;AAClB;AAEO,MAAM,sBAAsB,CAAC,EAAE,UAAU,aAAuC;AACtF,QAAM,EAAE,OAAO,eAAe,QAAQ,oBAAoB,sBAAsB,iBAC/E;AAED,QAAM,cAAc,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,aAAa;AAE5D,QAAM,aAAa,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,aAAa;AAEvD,QAAA,mBAAmB,aAAa,SAAS,YAAY;AAErD,QAAA,wBAAwB,kBAAkB,SAAS,YAAY;AAErE,QAAM,sBAAsBC,KAAA,WAAW,MAAM,KAAKC,KAAAA,YAAY,MAAM;AAEpE,QAAM,iBACL,wBAAwB,uBAAuB,gBAAgB,SAAS,YAAY;AAE/E,QAAA,oBAAoB,wBAAwB,yBAAyB;AAErE,QAAA,oBAAoB,wBAAwB,CAAC;AAEnD,QAAM,gBAAgB;AAAA,IACrB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,wCAAQC,mBAAAA,mBAAmB,UAAnB,EAA4B,OAAO,eAAgB,UAAS;AACrE;;"}
|
package/dist/harmony85.mjs
CHANGED
@@ -7,14 +7,23 @@ const billingRoles = [
|
|
7
7
|
SidebarTeamRoles.owner,
|
8
8
|
SidebarTeamRoles.admin
|
9
9
|
];
|
10
|
+
const teamSettingsRoles = [
|
11
|
+
SidebarTeamRoles.biller,
|
12
|
+
SidebarTeamRoles.owner,
|
13
|
+
SidebarTeamRoles.admin
|
14
|
+
];
|
15
|
+
const upgradeCtaRoles = [
|
16
|
+
SidebarTeamRoles.biller,
|
17
|
+
SidebarTeamRoles.owner
|
18
|
+
];
|
10
19
|
const ProfileMenuProvider = ({ children, config }) => {
|
11
20
|
const { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } = config;
|
12
21
|
const currentTeam = teams.find((t) => t.id === currentTeamId);
|
13
22
|
const otherTeams = teams.filter((t) => t.id !== currentTeamId);
|
14
23
|
const canChangeBilling = billingRoles.includes(userTeamRole);
|
15
|
-
const canAccessTeamSettings =
|
24
|
+
const canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole);
|
16
25
|
const isOnFreeOrTrialPlan = isFreePlan(planId) || isTrialPlan(planId);
|
17
|
-
const showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan &&
|
26
|
+
const showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan && upgradeCtaRoles.includes(userTeamRole);
|
18
27
|
const showBillingButton = isFullyAuthenticated && canAccessTeamSettings && canChangeBilling;
|
19
28
|
const allowTeamCreation = isFullyAuthenticated && !isEndOfTrialActive;
|
20
29
|
const providerValue = {
|
package/dist/harmony85.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"harmony85.mjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenuProvider.tsx"],"sourcesContent":["import { isFreePlan, isTrialPlan } from '@utils'\nimport type { PropsWithChildren } from 'react'\nimport { type SidebarTeamRole, SidebarTeamRoles } from '../../types'\nimport { ProfileMenuContext } from './ProfileMenuContext'\nimport type { SidebarProfileMenuConfig } from './types'\n\ntype ProfileMenuProviderProps = PropsWithChildren<{\n\tconfig: SidebarProfileMenuConfig\n}>\n\nconst billingRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nexport const ProfileMenuProvider = ({ children, config }: ProfileMenuProviderProps) => {\n\tconst { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } =\n\t\tconfig\n\n\tconst currentTeam = teams.find((t) => t.id === currentTeamId)\n\n\tconst otherTeams = teams.filter((t) => t.id !== currentTeamId)\n\n\tconst canChangeBilling = billingRoles.includes(userTeamRole)\n\n\tconst canAccessTeamSettings =
|
1
|
+
{"version":3,"file":"harmony85.mjs","sources":["../src/components/Sidebar/Widgets/ProfileMenu/ProfileMenuProvider.tsx"],"sourcesContent":["import { isFreePlan, isTrialPlan } from '@utils'\nimport type { PropsWithChildren } from 'react'\nimport { type SidebarTeamRole, SidebarTeamRoles } from '../../types'\nimport { ProfileMenuContext } from './ProfileMenuContext'\nimport type { SidebarProfileMenuConfig } from './types'\n\ntype ProfileMenuProviderProps = PropsWithChildren<{\n\tconfig: SidebarProfileMenuConfig\n}>\n\nconst billingRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nconst teamSettingsRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n\tSidebarTeamRoles.admin,\n]\n\nconst upgradeCtaRoles: ReadonlyArray<SidebarTeamRole> = [\n\tSidebarTeamRoles.biller,\n\tSidebarTeamRoles.owner,\n]\n\nexport const ProfileMenuProvider = ({ children, config }: ProfileMenuProviderProps) => {\n\tconst { teams, currentTeamId, planId, isEndOfTrialActive, isFullyAuthenticated, userTeamRole } =\n\t\tconfig\n\n\tconst currentTeam = teams.find((t) => t.id === currentTeamId)\n\n\tconst otherTeams = teams.filter((t) => t.id !== currentTeamId)\n\n\tconst canChangeBilling = billingRoles.includes(userTeamRole)\n\n\tconst canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole)\n\n\tconst isOnFreeOrTrialPlan = isFreePlan(planId) || isTrialPlan(planId)\n\n\tconst showUpgradeCta =\n\t\tisFullyAuthenticated && isOnFreeOrTrialPlan && upgradeCtaRoles.includes(userTeamRole)\n\n\tconst showBillingButton = isFullyAuthenticated && canAccessTeamSettings && canChangeBilling\n\n\tconst allowTeamCreation = isFullyAuthenticated && !isEndOfTrialActive\n\n\tconst providerValue = {\n\t\t...config,\n\t\tcurrentTeam,\n\t\totherTeams,\n\t\tcanChangeBilling,\n\t\tcanAccessTeamSettings,\n\t\tisOnFreeOrTrialPlan,\n\t\tshowUpgradeCta,\n\t\tshowBillingButton,\n\t\tallowTeamCreation,\n\t}\n\n\treturn <ProfileMenuContext.Provider value={providerValue}>{children}</ProfileMenuContext.Provider>\n}\n"],"names":[],"mappings":";;;;AAUA,MAAM,eAA+C;AAAA,EACpD,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAClB;AAEA,MAAM,oBAAoD;AAAA,EACzD,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAClB;AAEA,MAAM,kBAAkD;AAAA,EACvD,iBAAiB;AAAA,EACjB,iBAAiB;AAClB;AAEO,MAAM,sBAAsB,CAAC,EAAE,UAAU,aAAuC;AACtF,QAAM,EAAE,OAAO,eAAe,QAAQ,oBAAoB,sBAAsB,iBAC/E;AAED,QAAM,cAAc,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,aAAa;AAE5D,QAAM,aAAa,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,aAAa;AAEvD,QAAA,mBAAmB,aAAa,SAAS,YAAY;AAErD,QAAA,wBAAwB,kBAAkB,SAAS,YAAY;AAErE,QAAM,sBAAsB,WAAW,MAAM,KAAK,YAAY,MAAM;AAEpE,QAAM,iBACL,wBAAwB,uBAAuB,gBAAgB,SAAS,YAAY;AAE/E,QAAA,oBAAoB,wBAAwB,yBAAyB;AAErE,QAAA,oBAAoB,wBAAwB,CAAC;AAEnD,QAAM,gBAAgB;AAAA,IACrB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,6BAAQ,mBAAmB,UAAnB,EAA4B,OAAO,eAAgB,UAAS;AACrE;"}
|