@blade-hq/agent-react 2612.0.0-beta.40 → 2612.0.0-beta.43
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/chat/WorkflowRunBlock.d.ts +3 -0
- package/dist/{chunk-5S4H3CJD.js → chunk-42P352DI.js} +843 -495
- package/dist/chunk-42P352DI.js.map +1 -0
- package/dist/{chunk-KUZPP6OU.js → chunk-S3AC4DZF.js} +2 -2
- package/dist/{chunk-5X6RBFGB.js → chunk-TB2MEMX6.js} +23 -8
- package/dist/{chunk-5X6RBFGB.js.map → chunk-TB2MEMX6.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/internal.js +3 -3
- package/dist/rich-input/ConnectButton.d.ts +3 -1
- package/dist/rich-input/InputActionSubmenu.d.ts +10 -0
- package/dist/rich-input/SkillActionMenu.d.ts +10 -0
- package/dist/rich-input/index.d.ts +2 -0
- package/dist/rich-input.js +553 -717
- package/dist/rich-input.js.map +1 -1
- package/dist/style.full.css +1 -1
- package/package.json +2 -2
- package/dist/chunk-5S4H3CJD.js.map +0 -1
- /package/dist/{chunk-KUZPP6OU.js.map → chunk-S3AC4DZF.js.map} +0 -0
|
@@ -2659,7 +2659,7 @@ var createLruCache = (maxCacheSize) => {
|
|
|
2659
2659
|
let cacheSize = 0;
|
|
2660
2660
|
let cache = /* @__PURE__ */ Object.create(null);
|
|
2661
2661
|
let previousCache = /* @__PURE__ */ Object.create(null);
|
|
2662
|
-
const
|
|
2662
|
+
const update2 = (key, value) => {
|
|
2663
2663
|
cache[key] = value;
|
|
2664
2664
|
cacheSize++;
|
|
2665
2665
|
if (cacheSize > maxCacheSize) {
|
|
@@ -2675,7 +2675,7 @@ var createLruCache = (maxCacheSize) => {
|
|
|
2675
2675
|
return value;
|
|
2676
2676
|
}
|
|
2677
2677
|
if ((value = previousCache[key]) !== void 0) {
|
|
2678
|
-
|
|
2678
|
+
update2(key, value);
|
|
2679
2679
|
return value;
|
|
2680
2680
|
}
|
|
2681
2681
|
},
|
|
@@ -2683,7 +2683,7 @@ var createLruCache = (maxCacheSize) => {
|
|
|
2683
2683
|
if (key in cache) {
|
|
2684
2684
|
cache[key] = value;
|
|
2685
2685
|
} else {
|
|
2686
|
-
|
|
2686
|
+
update2(key, value);
|
|
2687
2687
|
}
|
|
2688
2688
|
}
|
|
2689
2689
|
};
|
|
@@ -6171,6 +6171,463 @@ function BrowserConnectionDialog({ client, name, label = "\u4E1A\u52A1\u8D26\u53
|
|
|
6171
6171
|
] }) });
|
|
6172
6172
|
}
|
|
6173
6173
|
|
|
6174
|
+
// src/chat/runtime/input-services.tsx
|
|
6175
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
6176
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
6177
|
+
function parseModelReasoningLevels(value) {
|
|
6178
|
+
if (!value) return {};
|
|
6179
|
+
try {
|
|
6180
|
+
const parsed = JSON.parse(value);
|
|
6181
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
6182
|
+
return Object.fromEntries(
|
|
6183
|
+
Object.entries(parsed).filter(
|
|
6184
|
+
(entry) => Boolean(entry[0]) && typeof entry[1] === "string" && Boolean(entry[1])
|
|
6185
|
+
)
|
|
6186
|
+
);
|
|
6187
|
+
} catch {
|
|
6188
|
+
return {};
|
|
6189
|
+
}
|
|
6190
|
+
}
|
|
6191
|
+
var RichInputServicesContext = createContext2({});
|
|
6192
|
+
function RichInputServicesProvider({ value, children }) {
|
|
6193
|
+
return /* @__PURE__ */ jsx4(RichInputServicesContext.Provider, { value, children });
|
|
6194
|
+
}
|
|
6195
|
+
function useRichInputServices() {
|
|
6196
|
+
return useContext2(RichInputServicesContext);
|
|
6197
|
+
}
|
|
6198
|
+
|
|
6199
|
+
// src/rich-input/lib/client-query.ts
|
|
6200
|
+
import { useCallback, useEffect as useEffect3, useSyncExternalStore } from "react";
|
|
6201
|
+
var EMPTY = { data: void 0, error: null, isLoading: false, isFetching: false };
|
|
6202
|
+
var caches = /* @__PURE__ */ new WeakMap();
|
|
6203
|
+
function entryFor(client, key) {
|
|
6204
|
+
let cache = caches.get(client);
|
|
6205
|
+
if (!cache) {
|
|
6206
|
+
const created = /* @__PURE__ */ new Map();
|
|
6207
|
+
cache = created;
|
|
6208
|
+
caches.set(client, created);
|
|
6209
|
+
onInputCachesReset(client, () => {
|
|
6210
|
+
for (const [key2, entry2] of created) {
|
|
6211
|
+
entry2.request = null;
|
|
6212
|
+
entry2.fetchedAt = 0;
|
|
6213
|
+
update(entry2, EMPTY);
|
|
6214
|
+
const load = loadersFor(client).get(key2);
|
|
6215
|
+
if (load && entry2.listeners.size > 0) void fetchClientQuery(client, key2, load, { force: true }).catch(() => {
|
|
6216
|
+
});
|
|
6217
|
+
}
|
|
6218
|
+
});
|
|
6219
|
+
}
|
|
6220
|
+
let entry = cache.get(key);
|
|
6221
|
+
if (!entry) {
|
|
6222
|
+
entry = { snapshot: EMPTY, fetchedAt: 0, request: null, listeners: /* @__PURE__ */ new Set() };
|
|
6223
|
+
cache.set(key, entry);
|
|
6224
|
+
}
|
|
6225
|
+
return entry;
|
|
6226
|
+
}
|
|
6227
|
+
function update(entry, patch) {
|
|
6228
|
+
entry.snapshot = { ...entry.snapshot, ...patch };
|
|
6229
|
+
for (const listener of [...entry.listeners]) listener();
|
|
6230
|
+
}
|
|
6231
|
+
function fetchClientQuery(client, key, load, { staleMs = 3e4, force = false } = {}) {
|
|
6232
|
+
const entry = entryFor(client, key);
|
|
6233
|
+
if (entry.request) return entry.request;
|
|
6234
|
+
if (!force && entry.snapshot.data !== void 0 && Date.now() - entry.fetchedAt < staleMs) {
|
|
6235
|
+
return Promise.resolve(entry.snapshot.data);
|
|
6236
|
+
}
|
|
6237
|
+
const request = Promise.resolve().then(() => load(client));
|
|
6238
|
+
entry.request = request;
|
|
6239
|
+
update(entry, { isFetching: true, isLoading: entry.snapshot.data === void 0 });
|
|
6240
|
+
request.then(
|
|
6241
|
+
(data) => {
|
|
6242
|
+
if (entry.request !== request) return;
|
|
6243
|
+
entry.request = null;
|
|
6244
|
+
entry.fetchedAt = Date.now();
|
|
6245
|
+
update(entry, { data, error: null, isFetching: false, isLoading: false });
|
|
6246
|
+
},
|
|
6247
|
+
(error) => {
|
|
6248
|
+
if (entry.request !== request) return;
|
|
6249
|
+
entry.request = null;
|
|
6250
|
+
update(entry, { error, isFetching: false, isLoading: false });
|
|
6251
|
+
}
|
|
6252
|
+
);
|
|
6253
|
+
return request;
|
|
6254
|
+
}
|
|
6255
|
+
function setClientQueryData(client, key, updater) {
|
|
6256
|
+
const entry = entryFor(client, key);
|
|
6257
|
+
if (entry.snapshot.data === void 0) return;
|
|
6258
|
+
update(entry, { data: updater(entry.snapshot.data) });
|
|
6259
|
+
}
|
|
6260
|
+
function useClientQuery(key, load, { staleMs = 3e4 } = {}) {
|
|
6261
|
+
const client = useBladeClient();
|
|
6262
|
+
const subscribe = useCallback(
|
|
6263
|
+
(listener) => {
|
|
6264
|
+
if (!key) return () => {
|
|
6265
|
+
};
|
|
6266
|
+
const entry = entryFor(client, key);
|
|
6267
|
+
entry.listeners.add(listener);
|
|
6268
|
+
return () => {
|
|
6269
|
+
entry.listeners.delete(listener);
|
|
6270
|
+
};
|
|
6271
|
+
},
|
|
6272
|
+
[client, key]
|
|
6273
|
+
);
|
|
6274
|
+
const snapshot = useSyncExternalStore(
|
|
6275
|
+
subscribe,
|
|
6276
|
+
() => key ? entryFor(client, key).snapshot : EMPTY,
|
|
6277
|
+
() => key ? entryFor(client, key).snapshot : EMPTY
|
|
6278
|
+
);
|
|
6279
|
+
if (key) loadersFor(client).set(key, load);
|
|
6280
|
+
useEffect3(() => {
|
|
6281
|
+
if (!key) return;
|
|
6282
|
+
const registered = loadersFor(client).get(key);
|
|
6283
|
+
if (registered) void fetchClientQuery(client, key, registered, { staleMs }).catch(() => {
|
|
6284
|
+
});
|
|
6285
|
+
}, [client, key, staleMs]);
|
|
6286
|
+
const refetch = useCallback(async () => {
|
|
6287
|
+
if (!key) return void 0;
|
|
6288
|
+
const registered = loadersFor(client).get(key);
|
|
6289
|
+
if (!registered) return void 0;
|
|
6290
|
+
return fetchClientQuery(client, key, registered, { force: true }).catch(() => void 0);
|
|
6291
|
+
}, [client, key]);
|
|
6292
|
+
return { ...snapshot, refetch };
|
|
6293
|
+
}
|
|
6294
|
+
var loaderRegistry = /* @__PURE__ */ new WeakMap();
|
|
6295
|
+
function loadersFor(client) {
|
|
6296
|
+
let loaders = loaderRegistry.get(client);
|
|
6297
|
+
if (!loaders) {
|
|
6298
|
+
loaders = /* @__PURE__ */ new Map();
|
|
6299
|
+
loaderRegistry.set(client, loaders);
|
|
6300
|
+
}
|
|
6301
|
+
return loaders;
|
|
6302
|
+
}
|
|
6303
|
+
function refreshClientQuery(client, key) {
|
|
6304
|
+
const entry = caches.get(client)?.get(key);
|
|
6305
|
+
if (!entry) return;
|
|
6306
|
+
entry.fetchedAt = 0;
|
|
6307
|
+
const load = loadersFor(client).get(key);
|
|
6308
|
+
if (load && entry.listeners.size > 0) void fetchClientQuery(client, key, load, { force: true }).catch(() => {
|
|
6309
|
+
});
|
|
6310
|
+
}
|
|
6311
|
+
|
|
6312
|
+
// src/rich-input/lib/session-data.ts
|
|
6313
|
+
import { useEffect as useEffect5, useRef as useRef4 } from "react";
|
|
6314
|
+
|
|
6315
|
+
// src/chat/runtime/session-source.tsx
|
|
6316
|
+
import { createInitialSessionState } from "@blade-hq/agent-client/internal";
|
|
6317
|
+
import {
|
|
6318
|
+
createContext as createContext3,
|
|
6319
|
+
useContext as useContext3,
|
|
6320
|
+
useEffect as useEffect4,
|
|
6321
|
+
useLayoutEffect,
|
|
6322
|
+
useMemo,
|
|
6323
|
+
useRef as useRef3,
|
|
6324
|
+
useState as useState2,
|
|
6325
|
+
useSyncExternalStore as useSyncExternalStore2
|
|
6326
|
+
} from "react";
|
|
6327
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
6328
|
+
var EMPTY_SOURCE = {
|
|
6329
|
+
subscribe: () => () => {
|
|
6330
|
+
},
|
|
6331
|
+
getSession: () => void 0,
|
|
6332
|
+
isHistoryLoading: () => false,
|
|
6333
|
+
planRevealRevision: () => 0
|
|
6334
|
+
};
|
|
6335
|
+
var SessionSourceContext = createContext3(EMPTY_SOURCE);
|
|
6336
|
+
function SessionSourceProvider({ source, children }) {
|
|
6337
|
+
return /* @__PURE__ */ jsx5(SessionSourceContext.Provider, { value: source, children });
|
|
6338
|
+
}
|
|
6339
|
+
function useSessionSource() {
|
|
6340
|
+
return useContext3(SessionSourceContext);
|
|
6341
|
+
}
|
|
6342
|
+
var SingleSessionSource = class {
|
|
6343
|
+
session = null;
|
|
6344
|
+
loading = false;
|
|
6345
|
+
listeners = /* @__PURE__ */ new Set();
|
|
6346
|
+
revisions = /* @__PURE__ */ new Map();
|
|
6347
|
+
subscribe = (listener) => {
|
|
6348
|
+
this.listeners.add(listener);
|
|
6349
|
+
return () => {
|
|
6350
|
+
this.listeners.delete(listener);
|
|
6351
|
+
};
|
|
6352
|
+
};
|
|
6353
|
+
getSession = (sessionId) => {
|
|
6354
|
+
const current = this.session;
|
|
6355
|
+
return current && (!sessionId || current.sessionId === sessionId) ? current : void 0;
|
|
6356
|
+
};
|
|
6357
|
+
isHistoryLoading = (sessionId) => {
|
|
6358
|
+
if (!this.session) return this.loading;
|
|
6359
|
+
return (!sessionId || this.session.sessionId === sessionId) && this.loading;
|
|
6360
|
+
};
|
|
6361
|
+
planRevealRevision = (sessionId) => sessionId ? this.revisions.get(sessionId) ?? 0 : 0;
|
|
6362
|
+
update(session, loading) {
|
|
6363
|
+
if (this.session === session && this.loading === loading) return;
|
|
6364
|
+
this.session = session;
|
|
6365
|
+
this.loading = loading;
|
|
6366
|
+
this.notify();
|
|
6367
|
+
}
|
|
6368
|
+
watchPlan(session) {
|
|
6369
|
+
return session.on("toolResult", ({ toolCall, turn, source }) => {
|
|
6370
|
+
if (source === "reconnect_replay" || (turn.loop_id || "root") !== "root" || toolCall.status !== "done" || !isPlanUpdateTool(toolCall) || !parsePlanUpdate(toolCall.arguments)) {
|
|
6371
|
+
return;
|
|
6372
|
+
}
|
|
6373
|
+
this.revisions.set(session.sessionId, (this.revisions.get(session.sessionId) ?? 0) + 1);
|
|
6374
|
+
this.notify();
|
|
6375
|
+
});
|
|
6376
|
+
}
|
|
6377
|
+
notify() {
|
|
6378
|
+
for (const listener of [...this.listeners]) listener();
|
|
6379
|
+
}
|
|
6380
|
+
};
|
|
6381
|
+
function useSingleSessionSource(session, loading) {
|
|
6382
|
+
const [source] = useState2(() => new SingleSessionSource());
|
|
6383
|
+
useLayoutEffect(() => {
|
|
6384
|
+
source.update(session, loading);
|
|
6385
|
+
}, [source, session, loading]);
|
|
6386
|
+
useEffect4(() => session ? source.watchPlan(session) : void 0, [source, session]);
|
|
6387
|
+
return source;
|
|
6388
|
+
}
|
|
6389
|
+
var EMPTY_STATE = createInitialSessionState("");
|
|
6390
|
+
var noopSubscribe = () => () => {
|
|
6391
|
+
};
|
|
6392
|
+
function useSessionHandle(sessionId) {
|
|
6393
|
+
const source = useSessionSource();
|
|
6394
|
+
return useSyncExternalStore2(
|
|
6395
|
+
source.subscribe,
|
|
6396
|
+
() => source.getSession(sessionId) ?? null,
|
|
6397
|
+
() => source.getSession(sessionId) ?? null
|
|
6398
|
+
);
|
|
6399
|
+
}
|
|
6400
|
+
function useSessionState(sessionId, selector) {
|
|
6401
|
+
const session = useSessionHandle(sessionId);
|
|
6402
|
+
const selectorRef = useRef3(selector);
|
|
6403
|
+
selectorRef.current = selector;
|
|
6404
|
+
const store = useMemo(() => {
|
|
6405
|
+
let lastState = null;
|
|
6406
|
+
let lastSelector = null;
|
|
6407
|
+
let lastSelected;
|
|
6408
|
+
const getSnapshot = () => {
|
|
6409
|
+
const state = session ? session.getState() : EMPTY_STATE;
|
|
6410
|
+
const current = selectorRef.current;
|
|
6411
|
+
if (state !== lastState || current !== lastSelector) {
|
|
6412
|
+
const next = current(state);
|
|
6413
|
+
if (!(lastState !== null && Object.is(next, lastSelected))) lastSelected = next;
|
|
6414
|
+
lastState = state;
|
|
6415
|
+
lastSelector = current;
|
|
6416
|
+
}
|
|
6417
|
+
return lastSelected;
|
|
6418
|
+
};
|
|
6419
|
+
return {
|
|
6420
|
+
subscribe: session ? (listener) => session.subscribe(listener) : noopSubscribe,
|
|
6421
|
+
getSnapshot
|
|
6422
|
+
};
|
|
6423
|
+
}, [session]);
|
|
6424
|
+
return useSyncExternalStore2(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
6425
|
+
}
|
|
6426
|
+
function useIsSessionHistoryLoading(sessionId) {
|
|
6427
|
+
const source = useSessionSource();
|
|
6428
|
+
return useSyncExternalStore2(
|
|
6429
|
+
source.subscribe,
|
|
6430
|
+
() => source.isHistoryLoading(sessionId),
|
|
6431
|
+
() => source.isHistoryLoading(sessionId)
|
|
6432
|
+
);
|
|
6433
|
+
}
|
|
6434
|
+
function usePlanRevealRevision(sessionId) {
|
|
6435
|
+
const source = useSessionSource();
|
|
6436
|
+
return useSyncExternalStore2(
|
|
6437
|
+
source.subscribe,
|
|
6438
|
+
() => source.planRevealRevision(sessionId),
|
|
6439
|
+
() => source.planRevealRevision(sessionId)
|
|
6440
|
+
);
|
|
6441
|
+
}
|
|
6442
|
+
var CurrentChatSessionContext = createContext3(null);
|
|
6443
|
+
function CurrentChatSessionProvider({ sessionId, children }) {
|
|
6444
|
+
return /* @__PURE__ */ jsx5(CurrentChatSessionContext.Provider, { value: sessionId, children });
|
|
6445
|
+
}
|
|
6446
|
+
function useCurrentChatSessionId() {
|
|
6447
|
+
return useContext3(CurrentChatSessionContext);
|
|
6448
|
+
}
|
|
6449
|
+
|
|
6450
|
+
// src/rich-input/lib/session-data.ts
|
|
6451
|
+
var sessionPath = (sessionId, rest) => `/api/sessions/${encodeURIComponent(sessionId)}/${rest}`;
|
|
6452
|
+
function useRefreshWhenRunEnds(sessionId, keys2) {
|
|
6453
|
+
const client = useBladeClient();
|
|
6454
|
+
const streaming = useSessionState(sessionId, (state) => state.isStreaming);
|
|
6455
|
+
const wasStreaming = useRef4(streaming);
|
|
6456
|
+
useEffect5(() => {
|
|
6457
|
+
if (wasStreaming.current && !streaming) {
|
|
6458
|
+
for (const key of keys2) refreshClientQuery(client, key);
|
|
6459
|
+
}
|
|
6460
|
+
wasStreaming.current = streaming;
|
|
6461
|
+
});
|
|
6462
|
+
}
|
|
6463
|
+
function useClientSessionSkills(sessionId) {
|
|
6464
|
+
const key = sessionId ? `session-skills:${sessionId}` : null;
|
|
6465
|
+
const query = useClientQuery(
|
|
6466
|
+
key,
|
|
6467
|
+
(client) => client.json("GET", sessionPath(sessionId ?? "", "skills"))
|
|
6468
|
+
);
|
|
6469
|
+
useRefreshWhenRunEnds(sessionId, key ? [key] : []);
|
|
6470
|
+
return { data: query.data, loading: query.isLoading, error: query.error };
|
|
6471
|
+
}
|
|
6472
|
+
function useClientSkillStats(sessionId) {
|
|
6473
|
+
const key = sessionId ? `skill-stats:${sessionId}` : null;
|
|
6474
|
+
const query = useClientQuery(key, (client) => client.json("GET", sessionPath(sessionId ?? "", "skill-stats")), {
|
|
6475
|
+
staleMs: 3e5
|
|
6476
|
+
});
|
|
6477
|
+
useRefreshWhenRunEnds(sessionId, key ? [key] : []);
|
|
6478
|
+
return { data: query.data, loading: query.isLoading, error: query.error };
|
|
6479
|
+
}
|
|
6480
|
+
function useClientContextStats(sessionId) {
|
|
6481
|
+
const key = sessionId ? `context-stats:${sessionId}` : null;
|
|
6482
|
+
const query = useClientQuery(
|
|
6483
|
+
key,
|
|
6484
|
+
(client) => client.json("GET", sessionPath(sessionId ?? "", "context-stats"))
|
|
6485
|
+
);
|
|
6486
|
+
useRefreshWhenRunEnds(sessionId, key ? [key] : []);
|
|
6487
|
+
return { data: query.data, loading: query.isLoading, error: query.error };
|
|
6488
|
+
}
|
|
6489
|
+
function useClientBackgroundTasks(sessionId) {
|
|
6490
|
+
const client = useBladeClient();
|
|
6491
|
+
const key = sessionId ? `background-tasks:${sessionId}` : null;
|
|
6492
|
+
const query = useClientQuery(key, (c) => c.sessions.listBackgroundTasks(sessionId ?? ""));
|
|
6493
|
+
const session = useSessionHandle(sessionId);
|
|
6494
|
+
useEffect5(() => {
|
|
6495
|
+
if (!session || !key) return;
|
|
6496
|
+
return session.on("backgroundTask", () => refreshClientQuery(client, key));
|
|
6497
|
+
}, [client, key, session]);
|
|
6498
|
+
return { data: query.data, loading: query.isLoading, error: query.error };
|
|
6499
|
+
}
|
|
6500
|
+
function refreshClientSessionSkills(client, sessionId) {
|
|
6501
|
+
refreshClientQuery(client, `session-skills:${sessionId}`);
|
|
6502
|
+
refreshClientQuery(client, `skill-stats:${sessionId}`);
|
|
6503
|
+
}
|
|
6504
|
+
function useClientSessionModel(sessionId) {
|
|
6505
|
+
const key = sessionId ? `session-detail:${sessionId}` : null;
|
|
6506
|
+
const query = useClientQuery(key, (client) => client.sessions.getSession(sessionId ?? ""));
|
|
6507
|
+
useRefreshWhenRunEnds(sessionId, key ? [key] : []);
|
|
6508
|
+
return query.data?.model ?? null;
|
|
6509
|
+
}
|
|
6510
|
+
|
|
6511
|
+
// src/rich-input/model/model-data.ts
|
|
6512
|
+
var EMPTY_MODELS = [];
|
|
6513
|
+
var EMPTY_IDS = [];
|
|
6514
|
+
var CATALOG_KEY = "model-catalog";
|
|
6515
|
+
function useClientModelCatalog() {
|
|
6516
|
+
const { data, isLoading, isFetching, refetch } = useClientQuery(
|
|
6517
|
+
CATALOG_KEY,
|
|
6518
|
+
(client) => client.json("GET", "/api/config/models"),
|
|
6519
|
+
{ staleMs: 0 }
|
|
6520
|
+
);
|
|
6521
|
+
return {
|
|
6522
|
+
models: data?.models ?? EMPTY_MODELS,
|
|
6523
|
+
defaultModel: data?.default ?? "",
|
|
6524
|
+
thinkingAvailable: data?.thinkingAvailable ?? false,
|
|
6525
|
+
unavailableProviderIds: data?.unavailableProviderIds ?? EMPTY_IDS,
|
|
6526
|
+
unavailableModelIds: data?.unavailableModelIds ?? EMPTY_IDS,
|
|
6527
|
+
isLoading,
|
|
6528
|
+
isFetching,
|
|
6529
|
+
refresh: async () => {
|
|
6530
|
+
await refetch();
|
|
6531
|
+
}
|
|
6532
|
+
};
|
|
6533
|
+
}
|
|
6534
|
+
var PREFERRED_MODEL_KEY = "preferred_model";
|
|
6535
|
+
var MODEL_REASONING_LEVELS_KEY = "llm.model_thinking_preferences";
|
|
6536
|
+
var PREFERENCES_KEY = "model-preferences";
|
|
6537
|
+
function loadPreferences(client) {
|
|
6538
|
+
const query = new URLSearchParams();
|
|
6539
|
+
query.append("key", PREFERRED_MODEL_KEY);
|
|
6540
|
+
query.append("key", MODEL_REASONING_LEVELS_KEY);
|
|
6541
|
+
return client.json("GET", `/api/user/preferences?${query.toString()}`).then((response) => response.values ?? {});
|
|
6542
|
+
}
|
|
6543
|
+
async function writePreference(client, key, value) {
|
|
6544
|
+
const previous = await fetchClientQuery(client, PREFERENCES_KEY, loadPreferences, { staleMs: 6e4 }).catch(
|
|
6545
|
+
() => ({})
|
|
6546
|
+
);
|
|
6547
|
+
setClientQueryData(client, PREFERENCES_KEY, (current) => ({ ...current, [key]: value }));
|
|
6548
|
+
try {
|
|
6549
|
+
await client.json("PUT", `/api/user/preferences/${encodeURIComponent(key)}`, { value });
|
|
6550
|
+
} catch {
|
|
6551
|
+
setClientQueryData(client, PREFERENCES_KEY, (current) => ({ ...current, [key]: previous[key] ?? null }));
|
|
6552
|
+
}
|
|
6553
|
+
}
|
|
6554
|
+
var EMPTY_LEVELS = {};
|
|
6555
|
+
function useClientModelPreferences() {
|
|
6556
|
+
const client = useBladeClient();
|
|
6557
|
+
const { data } = useClientQuery(PREFERENCES_KEY, loadPreferences, { staleMs: 6e4 });
|
|
6558
|
+
const rawLevels = data?.[MODEL_REASONING_LEVELS_KEY] ?? null;
|
|
6559
|
+
const reasoningLevels = rawLevels ? parseModelReasoningLevels(rawLevels) : EMPTY_LEVELS;
|
|
6560
|
+
return {
|
|
6561
|
+
preferredModel: data?.[PREFERRED_MODEL_KEY] ?? null,
|
|
6562
|
+
setPreferredModel: (modelId) => void writePreference(client, PREFERRED_MODEL_KEY, modelId),
|
|
6563
|
+
reasoningLevels,
|
|
6564
|
+
setReasoningLevel: (modelId, level) => {
|
|
6565
|
+
if (!modelId) return;
|
|
6566
|
+
void writePreference(
|
|
6567
|
+
client,
|
|
6568
|
+
MODEL_REASONING_LEVELS_KEY,
|
|
6569
|
+
JSON.stringify({ ...reasoningLevels, [modelId]: level })
|
|
6570
|
+
);
|
|
6571
|
+
}
|
|
6572
|
+
};
|
|
6573
|
+
}
|
|
6574
|
+
|
|
6575
|
+
// src/rich-input/services.tsx
|
|
6576
|
+
import { useMemo as useMemo2, useRef as useRef5 } from "react";
|
|
6577
|
+
function useModelCatalog() {
|
|
6578
|
+
const use = useRichInputServices().useModelCatalog ?? useClientModelCatalog;
|
|
6579
|
+
return use();
|
|
6580
|
+
}
|
|
6581
|
+
function useModelPreferences() {
|
|
6582
|
+
const use = useRichInputServices().useModelPreferences ?? useClientModelPreferences;
|
|
6583
|
+
return use();
|
|
6584
|
+
}
|
|
6585
|
+
function useSessionConnection(sessionId) {
|
|
6586
|
+
const connection = useSessionState(sessionId, (state) => state.connection);
|
|
6587
|
+
const status = sessionId ? connection : "connected";
|
|
6588
|
+
const everConnected = useRef5(false);
|
|
6589
|
+
if (status === "connected") everConnected.current = true;
|
|
6590
|
+
return { status, reconnectAttempt: 0, hasEverConnected: everConnected.current };
|
|
6591
|
+
}
|
|
6592
|
+
function useComposerConnectionInfo(sessionId) {
|
|
6593
|
+
const use = useRichInputServices().useConnection ?? useSessionConnection;
|
|
6594
|
+
return use(sessionId);
|
|
6595
|
+
}
|
|
6596
|
+
function useComposerConnection(sessionId) {
|
|
6597
|
+
return useComposerConnectionInfo(sessionId).status;
|
|
6598
|
+
}
|
|
6599
|
+
function useSessionSkills(sessionId) {
|
|
6600
|
+
const use = useRichInputServices().useSessionSkills ?? useClientSessionSkills;
|
|
6601
|
+
return use(sessionId);
|
|
6602
|
+
}
|
|
6603
|
+
function useSkillStats(sessionId) {
|
|
6604
|
+
const use = useRichInputServices().useSkillStats ?? useClientSkillStats;
|
|
6605
|
+
return use(sessionId);
|
|
6606
|
+
}
|
|
6607
|
+
function useContextStats(sessionId) {
|
|
6608
|
+
const use = useRichInputServices().useContextStats ?? useClientContextStats;
|
|
6609
|
+
return use(sessionId);
|
|
6610
|
+
}
|
|
6611
|
+
function useBackgroundTaskList(sessionId) {
|
|
6612
|
+
const use = useRichInputServices().useBackgroundTasks ?? useClientBackgroundTasks;
|
|
6613
|
+
return use(sessionId);
|
|
6614
|
+
}
|
|
6615
|
+
function useClientSessionDataInvalidation() {
|
|
6616
|
+
const client = useBladeClient();
|
|
6617
|
+
return useMemo2(
|
|
6618
|
+
() => ({
|
|
6619
|
+
filesUploaded: (_sessionId) => {
|
|
6620
|
+
},
|
|
6621
|
+
pluginsChanged: (sessionId) => refreshClientSessionSkills(client, sessionId)
|
|
6622
|
+
}),
|
|
6623
|
+
[client]
|
|
6624
|
+
);
|
|
6625
|
+
}
|
|
6626
|
+
function useSessionDataInvalidation() {
|
|
6627
|
+
const use = useRichInputServices().useSessionDataInvalidation ?? useClientSessionDataInvalidation;
|
|
6628
|
+
return use();
|
|
6629
|
+
}
|
|
6630
|
+
|
|
6174
6631
|
// ../../node_modules/.pnpm/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js
|
|
6175
6632
|
function deepCompareStrict(a, b) {
|
|
6176
6633
|
const typeofa = typeof a;
|
|
@@ -11909,7 +12366,7 @@ function toFieldPathId(fieldPath, globalFormOptions, parentPath, isMultiValue) {
|
|
|
11909
12366
|
|
|
11910
12367
|
// ../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/lib/useAltDateWidgetProps.js
|
|
11911
12368
|
import { jsx as _jsx3 } from "react/jsx-runtime";
|
|
11912
|
-
import { useCallback, useEffect as
|
|
12369
|
+
import { useCallback as useCallback2, useEffect as useEffect6, useMemo as useMemo3, useState as useState3 } from "react";
|
|
11913
12370
|
function readyForChange(state) {
|
|
11914
12371
|
return Object.values(state).every((value) => value !== -1);
|
|
11915
12372
|
}
|
|
@@ -11917,16 +12374,16 @@ function DateElement(props) {
|
|
|
11917
12374
|
const { className = "form-control", type, range, value, select, rootId, name, disabled, readonly, autofocus, registry, onBlur, onFocus } = props;
|
|
11918
12375
|
const id = `${rootId}_${type}`;
|
|
11919
12376
|
const { SelectWidget: SelectWidget2 } = registry.widgets;
|
|
11920
|
-
const onChange =
|
|
12377
|
+
const onChange = useCallback2((newValue) => select(type, newValue), [select, type]);
|
|
11921
12378
|
return _jsx3(SelectWidget2, { schema: { type: "integer" }, id, name, className, options: { enumOptions: dateRangeOptions(range[0], range[1]) }, placeholder: type, value, disabled, readonly, autofocus, onChange, onBlur, onFocus, registry, label: "", "aria-describedby": ariaDescribedByIds(rootId) });
|
|
11922
12379
|
}
|
|
11923
12380
|
function useAltDateWidgetProps(props) {
|
|
11924
12381
|
const { time: time2 = false, disabled = false, readonly = false, options, onChange, value } = props;
|
|
11925
|
-
const [state, setState] =
|
|
11926
|
-
|
|
12382
|
+
const [state, setState] = useState3(parseDateString(value, time2));
|
|
12383
|
+
useEffect6(() => {
|
|
11927
12384
|
setState(parseDateString(value, time2));
|
|
11928
12385
|
}, [time2, value]);
|
|
11929
|
-
const handleChange =
|
|
12386
|
+
const handleChange = useCallback2((property, newValue) => {
|
|
11930
12387
|
const nextState = {
|
|
11931
12388
|
...state,
|
|
11932
12389
|
[property]: typeof newValue === "undefined" ? -1 : newValue
|
|
@@ -11937,14 +12394,14 @@ function useAltDateWidgetProps(props) {
|
|
|
11937
12394
|
setState(nextState);
|
|
11938
12395
|
}
|
|
11939
12396
|
}, [state, onChange, time2]);
|
|
11940
|
-
const handleClear =
|
|
12397
|
+
const handleClear = useCallback2((event) => {
|
|
11941
12398
|
event.preventDefault();
|
|
11942
12399
|
if (disabled || readonly) {
|
|
11943
12400
|
return;
|
|
11944
12401
|
}
|
|
11945
12402
|
onChange(void 0);
|
|
11946
12403
|
}, [disabled, readonly, onChange]);
|
|
11947
|
-
const handleSetNow =
|
|
12404
|
+
const handleSetNow = useCallback2((event) => {
|
|
11948
12405
|
event.preventDefault();
|
|
11949
12406
|
if (disabled || readonly) {
|
|
11950
12407
|
return;
|
|
@@ -11952,14 +12409,14 @@ function useAltDateWidgetProps(props) {
|
|
|
11952
12409
|
const nextState = parseDateString((/* @__PURE__ */ new Date()).toJSON(), time2);
|
|
11953
12410
|
onChange(toDateString(nextState, time2));
|
|
11954
12411
|
}, [disabled, readonly, time2, onChange]);
|
|
11955
|
-
const elements =
|
|
12412
|
+
const elements = useMemo3(() => getDateElementProps(state, time2, options.yearsRange, options.format), [state, time2, options.yearsRange, options.format]);
|
|
11956
12413
|
return { elements, handleChange, handleClear, handleSetNow };
|
|
11957
12414
|
}
|
|
11958
12415
|
|
|
11959
12416
|
// ../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/lib/useDeepCompareMemo.js
|
|
11960
|
-
import { useRef as
|
|
12417
|
+
import { useRef as useRef6 } from "react";
|
|
11961
12418
|
function useDeepCompareMemo(newValue) {
|
|
11962
|
-
const valueRef =
|
|
12419
|
+
const valueRef = useRef6(newValue);
|
|
11963
12420
|
if (!deepEquals_default(newValue, valueRef.current)) {
|
|
11964
12421
|
valueRef.current = newValue;
|
|
11965
12422
|
}
|
|
@@ -11967,7 +12424,7 @@ function useDeepCompareMemo(newValue) {
|
|
|
11967
12424
|
}
|
|
11968
12425
|
|
|
11969
12426
|
// ../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/lib/useFileWidgetProps.js
|
|
11970
|
-
import { useCallback as
|
|
12427
|
+
import { useCallback as useCallback3, useMemo as useMemo4 } from "react";
|
|
11971
12428
|
function addNameToDataURL(dataURL, name) {
|
|
11972
12429
|
return dataURL.replace(";base64", `;name=${encodeURIComponent(name)};base64`);
|
|
11973
12430
|
}
|
|
@@ -12021,14 +12478,14 @@ function extractFileInfo(dataURLs) {
|
|
|
12021
12478
|
}, []);
|
|
12022
12479
|
}
|
|
12023
12480
|
function useFileWidgetProps(value, onChange, multiple = false) {
|
|
12024
|
-
const values =
|
|
12481
|
+
const values = useMemo4(() => {
|
|
12025
12482
|
if (multiple && value) {
|
|
12026
12483
|
return Array.isArray(value) ? value : [value];
|
|
12027
12484
|
}
|
|
12028
12485
|
return [];
|
|
12029
12486
|
}, [value, multiple]);
|
|
12030
|
-
const filesInfo =
|
|
12031
|
-
const handleChange =
|
|
12487
|
+
const filesInfo = useMemo4(() => Array.isArray(value) ? extractFileInfo(value) : extractFileInfo([value || ""]), [value]);
|
|
12488
|
+
const handleChange = useCallback3(async (files) => {
|
|
12032
12489
|
const filesInfoEvent = await processFiles(files);
|
|
12033
12490
|
const newValue = filesInfoEvent.map((fileInfo) => fileInfo.dataURL || null);
|
|
12034
12491
|
if (multiple) {
|
|
@@ -12037,7 +12494,7 @@ function useFileWidgetProps(value, onChange, multiple = false) {
|
|
|
12037
12494
|
onChange(newValue[0]);
|
|
12038
12495
|
}
|
|
12039
12496
|
}, [values, multiple, onChange]);
|
|
12040
|
-
const handleRemove =
|
|
12497
|
+
const handleRemove = useCallback3((index2) => {
|
|
12041
12498
|
if (multiple) {
|
|
12042
12499
|
const newValue = values.filter((_, i) => i !== index2);
|
|
12043
12500
|
onChange(newValue);
|
|
@@ -12153,7 +12610,7 @@ var TranslatableString;
|
|
|
12153
12610
|
|
|
12154
12611
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/ArrayField.js
|
|
12155
12612
|
import { jsx as _jsx4 } from "react/jsx-runtime";
|
|
12156
|
-
import { memo, useCallback as
|
|
12613
|
+
import { memo, useCallback as useCallback4, useMemo as useMemo5, useRef as useRef7, useState as useState4 } from "react";
|
|
12157
12614
|
var rowIdCounter = 0;
|
|
12158
12615
|
function generateRowId() {
|
|
12159
12616
|
rowIdCounter += 1;
|
|
@@ -12247,8 +12704,8 @@ function ArrayAsFiles(props) {
|
|
|
12247
12704
|
function ArrayFieldItemInner(props) {
|
|
12248
12705
|
const { itemKey, index: index2, name, disabled, hideError, readonly, registry, uiOptions, parentUiSchema, canAdd, canRemove = true, canMoveUp, canMoveDown, rawItemSchema, itemData, itemUiSchema, parentFieldPathId, itemErrorSchema, autofocus, onBlur, onFocus, onChange, rawErrors, totalItems, title, handleAddItem, handleCopyItem, handleRemoveItem, handleReorderItems } = props;
|
|
12249
12706
|
const { schemaUtils, fields: { ArraySchemaField, SchemaField: SchemaField2 }, globalUiOptions, globalFormOptions } = registry;
|
|
12250
|
-
const itemSchema =
|
|
12251
|
-
const fieldPathId =
|
|
12707
|
+
const itemSchema = useMemo5(() => schemaUtils.retrieveSchema(rawItemSchema, itemData), [schemaUtils, rawItemSchema, itemData]);
|
|
12708
|
+
const fieldPathId = useMemo5(() => toFieldPathId(index2, globalFormOptions, parentFieldPathId), [index2, globalFormOptions, parentFieldPathId]);
|
|
12252
12709
|
const ItemSchemaField = ArraySchemaField || SchemaField2;
|
|
12253
12710
|
const ArrayFieldItemTemplate2 = getTemplate("ArrayFieldItemTemplate", registry, uiOptions);
|
|
12254
12711
|
const displayLabel = schemaUtils.getDisplayLabel(itemSchema, itemUiSchema, globalUiOptions);
|
|
@@ -12263,19 +12720,19 @@ function ArrayFieldItemInner(props) {
|
|
|
12263
12720
|
toolbar: false
|
|
12264
12721
|
};
|
|
12265
12722
|
has.toolbar = Object.keys(has).some((key) => has[key]);
|
|
12266
|
-
const onAddItem =
|
|
12723
|
+
const onAddItem = useCallback4((event) => {
|
|
12267
12724
|
handleAddItem(event, index2 + 1);
|
|
12268
12725
|
}, [handleAddItem, index2]);
|
|
12269
|
-
const onCopyItem =
|
|
12726
|
+
const onCopyItem = useCallback4((event) => {
|
|
12270
12727
|
handleCopyItem(event, index2);
|
|
12271
12728
|
}, [handleCopyItem, index2]);
|
|
12272
|
-
const onRemoveItem =
|
|
12729
|
+
const onRemoveItem = useCallback4((event) => {
|
|
12273
12730
|
handleRemoveItem(event, index2);
|
|
12274
12731
|
}, [handleRemoveItem, index2]);
|
|
12275
|
-
const onMoveUpItem =
|
|
12732
|
+
const onMoveUpItem = useCallback4((event) => {
|
|
12276
12733
|
handleReorderItems(event, index2, index2 - 1);
|
|
12277
12734
|
}, [handleReorderItems, index2]);
|
|
12278
|
-
const onMoveDownItem =
|
|
12735
|
+
const onMoveDownItem = useCallback4((event) => {
|
|
12279
12736
|
handleReorderItems(event, index2, index2 + 1);
|
|
12280
12737
|
}, [handleReorderItems, index2]);
|
|
12281
12738
|
const templateProps = {
|
|
@@ -12322,13 +12779,13 @@ function NormalArray(props) {
|
|
|
12322
12779
|
const fieldTitle = schema.title || title || name;
|
|
12323
12780
|
const { schemaUtils, fields: fields2, formContext, globalUiOptions } = registry;
|
|
12324
12781
|
const { OptionalDataControlsField: OptionalDataControlsField2 } = fields2;
|
|
12325
|
-
const uiOptions =
|
|
12326
|
-
const schemaItems =
|
|
12327
|
-
const itemsSchema =
|
|
12328
|
-
const formData =
|
|
12782
|
+
const uiOptions = useMemo5(() => getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
|
|
12783
|
+
const schemaItems = useMemo5(() => isObject(schema.items) ? schema.items : {}, [schema.items]);
|
|
12784
|
+
const itemsSchema = useMemo5(() => schemaUtils.retrieveSchema(schemaItems), [schemaUtils, schemaItems]);
|
|
12785
|
+
const formData = useMemo5(() => keyedToPlainFormData(keyedFormData), [keyedFormData]);
|
|
12329
12786
|
const renderOptionalField = shouldRenderOptionalField(registry, schema, required, uiSchema);
|
|
12330
12787
|
const hasFormData = isFormDataAvailable(formDataFromProps);
|
|
12331
|
-
const canAdd =
|
|
12788
|
+
const canAdd = useMemo5(() => canAddItem(registry, schema, formData, uiSchema) && (!renderOptionalField || hasFormData), [registry, schema, formData, uiSchema, renderOptionalField, hasFormData]);
|
|
12332
12789
|
const actualFormData = hasFormData ? keyedFormData : [];
|
|
12333
12790
|
const extraClass = renderOptionalField ? " rjsf-optional-array-field" : "";
|
|
12334
12791
|
const childFieldPathId = props.childFieldPathId ?? fieldPathId;
|
|
@@ -12395,11 +12852,11 @@ function FixedArray(props) {
|
|
|
12395
12852
|
let { formData: items = [] } = props;
|
|
12396
12853
|
const fieldTitle = schema.title || title || name;
|
|
12397
12854
|
const { fields: fields2, formContext, globalUiOptions } = registry;
|
|
12398
|
-
const uiOptions =
|
|
12855
|
+
const uiOptions = useMemo5(() => getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
|
|
12399
12856
|
const { OptionalDataControlsField: OptionalDataControlsField2 } = fields2;
|
|
12400
12857
|
const renderOptionalField = shouldRenderOptionalField(registry, schema, required, uiSchema);
|
|
12401
12858
|
const hasFormData = isFormDataAvailable(formData);
|
|
12402
|
-
const schemaItems =
|
|
12859
|
+
const schemaItems = useMemo5(() => Array.isArray(schema.items) ? schema.items : [], [schema.items]);
|
|
12403
12860
|
const hasAdditionalItems = isObject(schema.additionalItems);
|
|
12404
12861
|
const childFieldPathId = props.childFieldPathId ?? fieldPathId;
|
|
12405
12862
|
if (items.length < schemaItems.length) {
|
|
@@ -12478,8 +12935,8 @@ function FixedArray(props) {
|
|
|
12478
12935
|
return _jsx4(Template, { ...arrayProps });
|
|
12479
12936
|
}
|
|
12480
12937
|
function useKeyedFormData(formData = []) {
|
|
12481
|
-
const newHash =
|
|
12482
|
-
const [state, setState] =
|
|
12938
|
+
const newHash = useMemo5(() => hashObject(formData), [formData]);
|
|
12939
|
+
const [state, setState] = useState4(() => ({
|
|
12483
12940
|
formDataHash: newHash,
|
|
12484
12941
|
keyedFormData: generateKeyedFormData(formData)
|
|
12485
12942
|
}));
|
|
@@ -12494,7 +12951,7 @@ function useKeyedFormData(formData = []) {
|
|
|
12494
12951
|
formDataHash = newHash;
|
|
12495
12952
|
setState({ formDataHash, keyedFormData });
|
|
12496
12953
|
}
|
|
12497
|
-
const updateKeyedFormData =
|
|
12954
|
+
const updateKeyedFormData = useCallback4((newData) => {
|
|
12498
12955
|
const plainFormData = keyedToPlainFormData(newData);
|
|
12499
12956
|
const updatedHash = hashObject(plainFormData);
|
|
12500
12957
|
setState({ formDataHash: updatedHash, keyedFormData: newData });
|
|
@@ -12506,12 +12963,12 @@ function ArrayField(props) {
|
|
|
12506
12963
|
const { schema, uiSchema, errorSchema, fieldPathId, registry, formData, onChange } = props;
|
|
12507
12964
|
const { globalFormOptions, schemaUtils, translateString } = registry;
|
|
12508
12965
|
const { keyedFormData, updateKeyedFormData } = useKeyedFormData(formData);
|
|
12509
|
-
const keyedFormDataRef =
|
|
12966
|
+
const keyedFormDataRef = useRef7(keyedFormData);
|
|
12510
12967
|
keyedFormDataRef.current = keyedFormData;
|
|
12511
|
-
const errorSchemaRef =
|
|
12968
|
+
const errorSchemaRef = useRef7(errorSchema);
|
|
12512
12969
|
errorSchemaRef.current = errorSchema;
|
|
12513
12970
|
const childFieldPathId = props.childFieldPathId ?? fieldPathId;
|
|
12514
|
-
const handleAddItem =
|
|
12971
|
+
const handleAddItem = useCallback4((event, index2) => {
|
|
12515
12972
|
if (event) {
|
|
12516
12973
|
event.preventDefault();
|
|
12517
12974
|
}
|
|
@@ -12539,7 +12996,7 @@ function ArrayField(props) {
|
|
|
12539
12996
|
}
|
|
12540
12997
|
onChange(updateKeyedFormData(newKeyedFormData), childFieldPathId.path, newErrorSchema);
|
|
12541
12998
|
}, [registry, schema, onChange, updateKeyedFormData, childFieldPathId]);
|
|
12542
|
-
const handleCopyItem =
|
|
12999
|
+
const handleCopyItem = useCallback4((event, index2) => {
|
|
12543
13000
|
if (event) {
|
|
12544
13001
|
event.preventDefault();
|
|
12545
13002
|
}
|
|
@@ -12567,7 +13024,7 @@ function ArrayField(props) {
|
|
|
12567
13024
|
}
|
|
12568
13025
|
onChange(updateKeyedFormData(newKeyedFormData), childFieldPathId.path, newErrorSchema);
|
|
12569
13026
|
}, [onChange, updateKeyedFormData, childFieldPathId]);
|
|
12570
|
-
const handleRemoveItem =
|
|
13027
|
+
const handleRemoveItem = useCallback4((event, index2) => {
|
|
12571
13028
|
if (event) {
|
|
12572
13029
|
event.preventDefault();
|
|
12573
13030
|
}
|
|
@@ -12586,7 +13043,7 @@ function ArrayField(props) {
|
|
|
12586
13043
|
const newKeyedFormData = keyedFormDataRef.current.filter((_, i) => i !== index2);
|
|
12587
13044
|
onChange(updateKeyedFormData(newKeyedFormData), childFieldPathId.path, newErrorSchema);
|
|
12588
13045
|
}, [onChange, updateKeyedFormData, childFieldPathId]);
|
|
12589
|
-
const handleReorderItems =
|
|
13046
|
+
const handleReorderItems = useCallback4((event, index2, newIndex) => {
|
|
12590
13047
|
if (event) {
|
|
12591
13048
|
event.preventDefault();
|
|
12592
13049
|
event.currentTarget.blur();
|
|
@@ -12614,7 +13071,7 @@ function ArrayField(props) {
|
|
|
12614
13071
|
const newKeyedFormData = reOrderArray();
|
|
12615
13072
|
onChange(updateKeyedFormData(newKeyedFormData), childFieldPathId.path, newErrorSchema);
|
|
12616
13073
|
}, [onChange, updateKeyedFormData, childFieldPathId]);
|
|
12617
|
-
const handleChange =
|
|
13074
|
+
const handleChange = useCallback4((value, path, newErrorSchema, id) => {
|
|
12618
13075
|
const lastPathIsItemIndex = typeof path.at(-1) === "number";
|
|
12619
13076
|
onChange(
|
|
12620
13077
|
// We need to treat undefined items as nulls to have validation.
|
|
@@ -12626,7 +13083,7 @@ function ArrayField(props) {
|
|
|
12626
13083
|
id
|
|
12627
13084
|
);
|
|
12628
13085
|
}, [onChange]);
|
|
12629
|
-
const onSelectChange =
|
|
13086
|
+
const onSelectChange = useCallback4((value) => {
|
|
12630
13087
|
onChange(value, childFieldPathId.path, void 0, childFieldPathId?.[ID_KEY]);
|
|
12631
13088
|
}, [onChange, childFieldPathId]);
|
|
12632
13089
|
const arrayAsMultiProps = {
|
|
@@ -12671,7 +13128,7 @@ function ArrayField(props) {
|
|
|
12671
13128
|
|
|
12672
13129
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/BooleanField.js
|
|
12673
13130
|
import { jsx as _jsx5 } from "react/jsx-runtime";
|
|
12674
|
-
import { useCallback as
|
|
13131
|
+
import { useCallback as useCallback5 } from "react";
|
|
12675
13132
|
function BooleanField(props) {
|
|
12676
13133
|
const { schema, name, uiSchema, fieldPathId, formData, registry, required, disabled, readonly, hideError, autofocus, title, onChange, onFocus, onBlur, rawErrors } = props;
|
|
12677
13134
|
const { title: schemaTitle } = schema;
|
|
@@ -12719,16 +13176,16 @@ function BooleanField(props) {
|
|
|
12719
13176
|
enumOptions = optionsList({ enum: enums }, uiSchema);
|
|
12720
13177
|
}
|
|
12721
13178
|
}
|
|
12722
|
-
const onWidgetChange =
|
|
13179
|
+
const onWidgetChange = useCallback5((value, errorSchema, id) => onChange(value, fieldPathId.path, errorSchema, id), [onChange, fieldPathId]);
|
|
12723
13180
|
return _jsx5(Widget, { options: { ...options, enumOptions }, schema, uiSchema, id: fieldPathId.$id, name, onChange: onWidgetChange, onFocus, onBlur, label, hideLabel: !displayLabel, value: formData, required, disabled, readonly, hideError, registry, autofocus, rawErrors, htmlName: fieldPathId.name });
|
|
12724
13181
|
}
|
|
12725
13182
|
var BooleanField_default = BooleanField;
|
|
12726
13183
|
|
|
12727
13184
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/CyclicSchemaField.js
|
|
12728
13185
|
import { jsx as _jsx6 } from "react/jsx-runtime";
|
|
12729
|
-
import { useState as
|
|
13186
|
+
import { useState as useState5 } from "react";
|
|
12730
13187
|
function CyclicSchemaField(props) {
|
|
12731
|
-
const [expanded, setExpanded] =
|
|
13188
|
+
const [expanded, setExpanded] = useState5(false);
|
|
12732
13189
|
const { name, registry, schema, uiSchema, fieldPathId } = props;
|
|
12733
13190
|
const { globalUiOptions } = registry;
|
|
12734
13191
|
const uiOptions = getUiOptions(uiSchema, globalUiOptions);
|
|
@@ -12743,7 +13200,7 @@ function CyclicSchemaField(props) {
|
|
|
12743
13200
|
|
|
12744
13201
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/FallbackField.js
|
|
12745
13202
|
import { jsx as _jsx7 } from "react/jsx-runtime";
|
|
12746
|
-
import { useMemo as
|
|
13203
|
+
import { useMemo as useMemo6, useState as useState6 } from "react";
|
|
12747
13204
|
function getFallbackTypeSelectionSchema(title) {
|
|
12748
13205
|
return {
|
|
12749
13206
|
type: "string",
|
|
@@ -12779,11 +13236,11 @@ function castToNewType(formData, newType) {
|
|
|
12779
13236
|
function FallbackField(props) {
|
|
12780
13237
|
const { id, formData, displayLabel = true, schema, name, uiSchema, required, disabled = false, readonly = false, onBlur, onFocus, registry, fieldPathId, onChange, errorSchema } = props;
|
|
12781
13238
|
const { translateString, fields: fields2, globalFormOptions } = registry;
|
|
12782
|
-
const [type, setType] =
|
|
13239
|
+
const [type, setType] = useState6(getTypeOfFormData(formData));
|
|
12783
13240
|
const uiOptions = getUiOptions(uiSchema);
|
|
12784
13241
|
const typeSelectorInnerFieldPathId = useDeepCompareMemo(toFieldPathId("__internal_type_selector", globalFormOptions, fieldPathId));
|
|
12785
13242
|
const schemaTitle = translateString(TranslatableString.Type);
|
|
12786
|
-
const typesOptionSchema =
|
|
13243
|
+
const typesOptionSchema = useMemo6(() => getFallbackTypeSelectionSchema(schemaTitle), [schemaTitle]);
|
|
12787
13244
|
const onTypeChange = (newType) => {
|
|
12788
13245
|
if (newType != null) {
|
|
12789
13246
|
setType(newType);
|
|
@@ -13122,7 +13579,7 @@ function LayoutHeaderField(props) {
|
|
|
13122
13579
|
|
|
13123
13580
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/LayoutMultiSchemaField.js
|
|
13124
13581
|
import { jsx as _jsx10 } from "react/jsx-runtime";
|
|
13125
|
-
import { useState as
|
|
13582
|
+
import { useState as useState7, useEffect as useEffect7 } from "react";
|
|
13126
13583
|
function getSelectedOption(options, selectorField, value) {
|
|
13127
13584
|
const defaultValue = "!@#!@$@#$!@$#";
|
|
13128
13585
|
const schemaOptions = options.map(({ schema }) => schema);
|
|
@@ -13149,7 +13606,7 @@ function computeEnumOptions(schema, options, schemaUtils, uiSchema, formData) {
|
|
|
13149
13606
|
function LayoutMultiSchemaField(props) {
|
|
13150
13607
|
const { name, baseType, disabled = false, formData, fieldPathId, onBlur, onChange, options, onFocus, registry, uiSchema, schema, autofocus, readonly, required, errorSchema, hideError = false } = props;
|
|
13151
13608
|
const { widgets: widgets2, schemaUtils, globalUiOptions } = registry;
|
|
13152
|
-
const [enumOptions, setEnumOptions] =
|
|
13609
|
+
const [enumOptions, setEnumOptions] = useState7(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));
|
|
13153
13610
|
const id = fieldPathId[ID_KEY];
|
|
13154
13611
|
const discriminator = getDiscriminatorFieldFromSchema(schema);
|
|
13155
13612
|
const FieldErrorTemplate2 = getTemplate("FieldErrorTemplate", registry, options);
|
|
@@ -13158,7 +13615,7 @@ function LayoutMultiSchemaField(props) {
|
|
|
13158
13615
|
const optionsHash = hashObject(options);
|
|
13159
13616
|
const uiSchemaHash = uiSchema ? hashObject(uiSchema) : "";
|
|
13160
13617
|
const formDataHash = formData ? hashObject(formData) : "";
|
|
13161
|
-
|
|
13618
|
+
useEffect7(() => {
|
|
13162
13619
|
setEnumOptions(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));
|
|
13163
13620
|
}, [schemaHash, optionsHash, schemaUtils, uiSchemaHash, formDataHash]);
|
|
13164
13621
|
const { widget = discriminator ? "radio" : "select", title = "", placeholder = "", optionsSchemaSelector: selectorField = discriminator, hideError: uiSchemaHideError, ...uiOptions } = getUiOptions(uiSchema);
|
|
@@ -13197,24 +13654,24 @@ function LayoutMultiSchemaField(props) {
|
|
|
13197
13654
|
|
|
13198
13655
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/MultiSchemaField.js
|
|
13199
13656
|
import { jsx as _jsx11 } from "react/jsx-runtime";
|
|
13200
|
-
import { useCallback as
|
|
13657
|
+
import { useCallback as useCallback6, useEffect as useEffect8, useMemo as useMemo7, useRef as useRef8, useState as useState8 } from "react";
|
|
13201
13658
|
function AnyOfField(props) {
|
|
13202
13659
|
const { name, disabled = false, errorSchema, formData, fieldPathId, onBlur, onChange, onFocus, options, readonly, registry, required = false, schema, uiSchema } = props;
|
|
13203
13660
|
const { schemaUtils } = registry;
|
|
13204
13661
|
const formDataHash = hashObject(formData ?? null);
|
|
13205
|
-
const retrievedOptions =
|
|
13662
|
+
const retrievedOptions = useMemo7(
|
|
13206
13663
|
() => options.map((opt) => schemaUtils.retrieveSchema(opt, formData)),
|
|
13207
13664
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- formDataHash is the value-stable proxy for formData
|
|
13208
13665
|
[options, schemaUtils, formDataHash]
|
|
13209
13666
|
);
|
|
13210
|
-
const [selectedOption, setSelectedOption] =
|
|
13667
|
+
const [selectedOption, setSelectedOption] = useState8(() => {
|
|
13211
13668
|
const discriminator = getDiscriminatorFieldFromSchema(schema);
|
|
13212
13669
|
return schemaUtils.getClosestMatchingOption(formData, retrievedOptions, 0, discriminator);
|
|
13213
13670
|
});
|
|
13214
|
-
const skipNextOptionRecalculation =
|
|
13215
|
-
const prevFormDataRef =
|
|
13216
|
-
const prevFieldIdRef =
|
|
13217
|
-
|
|
13671
|
+
const skipNextOptionRecalculation = useRef8(false);
|
|
13672
|
+
const prevFormDataRef = useRef8(formData);
|
|
13673
|
+
const prevFieldIdRef = useRef8(fieldPathId.$id);
|
|
13674
|
+
useEffect8(() => {
|
|
13218
13675
|
const prevFormData = prevFormDataRef.current;
|
|
13219
13676
|
const prevFieldId = prevFieldIdRef.current;
|
|
13220
13677
|
prevFormDataRef.current = formData;
|
|
@@ -13232,7 +13689,7 @@ function AnyOfField(props) {
|
|
|
13232
13689
|
}
|
|
13233
13690
|
});
|
|
13234
13691
|
const fieldId = `${fieldPathId.$id}${schema.oneOf ? "__oneof_select" : "__anyof_select"}`;
|
|
13235
|
-
const onOptionChange =
|
|
13692
|
+
const onOptionChange = useCallback6(
|
|
13236
13693
|
(option2) => {
|
|
13237
13694
|
if (disabled || readonly) {
|
|
13238
13695
|
return;
|
|
@@ -13312,10 +13769,10 @@ function AnyOfField(props) {
|
|
|
13312
13769
|
var MultiSchemaField_default = AnyOfField;
|
|
13313
13770
|
|
|
13314
13771
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/NullField.js
|
|
13315
|
-
import { useEffect as
|
|
13772
|
+
import { useEffect as useEffect9 } from "react";
|
|
13316
13773
|
function NullField(props) {
|
|
13317
13774
|
const { formData, onChange, fieldPathId } = props;
|
|
13318
|
-
|
|
13775
|
+
useEffect9(() => {
|
|
13319
13776
|
if (formData === void 0) {
|
|
13320
13777
|
onChange(null, fieldPathId.path);
|
|
13321
13778
|
}
|
|
@@ -13326,17 +13783,17 @@ var NullField_default = NullField;
|
|
|
13326
13783
|
|
|
13327
13784
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/NumberField.js
|
|
13328
13785
|
import { jsx as _jsx12 } from "react/jsx-runtime";
|
|
13329
|
-
import { useState as
|
|
13786
|
+
import { useState as useState9, useCallback as useCallback7 } from "react";
|
|
13330
13787
|
var trailingCharMatcherWithPrefix = /\.([0-9]*0)*$/;
|
|
13331
13788
|
var trailingCharMatcher = /[0.]0*$/;
|
|
13332
13789
|
function NumberField(props) {
|
|
13333
13790
|
const { registry, onChange, formData, value: initialValue } = props;
|
|
13334
|
-
const [lastValue, setLastValue] =
|
|
13791
|
+
const [lastValue, setLastValue] = useState9(initialValue);
|
|
13335
13792
|
const { StringField: StringField2 } = registry.fields;
|
|
13336
13793
|
const separator = getDecimalSeparator();
|
|
13337
13794
|
const escapedSeparator = separator === "." ? "\\." : separator;
|
|
13338
13795
|
let value = formData;
|
|
13339
|
-
const handleChange =
|
|
13796
|
+
const handleChange = useCallback7((newValue, path, errorSchema, id) => {
|
|
13340
13797
|
setLastValue(newValue);
|
|
13341
13798
|
const standardValue = typeof newValue === "string" ? newValue.replace(separator, ".") : newValue;
|
|
13342
13799
|
const normalizedValue = `${standardValue}`.startsWith(".") ? `0${standardValue}` : standardValue;
|
|
@@ -13366,7 +13823,7 @@ var NumberField_default = NumberField;
|
|
|
13366
13823
|
|
|
13367
13824
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/ObjectField.js
|
|
13368
13825
|
import { jsx as _jsx13, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13369
|
-
import { memo as memo2, useCallback as
|
|
13826
|
+
import { memo as memo2, useCallback as useCallback8, useMemo as useMemo9, useRef as useRef10, useState as useState10 } from "react";
|
|
13370
13827
|
|
|
13371
13828
|
// ../../node_modules/.pnpm/markdown-to-jsx@9.10.2_react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/markdown-to-jsx/dist/react.js
|
|
13372
13829
|
import * as i0 from "react";
|
|
@@ -16501,28 +16958,28 @@ function getAdditionalPropertyOrder(schemaProperties) {
|
|
|
16501
16958
|
}
|
|
16502
16959
|
function ObjectFieldPropertyFn(props) {
|
|
16503
16960
|
const { fieldPathId, schema, registry, uiSchema, errorSchema, formData, onChange, onBlur, onFocus, disabled, readonly, required, hideError, propertyName, handleKeyRename, handleRemoveProperty, addedByAdditionalProperties } = props;
|
|
16504
|
-
const [wasPropertyKeyModified, setWasPropertyKeyModified] =
|
|
16961
|
+
const [wasPropertyKeyModified, setWasPropertyKeyModified] = useState10(false);
|
|
16505
16962
|
const { globalFormOptions, fields: fields2 } = registry;
|
|
16506
16963
|
const { SchemaField: SchemaField2 } = fields2;
|
|
16507
16964
|
const innerFieldIdPathId = useDeepCompareMemo(toFieldPathId(propertyName, globalFormOptions, fieldPathId.path));
|
|
16508
|
-
const onPropertyChange =
|
|
16965
|
+
const onPropertyChange = useCallback8((value, path, newErrorSchema, id) => {
|
|
16509
16966
|
let normalizedValue = value;
|
|
16510
16967
|
if (value === void 0 && addedByAdditionalProperties && deepEquals_default(path, innerFieldIdPathId.path)) {
|
|
16511
16968
|
normalizedValue = "";
|
|
16512
16969
|
}
|
|
16513
16970
|
onChange(normalizedValue, path, newErrorSchema, id);
|
|
16514
16971
|
}, [onChange, addedByAdditionalProperties, innerFieldIdPathId]);
|
|
16515
|
-
const onKeyRename =
|
|
16972
|
+
const onKeyRename = useCallback8((value) => {
|
|
16516
16973
|
if (propertyName !== value) {
|
|
16517
16974
|
setWasPropertyKeyModified(true);
|
|
16518
16975
|
}
|
|
16519
16976
|
handleKeyRename(propertyName, value);
|
|
16520
16977
|
}, [propertyName, handleKeyRename]);
|
|
16521
|
-
const onKeyRenameBlur =
|
|
16978
|
+
const onKeyRenameBlur = useCallback8((event) => {
|
|
16522
16979
|
const { target: { value } } = event;
|
|
16523
16980
|
onKeyRename(value);
|
|
16524
16981
|
}, [onKeyRename]);
|
|
16525
|
-
const onRemoveProperty =
|
|
16982
|
+
const onRemoveProperty = useCallback8(() => {
|
|
16526
16983
|
handleRemoveProperty(propertyName);
|
|
16527
16984
|
}, [propertyName, handleRemoveProperty]);
|
|
16528
16985
|
return _jsx13(SchemaField2, { name: propertyName, required, schema, uiSchema, errorSchema, fieldPathId: innerFieldIdPathId, formData, wasPropertyKeyModified, onKeyRename, onKeyRenameBlur, onRemoveProperty, onChange: onPropertyChange, onBlur, onFocus, registry, disabled, readonly, hideError });
|
|
@@ -16532,15 +16989,15 @@ function ObjectField(props) {
|
|
|
16532
16989
|
const { schema: rawSchema, uiSchema = {}, formData, errorSchema, fieldPathId, name, required = false, disabled, readonly, hideError, onBlur, onFocus, onChange, registry, title } = props;
|
|
16533
16990
|
const { fields: fields2, schemaUtils, translateString, globalUiOptions } = registry;
|
|
16534
16991
|
const { OptionalDataControlsField: OptionalDataControlsField2 } = fields2;
|
|
16535
|
-
const formDataRef =
|
|
16992
|
+
const formDataRef = useRef10(formData);
|
|
16536
16993
|
formDataRef.current = formData;
|
|
16537
|
-
const schema =
|
|
16538
|
-
const uiOptions =
|
|
16539
|
-
const schemaProperties =
|
|
16994
|
+
const schema = useMemo9(() => schemaUtils.retrieveSchema(rawSchema, formData, true), [schemaUtils, rawSchema, formData]);
|
|
16995
|
+
const uiOptions = useMemo9(() => getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
|
|
16996
|
+
const schemaProperties = useMemo9(() => schema.properties ?? {}, [schema.properties]);
|
|
16540
16997
|
const childFieldPathId = props.childFieldPathId ?? fieldPathId;
|
|
16541
|
-
const lastRenamedProperty =
|
|
16542
|
-
const [additionalPropertyOrder, setAdditionalPropertyOrder] =
|
|
16543
|
-
const definedPropertyOrder =
|
|
16998
|
+
const lastRenamedProperty = useRef10({ previousKey: "", currentKey: void 0 });
|
|
16999
|
+
const [additionalPropertyOrder, setAdditionalPropertyOrder] = useState10(() => getAdditionalPropertyOrder(schemaProperties));
|
|
17000
|
+
const definedPropertyOrder = useMemo9(() => {
|
|
16544
17001
|
const additionalPropertySet = new Set(getAdditionalPropertyOrder(schemaProperties));
|
|
16545
17002
|
return Object.keys(schemaProperties).filter((property) => !additionalPropertySet.has(property));
|
|
16546
17003
|
}, [schemaProperties]);
|
|
@@ -16549,7 +17006,7 @@ function ObjectField(props) {
|
|
|
16549
17006
|
const renderOptionalField = shouldRenderOptionalField(registry, schema, required, uiSchema);
|
|
16550
17007
|
const hasFormData = isFormDataAvailable(formData);
|
|
16551
17008
|
let orderedProperties = [];
|
|
16552
|
-
const getAvailableKey =
|
|
17009
|
+
const getAvailableKey = useCallback8((preferredKey, existingFormData) => {
|
|
16553
17010
|
const { duplicateKeySuffixSeparator = "-" } = getUiOptions(uiSchema, globalUiOptions);
|
|
16554
17011
|
let index2 = 0;
|
|
16555
17012
|
let newKey = preferredKey;
|
|
@@ -16559,7 +17016,7 @@ function ObjectField(props) {
|
|
|
16559
17016
|
}
|
|
16560
17017
|
return newKey;
|
|
16561
17018
|
}, [uiSchema, globalUiOptions]);
|
|
16562
|
-
const onAddProperty =
|
|
17019
|
+
const onAddProperty = useCallback8(() => {
|
|
16563
17020
|
if (!(schema.additionalProperties || schema.patternProperties)) {
|
|
16564
17021
|
return;
|
|
16565
17022
|
}
|
|
@@ -16596,7 +17053,7 @@ function ObjectField(props) {
|
|
|
16596
17053
|
setAdditionalPropertyOrder((order) => [...order, newKey]);
|
|
16597
17054
|
onChange(newFormData, childFieldPathId.path);
|
|
16598
17055
|
}, [formData, onChange, translateString, schemaUtils, childFieldPathId, getAvailableKey, schema]);
|
|
16599
|
-
const handleKeyRename =
|
|
17056
|
+
const handleKeyRename = useCallback8((oldKey, newKey) => {
|
|
16600
17057
|
if (oldKey !== newKey) {
|
|
16601
17058
|
const currentFormData = formDataRef.current;
|
|
16602
17059
|
const actualNewKey = getAvailableKey(newKey, currentFormData);
|
|
@@ -16618,11 +17075,11 @@ function ObjectField(props) {
|
|
|
16618
17075
|
onChange(renamedObj, childFieldPathId.path);
|
|
16619
17076
|
}
|
|
16620
17077
|
}, [onChange, childFieldPathId, getAvailableKey]);
|
|
16621
|
-
const handleRemoveProperty =
|
|
17078
|
+
const handleRemoveProperty = useCallback8((key) => {
|
|
16622
17079
|
setAdditionalPropertyOrder((order) => order.filter((property) => property !== key));
|
|
16623
17080
|
onChange(ADDITIONAL_PROPERTY_KEY_REMOVE, [...childFieldPathId.path, key]);
|
|
16624
17081
|
}, [onChange, childFieldPathId]);
|
|
16625
|
-
const getStableKey =
|
|
17082
|
+
const getStableKey = useCallback8((property) => {
|
|
16626
17083
|
if (lastRenamedProperty.current.currentKey === property) {
|
|
16627
17084
|
return lastRenamedProperty.current.previousKey;
|
|
16628
17085
|
}
|
|
@@ -16709,7 +17166,7 @@ function OptionalDataControlsField(props) {
|
|
|
16709
17166
|
|
|
16710
17167
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/SchemaField.js
|
|
16711
17168
|
import { jsx as _jsx15, Fragment as _Fragment, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
16712
|
-
import { useCallback as
|
|
17169
|
+
import { useCallback as useCallback9, memo as memo3 } from "react";
|
|
16713
17170
|
var COMPONENT_TYPES = {
|
|
16714
17171
|
array: "ArrayField",
|
|
16715
17172
|
boolean: "BooleanField",
|
|
@@ -16745,7 +17202,7 @@ function SchemaFieldRender(props) {
|
|
|
16745
17202
|
const { schemaUtils, globalFormOptions, globalUiOptions, fields: fields2 } = registry;
|
|
16746
17203
|
const { AnyOfField: _AnyOfField, OneOfField: _OneOfField, CyclicSchemaField: CyclicSchemaField2 } = fields2;
|
|
16747
17204
|
const fieldId = fieldPathId[ID_KEY];
|
|
16748
|
-
const handleFieldComponentChange =
|
|
17205
|
+
const handleFieldComponentChange = useCallback9((newFormData, path, newErrorSchema, id2) => {
|
|
16749
17206
|
const theId = id2 || fieldId;
|
|
16750
17207
|
return onChange(newFormData, path, newErrorSchema, theId);
|
|
16751
17208
|
}, [fieldId, onChange]);
|
|
@@ -16865,7 +17322,7 @@ var SchemaField_default = SchemaField;
|
|
|
16865
17322
|
|
|
16866
17323
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/StringField.js
|
|
16867
17324
|
import { jsx as _jsx16 } from "react/jsx-runtime";
|
|
16868
|
-
import { useCallback as
|
|
17325
|
+
import { useCallback as useCallback10 } from "react";
|
|
16869
17326
|
function StringField(props) {
|
|
16870
17327
|
const { schema, name, uiSchema, fieldPathId, formData, required, disabled = false, readonly = false, autofocus = false, onChange, onBlur, onFocus, registry, rawErrors, hideError, title } = props;
|
|
16871
17328
|
const { title: schemaTitle, format: format2 } = schema;
|
|
@@ -16879,7 +17336,7 @@ function StringField(props) {
|
|
|
16879
17336
|
const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema, globalUiOptions);
|
|
16880
17337
|
const label = uiTitle ?? title ?? schemaTitle ?? name;
|
|
16881
17338
|
const Widget = getWidget(schema, widget, widgets2);
|
|
16882
|
-
const onWidgetChange =
|
|
17339
|
+
const onWidgetChange = useCallback10((value, errorSchema, id) => onChange(value, fieldPathId.path, errorSchema, id), [onChange, fieldPathId]);
|
|
16883
17340
|
return _jsx16(Widget, { options: { ...options, enumOptions }, schema, uiSchema, id: fieldPathId.$id, name, label, hideLabel: !displayLabel, hideError, value: formData, onChange: onWidgetChange, onBlur, onFocus, required, disabled, readonly, autofocus, registry, placeholder, rawErrors, htmlName: fieldPathId.name });
|
|
16884
17341
|
}
|
|
16885
17342
|
var StringField_default = StringField;
|
|
@@ -16973,7 +17430,7 @@ function ArrayFieldTitleTemplate(props) {
|
|
|
16973
17430
|
|
|
16974
17431
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/templates/BaseInputTemplate.js
|
|
16975
17432
|
import { jsx as _jsx23, Fragment as _Fragment3, jsxs as _jsxs6 } from "react/jsx-runtime";
|
|
16976
|
-
import { useCallback as
|
|
17433
|
+
import { useCallback as useCallback11 } from "react";
|
|
16977
17434
|
|
|
16978
17435
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/SchemaExamples.js
|
|
16979
17436
|
import { jsx as _jsx22 } from "react/jsx-runtime";
|
|
@@ -17028,10 +17485,10 @@ function BaseInputTemplate(props) {
|
|
|
17028
17485
|
} else {
|
|
17029
17486
|
inputValue = value == null ? "" : value;
|
|
17030
17487
|
}
|
|
17031
|
-
const handleChange =
|
|
17032
|
-
const handleBlur =
|
|
17033
|
-
const handleFocus =
|
|
17034
|
-
const handleClear =
|
|
17488
|
+
const handleChange = useCallback11(({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue), [onChange, options]);
|
|
17489
|
+
const handleBlur = useCallback11(({ target }) => onBlur(id, target?.value), [onBlur, id]);
|
|
17490
|
+
const handleFocus = useCallback11(({ target }) => onFocus(id, target?.value), [onFocus, id]);
|
|
17491
|
+
const handleClear = useCallback11((e2) => {
|
|
17035
17492
|
e2.preventDefault();
|
|
17036
17493
|
e2.stopPropagation();
|
|
17037
17494
|
onChange(options.emptyValue);
|
|
@@ -17360,13 +17817,13 @@ var AltDateWidget_default = AltDateWidget;
|
|
|
17360
17817
|
|
|
17361
17818
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/widgets/CheckboxesWidget.js
|
|
17362
17819
|
import { jsx as _jsx46, jsxs as _jsxs17 } from "react/jsx-runtime";
|
|
17363
|
-
import { useCallback as
|
|
17820
|
+
import { useCallback as useCallback12 } from "react";
|
|
17364
17821
|
function CheckboxesWidget({ id, disabled, options, value, autofocus = false, readonly, onChange, onBlur, onFocus, htmlName }) {
|
|
17365
17822
|
const { inline: inline3 = false, enumOptions, enumDisabled, emptyValue } = options;
|
|
17366
17823
|
const optionValueFormat = getOptionValueFormat(options);
|
|
17367
17824
|
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
17368
|
-
const handleBlur =
|
|
17369
|
-
const handleFocus =
|
|
17825
|
+
const handleBlur = useCallback12(({ target }) => onBlur(id, enumOptionValueDecoder(target?.value, enumOptions, optionValueFormat, emptyValue)), [onBlur, id, enumOptions, emptyValue, optionValueFormat]);
|
|
17826
|
+
const handleFocus = useCallback12(({ target }) => onFocus(id, enumOptionValueDecoder(target?.value, enumOptions, optionValueFormat, emptyValue)), [onFocus, id, enumOptions, emptyValue, optionValueFormat]);
|
|
17370
17827
|
return _jsx46("div", { className: "checkboxes", id, children: Array.isArray(enumOptions) && enumOptions.map((option, index2) => {
|
|
17371
17828
|
const checked = enumOptionsIsSelected(option.value, checkboxesValues);
|
|
17372
17829
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
@@ -17386,13 +17843,13 @@ var CheckboxesWidget_default = CheckboxesWidget;
|
|
|
17386
17843
|
|
|
17387
17844
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/widgets/CheckboxWidget.js
|
|
17388
17845
|
import { jsx as _jsx47, jsxs as _jsxs18 } from "react/jsx-runtime";
|
|
17389
|
-
import { useCallback as
|
|
17846
|
+
import { useCallback as useCallback13 } from "react";
|
|
17390
17847
|
function CheckboxWidget({ schema, uiSchema, options, id, value, disabled, readonly, label, hideLabel, autofocus = false, onBlur, onFocus, onChange, registry, htmlName, required }) {
|
|
17391
17848
|
const DescriptionFieldTemplate = getTemplate("DescriptionFieldTemplate", registry, options);
|
|
17392
17849
|
const trueValueRequired = schemaRequiresTrueValue(schema) && required;
|
|
17393
|
-
const handleChange =
|
|
17394
|
-
const handleBlur =
|
|
17395
|
-
const handleFocus =
|
|
17850
|
+
const handleChange = useCallback13((event) => onChange(event.target.checked), [onChange]);
|
|
17851
|
+
const handleBlur = useCallback13((event) => onBlur(id, event.target.checked), [onBlur, id]);
|
|
17852
|
+
const handleFocus = useCallback13((event) => onFocus(id, event.target.checked), [onFocus, id]);
|
|
17396
17853
|
const uiOptions = getUiOptions(uiSchema);
|
|
17397
17854
|
const isCheckboxWidget = uiOptions.widget === "checkbox";
|
|
17398
17855
|
const description = isCheckboxWidget ? void 0 : options.description ?? schema.description;
|
|
@@ -17418,11 +17875,11 @@ function DateTimeWidget(props) {
|
|
|
17418
17875
|
|
|
17419
17876
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/widgets/DateWidget.js
|
|
17420
17877
|
import { jsx as _jsx50 } from "react/jsx-runtime";
|
|
17421
|
-
import { useCallback as
|
|
17878
|
+
import { useCallback as useCallback14 } from "react";
|
|
17422
17879
|
function DateWidget(props) {
|
|
17423
17880
|
const { onChange, options, registry } = props;
|
|
17424
17881
|
const BaseInputTemplate2 = getTemplate("BaseInputTemplate", registry, options);
|
|
17425
|
-
const handleChange =
|
|
17882
|
+
const handleChange = useCallback14((value) => onChange(value || void 0), [onChange]);
|
|
17426
17883
|
return _jsx50(BaseInputTemplate2, { type: "date", ...props, onChange: handleChange });
|
|
17427
17884
|
}
|
|
17428
17885
|
|
|
@@ -17490,12 +17947,12 @@ function PasswordWidget(props) {
|
|
|
17490
17947
|
|
|
17491
17948
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/widgets/RadioWidget.js
|
|
17492
17949
|
import { jsx as _jsx55, jsxs as _jsxs20 } from "react/jsx-runtime";
|
|
17493
|
-
import { useCallback as
|
|
17950
|
+
import { useCallback as useCallback15 } from "react";
|
|
17494
17951
|
function RadioWidget({ options, value, required, disabled, readonly, autofocus = false, onBlur, onFocus, onChange, id, htmlName }) {
|
|
17495
17952
|
const { enumOptions, enumDisabled, inline: inline3, emptyValue } = options;
|
|
17496
17953
|
const optionValueFormat = getOptionValueFormat(options);
|
|
17497
|
-
const handleBlur =
|
|
17498
|
-
const handleFocus =
|
|
17954
|
+
const handleBlur = useCallback15(({ target }) => onBlur(id, enumOptionValueDecoder(target?.value, enumOptions, optionValueFormat, emptyValue)), [onBlur, enumOptions, emptyValue, id, optionValueFormat]);
|
|
17955
|
+
const handleFocus = useCallback15(({ target }) => onFocus(id, enumOptionValueDecoder(target?.value, enumOptions, optionValueFormat, emptyValue)), [onFocus, enumOptions, emptyValue, id, optionValueFormat]);
|
|
17499
17956
|
return _jsx55("div", { className: "field-radio-group", id, role: "radiogroup", children: Array.isArray(enumOptions) && enumOptions.map((option, i) => {
|
|
17500
17957
|
const checked = enumOptionsIsSelected(option.value, value);
|
|
17501
17958
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
|
|
@@ -17516,23 +17973,23 @@ function RangeWidget(props) {
|
|
|
17516
17973
|
|
|
17517
17974
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/widgets/RatingWidget.js
|
|
17518
17975
|
import { jsx as _jsx57, jsxs as _jsxs22 } from "react/jsx-runtime";
|
|
17519
|
-
import { useCallback as
|
|
17976
|
+
import { useCallback as useCallback16 } from "react";
|
|
17520
17977
|
function RatingWidget({ id, value, required, disabled, readonly, onChange, onFocus, onBlur, schema, options, htmlName }) {
|
|
17521
17978
|
const { stars = 5, shape = "star" } = options;
|
|
17522
17979
|
const numStars = schema.maximum ? Math.min(schema.maximum, 5) : Math.min(Math.max(stars, 1), 5);
|
|
17523
17980
|
const min2 = schema.minimum || 0;
|
|
17524
|
-
const handleStarClick =
|
|
17981
|
+
const handleStarClick = useCallback16((starValue) => {
|
|
17525
17982
|
if (!disabled && !readonly) {
|
|
17526
17983
|
onChange(starValue);
|
|
17527
17984
|
}
|
|
17528
17985
|
}, [onChange, disabled, readonly]);
|
|
17529
|
-
const handleFocus =
|
|
17986
|
+
const handleFocus = useCallback16((event) => {
|
|
17530
17987
|
if (onFocus) {
|
|
17531
17988
|
const starValue = Number(event.target.dataset.value);
|
|
17532
17989
|
onFocus(id, starValue);
|
|
17533
17990
|
}
|
|
17534
17991
|
}, [onFocus, id]);
|
|
17535
|
-
const handleBlur =
|
|
17992
|
+
const handleBlur = useCallback16((event) => {
|
|
17536
17993
|
if (onBlur) {
|
|
17537
17994
|
const starValue = Number(event.target.dataset.value);
|
|
17538
17995
|
onBlur(id, starValue);
|
|
@@ -17562,7 +18019,7 @@ function RatingWidget({ id, value, required, disabled, readonly, onChange, onFoc
|
|
|
17562
18019
|
|
|
17563
18020
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/widgets/SelectWidget.js
|
|
17564
18021
|
import { jsx as _jsx58, jsxs as _jsxs23, Fragment as _Fragment5 } from "react/jsx-runtime";
|
|
17565
|
-
import { useCallback as
|
|
18022
|
+
import { useCallback as useCallback17 } from "react";
|
|
17566
18023
|
function getValue(event, multiple) {
|
|
17567
18024
|
if (multiple) {
|
|
17568
18025
|
return Array.from(event.target.options).slice().filter((o2) => o2.selected).map((o2) => o2.value);
|
|
@@ -17573,15 +18030,15 @@ function SelectWidget({ schema, id, options, value, required, disabled, readonly
|
|
|
17573
18030
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
17574
18031
|
const emptyValue = multiple ? [] : "";
|
|
17575
18032
|
const optionValueFormat = getOptionValueFormat(options);
|
|
17576
|
-
const handleFocus =
|
|
18033
|
+
const handleFocus = useCallback17((event) => {
|
|
17577
18034
|
const newValue = getValue(event, multiple);
|
|
17578
18035
|
return onFocus(id, enumOptionValueDecoder(newValue, enumOptions, optionValueFormat, optEmptyVal));
|
|
17579
18036
|
}, [onFocus, id, multiple, enumOptions, optEmptyVal, optionValueFormat]);
|
|
17580
|
-
const handleBlur =
|
|
18037
|
+
const handleBlur = useCallback17((event) => {
|
|
17581
18038
|
const newValue = getValue(event, multiple);
|
|
17582
18039
|
return onBlur(id, enumOptionValueDecoder(newValue, enumOptions, optionValueFormat, optEmptyVal));
|
|
17583
18040
|
}, [onBlur, id, multiple, enumOptions, optEmptyVal, optionValueFormat]);
|
|
17584
|
-
const handleChange =
|
|
18041
|
+
const handleChange = useCallback17((event) => {
|
|
17585
18042
|
const newValue = getValue(event, multiple);
|
|
17586
18043
|
return onChange(enumOptionValueDecoder(newValue, enumOptions, optionValueFormat, optEmptyVal));
|
|
17587
18044
|
}, [onChange, multiple, enumOptions, optEmptyVal, optionValueFormat]);
|
|
@@ -17597,11 +18054,11 @@ var SelectWidget_default = SelectWidget;
|
|
|
17597
18054
|
|
|
17598
18055
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/widgets/TextareaWidget.js
|
|
17599
18056
|
import { jsx as _jsx59 } from "react/jsx-runtime";
|
|
17600
|
-
import { useCallback as
|
|
18057
|
+
import { useCallback as useCallback18 } from "react";
|
|
17601
18058
|
function TextareaWidget({ id, options, placeholder, value, required, disabled, readonly, autofocus = false, onChange, onBlur, onFocus, htmlName }) {
|
|
17602
|
-
const handleChange =
|
|
17603
|
-
const handleBlur =
|
|
17604
|
-
const handleFocus =
|
|
18059
|
+
const handleChange = useCallback18(({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue), [onChange, options.emptyValue]);
|
|
18060
|
+
const handleBlur = useCallback18(({ target }) => onBlur(id, target?.value), [onBlur, id]);
|
|
18061
|
+
const handleFocus = useCallback18(({ target }) => onFocus(id, target?.value), [id, onFocus]);
|
|
17605
18062
|
return _jsx59("textarea", { id, name: htmlName || id, className: "form-control", value: value || "", placeholder, required, disabled, readOnly: readonly, autoFocus: autofocus, rows: options.rows, onBlur: handleBlur, onFocus: handleFocus, onChange: handleChange, "aria-describedby": ariaDescribedByIds(id) });
|
|
17606
18063
|
}
|
|
17607
18064
|
var TextareaWidget_default = TextareaWidget;
|
|
@@ -17616,12 +18073,12 @@ function TextWidget(props) {
|
|
|
17616
18073
|
|
|
17617
18074
|
// ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/widgets/TimeWidget.js
|
|
17618
18075
|
import { jsx as _jsx61 } from "react/jsx-runtime";
|
|
17619
|
-
import { useCallback as
|
|
18076
|
+
import { useCallback as useCallback19 } from "react";
|
|
17620
18077
|
function TimeWidget(props) {
|
|
17621
18078
|
const { onChange, options, registry, schema, value } = props;
|
|
17622
18079
|
const BaseInputTemplate2 = getTemplate("BaseInputTemplate", registry, options);
|
|
17623
18080
|
const hasSecondPrecision = typeof schema.multipleOf === "number" && Number.isFinite(schema.multipleOf) && schema.multipleOf < 60;
|
|
17624
|
-
const handleChange =
|
|
18081
|
+
const handleChange = useCallback19((newValue) => {
|
|
17625
18082
|
if (!newValue) {
|
|
17626
18083
|
onChange(void 0);
|
|
17627
18084
|
} else if (hasSecondPrecision) {
|
|
@@ -18494,7 +18951,7 @@ var Form = class _Form extends Component {
|
|
|
18494
18951
|
};
|
|
18495
18952
|
|
|
18496
18953
|
// src/components/SessionPluginConfigForm.tsx
|
|
18497
|
-
import { isValidElement, useMemo as
|
|
18954
|
+
import { isValidElement, useMemo as useMemo10, useState as useState11 } from "react";
|
|
18498
18955
|
|
|
18499
18956
|
// src/components/plugin-config-schema.ts
|
|
18500
18957
|
function asSchema(value) {
|
|
@@ -18689,7 +19146,7 @@ function configDraftOperations(initial, values, retained, removed) {
|
|
|
18689
19146
|
}
|
|
18690
19147
|
|
|
18691
19148
|
// src/components/SessionPluginConfigForm.tsx
|
|
18692
|
-
import { Fragment as Fragment2, jsx as
|
|
19149
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
18693
19150
|
var defaults = getDefaultRegistry();
|
|
18694
19151
|
var validator = {
|
|
18695
19152
|
isValid(schema, data, rootSchema) {
|
|
@@ -18746,7 +19203,7 @@ function presentationSchema(schema) {
|
|
|
18746
19203
|
}
|
|
18747
19204
|
function ConfigMultiSchemaField(props) {
|
|
18748
19205
|
return /* @__PURE__ */ jsxs3("div", { className: "rjsf-field", children: [
|
|
18749
|
-
/* @__PURE__ */
|
|
19206
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: isValidElement(props.selector) ? props.selector.props.id : void 0, children: "\u914D\u7F6E\u65B9\u5F0F" }),
|
|
18750
19207
|
props.selector,
|
|
18751
19208
|
props.optionSchemaField
|
|
18752
19209
|
] });
|
|
@@ -18774,12 +19231,12 @@ function ConfigSchemaField(inputProps) {
|
|
|
18774
19231
|
const pointer = pointerOf(originalConfigPath(fieldPathId.path, context.removed));
|
|
18775
19232
|
const originalMarker = [...context.retained].find(([, path2]) => path2 === pointer)?.[0];
|
|
18776
19233
|
if (schema.const !== void 0 && schema.writeOnly !== true)
|
|
18777
|
-
return /* @__PURE__ */
|
|
19234
|
+
return /* @__PURE__ */ jsx6(Fragment2, { children: context.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */ jsx6("p", { role: "alert", children: error.message }, error.message)) });
|
|
18778
19235
|
if (schema.writeOnly === true) {
|
|
18779
19236
|
const kept = typeof formData === "string" && context.retained.has(formData);
|
|
18780
19237
|
return /* @__PURE__ */ jsxs3("div", { className: "rjsf-field", children: [
|
|
18781
19238
|
Array.isArray(schema.type) && schema.type.includes("null") ? /* @__PURE__ */ jsxs3("label", { children: [
|
|
18782
|
-
/* @__PURE__ */
|
|
19239
|
+
/* @__PURE__ */ jsx6(
|
|
18783
19240
|
"input",
|
|
18784
19241
|
{
|
|
18785
19242
|
type: "checkbox",
|
|
@@ -18791,8 +19248,8 @@ function ConfigSchemaField(inputProps) {
|
|
|
18791
19248
|
schema.title ?? props.name,
|
|
18792
19249
|
"\uFF1A\u7F6E\u4E3A\u7A7A\u503C"
|
|
18793
19250
|
] }) : null,
|
|
18794
|
-
/* @__PURE__ */
|
|
18795
|
-
/* @__PURE__ */
|
|
19251
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: fieldPathId.$id, "data-required": props.required, children: schema.title ?? props.name }),
|
|
19252
|
+
/* @__PURE__ */ jsx6(
|
|
18796
19253
|
"input",
|
|
18797
19254
|
{
|
|
18798
19255
|
id: fieldPathId.$id,
|
|
@@ -18805,8 +19262,8 @@ function ConfigSchemaField(inputProps) {
|
|
|
18805
19262
|
onChange: (event) => onChange(event.target.value || originalMarker, fieldPathId.path)
|
|
18806
19263
|
}
|
|
18807
19264
|
),
|
|
18808
|
-
kept ? /* @__PURE__ */
|
|
18809
|
-
formData !== void 0 ? /* @__PURE__ */
|
|
19265
|
+
kept ? /* @__PURE__ */ jsx6("p", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8" }) : null,
|
|
19266
|
+
formData !== void 0 ? /* @__PURE__ */ jsx6(
|
|
18810
19267
|
"button",
|
|
18811
19268
|
{
|
|
18812
19269
|
type: "button",
|
|
@@ -18815,8 +19272,8 @@ function ConfigSchemaField(inputProps) {
|
|
|
18815
19272
|
children: "\u6E05\u9664\u5DF2\u4FDD\u5B58\u7684\u503C"
|
|
18816
19273
|
}
|
|
18817
19274
|
) : null,
|
|
18818
|
-
schema.description ? /* @__PURE__ */
|
|
18819
|
-
context.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */
|
|
19275
|
+
schema.description ? /* @__PURE__ */ jsx6("p", { children: schema.description }) : null,
|
|
19276
|
+
context.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */ jsx6("p", { role: "alert", children: error.message }, error.message))
|
|
18820
19277
|
] });
|
|
18821
19278
|
}
|
|
18822
19279
|
const types = Array.isArray(schema.type) ? schema.type : [schema.type];
|
|
@@ -18825,7 +19282,7 @@ function ConfigSchemaField(inputProps) {
|
|
|
18825
19282
|
const inner = { ...schema, type: nonNull[0] };
|
|
18826
19283
|
return /* @__PURE__ */ jsxs3("div", { className: "rjsf-field", children: [
|
|
18827
19284
|
/* @__PURE__ */ jsxs3("label", { children: [
|
|
18828
|
-
/* @__PURE__ */
|
|
19285
|
+
/* @__PURE__ */ jsx6(
|
|
18829
19286
|
"input",
|
|
18830
19287
|
{
|
|
18831
19288
|
type: "checkbox",
|
|
@@ -18840,28 +19297,28 @@ function ConfigSchemaField(inputProps) {
|
|
|
18840
19297
|
schema.title ?? props.name,
|
|
18841
19298
|
"\uFF1A\u7F6E\u4E3A\u7A7A\u503C"
|
|
18842
19299
|
] }),
|
|
18843
|
-
nonNull.length && formData !== null ? /* @__PURE__ */
|
|
19300
|
+
nonNull.length && formData !== null ? /* @__PURE__ */ jsx6(defaults.fields.SchemaField, { ...props, schema: inner }) : null
|
|
18844
19301
|
] });
|
|
18845
19302
|
}
|
|
18846
|
-
return /* @__PURE__ */
|
|
19303
|
+
return /* @__PURE__ */ jsx6(defaults.fields.SchemaField, { ...props });
|
|
18847
19304
|
}
|
|
18848
19305
|
function ConfigFieldTemplate(props) {
|
|
18849
19306
|
const pointer = pointerOf(
|
|
18850
19307
|
originalConfigPath(props.fieldPathId.path, props.registry.formContext.removed)
|
|
18851
19308
|
);
|
|
18852
19309
|
return /* @__PURE__ */ jsxs3("div", { className: props.classNames, hidden: props.hidden, children: [
|
|
18853
|
-
props.displayLabel ? /* @__PURE__ */
|
|
19310
|
+
props.displayLabel ? /* @__PURE__ */ jsx6("label", { htmlFor: props.id, "data-required": props.required, children: props.label }) : null,
|
|
18854
19311
|
props.displayLabel ? props.description : null,
|
|
18855
19312
|
props.children,
|
|
18856
19313
|
props.help,
|
|
18857
|
-
props.registry.formContext.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */
|
|
19314
|
+
props.registry.formContext.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */ jsx6("p", { role: "alert", children: error.message }, error.message))
|
|
18858
19315
|
] });
|
|
18859
19316
|
}
|
|
18860
19317
|
function ConfigArrayItem(props) {
|
|
18861
19318
|
const { buttonsProps: buttons, registry } = props;
|
|
18862
19319
|
return /* @__PURE__ */ jsxs3("div", { className: "rjsf-array-item", children: [
|
|
18863
19320
|
props.children,
|
|
18864
|
-
buttons.hasRemove ? /* @__PURE__ */
|
|
19321
|
+
buttons.hasRemove ? /* @__PURE__ */ jsx6(
|
|
18865
19322
|
"button",
|
|
18866
19323
|
{
|
|
18867
19324
|
type: "button",
|
|
@@ -18876,7 +19333,7 @@ function ConfigArrayItem(props) {
|
|
|
18876
19333
|
if (previous !== void 0) registry.formContext.removed.add(pointerOf(path));
|
|
18877
19334
|
buttons.onRemoveItem(event);
|
|
18878
19335
|
},
|
|
18879
|
-
children: /* @__PURE__ */
|
|
19336
|
+
children: /* @__PURE__ */ jsx6(Trash2, { size: 14 })
|
|
18880
19337
|
}
|
|
18881
19338
|
) : null
|
|
18882
19339
|
] });
|
|
@@ -18891,12 +19348,12 @@ function SessionPluginConfigForm({
|
|
|
18891
19348
|
submitLabel = "\u4FDD\u5B58",
|
|
18892
19349
|
submittingLabel = "\u4FDD\u5B58\u4E2D\u2026"
|
|
18893
19350
|
}) {
|
|
18894
|
-
const [initial] =
|
|
18895
|
-
const [values, setValues] =
|
|
18896
|
-
const [removed] =
|
|
18897
|
-
const [draftFailure, setDraftFailure] =
|
|
18898
|
-
const support =
|
|
18899
|
-
const schema =
|
|
19351
|
+
const [initial] = useState11(() => createConfigDraft(config));
|
|
19352
|
+
const [values, setValues] = useState11(initial.values);
|
|
19353
|
+
const [removed] = useState11(() => /* @__PURE__ */ new Set());
|
|
19354
|
+
const [draftFailure, setDraftFailure] = useState11(null);
|
|
19355
|
+
const support = useMemo10(() => formSupport(config.schema), [config.schema]);
|
|
19356
|
+
const schema = useMemo10(() => {
|
|
18900
19357
|
try {
|
|
18901
19358
|
return config.schema ? presentationSchema(config.schema) : null;
|
|
18902
19359
|
} catch {
|
|
@@ -18913,11 +19370,11 @@ function SessionPluginConfigForm({
|
|
|
18913
19370
|
};
|
|
18914
19371
|
if (!schema || support)
|
|
18915
19372
|
return /* @__PURE__ */ jsxs3("div", { className: "space-y-3 text-xs", children: [
|
|
18916
|
-
/* @__PURE__ */
|
|
18917
|
-
/* @__PURE__ */
|
|
19373
|
+
/* @__PURE__ */ jsx6("p", { children: support ?? "\u914D\u7F6E\u58F0\u660E\u7684\u7EC4\u5408\u65E0\u6CD5\u5448\u73B0\uFF0C\u8BF7\u8054\u7CFB\u63D2\u4EF6\u63D0\u4F9B\u65B9" }),
|
|
19374
|
+
/* @__PURE__ */ jsx6("button", { type: "button", onClick: onCancel, children: "\u5173\u95ED" })
|
|
18918
19375
|
] });
|
|
18919
19376
|
return /* @__PURE__ */ jsxs3("div", { className: "blade-plugin-config text-xs", children: [
|
|
18920
|
-
/* @__PURE__ */
|
|
19377
|
+
/* @__PURE__ */ jsx6("style", { children: `
|
|
18921
19378
|
.blade-plugin-config .rjsf-field, .blade-plugin-config fieldset { min-width:0; margin:0 0 10px; padding:0; border:0 }
|
|
18922
19379
|
.blade-plugin-config label, .blade-plugin-config legend { display:block; font-size:12px; font-weight:500; overflow-wrap:anywhere; margin-bottom:4px }
|
|
18923
19380
|
.blade-plugin-config label[data-required=true]::after { content:' *'; color:hsl(var(--destructive)) }
|
|
@@ -18930,8 +19387,8 @@ function SessionPluginConfigForm({
|
|
|
18930
19387
|
.blade-plugin-config button:disabled { opacity:.5 }
|
|
18931
19388
|
.blade-plugin-config .control-label { display:block }
|
|
18932
19389
|
` }),
|
|
18933
|
-
failure || draftFailure ? /* @__PURE__ */
|
|
18934
|
-
/* @__PURE__ */
|
|
19390
|
+
failure || draftFailure ? /* @__PURE__ */ jsx6("p", { role: "alert", children: failure ?? draftFailure }) : null,
|
|
19391
|
+
/* @__PURE__ */ jsx6(
|
|
18935
19392
|
Form,
|
|
18936
19393
|
{
|
|
18937
19394
|
schema,
|
|
@@ -18945,7 +19402,7 @@ function SessionPluginConfigForm({
|
|
|
18945
19402
|
MultiSchemaFieldTemplate: ConfigMultiSchemaField,
|
|
18946
19403
|
ButtonTemplates: {
|
|
18947
19404
|
...defaults.templates.ButtonTemplates,
|
|
18948
|
-
AddButton: (props) => /* @__PURE__ */
|
|
19405
|
+
AddButton: (props) => /* @__PURE__ */ jsx6(
|
|
18949
19406
|
"button",
|
|
18950
19407
|
{
|
|
18951
19408
|
type: "button",
|
|
@@ -18953,7 +19410,7 @@ function SessionPluginConfigForm({
|
|
|
18953
19410
|
"aria-label": "\u6DFB\u52A0\u4E00\u9879",
|
|
18954
19411
|
disabled: props.disabled,
|
|
18955
19412
|
onClick: props.onClick,
|
|
18956
|
-
children: /* @__PURE__ */
|
|
19413
|
+
children: /* @__PURE__ */ jsx6(Plus, { size: 14 })
|
|
18957
19414
|
}
|
|
18958
19415
|
)
|
|
18959
19416
|
}
|
|
@@ -18995,8 +19452,8 @@ function SessionPluginConfigForm({
|
|
|
18995
19452
|
}
|
|
18996
19453
|
},
|
|
18997
19454
|
children: /* @__PURE__ */ jsxs3("div", { className: "flex justify-end gap-2", children: [
|
|
18998
|
-
/* @__PURE__ */
|
|
18999
|
-
/* @__PURE__ */
|
|
19455
|
+
/* @__PURE__ */ jsx6("button", { type: "button", onClick: onCancel, children: "\u53D6\u6D88" }),
|
|
19456
|
+
/* @__PURE__ */ jsx6("button", { type: "submit", disabled: submitting, children: submitting ? submittingLabel : submitLabel })
|
|
19000
19457
|
] })
|
|
19001
19458
|
}
|
|
19002
19459
|
)
|
|
@@ -19004,8 +19461,8 @@ function SessionPluginConfigForm({
|
|
|
19004
19461
|
}
|
|
19005
19462
|
|
|
19006
19463
|
// src/components/SessionPluginIcon.tsx
|
|
19007
|
-
import { useEffect as
|
|
19008
|
-
import { jsx as
|
|
19464
|
+
import { useEffect as useEffect10, useState as useState12 } from "react";
|
|
19465
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
19009
19466
|
function sessionPluginLabel(plugin) {
|
|
19010
19467
|
const display = typeof plugin.display_name === "string" ? plugin.display_name.trim() : "";
|
|
19011
19468
|
return display || plugin.name;
|
|
@@ -19030,9 +19487,9 @@ function iconBlob(client, sessionId, name, token) {
|
|
|
19030
19487
|
return pending;
|
|
19031
19488
|
}
|
|
19032
19489
|
function SessionPluginIcon({ client, sessionId, plugin, size: size4 = 20, shape = "rounded", className }) {
|
|
19033
|
-
const [url, setUrl] =
|
|
19490
|
+
const [url, setUrl] = useState12(null);
|
|
19034
19491
|
const token = plugin.icon;
|
|
19035
|
-
|
|
19492
|
+
useEffect10(() => {
|
|
19036
19493
|
setUrl(null);
|
|
19037
19494
|
if (!token) return;
|
|
19038
19495
|
let alive = true;
|
|
@@ -19050,14 +19507,14 @@ function SessionPluginIcon({ client, sessionId, plugin, size: size4 = 20, shape
|
|
|
19050
19507
|
const frame = `flex shrink-0 items-center justify-center overflow-hidden ${shape === "circle" ? "rounded-full" : "rounded"} ${className ?? ""}`;
|
|
19051
19508
|
const frameStyle = { width: size4, height: size4 };
|
|
19052
19509
|
if (!url) {
|
|
19053
|
-
return /* @__PURE__ */
|
|
19510
|
+
return /* @__PURE__ */ jsx7("span", { className: `${frame} bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]`, style: frameStyle, "data-plugin-icon": "placeholder", children: /* @__PURE__ */ jsx7(Puzzle, { "aria-hidden": true, size: Math.round(size4 * 0.7) }) });
|
|
19054
19511
|
}
|
|
19055
|
-
return /* @__PURE__ */
|
|
19512
|
+
return /* @__PURE__ */ jsx7("span", { className: frame, style: frameStyle, "data-plugin-icon": "image", children: /* @__PURE__ */ jsx7("img", { src: url, alt: "", "aria-hidden": true, className: "h-full w-full object-cover", onError: () => setUrl(null) }) });
|
|
19056
19513
|
}
|
|
19057
19514
|
|
|
19058
19515
|
// src/components/SessionPluginConfigDialog.tsx
|
|
19059
|
-
import { useEffect as
|
|
19060
|
-
import { Fragment as Fragment3, jsx as
|
|
19516
|
+
import { useEffect as useEffect11, useRef as useRef11, useState as useState13 } from "react";
|
|
19517
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
19061
19518
|
async function readFailure(error) {
|
|
19062
19519
|
const response = error?.response;
|
|
19063
19520
|
if (!response || typeof response.json !== "function") {
|
|
@@ -19084,7 +19541,7 @@ function SessionPluginConfigDialog({
|
|
|
19084
19541
|
plugin,
|
|
19085
19542
|
...props
|
|
19086
19543
|
}) {
|
|
19087
|
-
return /* @__PURE__ */
|
|
19544
|
+
return /* @__PURE__ */ jsx8(
|
|
19088
19545
|
ConfigDialogState,
|
|
19089
19546
|
{
|
|
19090
19547
|
client,
|
|
@@ -19102,11 +19559,11 @@ function ConfigDialogState({
|
|
|
19102
19559
|
onSaved,
|
|
19103
19560
|
onClose
|
|
19104
19561
|
}) {
|
|
19105
|
-
const [host, setHost] =
|
|
19106
|
-
const [restarting, setRestarting] =
|
|
19107
|
-
const [scope, setScope] =
|
|
19562
|
+
const [host, setHost] = useState13(null);
|
|
19563
|
+
const [restarting, setRestarting] = useState13(false);
|
|
19564
|
+
const [scope, setScope] = useState13("personal");
|
|
19108
19565
|
const waitingForHost = host?.state === "starting" || host?.state === "updating";
|
|
19109
|
-
|
|
19566
|
+
useEffect11(() => {
|
|
19110
19567
|
if (!waitingForHost) return;
|
|
19111
19568
|
const abort = new AbortController();
|
|
19112
19569
|
let timer;
|
|
@@ -19124,18 +19581,18 @@ function ConfigDialogState({
|
|
|
19124
19581
|
clearTimeout(timer);
|
|
19125
19582
|
};
|
|
19126
19583
|
}, [client, sessionId, plugin.name, scope, waitingForHost]);
|
|
19127
|
-
const [canConfigureGlobal, setCanConfigureGlobal] =
|
|
19128
|
-
const [config, setConfig] =
|
|
19129
|
-
const [loading, setLoading] =
|
|
19130
|
-
const [loadFailure, setLoadFailure] =
|
|
19131
|
-
const [saving, setSaving] =
|
|
19132
|
-
const [failure, setFailure] =
|
|
19133
|
-
const [fieldErrors, setFieldErrors] =
|
|
19134
|
-
const [formVersion, setFormVersion] =
|
|
19135
|
-
const alive =
|
|
19136
|
-
const generation2 =
|
|
19137
|
-
const dialog =
|
|
19138
|
-
|
|
19584
|
+
const [canConfigureGlobal, setCanConfigureGlobal] = useState13(false);
|
|
19585
|
+
const [config, setConfig] = useState13(null);
|
|
19586
|
+
const [loading, setLoading] = useState13(true);
|
|
19587
|
+
const [loadFailure, setLoadFailure] = useState13(null);
|
|
19588
|
+
const [saving, setSaving] = useState13(false);
|
|
19589
|
+
const [failure, setFailure] = useState13(null);
|
|
19590
|
+
const [fieldErrors, setFieldErrors] = useState13([]);
|
|
19591
|
+
const [formVersion, setFormVersion] = useState13(0);
|
|
19592
|
+
const alive = useRef11(true);
|
|
19593
|
+
const generation2 = useRef11(0);
|
|
19594
|
+
const dialog = useRef11(null);
|
|
19595
|
+
useEffect11(() => {
|
|
19139
19596
|
const element = dialog.current;
|
|
19140
19597
|
if (!element || element.open) return;
|
|
19141
19598
|
if (typeof element.showModal === "function") element.showModal();
|
|
@@ -19161,7 +19618,7 @@ function ConfigDialogState({
|
|
|
19161
19618
|
if (alive.current && generation2.current === current) setLoading(false);
|
|
19162
19619
|
}
|
|
19163
19620
|
};
|
|
19164
|
-
|
|
19621
|
+
useEffect11(() => {
|
|
19165
19622
|
alive.current = true;
|
|
19166
19623
|
setConfig(null);
|
|
19167
19624
|
setFailure(null);
|
|
@@ -19206,7 +19663,7 @@ function ConfigDialogState({
|
|
|
19206
19663
|
}
|
|
19207
19664
|
};
|
|
19208
19665
|
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
19209
|
-
/* @__PURE__ */
|
|
19666
|
+
/* @__PURE__ */ jsx8("style", { children: ".blade-plugin-dialog::backdrop { background: rgb(0 0 0 / 40%); }" }),
|
|
19210
19667
|
/* @__PURE__ */ jsxs4(
|
|
19211
19668
|
"dialog",
|
|
19212
19669
|
{
|
|
@@ -19233,8 +19690,8 @@ function ConfigDialogState({
|
|
|
19233
19690
|
className: "blade-plugin-dialog max-h-[80vh] overflow-y-auto rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-4 text-[hsl(var(--popover-foreground))] shadow-lg",
|
|
19234
19691
|
children: [
|
|
19235
19692
|
/* @__PURE__ */ jsxs4("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
19236
|
-
/* @__PURE__ */
|
|
19237
|
-
/* @__PURE__ */
|
|
19693
|
+
/* @__PURE__ */ jsx8(SessionPluginIcon, { client, sessionId, plugin }),
|
|
19694
|
+
/* @__PURE__ */ jsx8(
|
|
19238
19695
|
"span",
|
|
19239
19696
|
{
|
|
19240
19697
|
className: "min-w-0 flex-1 truncate text-sm font-medium",
|
|
@@ -19242,7 +19699,7 @@ function ConfigDialogState({
|
|
|
19242
19699
|
children: sessionPluginLabel(plugin)
|
|
19243
19700
|
}
|
|
19244
19701
|
),
|
|
19245
|
-
/* @__PURE__ */
|
|
19702
|
+
/* @__PURE__ */ jsx8(
|
|
19246
19703
|
"button",
|
|
19247
19704
|
{
|
|
19248
19705
|
type: "button",
|
|
@@ -19254,8 +19711,8 @@ function ConfigDialogState({
|
|
|
19254
19711
|
)
|
|
19255
19712
|
] }),
|
|
19256
19713
|
canConfigureGlobal ? /* @__PURE__ */ jsxs4("div", { className: "mb-3 flex gap-2 text-xs", children: [
|
|
19257
|
-
/* @__PURE__ */
|
|
19258
|
-
/* @__PURE__ */
|
|
19714
|
+
/* @__PURE__ */ jsx8("button", { type: "button", disabled: saving, "aria-pressed": scope === "personal", onClick: () => setScope("personal"), children: "\u6211\u7684\u767B\u5F55" }),
|
|
19715
|
+
/* @__PURE__ */ jsx8("button", { type: "button", disabled: saving, "aria-pressed": scope === "global", onClick: () => setScope("global"), children: "\u7EC4\u7EC7\u5171\u4EAB\u914D\u7F6E" })
|
|
19259
19716
|
] }) : null,
|
|
19260
19717
|
host ? /* @__PURE__ */ jsxs4("div", { className: "mb-3 space-y-1 text-xs", children: [
|
|
19261
19718
|
/* @__PURE__ */ jsxs4("p", { children: [
|
|
@@ -19272,25 +19729,25 @@ function ConfigDialogState({
|
|
|
19272
19729
|
" \xB7 \u914D\u7F6E\uFF1A",
|
|
19273
19730
|
host.revision
|
|
19274
19731
|
] }),
|
|
19275
|
-
/* @__PURE__ */
|
|
19732
|
+
/* @__PURE__ */ jsx8("button", { type: "button", disabled: restarting || saving, onClick: () => {
|
|
19276
19733
|
setRestarting(true);
|
|
19277
19734
|
void client.sessions.restartSessionPluginHost(sessionId, plugin.name).then(() => load()).catch(() => setFailure("\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")).finally(() => {
|
|
19278
19735
|
if (alive.current) setRestarting(false);
|
|
19279
19736
|
});
|
|
19280
19737
|
}, children: restarting ? "\u6B63\u5728\u91CD\u542F\u2026" : "\u91CD\u542F\u670D\u52A1" }),
|
|
19281
19738
|
host.recent?.length ? /* @__PURE__ */ jsxs4("details", { children: [
|
|
19282
|
-
/* @__PURE__ */
|
|
19283
|
-
host.recent.map((line, index2) => /* @__PURE__ */
|
|
19739
|
+
/* @__PURE__ */ jsx8("summary", { children: "\u6700\u8FD1\u6D3B\u52A8" }),
|
|
19740
|
+
host.recent.map((line, index2) => /* @__PURE__ */ jsx8("p", { children: line }, `${index2}-${line}`))
|
|
19284
19741
|
] }) : null
|
|
19285
19742
|
] }) : null
|
|
19286
19743
|
] }) : null,
|
|
19287
|
-
scope === "personal" && config?.auth_status === "expired" ? /* @__PURE__ */
|
|
19288
|
-
scope === "personal" && config?.global_ready === false ? /* @__PURE__ */
|
|
19289
|
-
scope === "global" ? /* @__PURE__ */
|
|
19290
|
-
loading ? /* @__PURE__ */
|
|
19744
|
+
scope === "personal" && config?.auth_status === "expired" ? /* @__PURE__ */ jsx8("p", { className: "mb-2 text-xs", children: "\u767B\u5F55\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199" }) : null,
|
|
19745
|
+
scope === "personal" && config?.global_ready === false ? /* @__PURE__ */ jsx8("p", { className: "mb-2 text-xs", children: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u586B\u5199\u5171\u4EAB\u914D\u7F6E" }) : null,
|
|
19746
|
+
scope === "global" ? /* @__PURE__ */ jsx8("p", { className: "mb-2 text-xs", children: "\u5171\u4EAB\u5BC6\u94A5\u7528\u4E8E\u63D2\u4EF6\u670D\u52A1\u3002\u547D\u4EE4\u7C7B\u63D2\u4EF6\u7684\u6C99\u76D2\u4EE3\u7801\u53EF\u4EE5\u8BFB\u53D6\u5B83\uFF1B\u9700\u4FDD\u5BC6\u65F6\u8BF7\u4F7F\u7528\u6258\u7BA1\u670D\u52A1\u3002" }) : null,
|
|
19747
|
+
loading ? /* @__PURE__ */ jsx8("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u8BFB\u53D6\u914D\u7F6E\u2026" }) : null,
|
|
19291
19748
|
loadFailure ? /* @__PURE__ */ jsxs4("div", { className: "space-y-2 text-xs", children: [
|
|
19292
|
-
/* @__PURE__ */
|
|
19293
|
-
/* @__PURE__ */
|
|
19749
|
+
/* @__PURE__ */ jsx8("p", { children: loadFailure }),
|
|
19750
|
+
/* @__PURE__ */ jsx8(
|
|
19294
19751
|
"button",
|
|
19295
19752
|
{
|
|
19296
19753
|
type: "button",
|
|
@@ -19300,7 +19757,7 @@ function ConfigDialogState({
|
|
|
19300
19757
|
}
|
|
19301
19758
|
)
|
|
19302
19759
|
] }) : null,
|
|
19303
|
-
config && !loading ? /* @__PURE__ */
|
|
19760
|
+
config && !loading ? /* @__PURE__ */ jsx8(
|
|
19304
19761
|
SessionPluginConfigForm,
|
|
19305
19762
|
{
|
|
19306
19763
|
config,
|
|
@@ -19319,7 +19776,7 @@ function ConfigDialogState({
|
|
|
19319
19776
|
}
|
|
19320
19777
|
|
|
19321
19778
|
// src/components/PluginConnectorList.tsx
|
|
19322
|
-
import { jsx as
|
|
19779
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
19323
19780
|
function PluginSwitch({
|
|
19324
19781
|
label,
|
|
19325
19782
|
checked,
|
|
@@ -19328,7 +19785,7 @@ function PluginSwitch({
|
|
|
19328
19785
|
draft = false,
|
|
19329
19786
|
onToggle
|
|
19330
19787
|
}) {
|
|
19331
|
-
return /* @__PURE__ */
|
|
19788
|
+
return /* @__PURE__ */ jsx9(
|
|
19332
19789
|
"button",
|
|
19333
19790
|
{
|
|
19334
19791
|
type: "button",
|
|
@@ -19338,12 +19795,12 @@ function PluginSwitch({
|
|
|
19338
19795
|
disabled,
|
|
19339
19796
|
onClick: () => onToggle(!checked),
|
|
19340
19797
|
className: `relative inline-flex h-[18px] w-8 shrink-0 cursor-pointer items-center rounded-full border transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${checked ? "border-transparent bg-[hsl(213_94%_55%)]" : "border-[hsl(var(--border))] bg-[hsl(var(--muted))]"}`,
|
|
19341
|
-
children: /* @__PURE__ */
|
|
19798
|
+
children: /* @__PURE__ */ jsx9(
|
|
19342
19799
|
"span",
|
|
19343
19800
|
{
|
|
19344
19801
|
"aria-hidden": "true",
|
|
19345
19802
|
className: `pointer-events-none flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white shadow transition-transform ${checked ? "translate-x-[16px]" : "translate-x-[2px]"}`,
|
|
19346
|
-
children: pending ? /* @__PURE__ */
|
|
19803
|
+
children: pending ? /* @__PURE__ */ jsx9(LoaderCircle, { size: 9, className: "animate-spin text-[hsl(var(--muted-foreground))]" }) : null
|
|
19347
19804
|
}
|
|
19348
19805
|
)
|
|
19349
19806
|
}
|
|
@@ -19369,8 +19826,8 @@ function PluginConnectorList({
|
|
|
19369
19826
|
}) {
|
|
19370
19827
|
const configuringItem = configuring ? items.find((item) => item.name === configuring.name) ?? null : null;
|
|
19371
19828
|
return /* @__PURE__ */ jsxs5("div", { className: "py-0.5", children: [
|
|
19372
|
-
disabledReason ? /* @__PURE__ */
|
|
19373
|
-
items.length === 0 ? /* @__PURE__ */
|
|
19829
|
+
disabledReason ? /* @__PURE__ */ jsx9("div", { className: "px-3 py-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: disabledReason }) : null,
|
|
19830
|
+
items.length === 0 ? /* @__PURE__ */ jsx9("div", { className: "px-3 py-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: unavailableText ?? emptyText }) : null,
|
|
19374
19831
|
items.map((item) => {
|
|
19375
19832
|
const label = sessionPluginLabel(item);
|
|
19376
19833
|
const actionable = !disabledReason && item.installed !== false || item.active;
|
|
@@ -19378,7 +19835,7 @@ function PluginConnectorList({
|
|
|
19378
19835
|
const checked = item.active;
|
|
19379
19836
|
return /* @__PURE__ */ jsxs5("div", { className: "group px-3 py-1", children: [
|
|
19380
19837
|
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
19381
|
-
/* @__PURE__ */
|
|
19838
|
+
/* @__PURE__ */ jsx9(
|
|
19382
19839
|
SessionPluginIcon,
|
|
19383
19840
|
{
|
|
19384
19841
|
client,
|
|
@@ -19386,9 +19843,9 @@ function PluginConnectorList({
|
|
|
19386
19843
|
plugin: item
|
|
19387
19844
|
}
|
|
19388
19845
|
),
|
|
19389
|
-
/* @__PURE__ */
|
|
19390
|
-
item.auth_status === "expired" || item.auth_status === "login_required" || item.auth_status === "unavailable" ? /* @__PURE__ */
|
|
19391
|
-
!draft && item.config === "configured" ? /* @__PURE__ */
|
|
19846
|
+
/* @__PURE__ */ jsx9("span", { className: "min-w-0 flex-1 truncate text-[11px]", title: label, children: label }),
|
|
19847
|
+
item.auth_status === "expired" || item.auth_status === "login_required" || item.auth_status === "unavailable" ? /* @__PURE__ */ jsx9("button", { type: "button", disabled: !sessionId || busy, onClick: () => onEditConfig(item), className: "shrink-0 text-[10px] underline", children: item.auth_status === "expired" ? "\u767B\u5F55\u5DF2\u8FC7\u671F" : item.auth_status === "unavailable" ? "\u6682\u65F6\u4E0D\u53EF\u7528" : "\u672A\u767B\u5F55" }) : null,
|
|
19848
|
+
!draft && item.config === "configured" ? /* @__PURE__ */ jsx9(
|
|
19392
19849
|
"button",
|
|
19393
19850
|
{
|
|
19394
19851
|
type: "button",
|
|
@@ -19399,7 +19856,7 @@ function PluginConnectorList({
|
|
|
19399
19856
|
children: "\u66F4\u65B0\u914D\u7F6E"
|
|
19400
19857
|
}
|
|
19401
19858
|
) : null,
|
|
19402
|
-
!draft && (item.config === "required" || item.config === "error") ? /* @__PURE__ */
|
|
19859
|
+
!draft && (item.config === "required" || item.config === "error") ? /* @__PURE__ */ jsx9(
|
|
19403
19860
|
"button",
|
|
19404
19861
|
{
|
|
19405
19862
|
type: "button",
|
|
@@ -19410,7 +19867,7 @@ function PluginConnectorList({
|
|
|
19410
19867
|
children: "\u586B\u5199\u914D\u7F6E"
|
|
19411
19868
|
}
|
|
19412
19869
|
) : null,
|
|
19413
|
-
/* @__PURE__ */
|
|
19870
|
+
/* @__PURE__ */ jsx9(
|
|
19414
19871
|
PluginSwitch,
|
|
19415
19872
|
{
|
|
19416
19873
|
label,
|
|
@@ -19423,8 +19880,8 @@ function PluginConnectorList({
|
|
|
19423
19880
|
)
|
|
19424
19881
|
] }),
|
|
19425
19882
|
!draft && item.active && item.status !== "valid" && item.status !== "required" ? /* @__PURE__ */ jsxs5("div", { className: "mt-0.5 flex items-center gap-2 pl-7 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
|
|
19426
|
-
/* @__PURE__ */
|
|
19427
|
-
/* @__PURE__ */
|
|
19883
|
+
/* @__PURE__ */ jsx9("span", { children: item.reason || "\u63D2\u4EF6\u6682\u4E0D\u53EF\u7528" }),
|
|
19884
|
+
/* @__PURE__ */ jsx9(
|
|
19428
19885
|
"button",
|
|
19429
19886
|
{
|
|
19430
19887
|
type: "button",
|
|
@@ -19437,8 +19894,8 @@ function PluginConnectorList({
|
|
|
19437
19894
|
] }) : null
|
|
19438
19895
|
] }, item.name);
|
|
19439
19896
|
}),
|
|
19440
|
-
mutationError ? /* @__PURE__ */
|
|
19441
|
-
configuring && configuringItem && sessionId ? /* @__PURE__ */
|
|
19897
|
+
mutationError ? /* @__PURE__ */ jsx9("div", { className: "px-3 pt-1 text-[10px] text-[hsl(var(--destructive))]", children: "\u64CD\u4F5C\u672A\u5B8C\u6210\uFF0C\u8BF7\u91CD\u8BD5" }) : null,
|
|
19898
|
+
configuring && configuringItem && sessionId ? /* @__PURE__ */ jsx9(
|
|
19442
19899
|
SessionPluginConfigDialog,
|
|
19443
19900
|
{
|
|
19444
19901
|
client,
|
|
@@ -19510,30 +19967,30 @@ function filterConnectorItems(items, query) {
|
|
|
19510
19967
|
|
|
19511
19968
|
// src/components/use-session-plugin-activation.ts
|
|
19512
19969
|
import { isLocalConnectorName } from "@blade-hq/agent-client/internal";
|
|
19513
|
-
import { useCallback as
|
|
19970
|
+
import { useCallback as useCallback20, useEffect as useEffect12, useMemo as useMemo11, useRef as useRef12, useState as useState14 } from "react";
|
|
19514
19971
|
function useSessionPluginActivation({
|
|
19515
19972
|
client,
|
|
19516
19973
|
sessionId,
|
|
19517
19974
|
onChange
|
|
19518
19975
|
}) {
|
|
19519
|
-
const [plugins, setPlugins] =
|
|
19520
|
-
const [catalog, setCatalog] =
|
|
19521
|
-
const [loading, setLoading] =
|
|
19522
|
-
const [listError, setListError] =
|
|
19523
|
-
const [mutationError, setMutationError] =
|
|
19524
|
-
const [inFlight, setInFlight] =
|
|
19525
|
-
const [configuring, setConfiguring] =
|
|
19526
|
-
const alive =
|
|
19527
|
-
const generation2 =
|
|
19528
|
-
const mutationGenerations =
|
|
19529
|
-
const desiredActivations =
|
|
19530
|
-
const pendingMutations =
|
|
19531
|
-
const submittedActivations =
|
|
19532
|
-
const serverActive =
|
|
19533
|
-
const lifetime =
|
|
19534
|
-
const request =
|
|
19535
|
-
const [desiredVersion, setDesiredVersion] =
|
|
19536
|
-
const setDesired =
|
|
19976
|
+
const [plugins, setPlugins] = useState14([]);
|
|
19977
|
+
const [catalog, setCatalog] = useState14(null);
|
|
19978
|
+
const [loading, setLoading] = useState14(false);
|
|
19979
|
+
const [listError, setListError] = useState14(false);
|
|
19980
|
+
const [mutationError, setMutationError] = useState14(false);
|
|
19981
|
+
const [inFlight, setInFlight] = useState14({});
|
|
19982
|
+
const [configuring, setConfiguring] = useState14(null);
|
|
19983
|
+
const alive = useRef12(true);
|
|
19984
|
+
const generation2 = useRef12(0);
|
|
19985
|
+
const mutationGenerations = useRef12(/* @__PURE__ */ new Map());
|
|
19986
|
+
const desiredActivations = useRef12(/* @__PURE__ */ new Map());
|
|
19987
|
+
const pendingMutations = useRef12(/* @__PURE__ */ new Map());
|
|
19988
|
+
const submittedActivations = useRef12(/* @__PURE__ */ new Set());
|
|
19989
|
+
const serverActive = useRef12(/* @__PURE__ */ new Set());
|
|
19990
|
+
const lifetime = useRef12(0);
|
|
19991
|
+
const request = useRef12(null);
|
|
19992
|
+
const [desiredVersion, setDesiredVersion] = useState14(0);
|
|
19993
|
+
const setDesired = useCallback20((name, value) => {
|
|
19537
19994
|
if (value === null) {
|
|
19538
19995
|
if (!desiredActivations.current.delete(name)) return;
|
|
19539
19996
|
} else {
|
|
@@ -19542,7 +19999,7 @@ function useSessionPluginActivation({
|
|
|
19542
19999
|
}
|
|
19543
20000
|
setDesiredVersion((version) => version + 1);
|
|
19544
20001
|
}, []);
|
|
19545
|
-
const items =
|
|
20002
|
+
const items = useMemo11(() => {
|
|
19546
20003
|
void desiredVersion;
|
|
19547
20004
|
const merged = mergeConnectorItems(plugins, catalog);
|
|
19548
20005
|
return merged.map((item) => {
|
|
@@ -19553,7 +20010,7 @@ function useSessionPluginActivation({
|
|
|
19553
20010
|
return desired === void 0 ? item : { ...item, active: desired };
|
|
19554
20011
|
});
|
|
19555
20012
|
}, [catalog, configuring, desiredVersion, plugins]);
|
|
19556
|
-
const markInFlight =
|
|
20013
|
+
const markInFlight = useCallback20((name, on) => {
|
|
19557
20014
|
setInFlight((current) => {
|
|
19558
20015
|
if (on) return current[name] ? current : { ...current, [name]: true };
|
|
19559
20016
|
if (!current[name]) return current;
|
|
@@ -19562,7 +20019,7 @@ function useSessionPluginActivation({
|
|
|
19562
20019
|
return rest;
|
|
19563
20020
|
});
|
|
19564
20021
|
}, []);
|
|
19565
|
-
|
|
20022
|
+
useEffect12(() => {
|
|
19566
20023
|
alive.current = true;
|
|
19567
20024
|
setPlugins([]);
|
|
19568
20025
|
setCatalog(null);
|
|
@@ -19582,7 +20039,7 @@ function useSessionPluginActivation({
|
|
|
19582
20039
|
request.current?.abort();
|
|
19583
20040
|
};
|
|
19584
20041
|
}, [client]);
|
|
19585
|
-
const load =
|
|
20042
|
+
const load = useCallback20(async () => {
|
|
19586
20043
|
if (!alive.current) return;
|
|
19587
20044
|
request.current?.abort();
|
|
19588
20045
|
const controller = new AbortController();
|
|
@@ -19618,30 +20075,30 @@ function useSessionPluginActivation({
|
|
|
19618
20075
|
if (alive.current && current === generation2.current) setLoading(false);
|
|
19619
20076
|
}
|
|
19620
20077
|
}, [client, sessionId]);
|
|
19621
|
-
const loadCatalog =
|
|
20078
|
+
const loadCatalog = useCallback20(async () => {
|
|
19622
20079
|
try {
|
|
19623
20080
|
const { plugins: entries } = await client.plugins.catalog();
|
|
19624
20081
|
if (alive.current) setCatalog(entries);
|
|
19625
20082
|
} catch {
|
|
19626
20083
|
}
|
|
19627
20084
|
}, [client]);
|
|
19628
|
-
const reload =
|
|
20085
|
+
const reload = useCallback20(() => {
|
|
19629
20086
|
void load();
|
|
19630
20087
|
void loadCatalog();
|
|
19631
20088
|
}, [load, loadCatalog]);
|
|
19632
|
-
const abandon =
|
|
20089
|
+
const abandon = useCallback20((name) => {
|
|
19633
20090
|
setDesired(name, null);
|
|
19634
20091
|
pendingMutations.current.delete(name);
|
|
19635
20092
|
mutationGenerations.current.set(name, (mutationGenerations.current.get(name) ?? 0) + 1);
|
|
19636
20093
|
markInFlight(name, false);
|
|
19637
20094
|
void load();
|
|
19638
20095
|
}, [load, markInFlight, setDesired]);
|
|
19639
|
-
const finish =
|
|
20096
|
+
const finish = useCallback20((name, mutation) => {
|
|
19640
20097
|
pendingMutations.current.delete(name);
|
|
19641
20098
|
setDesired(name, null);
|
|
19642
20099
|
if (mutation === mutationGenerations.current.get(name)) markInFlight(name, false);
|
|
19643
20100
|
}, [markInFlight, setDesired]);
|
|
19644
|
-
const commitActivation =
|
|
20101
|
+
const commitActivation = useCallback20(
|
|
19645
20102
|
async (name, active, mutation, startedAt) => {
|
|
19646
20103
|
submittedActivations.current.add(name);
|
|
19647
20104
|
try {
|
|
@@ -19680,7 +20137,7 @@ function useSessionPluginActivation({
|
|
|
19680
20137
|
},
|
|
19681
20138
|
[client, finish, load, markInFlight, onChange, sessionId, setDesired]
|
|
19682
20139
|
);
|
|
19683
|
-
const enable =
|
|
20140
|
+
const enable = useCallback20(async (name) => {
|
|
19684
20141
|
if (!alive.current) return;
|
|
19685
20142
|
const startedAt = lifetime.current;
|
|
19686
20143
|
const mutation = (mutationGenerations.current.get(name) ?? 0) + 1;
|
|
@@ -19717,7 +20174,7 @@ function useSessionPluginActivation({
|
|
|
19717
20174
|
setPlugins((current) => current.map((item) => item.name === name ? { ...item, config: state.state } : item));
|
|
19718
20175
|
await commitActivation(name, true, mutation, startedAt);
|
|
19719
20176
|
}, [abandon, client, commitActivation, markInFlight, sessionId, setDesired]);
|
|
19720
|
-
const disable =
|
|
20177
|
+
const disable = useCallback20((name) => {
|
|
19721
20178
|
const startedAt = lifetime.current;
|
|
19722
20179
|
request.current?.abort();
|
|
19723
20180
|
generation2.current++;
|
|
@@ -19734,17 +20191,17 @@ function useSessionPluginActivation({
|
|
|
19734
20191
|
markInFlight(name, true);
|
|
19735
20192
|
void commitActivation(name, false, mutation, startedAt);
|
|
19736
20193
|
}, [abandon, commitActivation, markInFlight, setDesired]);
|
|
19737
|
-
const toggle =
|
|
20194
|
+
const toggle = useCallback20((item, next) => {
|
|
19738
20195
|
if (next) void enable(item.name);
|
|
19739
20196
|
else disable(item.name);
|
|
19740
20197
|
}, [disable, enable]);
|
|
19741
|
-
const retry =
|
|
20198
|
+
const retry = useCallback20((item) => {
|
|
19742
20199
|
void enable(item.name);
|
|
19743
20200
|
}, [enable]);
|
|
19744
|
-
const editConfig =
|
|
20201
|
+
const editConfig = useCallback20((item) => {
|
|
19745
20202
|
setConfiguring({ name: item.name, pendingActivation: false });
|
|
19746
20203
|
}, []);
|
|
19747
|
-
const onConfigSaved =
|
|
20204
|
+
const onConfigSaved = useCallback20((state) => {
|
|
19748
20205
|
const target = configuring;
|
|
19749
20206
|
if (!target) return;
|
|
19750
20207
|
setConfiguring(null);
|
|
@@ -19762,7 +20219,7 @@ function useSessionPluginActivation({
|
|
|
19762
20219
|
markInFlight(target.name, true);
|
|
19763
20220
|
void commitActivation(target.name, true, mutation, startedAt);
|
|
19764
20221
|
}, [commitActivation, configuring, load, loadCatalog, markInFlight, setDesired]);
|
|
19765
|
-
const onConfigClose =
|
|
20222
|
+
const onConfigClose = useCallback20(() => {
|
|
19766
20223
|
const target = configuring;
|
|
19767
20224
|
if (!target) return;
|
|
19768
20225
|
setConfiguring(null);
|
|
@@ -19786,151 +20243,16 @@ function useSessionPluginActivation({
|
|
|
19786
20243
|
};
|
|
19787
20244
|
}
|
|
19788
20245
|
|
|
19789
|
-
// src/chat/runtime/session-source.tsx
|
|
19790
|
-
import { createInitialSessionState } from "@blade-hq/agent-client/internal";
|
|
19791
|
-
import {
|
|
19792
|
-
createContext as createContext3,
|
|
19793
|
-
useContext as useContext3,
|
|
19794
|
-
useEffect as useEffect10,
|
|
19795
|
-
useLayoutEffect,
|
|
19796
|
-
useMemo as useMemo10,
|
|
19797
|
-
useRef as useRef10,
|
|
19798
|
-
useState as useState14,
|
|
19799
|
-
useSyncExternalStore
|
|
19800
|
-
} from "react";
|
|
19801
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
19802
|
-
var EMPTY_SOURCE = {
|
|
19803
|
-
subscribe: () => () => {
|
|
19804
|
-
},
|
|
19805
|
-
getSession: () => void 0,
|
|
19806
|
-
isHistoryLoading: () => false,
|
|
19807
|
-
planRevealRevision: () => 0
|
|
19808
|
-
};
|
|
19809
|
-
var SessionSourceContext = createContext3(EMPTY_SOURCE);
|
|
19810
|
-
function SessionSourceProvider({ source, children }) {
|
|
19811
|
-
return /* @__PURE__ */ jsx8(SessionSourceContext.Provider, { value: source, children });
|
|
19812
|
-
}
|
|
19813
|
-
function useSessionSource() {
|
|
19814
|
-
return useContext3(SessionSourceContext);
|
|
19815
|
-
}
|
|
19816
|
-
var SingleSessionSource = class {
|
|
19817
|
-
session = null;
|
|
19818
|
-
loading = false;
|
|
19819
|
-
listeners = /* @__PURE__ */ new Set();
|
|
19820
|
-
revisions = /* @__PURE__ */ new Map();
|
|
19821
|
-
subscribe = (listener) => {
|
|
19822
|
-
this.listeners.add(listener);
|
|
19823
|
-
return () => {
|
|
19824
|
-
this.listeners.delete(listener);
|
|
19825
|
-
};
|
|
19826
|
-
};
|
|
19827
|
-
getSession = (sessionId) => {
|
|
19828
|
-
const current = this.session;
|
|
19829
|
-
return current && (!sessionId || current.sessionId === sessionId) ? current : void 0;
|
|
19830
|
-
};
|
|
19831
|
-
isHistoryLoading = (sessionId) => {
|
|
19832
|
-
if (!this.session) return this.loading;
|
|
19833
|
-
return (!sessionId || this.session.sessionId === sessionId) && this.loading;
|
|
19834
|
-
};
|
|
19835
|
-
planRevealRevision = (sessionId) => sessionId ? this.revisions.get(sessionId) ?? 0 : 0;
|
|
19836
|
-
update(session, loading) {
|
|
19837
|
-
if (this.session === session && this.loading === loading) return;
|
|
19838
|
-
this.session = session;
|
|
19839
|
-
this.loading = loading;
|
|
19840
|
-
this.notify();
|
|
19841
|
-
}
|
|
19842
|
-
watchPlan(session) {
|
|
19843
|
-
return session.on("toolResult", ({ toolCall, turn, source }) => {
|
|
19844
|
-
if (source === "reconnect_replay" || (turn.loop_id || "root") !== "root" || toolCall.status !== "done" || !isPlanUpdateTool(toolCall) || !parsePlanUpdate(toolCall.arguments)) {
|
|
19845
|
-
return;
|
|
19846
|
-
}
|
|
19847
|
-
this.revisions.set(session.sessionId, (this.revisions.get(session.sessionId) ?? 0) + 1);
|
|
19848
|
-
this.notify();
|
|
19849
|
-
});
|
|
19850
|
-
}
|
|
19851
|
-
notify() {
|
|
19852
|
-
for (const listener of [...this.listeners]) listener();
|
|
19853
|
-
}
|
|
19854
|
-
};
|
|
19855
|
-
function useSingleSessionSource(session, loading) {
|
|
19856
|
-
const [source] = useState14(() => new SingleSessionSource());
|
|
19857
|
-
useLayoutEffect(() => {
|
|
19858
|
-
source.update(session, loading);
|
|
19859
|
-
}, [source, session, loading]);
|
|
19860
|
-
useEffect10(() => session ? source.watchPlan(session) : void 0, [source, session]);
|
|
19861
|
-
return source;
|
|
19862
|
-
}
|
|
19863
|
-
var EMPTY_STATE = createInitialSessionState("");
|
|
19864
|
-
var noopSubscribe = () => () => {
|
|
19865
|
-
};
|
|
19866
|
-
function useSessionHandle(sessionId) {
|
|
19867
|
-
const source = useSessionSource();
|
|
19868
|
-
return useSyncExternalStore(
|
|
19869
|
-
source.subscribe,
|
|
19870
|
-
() => source.getSession(sessionId) ?? null,
|
|
19871
|
-
() => source.getSession(sessionId) ?? null
|
|
19872
|
-
);
|
|
19873
|
-
}
|
|
19874
|
-
function useSessionState(sessionId, selector) {
|
|
19875
|
-
const session = useSessionHandle(sessionId);
|
|
19876
|
-
const selectorRef = useRef10(selector);
|
|
19877
|
-
selectorRef.current = selector;
|
|
19878
|
-
const store = useMemo10(() => {
|
|
19879
|
-
let lastState = null;
|
|
19880
|
-
let lastSelector = null;
|
|
19881
|
-
let lastSelected;
|
|
19882
|
-
const getSnapshot = () => {
|
|
19883
|
-
const state = session ? session.getState() : EMPTY_STATE;
|
|
19884
|
-
const current = selectorRef.current;
|
|
19885
|
-
if (state !== lastState || current !== lastSelector) {
|
|
19886
|
-
const next = current(state);
|
|
19887
|
-
if (!(lastState !== null && Object.is(next, lastSelected))) lastSelected = next;
|
|
19888
|
-
lastState = state;
|
|
19889
|
-
lastSelector = current;
|
|
19890
|
-
}
|
|
19891
|
-
return lastSelected;
|
|
19892
|
-
};
|
|
19893
|
-
return {
|
|
19894
|
-
subscribe: session ? (listener) => session.subscribe(listener) : noopSubscribe,
|
|
19895
|
-
getSnapshot
|
|
19896
|
-
};
|
|
19897
|
-
}, [session]);
|
|
19898
|
-
return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
19899
|
-
}
|
|
19900
|
-
function useIsSessionHistoryLoading(sessionId) {
|
|
19901
|
-
const source = useSessionSource();
|
|
19902
|
-
return useSyncExternalStore(
|
|
19903
|
-
source.subscribe,
|
|
19904
|
-
() => source.isHistoryLoading(sessionId),
|
|
19905
|
-
() => source.isHistoryLoading(sessionId)
|
|
19906
|
-
);
|
|
19907
|
-
}
|
|
19908
|
-
function usePlanRevealRevision(sessionId) {
|
|
19909
|
-
const source = useSessionSource();
|
|
19910
|
-
return useSyncExternalStore(
|
|
19911
|
-
source.subscribe,
|
|
19912
|
-
() => source.planRevealRevision(sessionId),
|
|
19913
|
-
() => source.planRevealRevision(sessionId)
|
|
19914
|
-
);
|
|
19915
|
-
}
|
|
19916
|
-
var CurrentChatSessionContext = createContext3(null);
|
|
19917
|
-
function CurrentChatSessionProvider({ sessionId, children }) {
|
|
19918
|
-
return /* @__PURE__ */ jsx8(CurrentChatSessionContext.Provider, { value: sessionId, children });
|
|
19919
|
-
}
|
|
19920
|
-
function useCurrentChatSessionId() {
|
|
19921
|
-
return useContext3(CurrentChatSessionContext);
|
|
19922
|
-
}
|
|
19923
|
-
|
|
19924
20246
|
// src/chat/runtime/environment.tsx
|
|
19925
|
-
import { createContext as
|
|
19926
|
-
import { jsx as
|
|
20247
|
+
import { createContext as createContext5, useContext as useContext5, useMemo as useMemo12 } from "react";
|
|
20248
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
19927
20249
|
var EMPTY_ENVIRONMENT = {};
|
|
19928
|
-
var ChatEnvironmentContext =
|
|
20250
|
+
var ChatEnvironmentContext = createContext5(EMPTY_ENVIRONMENT);
|
|
19929
20251
|
function ChatEnvironmentProvider({ value, children }) {
|
|
19930
|
-
return /* @__PURE__ */
|
|
20252
|
+
return /* @__PURE__ */ jsx10(ChatEnvironmentContext.Provider, { value, children });
|
|
19931
20253
|
}
|
|
19932
20254
|
function useChatEnvironment() {
|
|
19933
|
-
return
|
|
20255
|
+
return useContext5(ChatEnvironmentContext);
|
|
19934
20256
|
}
|
|
19935
20257
|
var NO_HIGHLIGHT = { highlightedHtml: null };
|
|
19936
20258
|
function usePlainCode() {
|
|
@@ -19964,7 +20286,7 @@ function notifyChat(environment, kind, message, options) {
|
|
|
19964
20286
|
function useComposerBridge(sessionId) {
|
|
19965
20287
|
const environment = useChatEnvironment();
|
|
19966
20288
|
const session = useSessionHandle(sessionId);
|
|
19967
|
-
return
|
|
20289
|
+
return useMemo12(
|
|
19968
20290
|
() => ({
|
|
19969
20291
|
appendText(text, separate = false) {
|
|
19970
20292
|
if (!sessionId) return;
|
|
@@ -20122,13 +20444,13 @@ function useComposedRefs(...refs) {
|
|
|
20122
20444
|
|
|
20123
20445
|
// ../../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.2.14_react@19.2.4/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
20124
20446
|
import * as React2 from "react";
|
|
20125
|
-
import { jsx as
|
|
20447
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
20126
20448
|
function createContext22(rootComponentName, defaultContext) {
|
|
20127
20449
|
const Context = React2.createContext(defaultContext);
|
|
20128
20450
|
const Provider2 = (props) => {
|
|
20129
20451
|
const { children, ...context } = props;
|
|
20130
20452
|
const value = React2.useMemo(() => context, Object.values(context));
|
|
20131
|
-
return /* @__PURE__ */
|
|
20453
|
+
return /* @__PURE__ */ jsx11(Context.Provider, { value, children });
|
|
20132
20454
|
};
|
|
20133
20455
|
Provider2.displayName = rootComponentName + "Provider";
|
|
20134
20456
|
function useContext22(consumerName) {
|
|
@@ -20149,7 +20471,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
20149
20471
|
const { scope, children, ...context } = props;
|
|
20150
20472
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
20151
20473
|
const value = React2.useMemo(() => context, Object.values(context));
|
|
20152
|
-
return /* @__PURE__ */
|
|
20474
|
+
return /* @__PURE__ */ jsx11(Context.Provider, { value, children });
|
|
20153
20475
|
};
|
|
20154
20476
|
Provider2.displayName = rootComponentName + "Provider";
|
|
20155
20477
|
function useContext22(consumerName, scope) {
|
|
@@ -20206,7 +20528,7 @@ import * as ReactDOM from "react-dom";
|
|
|
20206
20528
|
|
|
20207
20529
|
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.2.14_react@19.2.4/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
20208
20530
|
import * as React3 from "react";
|
|
20209
|
-
import { Fragment as Fragment22, jsx as
|
|
20531
|
+
import { Fragment as Fragment22, jsx as jsx12 } from "react/jsx-runtime";
|
|
20210
20532
|
// @__NO_SIDE_EFFECTS__
|
|
20211
20533
|
function createSlot(ownerName) {
|
|
20212
20534
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
@@ -20224,9 +20546,9 @@ function createSlot(ownerName) {
|
|
|
20224
20546
|
return child;
|
|
20225
20547
|
}
|
|
20226
20548
|
});
|
|
20227
|
-
return /* @__PURE__ */
|
|
20549
|
+
return /* @__PURE__ */ jsx12(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null });
|
|
20228
20550
|
}
|
|
20229
|
-
return /* @__PURE__ */
|
|
20551
|
+
return /* @__PURE__ */ jsx12(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
20230
20552
|
});
|
|
20231
20553
|
Slot22.displayName = `${ownerName}.Slot`;
|
|
20232
20554
|
return Slot22;
|
|
@@ -20252,7 +20574,7 @@ var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
|
|
20252
20574
|
// @__NO_SIDE_EFFECTS__
|
|
20253
20575
|
function createSlottable(ownerName) {
|
|
20254
20576
|
const Slottable2 = ({ children }) => {
|
|
20255
|
-
return /* @__PURE__ */
|
|
20577
|
+
return /* @__PURE__ */ jsx12(Fragment22, { children });
|
|
20256
20578
|
};
|
|
20257
20579
|
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
20258
20580
|
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
@@ -20300,7 +20622,7 @@ function getElementRef(element) {
|
|
|
20300
20622
|
}
|
|
20301
20623
|
|
|
20302
20624
|
// ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.3_@types+react@19.2.14__@types+re_1181ea5061ec9212248424669240e4ec/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
20303
|
-
import { jsx as
|
|
20625
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
20304
20626
|
var NODES = [
|
|
20305
20627
|
"a",
|
|
20306
20628
|
"button",
|
|
@@ -20328,7 +20650,7 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
20328
20650
|
if (typeof window !== "undefined") {
|
|
20329
20651
|
window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
|
|
20330
20652
|
}
|
|
20331
|
-
return /* @__PURE__ */
|
|
20653
|
+
return /* @__PURE__ */ jsx13(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
20332
20654
|
});
|
|
20333
20655
|
Node2.displayName = `Primitive.${node}`;
|
|
20334
20656
|
return { ...primitive, [node]: Node2 };
|
|
@@ -20363,7 +20685,7 @@ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.docum
|
|
|
20363
20685
|
}
|
|
20364
20686
|
|
|
20365
20687
|
// ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.11_@types+react-dom@19.2.3_@types+react@19.2.14___3d3960154a4c07d09bb90cb341135fc5/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
20366
|
-
import { jsx as
|
|
20688
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
20367
20689
|
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
20368
20690
|
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
20369
20691
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
@@ -20451,7 +20773,7 @@ var DismissableLayer = React7.forwardRef(
|
|
|
20451
20773
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
20452
20774
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
20453
20775
|
}, []);
|
|
20454
|
-
return /* @__PURE__ */
|
|
20776
|
+
return /* @__PURE__ */ jsx14(
|
|
20455
20777
|
Primitive.div,
|
|
20456
20778
|
{
|
|
20457
20779
|
...layerProps,
|
|
@@ -20485,7 +20807,7 @@ var DismissableLayerBranch = React7.forwardRef((props, forwardedRef) => {
|
|
|
20485
20807
|
};
|
|
20486
20808
|
}
|
|
20487
20809
|
}, [context.branches]);
|
|
20488
|
-
return /* @__PURE__ */
|
|
20810
|
+
return /* @__PURE__ */ jsx14(Primitive.div, { ...props, ref: composedRefs });
|
|
20489
20811
|
});
|
|
20490
20812
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
20491
20813
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
@@ -20597,7 +20919,7 @@ function createFocusGuard() {
|
|
|
20597
20919
|
|
|
20598
20920
|
// ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.14__@types+_f62f3af4ca2ba305a7aecf04c8534604/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
20599
20921
|
import * as React9 from "react";
|
|
20600
|
-
import { jsx as
|
|
20922
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
20601
20923
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
20602
20924
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
20603
20925
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
@@ -20716,7 +21038,7 @@ var FocusScope = React9.forwardRef((props, forwardedRef) => {
|
|
|
20716
21038
|
},
|
|
20717
21039
|
[loop, trapped, focusScope.paused]
|
|
20718
21040
|
);
|
|
20719
|
-
return /* @__PURE__ */
|
|
21041
|
+
return /* @__PURE__ */ jsx15(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
20720
21042
|
});
|
|
20721
21043
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
20722
21044
|
function focusFirst(candidates, { select = false } = {}) {
|
|
@@ -22345,7 +22667,7 @@ function observeMove(element, onMove) {
|
|
|
22345
22667
|
refresh(true);
|
|
22346
22668
|
return cleanup;
|
|
22347
22669
|
}
|
|
22348
|
-
function autoUpdate(reference, floating,
|
|
22670
|
+
function autoUpdate(reference, floating, update2, options) {
|
|
22349
22671
|
if (options === void 0) {
|
|
22350
22672
|
options = {};
|
|
22351
22673
|
}
|
|
@@ -22359,12 +22681,12 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
22359
22681
|
const referenceEl = unwrapElement(reference);
|
|
22360
22682
|
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
|
|
22361
22683
|
ancestors.forEach((ancestor) => {
|
|
22362
|
-
ancestorScroll && ancestor.addEventListener("scroll",
|
|
22684
|
+
ancestorScroll && ancestor.addEventListener("scroll", update2, {
|
|
22363
22685
|
passive: true
|
|
22364
22686
|
});
|
|
22365
|
-
ancestorResize && ancestor.addEventListener("resize",
|
|
22687
|
+
ancestorResize && ancestor.addEventListener("resize", update2);
|
|
22366
22688
|
});
|
|
22367
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl,
|
|
22689
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2) : null;
|
|
22368
22690
|
let reobserveFrame = -1;
|
|
22369
22691
|
let resizeObserver = null;
|
|
22370
22692
|
if (elementResize) {
|
|
@@ -22378,7 +22700,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
22378
22700
|
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
22379
22701
|
});
|
|
22380
22702
|
}
|
|
22381
|
-
|
|
22703
|
+
update2();
|
|
22382
22704
|
});
|
|
22383
22705
|
if (referenceEl && !animationFrame) {
|
|
22384
22706
|
resizeObserver.observe(referenceEl);
|
|
@@ -22395,17 +22717,17 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
22395
22717
|
function frameLoop() {
|
|
22396
22718
|
const nextRefRect = getBoundingClientRect(reference);
|
|
22397
22719
|
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
22398
|
-
|
|
22720
|
+
update2();
|
|
22399
22721
|
}
|
|
22400
22722
|
prevRefRect = nextRefRect;
|
|
22401
22723
|
frameId = requestAnimationFrame(frameLoop);
|
|
22402
22724
|
}
|
|
22403
|
-
|
|
22725
|
+
update2();
|
|
22404
22726
|
return () => {
|
|
22405
22727
|
var _resizeObserver2;
|
|
22406
22728
|
ancestors.forEach((ancestor) => {
|
|
22407
|
-
ancestorScroll && ancestor.removeEventListener("scroll",
|
|
22408
|
-
ancestorResize && ancestor.removeEventListener("resize",
|
|
22729
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update2);
|
|
22730
|
+
ancestorResize && ancestor.removeEventListener("resize", update2);
|
|
22409
22731
|
});
|
|
22410
22732
|
cleanupIo == null || cleanupIo();
|
|
22411
22733
|
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
@@ -22563,7 +22885,7 @@ function useFloating(options) {
|
|
|
22563
22885
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
22564
22886
|
const platformRef = useLatestRef(platform2);
|
|
22565
22887
|
const openRef = useLatestRef(open);
|
|
22566
|
-
const
|
|
22888
|
+
const update2 = React12.useCallback(() => {
|
|
22567
22889
|
if (!referenceRef.current || !floatingRef.current) {
|
|
22568
22890
|
return;
|
|
22569
22891
|
}
|
|
@@ -22613,11 +22935,11 @@ function useFloating(options) {
|
|
|
22613
22935
|
if (floatingEl) floatingRef.current = floatingEl;
|
|
22614
22936
|
if (referenceEl && floatingEl) {
|
|
22615
22937
|
if (whileElementsMountedRef.current) {
|
|
22616
|
-
return whileElementsMountedRef.current(referenceEl, floatingEl,
|
|
22938
|
+
return whileElementsMountedRef.current(referenceEl, floatingEl, update2);
|
|
22617
22939
|
}
|
|
22618
|
-
|
|
22940
|
+
update2();
|
|
22619
22941
|
}
|
|
22620
|
-
}, [referenceEl, floatingEl,
|
|
22942
|
+
}, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
22621
22943
|
const refs = React12.useMemo(() => ({
|
|
22622
22944
|
reference: referenceRef,
|
|
22623
22945
|
floating: floatingRef,
|
|
@@ -22656,11 +22978,11 @@ function useFloating(options) {
|
|
|
22656
22978
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
22657
22979
|
return React12.useMemo(() => ({
|
|
22658
22980
|
...data,
|
|
22659
|
-
update,
|
|
22981
|
+
update: update2,
|
|
22660
22982
|
refs,
|
|
22661
22983
|
elements,
|
|
22662
22984
|
floatingStyles
|
|
22663
|
-
}), [data,
|
|
22985
|
+
}), [data, update2, refs, elements, floatingStyles]);
|
|
22664
22986
|
}
|
|
22665
22987
|
var arrow$1 = (options) => {
|
|
22666
22988
|
function isRef(value) {
|
|
@@ -22751,11 +23073,11 @@ var arrow3 = (options, deps) => {
|
|
|
22751
23073
|
|
|
22752
23074
|
// ../../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@_e05f2c19a58a99fddf374207b5e3778c/node_modules/@radix-ui/react-arrow/dist/index.mjs
|
|
22753
23075
|
import * as React13 from "react";
|
|
22754
|
-
import { jsx as
|
|
23076
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
22755
23077
|
var NAME = "Arrow";
|
|
22756
23078
|
var Arrow = React13.forwardRef((props, forwardedRef) => {
|
|
22757
23079
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
22758
|
-
return /* @__PURE__ */
|
|
23080
|
+
return /* @__PURE__ */ jsx16(
|
|
22759
23081
|
Primitive.svg,
|
|
22760
23082
|
{
|
|
22761
23083
|
...arrowProps,
|
|
@@ -22764,7 +23086,7 @@ var Arrow = React13.forwardRef((props, forwardedRef) => {
|
|
|
22764
23086
|
height,
|
|
22765
23087
|
viewBox: "0 0 30 10",
|
|
22766
23088
|
preserveAspectRatio: "none",
|
|
22767
|
-
children: props.asChild ? children : /* @__PURE__ */
|
|
23089
|
+
children: props.asChild ? children : /* @__PURE__ */ jsx16("polygon", { points: "0,0 30,0 15,10" })
|
|
22768
23090
|
}
|
|
22769
23091
|
);
|
|
22770
23092
|
});
|
|
@@ -22809,14 +23131,14 @@ function useSize(element) {
|
|
|
22809
23131
|
}
|
|
22810
23132
|
|
|
22811
23133
|
// ../../node_modules/.pnpm/@radix-ui+react-popper@1.2.8_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react_13e0521d8aea7ebfbfb8bee1fb615c05/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
22812
|
-
import { jsx as
|
|
23134
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
22813
23135
|
var POPPER_NAME = "Popper";
|
|
22814
23136
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
22815
23137
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
22816
23138
|
var Popper = (props) => {
|
|
22817
23139
|
const { __scopePopper, children } = props;
|
|
22818
23140
|
const [anchor, setAnchor] = React15.useState(null);
|
|
22819
|
-
return /* @__PURE__ */
|
|
23141
|
+
return /* @__PURE__ */ jsx17(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
22820
23142
|
};
|
|
22821
23143
|
Popper.displayName = POPPER_NAME;
|
|
22822
23144
|
var ANCHOR_NAME = "PopperAnchor";
|
|
@@ -22834,7 +23156,7 @@ var PopperAnchor = React15.forwardRef(
|
|
|
22834
23156
|
context.onAnchorChange(anchorRef.current);
|
|
22835
23157
|
}
|
|
22836
23158
|
});
|
|
22837
|
-
return virtualRef ? null : /* @__PURE__ */
|
|
23159
|
+
return virtualRef ? null : /* @__PURE__ */ jsx17(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
22838
23160
|
}
|
|
22839
23161
|
);
|
|
22840
23162
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
@@ -22927,7 +23249,7 @@ var PopperContent = React15.forwardRef(
|
|
|
22927
23249
|
useLayoutEffect22(() => {
|
|
22928
23250
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
22929
23251
|
}, [content]);
|
|
22930
|
-
return /* @__PURE__ */
|
|
23252
|
+
return /* @__PURE__ */ jsx17(
|
|
22931
23253
|
"div",
|
|
22932
23254
|
{
|
|
22933
23255
|
ref: refs.setFloating,
|
|
@@ -22951,7 +23273,7 @@ var PopperContent = React15.forwardRef(
|
|
|
22951
23273
|
}
|
|
22952
23274
|
},
|
|
22953
23275
|
dir: props.dir,
|
|
22954
|
-
children: /* @__PURE__ */
|
|
23276
|
+
children: /* @__PURE__ */ jsx17(
|
|
22955
23277
|
PopperContentProvider,
|
|
22956
23278
|
{
|
|
22957
23279
|
scope: __scopePopper,
|
|
@@ -22960,7 +23282,7 @@ var PopperContent = React15.forwardRef(
|
|
|
22960
23282
|
arrowX,
|
|
22961
23283
|
arrowY,
|
|
22962
23284
|
shouldHideArrow: cannotCenterArrow,
|
|
22963
|
-
children: /* @__PURE__ */
|
|
23285
|
+
children: /* @__PURE__ */ jsx17(
|
|
22964
23286
|
Primitive.div,
|
|
22965
23287
|
{
|
|
22966
23288
|
"data-side": placedSide,
|
|
@@ -22997,7 +23319,7 @@ var PopperArrow = React15.forwardRef(function PopperArrow2(props, forwardedRef)
|
|
|
22997
23319
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
22998
23320
|
// doesn't report size as we'd expect on SVG elements.
|
|
22999
23321
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
23000
|
-
/* @__PURE__ */
|
|
23322
|
+
/* @__PURE__ */ jsx17(
|
|
23001
23323
|
"span",
|
|
23002
23324
|
{
|
|
23003
23325
|
ref: contentContext.onArrowChange,
|
|
@@ -23020,7 +23342,7 @@ var PopperArrow = React15.forwardRef(function PopperArrow2(props, forwardedRef)
|
|
|
23020
23342
|
}[contentContext.placedSide],
|
|
23021
23343
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
23022
23344
|
},
|
|
23023
|
-
children: /* @__PURE__ */
|
|
23345
|
+
children: /* @__PURE__ */ jsx17(
|
|
23024
23346
|
Root,
|
|
23025
23347
|
{
|
|
23026
23348
|
...arrowProps,
|
|
@@ -23083,14 +23405,14 @@ var Arrow2 = PopperArrow;
|
|
|
23083
23405
|
// ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react_7668895bec2444446faa4e0f4eb5244b/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
23084
23406
|
import * as React16 from "react";
|
|
23085
23407
|
import ReactDOM3 from "react-dom";
|
|
23086
|
-
import { jsx as
|
|
23408
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
23087
23409
|
var PORTAL_NAME = "Portal";
|
|
23088
23410
|
var Portal = React16.forwardRef((props, forwardedRef) => {
|
|
23089
23411
|
const { container: containerProp, ...portalProps } = props;
|
|
23090
23412
|
const [mounted, setMounted] = React16.useState(false);
|
|
23091
23413
|
useLayoutEffect22(() => setMounted(true), []);
|
|
23092
23414
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
23093
|
-
return container ? ReactDOM3.createPortal(/* @__PURE__ */
|
|
23415
|
+
return container ? ReactDOM3.createPortal(/* @__PURE__ */ jsx18(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
23094
23416
|
});
|
|
23095
23417
|
Portal.displayName = PORTAL_NAME;
|
|
23096
23418
|
|
|
@@ -24130,7 +24452,7 @@ ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
|
24130
24452
|
var Combination_default = ReactRemoveScroll;
|
|
24131
24453
|
|
|
24132
24454
|
// ../../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@19.2.3_@types+react@19.2.14__@types+rea_8b5332f8e883134e9d9ab2856fc4395d/node_modules/@radix-ui/react-popover/dist/index.mjs
|
|
24133
|
-
import { jsx as
|
|
24455
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
24134
24456
|
var POPOVER_NAME = "Popover";
|
|
24135
24457
|
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
24136
24458
|
createPopperScope
|
|
@@ -24155,7 +24477,7 @@ var Popover = (props) => {
|
|
|
24155
24477
|
onChange: onOpenChange,
|
|
24156
24478
|
caller: POPOVER_NAME
|
|
24157
24479
|
});
|
|
24158
|
-
return /* @__PURE__ */
|
|
24480
|
+
return /* @__PURE__ */ jsx19(Root2, { ...popperScope, children: /* @__PURE__ */ jsx19(
|
|
24159
24481
|
PopoverProvider,
|
|
24160
24482
|
{
|
|
24161
24483
|
scope: __scopePopover,
|
|
@@ -24184,7 +24506,7 @@ var PopoverAnchor = React28.forwardRef(
|
|
|
24184
24506
|
onCustomAnchorAdd();
|
|
24185
24507
|
return () => onCustomAnchorRemove();
|
|
24186
24508
|
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
24187
|
-
return /* @__PURE__ */
|
|
24509
|
+
return /* @__PURE__ */ jsx19(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
24188
24510
|
}
|
|
24189
24511
|
);
|
|
24190
24512
|
PopoverAnchor.displayName = ANCHOR_NAME2;
|
|
@@ -24195,7 +24517,7 @@ var PopoverTrigger = React28.forwardRef(
|
|
|
24195
24517
|
const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
|
|
24196
24518
|
const popperScope = usePopperScope(__scopePopover);
|
|
24197
24519
|
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
24198
|
-
const trigger = /* @__PURE__ */
|
|
24520
|
+
const trigger = /* @__PURE__ */ jsx19(
|
|
24199
24521
|
Primitive.button,
|
|
24200
24522
|
{
|
|
24201
24523
|
type: "button",
|
|
@@ -24208,7 +24530,7 @@ var PopoverTrigger = React28.forwardRef(
|
|
|
24208
24530
|
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
24209
24531
|
}
|
|
24210
24532
|
);
|
|
24211
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */
|
|
24533
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx19(Anchor, { asChild: true, ...popperScope, children: trigger });
|
|
24212
24534
|
}
|
|
24213
24535
|
);
|
|
24214
24536
|
PopoverTrigger.displayName = TRIGGER_NAME;
|
|
@@ -24219,7 +24541,7 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
|
|
|
24219
24541
|
var PopoverPortal = (props) => {
|
|
24220
24542
|
const { __scopePopover, forceMount, children, container } = props;
|
|
24221
24543
|
const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
|
|
24222
|
-
return /* @__PURE__ */
|
|
24544
|
+
return /* @__PURE__ */ jsx19(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx19(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx19(Portal, { asChild: true, container, children }) }) });
|
|
24223
24545
|
};
|
|
24224
24546
|
PopoverPortal.displayName = PORTAL_NAME2;
|
|
24225
24547
|
var CONTENT_NAME2 = "PopoverContent";
|
|
@@ -24228,7 +24550,7 @@ var PopoverContent = React28.forwardRef(
|
|
|
24228
24550
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
24229
24551
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
24230
24552
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
24231
|
-
return /* @__PURE__ */
|
|
24553
|
+
return /* @__PURE__ */ jsx19(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx19(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx19(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
24232
24554
|
}
|
|
24233
24555
|
);
|
|
24234
24556
|
PopoverContent.displayName = CONTENT_NAME2;
|
|
@@ -24243,7 +24565,7 @@ var PopoverContentModal = React28.forwardRef(
|
|
|
24243
24565
|
const content = contentRef.current;
|
|
24244
24566
|
if (content) return hideOthers(content);
|
|
24245
24567
|
}, []);
|
|
24246
|
-
return /* @__PURE__ */
|
|
24568
|
+
return /* @__PURE__ */ jsx19(Combination_default, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx19(
|
|
24247
24569
|
PopoverContentImpl,
|
|
24248
24570
|
{
|
|
24249
24571
|
...props,
|
|
@@ -24278,7 +24600,7 @@ var PopoverContentNonModal = React28.forwardRef(
|
|
|
24278
24600
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
24279
24601
|
const hasInteractedOutsideRef = React28.useRef(false);
|
|
24280
24602
|
const hasPointerDownOutsideRef = React28.useRef(false);
|
|
24281
|
-
return /* @__PURE__ */
|
|
24603
|
+
return /* @__PURE__ */ jsx19(
|
|
24282
24604
|
PopoverContentImpl,
|
|
24283
24605
|
{
|
|
24284
24606
|
...props,
|
|
@@ -24330,7 +24652,7 @@ var PopoverContentImpl = React28.forwardRef(
|
|
|
24330
24652
|
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
24331
24653
|
const popperScope = usePopperScope(__scopePopover);
|
|
24332
24654
|
useFocusGuards();
|
|
24333
|
-
return /* @__PURE__ */
|
|
24655
|
+
return /* @__PURE__ */ jsx19(
|
|
24334
24656
|
FocusScope,
|
|
24335
24657
|
{
|
|
24336
24658
|
asChild: true,
|
|
@@ -24338,7 +24660,7 @@ var PopoverContentImpl = React28.forwardRef(
|
|
|
24338
24660
|
trapped: trapFocus,
|
|
24339
24661
|
onMountAutoFocus: onOpenAutoFocus,
|
|
24340
24662
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
24341
|
-
children: /* @__PURE__ */
|
|
24663
|
+
children: /* @__PURE__ */ jsx19(
|
|
24342
24664
|
DismissableLayer,
|
|
24343
24665
|
{
|
|
24344
24666
|
asChild: true,
|
|
@@ -24348,7 +24670,7 @@ var PopoverContentImpl = React28.forwardRef(
|
|
|
24348
24670
|
onPointerDownOutside,
|
|
24349
24671
|
onFocusOutside,
|
|
24350
24672
|
onDismiss: () => context.onOpenChange(false),
|
|
24351
|
-
children: /* @__PURE__ */
|
|
24673
|
+
children: /* @__PURE__ */ jsx19(
|
|
24352
24674
|
Content,
|
|
24353
24675
|
{
|
|
24354
24676
|
"data-state": getState(context.open),
|
|
@@ -24381,7 +24703,7 @@ var PopoverClose = React28.forwardRef(
|
|
|
24381
24703
|
(props, forwardedRef) => {
|
|
24382
24704
|
const { __scopePopover, ...closeProps } = props;
|
|
24383
24705
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
24384
|
-
return /* @__PURE__ */
|
|
24706
|
+
return /* @__PURE__ */ jsx19(
|
|
24385
24707
|
Primitive.button,
|
|
24386
24708
|
{
|
|
24387
24709
|
type: "button",
|
|
@@ -24398,7 +24720,7 @@ var PopoverArrow = React28.forwardRef(
|
|
|
24398
24720
|
(props, forwardedRef) => {
|
|
24399
24721
|
const { __scopePopover, ...arrowProps } = props;
|
|
24400
24722
|
const popperScope = usePopperScope(__scopePopover);
|
|
24401
|
-
return /* @__PURE__ */
|
|
24723
|
+
return /* @__PURE__ */ jsx19(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
24402
24724
|
}
|
|
24403
24725
|
);
|
|
24404
24726
|
PopoverArrow.displayName = ARROW_NAME2;
|
|
@@ -24434,7 +24756,7 @@ import * as React30 from "react";
|
|
|
24434
24756
|
|
|
24435
24757
|
// ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@19.2.3_@types+react@19.2.14__@ty_fa89646d7248b32d1762bf88948f6339/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
24436
24758
|
import * as React29 from "react";
|
|
24437
|
-
import { jsx as
|
|
24759
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
24438
24760
|
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
24439
24761
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
24440
24762
|
position: "absolute",
|
|
@@ -24451,7 +24773,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
24451
24773
|
var NAME2 = "VisuallyHidden";
|
|
24452
24774
|
var VisuallyHidden = React29.forwardRef(
|
|
24453
24775
|
(props, forwardedRef) => {
|
|
24454
|
-
return /* @__PURE__ */
|
|
24776
|
+
return /* @__PURE__ */ jsx20(
|
|
24455
24777
|
Primitive.span,
|
|
24456
24778
|
{
|
|
24457
24779
|
...props,
|
|
@@ -24465,7 +24787,7 @@ VisuallyHidden.displayName = NAME2;
|
|
|
24465
24787
|
var Root3 = VisuallyHidden;
|
|
24466
24788
|
|
|
24467
24789
|
// ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.8_@types+react-dom@19.2.3_@types+react@19.2.14__@types+reac_9074d9fb06315b089b2bee17c4c65951/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
24468
|
-
import { jsx as
|
|
24790
|
+
import { jsx as jsx21, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
24469
24791
|
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
24470
24792
|
createPopperScope
|
|
24471
24793
|
]);
|
|
@@ -24489,7 +24811,7 @@ var TooltipProvider = (props) => {
|
|
|
24489
24811
|
const skipDelayTimer = skipDelayTimerRef.current;
|
|
24490
24812
|
return () => window.clearTimeout(skipDelayTimer);
|
|
24491
24813
|
}, []);
|
|
24492
|
-
return /* @__PURE__ */
|
|
24814
|
+
return /* @__PURE__ */ jsx21(
|
|
24493
24815
|
TooltipProviderContextProvider,
|
|
24494
24816
|
{
|
|
24495
24817
|
scope: __scopeTooltip,
|
|
@@ -24580,7 +24902,7 @@ var Tooltip = (props) => {
|
|
|
24580
24902
|
}
|
|
24581
24903
|
};
|
|
24582
24904
|
}, []);
|
|
24583
|
-
return /* @__PURE__ */
|
|
24905
|
+
return /* @__PURE__ */ jsx21(Root2, { ...popperScope, children: /* @__PURE__ */ jsx21(
|
|
24584
24906
|
TooltipContextProvider,
|
|
24585
24907
|
{
|
|
24586
24908
|
scope: __scopeTooltip,
|
|
@@ -24624,7 +24946,7 @@ var TooltipTrigger = React30.forwardRef(
|
|
|
24624
24946
|
React30.useEffect(() => {
|
|
24625
24947
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
24626
24948
|
}, [handlePointerUp]);
|
|
24627
|
-
return /* @__PURE__ */
|
|
24949
|
+
return /* @__PURE__ */ jsx21(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx21(
|
|
24628
24950
|
Primitive.button,
|
|
24629
24951
|
{
|
|
24630
24952
|
"aria-describedby": context.open ? context.contentId : void 0,
|
|
@@ -24666,7 +24988,7 @@ var [PortalProvider2, usePortalContext2] = createTooltipContext(PORTAL_NAME3, {
|
|
|
24666
24988
|
var TooltipPortal = (props) => {
|
|
24667
24989
|
const { __scopeTooltip, forceMount, children, container } = props;
|
|
24668
24990
|
const context = useTooltipContext(PORTAL_NAME3, __scopeTooltip);
|
|
24669
|
-
return /* @__PURE__ */
|
|
24991
|
+
return /* @__PURE__ */ jsx21(PortalProvider2, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx21(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx21(Portal, { asChild: true, container, children }) }) });
|
|
24670
24992
|
};
|
|
24671
24993
|
TooltipPortal.displayName = PORTAL_NAME3;
|
|
24672
24994
|
var CONTENT_NAME3 = "TooltipContent";
|
|
@@ -24675,7 +24997,7 @@ var TooltipContent = React30.forwardRef(
|
|
|
24675
24997
|
const portalContext = usePortalContext2(CONTENT_NAME3, props.__scopeTooltip);
|
|
24676
24998
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
24677
24999
|
const context = useTooltipContext(CONTENT_NAME3, props.__scopeTooltip);
|
|
24678
|
-
return /* @__PURE__ */
|
|
25000
|
+
return /* @__PURE__ */ jsx21(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx21(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx21(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
24679
25001
|
}
|
|
24680
25002
|
);
|
|
24681
25003
|
var TooltipContentHoverable = React30.forwardRef((props, forwardedRef) => {
|
|
@@ -24737,7 +25059,7 @@ var TooltipContentHoverable = React30.forwardRef((props, forwardedRef) => {
|
|
|
24737
25059
|
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
24738
25060
|
}
|
|
24739
25061
|
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
|
24740
|
-
return /* @__PURE__ */
|
|
25062
|
+
return /* @__PURE__ */ jsx21(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
24741
25063
|
});
|
|
24742
25064
|
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
24743
25065
|
var Slottable = createSlottable("TooltipContent");
|
|
@@ -24768,7 +25090,7 @@ var TooltipContentImpl = React30.forwardRef(
|
|
|
24768
25090
|
return () => window.removeEventListener("scroll", handleScroll2, { capture: true });
|
|
24769
25091
|
}
|
|
24770
25092
|
}, [context.trigger, onClose]);
|
|
24771
|
-
return /* @__PURE__ */
|
|
25093
|
+
return /* @__PURE__ */ jsx21(
|
|
24772
25094
|
DismissableLayer,
|
|
24773
25095
|
{
|
|
24774
25096
|
asChild: true,
|
|
@@ -24796,8 +25118,8 @@ var TooltipContentImpl = React30.forwardRef(
|
|
|
24796
25118
|
}
|
|
24797
25119
|
},
|
|
24798
25120
|
children: [
|
|
24799
|
-
/* @__PURE__ */
|
|
24800
|
-
/* @__PURE__ */
|
|
25121
|
+
/* @__PURE__ */ jsx21(Slottable, { children }),
|
|
25122
|
+
/* @__PURE__ */ jsx21(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx21(Root3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
|
24801
25123
|
]
|
|
24802
25124
|
}
|
|
24803
25125
|
)
|
|
@@ -24815,7 +25137,7 @@ var TooltipArrow = React30.forwardRef(
|
|
|
24815
25137
|
ARROW_NAME3,
|
|
24816
25138
|
__scopeTooltip
|
|
24817
25139
|
);
|
|
24818
|
-
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */
|
|
25140
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsx21(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
24819
25141
|
}
|
|
24820
25142
|
);
|
|
24821
25143
|
TooltipArrow.displayName = ARROW_NAME3;
|
|
@@ -24953,7 +25275,7 @@ __export(dist_exports6, {
|
|
|
24953
25275
|
createCollapsibleScope: () => createCollapsibleScope
|
|
24954
25276
|
});
|
|
24955
25277
|
import * as React31 from "react";
|
|
24956
|
-
import { jsx as
|
|
25278
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
24957
25279
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
24958
25280
|
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
24959
25281
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
@@ -24973,7 +25295,7 @@ var Collapsible = React31.forwardRef(
|
|
|
24973
25295
|
onChange: onOpenChange,
|
|
24974
25296
|
caller: COLLAPSIBLE_NAME
|
|
24975
25297
|
});
|
|
24976
|
-
return /* @__PURE__ */
|
|
25298
|
+
return /* @__PURE__ */ jsx22(
|
|
24977
25299
|
CollapsibleProvider,
|
|
24978
25300
|
{
|
|
24979
25301
|
scope: __scopeCollapsible,
|
|
@@ -24981,7 +25303,7 @@ var Collapsible = React31.forwardRef(
|
|
|
24981
25303
|
contentId: useId(),
|
|
24982
25304
|
open,
|
|
24983
25305
|
onOpenToggle: React31.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
24984
|
-
children: /* @__PURE__ */
|
|
25306
|
+
children: /* @__PURE__ */ jsx22(
|
|
24985
25307
|
Primitive.div,
|
|
24986
25308
|
{
|
|
24987
25309
|
"data-state": getState2(open),
|
|
@@ -25000,7 +25322,7 @@ var CollapsibleTrigger = React31.forwardRef(
|
|
|
25000
25322
|
(props, forwardedRef) => {
|
|
25001
25323
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
25002
25324
|
const context = useCollapsibleContext(TRIGGER_NAME3, __scopeCollapsible);
|
|
25003
|
-
return /* @__PURE__ */
|
|
25325
|
+
return /* @__PURE__ */ jsx22(
|
|
25004
25326
|
Primitive.button,
|
|
25005
25327
|
{
|
|
25006
25328
|
type: "button",
|
|
@@ -25022,7 +25344,7 @@ var CollapsibleContent = React31.forwardRef(
|
|
|
25022
25344
|
(props, forwardedRef) => {
|
|
25023
25345
|
const { forceMount, ...contentProps } = props;
|
|
25024
25346
|
const context = useCollapsibleContext(CONTENT_NAME4, props.__scopeCollapsible);
|
|
25025
|
-
return /* @__PURE__ */
|
|
25347
|
+
return /* @__PURE__ */ jsx22(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx22(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
|
|
25026
25348
|
}
|
|
25027
25349
|
);
|
|
25028
25350
|
CollapsibleContent.displayName = CONTENT_NAME4;
|
|
@@ -25062,7 +25384,7 @@ var CollapsibleContentImpl = React31.forwardRef((props, forwardedRef) => {
|
|
|
25062
25384
|
setIsPresent(present);
|
|
25063
25385
|
}
|
|
25064
25386
|
}, [context.open, present]);
|
|
25065
|
-
return /* @__PURE__ */
|
|
25387
|
+
return /* @__PURE__ */ jsx22(
|
|
25066
25388
|
Primitive.div,
|
|
25067
25389
|
{
|
|
25068
25390
|
"data-state": getState2(context.open),
|
|
@@ -25110,7 +25432,7 @@ __export(dist_exports7, {
|
|
|
25110
25432
|
createDialogScope: () => createDialogScope
|
|
25111
25433
|
});
|
|
25112
25434
|
import * as React32 from "react";
|
|
25113
|
-
import { Fragment as Fragment7, jsx as
|
|
25435
|
+
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
25114
25436
|
var DIALOG_NAME = "Dialog";
|
|
25115
25437
|
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
25116
25438
|
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
@@ -25131,7 +25453,7 @@ var Dialog = (props) => {
|
|
|
25131
25453
|
onChange: onOpenChange,
|
|
25132
25454
|
caller: DIALOG_NAME
|
|
25133
25455
|
});
|
|
25134
|
-
return /* @__PURE__ */
|
|
25456
|
+
return /* @__PURE__ */ jsx23(
|
|
25135
25457
|
DialogProvider,
|
|
25136
25458
|
{
|
|
25137
25459
|
scope: __scopeDialog,
|
|
@@ -25155,7 +25477,7 @@ var DialogTrigger = React32.forwardRef(
|
|
|
25155
25477
|
const { __scopeDialog, ...triggerProps } = props;
|
|
25156
25478
|
const context = useDialogContext(TRIGGER_NAME4, __scopeDialog);
|
|
25157
25479
|
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
25158
|
-
return /* @__PURE__ */
|
|
25480
|
+
return /* @__PURE__ */ jsx23(
|
|
25159
25481
|
Primitive.button,
|
|
25160
25482
|
{
|
|
25161
25483
|
type: "button",
|
|
@@ -25178,7 +25500,7 @@ var [PortalProvider3, usePortalContext3] = createDialogContext(PORTAL_NAME4, {
|
|
|
25178
25500
|
var DialogPortal = (props) => {
|
|
25179
25501
|
const { __scopeDialog, forceMount, children, container } = props;
|
|
25180
25502
|
const context = useDialogContext(PORTAL_NAME4, __scopeDialog);
|
|
25181
|
-
return /* @__PURE__ */
|
|
25503
|
+
return /* @__PURE__ */ jsx23(PortalProvider3, { scope: __scopeDialog, forceMount, children: React32.Children.map(children, (child) => /* @__PURE__ */ jsx23(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx23(Portal, { asChild: true, container, children: child }) })) });
|
|
25182
25504
|
};
|
|
25183
25505
|
DialogPortal.displayName = PORTAL_NAME4;
|
|
25184
25506
|
var OVERLAY_NAME = "DialogOverlay";
|
|
@@ -25187,7 +25509,7 @@ var DialogOverlay = React32.forwardRef(
|
|
|
25187
25509
|
const portalContext = usePortalContext3(OVERLAY_NAME, props.__scopeDialog);
|
|
25188
25510
|
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
25189
25511
|
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
|
25190
|
-
return context.modal ? /* @__PURE__ */
|
|
25512
|
+
return context.modal ? /* @__PURE__ */ jsx23(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx23(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
|
|
25191
25513
|
}
|
|
25192
25514
|
);
|
|
25193
25515
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
@@ -25199,7 +25521,7 @@ var DialogOverlayImpl = React32.forwardRef(
|
|
|
25199
25521
|
return (
|
|
25200
25522
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
25201
25523
|
// ie. when `Overlay` and `Content` are siblings
|
|
25202
|
-
/* @__PURE__ */
|
|
25524
|
+
/* @__PURE__ */ jsx23(Combination_default, { as: Slot2, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx23(
|
|
25203
25525
|
Primitive.div,
|
|
25204
25526
|
{
|
|
25205
25527
|
"data-state": getState3(context.open),
|
|
@@ -25217,7 +25539,7 @@ var DialogContent = React32.forwardRef(
|
|
|
25217
25539
|
const portalContext = usePortalContext3(CONTENT_NAME5, props.__scopeDialog);
|
|
25218
25540
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
25219
25541
|
const context = useDialogContext(CONTENT_NAME5, props.__scopeDialog);
|
|
25220
|
-
return /* @__PURE__ */
|
|
25542
|
+
return /* @__PURE__ */ jsx23(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx23(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx23(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
25221
25543
|
}
|
|
25222
25544
|
);
|
|
25223
25545
|
DialogContent.displayName = CONTENT_NAME5;
|
|
@@ -25230,7 +25552,7 @@ var DialogContentModal = React32.forwardRef(
|
|
|
25230
25552
|
const content = contentRef.current;
|
|
25231
25553
|
if (content) return hideOthers(content);
|
|
25232
25554
|
}, []);
|
|
25233
|
-
return /* @__PURE__ */
|
|
25555
|
+
return /* @__PURE__ */ jsx23(
|
|
25234
25556
|
DialogContentImpl,
|
|
25235
25557
|
{
|
|
25236
25558
|
...props,
|
|
@@ -25260,7 +25582,7 @@ var DialogContentNonModal = React32.forwardRef(
|
|
|
25260
25582
|
const context = useDialogContext(CONTENT_NAME5, props.__scopeDialog);
|
|
25261
25583
|
const hasInteractedOutsideRef = React32.useRef(false);
|
|
25262
25584
|
const hasPointerDownOutsideRef = React32.useRef(false);
|
|
25263
|
-
return /* @__PURE__ */
|
|
25585
|
+
return /* @__PURE__ */ jsx23(
|
|
25264
25586
|
DialogContentImpl,
|
|
25265
25587
|
{
|
|
25266
25588
|
...props,
|
|
@@ -25303,7 +25625,7 @@ var DialogContentImpl = React32.forwardRef(
|
|
|
25303
25625
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
25304
25626
|
useFocusGuards();
|
|
25305
25627
|
return /* @__PURE__ */ jsxs7(Fragment7, { children: [
|
|
25306
|
-
/* @__PURE__ */
|
|
25628
|
+
/* @__PURE__ */ jsx23(
|
|
25307
25629
|
FocusScope,
|
|
25308
25630
|
{
|
|
25309
25631
|
asChild: true,
|
|
@@ -25311,7 +25633,7 @@ var DialogContentImpl = React32.forwardRef(
|
|
|
25311
25633
|
trapped: trapFocus,
|
|
25312
25634
|
onMountAutoFocus: onOpenAutoFocus,
|
|
25313
25635
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
25314
|
-
children: /* @__PURE__ */
|
|
25636
|
+
children: /* @__PURE__ */ jsx23(
|
|
25315
25637
|
DismissableLayer,
|
|
25316
25638
|
{
|
|
25317
25639
|
role: "dialog",
|
|
@@ -25327,8 +25649,8 @@ var DialogContentImpl = React32.forwardRef(
|
|
|
25327
25649
|
}
|
|
25328
25650
|
),
|
|
25329
25651
|
/* @__PURE__ */ jsxs7(Fragment7, { children: [
|
|
25330
|
-
/* @__PURE__ */
|
|
25331
|
-
/* @__PURE__ */
|
|
25652
|
+
/* @__PURE__ */ jsx23(TitleWarning, { titleId: context.titleId }),
|
|
25653
|
+
/* @__PURE__ */ jsx23(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
|
25332
25654
|
] })
|
|
25333
25655
|
] });
|
|
25334
25656
|
}
|
|
@@ -25338,7 +25660,7 @@ var DialogTitle = React32.forwardRef(
|
|
|
25338
25660
|
(props, forwardedRef) => {
|
|
25339
25661
|
const { __scopeDialog, ...titleProps } = props;
|
|
25340
25662
|
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
25341
|
-
return /* @__PURE__ */
|
|
25663
|
+
return /* @__PURE__ */ jsx23(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
25342
25664
|
}
|
|
25343
25665
|
);
|
|
25344
25666
|
DialogTitle.displayName = TITLE_NAME;
|
|
@@ -25347,7 +25669,7 @@ var DialogDescription = React32.forwardRef(
|
|
|
25347
25669
|
(props, forwardedRef) => {
|
|
25348
25670
|
const { __scopeDialog, ...descriptionProps } = props;
|
|
25349
25671
|
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
25350
|
-
return /* @__PURE__ */
|
|
25672
|
+
return /* @__PURE__ */ jsx23(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
25351
25673
|
}
|
|
25352
25674
|
);
|
|
25353
25675
|
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
@@ -25356,7 +25678,7 @@ var DialogClose = React32.forwardRef(
|
|
|
25356
25678
|
(props, forwardedRef) => {
|
|
25357
25679
|
const { __scopeDialog, ...closeProps } = props;
|
|
25358
25680
|
const context = useDialogContext(CLOSE_NAME2, __scopeDialog);
|
|
25359
|
-
return /* @__PURE__ */
|
|
25681
|
+
return /* @__PURE__ */ jsx23(
|
|
25360
25682
|
Primitive.button,
|
|
25361
25683
|
{
|
|
25362
25684
|
type: "button",
|
|
@@ -25415,17 +25737,17 @@ var Description = DialogDescription;
|
|
|
25415
25737
|
var Close2 = DialogClose;
|
|
25416
25738
|
|
|
25417
25739
|
// ../ui/src/lib/overlay-container.ts
|
|
25418
|
-
import { createContext as
|
|
25419
|
-
var OverlayRootContext =
|
|
25420
|
-
var PortalContainerContext =
|
|
25740
|
+
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
25741
|
+
var OverlayRootContext = createContext8(null);
|
|
25742
|
+
var PortalContainerContext = createContext8(null);
|
|
25421
25743
|
var OverlayRootProvider = OverlayRootContext.Provider;
|
|
25422
25744
|
var PortalContainerProvider = PortalContainerContext.Provider;
|
|
25423
25745
|
function useOverlayRoot() {
|
|
25424
|
-
return
|
|
25746
|
+
return useContext8(OverlayRootContext) ?? void 0;
|
|
25425
25747
|
}
|
|
25426
25748
|
function usePortalContainer() {
|
|
25427
|
-
const container =
|
|
25428
|
-
const root =
|
|
25749
|
+
const container = useContext8(PortalContainerContext);
|
|
25750
|
+
const root = useContext8(OverlayRootContext);
|
|
25429
25751
|
return container ?? root ?? void 0;
|
|
25430
25752
|
}
|
|
25431
25753
|
|
|
@@ -26605,16 +26927,16 @@ var cn2 = /* @__PURE__ */ wrapClsx(instance.mergeString, instance);
|
|
|
26605
26927
|
var twMerge2 = instance.merge;
|
|
26606
26928
|
|
|
26607
26929
|
// ../ui/src/components/dialog.tsx
|
|
26608
|
-
import { jsx as
|
|
26930
|
+
import { jsx as jsx24, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
26609
26931
|
function Dialog2({
|
|
26610
26932
|
...props
|
|
26611
26933
|
}) {
|
|
26612
|
-
return /* @__PURE__ */
|
|
26934
|
+
return /* @__PURE__ */ jsx24(dist_exports7.Root, { "data-slot": "dialog", ...props });
|
|
26613
26935
|
}
|
|
26614
26936
|
function DialogClose2({
|
|
26615
26937
|
...props
|
|
26616
26938
|
}) {
|
|
26617
|
-
return /* @__PURE__ */
|
|
26939
|
+
return /* @__PURE__ */ jsx24(dist_exports7.Close, { "data-slot": "dialog-close", ...props });
|
|
26618
26940
|
}
|
|
26619
26941
|
|
|
26620
26942
|
// ../ui/src/composites/dialog.tsx
|
|
@@ -26654,9 +26976,9 @@ function loopTabInShadowRoot(event) {
|
|
|
26654
26976
|
}
|
|
26655
26977
|
|
|
26656
26978
|
// ../ui/src/composites/dialog.tsx
|
|
26657
|
-
import { jsx as
|
|
26979
|
+
import { jsx as jsx25, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
26658
26980
|
var DialogOverlay2 = forwardRef17(function DialogOverlay3({ className, ...props }, ref) {
|
|
26659
|
-
return /* @__PURE__ */
|
|
26981
|
+
return /* @__PURE__ */ jsx25(
|
|
26660
26982
|
dist_exports7.Overlay,
|
|
26661
26983
|
{
|
|
26662
26984
|
ref,
|
|
@@ -26679,7 +27001,7 @@ function DialogContent2({
|
|
|
26679
27001
|
}) {
|
|
26680
27002
|
const overlayRoot = useOverlayRoot();
|
|
26681
27003
|
return /* @__PURE__ */ jsxs9(dist_exports7.Portal, { "data-slot": "dialog-portal", container: overlayRoot, children: [
|
|
26682
|
-
/* @__PURE__ */
|
|
27004
|
+
/* @__PURE__ */ jsx25(DialogOverlay2, { className: overlayClassName }),
|
|
26683
27005
|
/* @__PURE__ */ jsxs9(
|
|
26684
27006
|
dist_exports7.Content,
|
|
26685
27007
|
{
|
|
@@ -26701,8 +27023,8 @@ function DialogContent2({
|
|
|
26701
27023
|
"data-slot": "dialog-close",
|
|
26702
27024
|
className: "absolute top-4 right-4 rounded-[8px] p-2 text-[hsl(var(--muted-foreground))] opacity-90 transition-colors hover:bg-[hsl(var(--accent))] hover:opacity-100 focus:outline-none disabled:pointer-events-none",
|
|
26703
27025
|
children: [
|
|
26704
|
-
/* @__PURE__ */
|
|
26705
|
-
/* @__PURE__ */
|
|
27026
|
+
/* @__PURE__ */ jsx25(X, { size: 16 }),
|
|
27027
|
+
/* @__PURE__ */ jsx25("span", { className: "sr-only", children: "\u5173\u95ED" })
|
|
26706
27028
|
]
|
|
26707
27029
|
}
|
|
26708
27030
|
)
|
|
@@ -26712,7 +27034,7 @@ function DialogContent2({
|
|
|
26712
27034
|
] });
|
|
26713
27035
|
}
|
|
26714
27036
|
function DialogTitle2({ className, ...props }) {
|
|
26715
|
-
return /* @__PURE__ */
|
|
27037
|
+
return /* @__PURE__ */ jsx25(
|
|
26716
27038
|
dist_exports7.Title,
|
|
26717
27039
|
{
|
|
26718
27040
|
"data-slot": "dialog-title",
|
|
@@ -26725,7 +27047,7 @@ function DialogDescription2({
|
|
|
26725
27047
|
className,
|
|
26726
27048
|
...props
|
|
26727
27049
|
}) {
|
|
26728
|
-
return /* @__PURE__ */
|
|
27050
|
+
return /* @__PURE__ */ jsx25(
|
|
26729
27051
|
dist_exports7.Description,
|
|
26730
27052
|
{
|
|
26731
27053
|
"data-slot": "dialog-description",
|
|
@@ -26915,6 +27237,32 @@ export {
|
|
|
26915
27237
|
DialogTitle2 as DialogTitle,
|
|
26916
27238
|
DialogDescription2 as DialogDescription,
|
|
26917
27239
|
chatTone,
|
|
27240
|
+
RichInputServicesProvider,
|
|
27241
|
+
useRichInputServices,
|
|
27242
|
+
fetchClientQuery,
|
|
27243
|
+
setClientQueryData,
|
|
27244
|
+
useClientQuery,
|
|
27245
|
+
refreshClientQuery,
|
|
27246
|
+
useRefreshWhenRunEnds,
|
|
27247
|
+
useClientSessionSkills,
|
|
27248
|
+
useClientSkillStats,
|
|
27249
|
+
useClientContextStats,
|
|
27250
|
+
useClientBackgroundTasks,
|
|
27251
|
+
refreshClientSessionSkills,
|
|
27252
|
+
useClientSessionModel,
|
|
27253
|
+
useClientModelCatalog,
|
|
27254
|
+
PREFERRED_MODEL_KEY,
|
|
27255
|
+
MODEL_REASONING_LEVELS_KEY,
|
|
27256
|
+
useClientModelPreferences,
|
|
27257
|
+
useModelCatalog,
|
|
27258
|
+
useModelPreferences,
|
|
27259
|
+
useComposerConnectionInfo,
|
|
27260
|
+
useComposerConnection,
|
|
27261
|
+
useSessionSkills,
|
|
27262
|
+
useSkillStats,
|
|
27263
|
+
useContextStats,
|
|
27264
|
+
useBackgroundTaskList,
|
|
27265
|
+
useSessionDataInvalidation,
|
|
26918
27266
|
useEffectEvent2 as useEffectEvent,
|
|
26919
27267
|
SessionPluginConfigForm,
|
|
26920
27268
|
sessionPluginLabel,
|
|
@@ -27029,4 +27377,4 @@ lucide-react/dist/esm/lucide-react.js:
|
|
|
27029
27377
|
* See the LICENSE file in the root directory of this source tree.
|
|
27030
27378
|
*)
|
|
27031
27379
|
*/
|
|
27032
|
-
//# sourceMappingURL=chunk-
|
|
27380
|
+
//# sourceMappingURL=chunk-42P352DI.js.map
|