@lokalise/harmony 4.3.0 → 4.3.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 (312) hide show
  1. package/dist/harmony101.cjs +2 -2
  2. package/dist/harmony101.mjs +2 -2
  3. package/dist/harmony105.cjs +1 -1
  4. package/dist/harmony105.mjs +1 -1
  5. package/dist/harmony106.cjs +7 -7
  6. package/dist/harmony106.mjs +7 -7
  7. package/dist/harmony108.cjs +2 -2
  8. package/dist/harmony108.mjs +2 -2
  9. package/dist/harmony109.cjs +165 -2
  10. package/dist/harmony109.cjs.map +1 -1
  11. package/dist/harmony109.mjs +166 -3
  12. package/dist/harmony109.mjs.map +1 -1
  13. package/dist/harmony110.cjs +42 -16
  14. package/dist/harmony110.cjs.map +1 -1
  15. package/dist/harmony110.mjs +42 -16
  16. package/dist/harmony110.mjs.map +1 -1
  17. package/dist/harmony111.cjs +13 -75
  18. package/dist/harmony111.cjs.map +1 -1
  19. package/dist/harmony111.mjs +13 -75
  20. package/dist/harmony111.mjs.map +1 -1
  21. package/dist/harmony112.cjs +2 -11
  22. package/dist/harmony112.cjs.map +1 -1
  23. package/dist/harmony112.mjs +3 -12
  24. package/dist/harmony112.mjs.map +1 -1
  25. package/dist/harmony113.cjs +18 -34
  26. package/dist/harmony113.cjs.map +1 -1
  27. package/dist/harmony113.mjs +18 -34
  28. package/dist/harmony113.mjs.map +1 -1
  29. package/dist/harmony114.cjs +75 -8
  30. package/dist/harmony114.cjs.map +1 -1
  31. package/dist/harmony114.mjs +75 -8
  32. package/dist/harmony114.mjs.map +1 -1
  33. package/dist/harmony115.cjs +11 -46
  34. package/dist/harmony115.cjs.map +1 -1
  35. package/dist/harmony115.mjs +11 -46
  36. package/dist/harmony115.mjs.map +1 -1
  37. package/dist/harmony116.cjs +35 -10
  38. package/dist/harmony116.cjs.map +1 -1
  39. package/dist/harmony116.mjs +34 -9
  40. package/dist/harmony116.mjs.map +1 -1
  41. package/dist/harmony117.cjs +8 -10
  42. package/dist/harmony117.cjs.map +1 -1
  43. package/dist/harmony117.mjs +9 -11
  44. package/dist/harmony117.mjs.map +1 -1
  45. package/dist/harmony118.cjs +47 -21
  46. package/dist/harmony118.cjs.map +1 -1
  47. package/dist/harmony118.mjs +46 -20
  48. package/dist/harmony118.mjs.map +1 -1
  49. package/dist/harmony119.cjs +9 -12
  50. package/dist/harmony119.cjs.map +1 -1
  51. package/dist/harmony119.mjs +8 -11
  52. package/dist/harmony119.mjs.map +1 -1
  53. package/dist/harmony120.cjs +12 -12
  54. package/dist/harmony120.cjs.map +1 -1
  55. package/dist/harmony120.mjs +11 -11
  56. package/dist/harmony120.mjs.map +1 -1
  57. package/dist/harmony121.cjs +12 -14
  58. package/dist/harmony121.cjs.map +1 -1
  59. package/dist/harmony121.mjs +11 -13
  60. package/dist/harmony121.mjs.map +1 -1
  61. package/dist/harmony122.cjs +11 -20
  62. package/dist/harmony122.cjs.map +1 -1
  63. package/dist/harmony122.mjs +11 -20
  64. package/dist/harmony122.mjs.map +1 -1
  65. package/dist/harmony123.cjs +22 -22
  66. package/dist/harmony123.cjs.map +1 -1
  67. package/dist/harmony123.mjs +21 -21
  68. package/dist/harmony123.mjs.map +1 -1
  69. package/dist/harmony124.cjs +92 -159
  70. package/dist/harmony124.cjs.map +1 -1
  71. package/dist/harmony124.mjs +77 -161
  72. package/dist/harmony124.mjs.map +1 -1
  73. package/dist/harmony125.cjs +21 -44
  74. package/dist/harmony125.cjs.map +1 -1
  75. package/dist/harmony125.mjs +21 -44
  76. package/dist/harmony125.mjs.map +1 -1
  77. package/dist/harmony126.cjs +20 -8
  78. package/dist/harmony126.cjs.map +1 -1
  79. package/dist/harmony126.mjs +20 -8
  80. package/dist/harmony126.mjs.map +1 -1
  81. package/dist/harmony127.cjs +3 -3
  82. package/dist/harmony127.cjs.map +1 -1
  83. package/dist/harmony127.mjs +3 -3
  84. package/dist/harmony127.mjs.map +1 -1
  85. package/dist/harmony128.cjs +7 -16
  86. package/dist/harmony128.cjs.map +1 -1
  87. package/dist/harmony128.mjs +7 -16
  88. package/dist/harmony128.mjs.map +1 -1
  89. package/dist/harmony129.cjs +16 -98
  90. package/dist/harmony129.cjs.map +1 -1
  91. package/dist/harmony129.mjs +16 -81
  92. package/dist/harmony129.mjs.map +1 -1
  93. package/dist/harmony130.cjs +87 -9
  94. package/dist/harmony130.cjs.map +1 -1
  95. package/dist/harmony130.mjs +86 -8
  96. package/dist/harmony130.mjs.map +1 -1
  97. package/dist/harmony131.cjs +29 -11
  98. package/dist/harmony131.cjs.map +1 -1
  99. package/dist/harmony131.mjs +29 -11
  100. package/dist/harmony131.mjs.map +1 -1
  101. package/dist/harmony132.cjs +9 -15
  102. package/dist/harmony132.cjs.map +1 -1
  103. package/dist/harmony132.mjs +8 -14
  104. package/dist/harmony132.mjs.map +1 -1
  105. package/dist/harmony133.cjs +6 -13
  106. package/dist/harmony133.cjs.map +1 -1
  107. package/dist/harmony133.mjs +8 -15
  108. package/dist/harmony133.mjs.map +1 -1
  109. package/dist/harmony134.cjs +12 -7
  110. package/dist/harmony134.cjs.map +1 -1
  111. package/dist/harmony134.mjs +14 -9
  112. package/dist/harmony134.mjs.map +1 -1
  113. package/dist/harmony135.cjs +13 -20
  114. package/dist/harmony135.cjs.map +1 -1
  115. package/dist/harmony135.mjs +15 -22
  116. package/dist/harmony135.mjs.map +1 -1
  117. package/dist/harmony136.cjs +7 -9
  118. package/dist/harmony136.cjs.map +1 -1
  119. package/dist/harmony136.mjs +9 -11
  120. package/dist/harmony136.mjs.map +1 -1
  121. package/dist/harmony137.cjs +18 -30
  122. package/dist/harmony137.cjs.map +1 -1
  123. package/dist/harmony137.mjs +20 -32
  124. package/dist/harmony137.mjs.map +1 -1
  125. package/dist/harmony138.cjs +6 -6
  126. package/dist/harmony138.cjs.map +1 -1
  127. package/dist/harmony138.mjs +6 -6
  128. package/dist/harmony138.mjs.map +1 -1
  129. package/dist/harmony139.cjs +29 -13
  130. package/dist/harmony139.cjs.map +1 -1
  131. package/dist/harmony139.mjs +30 -14
  132. package/dist/harmony139.mjs.map +1 -1
  133. package/dist/harmony140.cjs +7 -31
  134. package/dist/harmony140.cjs.map +1 -1
  135. package/dist/harmony140.mjs +8 -32
  136. package/dist/harmony140.mjs.map +1 -1
  137. package/dist/harmony141.cjs +22 -21
  138. package/dist/harmony141.cjs.map +1 -1
  139. package/dist/harmony141.mjs +21 -20
  140. package/dist/harmony141.mjs.map +1 -1
  141. package/dist/harmony142.cjs +30 -15
  142. package/dist/harmony142.cjs.map +1 -1
  143. package/dist/harmony142.mjs +32 -17
  144. package/dist/harmony142.mjs.map +1 -1
  145. package/dist/harmony143.cjs +18 -3
  146. package/dist/harmony143.cjs.map +1 -1
  147. package/dist/harmony143.mjs +18 -3
  148. package/dist/harmony143.mjs.map +1 -1
  149. package/dist/harmony144.cjs +21 -15
  150. package/dist/harmony144.cjs.map +1 -1
  151. package/dist/harmony144.mjs +20 -14
  152. package/dist/harmony144.mjs.map +1 -1
  153. package/dist/harmony145.cjs +6 -87
  154. package/dist/harmony145.cjs.map +1 -1
  155. package/dist/harmony145.mjs +5 -86
  156. package/dist/harmony145.mjs.map +1 -1
  157. package/dist/harmony146.cjs +16 -31
  158. package/dist/harmony146.cjs.map +1 -1
  159. package/dist/harmony146.mjs +15 -30
  160. package/dist/harmony146.mjs.map +1 -1
  161. package/dist/harmony147.cjs +2 -2
  162. package/dist/harmony147.mjs +2 -2
  163. package/dist/harmony148.cjs +2 -2
  164. package/dist/harmony148.mjs +2 -2
  165. package/dist/harmony149.cjs +10 -2
  166. package/dist/harmony149.cjs.map +1 -1
  167. package/dist/harmony149.mjs +10 -2
  168. package/dist/harmony149.mjs.map +1 -1
  169. package/dist/harmony150.cjs +2 -3
  170. package/dist/harmony150.cjs.map +1 -1
  171. package/dist/harmony150.mjs +2 -3
  172. package/dist/harmony150.mjs.map +1 -1
  173. package/dist/harmony151.cjs +3 -3
  174. package/dist/harmony151.cjs.map +1 -1
  175. package/dist/harmony151.mjs +3 -3
  176. package/dist/harmony151.mjs.map +1 -1
  177. package/dist/harmony152.cjs +3 -3
  178. package/dist/harmony152.cjs.map +1 -1
  179. package/dist/harmony152.mjs +3 -3
  180. package/dist/harmony152.mjs.map +1 -1
  181. package/dist/harmony153.cjs +3 -14
  182. package/dist/harmony153.cjs.map +1 -1
  183. package/dist/harmony153.mjs +3 -14
  184. package/dist/harmony153.mjs.map +1 -1
  185. package/dist/harmony154.cjs +14 -3
  186. package/dist/harmony154.cjs.map +1 -1
  187. package/dist/harmony154.mjs +14 -3
  188. package/dist/harmony154.mjs.map +1 -1
  189. package/dist/harmony155.cjs +3 -14
  190. package/dist/harmony155.cjs.map +1 -1
  191. package/dist/harmony155.mjs +3 -14
  192. package/dist/harmony155.mjs.map +1 -1
  193. package/dist/harmony156.cjs +14 -96
  194. package/dist/harmony156.cjs.map +1 -1
  195. package/dist/harmony156.mjs +14 -96
  196. package/dist/harmony156.mjs.map +1 -1
  197. package/dist/harmony157.cjs +94 -11
  198. package/dist/harmony157.cjs.map +1 -1
  199. package/dist/harmony157.mjs +94 -11
  200. package/dist/harmony157.mjs.map +1 -1
  201. package/dist/harmony158.cjs +12 -13
  202. package/dist/harmony158.cjs.map +1 -1
  203. package/dist/harmony158.mjs +12 -13
  204. package/dist/harmony158.mjs.map +1 -1
  205. package/dist/harmony159.cjs +13 -35
  206. package/dist/harmony159.cjs.map +1 -1
  207. package/dist/harmony159.mjs +13 -35
  208. package/dist/harmony159.mjs.map +1 -1
  209. package/dist/harmony160.cjs +32 -24
  210. package/dist/harmony160.cjs.map +1 -1
  211. package/dist/harmony160.mjs +32 -24
  212. package/dist/harmony160.mjs.map +1 -1
  213. package/dist/harmony161.cjs +28 -10
  214. package/dist/harmony161.cjs.map +1 -1
  215. package/dist/harmony161.mjs +28 -10
  216. package/dist/harmony161.mjs.map +1 -1
  217. package/dist/harmony162.cjs +32 -9
  218. package/dist/harmony162.cjs.map +1 -1
  219. package/dist/harmony162.mjs +31 -8
  220. package/dist/harmony162.mjs.map +1 -1
  221. package/dist/harmony163.cjs +14 -7
  222. package/dist/harmony163.cjs.map +1 -1
  223. package/dist/harmony163.mjs +13 -6
  224. package/dist/harmony163.mjs.map +1 -1
  225. package/dist/harmony164.cjs +16 -10
  226. package/dist/harmony164.cjs.map +1 -1
  227. package/dist/harmony164.mjs +15 -9
  228. package/dist/harmony164.mjs.map +1 -1
  229. package/dist/harmony165.cjs +17 -25
  230. package/dist/harmony165.cjs.map +1 -1
  231. package/dist/harmony165.mjs +16 -24
  232. package/dist/harmony165.mjs.map +1 -1
  233. package/dist/harmony166.cjs +6 -3
  234. package/dist/harmony166.cjs.map +1 -1
  235. package/dist/harmony166.mjs +6 -3
  236. package/dist/harmony166.mjs.map +1 -1
  237. package/dist/harmony167.cjs +3 -9
  238. package/dist/harmony167.cjs.map +1 -1
  239. package/dist/harmony167.mjs +3 -9
  240. package/dist/harmony167.mjs.map +1 -1
  241. package/dist/harmony168.cjs +6 -3
  242. package/dist/harmony168.cjs.map +1 -1
  243. package/dist/harmony168.mjs +6 -3
  244. package/dist/harmony168.mjs.map +1 -1
  245. package/dist/harmony169.cjs +24 -32
  246. package/dist/harmony169.cjs.map +1 -1
  247. package/dist/harmony169.mjs +23 -31
  248. package/dist/harmony169.mjs.map +1 -1
  249. package/dist/harmony17.cjs +1 -1
  250. package/dist/harmony17.mjs +1 -1
  251. package/dist/harmony170.cjs +7 -14
  252. package/dist/harmony170.cjs.map +1 -1
  253. package/dist/harmony170.mjs +6 -13
  254. package/dist/harmony170.mjs.map +1 -1
  255. package/dist/harmony171.cjs +13 -16
  256. package/dist/harmony171.cjs.map +1 -1
  257. package/dist/harmony171.mjs +12 -15
  258. package/dist/harmony171.mjs.map +1 -1
  259. package/dist/harmony172.cjs +7 -17
  260. package/dist/harmony172.cjs.map +1 -1
  261. package/dist/harmony172.mjs +6 -16
  262. package/dist/harmony172.mjs.map +1 -1
  263. package/dist/harmony173.cjs +1 -1
  264. package/dist/harmony173.mjs +1 -1
  265. package/dist/harmony175.cjs +3 -3
  266. package/dist/harmony175.mjs +3 -3
  267. package/dist/harmony177.cjs +6 -4
  268. package/dist/harmony177.cjs.map +1 -1
  269. package/dist/harmony177.mjs +6 -4
  270. package/dist/harmony177.mjs.map +1 -1
  271. package/dist/harmony178.cjs +11 -5
  272. package/dist/harmony178.cjs.map +1 -1
  273. package/dist/harmony178.mjs +11 -5
  274. package/dist/harmony178.mjs.map +1 -1
  275. package/dist/harmony179.cjs +31 -11
  276. package/dist/harmony179.cjs.map +1 -1
  277. package/dist/harmony179.mjs +31 -11
  278. package/dist/harmony179.mjs.map +1 -1
  279. package/dist/harmony180.cjs +10 -28
  280. package/dist/harmony180.cjs.map +1 -1
  281. package/dist/harmony180.mjs +10 -28
  282. package/dist/harmony180.mjs.map +1 -1
  283. package/dist/harmony181.cjs +4 -14
  284. package/dist/harmony181.cjs.map +1 -1
  285. package/dist/harmony181.mjs +4 -14
  286. package/dist/harmony181.mjs.map +1 -1
  287. package/dist/harmony20.cjs +1 -1
  288. package/dist/harmony20.mjs +1 -1
  289. package/dist/harmony28.cjs +1 -1
  290. package/dist/harmony28.mjs +1 -1
  291. package/dist/harmony29.cjs +1 -1
  292. package/dist/harmony29.mjs +1 -1
  293. package/dist/harmony4.cjs +2 -17
  294. package/dist/harmony4.cjs.map +1 -1
  295. package/dist/harmony4.mjs +2 -17
  296. package/dist/harmony4.mjs.map +1 -1
  297. package/dist/harmony40.cjs +1 -1
  298. package/dist/harmony40.mjs +1 -1
  299. package/dist/harmony41.cjs +1 -1
  300. package/dist/harmony41.mjs +1 -1
  301. package/dist/harmony42.cjs +1 -1
  302. package/dist/harmony42.mjs +1 -1
  303. package/dist/harmony58.cjs +1 -1
  304. package/dist/harmony58.mjs +1 -1
  305. package/dist/harmony68.cjs +1 -1
  306. package/dist/harmony68.mjs +1 -1
  307. package/dist/harmony97.cjs +1 -1
  308. package/dist/harmony97.mjs +1 -1
  309. package/dist/harmony99.cjs +2 -2
  310. package/dist/harmony99.mjs +2 -2
  311. package/dist/types/src/features/navigation/ProjectNavigationPanel.d.ts +1 -1
  312. package/package.json +1 -1
