@lokalise/harmony 2.0.4 → 2.0.6

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 (335) hide show
  1. package/dist/harmony.cjs +1 -1
  2. package/dist/harmony.mjs +3 -3
  3. package/dist/harmony102.cjs +1 -1
  4. package/dist/harmony102.mjs +1 -1
  5. package/dist/harmony103.cjs +7 -7
  6. package/dist/harmony103.mjs +7 -7
  7. package/dist/harmony105.cjs +2 -2
  8. package/dist/harmony105.mjs +2 -2
  9. package/dist/harmony106.cjs +2 -165
  10. package/dist/harmony106.cjs.map +1 -1
  11. package/dist/harmony106.mjs +3 -166
  12. package/dist/harmony106.mjs.map +1 -1
  13. package/dist/harmony107.cjs +16 -42
  14. package/dist/harmony107.cjs.map +1 -1
  15. package/dist/harmony107.mjs +16 -42
  16. package/dist/harmony107.mjs.map +1 -1
  17. package/dist/harmony108.cjs +75 -13
  18. package/dist/harmony108.cjs.map +1 -1
  19. package/dist/harmony108.mjs +75 -13
  20. package/dist/harmony108.mjs.map +1 -1
  21. package/dist/harmony109.cjs +10 -10
  22. package/dist/harmony109.cjs.map +1 -1
  23. package/dist/harmony109.mjs +10 -10
  24. package/dist/harmony109.mjs.map +1 -1
  25. package/dist/harmony110.cjs +35 -13
  26. package/dist/harmony110.cjs.map +1 -1
  27. package/dist/harmony110.mjs +34 -12
  28. package/dist/harmony110.mjs.map +1 -1
  29. package/dist/harmony111.cjs +9 -3
  30. package/dist/harmony111.cjs.map +1 -1
  31. package/dist/harmony111.mjs +9 -3
  32. package/dist/harmony111.mjs.map +1 -1
  33. package/dist/harmony112.cjs +41 -12
  34. package/dist/harmony112.cjs.map +1 -1
  35. package/dist/harmony112.mjs +43 -14
  36. package/dist/harmony112.mjs.map +1 -1
  37. package/dist/harmony113.cjs +9 -76
  38. package/dist/harmony113.cjs.map +1 -1
  39. package/dist/harmony113.mjs +8 -75
  40. package/dist/harmony113.mjs.map +1 -1
  41. package/dist/harmony114.cjs +10 -10
  42. package/dist/harmony114.cjs.map +1 -1
  43. package/dist/harmony114.mjs +10 -10
  44. package/dist/harmony114.mjs.map +1 -1
  45. package/dist/harmony115.cjs +13 -35
  46. package/dist/harmony115.cjs.map +1 -1
  47. package/dist/harmony115.mjs +12 -34
  48. package/dist/harmony115.mjs.map +1 -1
  49. package/dist/harmony116.cjs +10 -8
  50. package/dist/harmony116.cjs.map +1 -1
  51. package/dist/harmony116.mjs +11 -9
  52. package/dist/harmony116.mjs.map +1 -1
  53. package/dist/harmony117.cjs +21 -47
  54. package/dist/harmony117.cjs.map +1 -1
  55. package/dist/harmony117.mjs +20 -46
  56. package/dist/harmony117.mjs.map +1 -1
  57. package/dist/harmony118.cjs +166 -9
  58. package/dist/harmony118.cjs.map +1 -1
  59. package/dist/harmony118.mjs +165 -8
  60. package/dist/harmony118.mjs.map +1 -1
  61. package/dist/harmony119.cjs +44 -11
  62. package/dist/harmony119.cjs.map +1 -1
  63. package/dist/harmony119.mjs +44 -11
  64. package/dist/harmony119.mjs.map +1 -1
  65. package/dist/harmony120.cjs +14 -21
  66. package/dist/harmony120.cjs.map +1 -1
  67. package/dist/harmony120.mjs +13 -20
  68. package/dist/harmony120.mjs.map +1 -1
  69. package/dist/harmony121.cjs +98 -6
  70. package/dist/harmony121.cjs.map +1 -1
  71. package/dist/harmony121.mjs +82 -7
  72. package/dist/harmony121.mjs.map +1 -1
  73. package/dist/harmony122.cjs +6 -16
  74. package/dist/harmony122.cjs.map +1 -1
  75. package/dist/harmony122.mjs +7 -17
  76. package/dist/harmony122.mjs.map +1 -1
  77. package/dist/harmony123.cjs +16 -7
  78. package/dist/harmony123.cjs.map +1 -1
  79. package/dist/harmony123.mjs +16 -7
  80. package/dist/harmony123.mjs.map +1 -1
  81. package/dist/harmony124.cjs +3 -3
  82. package/dist/harmony124.cjs.map +1 -1
  83. package/dist/harmony124.mjs +3 -3
  84. package/dist/harmony124.mjs.map +1 -1
  85. package/dist/harmony125.cjs +7 -14
  86. package/dist/harmony125.cjs.map +1 -1
  87. package/dist/harmony125.mjs +7 -14
  88. package/dist/harmony125.mjs.map +1 -1
  89. package/dist/harmony126.cjs +15 -20
  90. package/dist/harmony126.cjs.map +1 -1
  91. package/dist/harmony126.mjs +15 -20
  92. package/dist/harmony126.mjs.map +1 -1
  93. package/dist/harmony127.cjs +20 -87
  94. package/dist/harmony127.cjs.map +1 -1
  95. package/dist/harmony127.mjs +20 -87
  96. package/dist/harmony127.mjs.map +1 -1
  97. package/dist/harmony128.cjs +10 -31
  98. package/dist/harmony128.cjs.map +1 -1
  99. package/dist/harmony128.mjs +9 -30
  100. package/dist/harmony128.mjs.map +1 -1
  101. package/dist/harmony129.cjs +11 -98
  102. package/dist/harmony129.cjs.map +1 -1
  103. package/dist/harmony129.mjs +11 -81
  104. package/dist/harmony129.mjs.map +1 -1
  105. package/dist/harmony130.cjs +15 -9
  106. package/dist/harmony130.cjs.map +1 -1
  107. package/dist/harmony130.mjs +14 -8
  108. package/dist/harmony130.mjs.map +1 -1
  109. package/dist/harmony131.cjs +13 -6
  110. package/dist/harmony131.cjs.map +1 -1
  111. package/dist/harmony131.mjs +15 -8
  112. package/dist/harmony131.mjs.map +1 -1
  113. package/dist/harmony132.cjs +7 -12
  114. package/dist/harmony132.cjs.map +1 -1
  115. package/dist/harmony132.mjs +9 -14
  116. package/dist/harmony132.mjs.map +1 -1
  117. package/dist/harmony133.cjs +20 -13
  118. package/dist/harmony133.cjs.map +1 -1
  119. package/dist/harmony133.mjs +22 -15
  120. package/dist/harmony133.mjs.map +1 -1
  121. package/dist/harmony134.cjs +9 -7
  122. package/dist/harmony134.cjs.map +1 -1
  123. package/dist/harmony134.mjs +11 -9
  124. package/dist/harmony134.mjs.map +1 -1
  125. package/dist/harmony135.cjs +30 -18
  126. package/dist/harmony135.cjs.map +1 -1
  127. package/dist/harmony135.mjs +32 -20
  128. package/dist/harmony135.mjs.map +1 -1
  129. package/dist/harmony136.cjs +6 -6
  130. package/dist/harmony136.cjs.map +1 -1
  131. package/dist/harmony136.mjs +6 -6
  132. package/dist/harmony136.mjs.map +1 -1
  133. package/dist/harmony137.cjs +13 -29
  134. package/dist/harmony137.cjs.map +1 -1
  135. package/dist/harmony137.mjs +14 -30
  136. package/dist/harmony137.mjs.map +1 -1
  137. package/dist/harmony138.cjs +31 -7
  138. package/dist/harmony138.cjs.map +1 -1
  139. package/dist/harmony138.mjs +32 -8
  140. package/dist/harmony138.mjs.map +1 -1
  141. package/dist/harmony139.cjs +21 -22
  142. package/dist/harmony139.cjs.map +1 -1
  143. package/dist/harmony139.mjs +20 -21
  144. package/dist/harmony139.mjs.map +1 -1
  145. package/dist/harmony140.cjs +15 -30
  146. package/dist/harmony140.cjs.map +1 -1
  147. package/dist/harmony140.mjs +17 -32
  148. package/dist/harmony140.mjs.map +1 -1
  149. package/dist/harmony141.cjs +3 -18
  150. package/dist/harmony141.cjs.map +1 -1
  151. package/dist/harmony141.mjs +3 -18
  152. package/dist/harmony141.mjs.map +1 -1
  153. package/dist/harmony142.cjs +15 -21
  154. package/dist/harmony142.cjs.map +1 -1
  155. package/dist/harmony142.mjs +14 -20
  156. package/dist/harmony142.mjs.map +1 -1
  157. package/dist/harmony143.cjs +87 -6
  158. package/dist/harmony143.cjs.map +1 -1
  159. package/dist/harmony143.mjs +86 -5
  160. package/dist/harmony143.mjs.map +1 -1
  161. package/dist/harmony144.cjs +31 -16
  162. package/dist/harmony144.cjs.map +1 -1
  163. package/dist/harmony144.mjs +30 -15
  164. package/dist/harmony144.mjs.map +1 -1
  165. package/dist/harmony145.cjs +6 -4
  166. package/dist/harmony145.cjs.map +1 -1
  167. package/dist/harmony145.mjs +5 -3
  168. package/dist/harmony145.mjs.map +1 -1
  169. package/dist/harmony146.cjs +6 -4
  170. package/dist/harmony146.cjs.map +1 -1
  171. package/dist/harmony146.mjs +5 -3
  172. package/dist/harmony146.mjs.map +1 -1
  173. package/dist/harmony147.cjs +3 -3
  174. package/dist/harmony147.cjs.map +1 -1
  175. package/dist/harmony147.mjs +3 -3
  176. package/dist/harmony147.mjs.map +1 -1
  177. package/dist/harmony148.cjs +3 -14
  178. package/dist/harmony148.cjs.map +1 -1
  179. package/dist/harmony148.mjs +3 -14
  180. package/dist/harmony148.mjs.map +1 -1
  181. package/dist/harmony149.cjs +3 -14
  182. package/dist/harmony149.cjs.map +1 -1
  183. package/dist/harmony149.mjs +3 -14
  184. package/dist/harmony149.mjs.map +1 -1
  185. package/dist/harmony150.cjs +14 -3
  186. package/dist/harmony150.cjs.map +1 -1
  187. package/dist/harmony150.mjs +14 -3
  188. package/dist/harmony150.mjs.map +1 -1
  189. package/dist/harmony151.cjs +15 -6
  190. package/dist/harmony151.cjs.map +1 -1
  191. package/dist/harmony151.mjs +14 -5
  192. package/dist/harmony151.mjs.map +1 -1
  193. package/dist/harmony152.cjs +4 -6
  194. package/dist/harmony152.cjs.map +1 -1
  195. package/dist/harmony152.mjs +3 -5
  196. package/dist/harmony152.mjs.map +1 -1
  197. package/dist/harmony153.cjs +96 -10
  198. package/dist/harmony153.cjs.map +1 -1
  199. package/dist/harmony153.mjs +96 -10
  200. package/dist/harmony153.mjs.map +1 -1
  201. package/dist/harmony154.cjs +14 -10
  202. package/dist/harmony154.cjs.map +1 -1
  203. package/dist/harmony154.mjs +13 -9
  204. package/dist/harmony154.mjs.map +1 -1
  205. package/dist/harmony155.cjs +15 -7
  206. package/dist/harmony155.cjs.map +1 -1
  207. package/dist/harmony155.mjs +14 -6
  208. package/dist/harmony155.mjs.map +1 -1
  209. package/dist/harmony156.cjs +37 -10
  210. package/dist/harmony156.cjs.map +1 -1
  211. package/dist/harmony156.mjs +36 -9
  212. package/dist/harmony156.mjs.map +1 -1
  213. package/dist/harmony157.cjs +29 -25
  214. package/dist/harmony157.cjs.map +1 -1
  215. package/dist/harmony157.mjs +28 -24
  216. package/dist/harmony157.mjs.map +1 -1
  217. package/dist/harmony158.cjs +6 -3
  218. package/dist/harmony158.cjs.map +1 -1
  219. package/dist/harmony158.mjs +6 -3
  220. package/dist/harmony158.mjs.map +1 -1
  221. package/dist/harmony159.cjs +3 -9
  222. package/dist/harmony159.cjs.map +1 -1
  223. package/dist/harmony159.mjs +3 -9
  224. package/dist/harmony159.mjs.map +1 -1
  225. package/dist/harmony160.cjs +6 -3
  226. package/dist/harmony160.cjs.map +1 -1
  227. package/dist/harmony160.mjs +6 -3
  228. package/dist/harmony160.mjs.map +1 -1
  229. package/dist/harmony161.cjs +24 -32
  230. package/dist/harmony161.cjs.map +1 -1
  231. package/dist/harmony161.mjs +23 -31
  232. package/dist/harmony161.mjs.map +1 -1
  233. package/dist/harmony162.cjs +7 -97
  234. package/dist/harmony162.cjs.map +1 -1
  235. package/dist/harmony162.mjs +6 -96
  236. package/dist/harmony162.mjs.map +1 -1
  237. package/dist/harmony163.cjs +13 -14
  238. package/dist/harmony163.cjs.map +1 -1
  239. package/dist/harmony163.mjs +12 -13
  240. package/dist/harmony163.mjs.map +1 -1
  241. package/dist/harmony164.cjs +7 -15
  242. package/dist/harmony164.cjs.map +1 -1
  243. package/dist/harmony164.mjs +6 -14
  244. package/dist/harmony164.mjs.map +1 -1
  245. package/dist/harmony165.cjs +10 -36
  246. package/dist/harmony165.cjs.map +1 -1
  247. package/dist/harmony165.mjs +10 -36
  248. package/dist/harmony165.mjs.map +1 -1
  249. package/dist/harmony166.cjs +31 -27
  250. package/dist/harmony166.cjs.map +1 -1
  251. package/dist/harmony166.mjs +31 -27
  252. package/dist/harmony166.mjs.map +1 -1
  253. package/dist/harmony167.cjs +1 -1
  254. package/dist/harmony167.mjs +1 -1
  255. package/dist/harmony168.cjs +1 -1
  256. package/dist/harmony168.mjs +1 -1
  257. package/dist/harmony169.cjs +2 -2
  258. package/dist/harmony169.mjs +2 -2
  259. package/dist/harmony17.cjs +1 -1
  260. package/dist/harmony17.mjs +1 -1
  261. package/dist/harmony170.cjs +11 -4
  262. package/dist/harmony170.cjs.map +1 -1
  263. package/dist/harmony170.mjs +11 -4
  264. package/dist/harmony170.mjs.map +1 -1
  265. package/dist/harmony171.cjs +15 -10
  266. package/dist/harmony171.cjs.map +1 -1
  267. package/dist/harmony171.mjs +15 -10
  268. package/dist/harmony171.mjs.map +1 -1
  269. package/dist/harmony172.cjs +18 -13
  270. package/dist/harmony172.cjs.map +1 -1
  271. package/dist/harmony172.mjs +18 -13
  272. package/dist/harmony172.mjs.map +1 -1
  273. package/dist/harmony173.cjs +10 -19
  274. package/dist/harmony173.cjs.map +1 -1
  275. package/dist/harmony173.mjs +10 -19
  276. package/dist/harmony173.mjs.map +1 -1
  277. package/dist/harmony174.cjs +4 -12
  278. package/dist/harmony174.cjs.map +1 -1
  279. package/dist/harmony174.mjs +4 -12
  280. package/dist/harmony174.mjs.map +1 -1
  281. package/dist/harmony20.cjs +1 -1
  282. package/dist/harmony20.mjs +1 -1
  283. package/dist/harmony28.cjs +1 -1
  284. package/dist/harmony28.mjs +1 -1
  285. package/dist/harmony29.cjs +1 -1
  286. package/dist/harmony29.mjs +1 -1
  287. package/dist/harmony32.cjs +1 -1
  288. package/dist/harmony32.mjs +1 -1
  289. package/dist/harmony33.cjs +1 -1
  290. package/dist/harmony33.mjs +1 -1
  291. package/dist/harmony34.cjs +1 -1
  292. package/dist/harmony34.mjs +1 -1
  293. package/dist/harmony39.cjs +1 -1
  294. package/dist/harmony39.mjs +1 -1
  295. package/dist/harmony40.cjs +1 -1
  296. package/dist/harmony40.mjs +1 -1
  297. package/dist/harmony41.cjs +1 -1
  298. package/dist/harmony41.mjs +1 -1
  299. package/dist/harmony42.cjs +2 -2
  300. package/dist/harmony42.mjs +2 -2
  301. package/dist/harmony43.cjs +2 -2
  302. package/dist/harmony43.mjs +2 -2
  303. package/dist/harmony44.cjs +1 -1
  304. package/dist/harmony44.mjs +1 -1
  305. package/dist/harmony45.cjs +2 -0
  306. package/dist/harmony45.cjs.map +1 -1
  307. package/dist/harmony45.mjs +2 -0
  308. package/dist/harmony45.mjs.map +1 -1
  309. package/dist/harmony81.cjs +5 -20
  310. package/dist/harmony81.cjs.map +1 -1
  311. package/dist/harmony81.mjs +5 -20
  312. package/dist/harmony81.mjs.map +1 -1
  313. package/dist/harmony82.cjs +5 -1
  314. package/dist/harmony82.cjs.map +1 -1
  315. package/dist/harmony82.mjs +5 -1
  316. package/dist/harmony82.mjs.map +1 -1
  317. package/dist/harmony88.cjs +2 -1
  318. package/dist/harmony88.cjs.map +1 -1
  319. package/dist/harmony88.mjs +3 -2
  320. package/dist/harmony88.mjs.map +1 -1
  321. package/dist/harmony94.cjs +1 -1
  322. package/dist/harmony94.mjs +1 -1
  323. package/dist/harmony96.cjs +2 -2
  324. package/dist/harmony96.mjs +2 -2
  325. package/dist/harmony98.cjs +2 -2
  326. package/dist/harmony98.mjs +2 -2
  327. package/dist/types/src/features/permissions/types.d.ts +5 -1
  328. package/dist/types/src/features/publicApi/permissionTemplates.d.ts +5 -5
  329. package/dist/types/src/features/publicApi/projects.d.ts +15 -15
  330. package/dist/types/src/features/publicApi/teamUsers.d.ts +5 -5
  331. package/dist/types/src/features/publicApi/types/permissionTemplateTypes.d.ts +9 -10
  332. package/dist/types/src/features/publicApi/types/permissionTypes.d.ts +4 -4
  333. package/dist/types/src/features/publicApi/types/projectTypes.d.ts +24 -24
  334. package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +8 -8
  335. package/package.json +1 -1
