@burdenoff/microfe-botmanor 2026.1203.3 → 2026.1203.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/botlit/BotmanorRootInner.js +38 -41
- package/dist/botlit/BotmanorRootInner.js.map +1 -1
- package/dist/botlit/providers/WorkspaceFlagScope.d.ts +7 -0
- package/dist/botlit/providers/WorkspaceFlagScope.js +17 -0
- package/dist/botlit/providers/WorkspaceFlagScope.js.map +1 -0
- package/dist/botlit/providers/workspaceFlagKeys.d.ts +18 -0
- package/dist/botlit/providers/workspaceFlagKeys.js +8 -0
- package/dist/botlit/providers/workspaceFlagKeys.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,71 +1,68 @@
|
|
|
1
1
|
import { BotlitProvider as e } from "./providers/BotlitProvider.js";
|
|
2
2
|
import { QuotaGuard as t } from "./providers/QuotaGuard.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
3
|
+
import { WorkspaceFlagScope as n } from "./providers/WorkspaceFlagScope.js";
|
|
4
|
+
import { BotlitRoutes as r } from "./BotlitRoutes.js";
|
|
5
|
+
import { RouteLoader as i } from "./components/RouteLoader.js";
|
|
6
|
+
import { useTr as a } from "../shared/hooks/useTr.js";
|
|
7
|
+
import { WorkspaceRequired as o } from "./components/WorkspaceRequired.js";
|
|
8
|
+
import { ConfirmActionBridge as s } from "./utils/confirmAction.js";
|
|
9
|
+
import { BOTMANOR_TOUR_PRODUCT_ID as c, botmanorTourRoutes as l } from "./tours/tourRoutes.js";
|
|
10
|
+
import { useEffect as u, useState as d } from "react";
|
|
11
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
12
|
+
import { useGatewayClient as m } from "@burdenoff/fe-libs/shared/graphql";
|
|
13
|
+
import { ApolloProvider as h } from "@apollo/client/react";
|
|
14
|
+
import { QueryClient as g, QueryClientProvider as _ } from "@tanstack/react-query";
|
|
15
|
+
import { registerTourRouteCatalog as v } from "@burdenoff/fe-libs/shared/tours";
|
|
16
|
+
import { ErrorBoundary as y } from "@burdenoff/fe-libs/shared/components";
|
|
17
17
|
// src/botlit/BotmanorRootInner.tsx
|
|
18
|
-
var b = 1e4, x = 2e3, S = new
|
|
18
|
+
var b = 1e4, x = 2e3, S = new g({ defaultOptions: { queries: {
|
|
19
19
|
staleTime: 3e5,
|
|
20
20
|
retry: 1
|
|
21
|
-
} } }), C = (
|
|
22
|
-
let C =
|
|
23
|
-
if (
|
|
21
|
+
} } }), C = (g) => {
|
|
22
|
+
let C = a(), w = m("workspace"), T = !!w, [E, D] = d(!1), [O, k] = d(!1);
|
|
23
|
+
if (u(() => v(c, l(g.basePath)), [g.basePath]), u(() => {
|
|
24
24
|
if (T) return;
|
|
25
25
|
let e = setTimeout(() => {
|
|
26
26
|
D(!0);
|
|
27
27
|
}, b);
|
|
28
28
|
return () => clearTimeout(e);
|
|
29
|
-
}, [T]),
|
|
30
|
-
if (
|
|
29
|
+
}, [T]), u(() => {
|
|
30
|
+
if (g.workspaceId) return;
|
|
31
31
|
let e = setTimeout(() => k(!0), x);
|
|
32
32
|
return () => clearTimeout(e);
|
|
33
|
-
}, [
|
|
34
|
-
basePath:
|
|
35
|
-
navigate:
|
|
36
|
-
}) : /* @__PURE__ */
|
|
37
|
-
if (!T) return E ? /* @__PURE__ */
|
|
33
|
+
}, [g.workspaceId]), !g.workspaceId) return O ? /* @__PURE__ */ f(o, {
|
|
34
|
+
basePath: g.basePath,
|
|
35
|
+
navigate: g.navigate
|
|
36
|
+
}) : /* @__PURE__ */ f(i, { label: C("botlit.root.loadingWorkspace", "Loading your workspace…") });
|
|
37
|
+
if (!T) return E ? /* @__PURE__ */ f("div", {
|
|
38
38
|
className: "flex h-full min-h-[200px] w-full items-center justify-center p-6",
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ p("div", {
|
|
40
40
|
className: "text-center",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ f("p", {
|
|
42
42
|
className: "mb-4 text-sm text-text-secondary",
|
|
43
43
|
children: C("botlit.root.connectError", "BotManor could not connect to the gateway. Please refresh the page or check your configuration.")
|
|
44
|
-
}), /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ f("button", {
|
|
45
45
|
type: "button",
|
|
46
46
|
onClick: () => window.location.reload(),
|
|
47
47
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
48
48
|
children: C("botlit.root.reload", "Reload Page")
|
|
49
49
|
})]
|
|
50
50
|
})
|
|
51
|
-
}) : /* @__PURE__ */
|
|
52
|
-
let A = !!
|
|
53
|
-
...
|
|
54
|
-
children: /* @__PURE__ */
|
|
51
|
+
}) : /* @__PURE__ */ f(i, {});
|
|
52
|
+
let A = !!g.basePath, j = /* @__PURE__ */ f(e, {
|
|
53
|
+
...g,
|
|
54
|
+
children: /* @__PURE__ */ f(t, { children: /* @__PURE__ */ f(r, {}) })
|
|
55
55
|
});
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
fallback: /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ p(y, {
|
|
57
|
+
fallback: /* @__PURE__ */ f("div", {
|
|
58
58
|
className: "p-6 text-center text-text-secondary",
|
|
59
59
|
children: C("botlit.root.loadFailed", "Something went wrong loading BotManor. Please refresh the page.")
|
|
60
60
|
}),
|
|
61
|
-
children: [/* @__PURE__ */
|
|
62
|
-
workspaceId:
|
|
63
|
-
|
|
64
|
-
flagKeys: ["botmanor.stewards"],
|
|
65
|
-
defaultEnabled: !0,
|
|
66
|
-
children: /* @__PURE__ */ d(g, {
|
|
61
|
+
children: [/* @__PURE__ */ f(s, {}), /* @__PURE__ */ f(n, {
|
|
62
|
+
workspaceId: g.workspaceId,
|
|
63
|
+
children: /* @__PURE__ */ f(_, {
|
|
67
64
|
client: S,
|
|
68
|
-
children: A ? j : /* @__PURE__ */
|
|
65
|
+
children: A ? j : /* @__PURE__ */ f(h, {
|
|
69
66
|
client: w,
|
|
70
67
|
children: j
|
|
71
68
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotmanorRootInner.js","names":["CLIENT_READY_TIMEOUT_MS","WORKSPACE_SETTLE_MS","queryClient","QueryClient","BotmanorRootInner","tr","useTr","workspaceClient","useGatewayClient","clientReady","clientTimedOut","setClientTimedOut","useState","workspaceSettled","setWorkspaceSettled","useEffect","registerTourRouteCatalog","BOTMANOR_TOUR_PRODUCT_ID","botmanorTourRoutes","props","timer","WorkspaceRequired","RouteLoader","isIntegrated","content","BotlitProvider","QuotaGuard","BotlitRoutes","ErrorBoundary","ConfirmActionBridge","
|
|
1
|
+
{"version":3,"file":"BotmanorRootInner.js","names":["CLIENT_READY_TIMEOUT_MS","WORKSPACE_SETTLE_MS","queryClient","QueryClient","BotmanorRootInner","tr","useTr","workspaceClient","useGatewayClient","clientReady","clientTimedOut","setClientTimedOut","useState","workspaceSettled","setWorkspaceSettled","useEffect","registerTourRouteCatalog","BOTMANOR_TOUR_PRODUCT_ID","botmanorTourRoutes","props","timer","WorkspaceRequired","RouteLoader","isIntegrated","content","BotlitProvider","QuotaGuard","BotlitRoutes","ErrorBoundary","ConfirmActionBridge","WorkspaceFlagScope","QueryClientProvider","ApolloProvider"],"sources":["../../src/botlit/BotmanorRootInner.tsx"],"sourcesContent":["/**\n * BotManor Root — implementation\n * @module botlit\n *\n * Product pages live behind this lazy boundary. Workflow routes and SDK\n * lifecycle are owned by the app-shell WorkflowsRoot, shared with every host.\n */\n\nimport type { FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ApolloProvider } from '@apollo/client/react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { BotlitProvider } from './providers/BotlitProvider';\nimport { QuotaGuard } from './providers/QuotaGuard';\nimport { WorkspaceFlagScope } from './providers/WorkspaceFlagScope';\nimport { BotlitRoutes } from './BotlitRoutes';\nimport { RouteLoader } from './components/RouteLoader';\nimport { useTr } from '../shared/hooks/useTr';\nimport { WorkspaceRequired } from './components/WorkspaceRequired';\nimport { ConfirmActionBridge } from './utils/confirmAction';\nimport type { BotmanorRootProps } from './types';\n\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\nimport { registerTourRouteCatalog } from '@burdenoff/fe-libs/shared/tours';\nimport { BOTMANOR_TOUR_PRODUCT_ID, botmanorTourRoutes } from './tours/tourRoutes';\n\n/** How long to wait for the shell's gateway clients before showing an error. */\nconst CLIENT_READY_TIMEOUT_MS = 10_000;\n\n/**\n * How long to keep showing the loading skeleton before concluding that the\n * shell really has no active workspace.\n *\n * The shell resolves org/workspace asynchronously and passes `workspaceId=\"\"`\n * until it lands, which is indistinguishable from \"this user has no\n * workspace\". Without this settle window the guided zero state would flash on\n * every cold load — a get-started screen appearing and vanishing reads as a\n * broken page, which is exactly what this component exists to avoid.\n */\nconst WORKSPACE_SETTLE_MS = 2_000;\n\n// Create a query client for this microfrontend\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 5 * 60 * 1000,\n retry: 1,\n },\n },\n});\n\nexport const BotmanorRootInner: FC<BotmanorRootProps> = (props) => {\n // NOTE: Navigation is now handled by the shell's NavRegistration.tsx\n // The shell manages all product submenu items in a centralized way\n\n // Product operations use the shell's authenticated workspace gateway client.\n const tr = useTr();\n const workspaceClient = useGatewayClient('workspace');\n const clientReady = Boolean(workspaceClient);\n const [clientTimedOut, setClientTimedOut] = useState(false);\n const [workspaceSettled, setWorkspaceSettled] = useState(false);\n\n // Name each BotManor screen for product tours (BOFF-15482). Without this the\n // shell resolves every screen under the mount path to one pageId.\n useEffect(\n () => registerTourRouteCatalog(BOTMANOR_TOUR_PRODUCT_ID, botmanorTourRoutes(props.basePath)),\n [props.basePath]\n );\n\n // Timeout fallback: if gateway clients are never provided (test env, shell\n // misconfiguration, auth failure before hydration), show an error rather than\n // spinning indefinitely.\n useEffect(() => {\n if (clientReady) return;\n const timer = setTimeout(() => {\n setClientTimedOut(true);\n }, CLIENT_READY_TIMEOUT_MS);\n return () => clearTimeout(timer);\n }, [clientReady]);\n\n // Give the shell a bounded window to resolve the active workspace before the\n // guided zero state is allowed to render. Cancelled the moment a workspace\n // arrives — a workspace that is already present never starts the timer.\n useEffect(() => {\n if (props.workspaceId) return;\n const timer = setTimeout(() => setWorkspaceSettled(true), WORKSPACE_SETTLE_MS);\n return () => clearTimeout(timer);\n }, [props.workspaceId]);\n\n // Without a workspace every BotManor query is unscoped and every write is\n // rejected — guide the user instead of rendering empty lists. Until the\n // settle window elapses we cannot tell \"still resolving\" from \"none\", so we\n // keep the same skeleton the shell was already showing.\n if (!props.workspaceId) {\n if (!workspaceSettled) {\n return <RouteLoader label={tr('botlit.root.loadingWorkspace', 'Loading your workspace…')} />;\n }\n return <WorkspaceRequired basePath={props.basePath} navigate={props.navigate} />;\n }\n\n // Don't render until clients are ready (same pattern as microfe-bigconsole)\n if (!clientReady) {\n if (clientTimedOut) {\n return (\n <div className=\"flex h-full min-h-[200px] w-full items-center justify-center p-6\">\n <div className=\"text-center\">\n <p className=\"mb-4 text-sm text-text-secondary\">\n {tr(\n 'botlit.root.connectError',\n 'BotManor could not connect to the gateway. Please refresh the page or check your configuration.'\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover\"\n >\n {tr('botlit.root.reload', 'Reload Page')}\n </button>\n </div>\n </div>\n );\n }\n // Same skeleton as the lazy-chunk fallback, so the content region never\n // switches loading idioms between first paint and the page rendering.\n return <RouteLoader />;\n }\n\n const isIntegrated = !!props.basePath;\n\n const content = (\n <BotlitProvider {...props}>\n {/* Every metered mutation that hits a plan limit opens one translated dialog. */}\n <QuotaGuard>\n <BotlitRoutes />\n </QuotaGuard>\n </BotlitProvider>\n );\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'botlit.root.loadFailed',\n 'Something went wrong loading BotManor. Please refresh the page.'\n )}\n </div>\n }\n >\n {/* Every confirmAction asks through fe-libs' useConfirm (BOFF-16859). */}\n <ConfirmActionBridge />\n {/* One flag evaluation per workspace: reuses the shell's provider when it\n already covers this workspace (BOFF-18147). */}\n <WorkspaceFlagScope workspaceId={props.workspaceId}>\n <QueryClientProvider client={queryClient}>\n {isIntegrated ? (\n content\n ) : (\n <ApolloProvider client={workspaceClient}>{content}</ApolloProvider>\n )}\n </QueryClientProvider>\n </WorkspaceFlagScope>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,IAAMA,IAA0B,KAY1BC,IAAsB,KAGtBC,IAAc,IAAIC,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW;CACX,OAAO;AACT,EACF,EACF,CAAC,GAEYC,KAA4C,MAAU;CAKjE,IAAMC,IAAKC,EAAM,GACXC,IAAkBC,EAAiB,WAAW,GAC9CC,IAAc,EAAQF,GACtB,CAACG,GAAgBC,KAAqBC,EAAS,EAAK,GACpD,CAACC,GAAkBC,KAAuBF,EAAS,EAAK;CAiC9D,IA7BAG,QACQC,EAAyBC,GAA0BC,EAAmBC,EAAM,QAAQ,CAAC,GAC3F,CAACA,EAAM,QAAQ,CACjB,GAKAJ,QAAgB;EACd,IAAIN,GAAa;EACjB,IAAMW,IAAQ,iBAAiB;GAC7B,EAAkB,EAAI;EACxB,GAAGpB,CAAuB;EAC1B,aAAa,aAAaoB,CAAK;CACjC,GAAG,CAACX,CAAW,CAAC,GAKhBM,QAAgB;EACd,IAAII,EAAM,aAAa;EACvB,IAAMC,IAAQ,iBAAiBN,EAAoB,EAAI,GAAGb,CAAmB;EAC7E,aAAa,aAAamB,CAAK;CACjC,GAAG,CAACD,EAAM,WAAW,CAAC,GAMlB,CAACA,EAAM,aAIT,OAHKN,IAGE,kBAACQ,GAAD;EAAmB,UAAUF,EAAM;EAAU,UAAUA,EAAM;CAAW,CAAA,IAFtE,kBAACG,GAAD,EAAa,OAAOjB,EAAG,gCAAgC,yBAAyB,EAAI,CAAA;CAM/F,IAAI,CAACI,GAwBH,OAvBIC,IAEA,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAL,EACC,4BACA,iGACF;GACC,CAAA,GACH,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,OAAO,SAAS,OAAO;IACtC,WAAU;IAET,UAAAA,EAAG,sBAAsB,aAAa;GACjC,CAAA,CACL;;CACF,CAAA,IAKF,kBAACiB,GAAD,CAAc,CAAA;CAGvB,IAAMC,IAAe,CAAC,CAACJ,EAAM,UAEvBK,IACJ,kBAACC,GAAD;EAAgB,GAAIN;EAElB,UAAA,kBAACO,GAAD,EAAA,UACE,kBAACC,GAAD,CAAe,CAAA,EACL,CAAA;CACE,CAAA;CAGlB,OACE,kBAACC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;GACZ,UAAAvB,EACC,0BACA,iEACF;EACG,CAAA;EAPT,UAAA,CAWE,kBAACwB,GAAD,CAAsB,CAAA,GAGtB,kBAACC,GAAD;GAAoB,aAAaX,EAAM;GACrC,UAAA,kBAACY,GAAD;IAAqB,QAAQ7B;IAC1B,UAAAqB,IACCC,IAEA,kBAACQ,GAAD;KAAgB,QAAQzB;KAAkB,UAAAiB;IAAwB,CAAA;GAEjD,CAAA;EACH,CAAA,CACP;;AAEnB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export interface WorkspaceFlagScopeProps {
|
|
3
|
+
/** The page's workspace; empty or null while the shell is still resolving it. */
|
|
4
|
+
workspaceId: string | null | undefined;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const WorkspaceFlagScope: FC<WorkspaceFlagScopeProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BOTMANOR_FLAG_KEYS as e, enclosingProviderCoversWorkspace as t } from "./workspaceFlagKeys.js";
|
|
2
|
+
import { Fragment as n, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { FeatureFlagProvider as i, useOptionalFeatureFlags as a } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
4
|
+
// src/botlit/providers/WorkspaceFlagScope.tsx
|
|
5
|
+
var o = ({ workspaceId: o, children: s }) => {
|
|
6
|
+
let c = a();
|
|
7
|
+
return t(c?.workspaceId, o) ? /* @__PURE__ */ r(n, { children: s }) : /* @__PURE__ */ r(i, {
|
|
8
|
+
workspaceId: o || null,
|
|
9
|
+
gateway: "global",
|
|
10
|
+
flagKeys: e,
|
|
11
|
+
defaultEnabled: !0,
|
|
12
|
+
children: s
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export { o as WorkspaceFlagScope };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=WorkspaceFlagScope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceFlagScope.js","names":["_Fragment","WorkspaceFlagScope","enclosing","useOptionalFeatureFlags","enclosingProviderCoversWorkspace","workspaceId","Fragment","FeatureFlagProvider","BOTMANOR_FLAG_KEYS"],"sources":["../../../src/botlit/providers/WorkspaceFlagScope.tsx"],"sourcesContent":["/**\n * Feature flags for BotManor's pages, evaluated once per workspace.\n * @module botlit\n *\n * BotManor's only flag today is `botmanor.stewards`. The BotManor app shell\n * already evaluates every flag for the active workspace in its own\n * FeatureFlagProvider (botmanor-app `WorkspaceFeatureFlags`, BOFF-16146), and\n * this module used to mount a second provider underneath it that asked again\n * for `botmanor.stewards` alone. Every signed-in BotManor page therefore sent\n * `EvaluateFeatureFlags` twice for the same workspace (BOFF-18147).\n *\n * When an enclosing provider already evaluates flags for the same workspace,\n * this scope reuses it and sends nothing. A host that mounts no provider, or\n * one with no workspace or a different workspace, still gets BotManor's own\n * provider, so `useFeatureFlag('botmanor.stewards')` keeps answering for the\n * page's workspace in every host.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport {\n FeatureFlagProvider,\n useOptionalFeatureFlags,\n} from '@burdenoff/fe-libs/shared/feature-flags';\nimport { BOTMANOR_FLAG_KEYS, enclosingProviderCoversWorkspace } from './workspaceFlagKeys';\n\nexport interface WorkspaceFlagScopeProps {\n /** The page's workspace; empty or null while the shell is still resolving it. */\n workspaceId: string | null | undefined;\n children: ReactNode;\n}\n\nexport const WorkspaceFlagScope: FC<WorkspaceFlagScopeProps> = ({ workspaceId, children }) => {\n const enclosing = useOptionalFeatureFlags();\n\n if (enclosingProviderCoversWorkspace(enclosing?.workspaceId, workspaceId)) {\n return <>{children}</>;\n }\n\n return (\n <FeatureFlagProvider\n workspaceId={workspaceId || null}\n gateway=\"global\"\n flagKeys={BOTMANOR_FLAG_KEYS}\n defaultEnabled={true}\n >\n {children}\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;AA+BA,IAAaC,KAAmD,EAAE,gBAAa,kBAAe;CAC5F,IAAMC,IAAYC,EAAwB;CAM1C,OAJIC,EAAiCF,GAAW,aAAaG,CAAW,IAC/D,kBAAAL,GAAA,EAAG,YAAW,CAAA,IAIrB,kBAACO,GAAD;EACE,aAAaF,KAAe;EAC5B,SAAQ;EACR,UAAUG;EACV,gBAAgB;EAEf;CACkB,CAAA;AAEzB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flag keys and the reuse rule behind WorkspaceFlagScope (BOFF-18147).
|
|
3
|
+
* @module botlit
|
|
4
|
+
*
|
|
5
|
+
* Kept out of the component file so Fast Refresh can preserve the scope's
|
|
6
|
+
* state (react-doctor `only-export-components`).
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The flags BotManor's pages read. A module constant on purpose: the provider
|
|
10
|
+
* re-runs its fetch whenever this array changes identity, so an inline literal
|
|
11
|
+
* would evaluate the flags again on every render of the module root.
|
|
12
|
+
*/
|
|
13
|
+
export declare const BOTMANOR_FLAG_KEYS: string[];
|
|
14
|
+
/**
|
|
15
|
+
* `true` when the enclosing flag provider already evaluates flags for
|
|
16
|
+
* `workspaceId`, so a nested provider would only repeat its request.
|
|
17
|
+
*/
|
|
18
|
+
export declare function enclosingProviderCoversWorkspace(enclosingWorkspaceId: string | null | undefined, workspaceId: string | null | undefined): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaceFlagKeys.js","names":["BOTMANOR_FLAG_KEYS","enclosingProviderCoversWorkspace","enclosingWorkspaceId","workspaceId"],"sources":["../../../src/botlit/providers/workspaceFlagKeys.ts"],"sourcesContent":["/**\n * Flag keys and the reuse rule behind WorkspaceFlagScope (BOFF-18147).\n * @module botlit\n *\n * Kept out of the component file so Fast Refresh can preserve the scope's\n * state (react-doctor `only-export-components`).\n */\n\n/**\n * The flags BotManor's pages read. A module constant on purpose: the provider\n * re-runs its fetch whenever this array changes identity, so an inline literal\n * would evaluate the flags again on every render of the module root.\n */\nexport const BOTMANOR_FLAG_KEYS: string[] = ['botmanor.stewards'];\n\n/**\n * `true` when the enclosing flag provider already evaluates flags for\n * `workspaceId`, so a nested provider would only repeat its request.\n */\nexport function enclosingProviderCoversWorkspace(\n enclosingWorkspaceId: string | null | undefined,\n workspaceId: string | null | undefined\n): boolean {\n return Boolean(enclosingWorkspaceId) && enclosingWorkspaceId === workspaceId;\n}\n"],"mappings":";AAaA,IAAaA,IAA+B,CAAC,mBAAmB;AAMhE,SAAgBC,EACd,GACA,GACS;CACT,OAAO,EAAQC,KAAyBA,MAAyBC;AACnE"}
|