@@ -1,169 +1,102 @@
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("./harmony145.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);
4
+ const debounce = require("./harmony147.cjs");
5
+ const throttle = require("./harmony148.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
+ }
33
17
  }
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
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
23
+ const patchResizeCallback = (resizeCallback, refreshMode, refreshRate, refreshOptions) => {
24
+ switch (refreshMode) {
25
+ case "debounce":
26
+ return debounce.default(resizeCallback, refreshRate, refreshOptions);
27
+ case "throttle":
28
+ return throttle.default(resizeCallback, refreshRate, refreshOptions);
29
+ default:
30
+ return resizeCallback;
31
+ }
32
+ };
33
+ const useCallbackRef = (
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
+ (callback) => {
36
+ const callbackRef = React__namespace.useRef(callback);
37
+ React__namespace.useEffect(() => {
38
+ callbackRef.current = callback;
39
+ });
40
+ return React__namespace.useMemo(() => (...args) => {
41
+ var _a;
42
+ return (_a = callbackRef.current) === null || _a === void 0 ? void 0 : _a.call(callbackRef, ...args);
43
+ }, []);
44
+ }
45
+ );
46
+ const useRefProxy = (
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ (targetRef) => {
49
+ const [refElement, setRefElement] = React__namespace.useState((targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) || null);
50
+ if (targetRef) {
51
+ setTimeout(() => {
52
+ if (targetRef.current !== refElement) {
53
+ setRefElement(targetRef.current);
56
54
  }
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
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;
71
65
  }
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
66
+ return target[prop];
81
67
  },
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
- ]
68
+ set(target, prop, value) {
69
+ if (prop === "current") {
70
+ setRefElement(value);
71
+ } else {
72
+ target[prop] = value;
73
+ }
74
+ return true;
164
75
  }
165
- ];
166
- }, [project, adminRights, enabled, expertUrl]);
76
+ }), [refElement]);
77
+ return { refProxy, refElement, setRefElement };
78
+ }
79
+ );
80
+ const getDimensions = (entry, box) => {
81
+ if (box === "border-box") {
82
+ return {
83
+ width: entry.borderBoxSize[0].inlineSize,
84
+ height: entry.borderBoxSize[0].blockSize
85
+ };
86
+ }
87
+ if (box === "content-box") {
88
+ return {
89
+ width: entry.contentBoxSize[0].inlineSize,
90
+ height: entry.contentBoxSize[0].blockSize
91
+ };
92
+ }
93
+ return {
94
+ width: entry.contentRect.width,
95
+ height: entry.contentRect.height
96
+ };
167
97
  };
