@lokalise/harmony 1.40.0 → 1.40.1

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.
Files changed (232) hide show
  1. package/dist/harmony100.cjs +12 -9
  2. package/dist/harmony100.cjs.map +1 -1
  3. package/dist/harmony100.mjs +11 -8
  4. package/dist/harmony100.mjs.map +1 -1
  5. package/dist/harmony101.cjs +12 -57
  6. package/dist/harmony101.cjs.map +1 -1
  7. package/dist/harmony101.mjs +11 -56
  8. package/dist/harmony101.mjs.map +1 -1
  9. package/dist/harmony102.cjs +6 -42
  10. package/dist/harmony102.cjs.map +1 -1
  11. package/dist/harmony102.mjs +5 -41
  12. package/dist/harmony102.mjs.map +1 -1
  13. package/dist/harmony103.cjs +10 -6
  14. package/dist/harmony103.cjs.map +1 -1
  15. package/dist/harmony103.mjs +9 -5
  16. package/dist/harmony103.mjs.map +1 -1
  17. package/dist/harmony104.cjs +6 -6
  18. package/dist/harmony104.mjs +6 -6
  19. package/dist/harmony105.cjs +57 -24
  20. package/dist/harmony105.cjs.map +1 -1
  21. package/dist/harmony105.mjs +56 -23
  22. package/dist/harmony105.mjs.map +1 -1
  23. package/dist/harmony106.cjs +42 -6
  24. package/dist/harmony106.cjs.map +1 -1
  25. package/dist/harmony106.mjs +41 -5
  26. package/dist/harmony106.mjs.map +1 -1
  27. package/dist/harmony107.cjs +5 -21
  28. package/dist/harmony107.cjs.map +1 -1
  29. package/dist/harmony107.mjs +5 -21
  30. package/dist/harmony107.mjs.map +1 -1
  31. package/dist/harmony108.cjs +4 -7
  32. package/dist/harmony108.cjs.map +1 -1
  33. package/dist/harmony108.mjs +4 -7
  34. package/dist/harmony108.mjs.map +1 -1
  35. package/dist/harmony109.cjs +25 -12
  36. package/dist/harmony109.cjs.map +1 -1
  37. package/dist/harmony109.mjs +24 -11
  38. package/dist/harmony109.mjs.map +1 -1
  39. package/dist/harmony110.cjs +5 -20
  40. package/dist/harmony110.cjs.map +1 -1
  41. package/dist/harmony110.mjs +5 -20
  42. package/dist/harmony110.mjs.map +1 -1
  43. package/dist/harmony111.cjs +19 -164
  44. package/dist/harmony111.cjs.map +1 -1
  45. package/dist/harmony111.mjs +19 -164
  46. package/dist/harmony111.mjs.map +1 -1
  47. package/dist/harmony112.cjs +12 -44
  48. package/dist/harmony112.cjs.map +1 -1
  49. package/dist/harmony112.mjs +11 -43
  50. package/dist/harmony112.mjs.map +1 -1
  51. package/dist/harmony113.cjs +11 -96
  52. package/dist/harmony113.cjs.map +1 -1
  53. package/dist/harmony113.mjs +11 -79
  54. package/dist/harmony113.mjs.map +1 -1
  55. package/dist/harmony114.cjs +18 -14
  56. package/dist/harmony114.cjs.map +1 -1
  57. package/dist/harmony114.mjs +18 -14
  58. package/dist/harmony114.mjs.map +1 -1
  59. package/dist/harmony115.cjs +87 -18
  60. package/dist/harmony115.cjs.map +1 -1
  61. package/dist/harmony115.mjs +87 -18
  62. package/dist/harmony115.mjs.map +1 -1
  63. package/dist/harmony116.cjs +31 -22
  64. package/dist/harmony116.cjs.map +1 -1
  65. package/dist/harmony116.mjs +30 -21
  66. package/dist/harmony116.mjs.map +1 -1
  67. package/dist/harmony117.cjs +98 -5
  68. package/dist/harmony117.cjs.map +1 -1
  69. package/dist/harmony117.mjs +81 -5
  70. package/dist/harmony117.mjs.map +1 -1
  71. package/dist/harmony118.cjs +21 -132
  72. package/dist/harmony118.cjs.map +1 -1
  73. package/dist/harmony118.mjs +20 -131
  74. package/dist/harmony118.mjs.map +1 -1
  75. package/dist/harmony119.cjs +6 -12
  76. package/dist/harmony119.cjs.map +1 -1
  77. package/dist/harmony119.mjs +5 -11
  78. package/dist/harmony119.mjs.map +1 -1
  79. package/dist/harmony120.cjs +132 -5
  80. package/dist/harmony120.cjs.map +1 -1
  81. package/dist/harmony120.mjs +132 -5
  82. package/dist/harmony120.mjs.map +1 -1
  83. package/dist/harmony121.cjs +12 -40
  84. package/dist/harmony121.cjs.map +1 -1
  85. package/dist/harmony121.mjs +11 -39
  86. package/dist/harmony121.mjs.map +1 -1
  87. package/dist/harmony122.cjs +4 -59
  88. package/dist/harmony122.cjs.map +1 -1
  89. package/dist/harmony122.mjs +5 -60
  90. package/dist/harmony122.mjs.map +1 -1
  91. package/dist/harmony123.cjs +39 -6
  92. package/dist/harmony123.cjs.map +1 -1
  93. package/dist/harmony123.mjs +39 -6
  94. package/dist/harmony123.mjs.map +1 -1
  95. package/dist/harmony124.cjs +60 -6
  96. package/dist/harmony124.cjs.map +1 -1
  97. package/dist/harmony124.mjs +59 -5
  98. package/dist/harmony124.mjs.map +1 -1
  99. package/dist/harmony125.cjs +8 -6
  100. package/dist/harmony125.cjs.map +1 -1
  101. package/dist/harmony125.mjs +7 -5
  102. package/dist/harmony125.mjs.map +1 -1
  103. package/dist/harmony126.cjs +6 -5
  104. package/dist/harmony126.cjs.map +1 -1
  105. package/dist/harmony126.mjs +6 -5
  106. package/dist/harmony127.cjs +9 -86
  107. package/dist/harmony127.cjs.map +1 -1
  108. package/dist/harmony127.mjs +9 -86
  109. package/dist/harmony127.mjs.map +1 -1
  110. package/dist/harmony128.cjs +6 -31
  111. package/dist/harmony128.cjs.map +1 -1
  112. package/dist/harmony128.mjs +5 -30
  113. package/dist/harmony128.mjs.map +1 -1
  114. package/dist/harmony129.cjs +6 -97
  115. package/dist/harmony129.cjs.map +1 -1
  116. package/dist/harmony129.mjs +5 -96
  117. package/dist/harmony129.mjs.map +1 -1
  118. package/dist/harmony130.cjs +62 -13
  119. package/dist/harmony130.cjs.map +1 -1
  120. package/dist/harmony130.mjs +61 -12
  121. package/dist/harmony130.mjs.map +1 -1
  122. package/dist/harmony131.cjs +87 -13
  123. package/dist/harmony131.cjs.map +1 -1
  124. package/dist/harmony131.mjs +87 -13
  125. package/dist/harmony131.mjs.map +1 -1
  126. package/dist/harmony132.cjs +19 -37
  127. package/dist/harmony132.cjs.map +1 -1
  128. package/dist/harmony132.mjs +18 -36
  129. package/dist/harmony132.mjs.map +1 -1
  130. package/dist/harmony133.cjs +87 -19
  131. package/dist/harmony133.cjs.map +1 -1
  132. package/dist/harmony133.mjs +87 -19
  133. package/dist/harmony133.mjs.map +1 -1
  134. package/dist/harmony134.cjs +13 -62
  135. package/dist/harmony134.cjs.map +1 -1
  136. package/dist/harmony134.mjs +12 -61
  137. package/dist/harmony134.mjs.map +1 -1
  138. package/dist/harmony135.cjs +13 -87
  139. package/dist/harmony135.cjs.map +1 -1
  140. package/dist/harmony135.mjs +13 -87
  141. package/dist/harmony135.mjs.map +1 -1
  142. package/dist/harmony136.cjs +37 -19
  143. package/dist/harmony136.cjs.map +1 -1
  144. package/dist/harmony136.mjs +36 -18
  145. package/dist/harmony136.mjs.map +1 -1
  146. package/dist/harmony137.cjs +28 -10
  147. package/dist/harmony137.cjs.map +1 -1
  148. package/dist/harmony137.mjs +28 -10
  149. package/dist/harmony137.mjs.map +1 -1
  150. package/dist/harmony138.cjs +7 -13
  151. package/dist/harmony138.cjs.map +1 -1
  152. package/dist/harmony138.mjs +7 -13
  153. package/dist/harmony138.mjs.map +1 -1
  154. package/dist/harmony139.cjs +57 -15
  155. package/dist/harmony139.cjs.map +1 -1
  156. package/dist/harmony139.mjs +57 -15
  157. package/dist/harmony139.mjs.map +1 -1
  158. package/dist/harmony14.cjs +1 -1
  159. package/dist/harmony14.mjs +1 -1
  160. package/dist/harmony140.cjs +59 -15
  161. package/dist/harmony140.cjs.map +1 -1
  162. package/dist/harmony140.mjs +59 -15
  163. package/dist/harmony140.mjs.map +1 -1
  164. package/dist/harmony141.cjs +18 -7
  165. package/dist/harmony141.cjs.map +1 -1
  166. package/dist/harmony141.mjs +17 -6
  167. package/dist/harmony141.mjs.map +1 -1
  168. package/dist/harmony142.cjs +13 -57
  169. package/dist/harmony142.cjs.map +1 -1
  170. package/dist/harmony142.mjs +13 -57
  171. package/dist/harmony142.mjs.map +1 -1
  172. package/dist/harmony143.cjs +14 -59
  173. package/dist/harmony143.cjs.map +1 -1
  174. package/dist/harmony143.mjs +14 -59
  175. package/dist/harmony143.mjs.map +1 -1
  176. package/dist/harmony144.cjs +17 -19
  177. package/dist/harmony144.cjs.map +1 -1
  178. package/dist/harmony144.mjs +16 -18
  179. package/dist/harmony144.mjs.map +1 -1
  180. package/dist/harmony150.cjs +1 -1
  181. package/dist/harmony150.mjs +1 -1
  182. package/dist/harmony153.cjs +1 -1
  183. package/dist/harmony153.mjs +1 -1
  184. package/dist/harmony17.cjs +1 -1
  185. package/dist/harmony17.mjs +1 -1
  186. package/dist/harmony25.cjs +1 -1
  187. package/dist/harmony25.mjs +1 -1
  188. package/dist/harmony26.cjs +1 -1
  189. package/dist/harmony26.mjs +1 -1
  190. package/dist/harmony75.cjs +1 -1
  191. package/dist/harmony75.mjs +1 -1
  192. package/dist/harmony77.cjs +1 -1
  193. package/dist/harmony77.mjs +1 -1
  194. package/dist/harmony78.cjs +1 -1
  195. package/dist/harmony78.mjs +1 -1
  196. package/dist/harmony79.cjs +1 -1
  197. package/dist/harmony79.mjs +1 -1
  198. package/dist/harmony80.cjs +2 -2
  199. package/dist/harmony80.mjs +2 -2
  200. package/dist/harmony81.cjs +2 -2
  201. package/dist/harmony81.mjs +2 -2
  202. package/dist/harmony82.cjs +2 -2
  203. package/dist/harmony82.mjs +2 -2
  204. package/dist/harmony83.cjs +2 -2
  205. package/dist/harmony83.mjs +2 -2
  206. package/dist/harmony84.cjs +3 -3
  207. package/dist/harmony84.mjs +3 -3
  208. package/dist/harmony85.cjs +6 -6
  209. package/dist/harmony85.mjs +6 -6
  210. package/dist/harmony88.cjs +2 -2
  211. package/dist/harmony88.mjs +2 -2
  212. package/dist/harmony90.cjs +2 -2
  213. package/dist/harmony90.mjs +2 -2
  214. package/dist/harmony92.cjs +2 -2
  215. package/dist/harmony92.mjs +2 -2
  216. package/dist/harmony96.cjs +165 -11
  217. package/dist/harmony96.cjs.map +1 -1
  218. package/dist/harmony96.mjs +165 -11
  219. package/dist/harmony96.mjs.map +1 -1
  220. package/dist/harmony97.cjs +44 -12
  221. package/dist/harmony97.cjs.map +1 -1
  222. package/dist/harmony97.mjs +43 -11
  223. package/dist/harmony97.mjs.map +1 -1
  224. package/dist/harmony98.cjs +12 -7
  225. package/dist/harmony98.cjs.map +1 -1
  226. package/dist/harmony98.mjs +11 -6
  227. package/dist/harmony98.mjs.map +1 -1
  228. package/dist/harmony99.cjs +20 -8
  229. package/dist/harmony99.cjs.map +1 -1
  230. package/dist/harmony99.mjs +20 -8
  231. package/dist/harmony99.mjs.map +1 -1
  232. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"harmony111.cjs","sources":["../src/features/navigation/hooks/useExpertNavigation.ts"],"sourcesContent":["import type { Contributor, Project } from '@features/node'\nimport { useMemo } from 'react'\nimport { useNavigationClient } from '../providers/NavigationClientProvider'\nimport type { NavigationTabsItem } from '../types/navigation'\nimport { getProjectNavigationVisibilityMap } from '../utils/toolbarVisibility'\n\n// TODO: Validate features types\nexport const getIsFeatureEnabled = (features: Record<string, boolean>, name: string) => {\n\tconst featureState = features[name]\n\n\treturn (\n\t\tfeatureState !== null &&\n\t\tfeatureState !== undefined &&\n\t\t[true, 'on', 'true'].includes(featureState)\n\t)\n}\n\n/**\n * Hook to generate legacy navigation items using the existing structure\n * but with context API instead of Redux\n */\nexport const useExpertNavigation = (\n\tenabled: boolean,\n\tproject?: Project,\n\tcontributor?: Contributor,\n) => {\n\t// Use contributor data if provided, otherwise use defaults\n\tconst adminRights = contributor?.admin_rights || []\n\t// TODO: Implement selected app slug, small investigation is needed\n\tconst marketingSupportProjectSelectedAppSlug = 'selected-app-slug'\n\tconst navigationClient = useNavigationClient()\n\tconst expertUrl = navigationClient.getExpertUrl()\n\n\treturn useMemo(() => {\n\t\t// Get data from contexts instead of Redux, or use provided data\n\t\tif (!project || !enabled) {\n\t\t\treturn []\n\t\t}\n\t\t/* TODO: We're missing badges API. We need to get it from the backend or find alternative way to get task count\n\t\t * Fetch tasks and calculate count is not a good idea, because it can have pagination, therefore we can\n\t\t * ask for an additional prop in tasks response: task_count based on branch_id + project_id + task_status\n\t\t */\n\t\t// const taskCount = getTaskCount(project, branch, badges.tasks)\n\n\t\t// TODO: Implement feature flags functionality, most likely separate package\n\t\t// const isFeatureEnabled = (feature: string) => getIsFeatureEnabled(features, feature)\n\n\t\tconst navigationVisibility = getProjectNavigationVisibilityMap(\n\t\t\tproject,\n\t\t\tadminRights,\n\t\t\t() => true /*isFeatureEnabled*/,\n\t\t)\n\n\t\tconst appsNavigationItem: NavigationTabsItem = {\n\t\t\tkey: 'apps',\n\t\t\tlabel: 'Apps',\n\t\t\tisActive: (input: string) => input === 'apps',\n\t\t\tlink: `${expertUrl}/apps/${project.project_id}/`,\n\t\t\t...navigationVisibility.apps,\n\t\t}\n\n\t\tconst appsNavigationItemArrInMainMenu: NavigationTabsItem[] = []\n\t\tconst appsNavigationItemArrInMoreMenu: NavigationTabsItem[] = []\n\n\t\tif (project.project_type === 'content_integration') {\n\t\t\tappsNavigationItemArrInMoreMenu.push(appsNavigationItem)\n\t\t} else {\n\t\t\tappsNavigationItemArrInMainMenu.push(appsNavigationItem)\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tkey: 'edit',\n\t\t\t\tlabel: 'Editor',\n\t\t\t\tlink: `${expertUrl}/project/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'edit',\n\t\t\t\t...navigationVisibility.editor,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'files',\n\t\t\t\tlabel: 'Files',\n\t\t\t\tlink: `${expertUrl}/files/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'files',\n\t\t\t\t...navigationVisibility.files,\n\t\t\t},\n\t\t\t...(project.project_type === 'content_integration'\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'contentManagement',\n\t\t\t\t\t\t\tlabel: 'Content management',\n\t\t\t\t\t\t\tisActive: (input: string) => input === 'apps',\n\t\t\t\t\t\t\tlink: `${expertUrl}/apps/${project.project_id}/${marketingSupportProjectSelectedAppSlug}`,\n\t\t\t\t\t\t\t...navigationVisibility.contentManagement,\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'upload',\n\t\t\t\t\t\t\tlabel: 'Upload',\n\t\t\t\t\t\t\tlink: `${expertUrl}/upload/${project.project_id}/`,\n\t\t\t\t\t\t\tisActive: (input: string) => input === 'upload',\n\t\t\t\t\t\t\t...navigationVisibility.upload,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'download',\n\t\t\t\t\t\t\tlabel: 'Download',\n\t\t\t\t\t\t\tlink: `${expertUrl}/download/${project.project_id}/`,\n\t\t\t\t\t\t\tisActive: (input: string) => input === 'download',\n\t\t\t\t\t\t\t...navigationVisibility.download,\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t{\n\t\t\t\tkey: 'tasks',\n\t\t\t\tlabel: 'Tasks',\n\t\t\t\tlink: `${expertUrl}/tasks/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'tasks',\n\t\t\t\t// TODO: Add task count\n\t\t\t\t// badge: taskCount,\n\t\t\t\t...navigationVisibility.tasks,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'workflows',\n\t\t\t\tlabel: 'Workflows',\n\t\t\t\tlink: `${expertUrl}/workflows/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'workflows',\n\t\t\t\tnovel: 'New',\n\t\t\t\tonClick: () => {\n\t\t\t\t\t// TODO: Resolve analytics globally, most likely separate package\n\t\t\t\t\t// track(AnalyticsEventName.EDITOR_WORKFLOWS_TAB_CLICKED);\n\t\t\t\t\twindow.location.assign(`${expertUrl}/workflows/${project.project_id}/`)\n\t\t\t\t},\n\t\t\t\t...navigationVisibility.workflows,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'contributors',\n\t\t\t\tlabel: 'Contributors',\n\t\t\t\tlink: `${expertUrl}/contributors/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'contributors',\n\t\t\t\t...navigationVisibility.contributors,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'screenshots',\n\t\t\t\tlabel: 'Screenshots',\n\t\t\t\tlink: `${expertUrl}/screenshots/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'screenshots',\n\t\t\t\t...navigationVisibility.screenshots,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'glossary',\n\t\t\t\tlabel: 'Glossary',\n\t\t\t\tlink: `${expertUrl}/glossary/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'glossary',\n\t\t\t\t...navigationVisibility.glossary,\n\t\t\t},\n\t\t\t...appsNavigationItemArrInMainMenu,\n\t\t\t{\n\t\t\t\tkey: 'more',\n\t\t\t\tlabel: 'More...',\n\t\t\t\tisActive: (input: string) =>\n\t\t\t\t\t['settings', 'statistics', 'duplicates', 'live edit'].includes(input),\n\t\t\t\t...navigationVisibility.more,\n\t\t\t\tdropdown: [\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/`,\n\t\t\t\t\t\t\tlabel: 'Settings',\n\t\t\t\t\t\t\t...navigationVisibility.settings,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/#branches`,\n\t\t\t\t\t\t\tlabel: 'Branches',\n\t\t\t\t\t\t\t...navigationVisibility.branches,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/#ota-bundles`,\n\t\t\t\t\t\t\tlabel: 'OTA Bundles',\n\t\t\t\t\t\t\t...navigationVisibility.otaBundles,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/#project-automations`,\n\t\t\t\t\t\t\tlabel: 'Automations',\n\t\t\t\t\t\t\t...navigationVisibility.automations,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/dupes/${project.project_id}/`,\n\t\t\t\t\t\t\tlabel: 'Duplicate finder',\n\t\t\t\t\t\t\t...navigationVisibility.duplicateFinder,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t...appsNavigationItemArrInMoreMenu,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: This could be problematic tab, because it is not a link and we can't just redirect. We need to find a workaround for that.\n\t\t\t\t\t\t\tlabel: 'Activity',\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t// const showActivityEvent = new CustomEvent(\"show-activity\", {\n\t\t\t\t\t\t\t\t// \tdetail: {\n\t\t\t\t\t\t\t\t// \t\tprojectId: project.id,\n\t\t\t\t\t\t\t\t// \t\tbranchId: branch.branchId,\n\t\t\t\t\t\t\t\t// \t\tbranchName: branch.branchName,\n\t\t\t\t\t\t\t\t// \t},\n\t\t\t\t\t\t\t\t// });\n\t\t\t\t\t\t\t\t// document.dispatchEvent(showActivityEvent);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t...navigationVisibility.activity,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/statistics/${project.project_id}/`,\n\t\t\t\t\t\t\tlabel: 'Statistics',\n\t\t\t\t\t\t\t...navigationVisibility.statistics,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t},\n\t\t]\n\t}, [project, adminRights, enabled, expertUrl])\n}\n\n// TODO: Helper function for getting task count from badge data\n// const _getTaskCount = (project: any, branch: any, taskBadges: any) => {\n// \tif (!taskBadges) return 0\n\n// \t// Implementation would depend on your getTaskCountFromTasks utility\n// \t// Simplified version:\n// \tconst projectTasks = taskBadges[project.id] || {}\n// \treturn projectTasks[branch.branchId || 'master'] || 0\n// }\n"],"names":["useNavigationClient","useMemo","getProjectNavigationVisibilityMap"],"mappings":";;;;;AAqBO,MAAM,sBAAsB,CAClC,SACA,SACA,gBACI;AAEE,QAAA,eAAc,2CAAa,iBAAgB,CAAC;AAElD,QAAM,yCAAyC;AAC/C,QAAM,mBAAmBA,yBAAAA,oBAAoB;AACvC,QAAA,YAAY,iBAAiB,aAAa;AAEhD,SAAOC,cAAQ,MAAM;AAEhB,QAAA,CAAC,WAAW,CAAC,SAAS;AACzB,aAAO,CAAC;AAAA,IAAA;AAWT,UAAM,uBAAuBC,kBAAA;AAAA,MAC5B;AAAA,MACA;AAAA,MACA,MAAM;AAAA,IACP;AAEA,UAAM,qBAAyC;AAAA,MAC9C,KAAK;AAAA,MACL,OAAO;AAAA,MACP,UAAU,CAAC,UAAkB,UAAU;AAAA,MACvC,MAAM,GAAG,SAAS,SAAS,QAAQ,UAAU;AAAA,MAC7C,GAAG,qBAAqB;AAAA,IACzB;AAEA,UAAM,kCAAwD,CAAC;AAC/D,UAAM,kCAAwD,CAAC;AAE3D,QAAA,QAAQ,iBAAiB,uBAAuB;AACnD,sCAAgC,KAAK,kBAAkB;AAAA,IAAA,OACjD;AACN,sCAAgC,KAAK,kBAAkB;AAAA,IAAA;AAGjD,WAAA;AAAA,MACN;AAAA,QACC,KAAK;AAAA,QACL,OAAO;AAAA,QACP,MAAM,GAAG,SAAS,YAAY,QAAQ,UAAU;AAAA,QAChD,UAAU,CAAC,UAAkB,UAAU;AAAA,QACvC,GAAG,qBAAqB;AAAA,MACzB;AAAA,MACA;AAAA,QACC,KAAK;AAAA,QACL,OAAO;AAAA,QACP,MAAM,GAAG,SAAS,UAAU,QAAQ,UAAU;AAAA,QAC9C,UAAU,CAAC,UAAkB,UAAU;AAAA,QACvC,GAAG,qBAAqB;AAAA,MACzB;AAAA,MACA,GAAI,QAAQ,iBAAiB,wBAC1B;AAAA,QACA;AAAA,UACC,KAA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Q,UAAU;AAAA,cACnD,OAAO;AAAA,cACP,GAAG,qBAAqB;AAAA,YAAA;AAAA,UACzB;AAAA,QACD;AAAA,MACD;AAAA,IAEF;AAAA,KACE,CAAC,SAAS,aAAa,SAAS,SAAS,CAAC;AAC9C;;"}
