@axiom-lattice/react-sdk 4.10.0 → 4.11.1
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/{AgentDetailSideApp-EQDCKCXY.mjs → AgentDetailSideApp-OW5LUKMG.mjs} +8 -8
- package/dist/AgentGovernanceWorkbench-NNCUUU3E.mjs +20 -0
- package/dist/{MessageGraph-WWTTGLD7.mjs → MessageGraph-SGLKFEJK.mjs} +4 -4
- package/dist/{ReactChart-AOJAFAZM.mjs → ReactChart-FHVYPC7S.mjs} +4 -4
- package/dist/{SkillFlow-3ZGSHMHW.mjs → SkillFlow-MLSQCF4X.mjs} +4 -4
- package/dist/{TasksSideApp-42BLTNY4.mjs → TasksSideApp-F2ZZTWGN.mjs} +5 -5
- package/dist/{TeamWorkspace-U2IO3W4F.mjs → TeamWorkspace-AQOUI5EN.mjs} +4 -4
- package/dist/{TopologyRuntimeView-KJQVVUGE.mjs → TopologyRuntimeView-6GZUQLB6.mjs} +5 -5
- package/dist/{WorkflowAutomationView-3L3IMYYG.mjs → WorkflowAutomationView-UUAUG3LZ.mjs} +7 -7
- package/dist/{chunk-ZHOCTUDR.mjs → chunk-HLOK3K5J.mjs} +28 -12
- package/dist/chunk-HLOK3K5J.mjs.map +1 -0
- package/dist/{chunk-QTXQT77Q.mjs → chunk-J23W2JYG.mjs} +4 -4
- package/dist/{chunk-TBQVOSCN.mjs → chunk-JBDRDPL5.mjs} +24 -18
- package/dist/chunk-JBDRDPL5.mjs.map +1 -0
- package/dist/{chunk-HJDE5RQJ.mjs → chunk-MASPEZN4.mjs} +3 -3
- package/dist/{chunk-XVZUC4U3.mjs → chunk-PEEXMLMK.mjs} +21 -5
- package/dist/chunk-PEEXMLMK.mjs.map +1 -0
- package/dist/{chunk-JNP2AHRT.mjs → chunk-RDC4ZHXF.mjs} +109 -49
- package/dist/chunk-RDC4ZHXF.mjs.map +1 -0
- package/dist/{chunk-ECHGNV43.mjs → chunk-TIYJFBLK.mjs} +6 -6
- package/dist/{chunk-4CGRA733.mjs → chunk-TMGDS7XU.mjs} +3 -3
- package/dist/{chunk-CRGVJY56.mjs → chunk-TXBE42BY.mjs} +6 -6
- package/dist/{chunk-HG7UMQO2.mjs → chunk-ZQ7G446O.mjs} +3 -3
- package/dist/{embed-page-AgentDetailSideApp-GH3XNS5A.js → embed-page-AgentDetailSideApp-2M4MLVQQ.js} +1 -1
- package/dist/{embed-page-AgentGovernanceWorkbench-AXHLZTUG.js → embed-page-AgentGovernanceWorkbench-KEVBIQP6.js} +1 -1
- package/dist/{embed-page-MessageGraph-HLLPBTLQ.js → embed-page-MessageGraph-PRBUQINR.js} +1 -1
- package/dist/{embed-page-ReactChart-46EYPRQ7.js → embed-page-ReactChart-V6JJXCEV.js} +1 -1
- package/dist/{embed-page-SkillFlow-NMUDTNTY.js → embed-page-SkillFlow-6LPE2VG3.js} +1 -1
- package/dist/{embed-page-TasksSideApp-DOCKHJCF.js → embed-page-TasksSideApp-OFZI54MF.js} +1 -1
- package/dist/{embed-page-TeamWorkspace-LXOIMYRW.js → embed-page-TeamWorkspace-QSSAF3AA.js} +1 -1
- package/dist/{embed-page-TopologyRuntimeView-DT7XXEK2.js → embed-page-TopologyRuntimeView-PHULW2NG.js} +1 -1
- package/dist/{embed-page-WorkflowAutomationView-ONAY4RTM.js → embed-page-WorkflowAutomationView-LQS6H7X6.js} +1 -1
- package/dist/{embed-page-chunk-OY4CDWED.js → embed-page-chunk-7PNQFZMK.js} +7 -7
- package/dist/{embed-page-chunk-F7G2DME5.js → embed-page-chunk-D5EY6ASK.js} +1 -1
- package/dist/{embed-page-chunk-JQSBSZMP.js → embed-page-chunk-IJ2YWGKU.js} +1 -1
- package/dist/{embed-page-chunk-H4W4NDIY.js → embed-page-chunk-O44JEYLD.js} +7 -7
- package/dist/embed-page-chunk-PFCR6CFL.js +2 -0
- package/dist/{embed-page-chunk-RA35MUYW.js → embed-page-chunk-SSWDAKQU.js} +1 -1
- package/dist/{embed-page-chunk-LGZUYB7B.js → embed-page-chunk-YNHKD2CY.js} +1 -1
- package/dist/embed-page.js +1 -1
- package/dist/index.d.mts +41 -3
- package/dist/index.d.ts +41 -3
- package/dist/index.js +973 -866
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/web-app.js +1 -6
- package/dist/web-app.js.map +1 -1
- package/dist/web-app.mjs +1 -1
- package/package.json +1 -1
- package/dist/AgentGovernanceWorkbench-2HCQ4POL.mjs +0 -20
- package/dist/chunk-JNP2AHRT.mjs.map +0 -1
- package/dist/chunk-TBQVOSCN.mjs.map +0 -1
- package/dist/chunk-XVZUC4U3.mjs.map +0 -1
- package/dist/chunk-ZHOCTUDR.mjs.map +0 -1
- package/dist/embed-page-chunk-NR2PTMJ6.js +0 -2
- /package/dist/{AgentDetailSideApp-EQDCKCXY.mjs.map → AgentDetailSideApp-OW5LUKMG.mjs.map} +0 -0
- /package/dist/{AgentGovernanceWorkbench-2HCQ4POL.mjs.map → AgentGovernanceWorkbench-NNCUUU3E.mjs.map} +0 -0
- /package/dist/{MessageGraph-WWTTGLD7.mjs.map → MessageGraph-SGLKFEJK.mjs.map} +0 -0
- /package/dist/{ReactChart-AOJAFAZM.mjs.map → ReactChart-FHVYPC7S.mjs.map} +0 -0
- /package/dist/{SkillFlow-3ZGSHMHW.mjs.map → SkillFlow-MLSQCF4X.mjs.map} +0 -0
- /package/dist/{TasksSideApp-42BLTNY4.mjs.map → TasksSideApp-F2ZZTWGN.mjs.map} +0 -0
- /package/dist/{TeamWorkspace-U2IO3W4F.mjs.map → TeamWorkspace-AQOUI5EN.mjs.map} +0 -0
- /package/dist/{TopologyRuntimeView-KJQVVUGE.mjs.map → TopologyRuntimeView-6GZUQLB6.mjs.map} +0 -0
- /package/dist/{WorkflowAutomationView-3L3IMYYG.mjs.map → WorkflowAutomationView-UUAUG3LZ.mjs.map} +0 -0
- /package/dist/{chunk-QTXQT77Q.mjs.map → chunk-J23W2JYG.mjs.map} +0 -0
- /package/dist/{chunk-HJDE5RQJ.mjs.map → chunk-MASPEZN4.mjs.map} +0 -0
- /package/dist/{chunk-ECHGNV43.mjs.map → chunk-TIYJFBLK.mjs.map} +0 -0
- /package/dist/{chunk-4CGRA733.mjs.map → chunk-TMGDS7XU.mjs.map} +0 -0
- /package/dist/{chunk-CRGVJY56.mjs.map → chunk-TXBE42BY.mjs.map} +0 -0
- /package/dist/{chunk-HG7UMQO2.mjs.map → chunk-ZQ7G446O.mjs.map} +0 -0
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
TaskActionsButton,
|
|
5
5
|
isHiddenStatus,
|
|
6
6
|
taskOrigin
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JBDRDPL5.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useT
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PEEXMLMK.mjs";
|
|
11
11
|
|
|
12
12
|
// src/components/Tasks/TaskOutlineList.tsx
|
|
13
13
|
import {
|
|
@@ -491,4 +491,4 @@ var TaskOutlineList = ({
|
|
|
491
491
|
export {
|
|
492
492
|
TaskOutlineList
|
|
493
493
|
};
|
|
494
|
-
//# sourceMappingURL=chunk-
|
|
494
|
+
//# sourceMappingURL=chunk-MASPEZN4.mjs.map
|
|
@@ -116,13 +116,14 @@ function useT() {
|
|
|
116
116
|
|
|
117
117
|
// src/i18n/useLocale.ts
|
|
118
118
|
import { createContext, useContext } from "react";
|
|
119
|
-
var
|
|
119
|
+
var INERT_LOCALE_BRIDGE = {
|
|
120
120
|
locale: "en-US",
|
|
121
121
|
setLocale: () => void 0,
|
|
122
122
|
supportedLocales: SUPPORTED_LOCALES
|
|
123
|
-
}
|
|
123
|
+
};
|
|
124
|
+
var LocaleBridgeContext = createContext(null);
|
|
124
125
|
function useLocale() {
|
|
125
|
-
return useContext(LocaleBridgeContext);
|
|
126
|
+
return useContext(LocaleBridgeContext) ?? INERT_LOCALE_BRIDGE;
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
// src/i18n/LatticeLocaleProvider.tsx
|
|
@@ -187,12 +188,27 @@ function LatticeLocaleProvider({
|
|
|
187
188
|
return /* @__PURE__ */ jsx(LocaleBridgeContext.Provider, { value: bridge, children: /* @__PURE__ */ jsx(I18nextProvider, { i18n: instance, children }) });
|
|
188
189
|
}
|
|
189
190
|
|
|
191
|
+
// src/i18n/localeStorage.ts
|
|
192
|
+
var DEFAULT_LOCALE_STORAGE_KEY = "lattice.locale";
|
|
193
|
+
function readStoredLocale(storageKey = DEFAULT_LOCALE_STORAGE_KEY) {
|
|
194
|
+
if (typeof window === "undefined") return void 0;
|
|
195
|
+
try {
|
|
196
|
+
const stored = window.localStorage.getItem(storageKey);
|
|
197
|
+
return stored !== null && SUPPORTED_LOCALES.includes(stored) ? stored : void 0;
|
|
198
|
+
} catch {
|
|
199
|
+
return void 0;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
190
203
|
export {
|
|
191
204
|
SUPPORTED_LOCALES,
|
|
192
205
|
NAMESPACES,
|
|
193
206
|
namespaceOf,
|
|
194
207
|
useT,
|
|
208
|
+
LocaleBridgeContext,
|
|
195
209
|
useLocale,
|
|
196
|
-
LatticeLocaleProvider
|
|
210
|
+
LatticeLocaleProvider,
|
|
211
|
+
DEFAULT_LOCALE_STORAGE_KEY,
|
|
212
|
+
readStoredLocale
|
|
197
213
|
};
|
|
198
|
-
//# sourceMappingURL=chunk-
|
|
214
|
+
//# sourceMappingURL=chunk-PEEXMLMK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/i18n/instance.ts","../src/i18n/useT.ts","../src/i18n/useLocale.ts","../src/i18n/LatticeLocaleProvider.tsx","../src/i18n/localeStorage.ts"],"sourcesContent":["/**\n * The SDK's i18next instance.\n *\n * Auto-namespacing is the load-bearing idea here. Components write fully\n * qualified keys — `t(\"auth.login.title\")` — and the first segment (`auth`) is\n * also the namespace the dictionary is filed under. So `useT()` derives the\n * namespace from the key and hands it to i18next, which lets the ~2400\n * existing call sites stay exactly as they are while i18next still loads\n * dictionaries one namespace at a time.\n *\n * The alternative — merging all 18 namespaces into one — would also leave call\n * sites untouched, but it throws away the namespace boundary that i18next's\n * tooling (`i18next-cli extract/status/types`) is built around, and it makes\n * every chunk carry every module's copy.\n *\n * The instance is created with `createInstance()`, never the default export:\n * a shared package must not read or clobber its host's locale. For the same\n * reason `initReactI18next` is **not** used here — its `init()` writes the\n * instance into react-i18next's module-level singleton, which would swap the\n * host's instance out from under it. `<I18nextProvider>` is the supported way\n * to hand an instance down.\n */\n\nimport { createInstance } from \"i18next\";\nimport type { i18n as I18nInstance, ResourceKey } from \"i18next\";\nimport type { LatticeLocale } from \"@axiom-lattice/i18n\";\n\n/** Shipped locales, in the SDK's tag vocabulary. */\nexport const SUPPORTED_LOCALES: LatticeLocale[] = [\"en-US\", \"zh-CN\"];\n\n/** i18next speaks short tags; the SDK speaks BCP-47. */\nexport function toI18nextLocale(locale: LatticeLocale): string {\n return locale === \"zh-CN\" ? \"zh\" : \"en\";\n}\n\nexport function fromI18nextLocale(language: string): LatticeLocale {\n return language.startsWith(\"zh\") ? \"zh-CN\" : \"en-US\";\n}\n\n/**\n * Namespaces, one per dictionary module.\n *\n * Kept as an explicit list rather than discovered from the filesystem: it is\n * what lets the dynamic import below stay a *literal* pattern, which is what\n * Vite and Rollup require to emit a chunk per namespace.\n */\nexport const NAMESPACES = [\n /**\n * The shared verbs — confirm/cancel/save/delete/… — that used to live in\n * `@axiom-lattice/i18n`'s own dictionary. They keep the `common.` prefix and\n * become a namespace of their own so `namespaceOf` routes them somewhere they\n * actually exist; without this they fell through to the first namespace and\n * rendered as raw keys.\n */\n \"common\",\n \"a2a\", \"auth\", \"capability\", \"chat\", \"chatConfig\", \"chatMenu\", \"chatWorkspace\",\n \"cospace\", \"entities\", \"eval\", \"genui\", \"governance\", \"integration\", \"mcpapp\",\n \"migration\", \"projectRoom\", \"tasks\", \"training\",\n] as const;\n\n/**\n * Which namespace a key belongs to.\n *\n * `\"auth.login.title\"` → `\"auth\"`. A key with no dotted prefix falls back to\n * the first namespace, which keeps `i18next.t` from being handed `undefined`\n * and keeps unknown keys resolving (to themselves) instead of throwing.\n */\nexport function namespaceOf(key: string): string {\n const [head] = key.split(\".\");\n return (NAMESPACES as readonly string[]).includes(head) ? head : NAMESPACES[0];\n}\n\n/**\n * Loads the dictionary for one namespace in one language.\n *\n * A plain object satisfying i18next's backend contract — no\n * `i18next-resources-to-backend` dependency for eight lines of code. The\n * `import()` argument is a literal pattern with a literal extension, so the\n * bundler emits one chunk per namespace+language and loads them on demand.\n */\nconst namespaceBackend = {\n type: \"backend\" as const,\n read(\n language: string,\n namespace: string,\n callback: (error: unknown, resources: ResourceKey | null) => void\n ): void {\n void import(`./locales/${namespace}/${language}.json`)\n .then((mod) => {\n /**\n * Each file is `{ messages: { \"a.b.c\": \"…\" } }`, not the flat object\n * directly. The wrapper exists for the bundler: Vite's JSON plugin emits\n * a *named export* per top-level key, and our keys contain dots, so\n * `export { \"a2a.audit.action\": … }` is not valid JavaScript and the\n * build fails. One level of nesting makes the only top-level key a\n * legal identifier. Keys inside stay flat, so call sites are unaffected.\n */\n const body = (mod.default ?? mod) as { messages?: ResourceKey };\n callback(null, (body.messages ?? body) as ResourceKey);\n })\n .catch((error: unknown) => callback(error, null));\n },\n};\n\n/**\n * Exported for the jest setup, which registers this same loader on\n * react-i18next's default instance. Sharing it keeps the test environment from\n * drifting away from what the app does at runtime.\n */\nexport { namespaceBackend };\n\n/**\n * Build an instance for `locale`.\n *\n * `init()` is awaited so `changeLanguage` resolves only once the namespaces the\n * caller asked for are in hand — callers use that to avoid painting keys.\n */\nexport async function createSdkI18n(locale: LatticeLocale): Promise<I18nInstance> {\n const instance = createInstance();\n\n await instance.use(namespaceBackend).init({\n lng: toI18nextLocale(locale),\n fallbackLng: \"en\",\n ns: [...NAMESPACES],\n defaultNS: NAMESPACES[0],\n /**\n * Keys are stored flat and fully qualified (\"auth.login.title\"), so there\n * is no separator for i18next to split on — splitting would look for\n * `auth` → `login` → `title` as nested objects, which is not the shape.\n */\n keySeparator: false,\n nsSeparator: false,\n interpolation: { escapeValue: false },\n // The backend is the only source; an empty `resources` would make i18next\n // treat bundled resources as authoritative and never call it.\n returnNull: false,\n });\n\n return instance;\n}\n","import { useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { TFunction as I18nextT } from \"i18next\";\nimport type { TParams, LatticeLocale } from \"@axiom-lattice/i18n\";\nimport type { TranslationKey } from \"./translationKeys\";\nimport { fromI18nextLocale, namespaceOf } from \"./instance\";\n\n/**\n * The translator the SDK hands out: same call shape as before, but the key is\n * now constrained to the keys that actually exist.\n *\n * That constraint is the whole point of M5 — it turns `t(\"auth.login.titel\")`\n * into a compile error instead of a raw key rendered to the user, which is the\n * gap the hand-rolled implementation left open (it checked the *dictionary* for\n * missing translations, never the *call site* for typos).\n */\nexport interface SdkTFunction {\n (key: TranslationKey, params?: TParams): string;\n /** Active locale. Use for `Intl.*` / `toLocaleDateString`. */\n locale: LatticeLocale;\n}\n\n/**\n * Wrap i18next's `t` in the shape the SDK's components already use.\n *\n * The public contract is unchanged — `(key, params?) => string`, plus a\n * `locale` property for the browser-native formatters — which is what keeps the\n * ~2400 call sites and every component's `import { useT } from \".../i18n\"`\n * untouched through the migration.\n *\n * The one thing this adds over i18next's own `t` is deriving the namespace from\n * the key's first segment, so `t(\"auth.login.title\")` keeps working as written\n * while i18next still loads only the `auth` namespace. See `./instance.ts`.\n */\nfunction wrap(i18nextT: I18nextT, language: string | undefined): SdkTFunction {\n const t = ((key: TranslationKey, params?: TParams): string =>\n // `ns` first so a caller's interpolation params cannot shadow it.\n i18nextT(key, { ns: namespaceOf(key), ...(params as Record<string, unknown>) })) as SdkTFunction;\n\n t.locale = fromI18nextLocale(language ?? \"en\");\n return t;\n}\n\n/**\n * Translate copy in the active locale.\n *\n * Safe with no provider above: react-i18next falls back to its default instance\n * and, failing that, renders the key rather than throwing. The SDK's test suite\n * relies on that — it renders components bare — and `src/__tests__/setup.ts`\n * initialises that default instance in English so assertions still see real copy\n * rather than keys.\n */\nexport function useT(): SdkTFunction {\n const { t, i18n } = useTranslation();\n const language = i18n?.language;\n return useMemo(() => wrap(t, language), [t, language]);\n}\n","import { createContext, useContext } from \"react\";\nimport type { LatticeLocale } from \"@axiom-lattice/i18n\";\nimport { SUPPORTED_LOCALES } from \"./instance\";\n\nexport interface LocaleBridgeValue {\n /** Active locale. */\n locale: LatticeLocale;\n /** Locales this build can render. */\n setLocale: (locale: LatticeLocale) => void;\n supportedLocales: LatticeLocale[];\n}\n\n/**\n * Bridges the locale *selection* to the component tree.\n *\n * i18next owns the translations and hands them down through `I18nextProvider`;\n * this context carries only the bits i18next has no opinion about — which\n * locales the build ships, and how a switch is initiated.\n *\n * It exists because `useLocale()` is part of the SDK's public surface (the\n * language switcher reads it) and its shape predates i18next. Keeping the shape\n * is what lets that component survive the migration untouched.\n *\n * The no-provider value is deliberately inert rather than throwing: rendered\n * with no provider, `useLocale()` reports `en-US` and a no-op setter, matching\n * how `useT()` degrades.\n */\nconst INERT_LOCALE_BRIDGE: LocaleBridgeValue = {\n locale: \"en-US\",\n setLocale: () => undefined,\n supportedLocales: SUPPORTED_LOCALES,\n};\n\n/**\n * `null` is the sentinel for \"no provider above\".\n *\n * The old default was the inert object itself, which made \"nobody has provided\n * yet\" indistinguishable from \"someone provided the inert default\" — a\n * distinction a provider that defaults on the tree's behalf needs (see\n * `AxiomLatticeProvider`, which supplies a real provider only when it is the\n * outermost). `useLocale()` below hides the sentinel, so the public contract is\n * unchanged.\n */\nexport const LocaleBridgeContext = createContext<LocaleBridgeValue | null>(null);\n\n/**\n * Read and switch the active locale.\n *\n * @example\n * const { locale, setLocale, supportedLocales } = useLocale();\n */\nexport function useLocale(): LocaleBridgeValue {\n return useContext(LocaleBridgeContext) ?? INERT_LOCALE_BRIDGE;\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { createInstance } from \"i18next\";\nimport type { i18n as I18nInstance } from \"i18next\";\nimport { I18nextProvider } from \"react-i18next\";\nimport type { Dictionary, LatticeLocale } from \"@axiom-lattice/i18n\";\nimport { NAMESPACES, SUPPORTED_LOCALES, toI18nextLocale, namespaceBackend } from \"./instance\";\nimport { LocaleBridgeContext } from \"./useLocale\";\n\nexport interface LatticeLocaleProviderProps {\n /** Active locale. Defaults to `\"en-US\"` — the source language. */\n locale?: LatticeLocale;\n /**\n * Host-supplied copy layered **over** the shipped dictionary, per locale.\n *\n * Kept from the hand-rolled provider so hosts do not change: it is applied as\n * an i18next resource bundle for that namespace-free `translation` scope.\n */\n overrides?: Partial<Record<LatticeLocale, Dictionary>>;\n /** Forwarded to `onLocaleChange` hosts that persist the choice themselves. */\n storageKey?: string;\n /** Called when the user picks a locale, before the host re-renders. */\n onLocaleChange?: (locale: LatticeLocale) => void;\n children: React.ReactNode;\n}\n\n/**\n * Supplies the SDK's i18next instance to every `useT()` below it.\n *\n * The props are the ones the hand-rolled provider had, so hosts and\n * `AgentChatApp` keep working unchanged; only the implementation moved.\n *\n * The instance is private to this provider (`createInstance`, never the default\n * export) so the SDK neither reads nor replaces its host's locale. Namespaces\n * are fetched before `children` render, which is what stops the first paint\n * from showing raw keys.\n */\nexport function LatticeLocaleProvider({\n locale = \"en-US\",\n overrides,\n storageKey,\n onLocaleChange,\n children,\n}: LatticeLocaleProviderProps): React.ReactElement | null {\n const [ready, setReady] = useState(false);\n const instance = useMemo<I18nInstance>(() => createInstance(), []);\n\n useEffect(() => {\n let cancelled = false;\n setReady(false);\n\n void instance\n .use(namespaceBackend)\n .init({\n lng: toI18nextLocale(locale),\n fallbackLng: \"en\",\n ns: [...NAMESPACES],\n defaultNS: NAMESPACES[0],\n // Dictionaries are stored flat and fully qualified, so there is no\n // separator to split on. See ./instance.ts.\n keySeparator: false,\n nsSeparator: false,\n interpolation: { escapeValue: false },\n resources: overrides\n ? {\n [toI18nextLocale(locale)]: {\n [NAMESPACES[0]]: (overrides[locale] ?? {}) as Record<string, string>,\n },\n }\n : undefined,\n })\n .then(() => instance.loadNamespaces([...NAMESPACES]))\n .then(() => {\n if (!cancelled) setReady(true);\n })\n .catch(() => {\n // A namespace that fails to load must not blank the app; render with\n // whatever arrived and let missing keys fall back to their key text.\n if (!cancelled) setReady(true);\n });\n\n return () => {\n cancelled = true;\n };\n }, [instance, locale, overrides]);\n\n /**\n * Switching is delegated, not handled here.\n *\n * The provider cannot swap locale in place — the dictionaries for the new\n * locale have not been fetched — so the host decides what happens: it stores\n * the choice and reloads, and the reload re-enters this component with the\n * new `locale`. That mirrors the hand-rolled provider, whose `setLocale` also\n * only persisted and notified.\n */\n const bridge = useMemo(\n () => ({\n locale,\n supportedLocales: SUPPORTED_LOCALES,\n setLocale: (next: LatticeLocale) => {\n if (!SUPPORTED_LOCALES.includes(next)) return;\n if (storageKey && typeof window !== \"undefined\") {\n try {\n window.localStorage.setItem(storageKey, next);\n } catch {\n // Private mode / disabled storage: the switch still notifies the\n // host, it just will not survive a reload.\n }\n }\n onLocaleChange?.(next);\n },\n }),\n [locale, storageKey, onLocaleChange]\n );\n\n if (!ready) return null;\n\n return (\n <LocaleBridgeContext.Provider value={bridge}>\n <I18nextProvider i18n={instance}>{children}</I18nextProvider>\n </LocaleBridgeContext.Provider>\n );\n}\n","import type { LatticeLocale } from \"@axiom-lattice/i18n\";\nimport { SUPPORTED_LOCALES } from \"./instance\";\n\n/**\n * `localStorage` key the SDK persists the locale choice under.\n *\n * Shared with the first-party apps (`apps/web`, `apps/cli-web`) so the locale\n * layer the SDK supplies by default and those hosts agree on the stored value.\n */\nexport const DEFAULT_LOCALE_STORAGE_KEY = \"lattice.locale\";\n\n/**\n * Read the persisted locale, tolerating absent storage.\n *\n * Guarded for SSR and for private-mode browsers, where touching `localStorage`\n * throws. An unrecognised stored value is ignored rather than trusted — the\n * same whitelist the first-party apps apply.\n */\nexport function readStoredLocale(\n storageKey: string = DEFAULT_LOCALE_STORAGE_KEY\n): LatticeLocale | undefined {\n if (typeof window === \"undefined\") return undefined;\n try {\n const stored = window.localStorage.getItem(storageKey);\n return stored !== null && (SUPPORTED_LOCALES as readonly string[]).includes(stored)\n ? (stored as LatticeLocale)\n : undefined;\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;AAuBA,SAAS,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKxB,IAAM,oBAAqC,CAAC,SAAS,OAAO;AAG5D,SAAS,gBAAgB,QAA+B;AAC7D,SAAO,WAAW,UAAU,OAAO;AACrC;AAEO,SAAS,kBAAkB,UAAiC;AACjE,SAAO,SAAS,WAAW,IAAI,IAAI,UAAU;AAC/C;AASO,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQxB;AAAA,EACA;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAc;AAAA,EAAQ;AAAA,EAAc;AAAA,EAAY;AAAA,EAC/D;AAAA,EAAW;AAAA,EAAY;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAc;AAAA,EAAe;AAAA,EACrE;AAAA,EAAa;AAAA,EAAe;AAAA,EAAS;AACvC;AASO,SAAS,YAAY,KAAqB;AAC/C,QAAM,CAAC,IAAI,IAAI,IAAI,MAAM,GAAG;AAC5B,SAAQ,WAAiC,SAAS,IAAI,IAAI,OAAO,WAAW,CAAC;AAC/E;AAUA,IAAM,mBAAmB;AAAA,EACvB,MAAM;AAAA,EACN,KACE,UACA,WACA,UACM;AACN,SAAY,qCAAa,SAAS,IAAI,QAAQ,SAC3C,KAAK,CAAC,QAAQ;AASb,YAAM,OAAQ,IAAI,WAAW;AAC7B,eAAS,MAAO,KAAK,YAAY,IAAoB;AAAA,IACvD,CAAC,EACA,MAAM,CAAC,UAAmB,SAAS,OAAO,IAAI,CAAC;AAAA,EACpD;AACF;;;ACtGA,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAiC/B,SAAS,KAAK,UAAoB,UAA4C;AAC5E,QAAM,KAAK,CAAC,KAAqB;AAAA;AAAA,IAE/B,SAAS,KAAK,EAAE,IAAI,YAAY,GAAG,GAAG,GAAI,OAAmC,CAAC;AAAA;AAEhF,IAAE,SAAS,kBAAkB,YAAY,IAAI;AAC7C,SAAO;AACT;AAWO,SAAS,OAAqB;AACnC,QAAM,EAAE,GAAG,KAAK,IAAI,eAAe;AACnC,QAAM,WAAW,MAAM;AACvB,SAAO,QAAQ,MAAM,KAAK,GAAG,QAAQ,GAAG,CAAC,GAAG,QAAQ,CAAC;AACvD;;;ACxDA,SAAS,eAAe,kBAAkB;AA2B1C,IAAM,sBAAyC;AAAA,EAC7C,QAAQ;AAAA,EACR,WAAW,MAAM;AAAA,EACjB,kBAAkB;AACpB;AAYO,IAAM,sBAAsB,cAAwC,IAAI;AAQxE,SAAS,YAA+B;AAC7C,SAAO,WAAW,mBAAmB,KAAK;AAC5C;;;ACrDA,SAAgB,WAAW,WAAAA,UAAS,gBAAgB;AACpD,SAAS,kBAAAC,uBAAsB;AAE/B,SAAS,uBAAuB;AAmH1B;AAlFC,SAAS,sBAAsB;AAAA,EACpC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0D;AACxD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,KAAK;AACxC,QAAM,WAAWC,SAAsB,MAAMC,gBAAe,GAAG,CAAC,CAAC;AAEjE,YAAU,MAAM;AACd,QAAI,YAAY;AAChB,aAAS,KAAK;AAEd,SAAK,SACF,IAAI,gBAAgB,EACpB,KAAK;AAAA,MACJ,KAAK,gBAAgB,MAAM;AAAA,MAC3B,aAAa;AAAA,MACb,IAAI,CAAC,GAAG,UAAU;AAAA,MAClB,WAAW,WAAW,CAAC;AAAA;AAAA;AAAA,MAGvB,cAAc;AAAA,MACd,aAAa;AAAA,MACb,eAAe,EAAE,aAAa,MAAM;AAAA,MACpC,WAAW,YACP;AAAA,QACE,CAAC,gBAAgB,MAAM,CAAC,GAAG;AAAA,UACzB,CAAC,WAAW,CAAC,CAAC,GAAI,UAAU,MAAM,KAAK,CAAC;AAAA,QAC1C;AAAA,MACF,IACA;AAAA,IACN,CAAC,EACA,KAAK,MAAM,SAAS,eAAe,CAAC,GAAG,UAAU,CAAC,CAAC,EACnD,KAAK,MAAM;AACV,UAAI,CAAC,UAAW,UAAS,IAAI;AAAA,IAC/B,CAAC,EACA,MAAM,MAAM;AAGX,UAAI,CAAC,UAAW,UAAS,IAAI;AAAA,IAC/B,CAAC;AAEH,WAAO,MAAM;AACX,kBAAY;AAAA,IACd;AAAA,EACF,GAAG,CAAC,UAAU,QAAQ,SAAS,CAAC;AAWhC,QAAM,SAASD;AAAA,IACb,OAAO;AAAA,MACL;AAAA,MACA,kBAAkB;AAAA,MAClB,WAAW,CAAC,SAAwB;AAClC,YAAI,CAAC,kBAAkB,SAAS,IAAI,EAAG;AACvC,YAAI,cAAc,OAAO,WAAW,aAAa;AAC/C,cAAI;AACF,mBAAO,aAAa,QAAQ,YAAY,IAAI;AAAA,UAC9C,QAAQ;AAAA,UAGR;AAAA,QACF;AACA,yBAAiB,IAAI;AAAA,MACvB;AAAA,IACF;AAAA,IACA,CAAC,QAAQ,YAAY,cAAc;AAAA,EACrC;AAEA,MAAI,CAAC,MAAO,QAAO;AAEnB,SACE,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,QACnC,8BAAC,mBAAgB,MAAM,UAAW,UAAS,GAC7C;AAEJ;;;AChHO,IAAM,6BAA6B;AASnC,SAAS,iBACd,aAAqB,4BACM;AAC3B,MAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,MAAI;AACF,UAAM,SAAS,OAAO,aAAa,QAAQ,UAAU;AACrD,WAAO,WAAW,QAAS,kBAAwC,SAAS,MAAM,IAC7E,SACD;AAAA,EACN,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":["useMemo","createInstance","useMemo","createInstance"]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DEFAULT_LOCALE_STORAGE_KEY,
|
|
3
|
+
LatticeLocaleProvider,
|
|
4
|
+
LocaleBridgeContext,
|
|
5
|
+
readStoredLocale,
|
|
2
6
|
useT
|
|
3
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PEEXMLMK.mjs";
|
|
4
8
|
|
|
5
9
|
// src/utils/authStorage.ts
|
|
6
10
|
var AUTH_KEYS = [
|
|
@@ -66,21 +70,65 @@ function clearAuthItems() {
|
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
// src/context/AuthContext.tsx
|
|
69
|
-
import { createContext, useContext, useState, useCallback, useEffect, useRef } from "react";
|
|
70
|
-
|
|
73
|
+
import { createContext, useContext as useContext2, useState, useCallback, useEffect, useRef } from "react";
|
|
74
|
+
|
|
75
|
+
// src/i18n/LocaleLayerIfAbsent.tsx
|
|
76
|
+
import { useContext, useMemo } from "react";
|
|
77
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
78
|
+
function LocaleLayerIfAbsent({
|
|
79
|
+
locale,
|
|
80
|
+
storageKey = DEFAULT_LOCALE_STORAGE_KEY,
|
|
81
|
+
onLocaleChange,
|
|
82
|
+
children
|
|
83
|
+
}) {
|
|
84
|
+
const providedAbove = useContext(LocaleBridgeContext) !== null;
|
|
85
|
+
const initialLocale = useMemo(
|
|
86
|
+
() => locale ?? readStoredLocale(storageKey) ?? "en-US",
|
|
87
|
+
[locale, storageKey]
|
|
88
|
+
);
|
|
89
|
+
const handleLocaleChange = useMemo(
|
|
90
|
+
() => onLocaleChange ?? (() => {
|
|
91
|
+
if (typeof window !== "undefined") window.location.reload();
|
|
92
|
+
}),
|
|
93
|
+
[onLocaleChange]
|
|
94
|
+
);
|
|
95
|
+
if (providedAbove) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
LatticeLocaleProvider,
|
|
98
|
+
{
|
|
99
|
+
locale: initialLocale,
|
|
100
|
+
storageKey,
|
|
101
|
+
onLocaleChange: handleLocaleChange,
|
|
102
|
+
children
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// src/context/AuthContext.tsx
|
|
108
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
71
109
|
var AuthContext = createContext(null);
|
|
72
110
|
var useAuth = () => {
|
|
73
|
-
const context =
|
|
111
|
+
const context = useContext2(AuthContext);
|
|
74
112
|
if (!context) {
|
|
75
113
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
76
114
|
}
|
|
77
115
|
return context;
|
|
78
116
|
};
|
|
79
117
|
var useAuthOptional = () => {
|
|
80
|
-
const context =
|
|
118
|
+
const context = useContext2(AuthContext);
|
|
81
119
|
return context;
|
|
82
120
|
};
|
|
83
|
-
var AuthProvider = (
|
|
121
|
+
var AuthProvider = (props) => (
|
|
122
|
+
/* The locale layer sits above the inner provider on purpose: this component
|
|
123
|
+
* calls useT() for its own error copy (see below), so a layer rendered inside
|
|
124
|
+
* its return value would not reach that call. One layer here covers every
|
|
125
|
+
* auth screen: LoginForm/RegisterForm/TenantSelector all require this
|
|
126
|
+
* provider — useAuth() throws without it — and none of them mounts a locale
|
|
127
|
+
* provider of its own, so without this the whole logged-out screen paints raw
|
|
128
|
+
* keys. */
|
|
129
|
+
/* @__PURE__ */ jsx2(LocaleLayerIfAbsent, { children: /* @__PURE__ */ jsx2(AuthProviderInner, { ...props }) })
|
|
130
|
+
);
|
|
131
|
+
var AuthProviderInner = ({
|
|
84
132
|
children,
|
|
85
133
|
baseURL,
|
|
86
134
|
onLoginSuccess,
|
|
@@ -386,7 +434,7 @@ var AuthProvider = ({
|
|
|
386
434
|
clearError,
|
|
387
435
|
changePassword
|
|
388
436
|
};
|
|
389
|
-
return /* @__PURE__ */
|
|
437
|
+
return /* @__PURE__ */ jsx2(AuthContext.Provider, { value, children });
|
|
390
438
|
};
|
|
391
439
|
|
|
392
440
|
// src/context.tsx
|
|
@@ -394,13 +442,13 @@ import { App } from "antd";
|
|
|
394
442
|
import {
|
|
395
443
|
createContext as createContext2,
|
|
396
444
|
useCallback as useCallback2,
|
|
397
|
-
useContext as
|
|
445
|
+
useContext as useContext3,
|
|
398
446
|
useEffect as useEffect2,
|
|
399
|
-
useMemo,
|
|
447
|
+
useMemo as useMemo2,
|
|
400
448
|
useRef as useRef2
|
|
401
449
|
} from "react";
|
|
402
450
|
import { Client } from "@axiom-lattice/client-sdk";
|
|
403
|
-
import { jsx as
|
|
451
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
404
452
|
var AxiomLatticeContext = createContext2({
|
|
405
453
|
getClient: () => {
|
|
406
454
|
throw new Error("getClient must be used within AxiomLatticeProvider");
|
|
@@ -410,18 +458,21 @@ function AxiomLatticeProvider({
|
|
|
410
458
|
config,
|
|
411
459
|
onUnauthorized,
|
|
412
460
|
createClient,
|
|
461
|
+
locale,
|
|
462
|
+
storageKey = DEFAULT_LOCALE_STORAGE_KEY,
|
|
463
|
+
onLocaleChange,
|
|
413
464
|
children
|
|
414
465
|
}) {
|
|
415
|
-
const authContext =
|
|
466
|
+
const authContext = useContext3(AuthContext);
|
|
416
467
|
const tenantId = authContext?.currentTenant?.id;
|
|
417
|
-
const effectiveApiKey =
|
|
468
|
+
const effectiveApiKey = useMemo2(() => {
|
|
418
469
|
if (authContext?.isAuthenticated) {
|
|
419
470
|
return readAuthItem("lattice_token") || config.apiKey;
|
|
420
471
|
}
|
|
421
472
|
return config.apiKey;
|
|
422
473
|
}, [authContext?.isAuthenticated, authContext?.currentTenant?.id, config.apiKey]);
|
|
423
474
|
const clientCacheRef = useRef2(/* @__PURE__ */ new Map());
|
|
424
|
-
const baseConfig =
|
|
475
|
+
const baseConfig = useMemo2(
|
|
425
476
|
() => ({
|
|
426
477
|
baseURL: config.baseURL,
|
|
427
478
|
apiKey: effectiveApiKey,
|
|
@@ -431,7 +482,7 @@ function AxiomLatticeProvider({
|
|
|
431
482
|
}),
|
|
432
483
|
[config.baseURL, effectiveApiKey, config.transport]
|
|
433
484
|
);
|
|
434
|
-
const baseClient =
|
|
485
|
+
const baseClient = useMemo2(() => {
|
|
435
486
|
const client = createClient ? createClient(baseConfig) : new Client(baseConfig);
|
|
436
487
|
if (tenantId) {
|
|
437
488
|
client.setTenantId(tenantId);
|
|
@@ -464,27 +515,35 @@ function AxiomLatticeProvider({
|
|
|
464
515
|
},
|
|
465
516
|
[baseClient]
|
|
466
517
|
);
|
|
467
|
-
const value =
|
|
518
|
+
const value = useMemo2(
|
|
468
519
|
() => ({
|
|
469
520
|
getClient
|
|
470
521
|
}),
|
|
471
522
|
[getClient]
|
|
472
523
|
);
|
|
473
|
-
return /* @__PURE__ */
|
|
524
|
+
return /* @__PURE__ */ jsx3(App, { component: false, children: /* @__PURE__ */ jsx3(
|
|
525
|
+
LocaleLayerIfAbsent,
|
|
526
|
+
{
|
|
527
|
+
locale,
|
|
528
|
+
storageKey,
|
|
529
|
+
onLocaleChange,
|
|
530
|
+
children: /* @__PURE__ */ jsx3(AxiomLatticeContext.Provider, { value, children })
|
|
531
|
+
}
|
|
532
|
+
) });
|
|
474
533
|
}
|
|
475
534
|
function useClient(assistantId) {
|
|
476
|
-
const context =
|
|
535
|
+
const context = useContext3(AxiomLatticeContext);
|
|
477
536
|
if (!context) {
|
|
478
537
|
throw new Error(
|
|
479
538
|
"useClient must be used within an AxiomLatticeProvider"
|
|
480
539
|
);
|
|
481
540
|
}
|
|
482
|
-
return
|
|
541
|
+
return useMemo2(() => context.getClient(assistantId), [context, assistantId]);
|
|
483
542
|
}
|
|
484
543
|
function useAxiomLattice({
|
|
485
544
|
assistantId
|
|
486
545
|
} = {}) {
|
|
487
|
-
const context =
|
|
546
|
+
const context = useContext3(AxiomLatticeContext);
|
|
488
547
|
if (!context) {
|
|
489
548
|
throw new Error(
|
|
490
549
|
"useAxiomLattice must be used within an AxiomLatticeProvider"
|
|
@@ -495,17 +554,17 @@ function useAxiomLattice({
|
|
|
495
554
|
"useAxiomLattice requires assistantId parameter. Use useClient(assistantId) instead."
|
|
496
555
|
);
|
|
497
556
|
}
|
|
498
|
-
return
|
|
557
|
+
return useMemo2(() => context.getClient(assistantId), [context, assistantId]);
|
|
499
558
|
}
|
|
500
559
|
|
|
501
560
|
// src/components/Chat/LatticeChatShellContext.tsx
|
|
502
561
|
import {
|
|
503
562
|
createContext as createContext3,
|
|
504
563
|
useCallback as useCallback3,
|
|
505
|
-
useContext as
|
|
564
|
+
useContext as useContext4,
|
|
506
565
|
useState as useState3
|
|
507
566
|
} from "react";
|
|
508
|
-
import { jsx as
|
|
567
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
509
568
|
var DEFAULT_MIDDLEWARE_TYPES = [
|
|
510
569
|
{
|
|
511
570
|
type: "filesystem",
|
|
@@ -1054,7 +1113,7 @@ var LatticeChatShellContextProvider = ({
|
|
|
1054
1113
|
setConfig(defaultConfig);
|
|
1055
1114
|
saveToLocalStorage(defaultConfig);
|
|
1056
1115
|
}, [initialConfig, saveToLocalStorage]);
|
|
1057
|
-
return /* @__PURE__ */
|
|
1116
|
+
return /* @__PURE__ */ jsx4(
|
|
1058
1117
|
LatticeChatShellContext.Provider,
|
|
1059
1118
|
{
|
|
1060
1119
|
value: {
|
|
@@ -1070,7 +1129,7 @@ var LatticeChatShellContextProvider = ({
|
|
|
1070
1129
|
);
|
|
1071
1130
|
};
|
|
1072
1131
|
var useLatticeChatShellContext = () => {
|
|
1073
|
-
const context =
|
|
1132
|
+
const context = useContext4(LatticeChatShellContext);
|
|
1074
1133
|
if (!context) {
|
|
1075
1134
|
throw new Error(
|
|
1076
1135
|
"useLatticeChatShellContext must be used within a LatticeChatShellContextProvider"
|
|
@@ -1155,7 +1214,7 @@ import {
|
|
|
1155
1214
|
} from "antd";
|
|
1156
1215
|
import { PlusOutlined } from "@ant-design/icons";
|
|
1157
1216
|
import { theme } from "antd";
|
|
1158
|
-
import { jsx as
|
|
1217
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
1159
1218
|
var { TextArea } = Input;
|
|
1160
1219
|
var { Text } = Typography;
|
|
1161
1220
|
var CreateSkillModal = ({
|
|
@@ -1257,7 +1316,7 @@ var CreateSkillModal = ({
|
|
|
1257
1316
|
const handleAddMetadataRow = () => {
|
|
1258
1317
|
setMetadataRows([...metadataRows, { key: "", value: "" }]);
|
|
1259
1318
|
};
|
|
1260
|
-
return /* @__PURE__ */
|
|
1319
|
+
return /* @__PURE__ */ jsx5(
|
|
1261
1320
|
Modal,
|
|
1262
1321
|
{
|
|
1263
1322
|
title: isEdit ? t("chatConfig.skill.edit.title") : t("chatConfig.skill.create.title"),
|
|
@@ -1269,7 +1328,7 @@ var CreateSkillModal = ({
|
|
|
1269
1328
|
styles: {
|
|
1270
1329
|
body: { padding: 16 }
|
|
1271
1330
|
},
|
|
1272
|
-
children: /* @__PURE__ */
|
|
1331
|
+
children: /* @__PURE__ */ jsx5(
|
|
1273
1332
|
Form,
|
|
1274
1333
|
{
|
|
1275
1334
|
form,
|
|
@@ -1286,8 +1345,8 @@ var CreateSkillModal = ({
|
|
|
1286
1345
|
},
|
|
1287
1346
|
children: [
|
|
1288
1347
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
1289
|
-
/* @__PURE__ */
|
|
1290
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ jsx5(Text, { style: { fontSize: 12, color: token.colorTextSecondary }, children: t("chatConfig.skill.field.name") }),
|
|
1349
|
+
/* @__PURE__ */ jsx5(
|
|
1291
1350
|
Form.Item,
|
|
1292
1351
|
{
|
|
1293
1352
|
name: "name",
|
|
@@ -1300,13 +1359,13 @@ var CreateSkillModal = ({
|
|
|
1300
1359
|
{ min: 1, max: 64, message: t("chatConfig.skill.validation.nameLength") }
|
|
1301
1360
|
],
|
|
1302
1361
|
style: { marginBottom: 0 },
|
|
1303
|
-
children: /* @__PURE__ */
|
|
1362
|
+
children: /* @__PURE__ */ jsx5(Input, { placeholder: "e.g., data-analysis", disabled: isEdit })
|
|
1304
1363
|
}
|
|
1305
1364
|
)
|
|
1306
1365
|
] }),
|
|
1307
1366
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
/* @__PURE__ */
|
|
1367
|
+
/* @__PURE__ */ jsx5(Text, { style: { fontSize: 12, color: token.colorTextSecondary }, children: t("chatConfig.skill.field.description") }),
|
|
1368
|
+
/* @__PURE__ */ jsx5(
|
|
1310
1369
|
Form.Item,
|
|
1311
1370
|
{
|
|
1312
1371
|
name: "description",
|
|
@@ -1314,7 +1373,7 @@ var CreateSkillModal = ({
|
|
|
1314
1373
|
{ required: true, message: t("chatConfig.skill.validation.descriptionRequired") }
|
|
1315
1374
|
],
|
|
1316
1375
|
style: { marginBottom: 0 },
|
|
1317
|
-
children: /* @__PURE__ */
|
|
1376
|
+
children: /* @__PURE__ */ jsx5(
|
|
1318
1377
|
TextArea,
|
|
1319
1378
|
{
|
|
1320
1379
|
placeholder: t("chatConfig.skill.placeholder.description"),
|
|
@@ -1325,12 +1384,12 @@ var CreateSkillModal = ({
|
|
|
1325
1384
|
)
|
|
1326
1385
|
] }),
|
|
1327
1386
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1387
|
+
/* @__PURE__ */ jsx5(Text, { style: { fontSize: 12, color: token.colorTextSecondary }, children: t("chatConfig.skill.field.license") }),
|
|
1388
|
+
/* @__PURE__ */ jsx5(Form.Item, { name: "license", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx5(Input, { placeholder: t("chatConfig.skill.placeholder.license") }) })
|
|
1330
1389
|
] }),
|
|
1331
1390
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
1332
|
-
/* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ jsx5(Text, { style: { fontSize: 12, color: token.colorTextSecondary }, children: t("chatConfig.skill.field.compatibility") }),
|
|
1392
|
+
/* @__PURE__ */ jsx5(Form.Item, { name: "compatibility", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx5(Input, { placeholder: t("chatConfig.skill.placeholder.compatibility") }) })
|
|
1334
1393
|
] }),
|
|
1335
1394
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
1336
1395
|
/* @__PURE__ */ jsxs(
|
|
@@ -1343,7 +1402,7 @@ var CreateSkillModal = ({
|
|
|
1343
1402
|
gap: 8
|
|
1344
1403
|
},
|
|
1345
1404
|
children: [
|
|
1346
|
-
/* @__PURE__ */
|
|
1405
|
+
/* @__PURE__ */ jsx5(
|
|
1347
1406
|
Text,
|
|
1348
1407
|
{
|
|
1349
1408
|
style: {
|
|
@@ -1354,11 +1413,11 @@ var CreateSkillModal = ({
|
|
|
1354
1413
|
children: t("chatConfig.skill.field.metadata")
|
|
1355
1414
|
}
|
|
1356
1415
|
),
|
|
1357
|
-
/* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ jsx5(
|
|
1358
1417
|
Button,
|
|
1359
1418
|
{
|
|
1360
1419
|
size: "small",
|
|
1361
|
-
icon: /* @__PURE__ */
|
|
1420
|
+
icon: /* @__PURE__ */ jsx5(PlusOutlined, {}),
|
|
1362
1421
|
onClick: handleAddMetadataRow,
|
|
1363
1422
|
children: t("chatConfig.skill.metadata.add")
|
|
1364
1423
|
}
|
|
@@ -1367,7 +1426,7 @@ var CreateSkillModal = ({
|
|
|
1367
1426
|
}
|
|
1368
1427
|
),
|
|
1369
1428
|
/* @__PURE__ */ jsxs(Space, { direction: "vertical", size: 8, style: { width: "100%" }, children: [
|
|
1370
|
-
metadataRows.length === 0 && /* @__PURE__ */
|
|
1429
|
+
metadataRows.length === 0 && /* @__PURE__ */ jsx5(
|
|
1371
1430
|
Text,
|
|
1372
1431
|
{
|
|
1373
1432
|
style: {
|
|
@@ -1387,7 +1446,7 @@ var CreateSkillModal = ({
|
|
|
1387
1446
|
width: "100%"
|
|
1388
1447
|
},
|
|
1389
1448
|
children: [
|
|
1390
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ jsx5(
|
|
1391
1450
|
Text,
|
|
1392
1451
|
{
|
|
1393
1452
|
style: { fontSize: 11, color: token.colorTextSecondary },
|
|
@@ -1395,7 +1454,7 @@ var CreateSkillModal = ({
|
|
|
1395
1454
|
}
|
|
1396
1455
|
),
|
|
1397
1456
|
/* @__PURE__ */ jsxs(Space, { style: { width: "100%" }, size: 8, wrap: true, children: [
|
|
1398
|
-
/* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ jsx5(
|
|
1399
1458
|
Input,
|
|
1400
1459
|
{
|
|
1401
1460
|
value: row.key,
|
|
@@ -1404,7 +1463,7 @@ var CreateSkillModal = ({
|
|
|
1404
1463
|
onChange: (e) => handleMetadataChange(index, "key", e.target.value)
|
|
1405
1464
|
}
|
|
1406
1465
|
),
|
|
1407
|
-
/* @__PURE__ */
|
|
1466
|
+
/* @__PURE__ */ jsx5(
|
|
1408
1467
|
Input,
|
|
1409
1468
|
{
|
|
1410
1469
|
value: row.value,
|
|
@@ -1421,8 +1480,8 @@ var CreateSkillModal = ({
|
|
|
1421
1480
|
] })
|
|
1422
1481
|
] }),
|
|
1423
1482
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ jsx5(Text, { style: { fontSize: 12, color: token.colorTextSecondary }, children: t("chatConfig.skill.field.content") }),
|
|
1484
|
+
/* @__PURE__ */ jsx5(Form.Item, { name: "content", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsx5(
|
|
1426
1485
|
TextArea,
|
|
1427
1486
|
{
|
|
1428
1487
|
placeholder: t("chatConfig.skill.placeholder.content"),
|
|
@@ -1441,8 +1500,8 @@ var CreateSkillModal = ({
|
|
|
1441
1500
|
marginTop: 8
|
|
1442
1501
|
},
|
|
1443
1502
|
children: [
|
|
1444
|
-
/* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ jsx5(Button, { onClick: handleCancel, children: t("common.cancel") }),
|
|
1504
|
+
/* @__PURE__ */ jsx5(Button, { type: "primary", htmlType: "submit", loading, children: isEdit ? t("chatConfig.skill.action.save") : t("chatConfig.skill.action.create") })
|
|
1446
1505
|
]
|
|
1447
1506
|
}
|
|
1448
1507
|
)
|
|
@@ -1463,6 +1522,7 @@ export {
|
|
|
1463
1522
|
writeAuthItem,
|
|
1464
1523
|
removeAuthItem,
|
|
1465
1524
|
clearAuthItems,
|
|
1525
|
+
LocaleLayerIfAbsent,
|
|
1466
1526
|
useAuth,
|
|
1467
1527
|
useAuthOptional,
|
|
1468
1528
|
AuthProvider,
|
|
@@ -1477,4 +1537,4 @@ export {
|
|
|
1477
1537
|
CreateSkillModal,
|
|
1478
1538
|
CreateSkillModal_default
|
|
1479
1539
|
};
|
|
1480
|
-
//# sourceMappingURL=chunk-
|
|
1540
|
+
//# sourceMappingURL=chunk-RDC4ZHXF.mjs.map
|