@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.
@@ -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 = billingRoles.includes(userTeamRole);
26
+ const canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole);
18
27
  const isOnFreeOrTrialPlan = plan.isFreePlan(planId) || plan.isTrialPlan(planId);
19
- const showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan && canChangeBilling;
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 = {
@@ -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 = billingRoles.includes(userTeamRole)\n\n\tconst isOnFreeOrTrialPlan = isFreePlan(planId) || isTrialPlan(planId)\n\n\tconst showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan && canChangeBilling\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;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,aAAa,SAAS,YAAY;AAEhE,QAAM,sBAAsBC,KAAA,WAAW,MAAM,KAAKC,KAAAA,YAAY,MAAM;AAE9D,QAAA,iBAAiB,wBAAwB,uBAAuB;AAEhE,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;;"}
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;;"}
@@ -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 = billingRoles.includes(userTeamRole);
24
+ const canAccessTeamSettings = teamSettingsRoles.includes(userTeamRole);
16
25
  const isOnFreeOrTrialPlan = isFreePlan(planId) || isTrialPlan(planId);
17
- const showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan && canChangeBilling;
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 = {
@@ -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 = billingRoles.includes(userTeamRole)\n\n\tconst isOnFreeOrTrialPlan = isFreePlan(planId) || isTrialPlan(planId)\n\n\tconst showUpgradeCta = isFullyAuthenticated && isOnFreeOrTrialPlan && canChangeBilling\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;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,aAAa,SAAS,YAAY;AAEhE,QAAM,sBAAsB,WAAW,MAAM,KAAK,YAAY,MAAM;AAE9D,QAAA,iBAAiB,wBAAwB,uBAAuB;AAEhE,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;"}
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;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/harmony",
3
- "version": "1.29.2",
3
+ "version": "1.29.3",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"