1
+ {"version":3,"file":"harmony111.cjs","sources":["../src/components/Sidebar/UpgradeIcon/UpgradeIcon.tsx"],"sourcesContent":["import { CaretUpIcon } from '@lokalise/louis'\nimport clsx from 'clsx'\nimport styles from './UpgradeIcon.module.css'\n\ntype UpgradeIconProps = {\n\tclassName?: string\n}\n\nexport const UpgradeIcon = ({ className = '' }: UpgradeIconProps) => {\n\treturn (\n\t\t<div\n\t\t\taria-label={'Upgrade Icon'}\n\t\t\tclassName={clsx(\n\t\t\t\tstyles.iconContainer,\n\t\t\t\t'flex-row',\n\t\t\t\t'items-center',\n\t\t\t\t'justify-center',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<CaretUpIcon />\n\t\t</div>\n\t)\n}\n"],"names":["jsx","clsx","styles","CaretUpIcon"],"mappings":";;;;;;AAQO,MAAM,cAAc,CAAC,EAAE,YAAY,SAA2B;AAEnE,SAAAA,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,cAAY;AAAA,MACZ,WAAWC,KAAA;AAAA,QACVC,mBAAAA,QAAO;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MAEA,yCAACC,MAAAA,aAAY,CAAA,CAAA;AAAA,IAAA;AAAA,EACd;AAEF;;"}
@@ -1,169 +1,24 @@
1
- import { useMemo } from "react";
2
- import { useNavigationClient } from "./harmony94.mjs";
3
- import { getProjectNavigationVisibilityMap } from "./harmony127.mjs";
4
- const useExpertNavigation = (enabled, project, contributor) => {
5
- const adminRights = (contributor == null ? void 0 : contributor.admin_rights) || [];
6
- const marketingSupportProjectSelectedAppSlug = "selected-app-slug";
7
- const navigationClient = useNavigationClient();
8
- const expertUrl = navigationClient.getExpertUrl();
9
- return useMemo(() => {
10
- if (!project || !enabled) {
11
- return [];
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { CaretUpIcon } from "@lokalise/louis";
3
+ import { clsx } from "./harmony73.mjs";
4
+ import styles from "./harmony126.mjs";
5
+ const UpgradeIcon = ({ className = "" }) => {
6
+ return /* @__PURE__ */ jsx(
7
+ "div",
8
+ {
9
+ "aria-label": "Upgrade Icon",
10
+ className: clsx(
11
+ styles.iconContainer,
12
+ "flex-row",
13
+ "items-center",
14
+ "justify-center",
15
+ className
16
+ ),
17
+ children: /* @__PURE__ */ jsx(CaretUpIcon, {})
12
18
  }
13
- const navigationVisibility = getProjectNavigationVisibilityMap(
14
- project,
15
- adminRights,
16
- () => true
17
- );
18
- const appsNavigationItem = {
19
- key: "apps",
20
- label: "Apps",
21
- isActive: (input) => input === "apps",
22
- link: `${expertUrl}/apps/${project.project_id}/`,
23
- ...navigationVisibility.apps
24
- };
25
- const appsNavigationItemArrInMainMenu = [];
26
- const appsNavigationItemArrInMoreMenu = [];
27
- if (project.project_type === "content_integration") {
28
- appsNavigationItemArrInMoreMenu.push(appsNavigationItem);
29
- } else {
30
- appsNavigationItemArrInMainMenu.push(appsNavigationItem);
31
- }
32
- return [
33
- {
34
- key: "edit",
35
- label: "Editor",
36
- link: `${expertUrl}/project/${project.project_id}/`,
37
- isActive: (input) => input === "edit",
38
- ...navigationVisibility.editor
39
- },
40
- {
41
- key: "files",
42
- label: "Files",
43
- link: `${expertUrl}/files/${project.project_id}/`,
44
- isActive: (input) => input === "files",
45
- ...navigationVisibility.files
46
- },
47
- ...project.project_type === "content_integration" ? [
48
- {
49
- key: "contentManagement",
50
- label: "Content management",
51
- isActive: (input) => input === "apps",
52
- link: `${expertUrl}/apps/${project.project_id}/${marketingSupportProjectSelectedAppSlug}`,
53
- ...navigationVisibility.contentManagement
54
- }
55
- ] : [
56
- {
57
- key: "upload",
58
- label: "Upload",
59
- link: `${expertUrl}/upload/${project.project_id}/`,
60
- isActive: (input) => input === "upload",
61
- ...navigationVisibility.upload
62
- },
63
- {
64
- key: "download",
65
- label: "Download",
66
- link: `${expertUrl}/download/${project.project_id}/`,
67
- isActive: (input) => input === "download",
68
- ...navigationVisibility.download
69
- }
70
- ],
71
- {
72
- key: "tasks",
73
- label: "Tasks",
74
- link: `${expertUrl}/tasks/${project.project_id}/`,
75
- isActive: (input) => input === "tasks",
76
- // TODO: Add task count
77
- // badge: taskCount,
78
- ...navigationVisibility.tasks
79
- },
80
- {
81
- key: "workflows",
82
- label: "Workflows",
83
- link: `${expertUrl}/workflows/${project.project_id}/`,
84
- isActive: (input) => input === "workflows",
85
- novel: "New",
86
- onClick: () => {
87
- window.location.assign(`${expertUrl}/workflows/${project.project_id}/`);
88
- },
89
- ...navigationVisibility.workflows
90
- },
91
- {
92
- key: "contributors",
93
- label: "Contributors",
94
- link: `${expertUrl}/contributors/${project.project_id}/`,
95
- isActive: (input) => input === "contributors",
96
- ...navigationVisibility.contributors
97
- },
98
- {
99
- key: "screenshots",
100
- label: "Screenshots",
101
- link: `${expertUrl}/screenshots/${project.project_id}/`,
102
- isActive: (input) => input === "screenshots",
103
- ...navigationVisibility.screenshots
104
- },
105
- {
106
- key: "glossary",
107
- label: "Glossary",
108
- link: `${expertUrl}/glossary/${project.project_id}/`,
109
- isActive: (input) => input === "glossary",
110
- ...navigationVisibility.glossary
111
- },
112
- ...appsNavigationItemArrInMainMenu,
113
- {
114
- key: "more",
115
- label: "More...",
116
- isActive: (input) => ["settings", "statistics", "duplicates", "live edit"].includes(input),
117
- ...navigationVisibility.more,
118
- dropdown: [
119
- [
120
- {
121
- link: `${expertUrl}/settings/${project.project_id}/`,
122
- label: "Settings",
123
- ...navigationVisibility.settings
124
- },
125
- {
126
- link: `${expertUrl}/settings/${project.project_id}/#branches`,
127
- label: "Branches",
128
- ...navigationVisibility.branches
129
- },
130
- {
131
- link: `${expertUrl}/settings/${project.project_id}/#ota-bundles`,
132
- label: "OTA Bundles",
133
- ...navigationVisibility.otaBundles
134
- },
135
- {
136
- link: `${expertUrl}/settings/${project.project_id}/#project-automations`,
137
- label: "Automations",
138
- ...navigationVisibility.automations
139
- },
140
- {
141
- link: `${expertUrl}/dupes/${project.project_id}/`,
142
- label: "Duplicate finder",
143
- ...navigationVisibility.duplicateFinder
144
- }
145
- ],
146
- [
147
- ...appsNavigationItemArrInMoreMenu,
148
- {
149
- // TODO: This could be problematic tab, because it is not a link and we can't just redirect. We need to find a workaround for that.
150
- label: "Activity",
151
- onClick: () => {
152
- },
153
- ...navigationVisibility.activity
154
- },
155
- {
156
- link: `${expertUrl}/statistics/${project.project_id}/`,
157
- label: "Statistics",
158
- ...navigationVisibility.statistics
159
- }
160
- ]
161
- ]
162
- }
163
- ];
164
- }, [project, adminRights, enabled, expertUrl]);
19
+ );
165
20
  };
166
21
  export {
167
- useExpertNavigation
22
+ UpgradeIcon
168
23
  };
169
24
  //# sourceMappingURL=harmony111.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony111.mjs","sources":["../src/features/navigation/hooks/useExpertNavigation.ts"],"sourcesContent":["import type { Contributor, Project } from '@features/node'\nimport { useMemo } from 'react'\nimport { useNavigationClient } from '../providers/NavigationClientProvider'\nimport type { NavigationTabsItem } from '../types/navigation'\nimport { getProjectNavigationVisibilityMap } from '../utils/toolbarVisibility'\n\n// TODO: Validate features types\nexport const getIsFeatureEnabled = (features: Record<string, boolean>, name: string) => {\n\tconst featureState = features[name]\n\n\treturn (\n\t\tfeatureState !== null &&\n\t\tfeatureState !== undefined &&\n\t\t[true, 'on', 'true'].includes(featureState)\n\t)\n}\n\n/**\n * Hook to generate legacy navigation items using the existing structure\n * but with context API instead of Redux\n */\nexport const useExpertNavigation = (\n\tenabled: boolean,\n\tproject?: Project,\n\tcontributor?: Contributor,\n) => {\n\t// Use contributor data if provided, otherwise use defaults\n\tconst adminRights = contributor?.admin_rights || []\n\t// TODO: Implement selected app slug, small investigation is needed\n\tconst marketingSupportProjectSelectedAppSlug = 'selected-app-slug'\n\tconst navigationClient = useNavigationClient()\n\tconst expertUrl = navigationClient.getExpertUrl()\n\n\treturn useMemo(() => {\n\t\t// Get data from contexts instead of Redux, or use provided data\n\t\tif (!project || !enabled) {\n\t\t\treturn []\n\t\t}\n\t\t/* TODO: We're missing badges API. We need to get it from the backend or find alternative way to get task count\n\t\t * Fetch tasks and calculate count is not a good idea, because it can have pagination, therefore we can\n\t\t * ask for an additional prop in tasks response: task_count based on branch_id + project_id + task_status\n\t\t */\n\t\t// const taskCount = getTaskCount(project, branch, badges.tasks)\n\n\t\t// TODO: Implement feature flags functionality, most likely separate package\n\t\t// const isFeatureEnabled = (feature: string) => getIsFeatureEnabled(features, feature)\n\n\t\tconst navigationVisibility = getProjectNavigationVisibilityMap(\n\t\t\tproject,\n\t\t\tadminRights,\n\t\t\t() => true /*isFeatureEnabled*/,\n\t\t)\n\n\t\tconst appsNavigationItem: NavigationTabsItem = {\n\t\t\tkey: 'apps',\n\t\t\tlabel: 'Apps',\n\t\t\tisActive: (input: string) => input === 'apps',\n\t\t\tlink: `${expertUrl}/apps/${project.project_id}/`,\n\t\t\t...navigationVisibility.apps,\n\t\t}\n\n\t\tconst appsNavigationItemArrInMainMenu: NavigationTabsItem[] = []\n\t\tconst appsNavigationItemArrInMoreMenu: NavigationTabsItem[] = []\n\n\t\tif (project.project_type === 'content_integration') {\n\t\t\tappsNavigationItemArrInMoreMenu.push(appsNavigationItem)\n\t\t} else {\n\t\t\tappsNavigationItemArrInMainMenu.push(appsNavigationItem)\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tkey: 'edit',\n\t\t\t\tlabel: 'Editor',\n\t\t\t\tlink: `${expertUrl}/project/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'edit',\n\t\t\t\t...navigationVisibility.editor,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'files',\n\t\t\t\tlabel: 'Files',\n\t\t\t\tlink: `${expertUrl}/files/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'files',\n\t\t\t\t...navigationVisibility.files,\n\t\t\t},\n\t\t\t...(project.project_type === 'content_integration'\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'contentManagement',\n\t\t\t\t\t\t\tlabel: 'Content management',\n\t\t\t\t\t\t\tisActive: (input: string) => input === 'apps',\n\t\t\t\t\t\t\tlink: `${expertUrl}/apps/${project.project_id}/${marketingSupportProjectSelectedAppSlug}`,\n\t\t\t\t\t\t\t...navigationVisibility.contentManagement,\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'upload',\n\t\t\t\t\t\t\tlabel: 'Upload',\n\t\t\t\t\t\t\tlink: `${expertUrl}/upload/${project.project_id}/`,\n\t\t\t\t\t\t\tisActive: (input: string) => input === 'upload',\n\t\t\t\t\t\t\t...navigationVisibility.upload,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'download',\n\t\t\t\t\t\t\tlabel: 'Download',\n\t\t\t\t\t\t\tlink: `${expertUrl}/download/${project.project_id}/`,\n\t\t\t\t\t\t\tisActive: (input: string) => input === 'download',\n\t\t\t\t\t\t\t...navigationVisibility.download,\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t{\n\t\t\t\tkey: 'tasks',\n\t\t\t\tlabel: 'Tasks',\n\t\t\t\tlink: `${expertUrl}/tasks/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'tasks',\n\t\t\t\t// TODO: Add task count\n\t\t\t\t// badge: taskCount,\n\t\t\t\t...navigationVisibility.tasks,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'workflows',\n\t\t\t\tlabel: 'Workflows',\n\t\t\t\tlink: `${expertUrl}/workflows/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'workflows',\n\t\t\t\tnovel: 'New',\n\t\t\t\tonClick: () => {\n\t\t\t\t\t// TODO: Resolve analytics globally, most likely separate package\n\t\t\t\t\t// track(AnalyticsEventName.EDITOR_WORKFLOWS_TAB_CLICKED);\n\t\t\t\t\twindow.location.assign(`${expertUrl}/workflows/${project.project_id}/`)\n\t\t\t\t},\n\t\t\t\t...navigationVisibility.workflows,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'contributors',\n\t\t\t\tlabel: 'Contributors',\n\t\t\t\tlink: `${expertUrl}/contributors/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'contributors',\n\t\t\t\t...navigationVisibility.contributors,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'screenshots',\n\t\t\t\tlabel: 'Screenshots',\n\t\t\t\tlink: `${expertUrl}/screenshots/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'screenshots',\n\t\t\t\t...navigationVisibility.screenshots,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'glossary',\n\t\t\t\tlabel: 'Glossary',\n\t\t\t\tlink: `${expertUrl}/glossary/${project.project_id}/`,\n\t\t\t\tisActive: (input: string) => input === 'glossary',\n\t\t\t\t...navigationVisibility.glossary,\n\t\t\t},\n\t\t\t...appsNavigationItemArrInMainMenu,\n\t\t\t{\n\t\t\t\tkey: 'more',\n\t\t\t\tlabel: 'More...',\n\t\t\t\tisActive: (input: string) =>\n\t\t\t\t\t['settings', 'statistics', 'duplicates', 'live edit'].includes(input),\n\t\t\t\t...navigationVisibility.more,\n\t\t\t\tdropdown: [\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/`,\n\t\t\t\t\t\t\tlabel: 'Settings',\n\t\t\t\t\t\t\t...navigationVisibility.settings,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/#branches`,\n\t\t\t\t\t\t\tlabel: 'Branches',\n\t\t\t\t\t\t\t...navigationVisibility.branches,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/#ota-bundles`,\n\t\t\t\t\t\t\tlabel: 'OTA Bundles',\n\t\t\t\t\t\t\t...navigationVisibility.otaBundles,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/settings/${project.project_id}/#project-automations`,\n\t\t\t\t\t\t\tlabel: 'Automations',\n\t\t\t\t\t\t\t...navigationVisibility.automations,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/dupes/${project.project_id}/`,\n\t\t\t\t\t\t\tlabel: 'Duplicate finder',\n\t\t\t\t\t\t\t...navigationVisibility.duplicateFinder,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t...appsNavigationItemArrInMoreMenu,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: This could be problematic tab, because it is not a link and we can't just redirect. We need to find a workaround for that.\n\t\t\t\t\t\t\tlabel: 'Activity',\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t// const showActivityEvent = new CustomEvent(\"show-activity\", {\n\t\t\t\t\t\t\t\t// \tdetail: {\n\t\t\t\t\t\t\t\t// \t\tprojectId: project.id,\n\t\t\t\t\t\t\t\t// \t\tbranchId: branch.branchId,\n\t\t\t\t\t\t\t\t// \t\tbranchName: branch.branchName,\n\t\t\t\t\t\t\t\t// \t},\n\t\t\t\t\t\t\t\t// });\n\t\t\t\t\t\t\t\t// document.dispatchEvent(showActivityEvent);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t...navigationVisibility.activity,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlink: `${expertUrl}/statistics/${project.project_id}/`,\n\t\t\t\t\t\t\tlabel: 'Statistics',\n\t\t\t\t\t\t\t...navigationVisibility.statistics,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t},\n\t\t]\n\t}, [project, adminRights, enabled, expertUrl])\n}\n\n// TODO: Helper function for getting task count from badge data\n// const _getTaskCount = (project: any, branch: any, taskBadges: any) => {\n// \tif (!taskBadges) return 0\n\n// \t// Implementation would depend on your getTaskCountFromTasks utility\n// \t// Simplified version:\n// \tconst projectTasks = taskBadges[project.id] || {}\n// \treturn projectTasks[branch.branchId || 'master'] || 0\n// }\n"],"names":[],"mappings":";;;AAqBO,MAAM,sBAAsB,CAClC,SACA,SACA,gBACI;AAEE,QAAA,eAAc,2CAAa,iBAAgB,CAAC;AAElD,QAAM,yCAAyC;AAC/C,QAAM,mBAAmB,oBAAoB;AACvC,QAAA,YAAY,iBAAiB,aAAa;AAEhD,SAAO,QAAQ,MAAM;AAEhB,QAAA,CAAC,WAAW,CAAC,SAAS;AACzB,aAAO,CAAC;AAAA,IAAA;AAWT,UAAM,uBAAuB;AAAA,MAC5B;AAAA,MACA;AAAA,MACA,MAAM;AAAA,IACP;AAEA,UAAM,qBAAyC;AAAA,MAC9C,KAAK;AAAA,MACL,OAAO;AAAA,MACP,UAAU,CAAC,UAAkB,UAAU;AAAA,MACvC,MAAM,GAAG,SAAS,SAAS,QAAQ,UAAU;AAAA,MAC7C,GAAG,qBAAqB;AAAA,IACzB;AAEA,UAAM,kCAAwD,CAAC;AAC/D,UAAM,kCAAwD,CAAC;AAE3D,QAAA,QAAQ,iBAAiB,uBAAuB;AACnD,sCAAgC,KAAK,kBAAkB;AAAA,IAAA,OACjD;AACN,sCAAgC,KAAK,kBAAkB;AAAA,IAAA;AAGjD,WAAA;AAAA,MACN;AAAA,QACC,KAAK;AAAA,QACL,OAAO;AAAA,QACP,MAAM,GAAG,SAAS,YAAY,QAAQ,UAAU;AAAA,QAChD,UAAU,CAAC,UAAkB,UAAU;AAAA,QACvC,GAAG,qBAAqB;AAAA,MACzB;AAAA,MACA;AAAA,QACC,KAAK;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AAAA,YAAA;AAAA,UAE1B;AAAA,UACA;AAAA,YACC,GAAG;AAAA,YACH;AAAA;AAAA,cAEC,OAAO;AAAA,cACP,SAAS,MAAM;AAAA,cASf;AAAA,cACA,GAAG,qBAAqB;AAAA,YACzB;AAAA,YACA;AAAA,cACC,MAAM,GAAG,SAAS,eAAe,QAAQ,UAAU;AAAA,cACnD,OAAO;AAAA,cACP,GAAG,qBAAqB;AAAA,YAAA;AAAA,UACzB;AAAA,QACD;AAAA,MACD;AAAA,IAEF;AAAA,KACE,CAAC,SAAS,aAAa,SAAS,SAAS,CAAC;AAC9C;"}
1
+ {"version":3,"file":"harmony111.mjs","sources":["../src/components/Sidebar/UpgradeIcon/UpgradeIcon.tsx"],"sourcesContent":["import { CaretUpIcon } from '@lokalise/louis'\nimport clsx from 'clsx'\nimport styles from './UpgradeIcon.module.css'\n\ntype UpgradeIconProps = {\n\tclassName?: string\n}\n\nexport const UpgradeIcon = ({ className = '' }: UpgradeIconProps) => {\n\treturn (\n\t\t<div\n\t\t\taria-label={'Upgrade Icon'}\n\t\t\tclassName={clsx(\n\t\t\t\tstyles.iconContainer,\n\t\t\t\t'flex-row',\n\t\t\t\t'items-center',\n\t\t\t\t'justify-center',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<CaretUpIcon />\n\t\t</div>\n\t)\n}\n"],"names":[],"mappings":";;;;AAQO,MAAM,cAAc,CAAC,EAAE,YAAY,SAA2B;AAEnE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,cAAY;AAAA,MACZ,WAAW;AAAA,QACV,OAAO;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MAEA,8BAAC,aAAY,CAAA,CAAA;AAAA,IAAA;AAAA,EACd;AAEF;"}
@@ -1,47 +1,15 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const React = require("react");
4
- const NavigationClientProvider = require("./harmony94.cjs");
5
- const navigationSchema = require("./harmony128.cjs");
6
- const useNextgenNavigation = (activeKey, enabled, project, contributor) => {
7
- const navigationClient = NavigationClientProvider.useNavigationClient();
8
- const nextgenUrl = navigationClient.getNextgenUrl();
9
- const navigate = React.useCallback(
10
- (path) => {
11
- window.location.href = `${nextgenUrl}${path}`;
12
- },
13
- [nextgenUrl]
14
- );
15
- return React.useMemo(() => {
16
- if (!enabled) {
17
- return [];
18
- }
19
- const projectId = (project == null ? void 0 : project.project_id) || "";
20
- const context = {
21
- flags: {},
22
- // TODO: getFeatureFlags(features),
23
- pathname: window.location.pathname,
24
- permissions: []
25
- };
26
- return navigationSchema.navigationItems.filter((item) => item.shouldShow ? item.shouldShow(context) : true).map((item) => {
27
- const disabled = typeof item.disabled === "function" ? item.disabled(context) : !!item.disabled;
28
- const badge = typeof item.badge === "function" ? item.badge(context) : item.badge;
29
- const isActive = (input) => item.isActive ? item.isActive(input) : item.key === activeKey || input === item.key;
30
- return {
31
- key: item.key,
32
- label: item.labelKey,
33
- // You can apply translations here if needed
34
- icon: item.icon,
35
- visible: true,
36
- badge,
37
- disabled,
38
- dropdown: item.dropdown,
39
- isActive,
40
- link: `${nextgenUrl}${item.path({ projectId })}`,
41
- onClick: () => navigate(item.path({ projectId }))
42
- };
43
- });
44
- }, [project, activeKey, enabled, navigate, contributor, nextgenUrl]);
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const container = "_container_1u995_1";
4
+ const planCta = "_planCta_1u995_15";
5
+ const upgradeIconWrapper = "_upgradeIconWrapper_1u995_19";
6
+ const styles = {
7
+ container,
8
+ planCta,
9
+ upgradeIconWrapper
45
10
  };
46
- exports.useNextgenNavigation = useNextgenNavigation;
11
+ exports.container = container;
12
+ exports.default = styles;
13
+ exports.planCta = planCta;
14
+ exports.upgradeIconWrapper = upgradeIconWrapper;
47
15
  //# sourceMappingURL=harmony112.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony112.cjs","sources":["../src/features/navigation/hooks/useNextgenNavigation.ts"],"sourcesContent":["import type { Contributor, Project } from '@features/node'\nimport { useCallback, useMemo } from 'react'\nimport { useNavigationClient } from '../providers/NavigationClientProvider'\n// TODO: react-router-dom as peer dependencies works only inside next-gen apps. It shouldn't be like that.\n// Because of that we can't use THE WHOLE package in legacy apps, therefore it should be implemented in legacy apps as well(almost impossible),\n// so this dependency should be installed as direct dependency. or we should think about other options\n// import { useNavigate } from \"react-router-dom\";\nimport { navigationItems } from '../schemas/navigationSchema'\n\n// TODO: Unify navigation items for next-gen and legacy apps\n/**\n * Hook to generate navigation items for new applications\n */\nexport const useNextgenNavigation = (\n\tactiveKey: string,\n\tenabled: boolean,\n\tproject?: Project,\n\tcontributor?: Contributor,\n) => {\n\tconst navigationClient = useNavigationClient()\n\tconst nextgenUrl = navigationClient.getNextgenUrl()\n\n\tconst navigate = useCallback(\n\t\t(path: string) => {\n\t\t\t// TODO: Define navigate logic here\n\t\t\twindow.location.href = `${nextgenUrl}${path}`\n\t\t},\n\t\t[nextgenUrl],\n\t)\n\n\treturn useMemo(() => {\n\t\tif (!enabled) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst projectId = project?.project_id || ''\n\n\t\t// Context for filtering and transforming navigation items\n\t\tconst context = {\n\t\t\tflags: {}, // TODO: getFeatureFlags(features),\n\t\t\tpathname: window.location.pathname,\n\t\t\tpermissions: contributor?.admin_rights || [],\n\t\t}\n\n\t\t// Filter and map items\n\t\treturn (\n\t\t\tnavigationItems\n\t\t\t\t// Filter based on conditions\n\t\t\t\t.filter((item) => (item.shouldShow ? item.shouldShow(context) : true))\n\t\t\t\t// Map to NavigationTabsItem shape\n\t\t\t\t.map((item) => {\n\t\t\t\t\tconst disabled =\n\t\t\t\t\t\ttypeof item.disabled === 'function' ? item.disabled(context) : !!item.disabled\n\n\t\t\t\t\tconst badge = typeof item.badge === 'function' ? item.badge(context) : item.badge\n\n\t\t\t\t\t// Create isActive function\n\t\t\t\t\tconst isActive = (input: string) =>\n\t\t\t\t\t\titem.isActive ? item.isActive(input) : item.key === activeKey || input === item.key\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: item.key,\n\t\t\t\t\t\tlabel: item.labelKey, // You can apply translations here if needed\n\t\t\t\t\t\ticon: item.icon,\n\t\t\t\t\t\tvisible: true,\n\t\t\t\t\t\tbadge,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\tdropdown: item.dropdown,\n\t\t\t\t\t\tisActive,\n\t\t\t\t\t\tlink: `${nextgenUrl}${item.path({ projectId })}`,\n\t\t\t\t\t\tonClick: () => navigate(item.path({ projectId })),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t)\n\t}, [project, activeKey, enabled, navigate, contributor, nextgenUrl])\n}\n\n// TODO: Helper to convert features to flags format\n// const getFeatureFlags = (features) => {\n// \tif (!features) return {}\n//\n// \t// Convert features to the format expected by navigation schema\n// \treturn Object.keys(features).reduce((flags, key) => {\n// \t\tflags[key] = features[key] ? 'on' : 'off'\n// \t\treturn flags\n// \t}, {})\n// }\n"],"names":["useNavigationClient","useCallback","useMemo","navigationItems"],"mappings":";;;;;AAaO,MAAM,uBAAuB,CACnC,WACA,SACA,SACA,gBACI;AACJ,QAAM,mBAAmBA,yBAAAA,oBAAoB;AACvC,QAAA,aAAa,iBAAiB,cAAc;AAElD,QAAM,WAAWC,MAAA;AAAA,IAChB,CAAC,SAAiB;AAEjB,aAAO,SAAS,OAAO,GAAG,UAAU,GAAG,IAAI;AAAA,IAC5C;AAAA,IACA,CAAC,UAAU;AAAA,EACZ;AAEA,SAAOC,cAAQ,MAAM;AACpB,QAAI,CAAC,SAAS;AACb,aAAO,CAAC;AAAA,IAAA;AAGH,UAAA,aAAY,mCAAS,eAAc;AAGzC,UAAM,UAAU;AAAA,MACf,OAAO,CAAC;AAAA;AAAA,MACR,UAAU,OAAO,SAAS;AAAA,MAC1B,aAA0C,CAAA;AAAA,IAC3C;AAGA,WACCC,iBAEE,gBAAA,OAAO,CAAC,SAAU,KAAK,aAAa,KAAK,WAAW,OAAO,IAAI,IAAK,EAEpE,IAAI,CAAC,SAAS;AACR,YAAA,WACL,OAAO,KAAK,aAAa,aAAa,KAAK,SAAS,OAAO,IAAI,CAAC,CAAC,KAAK;AAEjE,YAAA,QAAQ,OAAO,KAAK,UAAU,aAAa,KAAK,MAAM,OAAO,IAAI,KAAK;AAG5E,YAAM,WAAW,CAAC,UACjB,KAAK,WAAW,KAAK,SAAS,KAAK,IAAI,KAAK,QAAQ,aAAa,UAAU,KAAK;AAE1E,aAAA;AAAA,QACN,KAAK,KAAK;AAAA,QACV,OAAO,KAAK;AAAA;AAAA,QACZ,MAAM,KAAK;AAAA,QACX,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,QACf;AAAA,QACA,MAAM,GAAG,UAAU,GAAG,KAAK,KAAK,EAAE,UAAW,CAAA,CAAC;AAAA,QAC9C,SAAS,MAAM,SAAS,KAAK,KAAK,EAAE,UAAA,CAAW,CAAC;AAAA,MACjD;AAAA,IAAA,CACA;AAAA,EAAA,GAED,CAAC,SAAS,WAAW,SAAS,UAAU,aAAa,UAAU,CAAC;AACpE;;"}
1
+ {"version":3,"file":"harmony112.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -1,47 +1,15 @@
1
- import { useCallback, useMemo } from "react";
2
- import { useNavigationClient } from "./harmony94.mjs";
3
- import { navigationItems } from "./harmony128.mjs";
4
- const useNextgenNavigation = (activeKey, enabled, project, contributor) => {
5
- const navigationClient = useNavigationClient();
6
- const nextgenUrl = navigationClient.getNextgenUrl();
7
- const navigate = useCallback(
8
- (path) => {
9
- window.location.href = `${nextgenUrl}${path}`;
10
- },
11
- [nextgenUrl]
12
- );
13
- return useMemo(() => {
14
- if (!enabled) {
15
- return [];
16
- }
17
- const projectId = (project == null ? void 0 : project.project_id) || "";
18
- const context = {
19
- flags: {},
20
- // TODO: getFeatureFlags(features),
21
- pathname: window.location.pathname,
22
- permissions: []
23
- };
24
- return navigationItems.filter((item) => item.shouldShow ? item.shouldShow(context) : true).map((item) => {
25
- const disabled = typeof item.disabled === "function" ? item.disabled(context) : !!item.disabled;
26
- const badge = typeof item.badge === "function" ? item.badge(context) : item.badge;
27
- const isActive = (input) => item.isActive ? item.isActive(input) : item.key === activeKey || input === item.key;
28
- return {
29
- key: item.key,
30
- label: item.labelKey,
31
- // You can apply translations here if needed
32
- icon: item.icon,
33
- visible: true,
34
- badge,
35
- disabled,
36
- dropdown: item.dropdown,
37
- isActive,
38
- link: `${nextgenUrl}${item.path({ projectId })}`,
39
- onClick: () => navigate(item.path({ projectId }))
40
- };
41
- });
42
- }, [project, activeKey, enabled, navigate, contributor, nextgenUrl]);
1
+ const container = "_container_1u995_1";
2
+ const planCta = "_planCta_1u995_15";
3
+ const upgradeIconWrapper = "_upgradeIconWrapper_1u995_19";
4
+ const styles = {
5
+ container,
6
+ planCta,
7
+ upgradeIconWrapper
43
8
  };
44
9
  export {
45
- useNextgenNavigation
10
+ container,
11
+ styles as default,
12
+ planCta,
13
+ upgradeIconWrapper
46
14
  };
47
15
  //# sourceMappingURL=harmony112.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony112.mjs","sources":["../src/features/navigation/hooks/useNextgenNavigation.ts"],"sourcesContent":["import type { Contributor, Project } from '@features/node'\nimport { useCallback, useMemo } from 'react'\nimport { useNavigationClient } from '../providers/NavigationClientProvider'\n// TODO: react-router-dom as peer dependencies works only inside next-gen apps. It shouldn't be like that.\n// Because of that we can't use THE WHOLE package in legacy apps, therefore it should be implemented in legacy apps as well(almost impossible),\n// so this dependency should be installed as direct dependency. or we should think about other options\n// import { useNavigate } from \"react-router-dom\";\nimport { navigationItems } from '../schemas/navigationSchema'\n\n// TODO: Unify navigation items for next-gen and legacy apps\n/**\n * Hook to generate navigation items for new applications\n */\nexport const useNextgenNavigation = (\n\tactiveKey: string,\n\tenabled: boolean,\n\tproject?: Project,\n\tcontributor?: Contributor,\n) => {\n\tconst navigationClient = useNavigationClient()\n\tconst nextgenUrl = navigationClient.getNextgenUrl()\n\n\tconst navigate = useCallback(\n\t\t(path: string) => {\n\t\t\t// TODO: Define navigate logic here\n\t\t\twindow.location.href = `${nextgenUrl}${path}`\n\t\t},\n\t\t[nextgenUrl],\n\t)\n\n\treturn useMemo(() => {\n\t\tif (!enabled) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst projectId = project?.project_id || ''\n\n\t\t// Context for filtering and transforming navigation items\n\t\tconst context = {\n\t\t\tflags: {}, // TODO: getFeatureFlags(features),\n\t\t\tpathname: window.location.pathname,\n\t\t\tpermissions: contributor?.admin_rights || [],\n\t\t}\n\n\t\t// Filter and map items\n\t\treturn (\n\t\t\tnavigationItems\n\t\t\t\t// Filter based on conditions\n\t\t\t\t.filter((item) => (item.shouldShow ? item.shouldShow(context) : true))\n\t\t\t\t// Map to NavigationTabsItem shape\n\t\t\t\t.map((item) => {\n\t\t\t\t\tconst disabled =\n\t\t\t\t\t\ttypeof item.disabled === 'function' ? item.disabled(context) : !!item.disabled\n\n\t\t\t\t\tconst badge = typeof item.badge === 'function' ? item.badge(context) : item.badge\n\n\t\t\t\t\t// Create isActive function\n\t\t\t\t\tconst isActive = (input: string) =>\n\t\t\t\t\t\titem.isActive ? item.isActive(input) : item.key === activeKey || input === item.key\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: item.key,\n\t\t\t\t\t\tlabel: item.labelKey, // You can apply translations here if needed\n\t\t\t\t\t\ticon: item.icon,\n\t\t\t\t\t\tvisible: true,\n\t\t\t\t\t\tbadge,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\tdropdown: item.dropdown,\n\t\t\t\t\t\tisActive,\n\t\t\t\t\t\tlink: `${nextgenUrl}${item.path({ projectId })}`,\n\t\t\t\t\t\tonClick: () => navigate(item.path({ projectId })),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t)\n\t}, [project, activeKey, enabled, navigate, contributor, nextgenUrl])\n}\n\n// TODO: Helper to convert features to flags format\n// const getFeatureFlags = (features) => {\n// \tif (!features) return {}\n//\n// \t// Convert features to the format expected by navigation schema\n// \treturn Object.keys(features).reduce((flags, key) => {\n// \t\tflags[key] = features[key] ? 'on' : 'off'\n// \t\treturn flags\n// \t}, {})\n// }\n"],"names":[],"mappings":";;;AAaO,MAAM,uBAAuB,CACnC,WACA,SACA,SACA,gBACI;AACJ,QAAM,mBAAmB,oBAAoB;AACvC,QAAA,aAAa,iBAAiB,cAAc;AAElD,QAAM,WAAW;AAAA,IAChB,CAAC,SAAiB;AAEjB,aAAO,SAAS,OAAO,GAAG,UAAU,GAAG,IAAI;AAAA,IAC5C;AAAA,IACA,CAAC,UAAU;AAAA,EACZ;AAEA,SAAO,QAAQ,MAAM;AACpB,QAAI,CAAC,SAAS;AACb,aAAO,CAAC;AAAA,IAAA;AAGH,UAAA,aAAY,mCAAS,eAAc;AAGzC,UAAM,UAAU;AAAA,MACf,OAAO,CAAC;AAAA;AAAA,MACR,UAAU,OAAO,SAAS;AAAA,MAC1B,aAA0C,CAAA;AAAA,IAC3C;AAGA,WACC,gBAEE,OAAO,CAAC,SAAU,KAAK,aAAa,KAAK,WAAW,OAAO,IAAI,IAAK,EAEpE,IAAI,CAAC,SAAS;AACR,YAAA,WACL,OAAO,KAAK,aAAa,aAAa,KAAK,SAAS,OAAO,IAAI,CAAC,CAAC,KAAK;AAEjE,YAAA,QAAQ,OAAO,KAAK,UAAU,aAAa,KAAK,MAAM,OAAO,IAAI,KAAK;AAG5E,YAAM,WAAW,CAAC,UACjB,KAAK,WAAW,KAAK,SAAS,KAAK,IAAI,KAAK,QAAQ,aAAa,UAAU,KAAK;AAE1E,aAAA;AAAA,QACN,KAAK,KAAK;AAAA,QACV,OAAO,KAAK;AAAA;AAAA,QACZ,MAAM,KAAK;AAAA,QACX,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,QACf;AAAA,QACA,MAAM,GAAG,UAAU,GAAG,KAAK,KAAK,EAAE,UAAW,CAAA,CAAC;AAAA,QAC9C,SAAS,MAAM,SAAS,KAAK,KAAK,EAAE,UAAA,CAAW,CAAC;AAAA,MACjD;AAAA,IAAA,CACA;AAAA,EAAA,GAED,CAAC,SAAS,WAAW,SAAS,UAAU,aAAa,UAAU,CAAC;AACpE;"}
1
+ {"version":3,"file":"harmony112.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,102 +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 React = require("react");
4
- const debounce = require("./harmony125.cjs");
5
- const throttle = require("./harmony126.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;
6
+ const jwtTokenPayload = require("./harmony17.cjs");
7
+ const _NewJwtIssuedEvent = class _NewJwtIssuedEvent extends CustomEvent {
8
+ constructor(token) {
9
+ super(_NewJwtIssuedEvent.eventName, {
10
+ detail: { token, payload: jwtTokenPayload.parseJwtTokenPayload(token.accessToken) }
39
11
  });
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
12
  }
93
- return {
94
- width: entry.contentRect.width,
95
- height: entry.contentRect.height
96
- };
97
13
  };
98
- exports.getDimensions = getDimensions;
99
- exports.patchResizeCallback = patchResizeCallback;
100
- exports.useCallbackRef = useCallbackRef;
101
- exports.useRefProxy = useRefProxy;
14
+ __publicField(_NewJwtIssuedEvent, "eventName", "new-jwt-issued");
15
+ let NewJwtIssuedEvent = _NewJwtIssuedEvent;
16
+ exports.NewJwtIssuedEvent = NewJwtIssuedEvent;
102
17
  //# sourceMappingURL=harmony113.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony113.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,W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AAA,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]}
1
+ {"version":3,"file":"harmony113.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;;"}
@@ -1,85 +1,17 @@
1
- import * as React from "react";
2
- import debounce from "./harmony125.mjs";
3
- import throttle from "./harmony126.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;
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 "./harmony17.mjs";
5
+ const _NewJwtIssuedEvent = class _NewJwtIssuedEvent extends CustomEvent {
6
+ constructor(token) {
7
+ super(_NewJwtIssuedEvent.eventName, {
8
+ detail: { token, payload: parseJwtTokenPayload(token.accessToken) }
20
9
  });
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
10
  }
74
- return {
75
- width: entry.contentRect.width,
76
- height: entry.contentRect.height
77
- };
78
11
  };
12
+ __publicField(_NewJwtIssuedEvent, "eventName", "new-jwt-issued");
13
+ let NewJwtIssuedEvent = _NewJwtIssuedEvent;
79
14
  export {
80
- getDimensions,
81
- patchResizeCallback,
82
- useCallbackRef,
83
- useRefProxy
15
+ NewJwtIssuedEvent
84
16
  };
85
17
  //# sourceMappingURL=harmony113.mjs.map