@darajs/core 1.0.0-a.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/dist/actions/download-content.d.ts +8 -0
  4. package/dist/actions/download-content.d.ts.map +1 -0
  5. package/dist/actions/download-content.js +46 -0
  6. package/dist/actions/download-content.js.map +1 -0
  7. package/dist/actions/download-variable.d.ts +8 -0
  8. package/dist/actions/download-variable.d.ts.map +1 -0
  9. package/dist/actions/download-variable.js +153 -0
  10. package/dist/actions/download-variable.js.map +1 -0
  11. package/dist/actions/index.d.ts +11 -0
  12. package/dist/actions/index.d.ts.map +1 -0
  13. package/dist/actions/index.js +11 -0
  14. package/dist/actions/index.js.map +1 -0
  15. package/dist/actions/logout.d.ts +8 -0
  16. package/dist/actions/logout.d.ts.map +1 -0
  17. package/dist/actions/logout.js +24 -0
  18. package/dist/actions/logout.js.map +1 -0
  19. package/dist/actions/navigate-to.d.ts +8 -0
  20. package/dist/actions/navigate-to.d.ts.map +1 -0
  21. package/dist/actions/navigate-to.js +77 -0
  22. package/dist/actions/navigate-to.js.map +1 -0
  23. package/dist/actions/notify.d.ts +8 -0
  24. package/dist/actions/notify.d.ts.map +1 -0
  25. package/dist/actions/notify.js +16 -0
  26. package/dist/actions/notify.js.map +1 -0
  27. package/dist/actions/reset-variables.d.ts +8 -0
  28. package/dist/actions/reset-variables.d.ts.map +1 -0
  29. package/dist/actions/reset-variables.js +24 -0
  30. package/dist/actions/reset-variables.js.map +1 -0
  31. package/dist/actions/side-effect.d.ts +8 -0
  32. package/dist/actions/side-effect.d.ts.map +1 -0
  33. package/dist/actions/side-effect.js +44 -0
  34. package/dist/actions/side-effect.js.map +1 -0
  35. package/dist/actions/trigger-variable.d.ts +8 -0
  36. package/dist/actions/trigger-variable.d.ts.map +1 -0
  37. package/dist/actions/trigger-variable.js +25 -0
  38. package/dist/actions/trigger-variable.js.map +1 -0
  39. package/dist/actions/update-variable.d.ts +9 -0
  40. package/dist/actions/update-variable.d.ts.map +1 -0
  41. package/dist/actions/update-variable.js +89 -0
  42. package/dist/actions/update-variable.js.map +1 -0
  43. package/dist/actions/utils.d.ts +9 -0
  44. package/dist/actions/utils.d.ts.map +1 -0
  45. package/dist/actions/utils.js +37 -0
  46. package/dist/actions/utils.js.map +1 -0
  47. package/dist/api/core.d.ts +34 -0
  48. package/dist/api/core.d.ts.map +1 -0
  49. package/dist/api/core.js +110 -0
  50. package/dist/api/core.js.map +1 -0
  51. package/dist/api/http.d.ts +9 -0
  52. package/dist/api/http.d.ts.map +1 -0
  53. package/dist/api/http.js +38 -0
  54. package/dist/api/http.js.map +1 -0
  55. package/dist/api/index.d.ts +5 -0
  56. package/dist/api/index.d.ts.map +1 -0
  57. package/dist/api/index.js +5 -0
  58. package/dist/api/index.js.map +1 -0
  59. package/dist/api/websocket.d.ts +140 -0
  60. package/dist/api/websocket.d.ts.map +1 -0
  61. package/dist/api/websocket.js +241 -0
  62. package/dist/api/websocket.js.map +1 -0
  63. package/dist/assets/fonts/Manrope-VariableFont_wght.ttf +0 -0
  64. package/dist/assets/login-background.svg +11 -0
  65. package/dist/assets/logo.svg +12 -0
  66. package/dist/auth/auth-context.d.ts +22 -0
  67. package/dist/auth/auth-context.d.ts.map +1 -0
  68. package/dist/auth/auth-context.js +18 -0
  69. package/dist/auth/auth-context.js.map +1 -0
  70. package/dist/auth/auth-wrapper.d.ts +14 -0
  71. package/dist/auth/auth-wrapper.d.ts.map +1 -0
  72. package/dist/auth/auth-wrapper.js +90 -0
  73. package/dist/auth/auth-wrapper.js.map +1 -0
  74. package/dist/auth/auth.d.ts +61 -0
  75. package/dist/auth/auth.d.ts.map +1 -0
  76. package/dist/auth/auth.js +161 -0
  77. package/dist/auth/auth.js.map +1 -0
  78. package/dist/auth/basic/basic-auth-login.d.ts +6 -0
  79. package/dist/auth/basic/basic-auth-login.d.ts.map +1 -0
  80. package/dist/auth/basic/basic-auth-login.js +174 -0
  81. package/dist/auth/basic/basic-auth-login.js.map +1 -0
  82. package/dist/auth/basic/basic-auth-logout.d.ts +6 -0
  83. package/dist/auth/basic/basic-auth-logout.d.ts.map +1 -0
  84. package/dist/auth/basic/basic-auth-logout.js +18 -0
  85. package/dist/auth/basic/basic-auth-logout.js.map +1 -0
  86. package/dist/auth/default/default-auth-login.d.ts +6 -0
  87. package/dist/auth/default/default-auth-login.d.ts.map +1 -0
  88. package/dist/auth/default/default-auth-login.js +66 -0
  89. package/dist/auth/default/default-auth-login.js.map +1 -0
  90. package/dist/auth/index.d.ts +7 -0
  91. package/dist/auth/index.d.ts.map +1 -0
  92. package/dist/auth/index.js +7 -0
  93. package/dist/auth/index.js.map +1 -0
  94. package/dist/components/fallback/default.d.ts +5 -0
  95. package/dist/components/fallback/default.d.ts.map +1 -0
  96. package/dist/components/fallback/default.js +10 -0
  97. package/dist/components/fallback/default.js.map +1 -0
  98. package/dist/components/fallback/dots.d.ts +8 -0
  99. package/dist/components/fallback/dots.d.ts.map +1 -0
  100. package/dist/components/fallback/dots.js +77 -0
  101. package/dist/components/fallback/dots.js.map +1 -0
  102. package/dist/components/fallback/row.d.ts +5 -0
  103. package/dist/components/fallback/row.d.ts.map +1 -0
  104. package/dist/components/fallback/row.js +14 -0
  105. package/dist/components/fallback/row.js.map +1 -0
  106. package/dist/components/for/for.d.ts +35 -0
  107. package/dist/components/for/for.d.ts.map +1 -0
  108. package/dist/components/for/for.js +43 -0
  109. package/dist/components/for/for.js.map +1 -0
  110. package/dist/components/index.d.ts +9 -0
  111. package/dist/components/index.d.ts.map +1 -0
  112. package/dist/components/index.js +9 -0
  113. package/dist/components/index.js.map +1 -0
  114. package/dist/components/menu/menu.d.ts +14 -0
  115. package/dist/components/menu/menu.d.ts.map +1 -0
  116. package/dist/components/menu/menu.js +58 -0
  117. package/dist/components/menu/menu.js.map +1 -0
  118. package/dist/components/progress-tracker/progress-tracker.d.ts +18 -0
  119. package/dist/components/progress-tracker/progress-tracker.d.ts.map +1 -0
  120. package/dist/components/progress-tracker/progress-tracker.js +202 -0
  121. package/dist/components/progress-tracker/progress-tracker.js.map +1 -0
  122. package/dist/components/router-content/router-content.d.ts +14 -0
  123. package/dist/components/router-content/router-content.d.ts.map +1 -0
  124. package/dist/components/router-content/router-content.js +17 -0
  125. package/dist/components/router-content/router-content.js.map +1 -0
  126. package/dist/components/side-bar-frame/side-bar-frame.d.ts +21 -0
  127. package/dist/components/side-bar-frame/side-bar-frame.d.ts.map +1 -0
  128. package/dist/components/side-bar-frame/side-bar-frame.js +63 -0
  129. package/dist/components/side-bar-frame/side-bar-frame.js.map +1 -0
  130. package/dist/components/top-bar-frame/top-bar-frame.d.ts +16 -0
  131. package/dist/components/top-bar-frame/top-bar-frame.d.ts.map +1 -0
  132. package/dist/components/top-bar-frame/top-bar-frame.js +70 -0
  133. package/dist/components/top-bar-frame/top-bar-frame.js.map +1 -0
  134. package/dist/dara_core-1.0.0a1-py3-none-any.whl +0 -0
  135. package/dist/devtools/backend-errors/backend-errors-ctx.d.ts +17 -0
  136. package/dist/devtools/backend-errors/backend-errors-ctx.d.ts.map +1 -0
  137. package/dist/devtools/backend-errors/backend-errors-ctx.js +37 -0
  138. package/dist/devtools/backend-errors/backend-errors-ctx.js.map +1 -0
  139. package/dist/devtools/backend-errors/backend-errors.d.ts +6 -0
  140. package/dist/devtools/backend-errors/backend-errors.d.ts.map +1 -0
  141. package/dist/devtools/backend-errors/backend-errors.js +57 -0
  142. package/dist/devtools/backend-errors/backend-errors.js.map +1 -0
  143. package/dist/devtools/backend-errors/error-display.d.ts +22 -0
  144. package/dist/devtools/backend-errors/error-display.d.ts.map +1 -0
  145. package/dist/devtools/backend-errors/error-display.js +99 -0
  146. package/dist/devtools/backend-errors/error-display.js.map +1 -0
  147. package/dist/devtools/backend-errors/index.d.ts +3 -0
  148. package/dist/devtools/backend-errors/index.d.ts.map +1 -0
  149. package/dist/devtools/backend-errors/index.js +3 -0
  150. package/dist/devtools/backend-errors/index.js.map +1 -0
  151. package/dist/devtools/devtools-content.d.ts +12 -0
  152. package/dist/devtools/devtools-content.d.ts.map +1 -0
  153. package/dist/devtools/devtools-content.js +73 -0
  154. package/dist/devtools/devtools-content.js.map +1 -0
  155. package/dist/devtools/devtools-context.d.ts +7 -0
  156. package/dist/devtools/devtools-context.d.ts.map +1 -0
  157. package/dist/devtools/devtools-context.js +9 -0
  158. package/dist/devtools/devtools-context.js.map +1 -0
  159. package/dist/devtools/devtools-wrapper.d.ts +8 -0
  160. package/dist/devtools/devtools-wrapper.d.ts.map +1 -0
  161. package/dist/devtools/devtools-wrapper.js +64 -0
  162. package/dist/devtools/devtools-wrapper.js.map +1 -0
  163. package/dist/devtools/devtools.d.ts +5 -0
  164. package/dist/devtools/devtools.d.ts.map +1 -0
  165. package/dist/devtools/devtools.js +10 -0
  166. package/dist/devtools/devtools.js.map +1 -0
  167. package/dist/devtools/floating-button.d.ts +24 -0
  168. package/dist/devtools/floating-button.d.ts.map +1 -0
  169. package/dist/devtools/floating-button.js +96 -0
  170. package/dist/devtools/floating-button.js.map +1 -0
  171. package/dist/devtools/index.d.ts +2 -0
  172. package/dist/devtools/index.d.ts.map +1 -0
  173. package/dist/devtools/index.js +2 -0
  174. package/dist/devtools/index.js.map +1 -0
  175. package/dist/devtools/resizer.d.ts +18 -0
  176. package/dist/devtools/resizer.d.ts.map +1 -0
  177. package/dist/devtools/resizer.js +48 -0
  178. package/dist/devtools/resizer.js.map +1 -0
  179. package/dist/devtools/use-move.d.ts +21 -0
  180. package/dist/devtools/use-move.d.ts.map +1 -0
  181. package/dist/devtools/use-move.js +55 -0
  182. package/dist/devtools/use-move.js.map +1 -0
  183. package/dist/index.css +95 -0
  184. package/dist/index.d.ts +15 -0
  185. package/dist/index.d.ts.map +1 -0
  186. package/dist/index.js +13 -0
  187. package/dist/index.js.map +1 -0
  188. package/dist/jest-setup.d.ts +2 -0
  189. package/dist/jest-setup.d.ts.map +1 -0
  190. package/dist/jest-setup.js +7 -0
  191. package/dist/jest-setup.js.map +1 -0
  192. package/dist/pages/error-page.d.ts +3 -0
  193. package/dist/pages/error-page.d.ts.map +1 -0
  194. package/dist/pages/error-page.js +32 -0
  195. package/dist/pages/error-page.js.map +1 -0
  196. package/dist/pages/sso-callback-page.d.ts +6 -0
  197. package/dist/pages/sso-callback-page.d.ts.map +1 -0
  198. package/dist/pages/sso-callback-page.js +8 -0
  199. package/dist/pages/sso-callback-page.js.map +1 -0
  200. package/dist/run.d.ts +22 -0
  201. package/dist/run.d.ts.map +1 -0
  202. package/dist/run.js +40 -0
  203. package/dist/run.js.map +1 -0
  204. package/dist/shared/center/center.d.ts +5 -0
  205. package/dist/shared/center/center.d.ts.map +1 -0
  206. package/dist/shared/center/center.js +15 -0
  207. package/dist/shared/center/center.js.map +1 -0
  208. package/dist/shared/context/direction-context.d.ts +7 -0
  209. package/dist/shared/context/direction-context.d.ts.map +1 -0
  210. package/dist/shared/context/direction-context.js +4 -0
  211. package/dist/shared/context/direction-context.js.map +1 -0
  212. package/dist/shared/context/display-context.d.ts +14 -0
  213. package/dist/shared/context/display-context.d.ts.map +1 -0
  214. package/dist/shared/context/display-context.js +4 -0
  215. package/dist/shared/context/display-context.js.map +1 -0
  216. package/dist/shared/context/fallback-context.d.ts +11 -0
  217. package/dist/shared/context/fallback-context.d.ts.map +1 -0
  218. package/dist/shared/context/fallback-context.js +4 -0
  219. package/dist/shared/context/fallback-context.js.map +1 -0
  220. package/dist/shared/context/global-task-context.d.ts +40 -0
  221. package/dist/shared/context/global-task-context.d.ts.map +1 -0
  222. package/dist/shared/context/global-task-context.js +78 -0
  223. package/dist/shared/context/global-task-context.js.map +1 -0
  224. package/dist/shared/context/importers-context.d.ts +7 -0
  225. package/dist/shared/context/importers-context.d.ts.map +1 -0
  226. package/dist/shared/context/importers-context.js +4 -0
  227. package/dist/shared/context/importers-context.js.map +1 -0
  228. package/dist/shared/context/index.d.ts +10 -0
  229. package/dist/shared/context/index.d.ts.map +1 -0
  230. package/dist/shared/context/index.js +10 -0
  231. package/dist/shared/context/index.js.map +1 -0
  232. package/dist/shared/context/registries-context.d.ts +21 -0
  233. package/dist/shared/context/registries-context.d.ts.map +1 -0
  234. package/dist/shared/context/registries-context.js +8 -0
  235. package/dist/shared/context/registries-context.js.map +1 -0
  236. package/dist/shared/context/variable-context.d.ts +10 -0
  237. package/dist/shared/context/variable-context.d.ts.map +1 -0
  238. package/dist/shared/context/variable-context.js +4 -0
  239. package/dist/shared/context/variable-context.js.map +1 -0
  240. package/dist/shared/context/websocket-context.d.ts +8 -0
  241. package/dist/shared/context/websocket-context.d.ts.map +1 -0
  242. package/dist/shared/context/websocket-context.js +4 -0
  243. package/dist/shared/context/websocket-context.js.map +1 -0
  244. package/dist/shared/dynamic-component/dynamic-component.d.ts +16 -0
  245. package/dist/shared/dynamic-component/dynamic-component.d.ts.map +1 -0
  246. package/dist/shared/dynamic-component/dynamic-component.js +243 -0
  247. package/dist/shared/dynamic-component/dynamic-component.js.map +1 -0
  248. package/dist/shared/error-handling/error-display.d.ts +8 -0
  249. package/dist/shared/error-handling/error-display.d.ts.map +1 -0
  250. package/dist/shared/error-handling/error-display.js +92 -0
  251. package/dist/shared/error-handling/error-display.js.map +1 -0
  252. package/dist/shared/error-handling/index.d.ts +3 -0
  253. package/dist/shared/error-handling/index.d.ts.map +1 -0
  254. package/dist/shared/error-handling/index.js +3 -0
  255. package/dist/shared/error-handling/index.js.map +1 -0
  256. package/dist/shared/error-handling/types.d.ts +10 -0
  257. package/dist/shared/error-handling/types.d.ts.map +1 -0
  258. package/dist/shared/error-handling/types.js +9 -0
  259. package/dist/shared/error-handling/types.js.map +1 -0
  260. package/dist/shared/index.d.ts +11 -0
  261. package/dist/shared/index.d.ts.map +1 -0
  262. package/dist/shared/index.js +9 -0
  263. package/dist/shared/index.js.map +1 -0
  264. package/dist/shared/interactivity/data-variable.d.ts +66 -0
  265. package/dist/shared/interactivity/data-variable.d.ts.map +1 -0
  266. package/dist/shared/interactivity/data-variable.js +186 -0
  267. package/dist/shared/interactivity/data-variable.js.map +1 -0
  268. package/dist/shared/interactivity/derived-variable.d.ts +153 -0
  269. package/dist/shared/interactivity/derived-variable.d.ts.map +1 -0
  270. package/dist/shared/interactivity/derived-variable.js +403 -0
  271. package/dist/shared/interactivity/derived-variable.js.map +1 -0
  272. package/dist/shared/interactivity/filtering.d.ts +9 -0
  273. package/dist/shared/interactivity/filtering.d.ts.map +1 -0
  274. package/dist/shared/interactivity/filtering.js +20 -0
  275. package/dist/shared/interactivity/filtering.js.map +1 -0
  276. package/dist/shared/interactivity/index.d.ts +12 -0
  277. package/dist/shared/interactivity/index.d.ts.map +1 -0
  278. package/dist/shared/interactivity/index.js +11 -0
  279. package/dist/shared/interactivity/index.js.map +1 -0
  280. package/dist/shared/interactivity/internal.d.ts +8 -0
  281. package/dist/shared/interactivity/internal.d.ts.map +1 -0
  282. package/dist/shared/interactivity/internal.js +10 -0
  283. package/dist/shared/interactivity/internal.js.map +1 -0
  284. package/dist/shared/interactivity/nested.d.ts +16 -0
  285. package/dist/shared/interactivity/nested.d.ts.map +1 -0
  286. package/dist/shared/interactivity/nested.js +50 -0
  287. package/dist/shared/interactivity/nested.js.map +1 -0
  288. package/dist/shared/interactivity/plain-variable.d.ts +23 -0
  289. package/dist/shared/interactivity/plain-variable.d.ts.map +1 -0
  290. package/dist/shared/interactivity/plain-variable.js +89 -0
  291. package/dist/shared/interactivity/plain-variable.js.map +1 -0
  292. package/dist/shared/interactivity/resolve-value.d.ts +13 -0
  293. package/dist/shared/interactivity/resolve-value.d.ts.map +1 -0
  294. package/dist/shared/interactivity/resolve-value.js +36 -0
  295. package/dist/shared/interactivity/resolve-value.js.map +1 -0
  296. package/dist/shared/interactivity/resolve-variable.d.ts +18 -0
  297. package/dist/shared/interactivity/resolve-variable.d.ts.map +1 -0
  298. package/dist/shared/interactivity/resolve-variable.js +47 -0
  299. package/dist/shared/interactivity/resolve-variable.js.map +1 -0
  300. package/dist/shared/interactivity/store.d.ts +35 -0
  301. package/dist/shared/interactivity/store.d.ts.map +1 -0
  302. package/dist/shared/interactivity/store.js +47 -0
  303. package/dist/shared/interactivity/store.js.map +1 -0
  304. package/dist/shared/interactivity/triggers.d.ts +31 -0
  305. package/dist/shared/interactivity/triggers.d.ts.map +1 -0
  306. package/dist/shared/interactivity/triggers.js +105 -0
  307. package/dist/shared/interactivity/triggers.js.map +1 -0
  308. package/dist/shared/interactivity/url-variable.d.ts +12 -0
  309. package/dist/shared/interactivity/url-variable.d.ts.map +1 -0
  310. package/dist/shared/interactivity/url-variable.js +28 -0
  311. package/dist/shared/interactivity/url-variable.js.map +1 -0
  312. package/dist/shared/interactivity/use-any-variable.d.ts +8 -0
  313. package/dist/shared/interactivity/use-any-variable.d.ts.map +1 -0
  314. package/dist/shared/interactivity/use-any-variable.js +38 -0
  315. package/dist/shared/interactivity/use-any-variable.js.map +1 -0
  316. package/dist/shared/interactivity/use-data-variable.d.ts +12 -0
  317. package/dist/shared/interactivity/use-data-variable.d.ts.map +1 -0
  318. package/dist/shared/interactivity/use-data-variable.js +56 -0
  319. package/dist/shared/interactivity/use-data-variable.js.map +1 -0
  320. package/dist/shared/interactivity/use-refresh-selector.d.ts +5 -0
  321. package/dist/shared/interactivity/use-refresh-selector.d.ts.map +1 -0
  322. package/dist/shared/interactivity/use-refresh-selector.js +16 -0
  323. package/dist/shared/interactivity/use-refresh-selector.js.map +1 -0
  324. package/dist/shared/interactivity/use-reset-variables.d.ts +8 -0
  325. package/dist/shared/interactivity/use-reset-variables.d.ts.map +1 -0
  326. package/dist/shared/interactivity/use-reset-variables.js +46 -0
  327. package/dist/shared/interactivity/use-reset-variables.js.map +1 -0
  328. package/dist/shared/interactivity/use-server-component.d.ts +24 -0
  329. package/dist/shared/interactivity/use-server-component.d.ts.map +1 -0
  330. package/dist/shared/interactivity/use-server-component.js +227 -0
  331. package/dist/shared/interactivity/use-server-component.js.map +1 -0
  332. package/dist/shared/interactivity/use-trigger-variable.d.ts +9 -0
  333. package/dist/shared/interactivity/use-trigger-variable.d.ts.map +1 -0
  334. package/dist/shared/interactivity/use-trigger-variable.js +18 -0
  335. package/dist/shared/interactivity/use-trigger-variable.js.map +1 -0
  336. package/dist/shared/interactivity/use-variable-state.d.ts +9 -0
  337. package/dist/shared/interactivity/use-variable-state.d.ts.map +1 -0
  338. package/dist/shared/interactivity/use-variable-state.js +35 -0
  339. package/dist/shared/interactivity/use-variable-state.js.map +1 -0
  340. package/dist/shared/interactivity/use-variable-value.d.ts +20 -0
  341. package/dist/shared/interactivity/use-variable-value.d.ts.map +1 -0
  342. package/dist/shared/interactivity/use-variable-value.js +77 -0
  343. package/dist/shared/interactivity/use-variable-value.js.map +1 -0
  344. package/dist/shared/interactivity/use-variable.d.ts +11 -0
  345. package/dist/shared/interactivity/use-variable.d.ts.map +1 -0
  346. package/dist/shared/interactivity/use-variable.js +62 -0
  347. package/dist/shared/interactivity/use-variable.js.map +1 -0
  348. package/dist/shared/private-route/private-route.d.ts +23 -0
  349. package/dist/shared/private-route/private-route.d.ts.map +1 -0
  350. package/dist/shared/private-route/private-route.js +39 -0
  351. package/dist/shared/private-route/private-route.js.map +1 -0
  352. package/dist/shared/template-root/dynamic-context.d.ts +9 -0
  353. package/dist/shared/template-root/dynamic-context.d.ts.map +1 -0
  354. package/dist/shared/template-root/dynamic-context.js +28 -0
  355. package/dist/shared/template-root/dynamic-context.js.map +1 -0
  356. package/dist/shared/template-root/template-root.d.ts +8 -0
  357. package/dist/shared/template-root/template-root.d.ts.map +1 -0
  358. package/dist/shared/template-root/template-root.js +76 -0
  359. package/dist/shared/template-root/template-root.js.map +1 -0
  360. package/dist/shared/utils/clean-session-cache.d.ts +9 -0
  361. package/dist/shared/utils/clean-session-cache.d.ts.map +1 -0
  362. package/dist/shared/utils/clean-session-cache.js +17 -0
  363. package/dist/shared/utils/clean-session-cache.js.map +1 -0
  364. package/dist/shared/utils/embed.d.ts +13 -0
  365. package/dist/shared/utils/embed.d.ts.map +1 -0
  366. package/dist/shared/utils/embed.js +23 -0
  367. package/dist/shared/utils/embed.js.map +1 -0
  368. package/dist/shared/utils/get-icon.d.ts +9 -0
  369. package/dist/shared/utils/get-icon.d.ts.map +1 -0
  370. package/dist/shared/utils/get-icon.js +30 -0
  371. package/dist/shared/utils/get-icon.js.map +1 -0
  372. package/dist/shared/utils/hashing.d.ts +14 -0
  373. package/dist/shared/utils/hashing.d.ts.map +1 -0
  374. package/dist/shared/utils/hashing.js +26 -0
  375. package/dist/shared/utils/hashing.js.map +1 -0
  376. package/dist/shared/utils/index.d.ts +18 -0
  377. package/dist/shared/utils/index.d.ts.map +1 -0
  378. package/dist/shared/utils/index.js +16 -0
  379. package/dist/shared/utils/index.js.map +1 -0
  380. package/dist/shared/utils/inject-css.d.ts +13 -0
  381. package/dist/shared/utils/inject-css.d.ts.map +1 -0
  382. package/dist/shared/utils/inject-css.js +25 -0
  383. package/dist/shared/utils/inject-css.js.map +1 -0
  384. package/dist/shared/utils/is-js-component.d.ts +9 -0
  385. package/dist/shared/utils/is-js-component.d.ts.map +1 -0
  386. package/dist/shared/utils/is-js-component.js +11 -0
  387. package/dist/shared/utils/is-js-component.js.map +1 -0
  388. package/dist/shared/utils/normalization.d.ts +19 -0
  389. package/dist/shared/utils/normalization.d.ts.map +1 -0
  390. package/dist/shared/utils/normalization.js +118 -0
  391. package/dist/shared/utils/normalization.js.map +1 -0
  392. package/dist/shared/utils/resolve-theme.d.ts +9 -0
  393. package/dist/shared/utils/resolve-theme.d.ts.map +1 -0
  394. package/dist/shared/utils/resolve-theme.js +28 -0
  395. package/dist/shared/utils/resolve-theme.js.map +1 -0
  396. package/dist/shared/utils/templating.d.ts +24 -0
  397. package/dist/shared/utils/templating.d.ts.map +1 -0
  398. package/dist/shared/utils/templating.js +67 -0
  399. package/dist/shared/utils/templating.js.map +1 -0
  400. package/dist/shared/utils/use-action-registry.d.ts +11 -0
  401. package/dist/shared/utils/use-action-registry.d.ts.map +1 -0
  402. package/dist/shared/utils/use-action-registry.js +18 -0
  403. package/dist/shared/utils/use-action-registry.js.map +1 -0
  404. package/dist/shared/utils/use-action.d.ts +9 -0
  405. package/dist/shared/utils/use-action.d.ts.map +1 -0
  406. package/dist/shared/utils/use-action.js +84 -0
  407. package/dist/shared/utils/use-action.js.map +1 -0
  408. package/dist/shared/utils/use-component-registry.d.ts +11 -0
  409. package/dist/shared/utils/use-component-registry.d.ts.map +1 -0
  410. package/dist/shared/utils/use-component-registry.js +46 -0
  411. package/dist/shared/utils/use-component-registry.js.map +1 -0
  412. package/dist/shared/utils/use-component-styles.d.ts +24 -0
  413. package/dist/shared/utils/use-component-styles.d.ts.map +1 -0
  414. package/dist/shared/utils/use-component-styles.js +68 -0
  415. package/dist/shared/utils/use-component-styles.js.map +1 -0
  416. package/dist/shared/utils/use-defer-loadable.d.ts +8 -0
  417. package/dist/shared/utils/use-defer-loadable.d.ts.map +1 -0
  418. package/dist/shared/utils/use-defer-loadable.js +44 -0
  419. package/dist/shared/utils/use-defer-loadable.js.map +1 -0
  420. package/dist/shared/utils/use-interval.d.ts +9 -0
  421. package/dist/shared/utils/use-interval.d.ts.map +1 -0
  422. package/dist/shared/utils/use-interval.js +18 -0
  423. package/dist/shared/utils/use-interval.js.map +1 -0
  424. package/dist/shared/utils/use-previous.d.ts +10 -0
  425. package/dist/shared/utils/use-previous.d.ts.map +1 -0
  426. package/dist/shared/utils/use-previous.js +17 -0
  427. package/dist/shared/utils/use-previous.js.map +1 -0
  428. package/dist/shared/utils/use-url-sync.d.ts +20 -0
  429. package/dist/shared/utils/use-url-sync.d.ts.map +1 -0
  430. package/dist/shared/utils/use-url-sync.js +68 -0
  431. package/dist/shared/utils/use-url-sync.js.map +1 -0
  432. package/dist/shared/utils/use-window-title.d.ts +3 -0
  433. package/dist/shared/utils/use-window-title.d.ts.map +1 -0
  434. package/dist/shared/utils/use-window-title.js +14 -0
  435. package/dist/shared/utils/use-window-title.js.map +1 -0
  436. package/dist/shared/variable-state-provider/variable-state-provider.d.ts +10 -0
  437. package/dist/shared/variable-state-provider/variable-state-provider.d.ts.map +1 -0
  438. package/dist/shared/variable-state-provider/variable-state-provider.js +21 -0
  439. package/dist/shared/variable-state-provider/variable-state-provider.js.map +1 -0
  440. package/dist/shared/wrapper/wrapper.d.ts +7 -0
  441. package/dist/shared/wrapper/wrapper.d.ts.map +1 -0
  442. package/dist/shared/wrapper/wrapper.js +14 -0
  443. package/dist/shared/wrapper/wrapper.js.map +1 -0
  444. package/dist/types/auth.d.ts +15 -0
  445. package/dist/types/auth.d.ts.map +1 -0
  446. package/dist/types/auth.js +6 -0
  447. package/dist/types/auth.js.map +1 -0
  448. package/dist/types/core.d.ts +325 -0
  449. package/dist/types/core.d.ts.map +1 -0
  450. package/dist/types/core.js +22 -0
  451. package/dist/types/core.js.map +1 -0
  452. package/dist/types/index.d.ts +7 -0
  453. package/dist/types/index.d.ts.map +1 -0
  454. package/dist/types/index.js +4 -0
  455. package/dist/types/index.js.map +1 -0
  456. package/dist/types/utils.d.ts +50 -0
  457. package/dist/types/utils.d.ts.map +1 -0
  458. package/dist/types/utils.js +84 -0
  459. package/dist/types/utils.js.map +1 -0
  460. package/dist/umd/dara.core.umd.js +93592 -0
  461. package/dist/umd/style.css +848 -0
  462. package/package.json +117 -0