package/dist/harmony.cjs CHANGED
@@ -152,6 +152,7 @@ exports.useHasAllFeatureFlags = useHasAllFeatureFlags.useHasAllFeatureFlags;
152
152
  exports.canPerformAction = canPerformAction.canPerformAction;
153
153
  exports.AUTOPILOT_FEATURE_FLAGS = types.AUTOPILOT_FEATURE_FLAGS;
154
154
  exports.EXPERT_FEATURE_FLAGS = types.EXPERT_FEATURE_FLAGS;
155
+ exports.LEGACY_PROJECT_PERMISSIONS = types.LEGACY_PROJECT_PERMISSIONS;
155
156
  exports.PROJECT_PERMISSIONS = types.PROJECT_PERMISSIONS;
156
157
  exports.PROJECT_TYPES = types.PROJECT_TYPES;
157
158
  exports.TEAM_ROLES = types.TEAM_ROLES;
@@ -246,7 +247,6 @@ exports.LIST_PROJECT_LANGUAGES_RESPONSE_SCHEMA = languageTypes.LIST_PROJECT_LANG
246
247
  exports.PAGINATION_QUERY_PARAMS_SCHEMA = paginationTypes.PAGINATION_QUERY_PARAMS_SCHEMA;
247
248
  exports.LIST_PERMISSION_TEMPLATES_PATH_PARAMS = permissionTemplateTypes.LIST_PERMISSION_TEMPLATES_PATH_PARAMS;
