@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.
- package/LICENSE +201 -0
- package/README.md +101 -0
- package/dist/actions/download-variable.d.ts +8 -0
- package/dist/actions/download-variable.d.ts.map +1 -0
- package/dist/actions/download-variable.js +140 -0
- package/dist/actions/download-variable.js.map +1 -0
- package/dist/actions/index.d.ts +7 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +7 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/navigate-to.d.ts +8 -0
- package/dist/actions/navigate-to.d.ts.map +1 -0
- package/dist/actions/navigate-to.js +37 -0
- package/dist/actions/navigate-to.js.map +1 -0
- package/dist/actions/notify.d.ts +4 -0
- package/dist/actions/notify.d.ts.map +1 -0
- package/dist/actions/notify.js +11 -0
- package/dist/actions/notify.js.map +1 -0
- package/dist/actions/reset-variables.d.ts +8 -0
- package/dist/actions/reset-variables.d.ts.map +1 -0
- package/dist/actions/reset-variables.js +37 -0
- package/dist/actions/reset-variables.js.map +1 -0
- package/dist/actions/trigger-variable.d.ts +8 -0
- package/dist/actions/trigger-variable.d.ts.map +1 -0
- package/dist/actions/trigger-variable.js +14 -0
- package/dist/actions/trigger-variable.js.map +1 -0
- package/dist/actions/update-variable.d.ts +15 -0
- package/dist/actions/update-variable.d.ts.map +1 -0
- package/dist/actions/update-variable.js +56 -0
- package/dist/actions/update-variable.js.map +1 -0
- package/dist/api/core.d.ts +35 -0
- package/dist/api/core.d.ts.map +1 -0
- package/dist/api/core.js +112 -0
- package/dist/api/core.js.map +1 -0
- package/dist/api/http.d.ts +29 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/http.js +126 -0
- package/dist/api/http.js.map +1 -0
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +5 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/websocket.d.ts +222 -0
- package/dist/api/websocket.d.ts.map +1 -0
- package/dist/api/websocket.js +353 -0
- package/dist/api/websocket.js.map +1 -0
- package/dist/assets/causalens-dark.svg +29 -0
- package/dist/assets/causalens-light.svg +29 -0
- package/dist/assets/dara-dark.svg +20 -0
- package/dist/assets/dara-light.svg +15 -0
- package/dist/assets/fonts/Manrope-VariableFont_wght.ttf +0 -0
- package/dist/auth/auth-wrapper.d.ts +15 -0
- package/dist/auth/auth-wrapper.d.ts.map +1 -0
- package/dist/auth/auth-wrapper.js +72 -0
- package/dist/auth/auth-wrapper.js.map +1 -0
- package/dist/auth/auth.d.ts +61 -0
- package/dist/auth/auth.d.ts.map +1 -0
- package/dist/auth/auth.js +163 -0
- package/dist/auth/auth.js.map +1 -0
- package/dist/auth/basic/basic-auth-login.d.ts +6 -0
- package/dist/auth/basic/basic-auth-login.d.ts.map +1 -0
- package/dist/auth/basic/basic-auth-login.js +171 -0
- package/dist/auth/basic/basic-auth-login.js.map +1 -0
- package/dist/auth/basic/basic-auth-logout.d.ts +6 -0
- package/dist/auth/basic/basic-auth-logout.d.ts.map +1 -0
- package/dist/auth/basic/basic-auth-logout.js +18 -0
- package/dist/auth/basic/basic-auth-logout.js.map +1 -0
- package/dist/auth/default/default-auth-login.d.ts +6 -0
- package/dist/auth/default/default-auth-login.d.ts.map +1 -0
- package/dist/auth/default/default-auth-login.js +59 -0
- package/dist/auth/default/default-auth-login.js.map +1 -0
- package/dist/auth/index.d.ts +7 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/use-session-token.d.ts +19 -0
- package/dist/auth/use-session-token.d.ts.map +1 -0
- package/dist/auth/use-session-token.js +30 -0
- package/dist/auth/use-session-token.js.map +1 -0
- package/dist/components/fallback/default.d.ts +5 -0
- package/dist/components/fallback/default.d.ts.map +1 -0
- package/dist/components/fallback/default.js +10 -0
- package/dist/components/fallback/default.js.map +1 -0
- package/dist/components/fallback/dots.d.ts +7 -0
- package/dist/components/fallback/dots.d.ts.map +1 -0
- package/dist/components/fallback/dots.js +78 -0
- package/dist/components/fallback/dots.js.map +1 -0
- package/dist/components/fallback/row.d.ts +5 -0
- package/dist/components/fallback/row.d.ts.map +1 -0
- package/dist/components/fallback/row.js +14 -0
- package/dist/components/fallback/row.js.map +1 -0
- package/dist/components/for/for.d.ts +35 -0
- package/dist/components/for/for.d.ts.map +1 -0
- package/dist/components/for/for.js +44 -0
- package/dist/components/for/for.js.map +1 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/menu/menu.d.ts +14 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/menu/menu.js +58 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/progress-tracker/progress-tracker.d.ts +18 -0
- package/dist/components/progress-tracker/progress-tracker.d.ts.map +1 -0
- package/dist/components/progress-tracker/progress-tracker.js +204 -0
- package/dist/components/progress-tracker/progress-tracker.js.map +1 -0
- package/dist/components/router-content/router-content.d.ts +14 -0
- package/dist/components/router-content/router-content.d.ts.map +1 -0
- package/dist/components/router-content/router-content.js +17 -0
- package/dist/components/router-content/router-content.js.map +1 -0
- package/dist/components/side-bar-frame/side-bar-frame.d.ts +21 -0
- package/dist/components/side-bar-frame/side-bar-frame.d.ts.map +1 -0
- package/dist/components/side-bar-frame/side-bar-frame.js +87 -0
- package/dist/components/side-bar-frame/side-bar-frame.js.map +1 -0
- package/dist/components/top-bar-frame/top-bar-frame.d.ts +16 -0
- package/dist/components/top-bar-frame/top-bar-frame.d.ts.map +1 -0
- package/dist/components/top-bar-frame/top-bar-frame.js +89 -0
- package/dist/components/top-bar-frame/top-bar-frame.js.map +1 -0
- package/dist/dara_core-0.4.8-py3-none-any.whl +0 -0
- package/dist/devtools/backend-errors/backend-errors-ctx.d.ts +17 -0
- package/dist/devtools/backend-errors/backend-errors-ctx.d.ts.map +1 -0
- package/dist/devtools/backend-errors/backend-errors-ctx.js +37 -0
- package/dist/devtools/backend-errors/backend-errors-ctx.js.map +1 -0
- package/dist/devtools/backend-errors/backend-errors.d.ts +6 -0
- package/dist/devtools/backend-errors/backend-errors.d.ts.map +1 -0
- package/dist/devtools/backend-errors/backend-errors.js +57 -0
- package/dist/devtools/backend-errors/backend-errors.js.map +1 -0
- package/dist/devtools/backend-errors/error-display.d.ts +22 -0
- package/dist/devtools/backend-errors/error-display.d.ts.map +1 -0
- package/dist/devtools/backend-errors/error-display.js +101 -0
- package/dist/devtools/backend-errors/error-display.js.map +1 -0
- package/dist/devtools/backend-errors/index.d.ts +3 -0
- package/dist/devtools/backend-errors/index.d.ts.map +1 -0
- package/dist/devtools/backend-errors/index.js +3 -0
- package/dist/devtools/backend-errors/index.js.map +1 -0
- package/dist/devtools/devtools-content.d.ts +12 -0
- package/dist/devtools/devtools-content.d.ts.map +1 -0
- package/dist/devtools/devtools-content.js +73 -0
- package/dist/devtools/devtools-content.js.map +1 -0
- package/dist/devtools/devtools-context.d.ts +7 -0
- package/dist/devtools/devtools-context.d.ts.map +1 -0
- package/dist/devtools/devtools-context.js +9 -0
- package/dist/devtools/devtools-context.js.map +1 -0
- package/dist/devtools/devtools-wrapper.d.ts +8 -0
- package/dist/devtools/devtools-wrapper.d.ts.map +1 -0
- package/dist/devtools/devtools-wrapper.js +64 -0
- package/dist/devtools/devtools-wrapper.js.map +1 -0
- package/dist/devtools/devtools.d.ts +5 -0
- package/dist/devtools/devtools.d.ts.map +1 -0
- package/dist/devtools/devtools.js +10 -0
- package/dist/devtools/devtools.js.map +1 -0
- package/dist/devtools/floating-button.d.ts +23 -0
- package/dist/devtools/floating-button.d.ts.map +1 -0
- package/dist/devtools/floating-button.js +94 -0
- package/dist/devtools/floating-button.js.map +1 -0
- package/dist/devtools/index.d.ts +2 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/index.js +2 -0
- package/dist/devtools/index.js.map +1 -0
- package/dist/devtools/resizer.d.ts +18 -0
- package/dist/devtools/resizer.d.ts.map +1 -0
- package/dist/devtools/resizer.js +49 -0
- package/dist/devtools/resizer.js.map +1 -0
- package/dist/devtools/use-move.d.ts +21 -0
- package/dist/devtools/use-move.d.ts.map +1 -0
- package/dist/devtools/use-move.js +56 -0
- package/dist/devtools/use-move.js.map +1 -0
- package/dist/index.css +95 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/jest-setup.d.ts +2 -0
- package/dist/jest-setup.d.ts.map +1 -0
- package/dist/jest-setup.js +18 -0
- package/dist/jest-setup.js.map +1 -0
- package/dist/pages/error-page.d.ts +3 -0
- package/dist/pages/error-page.d.ts.map +1 -0
- package/dist/pages/error-page.js +32 -0
- package/dist/pages/error-page.js.map +1 -0
- package/dist/pages/sso-callback-page.d.ts +6 -0
- package/dist/pages/sso-callback-page.d.ts.map +1 -0
- package/dist/pages/sso-callback-page.js +8 -0
- package/dist/pages/sso-callback-page.js.map +1 -0
- package/dist/run.d.ts +22 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +40 -0
- package/dist/run.js.map +1 -0
- package/dist/shared/center/center.d.ts +5 -0
- package/dist/shared/center/center.d.ts.map +1 -0
- package/dist/shared/center/center.js +15 -0
- package/dist/shared/center/center.js.map +1 -0
- package/dist/shared/context/direction-context.d.ts +6 -0
- package/dist/shared/context/direction-context.d.ts.map +1 -0
- package/dist/shared/context/direction-context.js +4 -0
- package/dist/shared/context/direction-context.js.map +1 -0
- package/dist/shared/context/display-context.d.ts +13 -0
- package/dist/shared/context/display-context.d.ts.map +1 -0
- package/dist/shared/context/display-context.js +4 -0
- package/dist/shared/context/display-context.js.map +1 -0
- package/dist/shared/context/fallback-context.d.ts +11 -0
- package/dist/shared/context/fallback-context.d.ts.map +1 -0
- package/dist/shared/context/fallback-context.js +4 -0
- package/dist/shared/context/fallback-context.js.map +1 -0
- package/dist/shared/context/global-task-context.d.ts +40 -0
- package/dist/shared/context/global-task-context.d.ts.map +1 -0
- package/dist/shared/context/global-task-context.js +81 -0
- package/dist/shared/context/global-task-context.js.map +1 -0
- package/dist/shared/context/importers-context.d.ts +6 -0
- package/dist/shared/context/importers-context.d.ts.map +1 -0
- package/dist/shared/context/importers-context.js +4 -0
- package/dist/shared/context/importers-context.js.map +1 -0
- package/dist/shared/context/index.d.ts +10 -0
- package/dist/shared/context/index.d.ts.map +1 -0
- package/dist/shared/context/index.js +10 -0
- package/dist/shared/context/index.js.map +1 -0
- package/dist/shared/context/registries-context.d.ts +20 -0
- package/dist/shared/context/registries-context.d.ts.map +1 -0
- package/dist/shared/context/registries-context.js +8 -0
- package/dist/shared/context/registries-context.js.map +1 -0
- package/dist/shared/context/request-extras-context.d.ts +33 -0
- package/dist/shared/context/request-extras-context.d.ts.map +1 -0
- package/dist/shared/context/request-extras-context.js +55 -0
- package/dist/shared/context/request-extras-context.js.map +1 -0
- package/dist/shared/context/variable-context.d.ts +10 -0
- package/dist/shared/context/variable-context.d.ts.map +1 -0
- package/dist/shared/context/variable-context.js +4 -0
- package/dist/shared/context/variable-context.js.map +1 -0
- package/dist/shared/context/websocket-context.d.ts +7 -0
- package/dist/shared/context/websocket-context.d.ts.map +1 -0
- package/dist/shared/context/websocket-context.js +4 -0
- package/dist/shared/context/websocket-context.js.map +1 -0
- package/dist/shared/dynamic-component/clean-props.d.ts +6 -0
- package/dist/shared/dynamic-component/clean-props.d.ts.map +1 -0
- package/dist/shared/dynamic-component/clean-props.js +13 -0
- package/dist/shared/dynamic-component/clean-props.js.map +1 -0
- package/dist/shared/dynamic-component/dynamic-component.d.ts +16 -0
- package/dist/shared/dynamic-component/dynamic-component.d.ts.map +1 -0
- package/dist/shared/dynamic-component/dynamic-component.js +252 -0
- package/dist/shared/dynamic-component/dynamic-component.js.map +1 -0
- package/dist/shared/error-handling/error-display.d.ts +8 -0
- package/dist/shared/error-handling/error-display.d.ts.map +1 -0
- package/dist/shared/error-handling/error-display.js +94 -0
- package/dist/shared/error-handling/error-display.js.map +1 -0
- package/dist/shared/error-handling/index.d.ts +3 -0
- package/dist/shared/error-handling/index.d.ts.map +1 -0
- package/dist/shared/error-handling/index.js +3 -0
- package/dist/shared/error-handling/index.js.map +1 -0
- package/dist/shared/error-handling/types.d.ts +11 -0
- package/dist/shared/error-handling/types.d.ts.map +1 -0
- package/dist/shared/error-handling/types.js +9 -0
- package/dist/shared/error-handling/types.js.map +1 -0
- package/dist/shared/event-bus/event-bus.d.ts +27 -0
- package/dist/shared/event-bus/event-bus.d.ts.map +1 -0
- package/dist/shared/event-bus/event-bus.js +58 -0
- package/dist/shared/event-bus/event-bus.js.map +1 -0
- package/dist/shared/global-state-store.d.ts +54 -0
- package/dist/shared/global-state-store.d.ts.map +1 -0
- package/dist/shared/global-state-store.js +168 -0
- package/dist/shared/global-state-store.js.map +1 -0
- package/dist/shared/index.d.ts +12 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +10 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/interactivity/data-variable.d.ts +78 -0
- package/dist/shared/interactivity/data-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/data-variable.js +218 -0
- package/dist/shared/interactivity/data-variable.js.map +1 -0
- package/dist/shared/interactivity/derived-variable.d.ts +160 -0
- package/dist/shared/interactivity/derived-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/derived-variable.js +446 -0
- package/dist/shared/interactivity/derived-variable.js.map +1 -0
- package/dist/shared/interactivity/filtering.d.ts +9 -0
- package/dist/shared/interactivity/filtering.d.ts.map +1 -0
- package/dist/shared/interactivity/filtering.js +20 -0
- package/dist/shared/interactivity/filtering.js.map +1 -0
- package/dist/shared/interactivity/index.d.ts +10 -0
- package/dist/shared/interactivity/index.d.ts.map +1 -0
- package/dist/shared/interactivity/index.js +9 -0
- package/dist/shared/interactivity/index.js.map +1 -0
- package/dist/shared/interactivity/internal.d.ts +9 -0
- package/dist/shared/interactivity/internal.d.ts.map +1 -0
- package/dist/shared/interactivity/internal.js +11 -0
- package/dist/shared/interactivity/internal.js.map +1 -0
- package/dist/shared/interactivity/nested.d.ts +16 -0
- package/dist/shared/interactivity/nested.d.ts.map +1 -0
- package/dist/shared/interactivity/nested.js +54 -0
- package/dist/shared/interactivity/nested.js.map +1 -0
- package/dist/shared/interactivity/persistence.d.ts +43 -0
- package/dist/shared/interactivity/persistence.d.ts.map +1 -0
- package/dist/shared/interactivity/persistence.js +215 -0
- package/dist/shared/interactivity/persistence.js.map +1 -0
- package/dist/shared/interactivity/plain-variable.d.ts +17 -0
- package/dist/shared/interactivity/plain-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/plain-variable.js +222 -0
- package/dist/shared/interactivity/plain-variable.js.map +1 -0
- package/dist/shared/interactivity/resolve-value.d.ts +13 -0
- package/dist/shared/interactivity/resolve-value.d.ts.map +1 -0
- package/dist/shared/interactivity/resolve-value.js +36 -0
- package/dist/shared/interactivity/resolve-value.js.map +1 -0
- package/dist/shared/interactivity/resolve-variable.d.ts +18 -0
- package/dist/shared/interactivity/resolve-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/resolve-variable.js +46 -0
- package/dist/shared/interactivity/resolve-variable.js.map +1 -0
- package/dist/shared/interactivity/store.d.ts +76 -0
- package/dist/shared/interactivity/store.d.ts.map +1 -0
- package/dist/shared/interactivity/store.js +99 -0
- package/dist/shared/interactivity/store.js.map +1 -0
- package/dist/shared/interactivity/triggers.d.ts +31 -0
- package/dist/shared/interactivity/triggers.d.ts.map +1 -0
- package/dist/shared/interactivity/triggers.js +105 -0
- package/dist/shared/interactivity/triggers.js.map +1 -0
- package/dist/shared/interactivity/url-variable.d.ts +12 -0
- package/dist/shared/interactivity/url-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/url-variable.js +27 -0
- package/dist/shared/interactivity/url-variable.js.map +1 -0
- package/dist/shared/interactivity/use-any-variable.d.ts +8 -0
- package/dist/shared/interactivity/use-any-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/use-any-variable.js +39 -0
- package/dist/shared/interactivity/use-any-variable.js.map +1 -0
- package/dist/shared/interactivity/use-data-variable.d.ts +18 -0
- package/dist/shared/interactivity/use-data-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/use-data-variable.js +58 -0
- package/dist/shared/interactivity/use-data-variable.js.map +1 -0
- package/dist/shared/interactivity/use-refresh-selector.d.ts +5 -0
- package/dist/shared/interactivity/use-refresh-selector.d.ts.map +1 -0
- package/dist/shared/interactivity/use-refresh-selector.js +20 -0
- package/dist/shared/interactivity/use-refresh-selector.js.map +1 -0
- package/dist/shared/interactivity/use-server-component.d.ts +24 -0
- package/dist/shared/interactivity/use-server-component.d.ts.map +1 -0
- package/dist/shared/interactivity/use-server-component.js +256 -0
- package/dist/shared/interactivity/use-server-component.js.map +1 -0
- package/dist/shared/interactivity/use-variable-state.d.ts +9 -0
- package/dist/shared/interactivity/use-variable-state.d.ts.map +1 -0
- package/dist/shared/interactivity/use-variable-state.js +26 -0
- package/dist/shared/interactivity/use-variable-state.js.map +1 -0
- package/dist/shared/interactivity/use-variable-value.d.ts +33 -0
- package/dist/shared/interactivity/use-variable-value.d.ts.map +1 -0
- package/dist/shared/interactivity/use-variable-value.js +94 -0
- package/dist/shared/interactivity/use-variable-value.js.map +1 -0
- package/dist/shared/interactivity/use-variable.d.ts +12 -0
- package/dist/shared/interactivity/use-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/use-variable.js +84 -0
- package/dist/shared/interactivity/use-variable.js.map +1 -0
- package/dist/shared/private-route/private-route.d.ts +19 -0
- package/dist/shared/private-route/private-route.d.ts.map +1 -0
- package/dist/shared/private-route/private-route.js +35 -0
- package/dist/shared/private-route/private-route.js.map +1 -0
- package/dist/shared/template-root/dynamic-context.d.ts +9 -0
- package/dist/shared/template-root/dynamic-context.d.ts.map +1 -0
- package/dist/shared/template-root/dynamic-context.js +29 -0
- package/dist/shared/template-root/dynamic-context.js.map +1 -0
- package/dist/shared/template-root/template-root.d.ts +12 -0
- package/dist/shared/template-root/template-root.d.ts.map +1 -0
- package/dist/shared/template-root/template-root.js +94 -0
- package/dist/shared/template-root/template-root.js.map +1 -0
- package/dist/shared/utils/clean-session-cache.d.ts +9 -0
- package/dist/shared/utils/clean-session-cache.d.ts.map +1 -0
- package/dist/shared/utils/clean-session-cache.js +19 -0
- package/dist/shared/utils/clean-session-cache.js.map +1 -0
- package/dist/shared/utils/embed.d.ts +22 -0
- package/dist/shared/utils/embed.d.ts.map +1 -0
- package/dist/shared/utils/embed.js +43 -0
- package/dist/shared/utils/embed.js.map +1 -0
- package/dist/shared/utils/get-icon.d.ts +9 -0
- package/dist/shared/utils/get-icon.d.ts.map +1 -0
- package/dist/shared/utils/get-icon.js +30 -0
- package/dist/shared/utils/get-icon.js.map +1 -0
- package/dist/shared/utils/hashing.d.ts +14 -0
- package/dist/shared/utils/hashing.d.ts.map +1 -0
- package/dist/shared/utils/hashing.js +26 -0
- package/dist/shared/utils/hashing.js.map +1 -0
- package/dist/shared/utils/index.d.ts +19 -0
- package/dist/shared/utils/index.d.ts.map +1 -0
- package/dist/shared/utils/index.js +17 -0
- package/dist/shared/utils/index.js.map +1 -0
- package/dist/shared/utils/inject-css.d.ts +12 -0
- package/dist/shared/utils/inject-css.d.ts.map +1 -0
- package/dist/shared/utils/inject-css.js +25 -0
- package/dist/shared/utils/inject-css.js.map +1 -0
- package/dist/shared/utils/is-js-component.d.ts +9 -0
- package/dist/shared/utils/is-js-component.d.ts.map +1 -0
- package/dist/shared/utils/is-js-component.js +11 -0
- package/dist/shared/utils/is-js-component.js.map +1 -0
- package/dist/shared/utils/normalization.d.ts +19 -0
- package/dist/shared/utils/normalization.d.ts.map +1 -0
- package/dist/shared/utils/normalization.js +121 -0
- package/dist/shared/utils/normalization.js.map +1 -0
- package/dist/shared/utils/resolve-theme.d.ts +9 -0
- package/dist/shared/utils/resolve-theme.d.ts.map +1 -0
- package/dist/shared/utils/resolve-theme.js +28 -0
- package/dist/shared/utils/resolve-theme.js.map +1 -0
- package/dist/shared/utils/templating.d.ts +24 -0
- package/dist/shared/utils/templating.d.ts.map +1 -0
- package/dist/shared/utils/templating.js +67 -0
- package/dist/shared/utils/templating.js.map +1 -0
- package/dist/shared/utils/use-action-registry.d.ts +11 -0
- package/dist/shared/utils/use-action-registry.d.ts.map +1 -0
- package/dist/shared/utils/use-action-registry.js +18 -0
- package/dist/shared/utils/use-action-registry.js.map +1 -0
- package/dist/shared/utils/use-action.d.ts +34 -0
- package/dist/shared/utils/use-action.d.ts.map +1 -0
- package/dist/shared/utils/use-action.js +314 -0
- package/dist/shared/utils/use-action.js.map +1 -0
- package/dist/shared/utils/use-component-registry.d.ts +11 -0
- package/dist/shared/utils/use-component-registry.d.ts.map +1 -0
- package/dist/shared/utils/use-component-registry.js +57 -0
- package/dist/shared/utils/use-component-registry.js.map +1 -0
- package/dist/shared/utils/use-component-styles.d.ts +24 -0
- package/dist/shared/utils/use-component-styles.d.ts.map +1 -0
- package/dist/shared/utils/use-component-styles.js +69 -0
- package/dist/shared/utils/use-component-styles.js.map +1 -0
- package/dist/shared/utils/use-defer-loadable.d.ts +8 -0
- package/dist/shared/utils/use-defer-loadable.d.ts.map +1 -0
- package/dist/shared/utils/use-defer-loadable.js +44 -0
- package/dist/shared/utils/use-defer-loadable.js.map +1 -0
- package/dist/shared/utils/use-interval.d.ts +9 -0
- package/dist/shared/utils/use-interval.d.ts.map +1 -0
- package/dist/shared/utils/use-interval.js +19 -0
- package/dist/shared/utils/use-interval.js.map +1 -0
- package/dist/shared/utils/use-previous.d.ts +10 -0
- package/dist/shared/utils/use-previous.d.ts.map +1 -0
- package/dist/shared/utils/use-previous.js +17 -0
- package/dist/shared/utils/use-previous.js.map +1 -0
- package/dist/shared/utils/use-url-sync.d.ts +20 -0
- package/dist/shared/utils/use-url-sync.d.ts.map +1 -0
- package/dist/shared/utils/use-url-sync.js +68 -0
- package/dist/shared/utils/use-url-sync.js.map +1 -0
- package/dist/shared/utils/use-window-title.d.ts +3 -0
- package/dist/shared/utils/use-window-title.d.ts.map +1 -0
- package/dist/shared/utils/use-window-title.js +14 -0
- package/dist/shared/utils/use-window-title.js.map +1 -0
- package/dist/shared/variable-state-provider/variable-state-provider.d.ts +10 -0
- package/dist/shared/variable-state-provider/variable-state-provider.d.ts.map +1 -0
- package/dist/shared/variable-state-provider/variable-state-provider.js +29 -0
- package/dist/shared/variable-state-provider/variable-state-provider.js.map +1 -0
- package/dist/shared/wrapper/wrapper.d.ts +7 -0
- package/dist/shared/wrapper/wrapper.d.ts.map +1 -0
- package/dist/shared/wrapper/wrapper.js +14 -0
- package/dist/shared/wrapper/wrapper.js.map +1 -0
- package/dist/types/auth.d.ts +15 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +6 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/core.d.ts +440 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +22 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/utils.d.ts +56 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +93 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/umd/dara.core.umd.js +86508 -0
- package/dist/umd/style.css +848 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +20 -0
- package/dist/utils.js.map +1 -0
- package/package.json +121 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { isDataVariable, isDerivedDataVariable, isDerivedVariable, isUrlVariable, } from '../../types';
|
|
2
|
+
// eslint-disable-next-line import/no-cycle
|
|
3
|
+
import { getOrRegisterDerivedVariable, getOrRegisterPlainVariable, getOrRegisterUrlVariable, resolveDataVariable, } from './internal';
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a variable to a value (for non-derived variables using provided resolver)
|
|
6
|
+
* or a ResolvedDerivedVariable (if it's a derived variable).
|
|
7
|
+
* Registers all encountered variables which aren't yet in registry.
|
|
8
|
+
*
|
|
9
|
+
* @param variable variable to resolve
|
|
10
|
+
* @param client websocket client from context
|
|
11
|
+
* @param taskContext global task context
|
|
12
|
+
* @param extras request extras to be merged into the options
|
|
13
|
+
* @param resolver function to run the value through (for non-derived variables)
|
|
14
|
+
*/
|
|
15
|
+
export function resolveVariable(variable, client, taskContext, extras, resolver = (val) => val) {
|
|
16
|
+
if (isDerivedVariable(variable) || isDerivedDataVariable(variable)) {
|
|
17
|
+
getOrRegisterDerivedVariable(variable, client, taskContext, extras);
|
|
18
|
+
// For derived variable, recursively resolve the dependencies
|
|
19
|
+
const values = variable.variables.map((v) => resolveVariable(v, client, taskContext, extras, resolver));
|
|
20
|
+
// Store indexes of values which are in deps
|
|
21
|
+
const deps = variable.deps.map((dep) => variable.variables.findIndex((v) => v.uid === dep.uid));
|
|
22
|
+
if (isDerivedDataVariable(variable)) {
|
|
23
|
+
return {
|
|
24
|
+
deps,
|
|
25
|
+
filters: variable.filters,
|
|
26
|
+
type: 'derived-data',
|
|
27
|
+
uid: variable.uid,
|
|
28
|
+
values,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
deps,
|
|
33
|
+
type: 'derived',
|
|
34
|
+
uid: variable.uid,
|
|
35
|
+
values,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (isDataVariable(variable)) {
|
|
39
|
+
return resolveDataVariable(variable);
|
|
40
|
+
}
|
|
41
|
+
if (isUrlVariable(variable)) {
|
|
42
|
+
return resolver(getOrRegisterUrlVariable(variable));
|
|
43
|
+
}
|
|
44
|
+
return resolver(getOrRegisterPlainVariable(variable, client, taskContext, extras));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=resolve-variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-vari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O;YACH,IAAI;YACJ,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,MAAM;SACkB,CAAC;IACjC,CAAC;IAED,IAAI,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,OAAO,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,OAAO,QAAQ,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,QAAQ,CAAC,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { RecoilState, RecoilValue } from 'recoil';
|
|
2
|
+
import { RequestExtrasSerializable } from '../../api/http';
|
|
3
|
+
import { AnyVariable } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Selector family type which constructs a selector from a given set of extras.
|
|
6
|
+
*/
|
|
7
|
+
export type SelectorFamily = (P: RequestExtrasSerializable) => RecoilValue<any>;
|
|
8
|
+
/**
|
|
9
|
+
* Atom family type which constructs an atom from a given set of extras.
|
|
10
|
+
*/
|
|
11
|
+
export type AtomFamily = (P: RequestExtrasSerializable) => RecoilState<any>;
|
|
12
|
+
/**
|
|
13
|
+
* Key -> trigger atom
|
|
14
|
+
*/
|
|
15
|
+
export declare const dataRegistry: Map<string, RecoilState<TriggerIndexValue>>;
|
|
16
|
+
/**
|
|
17
|
+
* Key -> atom
|
|
18
|
+
*/
|
|
19
|
+
export declare const atomRegistry: Map<string, RecoilState<any>>;
|
|
20
|
+
/**
|
|
21
|
+
* Key -> atom family
|
|
22
|
+
*/
|
|
23
|
+
export declare const atomFamilyRegistry: Map<string, AtomFamily>;
|
|
24
|
+
/**
|
|
25
|
+
* Atom family function => {extras => atom}
|
|
26
|
+
*
|
|
27
|
+
* Stores all instances of a given atom family, as a map of seriailzed extras to atom.
|
|
28
|
+
*/
|
|
29
|
+
export declare const atomFamilyMembersRegistry: Map<AtomFamily, Map<string, RecoilState<any>>>;
|
|
30
|
+
/**
|
|
31
|
+
* Key -> selector
|
|
32
|
+
*/
|
|
33
|
+
export declare const selectorRegistry: Map<string, RecoilValue<any>>;
|
|
34
|
+
/**
|
|
35
|
+
* Key -> selector family
|
|
36
|
+
*/
|
|
37
|
+
export declare const selectorFamilyRegistry: Map<string, SelectorFamily>;
|
|
38
|
+
/**
|
|
39
|
+
* Selector family function => {extras => selector}
|
|
40
|
+
*
|
|
41
|
+
* Stores all instances of a given selector family, as a map of seriailzed extras to selector.
|
|
42
|
+
*/
|
|
43
|
+
export declare const selectorFamilyMembersRegistry: Map<SelectorFamily, Map<string, RecoilValue<any>>>;
|
|
44
|
+
/**
|
|
45
|
+
* Key -> dependencies data for a selector
|
|
46
|
+
*/
|
|
47
|
+
export declare const depsRegistry: Map<string, {
|
|
48
|
+
args: any[];
|
|
49
|
+
cacheKey: string;
|
|
50
|
+
result: any;
|
|
51
|
+
}>;
|
|
52
|
+
export type TriggerIndexValue = {
|
|
53
|
+
force: boolean;
|
|
54
|
+
inc: number;
|
|
55
|
+
};
|
|
56
|
+
type RegistryKeyType = 'selector' | 'derived-selector' | 'trigger' | 'filters';
|
|
57
|
+
/**
|
|
58
|
+
* Get a unique registry key of a given type for a given variable.
|
|
59
|
+
*
|
|
60
|
+
* @param variable variable to get the key for
|
|
61
|
+
* @param type type of the registry entry
|
|
62
|
+
*/
|
|
63
|
+
export declare function getRegistryKey<T>(variable: AnyVariable<T>, type: RegistryKeyType): string;
|
|
64
|
+
/**
|
|
65
|
+
* Clear registries - to be used in tests only.
|
|
66
|
+
*/
|
|
67
|
+
export declare function clearRegistries_TEST(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Check whether a given variable is registered within the application
|
|
70
|
+
* (More strictly, under the current RecoilRoot)
|
|
71
|
+
*
|
|
72
|
+
* @param variable variable to check
|
|
73
|
+
*/
|
|
74
|
+
export declare function isRegistered<T>(variable: AnyVariable<T>): boolean;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/store.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAc,MAAM,SAAS,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,yBAAyB,KAAK,WAAW,CAAC,GAAG,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,EAAE,yBAAyB,KAAK,WAAW,CAAC,GAAG,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,YAAY,6CAAoD,CAAC;AAC9E;;GAEG;AACH,eAAO,MAAM,YAAY,+BAAsC,CAAC;AAChE;;GAEG;AACH,eAAO,MAAM,kBAAkB,yBAAgC,CAAC;AAChE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,gDAAuD,CAAC;AAC9F;;GAEG;AACH,eAAO,MAAM,gBAAgB,+BAAsC,CAAC;AACpE;;GAEG;AACH,eAAO,MAAM,sBAAsB,6BAAoC,CAAC;AACxE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,oDAA2D,CAAC;AACtG;;GAEG;AACH,eAAO,MAAM,YAAY;UAGX,GAAG,EAAE;cACD,MAAM;YACR,GAAG;EAEhB,CAAC;AAEJ,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,eAAe,GAAG,UAAU,GAAG,kBAAkB,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/E;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,GAAG,MAAM,CAEzF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAa3C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CA+BjE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { getUniqueIdentifier } from '../../shared/utils/hashing';
|
|
2
|
+
import { isVariable } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Key -> trigger atom
|
|
5
|
+
*/
|
|
6
|
+
export const dataRegistry = new Map();
|
|
7
|
+
/**
|
|
8
|
+
* Key -> atom
|
|
9
|
+
*/
|
|
10
|
+
export const atomRegistry = new Map();
|
|
11
|
+
/**
|
|
12
|
+
* Key -> atom family
|
|
13
|
+
*/
|
|
14
|
+
export const atomFamilyRegistry = new Map();
|
|
15
|
+
/**
|
|
16
|
+
* Atom family function => {extras => atom}
|
|
17
|
+
*
|
|
18
|
+
* Stores all instances of a given atom family, as a map of seriailzed extras to atom.
|
|
19
|
+
*/
|
|
20
|
+
export const atomFamilyMembersRegistry = new Map();
|
|
21
|
+
/**
|
|
22
|
+
* Key -> selector
|
|
23
|
+
*/
|
|
24
|
+
export const selectorRegistry = new Map();
|
|
25
|
+
/**
|
|
26
|
+
* Key -> selector family
|
|
27
|
+
*/
|
|
28
|
+
export const selectorFamilyRegistry = new Map();
|
|
29
|
+
/**
|
|
30
|
+
* Selector family function => {extras => selector}
|
|
31
|
+
*
|
|
32
|
+
* Stores all instances of a given selector family, as a map of seriailzed extras to selector.
|
|
33
|
+
*/
|
|
34
|
+
export const selectorFamilyMembersRegistry = new Map();
|
|
35
|
+
/**
|
|
36
|
+
* Key -> dependencies data for a selector
|
|
37
|
+
*/
|
|
38
|
+
export const depsRegistry = new Map();
|
|
39
|
+
/**
|
|
40
|
+
* Get a unique registry key of a given type for a given variable.
|
|
41
|
+
*
|
|
42
|
+
* @param variable variable to get the key for
|
|
43
|
+
* @param type type of the registry entry
|
|
44
|
+
*/
|
|
45
|
+
export function getRegistryKey(variable, type) {
|
|
46
|
+
return `${getUniqueIdentifier(variable)}-${type}`;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Clear registries - to be used in tests only.
|
|
50
|
+
*/
|
|
51
|
+
export function clearRegistries_TEST() {
|
|
52
|
+
for (const registry of [
|
|
53
|
+
dataRegistry,
|
|
54
|
+
atomRegistry,
|
|
55
|
+
atomFamilyRegistry,
|
|
56
|
+
atomFamilyMembersRegistry,
|
|
57
|
+
selectorRegistry,
|
|
58
|
+
depsRegistry,
|
|
59
|
+
selectorFamilyRegistry,
|
|
60
|
+
selectorFamilyMembersRegistry,
|
|
61
|
+
]) {
|
|
62
|
+
registry.clear();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Check whether a given variable is registered within the application
|
|
67
|
+
* (More strictly, under the current RecoilRoot)
|
|
68
|
+
*
|
|
69
|
+
* @param variable variable to check
|
|
70
|
+
*/
|
|
71
|
+
export function isRegistered(variable) {
|
|
72
|
+
var _a;
|
|
73
|
+
if (!isVariable(variable)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
switch (variable.__typename) {
|
|
77
|
+
case 'Variable': {
|
|
78
|
+
if (atomRegistry.has(variable.uid)) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
const family = atomFamilyRegistry.get(variable.uid);
|
|
82
|
+
return ((_a = atomFamilyMembersRegistry.get(family)) === null || _a === void 0 ? void 0 : _a.size) > 0;
|
|
83
|
+
}
|
|
84
|
+
case 'UrlVariable':
|
|
85
|
+
case 'DataVariable':
|
|
86
|
+
return atomRegistry.has(variable.uid);
|
|
87
|
+
case 'DerivedVariable': {
|
|
88
|
+
const key = getRegistryKey(variable, 'selector');
|
|
89
|
+
return selectorFamilyRegistry.has(key);
|
|
90
|
+
}
|
|
91
|
+
case 'DerivedDataVariable': {
|
|
92
|
+
const key = getRegistryKey(variable, 'selector');
|
|
93
|
+
return selectorFamilyRegistry.has(key);
|
|
94
|
+
}
|
|
95
|
+
default:
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../js/shared/interactivity/store.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAe,UAAU,EAAE,MAAM,SAAS,CAAC;AAYlD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA0C,CAAC;AAC9E;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA4B,CAAC;AAChE;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAsB,CAAC;AAChE;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,GAAG,EAA6C,CAAC;AAC9F;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA4B,CAAC;AACpE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAA0B,CAAC;AACxE;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,GAAG,EAAiD,CAAC;AACtG;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,GAAG,EAOhC,CAAC;AASJ;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAI,QAAwB,EAAE,IAAqB;IAC7E,OAAO,GAAG,mBAAmB,CAAC,QAAQ,CAAC,IAAI,IAA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AG,CAAC,CAAC;QAC3C,CAAC;QAED;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RecoilState } from 'recoil';
|
|
2
|
+
import { WebSocketClientInterface } from '../../api';
|
|
3
|
+
import { AnyVariable, DataVariable, DerivedDataVariable, DerivedVariable } from '../../types';
|
|
4
|
+
import { TriggerIndexValue } from './store';
|
|
5
|
+
/**
|
|
6
|
+
* Get a trigger index for a variable from the atom registry, registering it if not already registered
|
|
7
|
+
*
|
|
8
|
+
* @param variable variable to register trigger for
|
|
9
|
+
*/
|
|
10
|
+
export declare function getOrRegisterTrigger(variable: DerivedVariable | DerivedDataVariable): RecoilState<TriggerIndexValue>;
|
|
11
|
+
/**
|
|
12
|
+
* Get the data variable server trigger atom if it exists, otherwise create it
|
|
13
|
+
*/
|
|
14
|
+
export declare function getOrRegisterDataVariableTrigger(variable: DataVariable, wsClient: WebSocketClientInterface): RecoilState<TriggerIndexValue>;
|
|
15
|
+
/**
|
|
16
|
+
* Recursively register triggers as dependencies by calling the registerFunc on all nested derived variables
|
|
17
|
+
*
|
|
18
|
+
* @param variable variable to register triggers for
|
|
19
|
+
* @param wsClient websocket client
|
|
20
|
+
* @param registerFunc register function to run
|
|
21
|
+
*/
|
|
22
|
+
export declare function registerTriggers(variable: DerivedVariable | DerivedDataVariable, wsClient: WebSocketClientInterface, registerFunc?: (state: RecoilState<any>) => TriggerIndexValue): Array<TriggerIndexValue>;
|
|
23
|
+
/**
|
|
24
|
+
* Recursively register triggers in the list of dependant variables
|
|
25
|
+
*
|
|
26
|
+
* @param variable variable to register triggers for
|
|
27
|
+
* @param wsClient websocket client
|
|
28
|
+
* @param registerFunc register function to run
|
|
29
|
+
*/
|
|
30
|
+
export declare function registerChildTriggers(variables: AnyVariable<any>[], wsClient: WebSocketClientInterface, registerFunc?: (state: RecoilState<any>) => TriggerIndexValue): Array<TriggerIndexValue>;
|
|
31
|
+
//# sourceMappingURL=triggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/triggers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAwB,MAAM,QAAQ,CAAC;AAE3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EACH,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,eAAe,EAIlB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,iBAAiB,EAA8C,MAAM,SAAS,CAAC;AAExF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,mBAAmB,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAiBpH;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC5C,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,wBAAwB,GACnC,WAAW,CAAC,iBAAiB,CAAC,CAwChC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC5B,QAAQ,EAAE,eAAe,GAAG,mBAAmB,EAC/C,QAAQ,EAAE,wBAAwB,EAClC,YAAY,GAAE,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,iBAAkC,GAC9E,KAAK,CAAC,iBAAiB,CAAC,CAmB1B;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACjC,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,EAC7B,QAAQ,EAAE,wBAAwB,EAClC,YAAY,GAAE,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,iBAAkC,GAC9E,KAAK,CAAC,iBAAiB,CAAC,CAc1B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { atom, useRecoilValue } from 'recoil';
|
|
2
|
+
import { isDataVariable, isDerivedDataVariable, isDerivedVariable, } from '../../types';
|
|
3
|
+
import { atomRegistry, dataRegistry, getRegistryKey } from './store';
|
|
4
|
+
/**
|
|
5
|
+
* Get a trigger index for a variable from the atom registry, registering it if not already registered
|
|
6
|
+
*
|
|
7
|
+
* @param variable variable to register trigger for
|
|
8
|
+
*/
|
|
9
|
+
export function getOrRegisterTrigger(variable) {
|
|
10
|
+
const triggerKey = getRegistryKey(variable, 'trigger');
|
|
11
|
+
if (!atomRegistry.has(triggerKey)) {
|
|
12
|
+
atomRegistry.set(triggerKey, atom({
|
|
13
|
+
default: {
|
|
14
|
+
force: false,
|
|
15
|
+
inc: 0,
|
|
16
|
+
},
|
|
17
|
+
key: triggerKey,
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
return atomRegistry.get(triggerKey);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the data variable server trigger atom if it exists, otherwise create it
|
|
24
|
+
*/
|
|
25
|
+
export function getOrRegisterDataVariableTrigger(variable, wsClient) {
|
|
26
|
+
// get or create an observable for the data variable
|
|
27
|
+
const key = `${variable.uid}-data`;
|
|
28
|
+
if (!dataRegistry.has(key)) {
|
|
29
|
+
dataRegistry.set(key, atom({
|
|
30
|
+
default: {
|
|
31
|
+
force: true,
|
|
32
|
+
inc: 0,
|
|
33
|
+
},
|
|
34
|
+
effects: [
|
|
35
|
+
// synchronize with server triggers - increment when the variable is triggered on the server side
|
|
36
|
+
({ setSelf }) => {
|
|
37
|
+
const subscription = wsClient.serverTriggers$(variable.uid).subscribe(() => {
|
|
38
|
+
setSelf((v) => {
|
|
39
|
+
if (typeof v === 'object' && 'inc' in v) {
|
|
40
|
+
return {
|
|
41
|
+
force: true,
|
|
42
|
+
inc: v.inc + 1,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
force: true,
|
|
47
|
+
inc: 1,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
return () => {
|
|
52
|
+
subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
key,
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
return dataRegistry.get(key);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Recursively register triggers as dependencies by calling the registerFunc on all nested derived variables
|
|
63
|
+
*
|
|
64
|
+
* @param variable variable to register triggers for
|
|
65
|
+
* @param wsClient websocket client
|
|
66
|
+
* @param registerFunc register function to run
|
|
67
|
+
*/
|
|
68
|
+
export function registerTriggers(variable, wsClient, registerFunc = useRecoilValue) {
|
|
69
|
+
const triggers = [];
|
|
70
|
+
// Register the variable itself
|
|
71
|
+
const triggerIndex = getOrRegisterTrigger(variable);
|
|
72
|
+
triggers.push(registerFunc(triggerIndex));
|
|
73
|
+
// Register nested derived and data variables triggers recursively
|
|
74
|
+
variable.variables.forEach((v) => {
|
|
75
|
+
if (isDerivedVariable(v) || isDerivedDataVariable(v)) {
|
|
76
|
+
triggers.push(...registerTriggers(v, wsClient, registerFunc));
|
|
77
|
+
}
|
|
78
|
+
if (isDataVariable(v)) {
|
|
79
|
+
const serverTrigger = getOrRegisterDataVariableTrigger(v, wsClient);
|
|
80
|
+
triggers.push(registerFunc(serverTrigger));
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
return triggers;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Recursively register triggers in the list of dependant variables
|
|
87
|
+
*
|
|
88
|
+
* @param variable variable to register triggers for
|
|
89
|
+
* @param wsClient websocket client
|
|
90
|
+
* @param registerFunc register function to run
|
|
91
|
+
*/
|
|
92
|
+
export function registerChildTriggers(variables, wsClient, registerFunc = useRecoilValue) {
|
|
93
|
+
const triggers = [];
|
|
94
|
+
variables.forEach((v) => {
|
|
95
|
+
if (isDerivedVariable(v) || isDerivedDataVariable(v)) {
|
|
96
|
+
triggers.push(...registerTriggers(v, wsClient, registerFunc));
|
|
97
|
+
}
|
|
98
|
+
if (isDataVariable(v)) {
|
|
99
|
+
const serverTrigger = getOrRegisterDataVariableTrigger(v, wsClient);
|
|
100
|
+
triggers.push(registerFunc(serverTrigger));
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return triggers;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=triggers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.js","sourceRoot":"","sources":["../../../js/shared/interactivity/triggers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3D,OAAO,EAKH,cAAc,EACd,qBAAqB,EACrB,iBAAiB,GACpB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAExF;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAA+C;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAEvD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,YAAY,CAAC,GAAG,CACZ,UAAU,EACV,IAAI,CAAC;YACD,OAAO,EAAE;gBACL,KAAK,EAAE,KAAK;gBACZ,GAAG,EAAE,CAAC;aACT;YACD,GAAG,EAAE,UAAU;SAClB,CAAC,CACL,CAAC;IACN,CAAC;IAED,OAAO,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC5C,QAAsB,EACtB,QAAkC;IAElC,oDAAoD;IACpD,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC;IACnC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,YAAY,CAAC,GAAG,CACZ,GAAG,EACH,IAAI,CAAC;YACD,OAAO,EAAE;gBACL,KAAK,EAA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,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;QAClE,CAAC;QACD,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;YACpB,MAAM,aAAa,GAAG,gCAAgC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YACpE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACjC,SAA6B,EAC7B,QAAkC,EAClC,eAA+D,cAAc;IAE7E,MAAM,QAAQ,GAAwB,EAAE,CAAC;IAEzC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QACpB,IAAI,iBAAiB,CAAC,CAAC,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;QAClE,CAAC;QACD,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;YACpB,MAAM,aAAa,GAAG,gCAAgC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YACpE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RecoilState } from 'recoil';
|
|
2
|
+
import { UrlVariable } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Get a URL variable from the atom registry, registering it if not already registered
|
|
5
|
+
* TODO: once persist_value is unified with url sync, this can be moved into the same function as getOrRegisterPlainVariable
|
|
6
|
+
*
|
|
7
|
+
* @param variable variable to register
|
|
8
|
+
* @param searchString URL search string
|
|
9
|
+
*/
|
|
10
|
+
export declare function getOrRegisterUrlVariable<T>(variable: UrlVariable<T>): RecoilState<T>;
|
|
11
|
+
export declare function useUrlVariable<T>(variable: UrlVariable<T>): [T, (value: T) => void];
|
|
12
|
+
//# sourceMappingURL=url-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-variable.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/url-variable.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAwB,MAAM,QAAQ,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAItC;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAcpF;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAEnF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { mixed } from '@recoiljs/refine';
|
|
2
|
+
import { atom, useRecoilState } from 'recoil';
|
|
3
|
+
import { urlSyncEffect } from 'recoil-sync';
|
|
4
|
+
import { atomRegistry } from './store';
|
|
5
|
+
/**
|
|
6
|
+
* Get a URL variable from the atom registry, registering it if not already registered
|
|
7
|
+
* TODO: once persist_value is unified with url sync, this can be moved into the same function as getOrRegisterPlainVariable
|
|
8
|
+
*
|
|
9
|
+
* @param variable variable to register
|
|
10
|
+
* @param searchString URL search string
|
|
11
|
+
*/
|
|
12
|
+
export function getOrRegisterUrlVariable(variable) {
|
|
13
|
+
if (!atomRegistry.has(variable.uid)) {
|
|
14
|
+
atomRegistry.set(variable.uid, atom({
|
|
15
|
+
default: variable.default,
|
|
16
|
+
effects: [
|
|
17
|
+
urlSyncEffect({ history: 'push', itemKey: variable.query, refine: mixed(), syncDefault: true }),
|
|
18
|
+
],
|
|
19
|
+
key: variable.uid,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
return atomRegistry.get(variable.uid);
|
|
23
|
+
}
|
|
24
|
+
export function useUrlVariable(variable) {
|
|
25
|
+
return useRecoilState(getOrRegisterUrlVariable(variable));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=url-variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-variable.js","sourceRoot":"","sources":["../../../js/shared/interactivity/url-variable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAe,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAI,QAAwB;IAChE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,YAAY,CAAC,GAAG,CACZ,QAAQ,CAAC,GAAG,EACZ,IAAI,CAAC;YACD,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,OAAO,EAAE;gBACL,aAAa,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;aAClG;YACD,GAAG,EAAE,QAAQ,CAAC,GAAG;SACpB,CAAC,CACL,CAAC;IACN,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,cAAc,CAAI,QAAwB;IACtD,OAAO,cAAc,CAAI,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnyDataVariable, AnyVariable, DataFrame } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* A helper hook to retrieve value of any variable.
|
|
4
|
+
* For the rare occassions where a component can accept both a DataVariable and a non-DataVariable.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useAnyVariable(variable: AnyDataVariable): DataFrame;
|
|
7
|
+
export declare function useAnyVariable<T = any>(variable: AnyVariable<T>): T;
|
|
8
|
+
//# sourceMappingURL=use-any-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-any-variable.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/use-any-variable.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAyC,MAAM,SAAS,CAAC;AAKzG;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAC;AACrE,wBAAgB,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
12
|
+
import { useQuery } from '@tanstack/react-query';
|
|
13
|
+
import { useEffect } from 'react';
|
|
14
|
+
import { isDataVariable, isDerivedDataVariable } from '../../types';
|
|
15
|
+
import { useDataVariable } from './use-data-variable';
|
|
16
|
+
import { useVariable } from './use-variable';
|
|
17
|
+
export function useAnyVariable(variable) {
|
|
18
|
+
if (isDataVariable(variable) || isDerivedDataVariable(variable)) {
|
|
19
|
+
const getData = useDataVariable(variable);
|
|
20
|
+
const { data, refetch } = useQuery({
|
|
21
|
+
// ideally would be 0 but that causes infinite loops, see https://github.com/TanStack/query/issues/2367
|
|
22
|
+
cacheTime: 1,
|
|
23
|
+
queryFn: () => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const dataResponse = yield getData();
|
|
25
|
+
return dataResponse.data;
|
|
26
|
+
}),
|
|
27
|
+
queryKey: ['any-variable-data', variable.uid],
|
|
28
|
+
refetchOnWindowFocus: false,
|
|
29
|
+
suspense: true,
|
|
30
|
+
});
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
// Refetch when getData changes
|
|
33
|
+
refetch();
|
|
34
|
+
}, [getData]);
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
return useVariable(variable)[0];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=use-any-variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-any-variable.js","sourceRoot":"","sources":["../../../js/shared/interactivity/use-any-variable.tsx"],"names":[],"mappings":"AAAA,+CAA+C;;;;;;;;;;AAE/C,gDAAgD;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAA2C,cAAc,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEzG,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQ7C,MAAM,UAAU,cAAc,CAAU,QAAwB;IAC5D,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9D,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;YAC/B,uGAAuG;YACvG,SAAS,EAAE,CAAC;YACZ,OAAO,EAAE,GAAS,EAAE;gBAChB,MAAM,YAAY,GAAG,MAAM,OAAO,EAAE,CAAC;gBACrC,OAAO,YAAY,CAAC,IAAI,CAAC;YAC7B,CAAC,CAAA;YACD,QAAQ,EAAE,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG,CAAC;YAC7C,oBAAoB,EAAE,KAAK;YAC3B,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,SAAS,CAAC,GAAG,EAAE;YACX,+BAA+B;YAC/B,OAAO,EAAE,CAAC;QACd,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;QAEd,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AnyDataVariable, FilterQuery, Pagination } from '../../types';
|
|
2
|
+
import { DataResponse } from './internal';
|
|
3
|
+
/**
|
|
4
|
+
* Helper hook which turns a (Derived)DataVariable into a callback to return DataFrame.
|
|
5
|
+
* Can be used in components that only work with data variables.
|
|
6
|
+
*
|
|
7
|
+
* Optionally pass in filters, pagination, and other options to fetch data.
|
|
8
|
+
* Other options include:
|
|
9
|
+
* - schema: boolean - whether to include schema in the response. Default = false.
|
|
10
|
+
*
|
|
11
|
+
* The callback identity changes whenever a refetch should be triggered.
|
|
12
|
+
*
|
|
13
|
+
* @param variable data variable
|
|
14
|
+
*/
|
|
15
|
+
export declare function useDataVariable(variable: AnyDataVariable): (filters?: FilterQuery, pagination?: Pagination, options?: {
|
|
16
|
+
schema: boolean;
|
|
17
|
+
}) => Promise<DataResponse>;
|
|
18
|
+
//# sourceMappingURL=use-data-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-data-variable.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/use-data-variable.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAkB,MAAM,SAAS,CAAC;AAEnF,OAAO,EACH,YAAY,EAMf,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,eAAe,GAC1B,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,YAAY,CAAC,CA8C1G"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
3
|
+
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import { useRecoilValueLoadable } from 'recoil';
|
|
5
|
+
// eslint-disable-next-line import/no-cycle
|
|
6
|
+
import { VariableCtx, WebSocketCtx, useRequestExtras, useTaskContext } from '../../shared/context';
|
|
7
|
+
import { isDataVariable } from '../../types';
|
|
8
|
+
import { registerDataVariable, useDerivedVariable, useFetchDataVariable, useFetchDerivedDataVariable, } from './internal';
|
|
9
|
+
/**
|
|
10
|
+
* Helper hook which turns a (Derived)DataVariable into a callback to return DataFrame.
|
|
11
|
+
* Can be used in components that only work with data variables.
|
|
12
|
+
*
|
|
13
|
+
* Optionally pass in filters, pagination, and other options to fetch data.
|
|
14
|
+
* Other options include:
|
|
15
|
+
* - schema: boolean - whether to include schema in the response. Default = false.
|
|
16
|
+
*
|
|
17
|
+
* The callback identity changes whenever a refetch should be triggered.
|
|
18
|
+
*
|
|
19
|
+
* @param variable data variable
|
|
20
|
+
*/
|
|
21
|
+
export function useDataVariable(variable) {
|
|
22
|
+
const extras = useRequestExtras();
|
|
23
|
+
const { client: wsClient } = useContext(WebSocketCtx);
|
|
24
|
+
if (isDataVariable(variable)) {
|
|
25
|
+
registerDataVariable(variable);
|
|
26
|
+
const serverTriggers$ = useMemo(() => wsClient.serverTriggers$(variable.uid), []);
|
|
27
|
+
const [serverTriggerCounter, setServerTriggerCounter] = useState(0);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const sub = serverTriggers$.subscribe(() => setServerTriggerCounter((c) => c + 1));
|
|
30
|
+
return () => sub.unsubscribe();
|
|
31
|
+
}, [serverTriggers$]);
|
|
32
|
+
const fetchDataVariable = useFetchDataVariable(variable, serverTriggerCounter);
|
|
33
|
+
return fetchDataVariable;
|
|
34
|
+
}
|
|
35
|
+
// Synchronously register subscription to the underlying DV, clean up on unmount
|
|
36
|
+
const variablesContext = useContext(VariableCtx);
|
|
37
|
+
variablesContext.variables.current.add(variable.uid);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
return () => {
|
|
40
|
+
variablesContext.variables.current.delete(variable.uid);
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
const taskContext = useTaskContext();
|
|
44
|
+
const dvSelector = useDerivedVariable(variable, wsClient, taskContext, extras);
|
|
45
|
+
const dvLoadable = useRecoilValueLoadable(dvSelector);
|
|
46
|
+
// We can't directly use the loadable as the callback's dependency because the loadable identity
|
|
47
|
+
// changes whenever it also changes state; we only want to update it when there is a new value
|
|
48
|
+
const [dvValue, setDvValue] = useState(dvLoadable.toPromise());
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
// Whenever loadable becomes loading update the promise stored
|
|
51
|
+
if (dvLoadable.state === 'loading') {
|
|
52
|
+
setDvValue(dvLoadable.toPromise());
|
|
53
|
+
}
|
|
54
|
+
}, [dvLoadable]);
|
|
55
|
+
const fetchDerivedDataVariable = useFetchDerivedDataVariable(variable, taskContext, wsClient, dvValue);
|
|
56
|
+
return fetchDerivedDataVariable;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=use-data-variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-data-variable.js","sourceRoot":"","sources":["../../../js/shared/interactivity/use-data-variable.tsx"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,gDAAgD;AAChD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAEhD,2CAA2C;AAC3C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAA4C,cAAc,EAAE,MAAM,SAAS,CAAC;AAEnF,OAAO,EAGH,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,GAC9B,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAC3B,QAAyB;IAEzB,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IAEtD,IAAI,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAC/B,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;QAClF,MAAM,CAAC,oBAAoB,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AC;YACjC,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;QACvC,CAAC;IACL,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,MAAM,wBAAwB,GAAG,2BAA2B,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAEvG,OAAO,wBAAwB,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-refresh-selector.d.ts","sourceRoot":"","sources":["../../../js/shared/interactivity/use-refresh-selector.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAclF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useRecoilCallback } from 'recoil';
|
|
2
|
+
import { selectorFamilyMembersRegistry, selectorFamilyRegistry } from './store';
|
|
3
|
+
/**
|
|
4
|
+
* Helper hook to refresh a selector by its key
|
|
5
|
+
*/
|
|
6
|
+
export default function useRefreshSelector() {
|
|
7
|
+
return useRecoilCallback(({ refresh }) => {
|
|
8
|
+
return (key, extras) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const family = selectorFamilyRegistry.get(key);
|
|
11
|
+
if (family) {
|
|
12
|
+
const selector = (_a = selectorFamilyMembersRegistry.get(family)) === null || _a === void 0 ? void 0 : _a.get(extras);
|
|
13
|
+
if (selector) {
|
|
14
|
+
refresh(selector);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=use-refresh-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-refresh-selector.js","sourceRoot":"","sources":["../../../js/shared/interactivity/use-refresh-selector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB;IACtC,OAAO,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QACrC,OAAO,CAAC,GAAW,EAAE,MAAc,EAAE,EAAE;;YACnC,MAAM,MAAM,GAAG,sBAAsB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAE/C,IAAI,MAAM,EAAE,CAAC;gBACT,MAAM,QAAQ,GAAG,MAAA,6BAA6B,CAAC,GAAG,CAAC,MAAM,CAAC,0CAAE,GAAG,CAAC,MAAM,CAAC,CAAC;gBAExE,IAAI,QAAQ,EAAE,CAAC;oBACX,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACtB,CAAC;YACL,CAAC;QACL,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AnyVariable, ComponentInstance } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Claan value to a format understood by the backend.
|
|
4
|
+
* Removes `deps`, appends `force` to resolved derived(data)variables.
|
|
5
|
+
*
|
|
6
|
+
* @param value a value to clean
|
|
7
|
+
* @param force whether to force a derived variable recalculation
|
|
8
|
+
*/
|
|
9
|
+
export declare function cleanValue(value: unknown, force: boolean): any;
|
|
10
|
+
/**
|
|
11
|
+
* A hook to fetch a server component
|
|
12
|
+
*
|
|
13
|
+
* @param name component name - specific to a given py_component
|
|
14
|
+
* @param uid component uid - specific to a given *instance* of a py_component
|
|
15
|
+
* @param dynamicKwargs kwargs passed into the component
|
|
16
|
+
*/
|
|
17
|
+
export default function useServerComponent(name: string, uid: string, dynamicKwargs: Record<string, AnyVariable<any>>): ComponentInstance;
|
|
18
|
+
/**
|
|
19
|
+
* A helper hook that returns a function to force a refresh of a server component
|
|
20
|
+
*
|
|
21
|
+
* @param name component uid
|
|
22
|
+
*/
|
|
23
|
+
export declare function useRefreshServerComponent(uid: string): () => void;
|
|
24
|
+
//# sourceMappingURL=use-server-component.d.ts.map
|