@ethisyscore/plugin-ui 1.75.0 → 1.77.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.
- package/README.md +1 -1
- package/dist/components/connectors/index.cjs +1087 -13
- package/dist/components/connectors/index.cjs.map +1 -1
- package/dist/components/connectors/index.d.cts +198 -1
- package/dist/components/connectors/index.d.ts +198 -1
- package/dist/components/connectors/index.js +1088 -15
- package/dist/components/connectors/index.js.map +1 -1
- package/dist/components/ui/index.cjs +4 -0
- package/dist/components/ui/index.d.cts +66 -1
- package/dist/components/ui/index.d.ts +66 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/platform-react/index.cjs +28 -9
- package/dist/platform-react/index.cjs.map +1 -1
- package/dist/platform-react/index.d.cts +2 -0
- package/dist/platform-react/index.d.ts +2 -0
- package/dist/platform-react/index.js +28 -9
- package/dist/platform-react/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/plugin-base.css +11 -0
|
@@ -1056,6 +1056,8 @@ interface DefinePlatformReactPluginOverlayOptions {
|
|
|
1056
1056
|
styleId: string;
|
|
1057
1057
|
css: string;
|
|
1058
1058
|
manifest?: Record<string, Partial<Record<string, ViewComponent>>>;
|
|
1059
|
+
/** Override the per-overlay `QueryClient`. */
|
|
1060
|
+
queryClient?: QueryClient;
|
|
1059
1061
|
wrapOverlay?: (overlay: ReactElement) => ReactElement;
|
|
1060
1062
|
}
|
|
1061
1063
|
/**
|
|
@@ -1056,6 +1056,8 @@ interface DefinePlatformReactPluginOverlayOptions {
|
|
|
1056
1056
|
styleId: string;
|
|
1057
1057
|
css: string;
|
|
1058
1058
|
manifest?: Record<string, Partial<Record<string, ViewComponent>>>;
|
|
1059
|
+
/** Override the per-overlay `QueryClient`. */
|
|
1060
|
+
queryClient?: QueryClient;
|
|
1059
1061
|
wrapOverlay?: (overlay: ReactElement) => ReactElement;
|
|
1060
1062
|
}
|
|
1061
1063
|
/**
|
|
@@ -565,22 +565,41 @@ function useOverlayHost() {
|
|
|
565
565
|
}
|
|
566
566
|
return api;
|
|
567
567
|
}
|
|
568
|
+
function makeDefaultQueryClient2() {
|
|
569
|
+
return new QueryClient({
|
|
570
|
+
defaultOptions: {
|
|
571
|
+
queries: {
|
|
572
|
+
retry: 1,
|
|
573
|
+
refetchOnWindowFocus: false,
|
|
574
|
+
staleTime: 3e4
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
var defaultQueryClient2 = makeDefaultQueryClient2();
|
|
568
580
|
function definePlatformReactPluginOverlay(Overlay, options) {
|
|
569
|
-
const { rootClassName, styleId, css, manifest = {}, wrapOverlay } = options;
|
|
581
|
+
const { rootClassName, styleId, css, manifest = {}, queryClient = defaultQueryClient2, wrapOverlay } = options;
|
|
570
582
|
return function MountedOverlay(props) {
|
|
571
583
|
const tree = createElement(
|
|
572
584
|
OverlayHostContext.Provider,
|
|
573
585
|
{ value: props.overlayHost },
|
|
586
|
+
// react-query provider — an overlay bundle has its own react-query module
|
|
587
|
+
// instance, so the host's app-wide client is invisible across the bundle
|
|
588
|
+
// boundary; it needs its own provider exactly as each page gets one.
|
|
574
589
|
createElement(
|
|
575
|
-
|
|
576
|
-
{
|
|
577
|
-
createElement(PluginStyleScope, { id: styleId, css }),
|
|
590
|
+
QueryClientProvider,
|
|
591
|
+
{ client: queryClient },
|
|
578
592
|
createElement(
|
|
579
|
-
|
|
580
|
-
{
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
593
|
+
TemplateContext.Provider,
|
|
594
|
+
{ value: manifest },
|
|
595
|
+
createElement(PluginStyleScope, { id: styleId, css }),
|
|
596
|
+
createElement(
|
|
597
|
+
"div",
|
|
598
|
+
{ className: `${EHX_PLUGIN_ROOT_CLASS} ${rootClassName}` },
|
|
599
|
+
// Overlay surfaces open their own dialogs and menus, so they need the same
|
|
600
|
+
// portal containment as pages (see definePlatformReactPluginPage).
|
|
601
|
+
createElement(PluginPortalScope, null, createElement(Overlay, props))
|
|
602
|
+
)
|
|
584
603
|
)
|
|
585
604
|
)
|
|
586
605
|
);
|