248
249
  exports.LIST_PERMISSION_TEMPLATES_RESPONSE = permissionTemplateTypes.LIST_PERMISSION_TEMPLATES_RESPONSE;
249
- exports.PERMISSIONS = permissionTemplateTypes.PERMISSIONS;
250
250
  exports.PERMISSION_SCHEMA = permissionTemplateTypes.PERMISSION_SCHEMA;
251
251
  exports.PERMISSION_TEMPLATE_SCHEMA = permissionTemplateTypes.PERMISSION_TEMPLATE_SCHEMA;
252
252
  exports.PERMISSION_DETAILS_SCHEMA = permissionTypes.PERMISSION_DETAILS_SCHEMA;
package/dist/harmony.mjs CHANGED
@@ -41,7 +41,7 @@ import { useCanPerformAnyAction } from "./harmony41.mjs";
41
41
  import { useHasAnyFeatureFlags } from "./harmony42.mjs";
42
42
  import { useHasAllFeatureFlags } from "./harmony43.mjs";
43
43
  import { canPerformAction } from "./harmony44.mjs";
44
- import { AUTOPILOT_FEATURE_FLAGS, EXPERT_FEATURE_FLAGS, PROJECT_PERMISSIONS, PROJECT_TYPES, TEAM_ROLES } from "./harmony45.mjs";
44
+ import { AUTOPILOT_FEATURE_FLAGS, EXPERT_FEATURE_FLAGS, LEGACY_PROJECT_PERMISSIONS, PROJECT_PERMISSIONS, PROJECT_TYPES, TEAM_ROLES } from "./harmony45.mjs";
45
45
  import { addContributors, deleteContributor, listContributors, retrieveContributor, updateContributors } from "./harmony46.mjs";
