@darajs/core 0.4.8

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 (464) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +101 -0
  3. package/dist/actions/download-variable.d.ts +8 -0
  4. package/dist/actions/download-variable.d.ts.map +1 -0
  5. package/dist/actions/download-variable.js +140 -0
  6. package/dist/actions/download-variable.js.map +1 -0
  7. package/dist/actions/index.d.ts +7 -0
  8. package/dist/actions/index.d.ts.map +1 -0
  9. package/dist/actions/index.js +7 -0
  10. package/dist/actions/index.js.map +1 -0
  11. package/dist/actions/navigate-to.d.ts +8 -0
  12. package/dist/actions/navigate-to.d.ts.map +1 -0
  13. package/dist/actions/navigate-to.js +37 -0
  14. package/dist/actions/navigate-to.js.map +1 -0
  15. package/dist/actions/notify.d.ts +4 -0
  16. package/dist/actions/notify.d.ts.map +1 -0
  17. package/dist/actions/notify.js +11 -0
  18. package/dist/actions/notify.js.map +1 -0
  19. package/dist/actions/reset-variables.d.ts +8 -0
  20. package/dist/actions/reset-variables.d.ts.map +1 -0
  21. package/dist/actions/reset-variables.js +37 -0
  22. package/dist/actions/reset-variables.js.map +1 -0
  23. package/dist/actions/trigger-variable.d.ts +8 -0
  24. package/dist/actions/trigger-variable.d.ts.map +1 -0
  25. package/dist/actions/trigger-variable.js +14 -0
  26. package/dist/actions/trigger-variable.js.map +1 -0
  27. package/dist/actions/update-variable.d.ts +15 -0
  28. package/dist/actions/update-variable.d.ts.map +1 -0
  29. package/dist/actions/update-variable.js +56 -0
  30. package/dist/actions/update-variable.js.map +1 -0
  31. package/dist/api/core.d.ts +35 -0
  32. package/dist/api/core.d.ts.map +1 -0
  33. package/dist/api/core.js +112 -0
  34. package/dist/api/core.js.map +1 -0
  35. package/dist/api/http.d.ts +29 -0
  36. package/dist/api/http.d.ts.map +1 -0
  37. package/dist/api/http.js +126 -0
  38. package/dist/api/http.js.map +1 -0
  39. package/dist/api/index.d.ts +5 -0
  40. package/dist/api/index.d.ts.map +1 -0
  41. package/dist/api/index.js +5 -0
  42. package/dist/api/index.js.map +1 -0
  43. package/dist/api/websocket.d.ts +222 -0
  44. package/dist/api/websocket.d.ts.map +1 -0
  45. package/dist/api/websocket.js +353 -0
  46. package/dist/api/websocket.js.map +1 -0
  47. package/dist/assets/causalens-dark.svg +29 -0
  48. package/dist/assets/causalens-light.svg +29 -0
  49. package/dist/assets/dara-dark.svg +20 -0
  50. package/dist/assets/dara-light.svg +15 -0
  51. package/dist/assets/fonts/Manrope-VariableFont_wght.ttf +0 -0
  52. package/dist/auth/auth-wrapper.d.ts +15 -0
  53. package/dist/auth/auth-wrapper.d.ts.map +1 -0
  54. package/dist/auth/auth-wrapper.js +72 -0
  55. package/dist/auth/auth-wrapper.js.map +1 -0
  56. package/dist/auth/auth.d.ts +61 -0
  57. package/dist/auth/auth.d.ts.map +1 -0
  58. package/dist/auth/auth.js +163 -0
  59. package/dist/auth/auth.js.map +1 -0
  60. package/dist/auth/basic/basic-auth-login.d.ts +6 -0
  61. package/dist/auth/basic/basic-auth-login.d.ts.map +1 -0
  62. package/dist/auth/basic/basic-auth-login.js +171 -0
  63. package/dist/auth/basic/basic-auth-login.js.map +1 -0
  64. package/dist/auth/basic/basic-auth-logout.d.ts +6 -0
  65. package/dist/auth/basic/basic-auth-logout.d.ts.map +1 -0
  66. package/dist/auth/basic/basic-auth-logout.js +18 -0
  67. package/dist/auth/basic/basic-auth-logout.js.map +1 -0
  68. package/dist/auth/default/default-auth-login.d.ts +6 -0
  69. package/dist/auth/default/default-auth-login.d.ts.map +1 -0
  70. package/dist/auth/default/default-auth-login.js +59 -0
  71. package/dist/auth/default/default-auth-login.js.map +1 -0
  72. package/dist/auth/index.d.ts +7 -0
  73. package/dist/auth/index.d.ts.map +1 -0
  74. package/dist/auth/index.js +7 -0
  75. package/dist/auth/index.js.map +1 -0
  76. package/dist/auth/use-session-token.d.ts +19 -0
  77. package/dist/auth/use-session-token.d.ts.map +1 -0
  78. package/dist/auth/use-session-token.js +30 -0
  79. package/dist/auth/use-session-token.js.map +1 -0
  80. package/dist/components/fallback/default.d.ts +5 -0
  81. package/dist/components/fallback/default.d.ts.map +1 -0
  82. package/dist/components/fallback/default.js +10 -0
  83. package/dist/components/fallback/default.js.map +1 -0
  84. package/dist/components/fallback/dots.d.ts +7 -0
  85. package/dist/components/fallback/dots.d.ts.map +1 -0
  86. package/dist/components/fallback/dots.js +78 -0
  87. package/dist/components/fallback/dots.js.map +1 -0
  88. package/dist/components/fallback/row.d.ts +5 -0
  89. package/dist/components/fallback/row.d.ts.map +1 -0
  90. package/dist/components/fallback/row.js +14 -0
  91. package/dist/components/fallback/row.js.map +1 -0
  92. package/dist/components/for/for.d.ts +35 -0
  93. package/dist/components/for/for.d.ts.map +1 -0
  94. package/dist/components/for/for.js +44 -0
  95. package/dist/components/for/for.js.map +1 -0
  96. package/dist/components/index.d.ts +9 -0
  97. package/dist/components/index.d.ts.map +1 -0
  98. package/dist/components/index.js +9 -0
  99. package/dist/components/index.js.map +1 -0
  100. package/dist/components/menu/menu.d.ts +14 -0
  101. package/dist/components/menu/menu.d.ts.map +1 -0
  102. package/dist/components/menu/menu.js +58 -0
  103. package/dist/components/menu/menu.js.map +1 -0
  104. package/dist/components/progress-tracker/progress-tracker.d.ts +18 -0
  105. package/dist/components/progress-tracker/progress-tracker.d.ts.map +1 -0
  106. package/dist/components/progress-tracker/progress-tracker.js +204 -0
  107. package/dist/components/progress-tracker/progress-tracker.js.map +1 -0
  108. package/dist/components/router-content/router-content.d.ts +14 -0
  109. package/dist/components/router-content/router-content.d.ts.map +1 -0
  110. package/dist/components/router-content/router-content.js +17 -0
  111. package/dist/components/router-content/router-content.js.map +1 -0
  112. package/dist/components/side-bar-frame/side-bar-frame.d.ts +21 -0
  113. package/dist/components/side-bar-frame/side-bar-frame.d.ts.map +1 -0
  114. package/dist/components/side-bar-frame/side-bar-frame.js +87 -0
  115. package/dist/components/side-bar-frame/side-bar-frame.js.map +1 -0
  116. package/dist/components/top-bar-frame/top-bar-frame.d.ts +16 -0
  117. package/dist/components/top-bar-frame/top-bar-frame.d.ts.map +1 -0
  118. package/dist/components/top-bar-frame/top-bar-frame.js +89 -0
  119. package/dist/components/top-bar-frame/top-bar-frame.js.map +1 -0
  120. package/dist/dara_core-0.4.8-py3-none-any.whl +0 -0
  121. package/dist/devtools/backend-errors/backend-errors-ctx.d.ts +17 -0
  122. package/dist/devtools/backend-errors/backend-errors-ctx.d.ts.map +1 -0
  123. package/dist/devtools/backend-errors/backend-errors-ctx.js +37 -0
  124. package/dist/devtools/backend-errors/backend-errors-ctx.js.map +1 -0
  125. package/dist/devtools/backend-errors/backend-errors.d.ts +6 -0
  126. package/dist/devtools/backend-errors/backend-errors.d.ts.map +1 -0
  127. package/dist/devtools/backend-errors/backend-errors.js +57 -0
  128. package/dist/devtools/backend-errors/backend-errors.js.map +1 -0
  129. package/dist/devtools/backend-errors/error-display.d.ts +22 -0
  130. package/dist/devtools/backend-errors/error-display.d.ts.map +1 -0
  131. package/dist/devtools/backend-errors/error-display.js +101 -0
  132. package/dist/devtools/backend-errors/error-display.js.map +1 -0
  133. package/dist/devtools/backend-errors/index.d.ts +3 -0
  134. package/dist/devtools/backend-errors/index.d.ts.map +1 -0
  135. package/dist/devtools/backend-errors/index.js +3 -0
  136. package/dist/devtools/backend-errors/index.js.map +1 -0
  137. package/dist/devtools/devtools-content.d.ts +12 -0
  138. package/dist/devtools/devtools-content.d.ts.map +1 -0
  139. package/dist/devtools/devtools-content.js +73 -0
  140. package/dist/devtools/devtools-content.js.map +1 -0
  141. package/dist/devtools/devtools-context.d.ts +7 -0
  142. package/dist/devtools/devtools-context.d.ts.map +1 -0
  143. package/dist/devtools/devtools-context.js +9 -0
  144. package/dist/devtools/devtools-context.js.map +1 -0
  145. package/dist/devtools/devtools-wrapper.d.ts +8 -0
  146. package/dist/devtools/devtools-wrapper.d.ts.map +1 -0
  147. package/dist/devtools/devtools-wrapper.js +64 -0
  148. package/dist/devtools/devtools-wrapper.js.map +1 -0
  149. package/dist/devtools/devtools.d.ts +5 -0
  150. package/dist/devtools/devtools.d.ts.map +1 -0
  151. package/dist/devtools/devtools.js +10 -0
  152. package/dist/devtools/devtools.js.map +1 -0
  153. package/dist/devtools/floating-button.d.ts +23 -0
  154. package/dist/devtools/floating-button.d.ts.map +1 -0
  155. package/dist/devtools/floating-button.js +94 -0
  156. package/dist/devtools/floating-button.js.map +1 -0
  157. package/dist/devtools/index.d.ts +2 -0
  158. package/dist/devtools/index.d.ts.map +1 -0
  159. package/dist/devtools/index.js +2 -0
  160. package/dist/devtools/index.js.map +1 -0
  161. package/dist/devtools/resizer.d.ts +18 -0
  162. package/dist/devtools/resizer.d.ts.map +1 -0
  163. package/dist/devtools/resizer.js +49 -0
  164. package/dist/devtools/resizer.js.map +1 -0
  165. package/dist/devtools/use-move.d.ts +21 -0
  166. package/dist/devtools/use-move.d.ts.map +1 -0
  167. package/dist/devtools/use-move.js +56 -0
  168. package/dist/devtools/use-move.js.map +1 -0
  169. package/dist/index.css +95 -0
  170. package/dist/index.d.ts +17 -0
  171. package/dist/index.d.ts.map +1 -0
  172. package/dist/index.js +14 -0
  173. package/dist/index.js.map +1 -0
  174. package/dist/jest-setup.d.ts +2 -0
  175. package/dist/jest-setup.d.ts.map +1 -0
  176. package/dist/jest-setup.js +18 -0
  177. package/dist/jest-setup.js.map +1 -0
  178. package/dist/pages/error-page.d.ts +3 -0
  179. package/dist/pages/error-page.d.ts.map +1 -0
  180. package/dist/pages/error-page.js +32 -0
  181. package/dist/pages/error-page.js.map +1 -0
  182. package/dist/pages/sso-callback-page.d.ts +6 -0
  183. package/dist/pages/sso-callback-page.d.ts.map +1 -0
  184. package/dist/pages/sso-callback-page.js +8 -0
  185. package/dist/pages/sso-callback-page.js.map +1 -0
  186. package/dist/run.d.ts +22 -0
  187. package/dist/run.d.ts.map +1 -0
  188. package/dist/run.js +40 -0
  189. package/dist/run.js.map +1 -0
  190. package/dist/shared/center/center.d.ts +5 -0
  191. package/dist/shared/center/center.d.ts.map +1 -0
  192. package/dist/shared/center/center.js +15 -0
  193. package/dist/shared/center/center.js.map +1 -0
  194. package/dist/shared/context/direction-context.d.ts +6 -0
  195. package/dist/shared/context/direction-context.d.ts.map +1 -0
  196. package/dist/shared/context/direction-context.js +4 -0
  197. package/dist/shared/context/direction-context.js.map +1 -0
  198. package/dist/shared/context/display-context.d.ts +13 -0
  199. package/dist/shared/context/display-context.d.ts.map +1 -0
  200. package/dist/shared/context/display-context.js +4 -0
  201. package/dist/shared/context/display-context.js.map +1 -0
  202. package/dist/shared/context/fallback-context.d.ts +11 -0
  203. package/dist/shared/context/fallback-context.d.ts.map +1 -0
  204. package/dist/shared/context/fallback-context.js +4 -0
  205. package/dist/shared/context/fallback-context.js.map +1 -0
  206. package/dist/shared/context/global-task-context.d.ts +40 -0
  207. package/dist/shared/context/global-task-context.d.ts.map +1 -0
  208. package/dist/shared/context/global-task-context.js +81 -0
  209. package/dist/shared/context/global-task-context.js.map +1 -0
  210. package/dist/shared/context/importers-context.d.ts +6 -0
  211. package/dist/shared/context/importers-context.d.ts.map +1 -0
  212. package/dist/shared/context/importers-context.js +4 -0
  213. package/dist/shared/context/importers-context.js.map +1 -0
  214. package/dist/shared/context/index.d.ts +10 -0
  215. package/dist/shared/context/index.d.ts.map +1 -0
  216. package/dist/shared/context/index.js +10 -0
  217. package/dist/shared/context/index.js.map +1 -0
  218. package/dist/shared/context/registries-context.d.ts +20 -0
  219. package/dist/shared/context/registries-context.d.ts.map +1 -0
  220. package/dist/shared/context/registries-context.js +8 -0
  221. package/dist/shared/context/registries-context.js.map +1 -0
  222. package/dist/shared/context/request-extras-context.d.ts +33 -0
  223. package/dist/shared/context/request-extras-context.d.ts.map +1 -0
  224. package/dist/shared/context/request-extras-context.js +55 -0
  225. package/dist/shared/context/request-extras-context.js.map +1 -0
  226. package/dist/shared/context/variable-context.d.ts +10 -0
  227. package/dist/shared/context/variable-context.d.ts.map +1 -0
  228. package/dist/shared/context/variable-context.js +4 -0
  229. package/dist/shared/context/variable-context.js.map +1 -0
  230. package/dist/shared/context/websocket-context.d.ts +7 -0
  231. package/dist/shared/context/websocket-context.d.ts.map +1 -0
  232. package/dist/shared/context/websocket-context.js +4 -0
  233. package/dist/shared/context/websocket-context.js.map +1 -0
  234. package/dist/shared/dynamic-component/clean-props.d.ts +6 -0
  235. package/dist/shared/dynamic-component/clean-props.d.ts.map +1 -0
  236. package/dist/shared/dynamic-component/clean-props.js +13 -0
  237. package/dist/shared/dynamic-component/clean-props.js.map +1 -0
  238. package/dist/shared/dynamic-component/dynamic-component.d.ts +16 -0
  239. package/dist/shared/dynamic-component/dynamic-component.d.ts.map +1 -0
  240. package/dist/shared/dynamic-component/dynamic-component.js +252 -0
  241. package/dist/shared/dynamic-component/dynamic-component.js.map +1 -0
  242. package/dist/shared/error-handling/error-display.d.ts +8 -0
  243. package/dist/shared/error-handling/error-display.d.ts.map +1 -0
  244. package/dist/shared/error-handling/error-display.js +94 -0
  245. package/dist/shared/error-handling/error-display.js.map +1 -0
  246. package/dist/shared/error-handling/index.d.ts +3 -0
  247. package/dist/shared/error-handling/index.d.ts.map +1 -0
  248. package/dist/shared/error-handling/index.js +3 -0
  249. package/dist/shared/error-handling/index.js.map +1 -0
  250. package/dist/shared/error-handling/types.d.ts +11 -0
  251. package/dist/shared/error-handling/types.d.ts.map +1 -0
  252. package/dist/shared/error-handling/types.js +9 -0
  253. package/dist/shared/error-handling/types.js.map +1 -0
  254. package/dist/shared/event-bus/event-bus.d.ts +27 -0
  255. package/dist/shared/event-bus/event-bus.d.ts.map +1 -0
  256. package/dist/shared/event-bus/event-bus.js +58 -0
  257. package/dist/shared/event-bus/event-bus.js.map +1 -0
  258. package/dist/shared/global-state-store.d.ts +54 -0
  259. package/dist/shared/global-state-store.d.ts.map +1 -0
  260. package/dist/shared/global-state-store.js +168 -0
  261. package/dist/shared/global-state-store.js.map +1 -0
  262. package/dist/shared/index.d.ts +12 -0
  263. package/dist/shared/index.d.ts.map +1 -0
  264. package/dist/shared/index.js +10 -0
  265. package/dist/shared/index.js.map +1 -0
  266. package/dist/shared/interactivity/data-variable.d.ts +78 -0
  267. package/dist/shared/interactivity/data-variable.d.ts.map +1 -0
  268. package/dist/shared/interactivity/data-variable.js +218 -0
  269. package/dist/shared/interactivity/data-variable.js.map +1 -0
  270. package/dist/shared/interactivity/derived-variable.d.ts +160 -0
  271. package/dist/shared/interactivity/derived-variable.d.ts.map +1 -0
  272. package/dist/shared/interactivity/derived-variable.js +446 -0
  273. package/dist/shared/interactivity/derived-variable.js.map +1 -0
  274. package/dist/shared/interactivity/filtering.d.ts +9 -0
  275. package/dist/shared/interactivity/filtering.d.ts.map +1 -0
  276. package/dist/shared/interactivity/filtering.js +20 -0
  277. package/dist/shared/interactivity/filtering.js.map +1 -0
  278. package/dist/shared/interactivity/index.d.ts +10 -0
  279. package/dist/shared/interactivity/index.d.ts.map +1 -0
  280. package/dist/shared/interactivity/index.js +9 -0
  281. package/dist/shared/interactivity/index.js.map +1 -0
  282. package/dist/shared/interactivity/internal.d.ts +9 -0
  283. package/dist/shared/interactivity/internal.d.ts.map +1 -0
  284. package/dist/shared/interactivity/internal.js +11 -0
  285. package/dist/shared/interactivity/internal.js.map +1 -0
  286. package/dist/shared/interactivity/nested.d.ts +16 -0
  287. package/dist/shared/interactivity/nested.d.ts.map +1 -0
  288. package/dist/shared/interactivity/nested.js +54 -0
  289. package/dist/shared/interactivity/nested.js.map +1 -0
  290. package/dist/shared/interactivity/persistence.d.ts +43 -0
  291. package/dist/shared/interactivity/persistence.d.ts.map +1 -0
  292. package/dist/shared/interactivity/persistence.js +215 -0
  293. package/dist/shared/interactivity/persistence.js.map +1 -0
  294. package/dist/shared/interactivity/plain-variable.d.ts +17 -0
  295. package/dist/shared/interactivity/plain-variable.d.ts.map +1 -0
  296. package/dist/shared/interactivity/plain-variable.js +222 -0
  297. package/dist/shared/interactivity/plain-variable.js.map +1 -0
  298. package/dist/shared/interactivity/resolve-value.d.ts +13 -0
  299. package/dist/shared/interactivity/resolve-value.d.ts.map +1 -0
  300. package/dist/shared/interactivity/resolve-value.js +36 -0
  301. package/dist/shared/interactivity/resolve-value.js.map +1 -0
  302. package/dist/shared/interactivity/resolve-variable.d.ts +18 -0
  303. package/dist/shared/interactivity/resolve-variable.d.ts.map +1 -0
  304. package/dist/shared/interactivity/resolve-variable.js +46 -0
  305. package/dist/shared/interactivity/resolve-variable.js.map +1 -0
  306. package/dist/shared/interactivity/store.d.ts +76 -0
  307. package/dist/shared/interactivity/store.d.ts.map +1 -0
  308. package/dist/shared/interactivity/store.js +99 -0
  309. package/dist/shared/interactivity/store.js.map +1 -0
  310. package/dist/shared/interactivity/triggers.d.ts +31 -0
  311. package/dist/shared/interactivity/triggers.d.ts.map +1 -0
  312. package/dist/shared/interactivity/triggers.js +105 -0
  313. package/dist/shared/interactivity/triggers.js.map +1 -0
  314. package/dist/shared/interactivity/url-variable.d.ts +12 -0
  315. package/dist/shared/interactivity/url-variable.d.ts.map +1 -0
  316. package/dist/shared/interactivity/url-variable.js +27 -0
  317. package/dist/shared/interactivity/url-variable.js.map +1 -0
  318. package/dist/shared/interactivity/use-any-variable.d.ts +8 -0
  319. package/dist/shared/interactivity/use-any-variable.d.ts.map +1 -0
  320. package/dist/shared/interactivity/use-any-variable.js +39 -0
  321. package/dist/shared/interactivity/use-any-variable.js.map +1 -0
  322. package/dist/shared/interactivity/use-data-variable.d.ts +18 -0
  323. package/dist/shared/interactivity/use-data-variable.d.ts.map +1 -0
  324. package/dist/shared/interactivity/use-data-variable.js +58 -0
  325. package/dist/shared/interactivity/use-data-variable.js.map +1 -0
  326. package/dist/shared/interactivity/use-refresh-selector.d.ts +5 -0
  327. package/dist/shared/interactivity/use-refresh-selector.d.ts.map +1 -0
  328. package/dist/shared/interactivity/use-refresh-selector.js +20 -0
  329. package/dist/shared/interactivity/use-refresh-selector.js.map +1 -0
  330. package/dist/shared/interactivity/use-server-component.d.ts +24 -0
  331. package/dist/shared/interactivity/use-server-component.d.ts.map +1 -0
  332. package/dist/shared/interactivity/use-server-component.js +256 -0
  333. package/dist/shared/interactivity/use-server-component.js.map +1 -0
  334. package/dist/shared/interactivity/use-variable-state.d.ts +9 -0
  335. package/dist/shared/interactivity/use-variable-state.d.ts.map +1 -0
  336. package/dist/shared/interactivity/use-variable-state.js +26 -0
  337. package/dist/shared/interactivity/use-variable-state.js.map +1 -0
  338. package/dist/shared/interactivity/use-variable-value.d.ts +33 -0
  339. package/dist/shared/interactivity/use-variable-value.d.ts.map +1 -0
  340. package/dist/shared/interactivity/use-variable-value.js +94 -0
  341. package/dist/shared/interactivity/use-variable-value.js.map +1 -0
  342. package/dist/shared/interactivity/use-variable.d.ts +12 -0
  343. package/dist/shared/interactivity/use-variable.d.ts.map +1 -0
  344. package/dist/shared/interactivity/use-variable.js +84 -0
  345. package/dist/shared/interactivity/use-variable.js.map +1 -0
  346. package/dist/shared/private-route/private-route.d.ts +19 -0
  347. package/dist/shared/private-route/private-route.d.ts.map +1 -0
  348. package/dist/shared/private-route/private-route.js +35 -0
  349. package/dist/shared/private-route/private-route.js.map +1 -0
  350. package/dist/shared/template-root/dynamic-context.d.ts +9 -0
  351. package/dist/shared/template-root/dynamic-context.d.ts.map +1 -0
  352. package/dist/shared/template-root/dynamic-context.js +29 -0
  353. package/dist/shared/template-root/dynamic-context.js.map +1 -0
  354. package/dist/shared/template-root/template-root.d.ts +12 -0
  355. package/dist/shared/template-root/template-root.d.ts.map +1 -0
  356. package/dist/shared/template-root/template-root.js +94 -0
  357. package/dist/shared/template-root/template-root.js.map +1 -0
  358. package/dist/shared/utils/clean-session-cache.d.ts +9 -0
  359. package/dist/shared/utils/clean-session-cache.d.ts.map +1 -0
  360. package/dist/shared/utils/clean-session-cache.js +19 -0
  361. package/dist/shared/utils/clean-session-cache.js.map +1 -0
  362. package/dist/shared/utils/embed.d.ts +22 -0
  363. package/dist/shared/utils/embed.d.ts.map +1 -0
  364. package/dist/shared/utils/embed.js +43 -0
  365. package/dist/shared/utils/embed.js.map +1 -0
  366. package/dist/shared/utils/get-icon.d.ts +9 -0
  367. package/dist/shared/utils/get-icon.d.ts.map +1 -0
  368. package/dist/shared/utils/get-icon.js +30 -0
  369. package/dist/shared/utils/get-icon.js.map +1 -0
  370. package/dist/shared/utils/hashing.d.ts +14 -0
  371. package/dist/shared/utils/hashing.d.ts.map +1 -0
  372. package/dist/shared/utils/hashing.js +26 -0
  373. package/dist/shared/utils/hashing.js.map +1 -0
  374. package/dist/shared/utils/index.d.ts +19 -0
  375. package/dist/shared/utils/index.d.ts.map +1 -0
  376. package/dist/shared/utils/index.js +17 -0
  377. package/dist/shared/utils/index.js.map +1 -0
  378. package/dist/shared/utils/inject-css.d.ts +12 -0
  379. package/dist/shared/utils/inject-css.d.ts.map +1 -0
  380. package/dist/shared/utils/inject-css.js +25 -0
  381. package/dist/shared/utils/inject-css.js.map +1 -0
  382. package/dist/shared/utils/is-js-component.d.ts +9 -0
  383. package/dist/shared/utils/is-js-component.d.ts.map +1 -0
  384. package/dist/shared/utils/is-js-component.js +11 -0
  385. package/dist/shared/utils/is-js-component.js.map +1 -0
  386. package/dist/shared/utils/normalization.d.ts +19 -0
  387. package/dist/shared/utils/normalization.d.ts.map +1 -0
  388. package/dist/shared/utils/normalization.js +121 -0
  389. package/dist/shared/utils/normalization.js.map +1 -0
  390. package/dist/shared/utils/resolve-theme.d.ts +9 -0
  391. package/dist/shared/utils/resolve-theme.d.ts.map +1 -0
  392. package/dist/shared/utils/resolve-theme.js +28 -0
  393. package/dist/shared/utils/resolve-theme.js.map +1 -0
  394. package/dist/shared/utils/templating.d.ts +24 -0
  395. package/dist/shared/utils/templating.d.ts.map +1 -0
  396. package/dist/shared/utils/templating.js +67 -0
  397. package/dist/shared/utils/templating.js.map +1 -0
  398. package/dist/shared/utils/use-action-registry.d.ts +11 -0
  399. package/dist/shared/utils/use-action-registry.d.ts.map +1 -0
  400. package/dist/shared/utils/use-action-registry.js +18 -0
  401. package/dist/shared/utils/use-action-registry.js.map +1 -0
  402. package/dist/shared/utils/use-action.d.ts +34 -0
  403. package/dist/shared/utils/use-action.d.ts.map +1 -0
  404. package/dist/shared/utils/use-action.js +314 -0
  405. package/dist/shared/utils/use-action.js.map +1 -0
  406. package/dist/shared/utils/use-component-registry.d.ts +11 -0
  407. package/dist/shared/utils/use-component-registry.d.ts.map +1 -0
  408. package/dist/shared/utils/use-component-registry.js +57 -0
  409. package/dist/shared/utils/use-component-registry.js.map +1 -0
  410. package/dist/shared/utils/use-component-styles.d.ts +24 -0
  411. package/dist/shared/utils/use-component-styles.d.ts.map +1 -0
  412. package/dist/shared/utils/use-component-styles.js +69 -0
  413. package/dist/shared/utils/use-component-styles.js.map +1 -0
  414. package/dist/shared/utils/use-defer-loadable.d.ts +8 -0
  415. package/dist/shared/utils/use-defer-loadable.d.ts.map +1 -0
  416. package/dist/shared/utils/use-defer-loadable.js +44 -0
  417. package/dist/shared/utils/use-defer-loadable.js.map +1 -0
  418. package/dist/shared/utils/use-interval.d.ts +9 -0
  419. package/dist/shared/utils/use-interval.d.ts.map +1 -0
  420. package/dist/shared/utils/use-interval.js +19 -0
  421. package/dist/shared/utils/use-interval.js.map +1 -0
  422. package/dist/shared/utils/use-previous.d.ts +10 -0
  423. package/dist/shared/utils/use-previous.d.ts.map +1 -0
  424. package/dist/shared/utils/use-previous.js +17 -0
  425. package/dist/shared/utils/use-previous.js.map +1 -0
  426. package/dist/shared/utils/use-url-sync.d.ts +20 -0
  427. package/dist/shared/utils/use-url-sync.d.ts.map +1 -0
  428. package/dist/shared/utils/use-url-sync.js +68 -0
  429. package/dist/shared/utils/use-url-sync.js.map +1 -0
  430. package/dist/shared/utils/use-window-title.d.ts +3 -0
  431. package/dist/shared/utils/use-window-title.d.ts.map +1 -0
  432. package/dist/shared/utils/use-window-title.js +14 -0
  433. package/dist/shared/utils/use-window-title.js.map +1 -0
  434. package/dist/shared/variable-state-provider/variable-state-provider.d.ts +10 -0
  435. package/dist/shared/variable-state-provider/variable-state-provider.d.ts.map +1 -0
  436. package/dist/shared/variable-state-provider/variable-state-provider.js +29 -0
  437. package/dist/shared/variable-state-provider/variable-state-provider.js.map +1 -0
  438. package/dist/shared/wrapper/wrapper.d.ts +7 -0
  439. package/dist/shared/wrapper/wrapper.d.ts.map +1 -0
  440. package/dist/shared/wrapper/wrapper.js +14 -0
  441. package/dist/shared/wrapper/wrapper.js.map +1 -0
  442. package/dist/types/auth.d.ts +15 -0
  443. package/dist/types/auth.d.ts.map +1 -0
  444. package/dist/types/auth.js +6 -0
  445. package/dist/types/auth.js.map +1 -0
  446. package/dist/types/core.d.ts +440 -0
  447. package/dist/types/core.d.ts.map +1 -0
  448. package/dist/types/core.js +22 -0
  449. package/dist/types/core.js.map +1 -0
  450. package/dist/types/index.d.ts +7 -0
  451. package/dist/types/index.d.ts.map +1 -0
  452. package/dist/types/index.js +4 -0
  453. package/dist/types/index.js.map +1 -0
  454. package/dist/types/utils.d.ts +56 -0
  455. package/dist/types/utils.d.ts.map +1 -0
  456. package/dist/types/utils.js +93 -0
  457. package/dist/types/utils.js.map +1 -0
  458. package/dist/umd/dara.core.umd.js +86508 -0
  459. package/dist/umd/style.css +848 -0
  460. package/dist/utils.d.ts +11 -0
  461. package/dist/utils.d.ts.map +1 -0
  462. package/dist/utils.js +20 -0
  463. package/dist/utils.js.map +1 -0
  464. package/package.json +121 -0
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { transparentize } from 'polished';
3
+ import styled from '@darajs/styled-components';
4
+ import { injectCss, parseRawCss } from '../../shared/utils';
5
+ const StyledErrorDisplay = styled.div `
6
+ display: flex;
7
+ gap: 1rem;
8
+ align-items: center;
9
+ justify-content: space-between;
10
+
11
+ height: min-content;
12
+ padding: 1rem;
13
+
14
+ background-color: ${(props) => transparentize(0.9, props.theme.colors.error)};
15
+ border-radius: 0.25rem;
16
+ `;
17
+ const ErrorDisplayWrapper = injectCss(StyledErrorDisplay);
18
+ const IconWrapper = styled.div `
19
+ display: flex;
20
+ height: 100%;
21
+ `;
22
+ const ErrorIcon = styled.i `
23
+ line-height: 21px;
24
+ color: ${(props) => props.theme.colors.error};
25
+ `;
26
+ const ContentWrapper = styled.div `
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 1rem;
30
+ align-items: flex-start;
31
+ `;
32
+ const ErrorContent = styled.div `
33
+ display: flex;
34
+ flex-direction: column;
35
+ gap: 0.5rem;
36
+ color: ${(props) => props.theme.colors.error};
37
+ `;
38
+ const ErrorTitle = styled.h3 `
39
+ display: flex;
40
+ gap: 0.375rem;
41
+
42
+ font-size: 1rem;
43
+ font-weight: bold;
44
+ line-height: 1.375rem;
45
+ color: ${(props) => props.theme.colors.error};
46
+ `;
47
+ const ErrorText = styled.span `
48
+ font-size: 1rem;
49
+ line-height: 1.375rem;
50
+ `;
51
+ const RetryButton = styled.button `
52
+ cursor: pointer;
53
+
54
+ display: flex;
55
+ gap: 0.5rem;
56
+ align-items: center;
57
+ justify-content: center;
58
+
59
+ width: 40px;
60
+ height: 40px;
61
+
62
+ color: ${(props) => props.theme.colors.error};
63
+
64
+ background-color: inherit;
65
+ border: none;
66
+ border: 1px solid;
67
+ border-color: ${(props) => props.theme.colors.error};
68
+ border-radius: 5px;
69
+
70
+ transition-timing-function: ease;
71
+ transition-duration: 100ms;
72
+ transition-property: color, border-color;
73
+
74
+ i {
75
+ line-height: 21px;
76
+ transition: transform 400ms ease-in-out;
77
+ }
78
+
79
+ &:hover {
80
+ color: ${(props) => props.theme.colors.errorHover};
81
+ border-color: ${(props) => props.theme.colors.errorHover};
82
+
83
+ i {
84
+ transform: rotate(180deg);
85
+ }
86
+ }
87
+ `;
88
+ function ErrorDisplay(props) {
89
+ var _a, _b, _c, _d, _e;
90
+ const [styles, css] = parseRawCss((_a = props.config) === null || _a === void 0 ? void 0 : _a.raw_css);
91
+ return (_jsxs(ErrorDisplayWrapper, { "$rawCss": css, style: styles, children: [_jsx(ContentWrapper, { children: _jsxs(ErrorContent, { children: [_jsxs(ErrorTitle, { children: [_jsx(IconWrapper, { children: _jsx(ErrorIcon, { "aria-hidden": true, className: "fa-solid fa-circle-xmark fa-lg" }) }), (_c = (_b = props === null || props === void 0 ? void 0 : props.config) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : 'Error'] }), _jsx(ErrorText, { children: (_e = (_d = props === null || props === void 0 ? void 0 : props.config) === null || _d === void 0 ? void 0 : _d.description) !== null && _e !== void 0 ? _e : 'Try again or contact the application owner.' })] }) }), props.resetErrorBoundary && (_jsx(RetryButton, { onClick: () => props.resetErrorBoundary(props.error), type: "button", children: _jsx("i", { "aria-hidden": true, className: "fa-solid fa-rotate fa-xl" }) }))] }));
92
+ }
93
+ export default ErrorDisplay;
94
+ //# sourceMappingURL=error-display.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-display.js","sourceRoot":"","sources":["../../../js/shared/error-handling/error-display.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;wBASb,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;;CAE/E,CAAC;AACF,MAAM,mBAAmB,GAAG,SAAS,CAAC,kBAAkB,CAAC,CAAC;AAE1D,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG7B,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAA;;aAEb,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;CAC/C,CAA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E,MAAM,0CAAE,KAAK,mCAAI,OAAO,IACvB,EACb,KAAC,SAAS,cAAE,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,0CAAE,WAAW,mCAAI,6CAA6C,GAAa,IACzF,GACF,EAChB,KAAK,CAAC,kBAAkB,IAAI,CACzB,KAAC,WAAW,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,EAAC,QAAQ,YAC5E,iCAAe,SAAS,EAAC,0BAA0B,GAAG,GAC5C,CACjB,IACiB,CACzB,CAAC;AACN,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { isSelectorError, SelectorError } from './types';
2
+ export { default as ErrorDisplay } from './error-display';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../js/shared/error-handling/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { isSelectorError } from './types';
2
+ export { default as ErrorDisplay } from './error-display';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../js/shared/error-handling/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface SelectorError {
2
+ selectorExtras: string;
3
+ selectorId: string;
4
+ }
5
+ /**
6
+ * Check whether an error originated from a Recoil selector, i.e. it has a selectorId and extras attached
7
+ *
8
+ * @param e error to check
9
+ */
10
+ export declare function isSelectorError(e: unknown): e is SelectorError;
11
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../js/shared/error-handling/types.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAE9D"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Check whether an error originated from a Recoil selector, i.e. it has a selectorId and extras attached
3
+ *
4
+ * @param e error to check
5
+ */
6
+ export function isSelectorError(e) {
7
+ return e !== undefined && e !== null && typeof e === 'object' && 'selectorId' in e && 'selectorExtras' in e;
8
+ }
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../js/shared/error-handling/types.tsx"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,CAAU;IACtC,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,YAAY,IAAI,CAAC,IAAI,gBAAgB,IAAI,CAAC,CAAC;AAChH,CAAC"}
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import { DaraEvent, DaraEventMap, EventMap, IEventBus, UnionFromMap } from '../../types/core';
3
+ /**
4
+ * Global event bus that allows to publish and subscribe to events.
5
+ */
6
+ export declare class EventBus<MapT extends EventMap> implements IEventBus<MapT> {
7
+ #private;
8
+ constructor(parentBus?: EventBus<MapT>);
9
+ publish<T extends keyof MapT>(type: T, data: MapT[T]): void;
10
+ subscribe(callback: (event: UnionFromMap<MapT>) => void): () => void;
11
+ }
12
+ /** Default top-level event bus */
13
+ export declare const DEFAULT_BUS: EventBus<DaraEventMap>;
14
+ /** Hook to get the event bus instance */
15
+ export declare function useEventBus(): EventBus<DaraEventMap>;
16
+ interface EventCapturerProps {
17
+ children: React.ReactNode;
18
+ /** callback to call when the event is captured */
19
+ onEvent: (event: DaraEvent) => void;
20
+ }
21
+ /**
22
+ * Component that captures events of a given type fired in its children
23
+ * and calls the provided callback with the event data.
24
+ */
25
+ export declare function EventCapturer({ children, onEvent }: EventCapturerProps): React.ReactNode;
26
+ export {};
27
+ //# sourceMappingURL=event-bus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../../js/shared/event-bus/event-bus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE1F;;GAEG;AACH,qBAAa,QAAQ,CAAC,IAAI,SAAS,QAAQ,CAAE,YAAW,SAAS,CAAC,IAAI,CAAC;;gBAKvD,SAAS,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;IAItC,OAAO,CAAC,CAAC,SAAS,MAAM,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI;IAS3D,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI;CAMvE;AAED,kCAAkC;AAClC,eAAO,MAAM,WAAW,wBAA+B,CAAC;AAIxD,yCAAyC;AACzC,wBAAgB,WAAW,IAAI,QAAQ,CAAC,YAAY,CAAC,CAEpD;AAED,UAAU,kBAAkB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kDAAkD;IAClD,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,SAAS,CASxF"}
@@ -0,0 +1,58 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _EventBus_events$, _EventBus_parentBus;
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import * as React from 'react';
15
+ import { Subject } from 'rxjs';
16
+ /**
17
+ * Global event bus that allows to publish and subscribe to events.
18
+ */
19
+ export class EventBus {
20
+ constructor(parentBus) {
21
+ _EventBus_events$.set(this, new Subject());
22
+ _EventBus_parentBus.set(this, null);
23
+ __classPrivateFieldSet(this, _EventBus_parentBus, parentBus !== null && parentBus !== void 0 ? parentBus : null, "f");
24
+ }
25
+ publish(type, data) {
26
+ __classPrivateFieldGet(this, _EventBus_events$, "f").next({ type, data });
27
+ // bubble up the event
28
+ if (__classPrivateFieldGet(this, _EventBus_parentBus, "f")) {
29
+ __classPrivateFieldGet(this, _EventBus_parentBus, "f").publish(type, data);
30
+ }
31
+ }
32
+ subscribe(callback) {
33
+ // pipe just to make a copy
34
+ const sub = __classPrivateFieldGet(this, _EventBus_events$, "f").pipe().subscribe(callback);
35
+ return () => sub.unsubscribe();
36
+ }
37
+ }
38
+ _EventBus_events$ = new WeakMap(), _EventBus_parentBus = new WeakMap();
39
+ /** Default top-level event bus */
40
+ export const DEFAULT_BUS = new EventBus();
41
+ const EventBusContext = React.createContext(DEFAULT_BUS);
42
+ /** Hook to get the event bus instance */
43
+ export function useEventBus() {
44
+ return React.useContext(EventBusContext);
45
+ }
46
+ /**
47
+ * Component that captures events of a given type fired in its children
48
+ * and calls the provided callback with the event data.
49
+ */
50
+ export function EventCapturer({ children, onEvent }) {
51
+ const parentBus = useEventBus();
52
+ const bus = React.useMemo(() => new EventBus(parentBus), [parentBus]);
53
+ React.useEffect(() => {
54
+ return bus.subscribe(onEvent);
55
+ }, [bus, onEvent]);
56
+ return _jsx(EventBusContext.Provider, { value: bus, children: children });
57
+ }
58
+ //# sourceMappingURL=event-bus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../../js/shared/event-bus/event-bus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAI/B;;GAEG;AACH,MAAM,OAAO,QAAQ;IAKjB,YAAY,SAA0B;QAJtC,4BAAkE,IAAI,OAAO,EAAE,EAAC;QAEhF,8BAAoC,IAAI,EAAC;QAGrC,uBAAA,IAAI,uBAAc,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,MAAA,CAAC;IACxC,CAAC;IAED,OAAO,CAAuB,IAAO,EAAE,IAAa;QAChD,uBAAA,IAAI,yBAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAEnC,sBAAsB;QACtB,IAAI,uBAAA,IAAI,2BAAW,EAAE,CAAC;YAClB,uBAAA,IAAI,2BAAW,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACxC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,QAA6C;QACnD,2BAA2B;QAC3B,MAAM,GAAG,GAAG,uBAAA,IAAI,yBAAS,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAErD,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;IACnC,CAAC;CACJ;;AAED,kCAAkC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,QAAQ,EAAgB,CAAC;AAExD,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAyB,WAAW,CAAC,CAAC;AAEjF,yCAAyC;AACzC,MAAM,UAAU,WAAW;IACvB,OAAO,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAC7C,CAAC;AAQD;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAsB;IACnE,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC;IAChC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEtE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IAEnB,OAAO,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG,YAAG,QAAQ,GAA4B,CAAC;AACvF,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Global state store. Acts as a wrapper around localStorage.
3
+ *
4
+ * Supports a simple key-value store with subscriptions and async value replacement,
5
+ * while ensuring that only one replacement is in progress at a time.
6
+ */
7
+ declare class GlobalStore {
8
+ #private;
9
+ constructor();
10
+ /**
11
+ * Clear the store.
12
+ * Removes all values and subscribers.
13
+ */
14
+ clear(): void;
15
+ /**
16
+ * Get the value for a key.
17
+ * If the value is being replaced, the promise for the new value is returned.
18
+ *
19
+ * @param key - key to get value for
20
+ */
21
+ getValue(key: string): Promise<string | null>;
22
+ /**
23
+ * Get the value for a key synchronously.
24
+ * Even if the value is being replaced, the current value is returned.
25
+ *
26
+ * @param key - key to get value for
27
+ */
28
+ getValueSync(key: string): string | null;
29
+ /**
30
+ * Set the value for a key.
31
+ *
32
+ * @param key - key to set value for
33
+ * @param value - value to set
34
+ */
35
+ setValue(key: string, value: string | null): void;
36
+ /**
37
+ * Replace the value for a key.
38
+ * If the value is being replaced, the promise for the new value is returned.
39
+ *
40
+ * @param key - key to replace value for
41
+ * @param fn - function to get the new value
42
+ */
43
+ replaceValue(key: string, fn: () => Promise<string>): Promise<string>;
44
+ /**
45
+ * Subscribe to changes to a key.
46
+ *
47
+ * @param key - key to subscribe to changes to
48
+ * @param callback - callback invoked when the value is updated
49
+ */
50
+ subscribe(key: string, callback: (val: string) => void): () => void;
51
+ }
52
+ declare const store: GlobalStore;
53
+ export default store;
54
+ //# sourceMappingURL=global-state-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-state-store.d.ts","sourceRoot":"","sources":["../../js/shared/global-state-store.tsx"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,cAAM,WAAW;;;IAiBb;;;OAGG;IACI,KAAK,IAAI,IAAI;IAKpB;;;;;OAKG;IACU,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAQ1D;;;;;OAKG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAI/C;;;;;OAKG;IACI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAaxD;;;;;;OAMG;IACU,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAwClF;;;;;OAKG;IACI,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI;CA6B7E;AAED,QAAA,MAAM,KAAK,aAAoB,CAAC;AAEhC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,168 @@
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 __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11
+ if (kind === "m") throw new TypeError("Private method is not writable");
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15
+ };
16
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
17
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
18
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
19
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
20
+ };
21
+ var _GlobalStore_locks, _GlobalStore_subscribers;
22
+ /* eslint-disable class-methods-use-this */
23
+ /**
24
+ * Global state store. Acts as a wrapper around localStorage.
25
+ *
26
+ * Supports a simple key-value store with subscriptions and async value replacement,
27
+ * while ensuring that only one replacement is in progress at a time.
28
+ */
29
+ class GlobalStore {
30
+ constructor() {
31
+ /**
32
+ * Locks for each key to ensure only one replacement is in progress at a time.
33
+ * Each promise represents an ongoing replacement which will resolve to the new value or reject if replacement fails.
34
+ */
35
+ _GlobalStore_locks.set(this, void 0);
36
+ /**
37
+ * Subscribers for each key.
38
+ */
39
+ _GlobalStore_subscribers.set(this, void 0);
40
+ __classPrivateFieldSet(this, _GlobalStore_locks, {}, "f");
41
+ __classPrivateFieldSet(this, _GlobalStore_subscribers, {}, "f");
42
+ }
43
+ /**
44
+ * Clear the store.
45
+ * Removes all values and subscribers.
46
+ */
47
+ clear() {
48
+ __classPrivateFieldSet(this, _GlobalStore_locks, {}, "f");
49
+ __classPrivateFieldSet(this, _GlobalStore_subscribers, {}, "f");
50
+ }
51
+ /**
52
+ * Get the value for a key.
53
+ * If the value is being replaced, the promise for the new value is returned.
54
+ *
55
+ * @param key - key to get value for
56
+ */
57
+ getValue(key) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ if (__classPrivateFieldGet(this, _GlobalStore_locks, "f")[key]) {
60
+ return __classPrivateFieldGet(this, _GlobalStore_locks, "f")[key];
61
+ }
62
+ return localStorage.getItem(key);
63
+ });
64
+ }
65
+ /**
66
+ * Get the value for a key synchronously.
67
+ * Even if the value is being replaced, the current value is returned.
68
+ *
69
+ * @param key - key to get value for
70
+ */
71
+ getValueSync(key) {
72
+ return localStorage.getItem(key);
73
+ }
74
+ /**
75
+ * Set the value for a key.
76
+ *
77
+ * @param key - key to set value for
78
+ * @param value - value to set
79
+ */
80
+ setValue(key, value) {
81
+ if (value === null) {
82
+ localStorage.removeItem(key);
83
+ }
84
+ else {
85
+ localStorage.setItem(key, value);
86
+ }
87
+ // Notify any local subscribers of a change in the value
88
+ if (__classPrivateFieldGet(this, _GlobalStore_subscribers, "f")[key]) {
89
+ __classPrivateFieldGet(this, _GlobalStore_subscribers, "f")[key].forEach((cb) => cb(value));
90
+ }
91
+ }
92
+ /**
93
+ * Replace the value for a key.
94
+ * If the value is being replaced, the promise for the new value is returned.
95
+ *
96
+ * @param key - key to replace value for
97
+ * @param fn - function to get the new value
98
+ */
99
+ replaceValue(key, fn) {
100
+ return __awaiter(this, void 0, void 0, function* () {
101
+ // If there's already a replacement in progress, return the promise of the ongoing replacement
102
+ if (__classPrivateFieldGet(this, _GlobalStore_locks, "f")[key]) {
103
+ return __classPrivateFieldGet(this, _GlobalStore_locks, "f")[key];
104
+ }
105
+ // Create a new Promise to resolve to the replaced value
106
+ // TODO: this can be Promise.withResolvers once it's more widely supported
107
+ let unlock;
108
+ let unlockError;
109
+ const lockPromise = new Promise((resolve, reject) => {
110
+ unlock = resolve;
111
+ unlockError = reject;
112
+ });
113
+ // Store it for the given key so we can resolve other replacements/retrievals to the same promise
114
+ __classPrivateFieldGet(this, _GlobalStore_locks, "f")[key] = lockPromise;
115
+ let result;
116
+ try {
117
+ // Run the provided function to get the new value
118
+ result = yield fn();
119
+ // On success - set the value (notifying subscribers) and resolve the 'lock' promise.
120
+ // This resolves both the caller and other ongoing requests blocking on the lock to the new value.
121
+ this.setValue(key, result);
122
+ unlock(result);
123
+ }
124
+ catch (e) {
125
+ // On error - error out the 'lock' promise.
126
+ // This errors both the caller and other ongoing requests blocking on the lock.
127
+ unlockError(e);
128
+ }
129
+ finally {
130
+ // Clear the lock for the key so future replaceValue calls call the `fn` again
131
+ delete __classPrivateFieldGet(this, _GlobalStore_locks, "f")[key];
132
+ }
133
+ return lockPromise;
134
+ });
135
+ }
136
+ /**
137
+ * Subscribe to changes to a key.
138
+ *
139
+ * @param key - key to subscribe to changes to
140
+ * @param callback - callback invoked when the value is updated
141
+ */
142
+ subscribe(key, callback) {
143
+ if (!__classPrivateFieldGet(this, _GlobalStore_subscribers, "f")[key]) {
144
+ __classPrivateFieldGet(this, _GlobalStore_subscribers, "f")[key] = [];
145
+ }
146
+ // create a subscription scoped to the key
147
+ const subFunc = (e) => {
148
+ if (e.storageArea === localStorage && e.key === key) {
149
+ callback(e.newValue);
150
+ }
151
+ };
152
+ // Add the callback to the local subscribers list
153
+ // The storage event only fires when localStorage is changed from another document so we need to track changes
154
+ // locally as well.
155
+ __classPrivateFieldGet(this, _GlobalStore_subscribers, "f")[key].push(callback);
156
+ // Add a listener to the storage event for changes coming from other tabs
157
+ window.addEventListener('storage', subFunc);
158
+ // Cleanup the subscriptions
159
+ return () => {
160
+ window.removeEventListener('storage', subFunc);
161
+ __classPrivateFieldGet(this, _GlobalStore_subscribers, "f")[key].splice(__classPrivateFieldGet(this, _GlobalStore_subscribers, "f")[key].findIndex((val) => val === callback), 1);
162
+ };
163
+ }
164
+ }
165
+ _GlobalStore_locks = new WeakMap(), _GlobalStore_subscribers = new WeakMap();
166
+ const store = new GlobalStore();
167
+ export default store;
168
+ //# sourceMappingURL=global-state-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-state-store.js","sourceRoot":"","sources":["../../js/shared/global-state-store.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C;;;;;GAKG;AACH,MAAM,WAAW;IAYb;QAXA;;;WAGG;QACH,qCAA+C;QAE/C;;WAEG;QACH,2CAAwD;QAGpD,uBAAA,IAAI,sBAAU,EAAqC,MAAA,CAAC;QACpD,uBAAA,IAAI,4BAAgB,EAA+C,MAAA,CAAC;IACxE,CAAC;IAED;;;OAGG;IACI,KAAK;QACR,uBAAA,IAAI,sBAAU,EAAqC,MAAA,CAAC;QACpD,uBAAA,IAAI,4BAAgB,EAA+C,MAAA,CAAC;IACxE,CAAC;IAED;;;;;OAKG;IACU,QAAQ,CAAC,GAAW;;YAC7B,IAAI,uBAAA,IAAI,0BAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBACnB,OAAO,uBAAA,IAAI,0BAAO,CAAC,GAAG,CAAC,CAAC;YAC5B,CAAC;YAED,OAAO,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC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,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,EAC3D,CAAC,CACJ,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CACJ;;AAED,MAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;AAEhC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { RawCssProp } from './utils';
2
+ export { default as Center } from './center/center';
3
+ export { DirectionCtx, ImportersCtx, WebSocketCtx, DisplayCtx, useRequestExtras, RequestExtrasCtx, RequestExtrasProvider, PartialRequestExtrasProvider, } from './context';
4
+ export { default as DynamicComponent } from './dynamic-component/dynamic-component';
5
+ export { default as TemplateRoot } from './template-root/template-root';
6
+ export { default as PrivateRoute } from './private-route/private-route';
7
+ export { isJsComponent, resolveTheme, useAction, useActionIsLoading, useComponentRegistry, useWindowTitle, getIcon, injectCss, useComponentStyles, getMarkerPaths, replaceMarkers, hasTemplateMarkers, normalizeRequest, getToken, getTokenKey, DARA_JWT_TOKEN, } from './utils';
8
+ export { useVariable, useDataVariable, combineFilters, useAnyVariable, resolveValue, useVariableValue, } from './interactivity';
9
+ export { useEventBus, EventBus, EventCapturer } from './event-bus/event-bus';
10
+ export { default as Wrapper } from './wrapper/wrapper';
11
+ export type { RawCssProp };
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../js/shared/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,GAC/B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EACH,aAAa,EACb,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,cAAc,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EACH,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,gBAAgB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { default as Center } from './center/center';
2
+ export { DirectionCtx, ImportersCtx, WebSocketCtx, DisplayCtx, useRequestExtras, RequestExtrasCtx, RequestExtrasProvider, PartialRequestExtrasProvider, } from './context';
3
+ export { default as DynamicComponent } from './dynamic-component/dynamic-component';
4
+ export { default as TemplateRoot } from './template-root/template-root';
5
+ export { default as PrivateRoute } from './private-route/private-route';
6
+ export { isJsComponent, resolveTheme, useAction, useActionIsLoading, useComponentRegistry, useWindowTitle, getIcon, injectCss, useComponentStyles, getMarkerPaths, replaceMarkers, hasTemplateMarkers, normalizeRequest, getToken, getTokenKey, DARA_JWT_TOKEN, } from './utils';
7
+ export { useVariable, useDataVariable, combineFilters, useAnyVariable, resolveValue, useVariableValue, } from './interactivity';
8
+ export { useEventBus, EventBus, EventCapturer } from './event-bus/event-bus';
9
+ export { default as Wrapper } from './wrapper/wrapper';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../js/shared/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,GAC/B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EACH,aAAa,EACb,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,cAAc,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EACH,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,YAAY,EACZ,gBAAgB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { WebSocketClientInterface } from '../../api';
2
+ import { RequestExtras } from '../../api/http';
3
+ import { GlobalTaskContext } from '../../shared/context/global-task-context';
4
+ import { DataFrame, DataVariable, DerivedDataVariable, FilterQuery, Pagination, ResolvedDataVariable } from '../../types';
5
+ import { DerivedVariableValueResponse } from './internal';
6
+ /**
7
+ * Format a DataVariable into a ResolvedDataVariable structure for the backend
8
+ *
9
+ * @param variable the variable to resolve for the backend
10
+ */
11
+ export declare function resolveDataVariable(variable: DataVariable): ResolvedDataVariable;
12
+ /**
13
+ * Retrieve the value of a data variable from the backend
14
+ *
15
+ * @param uid
16
+ * @param extras request extras to be merged into the options
17
+ * @param filters
18
+ * @param pagination
19
+ */
20
+ export declare function fetchDataVariable(uid: string, extras: RequestExtras, filters?: FilterQuery, pagination?: Pagination): Promise<DataFrame>;
21
+ interface TaskResponse {
22
+ task_id: string;
23
+ }
24
+ export interface DataResponse {
25
+ data: DataFrame | null;
26
+ totalCount: number;
27
+ schema: DataFrameSchema;
28
+ }
29
+ type FieldType = {
30
+ name: string | string[];
31
+ type: 'integer' | 'number' | 'boolean' | 'datetime' | 'duration' | 'any' | 'str';
32
+ };
33
+ type DataFrameSchema = {
34
+ fields: FieldType[];
35
+ primaryKey: string[];
36
+ };
37
+ export declare function isDataResponse(response: any): response is DataResponse;
38
+ /**
39
+ * Retrieve the value of a derived data variable from the backend
40
+ *
41
+ * @param uid
42
+ * @param extras request extras to be merged into the options
43
+ * @param filters
44
+ * @param pagination
45
+ * @param cacheKey - cache key of the underlying DV, required for DerivedDataVariables
46
+ * @param wsChannel - websocket channel, required for DerivedDataVariables
47
+ */
48
+ export declare function fetchDerivedDataVariable(uid: string, extras: RequestExtras, cacheKey: string, wsChannel: string, filters?: FilterQuery, pagination?: Pagination): Promise<DataFrame | TaskResponse | null>;
49
+ /**
50
+ * Get a callback to fetch data variable from the backend
51
+ *
52
+ * @param variable variable instance
53
+ * @param serverTriggerCounter a counter to force recreation of the callback
54
+ */
55
+ export declare function useFetchDataVariable(variable: DataVariable, serverTriggerCounter: number): (filters?: FilterQuery, pagination?: Pagination, options?: {
56
+ schema: boolean;
57
+ }) => Promise<DataResponse>;
58
+ /**
59
+ * Get a callback to fetch derived data variable from the backend.
60
+ * Throws a TaskCancelledError when the backend task is cancelled.
61
+ *
62
+ * @param variable variable instance
63
+ * @param taskContext global task context
64
+ * @param wsClient websocket client instance
65
+ * @param dvValuePromise promise representing underlying derived variable state
66
+ */
67
+ export declare function useFetchDerivedDataVariable(variable: DerivedDataVariable, taskContext: GlobalTaskContext, wsClient: WebSocketClientInterface, dvValuePromise: Promise<DerivedVariableValueResponse<any>>): (filters?: FilterQuery, pagination?: Pagination, options?: {
68
+ schema: boolean;
69
+ }) => Promise<DataResponse>;
70
+ /**
71
+ * Register an empty atom for DataVariable.
72
+ * Used to check whether a variable is registered within the app.
73
+ *
74
+ * @param variable variable to register
75
+ */
76
+ export declare function registerDataVariable(variable: DataVariable): void;
77
+ export {};
78
+ //# sourceMappingURL=data-variable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-variable.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/data-variable.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,wBAAwB,EAAqC,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,aAAa,EAAW,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAMtH,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAG1D;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,oBAAoB,CAMhF;AA8BD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACnC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,WAAW,EACrB,UAAU,CAAC,EAAE,UAAU,GACxB,OAAO,CAAC,SAAS,CAAC,CAOpB;AAED,UAAU,YAAY;IAClB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACn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