@ethisyscore/plugin-ui 1.100.3 → 1.100.5
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 +76 -24
- package/dist/platform-react/index.cjs.map +1 -1
- package/dist/platform-react/index.d.cts +46 -2
- package/dist/platform-react/index.d.ts +46 -2
- package/dist/platform-react/index.js +77 -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,50 @@ 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". BOTH bracketed prefixes are stripped from the description — the status one and the
|
|
120
|
+
* plugin’s own [ERROR_CODE] behind it: they are our wire format, and an operator reading either is
|
|
121
|
+
* reading our plumbing rather than their problem.
|
|
122
|
+
*
|
|
123
|
+
* A page that renders its own error UI opts out with `meta.suppressErrorToast`, matching the host.
|
|
124
|
+
*/
|
|
125
|
+
/** The subset of react-query's `meta` this module reads. Both fields are optional by design. */
|
|
126
|
+
interface PluginQueryMeta {
|
|
127
|
+
/** Toast title for a failure from this call site. */
|
|
128
|
+
errorTitle?: string;
|
|
129
|
+
/** Set when the page shows its own error UI and a toast would double-report it. */
|
|
130
|
+
suppressErrorToast?: boolean;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Creates a plugin-surface `QueryClient` whose failures are visible to the operator.
|
|
134
|
+
*
|
|
135
|
+
* `config` is merged shallowly over the defaults, so a plugin can tune `defaultOptions` without
|
|
136
|
+
* having to restate — or accidentally drop — the error handling. Passing an explicit `queryCache`
|
|
137
|
+
* or `mutationCache` does replace ours, which is the escape hatch for a plugin that genuinely
|
|
138
|
+
* wants different behaviour.
|
|
139
|
+
*/
|
|
140
|
+
declare function createPluginQueryClient(config?: QueryClientConfig): QueryClient;
|
|
141
|
+
|
|
98
142
|
/**
|
|
99
143
|
* Matches component types renderable via `useView`: plain function/class
|
|
100
144
|
* components plus the object wrappers `React.lazy`, `React.forwardRef`, and
|
|
@@ -1386,4 +1430,4 @@ interface MenuConfigHostSidebarOptions {
|
|
|
1386
1430
|
*/
|
|
1387
1431
|
declare function menuConfigToHostSidebarInput(config: HeaderMenuItem[], opts: MenuConfigHostSidebarOptions): HostSidebarHookInput;
|
|
1388
1432
|
|
|
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 };
|
|
1433
|
+
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,50 @@ 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". BOTH bracketed prefixes are stripped from the description — the status one and the
|
|
120
|
+
* plugin’s own [ERROR_CODE] behind it: they are our wire format, and an operator reading either is
|
|
121
|
+
* reading our plumbing rather than their problem.
|
|
122
|
+
*
|
|
123
|
+
* A page that renders its own error UI opts out with `meta.suppressErrorToast`, matching the host.
|
|
124
|
+
*/
|
|
125
|
+
/** The subset of react-query's `meta` this module reads. Both fields are optional by design. */
|
|
126
|
+
interface PluginQueryMeta {
|
|
127
|
+
/** Toast title for a failure from this call site. */
|
|
128
|
+
errorTitle?: string;
|
|
129
|
+
/** Set when the page shows its own error UI and a toast would double-report it. */
|
|
130
|
+
suppressErrorToast?: boolean;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Creates a plugin-surface `QueryClient` whose failures are visible to the operator.
|
|
134
|
+
*
|
|
135
|
+
* `config` is merged shallowly over the defaults, so a plugin can tune `defaultOptions` without
|
|
136
|
+
* having to restate — or accidentally drop — the error handling. Passing an explicit `queryCache`
|
|
137
|
+
* or `mutationCache` does replace ours, which is the escape hatch for a plugin that genuinely
|
|
138
|
+
* wants different behaviour.
|
|
139
|
+
*/
|
|
140
|
+
declare function createPluginQueryClient(config?: QueryClientConfig): QueryClient;
|
|
141
|
+
|
|
98
142
|
/**
|
|
99
143
|
* Matches component types renderable via `useView`: plain function/class
|
|
100
144
|
* components plus the object wrappers `React.lazy`, `React.forwardRef`, and
|
|
@@ -1386,4 +1430,4 @@ interface MenuConfigHostSidebarOptions {
|
|
|
1386
1430
|
*/
|
|
1387
1431
|
declare function menuConfigToHostSidebarInput(config: HeaderMenuItem[], opts: MenuConfigHostSidebarOptions): HostSidebarHookInput;
|
|
1388
1432
|
|
|
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 };
|
|
1433
|
+
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,79 @@ 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
|
+
var ErrorCodePrefix = new RegExp(String.raw`^\[[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+\]\s*`);
|
|
48
|
+
function stripErrorCodePrefix(body) {
|
|
49
|
+
const stripped = body.replace(ErrorCodePrefix, "");
|
|
50
|
+
return stripped.length > 0 ? stripped : body;
|
|
51
|
+
}
|
|
52
|
+
function surfaceError(error, meta) {
|
|
53
|
+
if (meta?.suppressErrorToast === true) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const raw = error instanceof Error && error.message.length > 0 ? error.message : "An unexpected error occurred";
|
|
57
|
+
const { status, body } = splitStatusPrefix(raw);
|
|
58
|
+
const reason = stripErrorCodePrefix(body);
|
|
59
|
+
const title = meta?.errorTitle ?? (status !== null ? STATUS_TITLES.get(status) ?? GENERIC_TITLE : GENERIC_TITLE);
|
|
60
|
+
showErrorToast(title, reason);
|
|
61
|
+
}
|
|
62
|
+
function createPluginQueryClient(config) {
|
|
63
|
+
return new QueryClient({
|
|
64
|
+
queryCache: new QueryCache({
|
|
65
|
+
onError: (error, query) => surfaceError(error, query.meta)
|
|
66
|
+
}),
|
|
67
|
+
mutationCache: new MutationCache({
|
|
68
|
+
onError: (error, _variables, _context, mutation) => surfaceError(error, mutation.meta)
|
|
69
|
+
}),
|
|
70
|
+
...config,
|
|
71
|
+
defaultOptions: {
|
|
72
|
+
// Spread first so `mutations`, `dehydrate`, `hydrate` and anything else react-query
|
|
73
|
+
// adds to `DefaultOptions` survive. Rebuilding this object from named keys instead
|
|
74
|
+
// silently dropped them, which contradicted the merge promised just above.
|
|
75
|
+
...config?.defaultOptions,
|
|
76
|
+
queries: {
|
|
77
|
+
retry: 1,
|
|
78
|
+
refetchOnWindowFocus: false,
|
|
79
|
+
staleTime: 3e4,
|
|
80
|
+
...config?.defaultOptions?.queries
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
12
85
|
var TemplateContext = createContext(null);
|
|
13
86
|
function injectPluginStyles(id, css) {
|
|
14
87
|
if (typeof document === "undefined") return;
|
|
@@ -228,18 +301,7 @@ function useReportingCurrencySync() {
|
|
|
228
301
|
}
|
|
229
302
|
|
|
230
303
|
// 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();
|
|
304
|
+
var defaultQueryClient = createPluginQueryClient();
|
|
243
305
|
var EHX_PLUGIN_ROOT_CLASS = "ehx-plugin-root";
|
|
244
306
|
function definePlatformReactPluginPage(Page, options) {
|
|
245
307
|
const {
|
|
@@ -730,18 +792,7 @@ function useOverlayHost() {
|
|
|
730
792
|
}
|
|
731
793
|
return api;
|
|
732
794
|
}
|
|
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();
|
|
795
|
+
var defaultQueryClient2 = createPluginQueryClient();
|
|
745
796
|
function definePlatformReactPluginOverlay(Overlay, options) {
|
|
746
797
|
const { rootClassName, styleId, css, manifest = {}, queryClient = defaultQueryClient2, wrapOverlay } = options;
|
|
747
798
|
return function MountedOverlay(props) {
|
|
@@ -1160,6 +1211,6 @@ function withActiveNavHref(input, activeNavHref) {
|
|
|
1160
1211
|
return { ...input, activeNavHref };
|
|
1161
1212
|
}
|
|
1162
1213
|
|
|
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 };
|
|
1214
|
+
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
1215
|
//# sourceMappingURL=index.js.map
|
|
1165
1216
|
//# sourceMappingURL=index.js.map
|