168
- exports.useExpertNavigation = useExpertNavigation;
98
+ exports.getDimensions = getDimensions;
99
+ exports.patchResizeCallback = patchResizeCallback;
100
+ exports.useCallbackRef = useCallbackRef;
101
+ exports.useRefProxy = useRefProxy;
169
102
  //# sourceMappingURL=harmony124.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony124.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,CAA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L,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":"harmony124.cjs","sources":["../node_modules/react-resize-detector/build/utils.js"],"sourcesContent":["import * as React from 'react';\nimport debounce from 'lodash/debounce.js';\nimport throttle from 'lodash/throttle.js';\n\n/**\n * Wraps the resize callback with a lodash debounce / throttle based on the refresh mode\n */\nconst patchResizeCallback = (resizeCallback, refreshMode, refreshRate, refreshOptions) => {\n switch (refreshMode) {\n case 'debounce':\n return debounce(resizeCallback, refreshRate, refreshOptions);\n case 'throttle':\n return throttle(resizeCallback, refreshRate, refreshOptions);\n default:\n return resizeCallback;\n }\n};\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nconst useCallbackRef = \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(callback) => {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => ((...args) => { var _a; return (_a = callbackRef.current) === null || _a === void 0 ? void 0 : _a.call(callbackRef, ...args); }), []);\n};\n/** `useRef` hook doesn't handle conditional rendering or dynamic ref changes.\n * This hook creates a proxy that ensures that `refElement` is updated whenever the ref is changed. */\nconst useRefProxy = \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(targetRef) => {\n // we are going to use this ref to store the last element that was passed to the hook\n const [refElement, setRefElement] = React.useState((targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) || null);\n // if targetRef is passed, we need to update the refElement\n // we have to use setTimeout because ref get assigned after the hook is called\n // in the future releases we are going to remove targetRef and force users to use ref returned by the hook\n if (targetRef) {\n setTimeout(() => {\n if (targetRef.current !== refElement) {\n setRefElement(targetRef.current);\n }\n }, 0);\n }\n // this is a memo that will be called every time the ref is changed\n // This proxy will properly call setState either when the ref is called as a function or when `.current` is set\n // we call setState inside to trigger rerender\n const refProxy = React.useMemo(() => new Proxy((node) => {\n if (node !== refElement) {\n setRefElement(node);\n }\n }, {\n get(target, prop) {\n if (prop === 'current') {\n return refElement;\n }\n return target[prop];\n },\n set(target, prop, value) {\n if (prop === 'current') {\n setRefElement(value);\n }\n else {\n target[prop] = value;\n }\n return true;\n },\n }), [refElement]);\n return { refProxy, refElement, setRefElement };\n};\n/** Calculates the dimensions of the element based on the current box model.\n * @see https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/The_box_model\n */\nconst getDimensions = (entry, box) => {\n // Value\t Border\t Padding\t Inner Content\n // ---------------------------------------------------\n // 'border-box'\t Yes\t Yes\t Yes\n // 'content-box'\t No\t No\t Yes\n // undefined No\t No?\t Yes\n if (box === 'border-box') {\n return {\n width: entry.borderBoxSize[0].inlineSize,\n height: entry.borderBoxSize[0].blockSize,\n };\n }\n if (box === 'content-box') {\n return {\n width: entry.contentBoxSize[0].inlineSize,\n height: entry.contentBoxSize[0].blockSize,\n };\n }\n return {\n width: entry.contentRect.width,\n height: entry.contentRect.height,\n };\n};\n\nexport { getDimensions, patchResizeCallback, useCallbackRef, useRefProxy };\n//# sourceMappingURL=utils.js.map\n"],"names":["debounce","throttle","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOK,MAAC,sBAAsB,CAAC,gBAAgB,aAAa,aAAa,mBAAmB;AACtF,UAAQ,aAAW;AAAA,IACf,KAAK;AACD,aAAOA,iBAAS,gBAAgB,aAAa,cAAc;AAAA,IAC/D,KAAK;AACD,aAAOC,iBAAS,gBAAgB,aAAa,cAAc;AAAA,IAC/D;AACI,aAAO;AAAA,EACnB;AACA;AAKK,MAAC;AAAA;AAAA,EAEN,CAAC,aAAa;AACV,UAAM,cAAcC,iBAAM,OAAO,QAAQ;AACzCA,qBAAM,UAAU,MAAM;AAClB,kBAAY,UAAU;AAAA,IAC9B,CAAK;AACD,WAAOA,iBAAM,QAAQ,MAAO,IAAI,SAAS;AAAE,UAAI;AAAI,cAAQ,KAAK,YAAY,aAAa,QAAQ,OAAO,SAAS,SAAS,GAAG,KAAK,aAAa,GAAG,IAAI;AAAA,IAAI,GAAG,CAAA,CAAE;AAAA,EACnK;AAAA;AAGK,MAAC;AAAA;AAAA,EAEN,CAAC,cAAc;AAEX,UAAM,CAAC,YAAY,aAAa,IAAIA,iBAAM,UAAU,cAAc,QAAQ,cAAc,SAAS,SAAS,UAAU,YAAY,IAAI;AAIpI,QAAI,WAAW;AACX,iBAAW,MAAM;AACb,YAAI,UAAU,YAAY,YAAY;AAClC,wBAAc,UAAU,OAAO;AAAA,QAC/C;AAAA,MACS,GAAE,CAAC;AAAA,IACZ;AAII,UAAM,WAAWA,iBAAM,QAAQ,MAAM,IAAI,MAAM,CAAC,SAAS;AACrD,UAAI,SAAS,YAAY;AACrB,sBAAc,IAAI;AAAA,MAC9B;AAAA,IACA,GAAO;AAAA,MACC,IAAI,QAAQ,MAAM;AACd,YAAI,SAAS,WAAW;AACpB,iBAAO;AAAA,QACvB;AACY,eAAO,OAAO,IAAI;AAAA,MACrB;AAAA,MACD,IAAI,QAAQ,MAAM,OAAO;AACrB,YAAI,SAAS,WAAW;AACpB,wBAAc,KAAK;AAAA,QACnC,OACiB;AACD,iBAAO,IAAI,IAAI;AAAA,QAC/B;AACY,eAAO;AAAA,MACV;AAAA,IACT,CAAK,GAAG,CAAC,UAAU,CAAC;AAChB,WAAO,EAAE,UAAU,YAAY,cAAe;AAAA,EAClD;AAAA;AAIK,MAAC,gBAAgB,CAAC,OAAO,QAAQ;AAMlC,MAAI,QAAQ,cAAc;AACtB,WAAO;AAAA,MACH,OAAO,MAAM,cAAc,CAAC,EAAE;AAAA,MAC9B,QAAQ,MAAM,cAAc,CAAC,EAAE;AAAA,IAClC;AAAA,EACT;AACI,MAAI,QAAQ,eAAe;AACvB,WAAO;AAAA,MACH,OAAO,MAAM,eAAe,CAAC,EAAE;AAAA,MAC/B,QAAQ,MAAM,eAAe,CAAC,EAAE;AAAA,IACnC;AAAA,EACT;AACI,SAAO;AAAA,IACH,OAAO,MAAM,YAAY;AAAA,IACzB,QAAQ,MAAM,YAAY;AAAA,EAC7B;AACL;;;;;","x_google_ignoreList":[0]}
