@ethisyscore/plugin-ui 1.100.3 → 1.100.4
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/dist/components/connectors/index.cjs +56 -10
- package/dist/components/connectors/index.cjs.map +1 -1
- package/dist/components/connectors/index.d.cts +2 -2
- package/dist/components/connectors/index.d.ts +2 -2
- package/dist/components/connectors/index.js +57 -12
- package/dist/components/connectors/index.js.map +1 -1
- package/dist/components/ui/index.cjs +4 -0
- package/dist/components/ui/index.d.cts +1 -1
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/connector-mappings/index.d.cts +2 -2
- package/dist/connector-mappings/index.d.ts +2 -2
- package/dist/{mappingQueryKeys-BcbA0TGy.d.cts → mappingQueryKeys-KONuceBb.d.cts} +22 -1
- package/dist/{mappingQueryKeys-BcbA0TGy.d.ts → mappingQueryKeys-KONuceBb.d.ts} +22 -1
- package/dist/platform-react/index.cjs +70 -24
- package/dist/platform-react/index.cjs.map +1 -1
- package/dist/platform-react/index.d.cts +45 -2
- package/dist/platform-react/index.d.ts +45 -2
- package/dist/platform-react/index.js +71 -26
- package/dist/platform-react/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentType, ReactElement, ReactNode, AnchorHTMLAttributes, MouseEvent } from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
|
-
import { QueryClient, UseQueryResult, UseQueryOptions, QueryKey } from '@tanstack/react-query';
|
|
4
|
+
import { QueryClient, QueryClientConfig, UseQueryResult, UseQueryOptions, QueryKey } from '@tanstack/react-query';
|
|
5
5
|
import { PlatformReactPageProps } from '@ethisyscore/components-react';
|
|
6
6
|
import { T as ToolInvoker } from '../mcpService-4h3sKDpW.cjs';
|
|
7
7
|
export { B as BaseMcpService, n as notViaMcp, u as useToolInvoker, a as useToolInvokerMap } from '../mcpService-4h3sKDpW.cjs';
|
|
@@ -95,6 +95,49 @@ interface PluginPageDefinerConfig {
|
|
|
95
95
|
*/
|
|
96
96
|
declare function createPluginPageDefiner(config: PluginPageDefinerConfig): (Page: ComponentType<PlatformReactPageProps>, views?: Record<string, ViewComponent>) => ComponentType<PlatformReactPageProps>;
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* The `QueryClient` every PlatformReact plugin surface runs on.
|
|
100
|
+
*
|
|
101
|
+
* # Why this file exists
|
|
102
|
+
*
|
|
103
|
+
* A plugin bundle cannot see the host's app-wide `QueryClientProvider` — react-query is
|
|
104
|
+
* bundle-local, which is why each page and overlay creates its own client. The host's client
|
|
105
|
+
* carries cache-level `onError` handlers that turn a failed query or mutation into a toast, and
|
|
106
|
+
* for a long time the plugin-side client carried none. The consequence was not a degraded
|
|
107
|
+
* message: it was NO message. A command could be refused by the server, travel back through
|
|
108
|
+
* every layer intact, and land on a page that showed the operator nothing at all.
|
|
109
|
+
*
|
|
110
|
+
* That silence was invisible from inside plugin code, because plugins were written as though the
|
|
111
|
+
* handler existed — roughly 1,100 `meta.errorTitle` declarations across nine plugins, plus this
|
|
112
|
+
* SDK's own shared connector-mapping hooks, all of them dead on arrival.
|
|
113
|
+
*
|
|
114
|
+
* # What gets shown
|
|
115
|
+
*
|
|
116
|
+
* `meta.errorTitle` is the title when a call site set one — that is the contract those 1,100 sites
|
|
117
|
+
* were already written against. Otherwise the title is derived from the `[Status]` prefix the
|
|
118
|
+
* SDK's `ResultMapper` puts on every failure, so an unlabelled call still says something truer
|
|
119
|
+
* than "Error". The prefix is always stripped from the description: it is our wire format, and an
|
|
120
|
+
* operator reading "[Conflict]" is reading our plumbing rather than their problem.
|
|
121
|
+
*
|
|
122
|
+
* A page that renders its own error UI opts out with `meta.suppressErrorToast`, matching the host.
|
|
123
|
+
*/
|
|
124
|
+
/** The subset of react-query's `meta` this module reads. Both fields are optional by design. */
|
|
125
|
+
interface PluginQueryMeta {
|
|
126
|
+
/** Toast title for a failure from this call site. */
|
|
127
|
+
errorTitle?: string;
|
|
128
|
+
/** Set when the page shows its own error UI and a toast would double-report it. */
|
|
129
|
+
suppressErrorToast?: boolean;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Creates a plugin-surface `QueryClient` whose failures are visible to the operator.
|
|
133
|
+
*
|
|
134
|
+
* `config` is merged shallowly over the defaults, so a plugin can tune `defaultOptions` without
|
|
135
|
+
* having to restate — or accidentally drop — the error handling. Passing an explicit `queryCache`
|
|
136
|
+
* or `mutationCache` does replace ours, which is the escape hatch for a plugin that genuinely
|
|
137
|
+
* wants different behaviour.
|
|
138
|
+
*/
|
|
139
|
+
declare function createPluginQueryClient(config?: QueryClientConfig): QueryClient;
|
|
140
|
+
|
|
98
141
|
/**
|
|
99
142
|
* Matches component types renderable via `useView`: plain function/class
|
|
100
143
|
* components plus the object wrappers `React.lazy`, `React.forwardRef`, and
|
|
@@ -1386,4 +1429,4 @@ interface MenuConfigHostSidebarOptions {
|
|
|
1386
1429
|
*/
|
|
1387
1430
|
declare function menuConfigToHostSidebarInput(config: HeaderMenuItem[], opts: MenuConfigHostSidebarOptions): HostSidebarHookInput;
|
|
1388
1431
|
|
|
1389
|
-
export { type AuthenticatedQueryResult, type CurrencyInfo, type CurrencySelector, DEFAULT_MAX_UPLOAD_BYTES, type DefinePlatformReactPluginOverlayOptions, type DefinePlatformReactPluginPageOptions, EHX_PLUGIN_PORTAL_ATTR, EHX_PLUGIN_PORTAL_CLASS, EHX_PLUGIN_ROOT_CLASS, HostSidebarHookInput, HostSidebarInput, type InsetLease, LIST_CURRENCIES_TOOL, type ManagedLifecycle, type McpToolArgs, type McpToolContract, type McpToolContracts, type McpToolResult, type MenuConfigHostSidebarOptions, MissingViewFallback, ORGANISATION_SETTINGS_URI, OVERLAY_HOST_CONTRACT_VERSION, type OverlayHostApi, type OverlayHostCapabilities, OverlayHostContext, type PlatformReactOverlayProps, type PluginOverlayDefinerConfig, type PluginPageDefinerConfig, PluginPortalScope, PluginStyleScope, REPORTING_CURRENCY_TOOL, type ReactRouterShimOptions, SurfaceBaseContext, type SurfaceBaseValue, TemplateContext, type TemplateManifest, type ToHostSidebarInputOptions, ToolInvoker, TypedMcpService, type UseCurrencyResult, type UseMcpUploadOptions, type UseMcpUploadResult, type UseMcpUploadTarget, type ViewComponent, buildSurfaceUrl, createPluginOverlayDefiner, createPluginPageDefiner, createReactRouterShim, createUseView, definePlatformReactPluginOverlay, definePlatformReactPluginPage, deriveHostEntityToken, injectPluginStyles, isComponent, mcpTool, menuConfigToHostSidebarInput, normaliseSlug, resolveSurfaceBase, surfacePathFor, toHostSidebarInput, useAuthenticatedQueries, useAuthenticatedQuery, useCurrency, useManagedLifecycle, useMcpUpload, useOrgFormatSync, useOverlayHost, usePluginRealtime, useReportingCurrencySync, useSurfaceUrl, useTypedToolInvokerMap, useView };
|
|
1432
|
+
export { type AuthenticatedQueryResult, type CurrencyInfo, type CurrencySelector, DEFAULT_MAX_UPLOAD_BYTES, type DefinePlatformReactPluginOverlayOptions, type DefinePlatformReactPluginPageOptions, EHX_PLUGIN_PORTAL_ATTR, EHX_PLUGIN_PORTAL_CLASS, EHX_PLUGIN_ROOT_CLASS, HostSidebarHookInput, HostSidebarInput, type InsetLease, LIST_CURRENCIES_TOOL, type ManagedLifecycle, type McpToolArgs, type McpToolContract, type McpToolContracts, type McpToolResult, type MenuConfigHostSidebarOptions, MissingViewFallback, ORGANISATION_SETTINGS_URI, OVERLAY_HOST_CONTRACT_VERSION, type OverlayHostApi, type OverlayHostCapabilities, OverlayHostContext, type PlatformReactOverlayProps, type PluginOverlayDefinerConfig, type PluginPageDefinerConfig, PluginPortalScope, type PluginQueryMeta, PluginStyleScope, REPORTING_CURRENCY_TOOL, type ReactRouterShimOptions, SurfaceBaseContext, type SurfaceBaseValue, TemplateContext, type TemplateManifest, type ToHostSidebarInputOptions, ToolInvoker, TypedMcpService, type UseCurrencyResult, type UseMcpUploadOptions, type UseMcpUploadResult, type UseMcpUploadTarget, type ViewComponent, buildSurfaceUrl, createPluginOverlayDefiner, createPluginPageDefiner, createPluginQueryClient, createReactRouterShim, createUseView, definePlatformReactPluginOverlay, definePlatformReactPluginPage, deriveHostEntityToken, injectPluginStyles, isComponent, mcpTool, menuConfigToHostSidebarInput, normaliseSlug, resolveSurfaceBase, surfacePathFor, toHostSidebarInput, useAuthenticatedQueries, useAuthenticatedQuery, useCurrency, useManagedLifecycle, useMcpUpload, useOrgFormatSync, useOverlayHost, usePluginRealtime, useReportingCurrencySync, useSurfaceUrl, useTypedToolInvokerMap, useView };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentType, ReactElement, ReactNode, AnchorHTMLAttributes, MouseEvent } from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
|
-
import { QueryClient, UseQueryResult, UseQueryOptions, QueryKey } from '@tanstack/react-query';
|
|
4
|
+
import { QueryClient, QueryClientConfig, UseQueryResult, UseQueryOptions, QueryKey } from '@tanstack/react-query';
|
|
5
5
|
import { PlatformReactPageProps } from '@ethisyscore/components-react';
|
|
6
6
|
import { T as ToolInvoker } from '../mcpService-4h3sKDpW.js';
|
|
7
7
|
export { B as BaseMcpService, n as notViaMcp, u as useToolInvoker, a as useToolInvokerMap } from '../mcpService-4h3sKDpW.js';
|
|
@@ -95,6 +95,49 @@ interface PluginPageDefinerConfig {
|
|
|
95
95
|
*/
|
|
96
96
|
declare function createPluginPageDefiner(config: PluginPageDefinerConfig): (Page: ComponentType<PlatformReactPageProps>, views?: Record<string, ViewComponent>) => ComponentType<PlatformReactPageProps>;
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* The `QueryClient` every PlatformReact plugin surface runs on.
|
|
100
|
+
*
|
|
101
|
+
* # Why this file exists
|
|
102
|
+
*
|
|
103
|
+
* A plugin bundle cannot see the host's app-wide `QueryClientProvider` — react-query is
|
|
104
|
+
* bundle-local, which is why each page and overlay creates its own client. The host's client
|
|
105
|
+
* carries cache-level `onError` handlers that turn a failed query or mutation into a toast, and
|
|
106
|
+
* for a long time the plugin-side client carried none. The consequence was not a degraded
|
|
107
|
+
* message: it was NO message. A command could be refused by the server, travel back through
|
|
108
|
+
* every layer intact, and land on a page that showed the operator nothing at all.
|
|
109
|
+
*
|
|
110
|
+
* That silence was invisible from inside plugin code, because plugins were written as though the
|
|
111
|
+
* handler existed — roughly 1,100 `meta.errorTitle` declarations across nine plugins, plus this
|
|
112
|
+
* SDK's own shared connector-mapping hooks, all of them dead on arrival.
|
|
113
|
+
*
|
|
114
|
+
* # What gets shown
|
|
115
|
+
*
|
|
116
|
+
* `meta.errorTitle` is the title when a call site set one — that is the contract those 1,100 sites
|
|
117
|
+
* were already written against. Otherwise the title is derived from the `[Status]` prefix the
|
|
118
|
+
* SDK's `ResultMapper` puts on every failure, so an unlabelled call still says something truer
|
|
119
|
+
* than "Error". The prefix is always stripped from the description: it is our wire format, and an
|
|
120
|
+
* operator reading "[Conflict]" is reading our plumbing rather than their problem.
|
|
121
|
+
*
|
|
122
|
+
* A page that renders its own error UI opts out with `meta.suppressErrorToast`, matching the host.
|
|
123
|
+
*/
|
|
124
|
+
/** The subset of react-query's `meta` this module reads. Both fields are optional by design. */
|
|
125
|
+
interface PluginQueryMeta {
|
|
126
|
+
/** Toast title for a failure from this call site. */
|
|
127
|
+
errorTitle?: string;
|
|
128
|
+
/** Set when the page shows its own error UI and a toast would double-report it. */
|
|
129
|
+
suppressErrorToast?: boolean;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Creates a plugin-surface `QueryClient` whose failures are visible to the operator.
|
|
133
|
+
*
|
|
134
|
+
* `config` is merged shallowly over the defaults, so a plugin can tune `defaultOptions` without
|
|
135
|
+
* having to restate — or accidentally drop — the error handling. Passing an explicit `queryCache`
|
|
136
|
+
* or `mutationCache` does replace ours, which is the escape hatch for a plugin that genuinely
|
|
137
|
+
* wants different behaviour.
|
|
138
|
+
*/
|
|
139
|
+
declare function createPluginQueryClient(config?: QueryClientConfig): QueryClient;
|
|
140
|
+
|
|
98
141
|
/**
|
|
99
142
|
* Matches component types renderable via `useView`: plain function/class
|
|
100
143
|
* components plus the object wrappers `React.lazy`, `React.forwardRef`, and
|
|
@@ -1386,4 +1429,4 @@ interface MenuConfigHostSidebarOptions {
|
|
|
1386
1429
|
*/
|
|
1387
1430
|
declare function menuConfigToHostSidebarInput(config: HeaderMenuItem[], opts: MenuConfigHostSidebarOptions): HostSidebarHookInput;
|
|
1388
1431
|
|
|
1389
|
-
export { type AuthenticatedQueryResult, type CurrencyInfo, type CurrencySelector, DEFAULT_MAX_UPLOAD_BYTES, type DefinePlatformReactPluginOverlayOptions, type DefinePlatformReactPluginPageOptions, EHX_PLUGIN_PORTAL_ATTR, EHX_PLUGIN_PORTAL_CLASS, EHX_PLUGIN_ROOT_CLASS, HostSidebarHookInput, HostSidebarInput, type InsetLease, LIST_CURRENCIES_TOOL, type ManagedLifecycle, type McpToolArgs, type McpToolContract, type McpToolContracts, type McpToolResult, type MenuConfigHostSidebarOptions, MissingViewFallback, ORGANISATION_SETTINGS_URI, OVERLAY_HOST_CONTRACT_VERSION, type OverlayHostApi, type OverlayHostCapabilities, OverlayHostContext, type PlatformReactOverlayProps, type PluginOverlayDefinerConfig, type PluginPageDefinerConfig, PluginPortalScope, PluginStyleScope, REPORTING_CURRENCY_TOOL, type ReactRouterShimOptions, SurfaceBaseContext, type SurfaceBaseValue, TemplateContext, type TemplateManifest, type ToHostSidebarInputOptions, ToolInvoker, TypedMcpService, type UseCurrencyResult, type UseMcpUploadOptions, type UseMcpUploadResult, type UseMcpUploadTarget, type ViewComponent, buildSurfaceUrl, createPluginOverlayDefiner, createPluginPageDefiner, createReactRouterShim, createUseView, definePlatformReactPluginOverlay, definePlatformReactPluginPage, deriveHostEntityToken, injectPluginStyles, isComponent, mcpTool, menuConfigToHostSidebarInput, normaliseSlug, resolveSurfaceBase, surfacePathFor, toHostSidebarInput, useAuthenticatedQueries, useAuthenticatedQuery, useCurrency, useManagedLifecycle, useMcpUpload, useOrgFormatSync, useOverlayHost, usePluginRealtime, useReportingCurrencySync, useSurfaceUrl, useTypedToolInvokerMap, useView };
|
|
1432
|
+
export { type AuthenticatedQueryResult, type CurrencyInfo, type CurrencySelector, DEFAULT_MAX_UPLOAD_BYTES, type DefinePlatformReactPluginOverlayOptions, type DefinePlatformReactPluginPageOptions, EHX_PLUGIN_PORTAL_ATTR, EHX_PLUGIN_PORTAL_CLASS, EHX_PLUGIN_ROOT_CLASS, HostSidebarHookInput, HostSidebarInput, type InsetLease, LIST_CURRENCIES_TOOL, type ManagedLifecycle, type McpToolArgs, type McpToolContract, type McpToolContracts, type McpToolResult, type MenuConfigHostSidebarOptions, MissingViewFallback, ORGANISATION_SETTINGS_URI, OVERLAY_HOST_CONTRACT_VERSION, type OverlayHostApi, type OverlayHostCapabilities, OverlayHostContext, type PlatformReactOverlayProps, type PluginOverlayDefinerConfig, type PluginPageDefinerConfig, PluginPortalScope, type PluginQueryMeta, PluginStyleScope, REPORTING_CURRENCY_TOOL, type ReactRouterShimOptions, SurfaceBaseContext, type SurfaceBaseValue, TemplateContext, type TemplateManifest, type ToHostSidebarInputOptions, ToolInvoker, TypedMcpService, type UseCurrencyResult, type UseMcpUploadOptions, type UseMcpUploadResult, type UseMcpUploadTarget, type ViewComponent, buildSurfaceUrl, createPluginOverlayDefiner, createPluginPageDefiner, createPluginQueryClient, createReactRouterShim, createUseView, definePlatformReactPluginOverlay, definePlatformReactPluginPage, deriveHostEntityToken, injectPluginStyles, isComponent, mcpTool, menuConfigToHostSidebarInput, normaliseSlug, resolveSurfaceBase, surfacePathFor, toHostSidebarInput, useAuthenticatedQueries, useAuthenticatedQuery, useCurrency, useManagedLifecycle, useMcpUpload, useOrgFormatSync, useOverlayHost, usePluginRealtime, useReportingCurrencySync, useSurfaceUrl, useTypedToolInvokerMap, useView };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useEffect, useContext, useState, useMemo, useRef, createElement, useCallback, useSyncExternalStore } from 'react';
|
|
2
|
-
import { QueryClient, useQuery, useQueries, QueryClientProvider } from '@tanstack/react-query';
|
|
2
|
+
import { QueryClient, MutationCache, QueryCache, useQuery, useQueries, QueryClientProvider } from '@tanstack/react-query';
|
|
3
3
|
import { definePlatformReactPage, emitNavigation } from '@ethisyscore/components-react';
|
|
4
4
|
import * as extensionRuntime from '@ethisyscore/extension-runtime/plugin';
|
|
5
5
|
import { useHostIdentity, useMcpTool, useOptionalExtensionRuntimeTransport, usePluginRealtimeSource, useExtensionRuntimeTransport } from '@ethisyscore/extension-runtime/plugin';
|
|
@@ -9,6 +9,73 @@ import { setOrgFormats } from '@ethisyscore/core-utils/date/org-format';
|
|
|
9
9
|
import { setOrgReportingCurrency, MONEY_FALLBACK_LOCALE, formatMoney } from '@ethisyscore/core-utils/money';
|
|
10
10
|
|
|
11
11
|
// src/platform-react/definePlatformReactPluginPage.tsx
|
|
12
|
+
|
|
13
|
+
// src/components/shared/toast.ts
|
|
14
|
+
function dispatchToast(title, description, variant) {
|
|
15
|
+
if (typeof window === "undefined" || title.length === 0) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
window.dispatchEvent(new CustomEvent("ethisys:toast", { detail: { title, description, variant } }));
|
|
19
|
+
}
|
|
20
|
+
function showErrorToast(title, description) {
|
|
21
|
+
dispatchToast(title, description, "error");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/platform-react/pluginQueryClient.ts
|
|
25
|
+
var STATUS_TITLES = /* @__PURE__ */ new Map([
|
|
26
|
+
["NotFound", "Not Found"],
|
|
27
|
+
["Unauthorized", "Authentication Error"],
|
|
28
|
+
["Forbidden", "Access Denied"],
|
|
29
|
+
["Conflict", "Conflict"]
|
|
30
|
+
]);
|
|
31
|
+
var UNTITLED_STATUSES = /* @__PURE__ */ new Set(["Invalid", "Error", "CriticalError", "Unavailable", "Accepted"]);
|
|
32
|
+
var GENERIC_TITLE = "Error";
|
|
33
|
+
function isKnownStatus(status) {
|
|
34
|
+
return STATUS_TITLES.has(status) || UNTITLED_STATUSES.has(status);
|
|
35
|
+
}
|
|
36
|
+
function splitStatusPrefix(message) {
|
|
37
|
+
const match = /^\[([A-Za-z]+)\]\s*(.*)$/s.exec(message);
|
|
38
|
+
if (match === null) {
|
|
39
|
+
return { status: null, body: message };
|
|
40
|
+
}
|
|
41
|
+
const [, status, body] = match;
|
|
42
|
+
if (!isKnownStatus(status)) {
|
|
43
|
+
return { status: null, body: message };
|
|
44
|
+
}
|
|
45
|
+
return body.length > 0 ? { status, body } : { status: null, body: message };
|
|
46
|
+
}
|
|
47
|
+
function surfaceError(error, meta) {
|
|
48
|
+
if (meta?.suppressErrorToast === true) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const raw = error instanceof Error && error.message.length > 0 ? error.message : "An unexpected error occurred";
|
|
52
|
+
const { status, body } = splitStatusPrefix(raw);
|
|
53
|
+
const title = meta?.errorTitle ?? (status !== null ? STATUS_TITLES.get(status) ?? GENERIC_TITLE : GENERIC_TITLE);
|
|
54
|
+
showErrorToast(title, body);
|
|
55
|
+
}
|
|
56
|
+
function createPluginQueryClient(config) {
|
|
57
|
+
return new QueryClient({
|
|
58
|
+
queryCache: new QueryCache({
|
|
59
|
+
onError: (error, query) => surfaceError(error, query.meta)
|
|
60
|
+
}),
|
|
61
|
+
mutationCache: new MutationCache({
|
|
62
|
+
onError: (error, _variables, _context, mutation) => surfaceError(error, mutation.meta)
|
|
63
|
+
}),
|
|
64
|
+
...config,
|
|
65
|
+
defaultOptions: {
|
|
66
|
+
// Spread first so `mutations`, `dehydrate`, `hydrate` and anything else react-query
|
|
67
|
+
// adds to `DefaultOptions` survive. Rebuilding this object from named keys instead
|
|
68
|
+
// silently dropped them, which contradicted the merge promised just above.
|
|
69
|
+
...config?.defaultOptions,
|
|
70
|
+
queries: {
|
|
71
|
+
retry: 1,
|
|
72
|
+
refetchOnWindowFocus: false,
|
|
73
|
+
staleTime: 3e4,
|
|
74
|
+
...config?.defaultOptions?.queries
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
12
79
|
var TemplateContext = createContext(null);
|
|
13
80
|
function injectPluginStyles(id, css) {
|
|
14
81
|
if (typeof document === "undefined") return;
|
|
@@ -228,18 +295,7 @@ function useReportingCurrencySync() {
|
|
|
228
295
|
}
|
|
229
296
|
|
|
230
297
|
// src/platform-react/definePlatformReactPluginPage.tsx
|
|
231
|
-
|
|
232
|
-
return new QueryClient({
|
|
233
|
-
defaultOptions: {
|
|
234
|
-
queries: {
|
|
235
|
-
retry: 1,
|
|
236
|
-
refetchOnWindowFocus: false,
|
|
237
|
-
staleTime: 3e4
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
var defaultQueryClient = makeDefaultQueryClient();
|
|
298
|
+
var defaultQueryClient = createPluginQueryClient();
|
|
243
299
|
var EHX_PLUGIN_ROOT_CLASS = "ehx-plugin-root";
|
|
244
300
|
function definePlatformReactPluginPage(Page, options) {
|
|
245
301
|
const {
|
|
@@ -730,18 +786,7 @@ function useOverlayHost() {
|
|
|
730
786
|
}
|
|
731
787
|
return api;
|
|
732
788
|
}
|
|
733
|
-
|
|
734
|
-
return new QueryClient({
|
|
735
|
-
defaultOptions: {
|
|
736
|
-
queries: {
|
|
737
|
-
retry: 1,
|
|
738
|
-
refetchOnWindowFocus: false,
|
|
739
|
-
staleTime: 3e4
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
var defaultQueryClient2 = makeDefaultQueryClient2();
|
|
789
|
+
var defaultQueryClient2 = createPluginQueryClient();
|
|
745
790
|
function definePlatformReactPluginOverlay(Overlay, options) {
|
|
746
791
|
const { rootClassName, styleId, css, manifest = {}, queryClient = defaultQueryClient2, wrapOverlay } = options;
|
|
747
792
|
return function MountedOverlay(props) {
|
|
@@ -1160,6 +1205,6 @@ function withActiveNavHref(input, activeNavHref) {
|
|
|
1160
1205
|
return { ...input, activeNavHref };
|
|
1161
1206
|
}
|
|
1162
1207
|
|
|
1163
|
-
export { BaseMcpService, DEFAULT_MAX_UPLOAD_BYTES, EHX_PLUGIN_PORTAL_ATTR, EHX_PLUGIN_PORTAL_CLASS, EHX_PLUGIN_ROOT_CLASS, HOST_CHROME_CONTRACT_VERSION, HostSidebarActionsContext, LIST_CURRENCIES_TOOL, MissingViewFallback, ORGANISATION_SETTINGS_URI, OVERLAY_HOST_CONTRACT_VERSION, OverlayHostContext, PluginPortalScope, PluginStyleScope, REPORTING_CURRENCY_TOOL2 as REPORTING_CURRENCY_TOOL, SIDEBAR_MODE, SurfaceBaseContext, TemplateContext, TypedMcpService, buildSurfaceUrl, createPluginOverlayDefiner, createPluginPageDefiner, createReactRouterShim, createUseView, definePlatformReactPluginOverlay, definePlatformReactPluginPage, deriveHostEntityToken, injectPluginStyles, isComponent, isHostChromeCompatible, mcpTool, menuConfigToHostSidebarInput, normaliseSlug, notViaMcp, reportHostChromeDiagnostic, resolveActiveNavHref, resolveSurfaceBase, setHostChromeDiagnosticSink, surfacePathFor, toHostSidebarInput, useAuthenticatedQueries, useAuthenticatedQuery, useCurrency, useHostSidebarActions, useManagedLifecycle, useMcpUpload, useOrgFormatSync, useOverlayHost, usePluginRealtime, useReportingCurrencySync, useSurfaceUrl, useToolInvoker, useToolInvokerMap, useTypedToolInvokerMap, useView, withActiveNavHref };
|
|
1208
|
+
export { BaseMcpService, DEFAULT_MAX_UPLOAD_BYTES, EHX_PLUGIN_PORTAL_ATTR, EHX_PLUGIN_PORTAL_CLASS, EHX_PLUGIN_ROOT_CLASS, HOST_CHROME_CONTRACT_VERSION, HostSidebarActionsContext, LIST_CURRENCIES_TOOL, MissingViewFallback, ORGANISATION_SETTINGS_URI, OVERLAY_HOST_CONTRACT_VERSION, OverlayHostContext, PluginPortalScope, PluginStyleScope, REPORTING_CURRENCY_TOOL2 as REPORTING_CURRENCY_TOOL, SIDEBAR_MODE, SurfaceBaseContext, TemplateContext, TypedMcpService, buildSurfaceUrl, createPluginOverlayDefiner, createPluginPageDefiner, createPluginQueryClient, createReactRouterShim, createUseView, definePlatformReactPluginOverlay, definePlatformReactPluginPage, deriveHostEntityToken, injectPluginStyles, isComponent, isHostChromeCompatible, mcpTool, menuConfigToHostSidebarInput, normaliseSlug, notViaMcp, reportHostChromeDiagnostic, resolveActiveNavHref, resolveSurfaceBase, setHostChromeDiagnosticSink, surfacePathFor, toHostSidebarInput, useAuthenticatedQueries, useAuthenticatedQuery, useCurrency, useHostSidebarActions, useManagedLifecycle, useMcpUpload, useOrgFormatSync, useOverlayHost, usePluginRealtime, useReportingCurrencySync, useSurfaceUrl, useToolInvoker, useToolInvokerMap, useTypedToolInvokerMap, useView, withActiveNavHref };
|
|
1164
1209
|
//# sourceMappingURL=index.js.map
|
|
1165
1210
|
//# sourceMappingURL=index.js.map
|