@@ -0,0 +1,403 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
21
+ import { isEqual } from 'lodash';
22
+ import { useCallback, useMemo } from 'react';
23
+ import { selector, useRecoilValue, useSetRecoilState } from 'recoil';
24
+ import { BehaviorSubject, from } from 'rxjs';
25
+ import { debounceTime, filter, share, switchMap, take } from 'rxjs/operators';
26
+ import shortid from 'shortid';
27
+ import { HTTP_METHOD, validateResponse } from '@darajs/ui-utils';
28
+ import { fetchTaskResult, request } from '../../api';
29
+ import { getUniqueIdentifier } from '../../shared/utils/hashing';
30
+ import { normalizeRequest } from '../../shared/utils/normalization';
31
+ import useInterval from '../../shared/utils/use-interval';
32
+ import { isDerivedDataVariable, isDerivedVariable, isResolvedDataVariable, isResolvedDerivedDataVariable, isResolvedDerivedVariable, } from '../../types';
33
+ // eslint-disable-next-line import/no-cycle
34
+ import { getOrRegisterTrigger, registerChildTriggers, resolveNested, resolveVariable } from './internal';
35
+ import { depsRegistry, getRegistryKey, selectorRegistry } from './store';
36
+ export function isTaskResponse(dvResponse) {
37
+ return 'task_id' in dvResponse;
38
+ }
39
+ /**
40
+ * Format values into a shape expected by the backend.
41
+ *
42
+ * @param values list of values - plain values or ResolvedDerivedVariable constructs with plain values nested inside
43
+ */
44
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
45
+ export function formatDerivedVariableRequest(values) {
46
+ return values.map((val) => {
47
+ if (isResolvedDerivedVariable(val) || isResolvedDerivedDataVariable(val)) {
48
+ const { deps, values: nestedValues } = val, rest = __rest(val, ["deps", "values"]);
49
+ // Recursively remove deps from request
50
+ // Append force: false - it's sent separately in the request at the top level but we append it recursively
51
+ // to keep the request shape consistent with the PythonWrapper requests
52
+ return Object.assign(Object.assign({}, rest), { force: false, values: formatDerivedVariableRequest(nestedValues) });
53
+ }
54
+ return val;
55
+ });
56
+ }
57
+ /**
58
+ * Fetch the value of a derived variable from the backend
59
+ *
60
+ * @param input Function inputs
61
+ * - `cache`, the cache option for the derived variable.
62
+ * - `force`, send force=true in the request body
63
+ * - `sessionToken`, bearer token for the session
64
+ * - `uid`, the uid of the derived variable
65
+ * - `values`, values to pass in the request
66
+ * - `wsClient`, websocket client
67
+ */
68
+ export function fetchDerivedVariable({ cache, force, token, uid, values, wsClient, is_data_variable = false, }) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const cacheControl = cache === null
71
+ ? {
72
+ 'cache-control': 'none',
73
+ }
74
+ : undefined;
75
+ const ws_channel = yield wsClient.getChannel();
76
+ const res = yield request(`/api/core/derived-variable/${uid}`, {
77
+ body: JSON.stringify({ force, is_data_variable, values, ws_channel }),
78
+ headers: Object.assign({}, cacheControl),
79
+ method: HTTP_METHOD.POST,
80
+ }, token);
81
+ yield validateResponse(res, `Failed to fetch the derived variable with uid: ${uid}`);
82
+ return res.json();
83
+ });
84
+ }
85
+ /**
86
+ * Add a debounced version of the fetch so as to not overload the backend on startup. This needs to be cached per uid
87
+ * so that we only debounce calls to the same DerivedVariable. Debouncing is done with rxjs as everything here is
88
+ * promise based and async
89
+ */
90
+ const debouncedFetchSubjects = {};
91
+ const debouncedFetchCache = {};
92
+ function debouncedFetchDerivedVariable({ uid, values, wsClient, force, token, cache, is_data_variable = false, }) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ // If this is the first time this is called then set up a subject and return stream for this variable.
95
+ if (!debouncedFetchSubjects[uid]) {
96
+ debouncedFetchSubjects[uid] = new BehaviorSubject(null);
97
+ debouncedFetchCache[uid] = debouncedFetchSubjects[uid].pipe(filter((args) => !!args), debounceTime(10), switchMap((args) => from(fetchDerivedVariable(args))), share());
98
+ }
99
+ // Push the next set of args to the subject
100
+ debouncedFetchSubjects[uid].next({ cache, force, is_data_variable, token, uid, values, wsClient });
101
+ // Return the debounced response from the backend
102
+ return new Promise((resolve, reject) => {
103
+ debouncedFetchCache[uid].pipe(take(1)).subscribe(resolve, reject);
104
+ });
105
+ });
106
+ }
107
+ /**
108
+ * Resolve a value to a format understood by the backend, resolving atoms to values.
109
+ *
110
+ * @param value value to resolve
111
+ * @param getter recoil getter function
112
+ */
113
+ export function resolveValue(value, getter) {
114
+ if (isResolvedDerivedVariable(value) || isResolvedDerivedDataVariable(value)) {
115
+ const resolvedValues = value.values.map((v) => resolveValue(v, getter));
116
+ return Object.assign(Object.assign({}, value), { values: resolvedValues });
117
+ }
118
+ if (isResolvedDataVariable(value)) {
119
+ return value;
120
+ }
121
+ return getter(value);
122
+ }
123
+ /**
124
+ * Recursively build a deps array from a list of values
125
+ * Values not in deps array are replaced with empty array
126
+ *
127
+ * @param values array of primitives and ResolvedDerivedVariable objects
128
+ * @param deps array of indexes of dependencies to get values from
129
+ */
130
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
131
+ export function getDeps(values, deps) {
132
+ return values.map((val, idx) => {
133
+ if (deps && !deps.includes(idx)) {
134
+ return [];
135
+ }
136
+ return isResolvedDerivedVariable(val) || isResolvedDerivedDataVariable(val)
137
+ ? getDeps(val.values, val.deps).flat()
138
+ : val;
139
+ });
140
+ }
141
+ /**
142
+ * A helper hook that turns a DerivedVariable into its trigger index value.
143
+ * Useful to subscribe a component to forced trigger updates.
144
+ *
145
+ * @param variable variable to use
146
+ */
147
+ export function useTriggerIndex(variable) {
148
+ return useRecoilValue(getOrRegisterTrigger(variable));
149
+ }
150
+ /**
151
+ * Resolve a derived value from a list of dependant variables and their resolved values.
152
+ *
153
+ * Handles a dependency array, where in case 'relevant' (i.e. present in deps) values did not change,
154
+ * an earlier result from the `depsRegistry` is returned.
155
+ *
156
+ * This is the core of the derived variable resolution logic, extracted so that it can be used in both
157
+ * DerivedVariable and py_component logic.
158
+ *
159
+ * @param key unique key to look up `depsRegistry` entry from
160
+ * @param variables dependant variables
161
+ * @param deps list of relevant dependant variables, akin to useEffect dependency array
162
+ * @param resolvedVariables resolved values of dependant variables - turned into primitives and Resolved forms
163
+ * @param wsClient websocket client
164
+ * @param get getter function to resolve atoms to values
165
+ * @param selfTrigger additional trigger index value to register as a dependency
166
+ */
167
+ export function resolveDerivedValue(key, variables, deps, resolvedVariables, wsClient, get, selfTrigger) {
168
+ return __awaiter(this, void 0, void 0, function* () {
169
+ // Register nested triggers as dependencies so triggering one of the nested derived variables will trigger a recalculation here
170
+ const triggers = registerChildTriggers(variables, wsClient, get);
171
+ if (selfTrigger) {
172
+ triggers.unshift(selfTrigger);
173
+ }
174
+ /**
175
+ * Array of values:
176
+ * - simple variables are resolved to their values
177
+ * - derived variables are resolved to ResolvedDerivedVariable objects with nested values/deps resolved to values
178
+ * - ResolvedDataVariable objects are left as is
179
+ */
180
+ const values = resolvedVariables.map((v) => resolveValue(v, get));
181
+ /**
182
+ * Array of values with ResolvedDerivedVariable objects replaced
183
+ * (recursively) by nested arrays of their dependency values
184
+ *
185
+ * Dependencies which aren't included in `deps` are replaced with empty arrays
186
+ */
187
+ const depsValues = getDeps(values);
188
+ /**
189
+ * A map of variable UID-nested -> its primitive value (or array of dependencies).
190
+ * Only includes variables present in deps
191
+ *
192
+ * `nested` is used to generate a key so that the same variable with different nested property will be
193
+ * present in the map separately.
194
+ */
195
+ const variableValueMap = variables.reduce((acc, v, idx) => acc.set(getUniqueIdentifier(v), depsValues[idx]), new Map());
196
+ let recalculateForced = false; // whether the recalculation was forced or not (by calling trigger with force=true)
197
+ let wasTriggered = false; // whether a trigger caused the selector execution
198
+ let wasTriggeredItself = false; // whether the variable's own trigger caused the selector execution
199
+ /**
200
+ * Deps handling
201
+ */
202
+ const previousEntry = depsRegistry.get(key);
203
+ // Get relevant values based on deps
204
+ const relevantValues = deps
205
+ .map((dep) => variableValueMap.get(getUniqueIdentifier(dep)))
206
+ .concat(triggers.map((trigger) => trigger.inc)); // Append triggerValues to make triggers force a recalc even when deps didn't change
207
+ // If there's no entry it's the first run so skip; otherwise:
208
+ if (previousEntry) {
209
+ const areArgsTheSame = isEqual(previousEntry.args, relevantValues);
210
+ // If the relevant arg values didn't change, return previous result
211
+ if (areArgsTheSame) {
212
+ return {
213
+ entry: previousEntry,
214
+ type: 'previous',
215
+ };
216
+ }
217
+ // Otherwise continue and fetch new value, but first check what caused the change
218
+ // Assumption: Triggers are always stored after the values, with the triggers of the current variable being first
219
+ const previousTriggerCounters = previousEntry.args.slice(previousEntry.args.length - triggers.length);
220
+ for (const [idx, triggerValue] of triggers.entries()) {
221
+ /**
222
+ * If any of the nested trigger value has changed (this execution was caused by a trigger)
223
+ * update whether it was called with a `force` flag or not - based on the trigger that changed
224
+ */
225
+ if (triggerValue.inc !== previousTriggerCounters[idx]) {
226
+ recalculateForced = triggerValue.force;
227
+ // Record whether its own trigger was the one that caused the change
228
+ if (idx === 0) {
229
+ wasTriggeredItself = true;
230
+ }
231
+ wasTriggered = true;
232
+ break;
233
+ }
234
+ }
235
+ }
236
+ // if it was triggered but not by its own trigger, wait 50ms to let the triggered variable run first
237
+ if (wasTriggered && !wasTriggeredItself) {
238
+ yield new Promise((resolve) => setTimeout(resolve, 50));
239
+ }
240
+ return {
241
+ force: recalculateForced,
242
+ relevantValues,
243
+ type: 'current',
244
+ values,
245
+ };
246
+ });
247
+ }
248
+ /**
249
+ * Get a derived variable from the selector registry, registering it if not already registered
250
+ *
251
+ * @param variable variable to register
252
+ * @param wsClient WebSocket client from context
253
+ * @param tasks tasks list from context
254
+ * @param search search query from location
255
+ * @param sessionToken session token from context
256
+ */
257
+ export function getOrRegisterDerivedVariable(variable, wsClient, taskContext, search, token) {
258
+ const key = getRegistryKey(variable, 'selector');
259
+ if (!selectorRegistry.has(key)) {
260
+ /**
261
+ * Recursively resolve variables to list of values
262
+ *
263
+ * For derived variables, put ResolvedDerivedVariable object with values resolved to recoil atoms/selectors,
264
+ * and deps resolved to array of indexes of variables (or null if not set)
265
+ * For data variables, put ResolvedDataVariable object.
266
+ */
267
+ const resolvedVariables = variable.variables.map((v) => resolveVariable(v, wsClient, taskContext, search, token));
268
+ getOrRegisterTrigger(variable);
269
+ selectorRegistry.set(key, selector({
270
+ cachePolicy_UNSTABLE: {
271
+ eviction: 'most-recent',
272
+ },
273
+ get: ({ get }) => __awaiter(this, void 0, void 0, function* () {
274
+ const selfTrigger = get(getOrRegisterTrigger(variable));
275
+ const derivedResult = yield resolveDerivedValue(key, variable.variables, variable.deps, resolvedVariables, wsClient, get, selfTrigger);
276
+ if (derivedResult.type === 'previous') {
277
+ return { cache_key: derivedResult.entry.cacheKey, value: derivedResult.entry.result };
278
+ }
279
+ let variableResponse = null;
280
+ try {
281
+ variableResponse = yield debouncedFetchDerivedVariable({
282
+ cache: variable.cache,
283
+ force: derivedResult.force,
284
+ is_data_variable: isDerivedDataVariable(variable),
285
+ token,
286
+ uid: variable.uid,
287
+ values: normalizeRequest(formatDerivedVariableRequest(derivedResult.values), variable.variables),
288
+ wsClient,
289
+ });
290
+ }
291
+ catch (e) {
292
+ // On DV error put selectorId into the error so the boundary can reset the selector cache
293
+ e.selectorId = key;
294
+ throw e;
295
+ }
296
+ const cacheKey = variableResponse.cache_key;
297
+ let variableValue = null;
298
+ // We're only interested in the actual value for DVs.
299
+ // For DerivedDataVariables we only need the cache key and the backend will handle the rest, regardless
300
+ // of whether it's running as a task or not
301
+ if (isDerivedVariable(variable)) {
302
+ // If there is a task running related to the current variable then something has changed, so cancel them
303
+ taskContext.cleanupRunningTasks(variable.uid);
304
+ // If the variable is computed as a task then wait for it to finish and fetch the result
305
+ if (isTaskResponse(variableResponse)) {
306
+ const taskId = variableResponse.task_id;
307
+ // register task being started
308
+ taskContext.startTask(taskId, variable.uid, getRegistryKey(variable, 'trigger'));
309
+ try {
310
+ yield wsClient.waitForTask(taskId);
311
+ }
312
+ catch (_a) {
313
+ // If there was an error waiting for task it means it was cancelled (by a re-run)
314
+ // It should be safe to return `null` here as the selector will re-run and throw suspense again
315
+ return {
316
+ cache_key: cacheKey,
317
+ value: null,
318
+ };
319
+ }
320
+ finally {
321
+ taskContext.endTask(taskId);
322
+ }
323
+ try {
324
+ variableValue = yield fetchTaskResult(taskId, token);
325
+ }
326
+ catch (e) {
327
+ // On DV task error put selectorId into the error so the boundary can reset the selector cache
328
+ e.selectorId = key;
329
+ throw e;
330
+ }
331
+ }
332
+ else {
333
+ variableValue = variableResponse.value;
334
+ }
335
+ }
336
+ // Store the final result and arguments used if deps is specified
337
+ // resolve nested if defined (i.e. for DerivedVariable, DerivedDataVariable does not have nested)
338
+ variableValue =
339
+ 'nested' in variable ? resolveNested(variableValue, variable.nested) : variableValue;
340
+ depsRegistry.set(key, {
341
+ args: derivedResult.relevantValues,
342
+ cacheKey,
343
+ result: variableValue,
344
+ });
345
+ return {
346
+ cache_key: cacheKey,
347
+ value: variableValue,
348
+ };
349
+ }),
350
+ key: shortid.generate(),
351
+ }));
352
+ }
353
+ return selectorRegistry.get(key);
354
+ }
355
+ /**
356
+ * Get a derived selector for a derived variable.
357
+ * Retrieves the value of the derived variable directly instead of returning an object with cache_key and value.
358
+ *
359
+ * @param variable variable to register
360
+ * @param wsClient WebSocket client from context
361
+ * @param taskContext global task context
362
+ * @param search search query from location
363
+ * @param sessionToken session token from context
364
+ */
365
+ export function getOrRegisterDerivedVariableValue(variable, wsClient, taskContext, search, token) {
366
+ const dvSelector = getOrRegisterDerivedVariable(variable, wsClient, taskContext, search, token);
367
+ const key = getRegistryKey(variable, 'derived-selector');
368
+ if (!selectorRegistry.has(key)) {
369
+ selectorRegistry.set(key, selector({
370
+ get: ({ get }) => {
371
+ const dvResponse = get(dvSelector);
372
+ return dvResponse.value;
373
+ },
374
+ key: shortid.generate(),
375
+ }));
376
+ }
377
+ return selectorRegistry.get(key);
378
+ }
379
+ /**
380
+ * Helper hook to get the (data) derived variable selector, while correctly registering triggers and setting up polling interval.
381
+ *
382
+ * @param variable derived variable to use
383
+ * @param WsClient websocket client instance
384
+ * @param taskContext global task context
385
+ * @param search search query
386
+ * @param token auth context
387
+ */
388
+ export function useDerivedVariable(variable, WsClient, taskContext, search, token) {
389
+ const dvSelector = getOrRegisterDerivedVariable(variable, WsClient, taskContext, search, token);
390
+ /**
391
+ * Workaround for forcing a re-calculation for derived variables by creating a triggerIndex atom and making it a dependency of
392
+ * the recoil selector. This way the selector can be re-run and derived variable can be re-fetched from the
393
+ * backend by just updating this atom.
394
+ */
395
+ const triggerIndex = useMemo(() => getOrRegisterTrigger(variable), []);
396
+ // Creating a setter function for triggerIndex
397
+ const triggerUpdates = useSetRecoilState(triggerIndex);
398
+ const trigger = useCallback((force = true) => triggerUpdates((val) => ({ force, inc: val.inc + 1 })), [triggerUpdates]);
399
+ // Using useInterval to poll, forcing recalculation everytime
400
+ useInterval(trigger, variable.polling_interval);
401
+ return dvSelector;
402
+ }
403
+ //# sourceMappingURL=derived-variable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derived-variable.js","sourceRoot":"","sources":["../../../js/shared/interactivity/derived-variable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAA+B,QAAQ,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAClG,OAAO,EAAE,eAAe,EAAc,IAAI,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAA4B,eAAe,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,m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G,CAChB,GAAG,EACH,QAAQ,CAAC;YACL,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;gBACb,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;gBACnC,OAAO,UAAU,CAAC,KAAK,CAAC;YAC5B,CAAC;YACD,GAAG,EAAE,OAAO,CAAC,QAAQ,EAAE;SAC1B,CAAC,CACL,CAAC;KACL;IAED,OAAO,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAC9B,QAA+C,EAC/C,QAAkC,EAClC,WAA8B,EAC9B,MAAc,EACd,KAAa;IAEb,MAAM,UAAU,GAAG,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEhG;;;;OAIG;IACH,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEvE,8CAA8C;IAC9C,MAAM,cAAc,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,WAAW,CACvB,CAAC,KAAK,GAAG,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,EACxE,CAAC,cAAc,CAAC,CACnB,CAAC;IAEF,6DAA6D;IAC7D,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAEhD,OAAO,UAAU,CAAC;AACtB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { FilterQuery, QueryCombinator } from '../../types';
2
+ /**
3
+ * Combine filters with a given combinator
4
+ *
5
+ * @param combinator combinator to use
6
+ * @param queries any number of queries to combine
7
+ */
8
+ export declare function combineFilters(combinator: QueryCombinator, queries: FilterQuery[]): FilterQuery;
9
+ //# sourceMappingURL=filtering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/filtering.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,WAAW,CAe/F"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Combine filters with a given combinator
3
+ *
4
+ * @param combinator combinator to use
5
+ * @param queries any number of queries to combine
6
+ */
7
+ export function combineFilters(combinator, queries) {
8
+ const validQueries = queries.filter(Boolean); // filter out undefined/null values
9
+ if (validQueries.length === 0) {
10
+ return null;
11
+ }
12
+ if (validQueries.length === 1) {
13
+ return validQueries[0];
14
+ }
15
+ return {
16
+ clauses: validQueries,
17
+ combinator,
18
+ };
19
+ }
20
+ //# sourceMappingURL=filtering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filtering.js","sourceRoot":"","sources":["../../../js/shared/interactivity/filtering.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,UAA2B,EAAE,OAAsB;IAC9E,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,mCAAmC;IAEjF,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3B,OAAO,IAAI,CAAC;KACf;IAED,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3B,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;KAC1B;IAED,OAAO;QACH,OAAO,EAAE,YAAY;QACrB,UAAU;KACb,CAAC;AACN,CAAC"}
@@ -0,0 +1,12 @@
1
+ export { useVariable } from './use-variable';
2
+ export { useAnyVariable } from './use-any-variable';
3
+ export { default as useVariableValue } from './use-variable-value';
4
+ export { resolveValue } from './resolve-value';
5
+ export { default as useResetVariables } from './use-reset-variables';
6
+ export { default as useTriggerVariable } from './use-trigger-variable';
7
+ export { TriggerIndexValue } from './store';
8
+ export { useDataVariable } from './use-data-variable';
9
+ export { combineFilters } from './filtering';
10
+ export { default as useRefreshSelector } from './use-refresh-selector';
11
+ export { default as useVariableState } from './use-variable-state';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export { useVariable } from './use-variable';
2
+ export { useAnyVariable } from './use-any-variable';
3
+ export { default as useVariableValue } from './use-variable-value';
4
+ export { resolveValue } from './resolve-value';
5
+ export { default as useResetVariables } from './use-reset-variables';
6
+ export { default as useTriggerVariable } from './use-trigger-variable';
7
+ export { useDataVariable } from './use-data-variable';
8
+ export { combineFilters } from './filtering';
9
+ export { default as useRefreshSelector } from './use-refresh-selector';
10
+ export { default as useVariableState } from './use-variable-state';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../js/shared/interactivity/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from './plain-variable';
2
+ export * from './url-variable';
3
+ export * from './data-variable';
4
+ export * from './derived-variable';
5
+ export * from './nested';
6
+ export * from './triggers';
7
+ export * from './resolve-variable';
8
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/internal.tsx"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,10 @@
1
+ // ESLint does not understand this pattern, see: https://medium.com/visual-development/how-to-fix-nasty-circular-dependency-issues-once-and-for-all-in-javascript-typescript-a04c987cf0de
2
+ /* eslint-disable import/no-cycle */
3
+ export * from './plain-variable';
4
+ export * from './url-variable';
5
+ export * from './data-variable';
6
+ export * from './derived-variable';
7
+ export * from './nested';
8
+ export * from './triggers';
9
+ export * from './resolve-variable';
10
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../js/shared/interactivity/internal.tsx"],"names":[],"mappings":"AAAA,yLAAyL;AACzL,oCAAoC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Resolve the value of the variable using it's optional nested
3
+ *
4
+ * @param obj an object to resolve from
5
+ * @param nested a list of keys to resolve
6
+ */
7
+ export declare function resolveNested<T extends Record<string, any>>(obj: T, nested: string[]): any;
8
+ /**
9
+ * Set a nested value inside a given object.
10
+ *
11
+ * @param obj an object to set the value of
12
+ * @param nested a list of keys pointing at the value to set
13
+ * @param newValue a new value to set
14
+ */
15
+ export declare function setNested<T extends Record<string, any>>(obj: T, nested: string[], newValue: unknown): T;
16
+ //# sourceMappingURL=nested.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nested.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/nested.tsx"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAmB1F;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAG,CAAC,CAmBvG"}
@@ -0,0 +1,50 @@
1
+ import clone from 'lodash/clone';
2
+ import cloneDeep from 'lodash/cloneDeep';
3
+ /**
4
+ * Resolve the value of the variable using it's optional nested
5
+ *
6
+ * @param obj an object to resolve from
7
+ * @param nested a list of keys to resolve
8
+ */
9
+ export function resolveNested(obj, nested) {
10
+ // Nested not provided
11
+ if (!nested || nested.length === 0)
12
+ return obj;
13
+ // Not an object
14
+ if (!obj || !(typeof obj === 'object' && !Array.isArray(obj)))
15
+ return obj;
16
+ let returnVal = obj;
17
+ for (const key of nested) {
18
+ // If the key doesn't exist, return null as we're referring to a path which doesn't exist yet
19
+ if (!Object.keys(returnVal).includes(key)) {
20
+ return null;
21
+ }
22
+ returnVal = returnVal[key];
23
+ }
24
+ return returnVal;
25
+ }
26
+ /**
27
+ * Set a nested value inside a given object.
28
+ *
29
+ * @param obj an object to set the value of
30
+ * @param nested a list of keys pointing at the value to set
31
+ * @param newValue a new value to set
32
+ */
33
+ export function setNested(obj, nested, newValue) {
34
+ // Nested not provided
35
+ if (!nested || nested.length === 0)
36
+ return cloneDeep(obj);
37
+ // Not an object
38
+ if (!obj || !(typeof obj === 'object' && !Array.isArray(obj)))
39
+ return cloneDeep(obj);
40
+ // Need to clone to prevent reference issues
41
+ const cloned = clone(obj);
42
+ // If the key doesn't exist, create an empty object in case we're setting a nested value
43
+ const [key] = nested;
44
+ if (!Object.keys(obj).includes(key)) {
45
+ cloned[key] = {};
46
+ }
47
+ cloned[key] = nested.length === 1 ? newValue : setNested(cloned[key], nested.slice(1), newValue);
48
+ return cloned;
49
+ }
50
+ //# sourceMappingURL=nested.js.map
@@ -0,0 +1 @@
1
+ {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FAAwF;IACxF,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAChC,MAAc,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;KAC7B;IAEA,MAAc,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAE1G,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { RecoilState } from 'recoil';
2
+ import { WebSocketClientInterface } from '../../api';
3
+ import { GlobalTaskContext } from '../../shared/context/global-task-context';
4
+ import { SingleVariable } from '../../types';
5
+ /**
6
+ * Get the session key used to persist a variable value
7
+ *
8
+ * @param sessionToken current session token
9
+ * @param uid uid of the variable to persist
10
+ */
11
+ export declare function getSessionKey(sessionToken: string, uid: string): string;
12
+ /**
13
+ * Get a plain variable from the atom or selector registry (based on nested property),
14
+ * registering it if not already registered
15
+ *
16
+ * @param variable variable to register
17
+ * @param wsClient websocket client
18
+ * @param taskContext task context
19
+ * @param search search query
20
+ * @param token current session token
21
+ */
22
+ export declare function getOrRegisterPlainVariable<T>(variable: SingleVariable<T>, wsClient: WebSocketClientInterface, taskContext: GlobalTaskContext, search: string, token: string): RecoilState<T>;
23
+ //# sourceMappingURL=plain-variable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plain-variable.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/plain-variable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAqB,MAAM,SAAS,CAAC;AAM5D;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAOvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EACxC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,EAC3B,QAAQ,EAAE,wBAAwB,EAClC,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACd,WAAW,CAAC,CAAC,CAAC,CAkFhB"}