@@ -1,169 +1,85 @@
1
- import { useMemo } from "react";
2
- import { useNavigationClient } from "./harmony16.mjs";
3
- import { getProjectNavigationVisibilityMap } from "./harmony145.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
1
+ import * as React from "react";
2
+ import debounce from "./harmony147.mjs";
3
+ import throttle from "./harmony148.mjs";
4
+ const patchResizeCallback = (resizeCallback, refreshMode, refreshRate, refreshOptions) => {
5
+ switch (refreshMode) {
6
+ case "debounce":
7
+ return debounce(resizeCallback, refreshRate, refreshOptions);
8
+ case "throttle":
9
+ return throttle(resizeCallback, refreshRate, refreshOptions);
10
+ default:
11
+ return resizeCallback;
12
+ }
13
+ };
14
+ const useCallbackRef = (
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
+ (callback) => {
17
+ const callbackRef = React.useRef(callback);
18
+ React.useEffect(() => {
19
+ callbackRef.current = callback;
20
+ });
21
+ return React.useMemo(() => (...args) => {
22
+ var _a;
23
+ return (_a = callbackRef.current) === null || _a === void 0 ? void 0 : _a.call(callbackRef, ...args);
24
+ }, []);
25
+ }
26
+ );
27
+ const useRefProxy = (
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ (targetRef) => {
30
+ const [refElement, setRefElement] = React.useState((targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) || null);
31
+ if (targetRef) {
32
+ setTimeout(() => {
33
+ if (targetRef.current !== refElement) {
34
+ setRefElement(targetRef.current);
54
35
  }
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
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;
69
46
  }
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
47
+ return target[prop];
79
48
  },
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
- ]
49
+ set(target, prop, value) {
50
+ if (prop === "current") {
51
+ setRefElement(value);
52
+ } else {
53
+ target[prop] = value;
54
+ }
55
+ return true;
162
56
  }
163
- ];
164
- }, [project, adminRights, enabled, expertUrl]);
57
+ }), [refElement]);
58
+ return { refProxy, refElement, setRefElement };
59
+ }
60
+ );
61
+ const getDimensions = (entry, box) => {
62
+ if (box === "border-box") {
63
+ return {
64
+ width: entry.borderBoxSize[0].inlineSize,
65
+ height: entry.borderBoxSize[0].blockSize
66
+ };
67
+ }
68
+ if (box === "content-box") {
69
+ return {
70
+ width: entry.contentBoxSize[0].inlineSize,
71
+ height: entry.contentBoxSize[0].blockSize
72
+ };
73
+ }
74
+ return {
75
+ width: entry.contentRect.width,
76
+ height: entry.contentRect.height
77
+ };
165
78
  };
166
79
  export {
167
- useExpertNavigation
80
+ getDimensions,
81
+ patchResizeCallback,
82
+ useCallbackRef,
83
+ useRefProxy
168
84
  };
169
85
  //# sourceMappingURL=harmony124.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"harmony124.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;AAAA,QACL,OAAO;AAAA,QACP,MAAM,GAAG,SAAS,UAAU,QAAQ,U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ACH;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":"harmony124.mjs","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":[],"mappings":";;;AAOK,MAAC,sBAAsB,CAAC,gBAAgB,aAAa,aAAa,mBAAmB;AACtF,UAAQ,aAAW;AAAA,IACf,KAAK;AACD,aAAO,SAAS,gBAAgB,aAAa,cAAc;AAAA,IAC/D,KAAK;AACD,aAAO,SAAS,gBAAgB,aAAa,cAAc;AAAA,IAC/D;AACI,aAAO;AAAA,EACnB;AACA;AAKK,MAAC;AAAA;AAAA,EAEN,CAAC,aAAa;AACV,UA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