@ethisyscore/plugin-ui 1.75.0 → 1.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -567,22 +567,41 @@ function useOverlayHost() {
567
567
  }
568
568
  return api;
569
569
  }
570
+ function makeDefaultQueryClient2() {
571
+ return new reactQuery.QueryClient({
572
+ defaultOptions: {
573
+ queries: {
574
+ retry: 1,
575
+ refetchOnWindowFocus: false,
576
+ staleTime: 3e4
577
+ }
578
+ }
579
+ });
580
+ }
581
+ var defaultQueryClient2 = makeDefaultQueryClient2();
570
582
  function definePlatformReactPluginOverlay(Overlay, options) {
571
- const { rootClassName, styleId, css, manifest = {}, wrapOverlay } = options;
583
+ const { rootClassName, styleId, css, manifest = {}, queryClient = defaultQueryClient2, wrapOverlay } = options;
572
584
  return function MountedOverlay(props) {
573
585
  const tree = react.createElement(
574
586
  OverlayHostContext.Provider,
575
587
  { value: props.overlayHost },
588
+ // react-query provider — an overlay bundle has its own react-query module
589
+ // instance, so the host's app-wide client is invisible across the bundle
590
+ // boundary; it needs its own provider exactly as each page gets one.
576
591
  react.createElement(
577
- TemplateContext.Provider,
578
- { value: manifest },
579
- react.createElement(PluginStyleScope, { id: styleId, css }),
592
+ reactQuery.QueryClientProvider,
593
+ { client: queryClient },
580
594
  react.createElement(
581
- "div",
582
- { className: `${EHX_PLUGIN_ROOT_CLASS} ${rootClassName}` },
583
- // Overlay surfaces open their own dialogs and menus, so they need the same
584
- // portal containment as pages (see definePlatformReactPluginPage).
585
- react.createElement(PluginPortalScope, null, react.createElement(Overlay, props))
595
+ TemplateContext.Provider,
596
+ { value: manifest },
597
+ react.createElement(PluginStyleScope, { id: styleId, css }),
598
+ react.createElement(
599
+ "div",
600
+ { className: `${EHX_PLUGIN_ROOT_CLASS} ${rootClassName}` },
601
+ // Overlay surfaces open their own dialogs and menus, so they need the same
602
+ // portal containment as pages (see definePlatformReactPluginPage).
603
+ react.createElement(PluginPortalScope, null, react.createElement(Overlay, props))
604
+ )
586
605
  )
587
606
  )
588
607
  );