46
46
  import { addLanguagesToProject, bulkUpdateProjectLanguages, listProjectLanguages } from "./harmony47.mjs";
47
47
  import { listPermissionTemplates } from "./harmony48.mjs";
@@ -77,7 +77,7 @@ 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, PERMISSIONS, PERMISSION_SCHEMA, PERMISSION_TEMPLATE_SCHEMA } from "./harmony81.mjs";
80
+ import { LIST_PERMISSION_TEMPLATES_PATH_PARAMS, LIST_PERMISSION_TEMPLATES_RESPONSE, PERMISSION_SCHEMA, PERMISSION_TEMPLATE_SCHEMA } from "./harmony81.mjs";
81
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";
@@ -137,6 +137,7 @@ export {
137
137
  LANGUAGE_ISO_SCHEMA,
138
138
  LANGUAGE_SCHEMA,
139
139
  LANGUAGE_STATISTICS_SCHEMA,
140
+ LEGACY_PROJECT_PERMISSIONS,
140
141
  LIST_CONTRIBUTORS_PATH_PARAMS_SCHEMA,
141
142
  LIST_CONTRIBUTORS_RESPONSE_SCHEMA,
142
143
  LIST_PERMISSION_TEMPLATES_PATH_PARAMS,
@@ -152,7 +153,6 @@ export {
152
153
  NavigationProvider,
153
154
  NavigationTabs,
154
155
  PAGINATION_QUERY_PARAMS_SCHEMA,
155
- PERMISSIONS,
156
156
  PERMISSION_DETAILS_SCHEMA,
157
157
  PERMISSION_ID_SCHEMA,
158
158
  PERMISSION_SCHEMA,
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const SidebarContext = require("./harmony111.cjs");
5
+ const SidebarContext = require("./harmony106.cjs");
6
6
  const SidebarProvider = ({
7
7
  data,
8
8
  jwt,
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
- import { SidebarContext } from "./harmony111.mjs";
3
+ import { SidebarContext } from "./harmony106.mjs";
4
4
  const SidebarProvider = ({
5
5
  data,
6
6
  jwt,
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const IconLink = require("./harmony112.cjs");
5
- const ProfileMenu = require("./harmony113.cjs");
6
- const useSidebar = require("./harmony114.cjs");
4
+ const IconLink = require("./harmony107.cjs");
5
+ const ProfileMenu = require("./harmony108.cjs");
6
+ const useSidebar = require("./harmony109.cjs");
7
7
  const louis = require("@lokalise/louis");
8
- const permissions = require("./harmony115.cjs");
9
- const Avatar = require("./harmony116.cjs");
10
- const HelpMenu = require("./harmony117.cjs");
11
- const SidebarContent_module = require("./harmony118.cjs");
8
+ const permissions = require("./harmony110.cjs");
9
+ const Avatar = require("./harmony111.cjs");
10
+ const HelpMenu = require("./harmony112.cjs");
11
+ const SidebarContent_module = require("./harmony113.cjs");
12
12
  const SidebarContent = ({ widgetsConfig, children, ...navProps }) => {
13
13
  const sidebarContextProps = useSidebar.useSidebar();
14
14
  const { jwt } = sidebarContextProps;
@@ -1,12 +1,12 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { IconLink } from "./harmony112.mjs";
3
- import { ProfileMenu } from "./harmony113.mjs";
4
- import { useSidebar } from "./harmony114.mjs";
2
+ import { IconLink } from "./harmony107.mjs";
3
+ import { ProfileMenu } from "./harmony108.mjs";
4
+ import { useSidebar } from "./harmony109.mjs";
5
5
  import { Skeleton, Rectangle, ProjectIcon, ShoppingBagIcon, StyleguideIcon, ChartLineIcon } from "@lokalise/louis";
6
- import { canAccessStyleGuide, canAccessReporting } from "./harmony115.mjs";
7
- import { Avatar } from "./harmony116.mjs";
8
- import { HelpMenu } from "./harmony117.mjs";
9
- import styles from "./harmony118.mjs";
6
+ import { canAccessStyleGuide, canAccessReporting } from "./harmony110.mjs";
7
+ import { Avatar } from "./harmony111.mjs";
8
+ import { HelpMenu } from "./harmony112.mjs";
9
+ import styles from "./harmony113.mjs";
10
10
  const SidebarContent = ({ widgetsConfig, children, ...navProps }) => {
11
11
  const sidebarContextProps = useSidebar();
12
12
  const { jwt } = sidebarContextProps;
@@ -4,8 +4,8 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const louis = require("@lokalise/louis");
5
5
  const reactTable = require("@tanstack/react-table");
6
6
  const clsx = require("./harmony92.cjs");
7
- const SortingIcon = require("./harmony109.cjs");
8
- const TableHeaderCell_module = require("./harmony110.cjs");
7
+ const SortingIcon = require("./harmony114.cjs");
8
+ const TableHeaderCell_module = require("./harmony115.cjs");
9
9
  const TableHeaderCell = ({
10
10
  header,
11
11
  align = "left",
@@ -2,8 +2,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { TableHeaderCell as TableHeaderCell$1 } from "@lokalise/louis";
3
3
  import { flexRender } from "@tanstack/react-table";
4
4
  import { clsx } from "./harmony92.mjs";
5
- import { SortingIcon } from "./harmony109.mjs";
6
- import styles from "./harmony110.mjs";
5
+ import { SortingIcon } from "./harmony114.mjs";
6
+ import styles from "./harmony115.mjs";
7
7
  const TableHeaderCell = ({
8
8
  header,
9
9
  align = "left",
@@ -1,169 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
- const NavigationClientProvider = require("./harmony16.cjs");
5
- const toolbarVisibility = require("./harmony127.cjs");
6
- const useExpertNavigation = (enabled, project, contributor) => {
7
- const adminRights = (contributor == null ? void 0 : contributor.admin_rights) || [];
8
- const marketingSupportProjectSelectedAppSlug = "selected-app-slug";
9
- const navigationClient = NavigationClientProvider.useNavigationClient();
10
- const expertUrl = navigationClient.getExpertUrl();
11
- return React.useMemo(() => {
12
- if (!project || !enabled) {
13
- return [];
14
- }
15
- const navigationVisibility = toolbarVisibility.getProjectNavigationVisibilityMap(
16
- project,
17
- adminRights,
18
- () => true
19
- );
20
- const appsNavigationItem = {
21
- key: "apps",
22
- label: "Apps",
23
- isActive: (input) => input === "apps",
24
- link: `${expertUrl}/apps/${project.project_id}/`,
25
- ...navigationVisibility.apps
26
- };
27
- const appsNavigationItemArrInMainMenu = [];
28
- const appsNavigationItemArrInMoreMenu = [];
29
- if (project.project_type === "content_integration") {
30
- appsNavigationItemArrInMoreMenu.push(appsNavigationItem);
31
- } else {
32
- appsNavigationItemArrInMainMenu.push(appsNavigationItem);
33
- }
34
- return [
35
- {
36
- key: "edit",
37
- label: "Editor",
38
- link: `${expertUrl}/project/${project.project_id}/`,
39
- isActive: (input) => input === "edit",
40
- ...navigationVisibility.editor
41
- },
42
- {
43
- key: "files",
44
- label: "Files",
45
- link: `${expertUrl}/files/${project.project_id}/`,
46
- isActive: (input) => input === "files",
47
- ...navigationVisibility.files
48
- },
49
- ...project.project_type === "content_integration" ? [
50
- {
51
- key: "contentManagement",
52
- label: "Content management",
53
- isActive: (input) => input === "apps",
54
- link: `${expertUrl}/apps/${project.project_id}/${marketingSupportProjectSelectedAppSlug}`,
55
- ...navigationVisibility.contentManagement
56
- }
57
- ] : [
58
- {
59
- key: "upload",
60
- label: "Upload",
61
- link: `${expertUrl}/upload/${project.project_id}/`,
62
- isActive: (input) => input === "upload",
63
- ...navigationVisibility.upload
64
- },
65
- {
66
- key: "download",
67
- label: "Download",
68
- link: `${expertUrl}/download/${project.project_id}/`,
69
- isActive: (input) => input === "download",
70
- ...navigationVisibility.download
71
- }
72
- ],
73
- {
74
- key: "tasks",
75
- label: "Tasks",
76
- link: `${expertUrl}/tasks/${project.project_id}/`,
77
- isActive: (input) => input === "tasks",
78
- // TODO: Add task count
79
- // badge: taskCount,
80
- ...navigationVisibility.tasks
81
- },
82
- {
83
- key: "workflows",
84
- label: "Workflows",
85
- link: `${expertUrl}/workflows/${project.project_id}/`,
86
- isActive: (input) => input === "workflows",
87
- novel: "New",
88
- onClick: () => {
89
- window.location.assign(`${expertUrl}/workflows/${project.project_id}/`);
90
- },
91
- ...navigationVisibility.workflows
92
- },
93
- {
94
- key: "contributors",
95
- label: "Contributors",
96
- link: `${expertUrl}/contributors/${project.project_id}/`,
97
- isActive: (input) => input === "contributors",
98
- ...navigationVisibility.contributors
99
- },
100
- {
101
- key: "screenshots",
102
- label: "Screenshots",
103
- link: `${expertUrl}/screenshots/${project.project_id}/`,
104
- isActive: (input) => input === "screenshots",
105
- ...navigationVisibility.screenshots
106
- },
107
- {
108
- key: "glossary",
109
- label: "Glossary",
110
- link: `${expertUrl}/glossary/${project.project_id}/`,
111
- isActive: (input) => input === "glossary",
112
- ...navigationVisibility.glossary
113
- },
114
- ...appsNavigationItemArrInMainMenu,
115
- {
116
- key: "more",
117
- label: "More...",
118
- isActive: (input) => ["settings", "statistics", "duplicates", "live edit"].includes(input),
119
- ...navigationVisibility.more,
120
- dropdown: [
121
- [
122
- {
123
- link: `${expertUrl}/settings/${project.project_id}/`,
124
- label: "Settings",
125
- ...navigationVisibility.settings
126
- },
127
- {
128
- link: `${expertUrl}/settings/${project.project_id}/#branches`,
129
- label: "Branches",
130
- ...navigationVisibility.branches
131
- },
132
- {
133
- link: `${expertUrl}/settings/${project.project_id}/#ota-bundles`,
134
- label: "OTA Bundles",
135
- ...navigationVisibility.otaBundles
136
- },
137
- {
138
- link: `${expertUrl}/settings/${project.project_id}/#project-automations`,
139
- label: "Automations",
140
- ...navigationVisibility.automations
141
- },
142
- {
143
- link: `${expertUrl}/dupes/${project.project_id}/`,
144
- label: "Duplicate finder",
145
- ...navigationVisibility.duplicateFinder
146
- }
147
- ],
148
- [
149
- ...appsNavigationItemArrInMoreMenu,
150
- {
151
- // 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.
152
- label: "Activity",
153
- onClick: () => {
154
- },
155
- ...navigationVisibility.activity
156
- },
157
- {
158
- link: `${expertUrl}/statistics/${project.project_id}/`,
159
- label: "Statistics",
160
- ...navigationVisibility.statistics
161
- }
162
- ]
163
- ]
164
- }
165
- ];
166
- }, [project, adminRights, enabled, expertUrl]);
167
- };
168
- exports.useExpertNavigation = useExpertNavigation;
4
+ const SidebarContext = React.createContext({});
5
+ exports.SidebarContext = SidebarContext;
169
6
  //# sourceMappingURL=harmony106.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony106.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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AS,UAAU,QAAQ,UAAU;AAAA,cAC9C,OAAO;AAAA,cACP,GAAG,qBAAqB;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":"harmony106.cjs","sources":["../src/components/Sidebar/SidebarContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { SidebarContextProps } from './types'\n\nexport const SidebarContext = createContext({} as SidebarContextProps)\n\nexport const useSidebar = () => {\n\tconst context = useContext(SidebarContext)\n\n\tif (!context) {\n\t\tthrow new Error(\n\t\t\t'You are using useSidebar hook outside its context. Please review your code implementation',\n\t\t)\n\t}\n\n\treturn context\n}\n"],"names":["createContext"],"mappings":";;;AAGa,MAAA,iBAAiBA,MAAc,cAAA,CAAyB,CAAA;;"}
@@ -1,169 +1,6 @@
1
- import { useMemo } from "react";
2
- import { useNavigationClient } from "./harmony16.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 [];
12
- }
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]);
165
- };
1
+ import { createContext } from "react";
2
+ const SidebarContext = createContext({});
166
3
  export {
167
- useExpertNavigation
4
+ SidebarContext
168
5
  };
169
6
  //# sourceMappingURL=harmony106.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony106.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;AAC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AAAA,MACzB;AAAA,MACA,GAAG;AAAA,MACH;AAAA,QACC,KAAK;AAAA,QACL,OAAO;AAAA,QACP,UAAU,CAAC,UACV,CAAC,YAAY,cAAc,cAAc,WAAW,EAAE,SAAS,KAAK;AAAA,QACrE,GAAG,qBAAqB;AAAA,QACxB,UAAU;AAAA,UACT;AAAA,YACC;AAAA,cACC,MAAM,GAAG,SAAS,aAAa,QAAQ,UAAU;AAAA,cACjD,OAAO;AAAA,cACP,GAAG,qBAAqB;AAAA,YACzB;AAAA,YACA;AAAA,cACC,MAAM,GAAG,SAAS,aAAa,QAAQ,UAAU;AAAA,cACjD,OAAO;AAAA,cACP,GAAG,qBAAqB;AAAA,YACzB;AAAA,YACA;AAAA,cACC,MAAM,GAAG,SAAS,aAAa,QAAQ,UAAU;AAAA,cACjD,OAAO;AAAA,cACP,GAAG,qBAAqB;AAAA,YACzB;AAAA,YACA;AAAA,cACC,MAAM,GAAG,SAAS,aAAa,QAAQ,UAAU;AAAA,cACjD,OAAO;AAAA,cACP,GAAG,qBAAqB;AAAA,YACzB;AAAA,YACA;AAAA,cACC,MAAM,GAAG,SAAS,UAAU,QAAQ,UAAU;AAAA,cAC9C,OAAO;AAAA,cACP,GAAG,qBAAqB;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":"harmony106.mjs","sources":["../src/components/Sidebar/SidebarContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { SidebarContextProps } from './types'\n\nexport const SidebarContext = createContext({} as SidebarContextProps)\n\nexport const useSidebar = () => {\n\tconst context = useContext(SidebarContext)\n\n\tif (!context) {\n\t\tthrow new Error(\n\t\t\t'You are using useSidebar hook outside its context. Please review your code implementation',\n\t\t)\n\t}\n\n\treturn context\n}\n"],"names":[],"mappings":";AAGa,MAAA,iBAAiB,cAAc,CAAyB,CAAA;"}
@@ -1,47 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const React = require("react");
4
- const NavigationClientProvider = require("./harmony16.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 [];
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const louis = require("@lokalise/louis");
5
+ const clsx = require("./harmony92.cjs");
6
+ const IconLink_module = require("./harmony128.cjs");
7
+ const IconLink = ({ label, to, icon: Icon }) => {
8
+ return /* @__PURE__ */ jsxRuntime.jsx(louis.Tooltip, { placement: "right", tooltip: label, children: /* @__PURE__ */ jsxRuntime.jsx(
9
+ louis.Link,
10
+ {
11
+ "aria-label": label,
12
+ className: clsx.clsx(IconLink_module.default.link, {
13
+ [IconLink_module.default.active]: typeof window !== "undefined" && window.location.pathname.startsWith(to)
14
+ }),
15
+ href: to,
16
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: "25px" })
18
17
  }
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]);
18
+ ) });
45
19
  };
46
- exports.useNextgenNavigation = useNextgenNavigation;
20
+ exports.IconLink = IconLink;
47
21
  //# sourceMappingURL=harmony107.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony107.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":["useNavigationCl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AA,GAED,CAAC,SAAS,WAAW,SAAS,UAAU,aAAa,UAAU,CAAC;AACpE;;"}
1
+ {"version":3,"file":"harmony107.cjs","sources":["../src/components/Sidebar/Widgets/IconLink/IconLink.tsx"],"sourcesContent":["import { Link, type SvgIconProps, Tooltip } from '@lokalise/louis'\nimport clsx from 'clsx'\nimport type { FC } from 'react'\nimport styles from './IconLink.module.css'\n\ntype IconLinkProps = {\n\t/** URL destination for the link */\n\tto: string\n\t/** Text to display in the tooltip when hovering over the icon */\n\tlabel: string\n\t/** Icon component from @lokalise/louis to display */\n\ticon: FC<SvgIconProps>\n}\n\n/**\n * A navigation link component that displays an icon with a tooltip.\n * When hovered, shows a tooltip with the label text.\n * The link is highlighted when the current URL matches its destination.\n *\n * @example\n * ```tsx\n * <IconLink to=\"/projects\" label=\"Projects\" icon={FolderOpenIcon} />\n * ```\n */\nexport const IconLink = ({ label, to, icon: Icon }: IconLinkProps) => {\n\treturn (\n\t\t<Tooltip placement=\"right\" tooltip={label}>\n\t\t\t<Link\n\t\t\t\taria-label={label}\n\t\t\t\tclassName={clsx(styles.link, {\n\t\t\t\t\t[styles.active]: typeof window !== 'undefined' && window.location.pathname.startsWith(to),\n\t\t\t\t})}\n\t\t\t\thref={to}\n\t\t\t>\n\t\t\t\t<Icon size=\"25px\" />\n\t\t\t</Link>\n\t\t</Tooltip>\n\t)\n}\n"],"names":["jsx","Tooltip","Link","clsx","styles"],"mappings":";;;;;;AAwBO,MAAM,WAAW,CAAC,EAAE,OAAO,IAAI,MAAM,WAA0B;AACrE,SACEA,2BAAA,IAAAC,MAAA,SAAA,EAAQ,WAAU,SAAQ,SAAS,OACnC,UAAAD,2BAAA;AAAA,IAACE,MAAA;AAAA,IAAA;AAAA,MACA,cAAY;AAAA,MACZ,WAAWC,KAAAA,KAAKC,gBAAA,QAAO,MAAM;AAAA,QAC5B,CAACA,gBAAO,QAAA,MAAM,GAAG,OAAO,WAAW,eAAe,OAAO,SAAS,SAAS,WAAW,EAAE;AAAA,MAAA,CACxF;AAAA,MACD,MAAM;AAAA,MAEN,UAAAJ,2BAAAA,IAAC,MAAK,EAAA,MAAK,OAAO,CAAA;AAAA,IAAA;AAAA,EAAA,GAEpB;AAEF;;"}