@zextras/carbonio-shell-ui 6.0.0 → 7.0.0

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 (461) hide show
  1. package/lib/boot/app/app-context-provider.d.ts +7 -0
  2. package/lib/boot/app/app-context-provider.js +17 -0
  3. package/lib/boot/app/app-context-provider.js.map +1 -0
  4. package/lib/boot/app/app-error-catcher.d.ts +3 -0
  5. package/lib/boot/app/app-error-catcher.js +41 -0
  6. package/lib/boot/app/app-error-catcher.js.map +1 -0
  7. package/lib/boot/app/app-loader-functions.d.ts +37 -0
  8. package/lib/boot/app/app-loader-functions.js +121 -0
  9. package/lib/boot/app/app-loader-functions.js.map +1 -0
  10. package/lib/boot/app/app-loader-setters.d.ts +38 -0
  11. package/lib/boot/app/app-loader-setters.js +46 -0
  12. package/lib/boot/app/app-loader-setters.js.map +1 -0
  13. package/lib/boot/matomo.d.ts +12 -0
  14. package/lib/boot/matomo.js +22 -0
  15. package/lib/boot/matomo.js.map +1 -0
  16. package/lib/boot/module-i18next-provider.d.ts +7 -0
  17. package/lib/boot/module-i18next-provider.js +22 -0
  18. package/lib/boot/module-i18next-provider.js.map +1 -0
  19. package/lib/boot/tracker.d.ts +11 -0
  20. package/lib/boot/tracker.js +57 -0
  21. package/lib/boot/tracker.js.map +1 -0
  22. package/lib/constants/index.d.ts +146 -0
  23. package/lib/constants/index.js +160 -0
  24. package/lib/constants/index.js.map +1 -0
  25. package/lib/constants/locales.d.ts +83 -0
  26. package/lib/constants/locales.js +86 -0
  27. package/lib/constants/locales.js.map +1 -0
  28. package/lib/history/hooks.d.ts +12 -0
  29. package/lib/history/hooks.js +69 -0
  30. package/lib/history/hooks.js.map +1 -0
  31. package/lib/lib.d.ts +74 -0
  32. package/lib/lib.js +134 -0
  33. package/lib/lib.js.map +1 -0
  34. package/lib/network/edit-settings.d.ts +14 -0
  35. package/lib/network/edit-settings.js +144 -0
  36. package/lib/network/edit-settings.js.map +1 -0
  37. package/lib/network/fetch.d.ts +4 -0
  38. package/lib/network/fetch.js +175 -0
  39. package/lib/network/fetch.js.map +1 -0
  40. package/lib/network/tags.d.ts +27 -0
  41. package/lib/network/tags.js +31 -0
  42. package/lib/network/tags.js.map +1 -0
  43. package/lib/network/user-agent.d.ts +1 -0
  44. package/lib/network/user-agent.js +15 -0
  45. package/lib/network/user-agent.js.map +1 -0
  46. package/lib/network/utils.d.ts +2 -0
  47. package/lib/network/utils.js +17 -0
  48. package/lib/network/utils.js.map +1 -0
  49. package/lib/notification/NotificationManager.d.ts +22 -0
  50. package/lib/notification/NotificationManager.js +153 -0
  51. package/lib/notification/NotificationManager.js.map +1 -0
  52. package/lib/reporting/functions.d.ts +2 -0
  53. package/lib/reporting/functions.js +14 -0
  54. package/lib/reporting/functions.js.map +1 -0
  55. package/lib/reporting/store.d.ts +8 -0
  56. package/lib/reporting/store.js +43 -0
  57. package/lib/reporting/store.js.map +1 -0
  58. package/lib/search/run-search.d.ts +2 -0
  59. package/lib/search/run-search.js +17 -0
  60. package/lib/search/run-search.js.map +1 -0
  61. package/lib/search/search-store.d.ts +2 -0
  62. package/lib/search/search-store.js +20 -0
  63. package/lib/search/search-store.js.map +1 -0
  64. package/lib/search/useSearchModule.d.ts +3 -0
  65. package/lib/search/useSearchModule.js +21 -0
  66. package/lib/search/useSearchModule.js.map +1 -0
  67. package/lib/settings/components/settings-header.d.ts +9 -0
  68. package/lib/settings/components/settings-header.js +86 -0
  69. package/lib/settings/components/settings-header.js.map +1 -0
  70. package/lib/shell/hooks/useIsMobile.d.ts +4 -0
  71. package/lib/shell/hooks/useIsMobile.js +22 -0
  72. package/lib/shell/hooks/useIsMobile.js.map +1 -0
  73. package/lib/shell/hooks/useLocalStorage.d.ts +14 -0
  74. package/lib/shell/hooks/useLocalStorage.js +77 -0
  75. package/lib/shell/hooks/useLocalStorage.js.map +1 -0
  76. package/lib/shell/shell-context.d.ts +4 -0
  77. package/lib/shell/shell-context.js +11 -0
  78. package/lib/shell/shell-context.js.map +1 -0
  79. package/lib/store/account/hooks.d.ts +14 -0
  80. package/lib/store/account/hooks.js +51 -0
  81. package/lib/store/account/hooks.js.map +1 -0
  82. package/lib/store/account/index.d.ts +2 -0
  83. package/lib/store/account/index.js +24 -0
  84. package/lib/store/account/index.js.map +1 -0
  85. package/lib/store/account/store.d.ts +2 -0
  86. package/lib/store/account/store.js +23 -0
  87. package/lib/store/account/store.js.map +1 -0
  88. package/lib/store/app/hooks.d.ts +14 -0
  89. package/lib/store/app/hooks.js +41 -0
  90. package/lib/store/app/hooks.js.map +1 -0
  91. package/lib/store/app/index.d.ts +2 -0
  92. package/lib/store/app/index.js +24 -0
  93. package/lib/store/app/index.js.map +1 -0
  94. package/lib/store/app/store.d.ts +44 -0
  95. package/lib/store/app/store.js +265 -0
  96. package/lib/store/app/store.js.map +1 -0
  97. package/lib/store/app/utils.d.ts +10 -0
  98. package/lib/store/app/utils.js +123 -0
  99. package/lib/store/app/utils.js.map +1 -0
  100. package/lib/store/boards/hooks.d.ts +31 -0
  101. package/lib/store/boards/hooks.js +82 -0
  102. package/lib/store/boards/hooks.js.map +1 -0
  103. package/lib/store/boards/index.d.ts +2 -0
  104. package/lib/store/boards/index.js +24 -0
  105. package/lib/store/boards/index.js.map +1 -0
  106. package/lib/store/boards/store.d.ts +23 -0
  107. package/lib/store/boards/store.js +124 -0
  108. package/lib/store/boards/store.js.map +1 -0
  109. package/lib/store/context-bridge.d.ts +11 -0
  110. package/lib/store/context-bridge.js +34 -0
  111. package/lib/store/context-bridge.js.map +1 -0
  112. package/lib/store/folder/hooks.d.ts +21 -0
  113. package/lib/store/folder/hooks.js +77 -0
  114. package/lib/store/folder/hooks.js.map +1 -0
  115. package/lib/store/folder/index.d.ts +2 -0
  116. package/lib/store/folder/index.js +24 -0
  117. package/lib/store/folder/index.js.map +1 -0
  118. package/lib/store/folder/store.d.ts +2 -0
  119. package/lib/store/folder/store.js +20 -0
  120. package/lib/store/folder/store.js.map +1 -0
  121. package/lib/store/folder/utils.d.ts +16 -0
  122. package/lib/store/folder/utils.js +53 -0
  123. package/lib/store/folder/utils.js.map +1 -0
  124. package/lib/store/i18n/hooks.d.ts +4 -0
  125. package/lib/store/i18n/hooks.js +21 -0
  126. package/lib/store/i18n/hooks.js.map +1 -0
  127. package/lib/store/i18n/store.d.ts +13 -0
  128. package/lib/store/i18n/store.js +104 -0
  129. package/lib/store/i18n/store.js.map +1 -0
  130. package/lib/store/integrations/composer.d.ts +49 -0
  131. package/lib/store/integrations/composer.js +233 -0
  132. package/lib/store/integrations/composer.js.map +1 -0
  133. package/lib/store/integrations/getters.d.ts +9 -0
  134. package/lib/store/integrations/getters.js +41 -0
  135. package/lib/store/integrations/getters.js.map +1 -0
  136. package/lib/store/integrations/hooks.d.ts +9 -0
  137. package/lib/store/integrations/hooks.js +42 -0
  138. package/lib/store/integrations/hooks.js.map +1 -0
  139. package/lib/store/integrations/store.d.ts +41 -0
  140. package/lib/store/integrations/store.js +65 -0
  141. package/lib/store/integrations/store.js.map +1 -0
  142. package/lib/store/integrations/utils.d.ts +8 -0
  143. package/lib/store/integrations/utils.js +50 -0
  144. package/lib/store/integrations/utils.js.map +1 -0
  145. package/lib/store/login/getters.d.ts +2 -0
  146. package/lib/store/login/getters.js +18 -0
  147. package/lib/store/login/getters.js.map +1 -0
  148. package/lib/store/login/store.d.ts +12 -0
  149. package/lib/store/login/store.js +18 -0
  150. package/lib/store/login/store.js.map +1 -0
  151. package/lib/store/network/hooks.d.ts +3 -0
  152. package/lib/store/network/hooks.js +14 -0
  153. package/lib/store/network/hooks.js.map +1 -0
  154. package/lib/store/network/index.d.ts +2 -0
  155. package/lib/store/network/index.js +24 -0
  156. package/lib/store/network/index.js.map +1 -0
  157. package/lib/store/network/store.d.ts +2 -0
  158. package/lib/store/network/store.js +15 -0
  159. package/lib/store/network/store.js.map +1 -0
  160. package/lib/store/network/utils.d.ts +13 -0
  161. package/lib/store/network/utils.js +94 -0
  162. package/lib/store/network/utils.js.map +1 -0
  163. package/lib/store/tags/hooks.d.ts +3 -0
  164. package/lib/store/tags/hooks.js +15 -0
  165. package/lib/store/tags/hooks.js.map +1 -0
  166. package/lib/store/tags/index.d.ts +2 -0
  167. package/lib/store/tags/index.js +24 -0
  168. package/lib/store/tags/index.js.map +1 -0
  169. package/lib/store/tags/store.d.ts +2 -0
  170. package/lib/store/tags/store.js +18 -0
  171. package/lib/store/tags/store.js.map +1 -0
  172. package/lib/tsdoc-metadata.json +11 -0
  173. package/lib/types/account/index.d.ts +140 -0
  174. package/lib/types/account/index.js +8 -0
  175. package/lib/types/account/index.js.map +1 -0
  176. package/lib/types/apps/index.d.ts +120 -0
  177. package/lib/types/apps/index.js +9 -0
  178. package/lib/types/apps/index.js.map +1 -0
  179. package/lib/types/boards/index.d.ts +10 -0
  180. package/lib/types/boards/index.js +3 -0
  181. package/lib/types/boards/index.js.map +1 -0
  182. package/lib/types/folder/index.d.ts +29 -0
  183. package/lib/types/folder/index.js +8 -0
  184. package/lib/types/folder/index.js.map +1 -0
  185. package/lib/types/integrations/index.d.ts +8 -0
  186. package/lib/types/integrations/index.js +8 -0
  187. package/lib/types/integrations/index.js.map +1 -0
  188. package/lib/types/misc/index.d.ts +156 -0
  189. package/lib/types/misc/index.js +8 -0
  190. package/lib/types/misc/index.js.map +1 -0
  191. package/lib/types/network/entities.d.ts +47 -0
  192. package/lib/types/network/entities.js +3 -0
  193. package/lib/types/network/entities.js.map +1 -0
  194. package/lib/types/network/index.d.ts +171 -0
  195. package/lib/types/network/index.js +23 -0
  196. package/lib/types/network/index.js.map +1 -0
  197. package/lib/types/network/soap.d.ts +102 -0
  198. package/lib/types/network/soap.js +8 -0
  199. package/lib/types/network/soap.js.map +1 -0
  200. package/lib/types/search/index.d.ts +11 -0
  201. package/lib/types/search/index.js +23 -0
  202. package/lib/types/search/index.js.map +1 -0
  203. package/lib/types/search/items.d.ts +6 -0
  204. package/lib/types/search/items.js +3 -0
  205. package/lib/types/search/items.js.map +1 -0
  206. package/lib/types/tags/index.d.ts +12 -0
  207. package/lib/types/tags/index.js +9 -0
  208. package/lib/types/tags/index.js.map +1 -0
  209. package/lib/types/workers/index.d.ts +17 -0
  210. package/lib/types/workers/index.js +3 -0
  211. package/lib/types/workers/index.js.map +1 -0
  212. package/lib/ui-extras/app-link.d.ts +6 -0
  213. package/lib/ui-extras/app-link.js +40 -0
  214. package/lib/ui-extras/app-link.js.map +1 -0
  215. package/lib/ui-extras/nav-guard.d.ts +9 -0
  216. package/lib/ui-extras/nav-guard.js +96 -0
  217. package/lib/ui-extras/nav-guard.js.map +1 -0
  218. package/lib/ui-extras/spinner.d.ts +2 -0
  219. package/lib/ui-extras/spinner.js +18 -0
  220. package/lib/ui-extras/spinner.js.map +1 -0
  221. package/lib/utils/typeUtils.d.ts +14 -0
  222. package/lib/utils/typeUtils.js +3 -0
  223. package/lib/utils/typeUtils.js.map +1 -0
  224. package/lib/utils/utils.d.ts +20 -0
  225. package/lib/utils/utils.js +39 -0
  226. package/lib/utils/utils.js.map +1 -0
  227. package/lib/workers/index.d.ts +2 -0
  228. package/lib/workers/index.js +15 -0
  229. package/lib/workers/index.js.map +1 -0
  230. package/package.json +34 -37
  231. package/dist/20d012c938e8d0dcc703.mp3 +0 -0
  232. package/dist/2d9c9ae572663301cb7d.js +0 -75391
  233. package/dist/CHANGELOG.md +0 -701
  234. package/dist/carbonio-head.svg +0 -200
  235. package/dist/carbonio.svg +0 -10
  236. package/dist/commit +0 -1
  237. package/dist/component.json +0 -13
  238. package/dist/favicon.png +0 -0
  239. package/dist/files/roboto-cyrillic-300-normal.woff +0 -0
  240. package/dist/files/roboto-cyrillic-300-normal.woff2 +0 -0
  241. package/dist/files/roboto-cyrillic-400-normal.woff +0 -0
  242. package/dist/files/roboto-cyrillic-400-normal.woff2 +0 -0
  243. package/dist/files/roboto-cyrillic-500-normal.woff +0 -0
  244. package/dist/files/roboto-cyrillic-500-normal.woff2 +0 -0
  245. package/dist/files/roboto-cyrillic-700-normal.woff +0 -0
  246. package/dist/files/roboto-cyrillic-700-normal.woff2 +0 -0
  247. package/dist/files/roboto-cyrillic-ext-300-normal.woff +0 -0
  248. package/dist/files/roboto-cyrillic-ext-300-normal.woff2 +0 -0
  249. package/dist/files/roboto-cyrillic-ext-400-normal.woff +0 -0
  250. package/dist/files/roboto-cyrillic-ext-400-normal.woff2 +0 -0
  251. package/dist/files/roboto-cyrillic-ext-500-normal.woff +0 -0
  252. package/dist/files/roboto-cyrillic-ext-500-normal.woff2 +0 -0
  253. package/dist/files/roboto-cyrillic-ext-700-normal.woff +0 -0
  254. package/dist/files/roboto-cyrillic-ext-700-normal.woff2 +0 -0
  255. package/dist/files/roboto-greek-300-normal.woff +0 -0
  256. package/dist/files/roboto-greek-300-normal.woff2 +0 -0
  257. package/dist/files/roboto-greek-400-normal.woff +0 -0
  258. package/dist/files/roboto-greek-400-normal.woff2 +0 -0
  259. package/dist/files/roboto-greek-500-normal.woff +0 -0
  260. package/dist/files/roboto-greek-500-normal.woff2 +0 -0
  261. package/dist/files/roboto-greek-700-normal.woff +0 -0
  262. package/dist/files/roboto-greek-700-normal.woff2 +0 -0
  263. package/dist/files/roboto-greek-ext-300-normal.woff +0 -0
  264. package/dist/files/roboto-greek-ext-300-normal.woff2 +0 -0
  265. package/dist/files/roboto-greek-ext-400-normal.woff +0 -0
  266. package/dist/files/roboto-greek-ext-400-normal.woff2 +0 -0
  267. package/dist/files/roboto-greek-ext-500-normal.woff +0 -0
  268. package/dist/files/roboto-greek-ext-500-normal.woff2 +0 -0
  269. package/dist/files/roboto-greek-ext-700-normal.woff +0 -0
  270. package/dist/files/roboto-greek-ext-700-normal.woff2 +0 -0
  271. package/dist/files/roboto-latin-300-normal.woff +0 -0
  272. package/dist/files/roboto-latin-300-normal.woff2 +0 -0
  273. package/dist/files/roboto-latin-400-normal.woff +0 -0
  274. package/dist/files/roboto-latin-400-normal.woff2 +0 -0
  275. package/dist/files/roboto-latin-500-normal.woff +0 -0
  276. package/dist/files/roboto-latin-500-normal.woff2 +0 -0
  277. package/dist/files/roboto-latin-700-normal.woff +0 -0
  278. package/dist/files/roboto-latin-700-normal.woff2 +0 -0
  279. package/dist/files/roboto-latin-ext-300-normal.woff +0 -0
  280. package/dist/files/roboto-latin-ext-300-normal.woff2 +0 -0
  281. package/dist/files/roboto-latin-ext-400-normal.woff +0 -0
  282. package/dist/files/roboto-latin-ext-400-normal.woff2 +0 -0
  283. package/dist/files/roboto-latin-ext-500-normal.woff +0 -0
  284. package/dist/files/roboto-latin-ext-500-normal.woff2 +0 -0
  285. package/dist/files/roboto-latin-ext-700-normal.woff +0 -0
  286. package/dist/files/roboto-latin-ext-700-normal.woff2 +0 -0
  287. package/dist/files/roboto-vietnamese-300-normal.woff +0 -0
  288. package/dist/files/roboto-vietnamese-300-normal.woff2 +0 -0
  289. package/dist/files/roboto-vietnamese-400-normal.woff +0 -0
  290. package/dist/files/roboto-vietnamese-400-normal.woff2 +0 -0
  291. package/dist/files/roboto-vietnamese-500-normal.woff +0 -0
  292. package/dist/files/roboto-vietnamese-500-normal.woff2 +0 -0
  293. package/dist/files/roboto-vietnamese-700-normal.woff +0 -0
  294. package/dist/files/roboto-vietnamese-700-normal.woff2 +0 -0
  295. package/dist/i18n/ar.json +0 -1
  296. package/dist/i18n/de.json +0 -438
  297. package/dist/i18n/en-US.json +0 -1
  298. package/dist/i18n/en.json +0 -438
  299. package/dist/i18n/es-419.json +0 -1
  300. package/dist/i18n/es.json +0 -438
  301. package/dist/i18n/fa.json +0 -1
  302. package/dist/i18n/fi.json +0 -12
  303. package/dist/i18n/fr.json +0 -438
  304. package/dist/i18n/hi.json +0 -438
  305. package/dist/i18n/hr.json +0 -1
  306. package/dist/i18n/hu.json +0 -31
  307. package/dist/i18n/id.json +0 -438
  308. package/dist/i18n/it.json +0 -438
  309. package/dist/i18n/ja.json +0 -438
  310. package/dist/i18n/ky.json +0 -6
  311. package/dist/i18n/nl.json +0 -438
  312. package/dist/i18n/pl.json +0 -438
  313. package/dist/i18n/pt-PT.json +0 -1
  314. package/dist/i18n/pt.json +0 -438
  315. package/dist/i18n/pt_BR.json +0 -438
  316. package/dist/i18n/ro.json +0 -9
  317. package/dist/i18n/ru.json +0 -438
  318. package/dist/i18n/th.json +0 -438
  319. package/dist/i18n/tr.json +0 -438
  320. package/dist/i18n/uk.json +0 -186
  321. package/dist/i18n/vi.json +0 -396
  322. package/dist/i18n/zh_Hans.json +0 -412
  323. package/dist/index.html +0 -25
  324. package/dist/notification.mp3 +0 -0
  325. package/dist/package/PKGBUILD +0 -45
  326. package/dist/plugins/help/js/i18n/keynav/de.js +0 -90
  327. package/dist/plugins/help/js/i18n/keynav/en.js +0 -90
  328. package/dist/plugins/help/js/i18n/keynav/es.js +0 -90
  329. package/dist/plugins/help/js/i18n/keynav/fr_FR.js +0 -90
  330. package/dist/plugins/help/js/i18n/keynav/hi.js +0 -90
  331. package/dist/plugins/help/js/i18n/keynav/it.js +0 -90
  332. package/dist/plugins/help/js/i18n/keynav/ja.js +0 -90
  333. package/dist/plugins/help/js/i18n/keynav/nl.js +0 -90
  334. package/dist/plugins/help/js/i18n/keynav/pl.js +0 -90
  335. package/dist/plugins/help/js/i18n/keynav/pt_BR.js +0 -90
  336. package/dist/plugins/help/js/i18n/keynav/ro.js +0 -90
  337. package/dist/plugins/help/js/i18n/keynav/ru.js +0 -90
  338. package/dist/plugins/help/js/i18n/keynav/th_TH.js +0 -90
  339. package/dist/plugins/help/js/i18n/keynav/tr.js +0 -90
  340. package/dist/plugins/help/js/i18n/keynav/vi.js +0 -90
  341. package/dist/skins/content/dark/content.css +0 -59
  342. package/dist/skins/content/dark/content.min.css +0 -8
  343. package/dist/skins/content/default/content.css +0 -49
  344. package/dist/skins/content/default/content.min.css +0 -8
  345. package/dist/skins/content/document/content.css +0 -53
  346. package/dist/skins/content/document/content.min.css +0 -8
  347. package/dist/skins/content/writer/content.css +0 -50
  348. package/dist/skins/content/writer/content.min.css +0 -8
  349. package/dist/skins/ui/oxide/content.css +0 -615
  350. package/dist/skins/ui/oxide/content.inline.css +0 -608
  351. package/dist/skins/ui/oxide/content.inline.min.css +0 -8
  352. package/dist/skins/ui/oxide/content.min.css +0 -8
  353. package/dist/skins/ui/oxide/content.mobile.css +0 -29
  354. package/dist/skins/ui/oxide/content.mobile.min.css +0 -8
  355. package/dist/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  356. package/dist/skins/ui/oxide/skin.css +0 -2884
  357. package/dist/skins/ui/oxide/skin.min.css +0 -8
  358. package/dist/skins/ui/oxide/skin.mobile.css +0 -673
  359. package/dist/skins/ui/oxide/skin.mobile.min.css +0 -8
  360. package/dist/skins/ui/oxide-dark/content.css +0 -596
  361. package/dist/skins/ui/oxide-dark/content.inline.css +0 -608
  362. package/dist/skins/ui/oxide-dark/content.inline.min.css +0 -8
  363. package/dist/skins/ui/oxide-dark/content.min.css +0 -8
  364. package/dist/skins/ui/oxide-dark/content.mobile.css +0 -29
  365. package/dist/skins/ui/oxide-dark/content.mobile.min.css +0 -8
  366. package/dist/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  367. package/dist/skins/ui/oxide-dark/skin.css +0 -2884
  368. package/dist/skins/ui/oxide-dark/skin.min.css +0 -8
  369. package/dist/skins/ui/oxide-dark/skin.mobile.css +0 -673
  370. package/dist/skins/ui/oxide-dark/skin.mobile.min.css +0 -8
  371. package/dist/src_boot_bootstrapper_tsx-node_modules_moment_locale_sync_recursive_.css +0 -21
  372. package/dist/src_boot_bootstrapper_tsx-node_modules_moment_locale_sync_recursive_.css.map +0 -1
  373. package/dist/src_boot_bootstrapper_tsx-node_modules_moment_locale_sync_recursive_.d07f086d.chunk.js +0 -13399
  374. package/dist/src_boot_bootstrapper_tsx-node_modules_moment_locale_sync_recursive_.d07f086d.chunk.js.map +0 -1
  375. package/dist/src_workers_folder_ts.2df69eae.chunk.js +0 -537
  376. package/dist/src_workers_folder_ts.2df69eae.chunk.js.map +0 -1
  377. package/dist/src_workers_tag_ts.59a752d7.chunk.js +0 -113
  378. package/dist/src_workers_tag_ts.59a752d7.chunk.js.map +0 -1
  379. package/dist/style.a7eb9e6c.css +0 -389
  380. package/dist/style.a7eb9e6c.css.map +0 -1
  381. package/dist/tinymce/langs/de.js +0 -1
  382. package/dist/tinymce/langs/es.js +0 -1
  383. package/dist/tinymce/langs/fr_FR.js +0 -1
  384. package/dist/tinymce/langs/hi.js +0 -1
  385. package/dist/tinymce/langs/it.js +0 -1
  386. package/dist/tinymce/langs/ja.js +0 -1
  387. package/dist/tinymce/langs/nl.js +0 -1
  388. package/dist/tinymce/langs/pl.js +0 -1
  389. package/dist/tinymce/langs/pt_BR.js +0 -1
  390. package/dist/tinymce/langs/ro.js +0 -1
  391. package/dist/tinymce/langs/ru.js +0 -1
  392. package/dist/tinymce/langs/th_TH.js +0 -1
  393. package/dist/tinymce/langs/tr.js +0 -1
  394. package/dist/tinymce/langs/vi.js +0 -1
  395. package/dist/tinymce/langs/zh-Hans.js +0 -1
  396. package/dist/vendors-node_modules_date-fns__lib_isSameUTCWeek_index_js-node_modules_date-fns_locale__lib_b-41ea83.3e405109.chunk.js +0 -412
  397. package/dist/vendors-node_modules_date-fns__lib_isSameUTCWeek_index_js-node_modules_date-fns_locale__lib_b-41ea83.3e405109.chunk.js.map +0 -1
  398. package/dist/vendors-node_modules_date-fns_locale_de_index_js.42fc0cb6.chunk.js +0 -787
  399. package/dist/vendors-node_modules_date-fns_locale_de_index_js.42fc0cb6.chunk.js.map +0 -1
  400. package/dist/vendors-node_modules_date-fns_locale_en-US_index_js.1575ad91.chunk.js +0 -693
  401. package/dist/vendors-node_modules_date-fns_locale_en-US_index_js.1575ad91.chunk.js.map +0 -1
  402. package/dist/vendors-node_modules_date-fns_locale_es_index_js.a054d7dc.chunk.js +0 -685
  403. package/dist/vendors-node_modules_date-fns_locale_es_index_js.a054d7dc.chunk.js.map +0 -1
  404. package/dist/vendors-node_modules_date-fns_locale_fr_index_js.20eefc5f.chunk.js +0 -644
  405. package/dist/vendors-node_modules_date-fns_locale_fr_index_js.20eefc5f.chunk.js.map +0 -1
  406. package/dist/vendors-node_modules_date-fns_locale_hi_index_js.016d9c1b.chunk.js +0 -741
  407. package/dist/vendors-node_modules_date-fns_locale_hi_index_js.016d9c1b.chunk.js.map +0 -1
  408. package/dist/vendors-node_modules_date-fns_locale_it_index_js.b1509e74.chunk.js +0 -531
  409. package/dist/vendors-node_modules_date-fns_locale_it_index_js.b1509e74.chunk.js.map +0 -1
  410. package/dist/vendors-node_modules_date-fns_locale_ja_index_js.7ee709ea.chunk.js +0 -703
  411. package/dist/vendors-node_modules_date-fns_locale_ja_index_js.7ee709ea.chunk.js.map +0 -1
  412. package/dist/vendors-node_modules_date-fns_locale_nl_index_js.03ea6284.chunk.js +0 -638
  413. package/dist/vendors-node_modules_date-fns_locale_nl_index_js.03ea6284.chunk.js.map +0 -1
  414. package/dist/vendors-node_modules_date-fns_locale_pl_index_js.b1a781fa.chunk.js +0 -623
  415. package/dist/vendors-node_modules_date-fns_locale_pl_index_js.b1a781fa.chunk.js.map +0 -1
  416. package/dist/vendors-node_modules_date-fns_locale_pt-BR_index_js.695bc207.chunk.js +0 -682
  417. package/dist/vendors-node_modules_date-fns_locale_pt-BR_index_js.695bc207.chunk.js.map +0 -1
  418. package/dist/vendors-node_modules_date-fns_locale_pt_index_js.09460edb.chunk.js +0 -678
  419. package/dist/vendors-node_modules_date-fns_locale_pt_index_js.09460edb.chunk.js.map +0 -1
  420. package/dist/vendors-node_modules_date-fns_locale_ro_index_js.53425395.chunk.js +0 -670
  421. package/dist/vendors-node_modules_date-fns_locale_ro_index_js.53425395.chunk.js.map +0 -1
  422. package/dist/vendors-node_modules_date-fns_locale_ru_index_js.ab8b44d9.chunk.js +0 -707
  423. package/dist/vendors-node_modules_date-fns_locale_ru_index_js.ab8b44d9.chunk.js.map +0 -1
  424. package/dist/vendors-node_modules_date-fns_locale_th_index_js.9f2448ee.chunk.js +0 -672
  425. package/dist/vendors-node_modules_date-fns_locale_th_index_js.9f2448ee.chunk.js.map +0 -1
  426. package/dist/vendors-node_modules_date-fns_locale_tr_index_js.c47c86fa.chunk.js +0 -677
  427. package/dist/vendors-node_modules_date-fns_locale_tr_index_js.c47c86fa.chunk.js.map +0 -1
  428. package/dist/vendors-node_modules_date-fns_locale_vi_index_js.d02adf1c.chunk.js +0 -765
  429. package/dist/vendors-node_modules_date-fns_locale_vi_index_js.d02adf1c.chunk.js.map +0 -1
  430. package/dist/vendors-node_modules_date-fns_locale_zh-CN_index_js.505f5507.chunk.js +0 -521
  431. package/dist/vendors-node_modules_date-fns_locale_zh-CN_index_js.505f5507.chunk.js.map +0 -1
  432. package/dist/vendors-node_modules_lodash_lodash_js-node_modules_core-js_modules_es_array_push_js.8ced7511.chunk.js +0 -19112
  433. package/dist/vendors-node_modules_lodash_lodash_js-node_modules_core-js_modules_es_array_push_js.8ced7511.chunk.js.map +0 -1
  434. package/dist/vendors-node_modules_tinymce_skins_ui_oxide_skin_min_css-node_modules_reduxjs_toolkit_dist_re-f60063.88e81e25.chunk.js +0 -219343
  435. package/dist/vendors-node_modules_tinymce_skins_ui_oxide_skin_min_css-node_modules_reduxjs_toolkit_dist_re-f60063.88e81e25.chunk.js.map +0 -1
  436. package/dist/vendors-node_modules_tinymce_skins_ui_oxide_skin_min_css-node_modules_reduxjs_toolkit_dist_re-f60063.css +0 -4104
  437. package/dist/vendors-node_modules_tinymce_skins_ui_oxide_skin_min_css-node_modules_reduxjs_toolkit_dist_re-f60063.css.map +0 -1
  438. package/dist/yap.json +0 -11
  439. package/dist/zapp-shell.bundle.js +0 -30430
  440. package/dist/zapp-shell.bundle.js.map +0 -1
  441. package/types/account/index.d.ts +0 -179
  442. package/types/apps/index.d.ts +0 -198
  443. package/types/boards/index.d.ts +0 -31
  444. package/types/exports/index.d.ts +0 -256
  445. package/types/folder/index.d.ts +0 -33
  446. package/types/i18n/index.d.ts +0 -19
  447. package/types/index.d.ts +0 -20
  448. package/types/integrations/index.d.ts +0 -41
  449. package/types/loginConfig/index.d.ts +0 -17
  450. package/types/misc/index.d.ts +0 -309
  451. package/types/network/entities.d.ts +0 -106
  452. package/types/network/index.d.ts +0 -239
  453. package/types/network/soap.d.ts +0 -106
  454. package/types/notification/index.d.ts +0 -31
  455. package/types/search/index.d.ts +0 -18
  456. package/types/search/items.d.ts +0 -13
  457. package/types/settings/index.d.ts +0 -10
  458. package/types/styled-components.d.ts +0 -18
  459. package/types/tags/index.d.ts +0 -21
  460. package/types/theme/index.d.ts +0 -9
  461. package/types/workers/index.d.ts +0 -24
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /*
3
+ * SPDX-FileCopyrightText: 2021 Zextras <https://www.zextras.com>
4
+ *
5
+ * SPDX-License-Identifier: AGPL-3.0-only
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.goTo = exports.goToLogin = void 0;
9
+ function goToLogin() {
10
+ window.location.assign(`${window.location.origin}/static/login`);
11
+ }
12
+ exports.goToLogin = goToLogin;
13
+ function goTo(location) {
14
+ window.location.assign(location);
15
+ }
16
+ exports.goTo = goTo;
17
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/network/utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,SAAgB,SAAS;IACxB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,eAAe,CAAC,CAAC;AAClE,CAAC;AAFD,8BAEC;AAED,SAAgB,IAAI,CAAC,QAAgB;IACpC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAFD,oBAEC"}
@@ -0,0 +1,22 @@
1
+ export type PopupNotificationConfig = {
2
+ title?: string;
3
+ message?: string;
4
+ icon?: string;
5
+ vibrate?: Array<number>;
6
+ tag?: string;
7
+ onClick?: (event: Event) => void;
8
+ };
9
+ export type AudioNotificationConfig = {
10
+ sound?: string;
11
+ };
12
+ export type NotificationConfig = {
13
+ showPopup?: boolean;
14
+ playSound?: boolean;
15
+ } & PopupNotificationConfig & AudioNotificationConfig;
16
+ export interface INotificationManager {
17
+ playSound: (config: AudioNotificationConfig) => void;
18
+ showPopup: (config: PopupNotificationConfig) => void;
19
+ notify: (config: NotificationConfig) => void;
20
+ multipleNotify: (config: NotificationConfig[]) => void;
21
+ }
22
+ export declare const getNotificationManager: () => INotificationManager;
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ /*
3
+ * SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com>
4
+ *
5
+ * SPDX-License-Identifier: AGPL-3.0-only
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.getNotificationManager = void 0;
12
+ const lodash_1 = require("lodash");
13
+ const notification_mp3_1 = __importDefault(require("../../assets/notification.mp3"));
14
+ const getters_1 = require("../store/login/getters");
15
+ /**
16
+ * The main goals of the NotificationManager are:
17
+ * - to provide a single and rich implementation for all the Carbonio modules,
18
+ * reducing the boilerplate code needed to send a notification to the user
19
+ * - to optimize the audio notifications avoiding to spam the same sound file
20
+ * in a short period of time
21
+ * - to act as a collector for all the notification (for possible future
22
+ * implementations)
23
+ *
24
+ * In order to reduce the effort needed to send a notification the class
25
+ * provided a set of default values/assets (e.g. icon, sound, title, ...)
26
+ *
27
+ * The class is provided as a singleton
28
+ */
29
+ class NotificationManager {
30
+ static instance;
31
+ /**
32
+ * Minimum time (ms) to wait before the same audio file will be played
33
+ * @private
34
+ */
35
+ static DEBOUNCE_TIME = 1000;
36
+ /**
37
+ * Default configuration for the popup-only notification
38
+ * @private
39
+ */
40
+ PopupNotificationDefaultConfig = {
41
+ title: '',
42
+ vibrate: [200, 100, 200],
43
+ icon: (0, getters_1.getFavicon)()
44
+ };
45
+ /**
46
+ * Default configuration for the audio-only notification
47
+ * @private
48
+ */
49
+ AudioNotificationDefaultConfig = {
50
+ sound: notification_mp3_1.default
51
+ };
52
+ /**
53
+ * Default configuration for a notification with both popup and audio
54
+ * @private
55
+ */
56
+ NotificationDefaultConfig = {
57
+ ...this.PopupNotificationDefaultConfig,
58
+ ...this.AudioNotificationDefaultConfig,
59
+ showPopup: true,
60
+ playSound: false
61
+ };
62
+ /**
63
+ * Map of functions to play a specific audio file
64
+ * @private
65
+ */
66
+ functions = new Map();
67
+ /**
68
+ * Gets or creates the (debounced) function to play the audio file
69
+ * @param sound - relative path to the audio file to play
70
+ */
71
+ getAudioFileFunction = (sound) => {
72
+ if (!this.functions.has(sound)) {
73
+ this.functions.set(sound, (0, lodash_1.debounce)(() => {
74
+ new Audio(sound).play().then();
75
+ this.functions.delete(sound);
76
+ }, NotificationManager.DEBOUNCE_TIME));
77
+ }
78
+ const result = this.functions.get(sound);
79
+ return result ?? lodash_1.noop;
80
+ };
81
+ /**
82
+ * Executes the debounced function to play the audio file
83
+ * @param config - Configuration for the audio notification. In case of
84
+ * missing properties default values are used
85
+ */
86
+ playSound = (config) => {
87
+ const defConfig = {
88
+ ...this.AudioNotificationDefaultConfig,
89
+ ...config
90
+ };
91
+ if (!defConfig.sound) {
92
+ return;
93
+ }
94
+ this.getAudioFileFunction(defConfig.sound)();
95
+ };
96
+ /**
97
+ * Shows a popup notification
98
+ * @param config - Configuration for the popup notification. In case of
99
+ * missing properties default values are used
100
+ */
101
+ showPopup = (config) => {
102
+ const defConfig = {
103
+ ...this.PopupNotificationDefaultConfig,
104
+ ...config
105
+ };
106
+ const n = new Notification(defConfig.title, {
107
+ body: defConfig.message,
108
+ vibrate: defConfig.vibrate,
109
+ icon: defConfig.icon,
110
+ tag: defConfig?.tag
111
+ });
112
+ if (defConfig.onClick) {
113
+ n.addEventListener('click', defConfig.onClick);
114
+ }
115
+ };
116
+ /**
117
+ * Sends a popup/audio notification to the user
118
+ * @param config - Configuration for the notification. In case of
119
+ * missing properties default values are used
120
+ */
121
+ notify = (config) => {
122
+ const defConfig = {
123
+ ...this.NotificationDefaultConfig,
124
+ ...config
125
+ };
126
+ if (defConfig?.showPopup) {
127
+ this.showPopup(defConfig);
128
+ }
129
+ if (defConfig?.playSound) {
130
+ this.playSound(defConfig);
131
+ }
132
+ };
133
+ /**
134
+ * Sends multiple notifications
135
+ * @param config - Array of configurations for the notifications. In case of
136
+ * missing properties default values are used
137
+ */
138
+ multipleNotify = (config) => {
139
+ config.forEach((conf) => this.notify(conf));
140
+ };
141
+ /**
142
+ * Return the singleton instance
143
+ */
144
+ static getInstance() {
145
+ if (!NotificationManager.instance) {
146
+ NotificationManager.instance = new NotificationManager();
147
+ }
148
+ return NotificationManager.instance;
149
+ }
150
+ }
151
+ const getNotificationManager = () => NotificationManager.getInstance();
152
+ exports.getNotificationManager = getNotificationManager;
153
+ //# sourceMappingURL=NotificationManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationManager.js","sourceRoot":"","sources":["../../src/notification/NotificationManager.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,mCAAwC;AAExC,qFAAyD;AACzD,oDAAoD;AA4BpD;;;;;;;;;;;;;GAaG;AACH,MAAM,mBAAmB;IAChB,MAAM,CAAC,QAAQ,CAAsB;IAE7C;;;OAGG;IACK,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC;IAEpC;;;OAGG;IACK,8BAA8B,GAAG;QACxC,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;QACxB,IAAI,EAAE,IAAA,oBAAU,GAAE;KAClB,CAAC;IAEF;;;OAGG;IACK,8BAA8B,GAA4B;QACjE,KAAK,EAAE,0BAAY;KACnB,CAAC;IAEF;;;OAGG;IACK,yBAAyB,GAAuB;QACvD,GAAG,IAAI,CAAC,8BAA8B;QACtC,GAAG,IAAI,CAAC,8BAA8B;QACtC,SAAS,EAAE,IAAI;QACf,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OAAO;YAC1B,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,GAAG,EAAE,SAAS,EAAE,GAAG;SACnB,CAAC,CAAC;QAEH,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;YACvB,CAAC,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;IACF,CAAC,CAAC;IAEF;;;;OAIG;IACI,MAAM,GAAG,CAAC,MAA0B,EAAQ,EAAE;QACpD,MAAM,SAAS,GAAG;YACjB,GAAG,IAAI,CAAC,yBAAyB;YACjC,GAAG,MAAM;SACT,CAAC;QAEF,IAAI,SAAS,EAAE,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QAED,IAAI,SAAS,EAAE,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC,CAAC;IAEF;;;;OAIG;IACI,cAAc,GAAG,CAAC,MAA4B,EAAQ,EAAE;QAC9D,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC;IAEF;;OAEG;IACI,MAAM,CAAC,WAAW;QACxB,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC;YACnC,mBAAmB,CAAC,QAAQ,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAC1D,CAAC;QAED,OAAO,mBAAmB,CAAC,QAAQ,CAAC;IACrC,CAAC;;AAGK,MAAM,sBAAsB,GAAG,GAAyB,EAAE,CAAC,mBAAmB,CAAC,WAAW,EAAE,CAAC;AAAvF,QAAA,sBAAsB,0BAAiE"}
@@ -0,0 +1,2 @@
1
+ import type { Event, EventHint } from '@sentry/browser';
2
+ export declare const report: (appId: string) => (error: Event, hint?: EventHint) => string;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.report = void 0;
4
+ const store_1 = require("./store");
5
+ const report = (appId) => (error, hint) => {
6
+ const reporter = store_1.useReporter.getState();
7
+ const eventId = reporter.clients[appId]?.captureException(error, { ...hint });
8
+ if (eventId) {
9
+ console.info('Reported event ', eventId);
10
+ }
11
+ return eventId;
12
+ };
13
+ exports.report = report;
14
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/reporting/functions.ts"],"names":[],"mappings":";;;AAOA,mCAAsC;AAE/B,MAAM,MAAM,GAClB,CAAC,KAAa,EAAE,EAAE,CAClB,CAAC,KAAY,EAAE,IAAgB,EAAU,EAAE;IAC1C,MAAM,QAAQ,GAAG,mBAAW,CAAC,QAAQ,EAAE,CAAC;IACxC,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC9E,IAAI,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AATU,QAAA,MAAM,UAShB"}
@@ -0,0 +1,8 @@
1
+ import { Hub } from '@sentry/browser';
2
+ import type { CarbonioModule } from '../types/apps';
3
+ type ReporterState = {
4
+ clients: Record<string, Hub>;
5
+ setClients: (apps: Array<CarbonioModule>) => void;
6
+ };
7
+ export declare const useReporter: import("zustand").UseBoundStore<import("zustand").StoreApi<ReporterState>>;
8
+ export {};
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /*
3
+ * SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com>
4
+ *
5
+ * SPDX-License-Identifier: AGPL-3.0-only
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.useReporter = void 0;
9
+ const browser_1 = require("@sentry/browser");
10
+ const lodash_1 = require("lodash");
11
+ const zustand_1 = require("zustand");
12
+ const constants_1 = require("../constants");
13
+ exports.useReporter = (0, zustand_1.create)()((set) => ({
14
+ clients: {
15
+ [constants_1.SHELL_APP_ID]: new browser_1.Hub(new browser_1.BrowserClient({
16
+ transport: browser_1.makeFetchTransport,
17
+ stackParser: browser_1.defaultStackParser,
18
+ integrations: browser_1.defaultIntegrations,
19
+ dsn: constants_1.SENTRY_SHELL_DSN,
20
+ release: '0',
21
+ maxValueLength: 500
22
+ }))
23
+ },
24
+ setClients: (apps) => {
25
+ set((s) => ({
26
+ clients: (0, lodash_1.reduce)(apps, (acc, app) => {
27
+ if (app.sentryDsn) {
28
+ // eslint-disable-next-line no-param-reassign
29
+ s.clients[app.name] = new browser_1.Hub(new browser_1.BrowserClient({
30
+ transport: browser_1.makeFetchTransport,
31
+ stackParser: browser_1.defaultStackParser,
32
+ integrations: browser_1.defaultIntegrations,
33
+ dsn: app.sentryDsn,
34
+ release: app.version,
35
+ maxValueLength: 500
36
+ }));
37
+ }
38
+ return acc;
39
+ }, s.clients)
40
+ }));
41
+ }
42
+ }));
43
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/reporting/store.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6CAMyB;AACzB,mCAAgC;AAChC,qCAAiC;AAEjC,4CAA8D;AAQjD,QAAA,WAAW,GAAG,IAAA,gBAAM,GAAiB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5D,OAAO,EAAE;QACR,CAAC,wBAAY,CAAC,EAAE,IAAI,aAAG,CACtB,IAAI,uBAAa,CAAC;YACjB,SAAS,EAAE,4BAAkB;YAC7B,WAAW,EAAE,4BAAkB;YAC/B,YAAY,EAAE,6BAAmB;YACjC,GAAG,EAAE,4BAAgB;YACrB,OAAO,EAAE,GAAG;YACZ,cAAc,EAAE,GAAG;SACnB,CAAC,CACF;KACD;IACD,UAAU,EAAE,CAAC,IAAI,EAAQ,EAAE;QAC1B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACX,OAAO,EAAE,IAAA,eAAM,EACd,IAAI,EACJ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;gBACZ,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;oBACnB,6CAA6C;oBAC7C,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,aAAG,CAC5B,IAAI,uBAAa,CAAC;wBACjB,SAAS,EAAE,4BAAkB;wBAC7B,WAAW,EAAE,4BAAkB;wBAC/B,YAAY,EAAE,6BAAmB;wBACjC,GAAG,EAAE,GAAG,CAAC,SAAS;wBAClB,OAAO,EAAE,GAAG,CAAC,OAAO;wBACpB,cAAc,EAAE,GAAG;qBACnB,CAAC,CACF,CAAC;gBACH,CAAC;gBACD,OAAO,GAAG,CAAC;YACZ,CAAC,EACD,CAAC,CAAC,OAAO,CACT;SACD,CAAC,CAAC,CAAC;IACL,CAAC;CACD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { QueryChip } from '../types/search';
2
+ export declare const runSearch: (query: Array<QueryChip>, module: string) => void;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runSearch = void 0;
4
+ /*
5
+ * SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com>
6
+ *
7
+ * SPDX-License-Identifier: AGPL-3.0-only
8
+ */
9
+ const search_store_1 = require("./search-store");
10
+ const constants_1 = require("../constants");
11
+ const hooks_1 = require("../history/hooks");
12
+ const runSearch = (query, module) => {
13
+ search_store_1.useSearchStore.setState({ query, module, searchDisabled: false });
14
+ (0, hooks_1.pushHistory)({ route: constants_1.SEARCH_APP_ID, path: '' });
15
+ };
16
+ exports.runSearch = runSearch;
17
+ //# sourceMappingURL=run-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-search.js","sourceRoot":"","sources":["../../src/search/run-search.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,iDAAgD;AAChD,4CAA6C;AAC7C,4CAA+C;AAGxC,MAAM,SAAS,GAAG,CAAC,KAAuB,EAAE,MAAc,EAAQ,EAAE;IAC1E,6BAAc,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,IAAA,mBAAW,EAAC,EAAE,KAAK,EAAE,yBAAa,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC,CAAC;AAHW,QAAA,SAAS,aAGpB"}
@@ -0,0 +1,2 @@
1
+ import type { SearchState } from '../types/search';
2
+ export declare const useSearchStore: import("zustand").UseBoundStore<import("zustand").StoreApi<SearchState>>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /*
3
+ * SPDX-FileCopyrightText: 2021 Zextras <https://www.zextras.com>
4
+ *
5
+ * SPDX-License-Identifier: AGPL-3.0-only
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.useSearchStore = void 0;
9
+ const lodash_1 = require("lodash");
10
+ const zustand_1 = require("zustand");
11
+ // extra currying as suggested in https://github.com/pmndrs/zustand/blob/main/docs/guides/typescript.md#basic-usage
12
+ exports.useSearchStore = (0, zustand_1.create)()((set, get) => ({
13
+ query: [],
14
+ searchDisabled: false,
15
+ tooltip: undefined,
16
+ setSearchDisabled: (searchDisabled, tooltip) => set({ searchDisabled, tooltip }),
17
+ updateQuery: (query) => set({ query: (0, lodash_1.isFunction)(query) ? query(get().query) : query }),
18
+ updateModule: (module) => set({ module })
19
+ }));
20
+ //# sourceMappingURL=search-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-store.js","sourceRoot":"","sources":["../../src/search/search-store.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mCAAoC;AACpC,qCAAiC;AAIjC,mHAAmH;AACtG,QAAA,cAAc,GAAG,IAAA,gBAAM,GAAe,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IAClE,KAAK,EAAE,EAAE;IACT,cAAc,EAAE,KAAK;IACrB,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,CAAC,cAAuB,EAAE,OAAgB,EAAQ,EAAE,CACtE,GAAG,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC;IACjC,WAAW,EAAE,CAAC,KAAqE,EAAQ,EAAE,CAC5F,GAAG,CAAC,EAAE,KAAK,EAAE,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IAC/D,YAAY,EAAE,CAAC,MAAc,EAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CACvD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const SEARCH_MODULE_KEY = "search_module";
2
+ export declare const setSearchModule: (newModule: string) => void;
3
+ export declare const useSearchModule: () => [module: string | undefined, setModule: (module: string) => void];
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /*
3
+ * SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com>
4
+ *
5
+ * SPDX-License-Identifier: AGPL-3.0-only
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.useSearchModule = exports.setSearchModule = exports.SEARCH_MODULE_KEY = void 0;
9
+ const search_store_1 = require("./search-store");
10
+ exports.SEARCH_MODULE_KEY = 'search_module';
11
+ const setSearchModule = (newModule) => {
12
+ sessionStorage.setItem(exports.SEARCH_MODULE_KEY, newModule);
13
+ search_store_1.useSearchStore.getState().updateModule(newModule);
14
+ };
15
+ exports.setSearchModule = setSearchModule;
16
+ const useSearchModule = () => {
17
+ const { module } = (0, search_store_1.useSearchStore)();
18
+ return [module ?? sessionStorage.getItem(exports.SEARCH_MODULE_KEY) ?? undefined, exports.setSearchModule];
19
+ };
20
+ exports.useSearchModule = useSearchModule;
21
+ //# sourceMappingURL=useSearchModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchModule.js","sourceRoot":"","sources":["../../src/search/useSearchModule.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iDAAgD;AAEnC,QAAA,iBAAiB,GAAG,eAAe,CAAC;AAE1C,MAAM,eAAe,GAAG,CAAC,SAAiB,EAAQ,EAAE;IAC1D,cAAc,CAAC,OAAO,CAAC,yBAAiB,EAAE,SAAS,CAAC,CAAC;IACrD,6BAAc,CAAC,QAAQ,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;AACnD,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B;AACK,MAAM,eAAe,GAAG,GAG7B,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,6BAAc,GAAE,CAAC;IAEpC,OAAO,CAAC,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,yBAAiB,CAAC,IAAI,SAAS,EAAE,uBAAe,CAAC,CAAC;AAC5F,CAAC,CAAC;AAPW,QAAA,eAAe,mBAO1B"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { RouteLeavingGuardProps } from '../../ui-extras/nav-guard';
3
+ export type SettingsHeaderProps = {
4
+ title: string;
5
+ onSave: RouteLeavingGuardProps['onSave'];
6
+ onCancel: () => void;
7
+ isDirty: boolean;
8
+ };
9
+ export declare const SettingsHeader: ({ onSave, onCancel, isDirty, title }: SettingsHeaderProps) => React.JSX.Element;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /*
3
+ * SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com>
4
+ *
5
+ * SPDX-License-Identifier: AGPL-3.0-only
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __importStar = (this && this.__importStar) || function (mod) {
24
+ if (mod && mod.__esModule) return mod;
25
+ var result = {};
26
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
27
+ __setModuleDefault(result, mod);
28
+ return result;
29
+ };
30
+ var __importDefault = (this && this.__importDefault) || function (mod) {
31
+ return (mod && mod.__esModule) ? mod : { "default": mod };
32
+ };
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.SettingsHeader = void 0;
35
+ const react_1 = __importStar(require("react"));
36
+ const carbonio_design_system_1 = require("@zextras/carbonio-design-system");
37
+ const react_router_dom_1 = require("react-router-dom");
38
+ const styled_components_1 = __importDefault(require("styled-components"));
39
+ const hooks_1 = require("../../store/i18n/hooks");
40
+ const nav_guard_1 = require("../../ui-extras/nav-guard");
41
+ const CustomBreadcrumbs = (0, styled_components_1.default)(carbonio_design_system_1.Breadcrumbs) `
42
+ .breadcrumbCrumb {
43
+ cursor: default;
44
+ }
45
+ `;
46
+ const SettingsHeader = ({ onSave, onCancel, isDirty, title }) => {
47
+ const t = (0, hooks_1.getT)();
48
+ const history = (0, react_router_dom_1.useHistory)();
49
+ const params = (0, react_router_dom_1.useParams)();
50
+ const crumbs = (0, react_1.useMemo)(() => [
51
+ {
52
+ id: 'settings',
53
+ label: t('settings.app', 'Settings'),
54
+ className: 'breadcrumbCrumb'
55
+ },
56
+ {
57
+ id: 'general',
58
+ label: title,
59
+ className: 'breadcrumbCrumb'
60
+ }
61
+ ], [t, title]);
62
+ const search = history.location?.search;
63
+ (0, react_1.useEffect)(() => {
64
+ if (search) {
65
+ // TODO: why not using anchor links instead of js?
66
+ setTimeout(() => document
67
+ .querySelector(`#${history.location.search}`.replace('?section=', ''))
68
+ ?.scrollIntoView(), 1);
69
+ }
70
+ }, [history, history.location, history.location.search, search, params]);
71
+ return (react_1.default.createElement(react_1.default.Fragment, null,
72
+ react_1.default.createElement(nav_guard_1.RouteLeavingGuard, { when: isDirty, onSave: onSave },
73
+ react_1.default.createElement(carbonio_design_system_1.Text, null, t('label.unsaved_changes_line1', 'Are you sure you want to leave this page without saving?')),
74
+ react_1.default.createElement(carbonio_design_system_1.Text, null, t('label.unsaved_changes_line2', 'All your unsaved changes will be lost'))),
75
+ react_1.default.createElement(carbonio_design_system_1.Container, { orientation: "vertical", mainAlignment: "space-around", background: 'gray5', height: "fit" },
76
+ react_1.default.createElement(carbonio_design_system_1.Row, { orientation: "horizontal", width: "100%" },
77
+ react_1.default.createElement(carbonio_design_system_1.Row, { padding: { all: 'small' }, mainAlignment: "flex-start", width: "50%", crossAlignment: "flex-start" },
78
+ react_1.default.createElement(CustomBreadcrumbs, { crumbs: crumbs })),
79
+ react_1.default.createElement(carbonio_design_system_1.Row, { padding: { all: 'small' }, width: "50%", mainAlignment: "flex-end", crossAlignment: "flex-end" },
80
+ react_1.default.createElement(carbonio_design_system_1.Padding, { right: "small" },
81
+ react_1.default.createElement(carbonio_design_system_1.Button, { label: t('label.discard_changes', 'DISCARD CHANGES'), onClick: onCancel, color: "secondary", disabled: !isDirty })),
82
+ react_1.default.createElement(carbonio_design_system_1.Button, { label: t('label.save', 'Save'), color: "primary", onClick: onSave, disabled: !isDirty })))),
83
+ react_1.default.createElement(carbonio_design_system_1.Divider, null)));
84
+ };
85
+ exports.SettingsHeader = SettingsHeader;
86
+ //# sourceMappingURL=settings-header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-header.js","sourceRoot":"","sources":["../../../src/settings/components/settings-header.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAkD;AAElD,4EASyC;AACzC,uDAAyD;AACzD,0EAAuC;AAEvC,kDAA8C;AAE9C,yDAA8D;AAE9D,MAAM,iBAAiB,GAAG,IAAA,2BAAM,EAAC,oCAAW,CAAC,CAAA;;;;CAI5C,CAAC;AASK,MAAM,cAAc,GAAG,CAAC,EAC9B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,KAAK,EACgB,EAAqB,EAAE;IAC5C,MAAM,CAAC,GAAG,IAAA,YAAI,GAAE,CAAC;IACjB,MAAM,OAAO,GAAG,IAAA,6BAAU,GAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,4BAAS,GAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,IAAA,eAAO,EACrB,GAAY,EAAE,CAAC;QACd;YACC,EAAE,EAAE,UAAU;YACd,KAAK,EAAE,CAAC,CAAC,cAAc,EAAE,UAAU,CAAC;YACpC,SAAS,EAAE,iBAAiB;SAC5B;QACD;YACC,EAAE,EAAE,SAAS;YACb,KAAK,EAAE,KAAK;YACZ,SAAS,EAAE,iBAAiB;SAC5B;KACD,EACD,CAAC,CAAC,EAAE,KAAK,CAAC,CACV,CAAC;IAEF,MAAM,MAAM,GAAuB,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE5D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,IAAI,MAAM,EAAE,CAAC;YACZ,kDAAkD;YAClD,UAAU,CACT,GAAG,EAAE,CACJ,QAAQ;iBACN,aAAa,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;gBACtE,EAAE,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C,EAC9B,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,OAAO,GACjB,CACG,CACD,CACK;QACZ,8BAAC,gCAAO,OAAG,CACT,CACH,CAAC;AACH,CAAC,CAAC;AA3FW,QAAA,cAAc,kBA2FzB"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @deprecated Use useScreenMode hook
3
+ */
4
+ export declare function useIsMobile(): boolean;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useIsMobile = void 0;
7
+ /*
8
+ * SPDX-FileCopyrightText: 2023 Zextras <https://www.zextras.com>
9
+ *
10
+ * SPDX-License-Identifier: AGPL-3.0-only
11
+ */
12
+ const react_1 = require("react");
13
+ const shell_context_1 = __importDefault(require("../shell-context"));
14
+ /**
15
+ * @deprecated Use useScreenMode hook
16
+ */
17
+ function useIsMobile() {
18
+ const { isMobile } = (0, react_1.useContext)(shell_context_1.default);
19
+ return isMobile;
20
+ }
21
+ exports.useIsMobile = useIsMobile;
22
+ //# sourceMappingURL=useIsMobile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsMobile.js","sourceRoot":"","sources":["../../../src/shell/hooks/useIsMobile.ts"],"names":[],"mappings":";;;;;;AAAA;;;;GAIG;AACH,iCAAmC;AAEnC,qEAA4C;AAE5C;;GAEG;AACH,SAAgB,WAAW;IAC1B,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,kBAAU,EAAC,uBAAY,CAAC,CAAC;IAC9C,OAAO,QAAQ,CAAC;AACjB,CAAC;AAHD,kCAGC"}
@@ -0,0 +1,14 @@
1
+ import type React from 'react';
2
+ type LocalStorageOptions = {
3
+ keepSyncedWithStorage?: boolean;
4
+ };
5
+ type LocalStorageState = {
6
+ storage: Record<string, unknown>;
7
+ readValue: <T>(key: string, fallback: T) => void;
8
+ setValue: <T>(key: string, value: React.SetStateAction<T>) => void;
9
+ };
10
+ export declare function useLocalStorage<T>(key: string, initialValue: T, options?: LocalStorageOptions): [T, React.Dispatch<React.SetStateAction<T>>];
11
+ export declare const exportForTest: {
12
+ useLocalStorageStore: import("zustand").UseBoundStore<import("zustand").StoreApi<LocalStorageState>> | undefined;
13
+ };
14
+ export {};
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exportForTest = exports.useLocalStorage = void 0;
4
+ const react_1 = require("react");
5
+ const zustand_1 = require("zustand");
6
+ const utils_1 = require("../../utils/utils");
7
+ function isSameLocalStorageValue(valueA, valueB) {
8
+ return JSON.stringify(valueA) === JSON.stringify(valueB);
9
+ }
10
+ const useLocalStorageStore = (0, zustand_1.create)()((setState) => ({
11
+ storage: {},
12
+ readValue(key, fallback) {
13
+ const localStorageItem = window.localStorage.getItem(key);
14
+ let item;
15
+ try {
16
+ item = localStorageItem !== null ? JSON.parse(localStorageItem) : fallback;
17
+ }
18
+ catch (error) {
19
+ console.error(`Cannot read local storage ${key} with value "${localStorageItem}":`, error);
20
+ item = fallback;
21
+ }
22
+ setState((state) => {
23
+ if (state.storage[key] === undefined) {
24
+ return { storage: { ...state.storage, [key]: item } };
25
+ }
26
+ return state;
27
+ });
28
+ },
29
+ setValue(key, value) {
30
+ setState((state) => {
31
+ const valueToStore = value instanceof Function ? value(state.storage[key]) : value;
32
+ if (!isSameLocalStorageValue(valueToStore, state.storage[key])) {
33
+ window.localStorage.setItem(key, JSON.stringify(valueToStore));
34
+ return { storage: { ...state.storage, [key]: valueToStore } };
35
+ }
36
+ return state;
37
+ });
38
+ }
39
+ }));
40
+ const DEFAULT_OPTIONS = {
41
+ keepSyncedWithStorage: true
42
+ };
43
+ function useLocalStorage(key, initialValue, options = DEFAULT_OPTIONS) {
44
+ const storedValue = useLocalStorageStore((state) => state.storage[key] ?? initialValue);
45
+ const shouldDispatchStorageEventRef = (0, react_1.useRef)(false);
46
+ const localStorageOptions = (0, react_1.useMemo)(() => ({ ...DEFAULT_OPTIONS, ...options }), [options]);
47
+ const readValueForKey = (0, react_1.useCallback)(() => {
48
+ useLocalStorageStore.getState().readValue(key, initialValue);
49
+ }, [key, initialValue]);
50
+ (0, react_1.useEffect)(() => {
51
+ readValueForKey();
52
+ }, [readValueForKey]);
53
+ const setValueForKey = (0, react_1.useCallback)((value) => {
54
+ useLocalStorageStore.getState().setValue(key, value);
55
+ shouldDispatchStorageEventRef.current = true;
56
+ }, [key]);
57
+ (0, react_1.useEffect)(() => {
58
+ if (localStorageOptions?.keepSyncedWithStorage) {
59
+ window.addEventListener('storage', readValueForKey);
60
+ }
61
+ return () => {
62
+ window.removeEventListener('storage', readValueForKey);
63
+ };
64
+ }, [localStorageOptions?.keepSyncedWithStorage, readValueForKey]);
65
+ (0, react_1.useEffect)(() => {
66
+ if (shouldDispatchStorageEventRef.current) {
67
+ // dispatch event when stored value change,
68
+ // but only after render to avoid possible update of parent component during render
69
+ window.dispatchEvent(new Event('storage'));
70
+ shouldDispatchStorageEventRef.current = false;
71
+ }
72
+ }, [storedValue]);
73
+ return [storedValue, setValueForKey];
74
+ }
75
+ exports.useLocalStorage = useLocalStorage;
76
+ exports.exportForTest = (0, utils_1.createExportForTestOnly)({ useLocalStorageStore });
77
+ //# sourceMappingURL=useLocalStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLocalStorage.js","sourceRoot":"","sources":["../../../src/shell/hooks/useLocalStorage.ts"],"names":[],"mappings":";;;AAMA,iCAAgE;AAEhE,qCAAiC;AAEjC,6CAA4D;AAE5D,SAAS,uBAAuB,CAAC,MAAe,EAAE,MAAe;IAChE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC1D,CAAC;AAUD,MAAM,oBAAoB,GAAG,IAAA,gBAAM,GAAqB,CA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EACD,CAAC,GAAG,CAAC,CACL,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,IAAI,mBAAmB,EAAE,qBAAqB,EAAE,CAAC;YAChD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,GAAS,EAAE;YACjB,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QACxD,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,mBAAmB,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC,CAAC;IAElE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,IAAI,6BAA6B,CAAC,OAAO,EAAE,CAAC;YAC3C,2CAA2C;YAC3C,mFAAmF;YACnF,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YAC3C,6BAA6B,CAAC,OAAO,GAAG,KAAK,CAAC;QAC/C,CAAC;IACF,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AACtC,CAAC;AA7CD,0CA6CC;AAEY,QAAA,aAAa,GAAG,IAAA,+BAAuB,EAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare const ShellContext: import("react").Context<{
2
+ isMobile: boolean;
3
+ }>;
4
+ export default ShellContext;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /*
3
+ * SPDX-FileCopyrightText: 2021 Zextras <https://www.zextras.com>
4
+ *
5
+ * SPDX-License-Identifier: AGPL-3.0-only
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const react_1 = require("react");
9
+ const ShellContext = (0, react_1.createContext)({ isMobile: true });
10
+ exports.default = ShellContext;
11
+ //# sourceMappingURL=shell-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-context.js","sourceRoot":"","sources":["../../src/shell/shell-context.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,iCAAsC;AAEtC,MAAM,YAAY,GAAG,IAAA,qBAAa,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAEvD,kBAAe,YAAY,CAAC"}