@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,123 @@
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.normalizeBoardView = exports.normalizeSecondaryAccessoryView = exports.normalizePrimaryAccessoryView = exports.normalizeUtilityView = exports.normalizeSearchView = exports.normalizeSettingsView = exports.normalizeRoute = exports.normalizeBadgeInfo = exports.normalizeApp = void 0;
12
+ const react_1 = __importDefault(require("react"));
13
+ const lodash_1 = require("lodash");
14
+ const normalizeApp = (app) => ({
15
+ commit: app.commit ?? '',
16
+ description: app.description ?? 'A carbonio Module',
17
+ // eslint-disable-next-line camelcase
18
+ js_entrypoint: app.js_entrypoint ?? '',
19
+ name: app.name ?? 'module',
20
+ priority: app.priority ?? 99,
21
+ version: app.version ?? '',
22
+ type: app.type ?? 'carbonio',
23
+ attrKey: app.attrKey,
24
+ icon: app.icon ?? 'Cube',
25
+ display: app.display ?? 'Module',
26
+ sentryDsn: app.sentryDsn
27
+ });
28
+ exports.normalizeApp = normalizeApp;
29
+ const FallbackView = () => react_1.default.createElement("p", null, "Missing Component");
30
+ const normalizeBadgeInfo = (badge) => ({
31
+ show: badge.show ?? false,
32
+ count: badge.count ?? 0,
33
+ showCount: badge.showCount ?? false,
34
+ color: badge.color ?? 'primary'
35
+ });
36
+ exports.normalizeBadgeInfo = normalizeBadgeInfo;
37
+ const normalizeRoute = (data, app) => {
38
+ const route = (0, lodash_1.trim)(data.route ?? app.name, '/');
39
+ return {
40
+ app: app.name,
41
+ route,
42
+ id: data.id ?? route,
43
+ badge: (0, exports.normalizeBadgeInfo)(data?.badge ?? {}),
44
+ position: data?.position ?? app.priority,
45
+ visible: data?.visible ?? true,
46
+ label: data?.label ?? '',
47
+ primaryBar: data.primaryBar ?? app.icon ?? 'CubeOutline',
48
+ secondaryBar: data.secondaryBar,
49
+ appView: data.appView ?? FallbackView,
50
+ focusMode: data.focusMode
51
+ };
52
+ };
53
+ exports.normalizeRoute = normalizeRoute;
54
+ const normalizeSettingsView = (data, app) => {
55
+ const route = (0, lodash_1.trim)(data.route ?? app.name, '/');
56
+ return {
57
+ app: app.name,
58
+ route,
59
+ id: data?.id ?? route,
60
+ component: data?.component ?? FallbackView,
61
+ label: data.label ?? app.display,
62
+ icon: data.icon ?? app.icon,
63
+ position: data.position ?? app.priority ?? 99,
64
+ subSections: data.subSections ?? []
65
+ };
66
+ };
67
+ exports.normalizeSettingsView = normalizeSettingsView;
68
+ const normalizeSearchView = (data, app) => {
69
+ const route = (0, lodash_1.trim)(data.route ?? app.name, '/');
70
+ return {
71
+ app: app.name,
72
+ route,
73
+ id: data?.id ?? route,
74
+ component: data?.component ?? FallbackView,
75
+ label: data.label ?? app.display,
76
+ icon: data.icon ?? app.icon,
77
+ position: data.position ?? app.priority ?? 99
78
+ };
79
+ };
80
+ exports.normalizeSearchView = normalizeSearchView;
81
+ const normalizeUtilityView = (data, app) => ({
82
+ app: app.name,
83
+ id: data?.id ?? app.name,
84
+ whitelistRoutes: data?.whitelistRoutes,
85
+ blacklistRoutes: data?.blacklistRoutes,
86
+ component: data?.component ?? FallbackView,
87
+ button: data?.button ?? 'Cube',
88
+ badge: (0, exports.normalizeBadgeInfo)(data?.badge ?? {}),
89
+ position: data?.position ?? app.priority,
90
+ label: data?.label ?? app.display
91
+ });
92
+ exports.normalizeUtilityView = normalizeUtilityView;
93
+ const normalizePrimaryAccessoryView = (data, app) => ({
94
+ app: app.name,
95
+ onClick: data?.onClick,
96
+ label: data?.label ?? app.display,
97
+ position: data?.position ?? app.priority,
98
+ whitelistRoutes: data?.whitelistRoutes,
99
+ blacklistRoutes: data?.blacklistRoutes,
100
+ id: data?.id ?? app.name,
101
+ component: data?.component ?? FallbackView
102
+ });
103
+ exports.normalizePrimaryAccessoryView = normalizePrimaryAccessoryView;
104
+ const normalizeSecondaryAccessoryView = (data, app) => ({
105
+ app: app.name,
106
+ position: data?.position ?? app.priority,
107
+ whitelistRoutes: data?.whitelistRoutes,
108
+ blacklistRoutes: data?.blacklistRoutes,
109
+ id: data?.id ?? app.name,
110
+ component: data?.component ?? FallbackView
111
+ });
112
+ exports.normalizeSecondaryAccessoryView = normalizeSecondaryAccessoryView;
113
+ const normalizeBoardView = (data, app) => {
114
+ const route = (0, lodash_1.trim)(data.route ?? app.name, '/');
115
+ return {
116
+ app: app.name,
117
+ route,
118
+ id: data?.id ?? route,
119
+ component: data?.component ?? FallbackView
120
+ };
121
+ };
122
+ exports.normalizeBoardView = normalizeBoardView;
123
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/store/app/utils.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAGH,kDAA0B;AAE1B,mCAA8B;AAcvB,MAAM,YAAY,GAAG,CAAC,GAA4B,EAAkB,EAAE,CAAC,CAAC;IAC9E,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE;IACxB,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,mBAAmB;IACnD,qCAAqC;IACrC,aAAa,EAAE,GAAG,CAAC,aAAa,IAAI,EAAE;IACtC,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,Q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,IAAI;IACxB,SAAS,EAAE,IAAI,EAAE,SAAS,IAAI,YAAY;CAC1C,CAAC,CAAC;AAZU,QAAA,6BAA6B,iCAYvC;AACI,MAAM,+BAA+B,GAAG,CAC9C,IAAqC,EACrC,GAAmB,EACM,EAAE,CAAC,CAAC;IAC7B,GAAG,EAAE,GAAG,CAAC,IAAI;IACb,QAAQ,EAAE,IAAI,EAAE,QAAQ,IAAI,GAAG,CAAC,QAAQ;IACxC,eAAe,EAAE,IAAI,EAAE,eAAe;IACtC,eAAe,EAAE,IAAI,EAAE,eAAe;IACtC,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,GAAG,CAAC,IAAI;IACxB,SAAS,EAAE,IAAI,EAAE,SAAS,IAAI,YAAY;CAC1C,CAAC,CAAC;AAVU,QAAA,+BAA+B,mCAUzC;AAEI,MAAM,kBAAkB,GAAG,CAAC,IAAwB,EAAE,GAAmB,EAAa,EAAE;IAC9F,MAAM,KAAK,GAAG,IAAA,aAAI,EAAC,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAChD,OAAO;QACN,GAAG,EAAE,GAAG,CAAC,IAAI;QACb,KAAK;QACL,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,KAAK;QACrB,SAAS,EAAE,IAAI,EAAE,SAAS,IAAI,YAAY;KAC1C,CAAC;AACH,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B"}
@@ -0,0 +1,31 @@
1
+ import type { FC } from 'react';
2
+ import React from 'react';
3
+ import type { Board } from '../../types/boards';
4
+ export declare const useBoardById: <T>(id: string) => Board<T> | undefined;
5
+ export declare const getBoardById: <T>(id: string) => Board<T> | undefined;
6
+ export declare const useBoardContextById: <T>(id: string) => T | undefined;
7
+ export declare const getBoardContextById: <T>(id: string) => T | undefined;
8
+ export declare const boardContext: React.Context<Board | undefined>;
9
+ export type BoardHooksContext = {
10
+ closeBoard: () => void;
11
+ updateBoard: (b: Partial<Board>) => void;
12
+ setCurrentBoard: () => void;
13
+ getBoardContext: <T>() => T;
14
+ getBoard: <T>() => Board<T>;
15
+ };
16
+ export declare const boardHooksContext: React.Context<BoardHooksContext | undefined>;
17
+ export declare const BoardProvider: FC<{
18
+ id: string;
19
+ }>;
20
+ /**
21
+ * Allow quick access to all current board hooks.
22
+ * This hook must be used from inside a board view.
23
+ * Outside a board, it will throw an error.
24
+ */
25
+ export declare const useBoardHooks: () => BoardHooksContext;
26
+ /**
27
+ * Retrieve the board object.
28
+ * This hook must be used from inside a board view.
29
+ * Outside a board, it will throw an error.
30
+ */
31
+ export declare const useBoard: <TBoardContext>() => Board<TBoardContext>;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.useBoard = exports.useBoardHooks = exports.BoardProvider = exports.boardHooksContext = exports.boardContext = exports.getBoardContextById = exports.useBoardContextById = exports.getBoardById = exports.useBoardById = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const store_1 = require("./store");
29
+ const useBoardById = (id) => (0, store_1.useBoardStore)((s) => s.boards[id]);
30
+ exports.useBoardById = useBoardById;
31
+ const getBoardById = (id) => store_1.useBoardStore.getState().boards[id];
32
+ exports.getBoardById = getBoardById;
33
+ const useBoardContextById = (id) => (0, store_1.useBoardStore)((s) => s.boards[id]?.context);
34
+ exports.useBoardContextById = useBoardContextById;
35
+ const getBoardContextById = (id) => store_1.useBoardStore.getState().boards[id]?.context;
36
+ exports.getBoardContextById = getBoardContextById;
37
+ // Must be empty if no board is available
38
+ exports.boardContext = (0, react_1.createContext)(undefined);
39
+ // Must be empty if no board is available
40
+ exports.boardHooksContext = (0, react_1.createContext)(undefined);
41
+ const BoardProvider = ({ children, id }) => {
42
+ const board = (0, exports.useBoardById)(id);
43
+ const callbacks = (0, react_1.useMemo)(() => ({
44
+ // at this point the id should be only one of the available boards,
45
+ // that's way the cast without further checks
46
+ getBoardContext: () => (0, exports.getBoardContextById)(id),
47
+ getBoard: () => (0, exports.getBoardById)(id),
48
+ closeBoard: () => (0, store_1.closeBoard)(id),
49
+ updateBoard: (b) => (0, store_1.updateBoard)(id, b),
50
+ setCurrentBoard: () => (0, store_1.setCurrentBoard)(id)
51
+ }), [id]);
52
+ return (react_1.default.createElement(exports.boardHooksContext.Provider, { value: callbacks },
53
+ react_1.default.createElement(exports.boardContext.Provider, { value: board }, children)));
54
+ };
55
+ exports.BoardProvider = BoardProvider;
56
+ /**
57
+ * Allow quick access to all current board hooks.
58
+ * This hook must be used from inside a board view.
59
+ * Outside a board, it will throw an error.
60
+ */
61
+ const useBoardHooks = () => {
62
+ const hooks = (0, react_1.useContext)(exports.boardHooksContext);
63
+ if (hooks === undefined) {
64
+ throw new Error('board hooks is undefined. This hook is meant to be used only from inside boards. Check that the hook is invoked from a board');
65
+ }
66
+ return hooks;
67
+ };
68
+ exports.useBoardHooks = useBoardHooks;
69
+ /**
70
+ * Retrieve the board object.
71
+ * This hook must be used from inside a board view.
72
+ * Outside a board, it will throw an error.
73
+ */
74
+ const useBoard = () => {
75
+ const board = (0, react_1.useContext)(exports.boardContext);
76
+ if (board === undefined) {
77
+ throw new Error('board is undefined. This hook is meant to be used only from inside boards. Check that the hook is invoked from a board');
78
+ }
79
+ return board;
80
+ };
81
+ exports.useBoard = useBoard;
82
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/store/boards/hooks.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,+CAAkE;AAElE,mCAAkF;AAG3E,MAAM,YAAY,GAAG,CAAK,EAAU,EAAwB,EAAE,CACpE,IAAA,qBAAa,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAyB,CAAC;AAD/C,QAAA,YAAY,gBACmC;AACrD,MAAM,YAAY,GAAG,CAAK,EAAU,EAAwB,EAAE,CACpE,qBAAa,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,CAAyB,CAAC;AADhD,QAAA,YAAY,gBACoC;AACtD,MAAM,mBAAmB,GAAG,CAAK,EAAU,EAAiB,EAAE,CACpE,IAAA,qBAAa,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,CAAkB,CAAC;AADjD,QAAA,mBAAmB,uBAC8B;AACvD,MAAM,mBAAmB,GAAG,CAAK,EAAU,EAAiB,EAAE,CACpE,qBAAa,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,OAAwB,CAAC;AADlD,QAAA,mBAAmB,uBAC+B;AAE/D,yCAAyC;AAC5B,QAAA,YAAY,GAAG,IAAA,qBAAa,EAAoB,SAAS,CAAC,CAAC;AASxE,yCAAyC;AAC5B,QAAA,iBAAiB,GAAG,IAAA,qBAAa,EAAgC,SAAS,CAAC,CAAC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U,EAAC,oBAAY,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACd,wHAAwH,CACxH,CAAC;IACH,CAAC;IACD,OAAO,KAA6B,CAAC;AACtC,CAAC,CAAC;AARW,QAAA,QAAQ,YAQnB"}
@@ -0,0 +1,2 @@
1
+ export * from './hooks';
2
+ export * from './store';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /*
18
+ * SPDX-FileCopyrightText: 2022 Zextras <https://www.zextras.com>
19
+ *
20
+ * SPDX-License-Identifier: AGPL-3.0-only
21
+ */
22
+ __exportStar(require("./hooks"), exports);
23
+ __exportStar(require("./store"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/store/boards/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,0CAAwB;AACxB,0CAAwB"}
@@ -0,0 +1,23 @@
1
+ import type { Board } from '../../types/boards';
2
+ export type BoardState = {
3
+ orderedBoards: Array<string>;
4
+ boards: Record<string, Board>;
5
+ expanded: boolean;
6
+ minimized: boolean;
7
+ current?: string;
8
+ };
9
+ export declare const useBoardStore: import("zustand").UseBoundStore<import("zustand").StoreApi<BoardState>>;
10
+ export declare const addBoard: (app: string) => <T = unknown>(board: Omit<Board<T>, "id" | "app" | "icon"> & {
11
+ id?: string | undefined;
12
+ icon?: string | undefined;
13
+ }, expanded?: BoardState['expanded']) => Board;
14
+ export declare const closeBoard: (id: string) => void;
15
+ export declare const closeAllBoards: () => void;
16
+ export declare const onGoToPanel: () => void;
17
+ export declare const minimizeBoards: () => void;
18
+ export declare const reopenBoards: () => void;
19
+ export declare const expandBoards: () => void;
20
+ export declare const reduceBoards: () => void;
21
+ export declare const setCurrentBoard: (id: string) => void;
22
+ export declare const updateBoard: <T = unknown>(id: string, board: Partial<Board<T>>) => void;
23
+ export declare const updateBoardContext: <T = unknown>(id: string, context: T) => void;
@@ -0,0 +1,124 @@
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.updateBoardContext = exports.updateBoard = exports.setCurrentBoard = exports.reduceBoards = exports.expandBoards = exports.reopenBoards = exports.minimizeBoards = exports.onGoToPanel = exports.closeAllBoards = exports.closeBoard = exports.addBoard = exports.useBoardStore = void 0;
9
+ const immer_1 = require("immer");
10
+ const lodash_1 = require("lodash");
11
+ const zustand_1 = require("zustand");
12
+ const app_1 = require("../app");
13
+ // extra currying as suggested in https://github.com/pmndrs/zustand/blob/main/docs/guides/typescript.md#basic-usage
14
+ exports.useBoardStore = (0, zustand_1.create)()(() => ({
15
+ orderedBoards: [],
16
+ boards: {},
17
+ expanded: false,
18
+ minimized: false
19
+ }));
20
+ const addBoard = (app) => (board, expanded) => {
21
+ const id = board.id ?? (0, lodash_1.uniqueId)('board-');
22
+ exports.useBoardStore.setState((0, immer_1.produce)((state) => {
23
+ state.boards[id] = {
24
+ ...board,
25
+ app,
26
+ id,
27
+ icon: board.icon ?? (0, app_1.getApp)(app)()?.icon ?? 'CubeOutline',
28
+ url: (0, lodash_1.trimStart)(board.url, '/')
29
+ };
30
+ state.current = id;
31
+ state.minimized = false;
32
+ state.expanded = expanded ?? state.expanded;
33
+ state.orderedBoards.unshift(id);
34
+ }));
35
+ return exports.useBoardStore.getState().boards[id];
36
+ };
37
+ exports.addBoard = addBoard;
38
+ const closeBoard = (id) => {
39
+ exports.useBoardStore.setState((0, immer_1.produce)((state) => {
40
+ state.boards[id]?.onClose?.(state.boards[id]);
41
+ delete state.boards[id];
42
+ const index = state.orderedBoards.findIndex((boardId) => boardId === id);
43
+ if (state.current === id) {
44
+ state.current = state.orderedBoards[index + 1] || state.orderedBoards[index - 1];
45
+ }
46
+ if (index !== -1) {
47
+ state.orderedBoards.splice(index, 1);
48
+ }
49
+ }));
50
+ };
51
+ exports.closeBoard = closeBoard;
52
+ const closeAllBoards = () => {
53
+ exports.useBoardStore.setState((0, immer_1.produce)((state) => {
54
+ (0, lodash_1.forEach)(state.boards, (b) => {
55
+ b?.onClose?.(b);
56
+ delete state.boards[b.id];
57
+ });
58
+ state.orderedBoards = [];
59
+ }));
60
+ };
61
+ exports.closeAllBoards = closeAllBoards;
62
+ const onGoToPanel = () => {
63
+ exports.useBoardStore.setState((0, immer_1.produce)((state) => {
64
+ const id = state.current;
65
+ if (id) {
66
+ state.boards[id]?.onGoToPanel?.(state.boards[id]);
67
+ delete state.boards[id];
68
+ const index = state.orderedBoards.findIndex((boardId) => boardId === id);
69
+ if (index !== -1) {
70
+ state.orderedBoards.splice(index, 1);
71
+ }
72
+ }
73
+ }));
74
+ };
75
+ exports.onGoToPanel = onGoToPanel;
76
+ const minimizeBoards = () => {
77
+ exports.useBoardStore.setState({
78
+ minimized: true
79
+ });
80
+ };
81
+ exports.minimizeBoards = minimizeBoards;
82
+ const reopenBoards = () => {
83
+ exports.useBoardStore.setState({
84
+ minimized: false
85
+ });
86
+ };
87
+ exports.reopenBoards = reopenBoards;
88
+ const expandBoards = () => {
89
+ exports.useBoardStore.setState({
90
+ expanded: true
91
+ });
92
+ };
93
+ exports.expandBoards = expandBoards;
94
+ const reduceBoards = () => {
95
+ exports.useBoardStore.setState({
96
+ expanded: false
97
+ });
98
+ };
99
+ exports.reduceBoards = reduceBoards;
100
+ const setCurrentBoard = (id) => {
101
+ exports.useBoardStore.setState({
102
+ current: id
103
+ });
104
+ };
105
+ exports.setCurrentBoard = setCurrentBoard;
106
+ const updateBoard = (id, board) => {
107
+ exports.useBoardStore.setState((0, immer_1.produce)((state) => {
108
+ if (state.boards[id])
109
+ state.boards[id] = {
110
+ ...state.boards[id],
111
+ ...board
112
+ };
113
+ }));
114
+ };
115
+ exports.updateBoard = updateBoard;
116
+ const updateBoardContext = (id, context) => {
117
+ exports.useBoardStore.setState((0, immer_1.produce)((state) => {
118
+ if (state.boards[id]) {
119
+ state.boards[id].context = context;
120
+ }
121
+ }));
122
+ };
123
+ exports.updateBoardContext = updateBoardContext;
124
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/store/boards/store.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAAgC;AAChC,mCAAsD;AACtD,qCAAiC;AAGjC,gCAAgC;AAUhC,mHAAmH;AACtG,QAAA,aAAa,GAAG,IAAA,gBAAM,GAAc,CAAC,GAAG,EAAE,CAAC,CAAC;IACxD,aAAa,EAAE,EAAE;IACjB,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,KAAK;CAChB,CAAC,CAAC,CAAC;AAEG,MAAM,QAAQ,GACpB,CAAC,GAAW,EAAE,EAAE,CAChB,CACC,KAA6E,EAC7E,QAAiC,EACzB,EAAE;IACV,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,IAAA,iBAAQ,EAAC,QAAQ,CAAC,CAAC;IAC1C,qBAAa,CAAC,QAAQ,CACrB,IAAA,eAAO,EAAC,CAAC,KAAiB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aACC,CAAC;IACb,CAAC,CAAC,CACF,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,WAAW,eAUtB;AACK,MAAM,kBAAkB,GAAG,CAAc,EAAU,EAAE,OAAU,EAAQ,EAAE;IAC/E,qBAAa,CAAC,QAAQ,CACrB,IAAA,eAAO,EAAC,CAAC,KAAiB,EAAE,EAAE;QAC7B,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC;QACpC,CAAC;IACF,CAAC,CAAC,CACF,CAAC;AACH,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B"}
@@ -0,0 +1,11 @@
1
+ import type { AnyFunction } from '../utils/typeUtils';
2
+ export type PackageDependentFunction = (app: string) => AnyFunction;
3
+ export type ContextBridgeState = {
4
+ packageDependentFunctions: Record<string, PackageDependentFunction>;
5
+ functions: Record<string, AnyFunction>;
6
+ };
7
+ export type ContextBridgeActions = {
8
+ add: (content: Partial<ContextBridgeState>) => void;
9
+ };
10
+ export declare const useContextBridge: import("zustand").UseBoundStore<import("zustand").StoreApi<ContextBridgeState & ContextBridgeActions>>;
11
+ export declare const useBridge: (content: Partial<ContextBridgeState>) => void;
@@ -0,0 +1,34 @@
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.useBridge = exports.useContextBridge = void 0;
9
+ const lodash_1 = require("lodash");
10
+ const zustand_1 = require("zustand");
11
+ const initialState = {
12
+ packageDependentFunctions: {},
13
+ functions: {}
14
+ };
15
+ // extra currying as suggested in https://github.com/pmndrs/zustand/blob/main/docs/guides/typescript.md#basic-usage
16
+ exports.useContextBridge = (0, zustand_1.create)()((set) => ({
17
+ ...initialState,
18
+ add: ({ packageDependentFunctions, functions }) => {
19
+ set((s) => ({
20
+ packageDependentFunctions: (0, lodash_1.reduce)(packageDependentFunctions ?? {}, (acc, f, key) => {
21
+ // eslint-disable-next-line no-param-reassign
22
+ acc[key] = f;
23
+ return acc;
24
+ }, s.packageDependentFunctions),
25
+ functions: (0, lodash_1.reduce)(functions ?? {}, (acc, f, key) => {
26
+ // eslint-disable-next-line no-param-reassign
27
+ acc[key] = f;
28
+ return acc;
29
+ }, s.functions)
30
+ }));
31
+ }
32
+ }));
33
+ exports.useBridge = exports.useContextBridge.getState().add;
34
+ //# sourceMappingURL=context-bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-bridge.js","sourceRoot":"","sources":["../../src/store/context-bridge.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mCAAgC;AAChC,qCAAiC;AAejC,MAAM,YAAY,GAAuB;IACxC,yBAAyB,EAAE,EAAE;IAC7B,SAAS,EAAE,EAAE;CACb,CAAC;AAEF,mHAAmH;AACtG,QAAA,gBAAgB,GAAG,IAAA,gBAAM,GAA6C,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC7F,GAAG,YAAY;IACf,GAAG,EAAE,CAAC,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAQ,EAAE;QACvD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACX,yBAAyB,EAAE,IAAA,eAAM,EAChC,yBAAyB,IAAI,EAAE,EAC/B,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE;gBACf,6CAA6C;gBAC7C,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACb,OAAO,GAAG,CAAC;YACZ,CAAC,EACD,CAAC,CAAC,yBAAyB,CAC3B;YACD,SAAS,EAAE,IAAA,eAAM,EAChB,SAAS,IAAI,EAAE,EACf,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE;gBACf,6CAA6C;gBAC7C,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACb,OAAO,GAAG,CAAC;YACZ,CAAC,EACD,CAAC,CAAC,SAAS,CACX;SACD,CAAC,CAAC,CAAC;IACL,CAAC;CACD,CAAC,CAAC,CAAC;AAES,QAAA,SAAS,GAAG,wBAAgB,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { Folder, Folders, Searches, SearchFolder } from '../../types/folder';
3
+ import type { AccordionFolder, FolderView } from '../../types/misc';
4
+ export declare const useFolder: (id: string) => Folder | undefined;
5
+ export declare const getFolder: (id: string) => Folder | undefined;
6
+ export declare const useFolders: () => Folders;
7
+ export declare const getFolders: () => Folders;
8
+ export declare const useRoot: (id: string) => Folder | undefined;
9
+ export declare const getRoot: (id: string) => Folder | undefined;
10
+ export declare const useRoots: () => Folders;
11
+ export declare const getRoots: () => Folders;
12
+ export declare const useRootByUser: (userId: string) => Folder | SearchFolder | Record<string, never>;
13
+ export declare const getRootByUser: (userId: string) => Folder | SearchFolder | Record<string, never>;
14
+ export declare const useSearchFolder: (id: string) => SearchFolder | undefined;
15
+ export declare const getSearchFolder: (id: string) => SearchFolder | undefined;
16
+ export declare const useSearchFolders: () => Searches;
17
+ export declare const getSearchFolders: () => Searches;
18
+ export declare const useFoldersByView: (view: FolderView) => Array<Folder>;
19
+ export declare const useFoldersAccordionByView: (view: FolderView, CustomComponent: ComponentType<{
20
+ folder: Folder;
21
+ }>, itemProps?: ((item: AccordionFolder) => Record<string, unknown>) | undefined) => Array<AccordionFolder>;
@@ -0,0 +1,77 @@
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.useFoldersAccordionByView = exports.useFoldersByView = exports.getSearchFolders = exports.useSearchFolders = exports.getSearchFolder = exports.useSearchFolder = exports.getRootByUser = exports.useRootByUser = exports.getRoots = exports.useRoots = exports.getRoot = exports.useRoot = exports.getFolders = exports.useFolders = exports.getFolder = exports.useFolder = void 0;
9
+ const react_1 = require("react");
10
+ const store_1 = require("./store");
11
+ const utils_1 = require("./utils");
12
+ // FOLDERS
13
+ const useFolder = (id) => (0, store_1.useFolderStore)((s) => s.folders?.[id]);
14
+ exports.useFolder = useFolder;
15
+ const getFolder = (id) => store_1.useFolderStore.getState()?.folders?.[id];
16
+ exports.getFolder = getFolder;
17
+ const useFolders = () => (0, store_1.useFolderStore)((s) => s.folders);
18
+ exports.useFolders = useFolders;
19
+ const getFolders = () => store_1.useFolderStore.getState().folders;
20
+ exports.getFolders = getFolders;
21
+ // ROOTS
22
+ const useRoot = (id) => (0, store_1.useFolderStore)((s) => s.roots?.[id]);
23
+ exports.useRoot = useRoot;
24
+ const getRoot = (id) => store_1.useFolderStore.getState().roots?.[id];
25
+ exports.getRoot = getRoot;
26
+ const useRoots = () => (0, store_1.useFolderStore)((s) => s.roots);
27
+ exports.useRoots = useRoots;
28
+ const getRoots = () => store_1.useFolderStore.getState().roots;
29
+ exports.getRoots = getRoots;
30
+ // ROOTS BY VIEW
31
+ const useRootByUser = (userId) => (0, store_1.useFolderStore)((s) => (s.roots ? s.roots[userId] : {}));
32
+ exports.useRootByUser = useRootByUser;
33
+ const getRootByUser = (userId) => {
34
+ const folders = store_1.useFolderStore.getState();
35
+ return folders.roots ? folders.roots[userId] : {};
36
+ };
37
+ exports.getRootByUser = getRootByUser;
38
+ // SEARCHES
39
+ const useSearchFolder = (id) => (0, store_1.useFolderStore)((s) => s.searches?.[id]);
40
+ exports.useSearchFolder = useSearchFolder;
41
+ const getSearchFolder = (id) => store_1.useFolderStore.getState().searches[id];
42
+ exports.getSearchFolder = getSearchFolder;
43
+ const useSearchFolders = () => (0, store_1.useFolderStore)((s) => s.searches);
44
+ exports.useSearchFolders = useSearchFolders;
45
+ const getSearchFolders = () => store_1.useFolderStore.getState().searches;
46
+ exports.getSearchFolders = getSearchFolders;
47
+ // Accordion-ize
48
+ const useFoldersByView = (view) => {
49
+ const roots = (0, exports.useRoots)();
50
+ return (0, react_1.useMemo)(() => roots ? (0, utils_1.filterNodes)(Object.values(roots), (0, utils_1.folderViewFilter)(view), utils_1.sortFolders) : [], [roots, view]);
51
+ };
52
+ exports.useFoldersByView = useFoldersByView;
53
+ const useFoldersAccordionByView = (view, CustomComponent, itemProps) => {
54
+ const roots = (0, exports.useRoots)();
55
+ return (0, react_1.useMemo)(() => roots
56
+ ? (0, utils_1.mapNodes)(Object.values(roots), {
57
+ mapFunction: (f) => {
58
+ const item = {
59
+ id: f.id,
60
+ label: f.name,
61
+ CustomComponent,
62
+ items: [],
63
+ folder: f,
64
+ disableHover: (0, utils_1.isRoot)(f)
65
+ };
66
+ const props = itemProps?.(item) ?? {};
67
+ return { ...item, ...props };
68
+ },
69
+ filterFunction: (0, utils_1.folderViewFilter)(view),
70
+ recursionKey: 'items',
71
+ sortFunction: utils_1.sortFolders,
72
+ deep: false
73
+ })
74
+ : [], [CustomComponent, itemProps, roots, view]);
75
+ };
76
+ exports.useFoldersAccordionByView = useFoldersAccordionByView;
77
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/store/folder/hooks.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,iCAAgC;AAEhC,mCAAyC;AACzC,mCAAuF;AAIvF,UAAU;AACH,MAAM,SAAS,GAAG,CAAC,EAAU,EAAsB,EAAE,CAAC,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAAvF,QAAA,SAAS,aAA8E;AAC7F,MAAM,SAAS,GAAG,CAAC,EAAU,EAAsB,EAAE,CAC3D,sBAAc,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,EAA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PW,QAAA,gBAAgB,oBAO3B;AAEK,MAAM,yBAAyB,GAAG,CACxC,IAAgB,EAChB,eAAkD,EAClD,SAA8D,EACrC,EAAE;IAC3B,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACzB,OAAO,IAAA,eAAO,EACb,GAAG,EAAE,CACJ,KAAK;QACJ,CAAC,CAAC,IAAA,gBAAQ,EAA0B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YACxD,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;gBAClB,MAAM,IAAI,GAAG;oBACZ,EAAE,EAAE,CAAC,CAAC,EAAE;oBACR,KAAK,EAAE,CAAC,CAAC,IAAI;oBACb,eAAe;oBACf,KAAK,EAAE,EAAE;oBACT,MAAM,EAAE,CAAC;oBACT,YAAY,EAAE,IAAA,cAAM,EAAC,CAAC,CAAC;iBACvB,CAAC;gBACF,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;gBACtC,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;YAC9B,CAAC;YACD,cAAc,EAAE,IAAA,wBAAgB,EAAC,IAAI,CAAC;YACtC,YAAY,EAAE,OAAO;YACrB,YAAY,EAAE,mBAAW;YACzB,IAAI,EAAE,KAAK;SACX,CAAC;QACH,CAAC,CAAC,EAAE,EACN,CAAC,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,CACzC,CAAC;AACH,CAAC,CAAC;AA9BW,QAAA,yBAAyB,6BA8BpC"}
@@ -0,0 +1,2 @@
1
+ export * from './store';
2
+ export * from './hooks';
@@ -0,0 +1,24 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ __exportStar(require("./store"), exports);
23
+ __exportStar(require("./hooks"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/store/folder/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,0CAAwB"}
@@ -0,0 +1,2 @@
1
+ import type { FolderState } from '../../types/folder';
2
+ export declare const useFolderStore: import("zustand").UseBoundStore<import("zustand").StoreApi<FolderState>>;