@djangocfg/ui-tools 2.1.284 → 2.1.286
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/DocsLayout-BCVU6TTX.cjs +2027 -0
- package/dist/DocsLayout-BCVU6TTX.cjs.map +1 -0
- package/dist/DocsLayout-ERETJLLV.mjs +2020 -0
- package/dist/DocsLayout-ERETJLLV.mjs.map +1 -0
- package/dist/{PlaygroundLayout-O52C6HK5.css → DocsLayout-MBFIB4NO.css} +1 -1
- package/dist/{PrettyCode.client-SGDGQTYT.cjs → PrettyCode.client-5GABIN2I.cjs} +57 -35
- package/dist/PrettyCode.client-5GABIN2I.cjs.map +1 -0
- package/dist/{PrettyCode.client-DW5LTG47.mjs → PrettyCode.client-IZTXXYHG.mjs} +57 -35
- package/dist/PrettyCode.client-IZTXXYHG.mjs.map +1 -0
- package/dist/chunk-IULI4XII.cjs +1129 -0
- package/dist/chunk-IULI4XII.cjs.map +1 -0
- package/dist/chunk-VZGQC3NG.mjs +1100 -0
- package/dist/chunk-VZGQC3NG.mjs.map +1 -0
- package/dist/index.cjs +88 -552
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.mjs +25 -496
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/tools/OpenapiViewer/.claude/.sidecar/activity.jsonl +4 -0
- package/src/tools/OpenapiViewer/.claude/.sidecar/map_cache.json +30 -0
- package/src/tools/OpenapiViewer/.claude/.sidecar/usage.json +5 -0
- package/src/tools/OpenapiViewer/.claude/project-map.md +23 -0
- package/src/tools/OpenapiViewer/OpenapiViewer.story.tsx +28 -2
- package/src/tools/OpenapiViewer/README.md +104 -51
- package/src/tools/OpenapiViewer/components/DocsLayout/ApiIntroSection.tsx +64 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/DocsView.tsx +137 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc.tsx +268 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/SchemaCopyMenu.tsx +139 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar.tsx +211 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/SlideInPlayground.tsx +101 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/TryItSheet.tsx +57 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/anchor.ts +11 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/grouping.ts +71 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/index.tsx +166 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/schemaFields.ts +121 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/sidebarLabel.ts +60 -0
- package/src/tools/OpenapiViewer/components/index.ts +5 -2
- package/src/tools/OpenapiViewer/components/shared/BodyFormEditor.tsx +422 -0
- package/src/tools/OpenapiViewer/components/shared/EndpointDraftSync.tsx +108 -0
- package/src/tools/OpenapiViewer/components/shared/EndpointResetButton.tsx +50 -0
- package/src/tools/OpenapiViewer/components/{PlaygroundLayout → shared}/RequestPanel.tsx +174 -87
- package/src/tools/OpenapiViewer/components/shared/SendButton.tsx +91 -0
- package/src/tools/OpenapiViewer/components/{PlaygroundLayout → shared}/ui.tsx +5 -4
- package/src/tools/OpenapiViewer/context/PlaygroundContext.tsx +82 -8
- package/src/tools/OpenapiViewer/hooks/useEndpointDraft.ts +142 -0
- package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +126 -13
- package/src/tools/OpenapiViewer/index.tsx +3 -7
- package/src/tools/OpenapiViewer/lazy.tsx +6 -27
- package/src/tools/OpenapiViewer/types.ts +44 -0
- package/src/tools/OpenapiViewer/utils/formatters.ts +2 -23
- package/src/tools/OpenapiViewer/utils/index.ts +3 -1
- package/src/tools/OpenapiViewer/utils/schemaExport.ts +206 -0
- package/src/tools/OpenapiViewer/utils/url.ts +202 -0
- package/src/tools/PrettyCode/PrettyCode.client.tsx +42 -8
- package/src/tools/PrettyCode/index.tsx +6 -0
- package/dist/PlaygroundLayout-DHUATCHB.cjs +0 -798
- package/dist/PlaygroundLayout-DHUATCHB.cjs.map +0 -1
- package/dist/PlaygroundLayout-NONWOVQR.mjs +0 -791
- package/dist/PlaygroundLayout-NONWOVQR.mjs.map +0 -1
- package/dist/PrettyCode.client-DW5LTG47.mjs.map +0 -1
- package/dist/PrettyCode.client-SGDGQTYT.cjs.map +0 -1
- package/dist/chunk-5FKE7OME.cjs +0 -369
- package/dist/chunk-5FKE7OME.cjs.map +0 -1
- package/dist/chunk-BKWDHJKF.mjs +0 -356
- package/dist/chunk-BKWDHJKF.mjs.map +0 -1
- package/src/tools/OpenapiViewer/components/PlaygroundLayout/EndpointList.tsx +0 -228
- package/src/tools/OpenapiViewer/components/PlaygroundLayout/index.tsx +0 -107
- /package/dist/{PlaygroundLayout-O52C6HK5.css.map → DocsLayout-MBFIB4NO.css.map} +0 -0
- /package/src/tools/OpenapiViewer/components/{PlaygroundLayout → shared}/ResponsePanel.tsx +0 -0
package/dist/index.cjs
CHANGED
|
@@ -6,21 +6,17 @@ require('./chunk-F2N7P5XU.cjs');
|
|
|
6
6
|
var chunkIHAY6FO6_cjs = require('./chunk-IHAY6FO6.cjs');
|
|
7
7
|
var chunk77HQWEQ6_cjs = require('./chunk-77HQWEQ6.cjs');
|
|
8
8
|
var chunkF2CMIIOH_cjs = require('./chunk-F2CMIIOH.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkIULI4XII_cjs = require('./chunk-IULI4XII.cjs');
|
|
10
10
|
var chunk33AMWFBZ_cjs = require('./chunk-33AMWFBZ.cjs');
|
|
11
11
|
require('./chunk-2SMCH62O.cjs');
|
|
12
12
|
var chunkL37FZYJU_cjs = require('./chunk-L37FZYJU.cjs');
|
|
13
13
|
var chunkPRPG2T2E_cjs = require('./chunk-PRPG2T2E.cjs');
|
|
14
14
|
var chunkWGEGR3DF_cjs = require('./chunk-WGEGR3DF.cjs');
|
|
15
|
-
var
|
|
15
|
+
var React = require('react');
|
|
16
16
|
var lib = require('@djangocfg/ui-core/lib');
|
|
17
17
|
var i18n = require('@djangocfg/i18n');
|
|
18
18
|
var jsxRuntime = require('react/jsx-runtime');
|
|
19
|
-
var ReactMarkdown = require('react-markdown');
|
|
20
|
-
var remarkGfm = require('remark-gfm');
|
|
21
|
-
var components = require('@djangocfg/ui-core/components');
|
|
22
19
|
var hooks = require('@djangocfg/ui-core/hooks');
|
|
23
|
-
require('@djangocfg/ui-core/styles/palette');
|
|
24
20
|
var react = require('@tiptap/react');
|
|
25
21
|
var StarterKit = require('@tiptap/starter-kit');
|
|
26
22
|
var Placeholder = require('@tiptap/extension-placeholder');
|
|
@@ -48,9 +44,7 @@ function _interopNamespace(e) {
|
|
|
48
44
|
return Object.freeze(n);
|
|
49
45
|
}
|
|
50
46
|
|
|
51
|
-
var
|
|
52
|
-
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
53
|
-
var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
|
|
47
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
54
48
|
var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
|
|
55
49
|
var Placeholder__default = /*#__PURE__*/_interopDefault(Placeholder);
|
|
56
50
|
var Mention__default = /*#__PURE__*/_interopDefault(Mention);
|
|
@@ -205,486 +199,19 @@ function LazyWrapper({
|
|
|
205
199
|
className
|
|
206
200
|
}
|
|
207
201
|
) : /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight, className });
|
|
208
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
202
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: fallback ?? defaultFallback, children });
|
|
209
203
|
}
|
|
210
204
|
chunkWGEGR3DF_cjs.__name(LazyWrapper, "LazyWrapper");
|
|
211
205
|
function createLazyComponent(loader, options = {}) {
|
|
212
|
-
const LazyComponent =
|
|
206
|
+
const LazyComponent = React__namespace.lazy(loader);
|
|
213
207
|
const WrappedComponent = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((props) => {
|
|
214
208
|
const fallback = typeof options.fallback === "function" ? options.fallback(props) : options.fallback ?? /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, {});
|
|
215
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
209
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback, children: /* @__PURE__ */ jsxRuntime.jsx(LazyComponent, { ...props }) });
|
|
216
210
|
}, "WrappedComponent");
|
|
217
211
|
WrappedComponent.displayName = options.displayName ?? "LazyComponent";
|
|
218
212
|
return WrappedComponent;
|
|
219
213
|
}
|
|
220
214
|
chunkWGEGR3DF_cjs.__name(createLazyComponent, "createLazyComponent");
|
|
221
|
-
var MermaidClient = React3.lazy(() => import('./Mermaid.client-RSWUUHIL.cjs'));
|
|
222
|
-
var LoadingFallback2 = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center items-center min-h-[100px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-6 w-6 border-b-2 border-primary" }) }), "LoadingFallback");
|
|
223
|
-
var Mermaid = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((props) => {
|
|
224
|
-
return /* @__PURE__ */ jsxRuntime.jsx(React3.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback2, {}), children: /* @__PURE__ */ jsxRuntime.jsx(MermaidClient, { ...props }) });
|
|
225
|
-
}, "Mermaid");
|
|
226
|
-
var Mermaid_default = Mermaid;
|
|
227
|
-
function smartTruncate(content, maxLength) {
|
|
228
|
-
if (content.length <= maxLength) {
|
|
229
|
-
return content;
|
|
230
|
-
}
|
|
231
|
-
let breakPoint = maxLength;
|
|
232
|
-
while (breakPoint > maxLength - 50 && breakPoint > 0) {
|
|
233
|
-
const char = content[breakPoint];
|
|
234
|
-
if (char === " " || char === "\n" || char === " ") {
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
breakPoint--;
|
|
238
|
-
}
|
|
239
|
-
if (breakPoint <= maxLength - 50) {
|
|
240
|
-
breakPoint = maxLength;
|
|
241
|
-
}
|
|
242
|
-
let truncated = content.slice(0, breakPoint).trimEnd();
|
|
243
|
-
truncated = fixUnclosedMarkdown(truncated);
|
|
244
|
-
return truncated;
|
|
245
|
-
}
|
|
246
|
-
chunkWGEGR3DF_cjs.__name(smartTruncate, "smartTruncate");
|
|
247
|
-
function truncateByLines(content, maxLines) {
|
|
248
|
-
const lines = content.split("\n");
|
|
249
|
-
if (lines.length <= maxLines) {
|
|
250
|
-
return content;
|
|
251
|
-
}
|
|
252
|
-
let truncated = lines.slice(0, maxLines).join("\n").trimEnd();
|
|
253
|
-
truncated = fixUnclosedMarkdown(truncated);
|
|
254
|
-
return truncated;
|
|
255
|
-
}
|
|
256
|
-
chunkWGEGR3DF_cjs.__name(truncateByLines, "truncateByLines");
|
|
257
|
-
function fixUnclosedMarkdown(content) {
|
|
258
|
-
let result = content;
|
|
259
|
-
const countOccurrences = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((str, marker) => {
|
|
260
|
-
const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
261
|
-
const matches = str.match(new RegExp(escaped, "g"));
|
|
262
|
-
return matches ? matches.length : 0;
|
|
263
|
-
}, "countOccurrences");
|
|
264
|
-
const boldCount = countOccurrences(result, "**");
|
|
265
|
-
if (boldCount % 2 !== 0) {
|
|
266
|
-
result += "**";
|
|
267
|
-
}
|
|
268
|
-
const withoutBold = result.replace(/\*\*/g, "");
|
|
269
|
-
const italicCount = countOccurrences(withoutBold, "*");
|
|
270
|
-
if (italicCount % 2 !== 0) {
|
|
271
|
-
result += "*";
|
|
272
|
-
}
|
|
273
|
-
const codeCount = countOccurrences(result, "`");
|
|
274
|
-
const tripleCount = countOccurrences(result, "```");
|
|
275
|
-
const singleCodeCount = codeCount - tripleCount * 3;
|
|
276
|
-
if (singleCodeCount % 2 !== 0) {
|
|
277
|
-
result += "`";
|
|
278
|
-
}
|
|
279
|
-
if (tripleCount % 2 !== 0) {
|
|
280
|
-
result += "\n```";
|
|
281
|
-
}
|
|
282
|
-
const strikeCount = countOccurrences(result, "~~");
|
|
283
|
-
if (strikeCount % 2 !== 0) {
|
|
284
|
-
result += "~~";
|
|
285
|
-
}
|
|
286
|
-
const underlineBoldCount = countOccurrences(result, "__");
|
|
287
|
-
if (underlineBoldCount % 2 !== 0) {
|
|
288
|
-
result += "__";
|
|
289
|
-
}
|
|
290
|
-
const withoutUnderlineBold = result.replace(/__/g, "");
|
|
291
|
-
const underlineItalicCount = countOccurrences(withoutUnderlineBold, "_");
|
|
292
|
-
if (underlineItalicCount % 2 !== 0) {
|
|
293
|
-
result += "_";
|
|
294
|
-
}
|
|
295
|
-
return result;
|
|
296
|
-
}
|
|
297
|
-
chunkWGEGR3DF_cjs.__name(fixUnclosedMarkdown, "fixUnclosedMarkdown");
|
|
298
|
-
function useCollapsibleContent(content, options = {}) {
|
|
299
|
-
const { maxLength, maxLines, defaultExpanded = false } = options;
|
|
300
|
-
const [isCollapsed, setIsCollapsed] = React3.useState(!defaultExpanded);
|
|
301
|
-
const originalLength = content.length;
|
|
302
|
-
const originalLineCount = content.split("\n").length;
|
|
303
|
-
const { shouldCollapse, truncatedContent } = React3.useMemo(() => {
|
|
304
|
-
if (maxLength === void 0 && maxLines === void 0) {
|
|
305
|
-
return { shouldCollapse: false, truncatedContent: content };
|
|
306
|
-
}
|
|
307
|
-
let needsCollapse = false;
|
|
308
|
-
let result = content;
|
|
309
|
-
if (maxLines !== void 0 && originalLineCount > maxLines) {
|
|
310
|
-
needsCollapse = true;
|
|
311
|
-
result = truncateByLines(result, maxLines);
|
|
312
|
-
}
|
|
313
|
-
if (maxLength !== void 0 && result.length > maxLength) {
|
|
314
|
-
needsCollapse = true;
|
|
315
|
-
result = smartTruncate(result, maxLength);
|
|
316
|
-
}
|
|
317
|
-
return { shouldCollapse: needsCollapse, truncatedContent: result };
|
|
318
|
-
}, [content, maxLength, maxLines, originalLineCount]);
|
|
319
|
-
const displayContent = React3.useMemo(() => {
|
|
320
|
-
if (!shouldCollapse || !isCollapsed) {
|
|
321
|
-
return content;
|
|
322
|
-
}
|
|
323
|
-
return truncatedContent;
|
|
324
|
-
}, [content, truncatedContent, shouldCollapse, isCollapsed]);
|
|
325
|
-
const toggleCollapsed = React3.useCallback(() => {
|
|
326
|
-
setIsCollapsed((prev) => !prev);
|
|
327
|
-
}, []);
|
|
328
|
-
const setCollapsed = React3.useCallback((collapsed) => {
|
|
329
|
-
setIsCollapsed(collapsed);
|
|
330
|
-
}, []);
|
|
331
|
-
return {
|
|
332
|
-
isCollapsed,
|
|
333
|
-
toggleCollapsed,
|
|
334
|
-
setCollapsed,
|
|
335
|
-
displayContent,
|
|
336
|
-
shouldCollapse,
|
|
337
|
-
originalLength,
|
|
338
|
-
originalLineCount
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
chunkWGEGR3DF_cjs.__name(useCollapsibleContent, "useCollapsibleContent");
|
|
342
|
-
var extractTextFromChildren = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((children) => {
|
|
343
|
-
if (typeof children === "string") {
|
|
344
|
-
return children;
|
|
345
|
-
}
|
|
346
|
-
if (typeof children === "number") {
|
|
347
|
-
return String(children);
|
|
348
|
-
}
|
|
349
|
-
if (React3__namespace.default.isValidElement(children)) {
|
|
350
|
-
const props = children.props;
|
|
351
|
-
return extractTextFromChildren(props.children);
|
|
352
|
-
}
|
|
353
|
-
if (Array.isArray(children)) {
|
|
354
|
-
return children.map(extractTextFromChildren).join("");
|
|
355
|
-
}
|
|
356
|
-
return "";
|
|
357
|
-
}, "extractTextFromChildren");
|
|
358
|
-
var CodeBlock = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ code, language, isUser, isCompact = false }) => {
|
|
359
|
-
const theme = hooks.useResolvedTheme();
|
|
360
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative group my-3", children: [
|
|
361
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
362
|
-
components.CopyButton,
|
|
363
|
-
{
|
|
364
|
-
value: code,
|
|
365
|
-
variant: "ghost",
|
|
366
|
-
className: `
|
|
367
|
-
absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity
|
|
368
|
-
h-8 w-8
|
|
369
|
-
${isUser ? "hover:bg-white/20 text-white" : "hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground"}
|
|
370
|
-
`,
|
|
371
|
-
title: "Copy code"
|
|
372
|
-
}
|
|
373
|
-
),
|
|
374
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
375
|
-
chunk5FKE7OME_cjs.PrettyCode_default,
|
|
376
|
-
{
|
|
377
|
-
data: code,
|
|
378
|
-
language,
|
|
379
|
-
className: isCompact ? "text-xs" : "text-sm",
|
|
380
|
-
customBg: isUser ? "bg-white/10" : "bg-muted dark:bg-muted",
|
|
381
|
-
mode: theme,
|
|
382
|
-
isCompact
|
|
383
|
-
}
|
|
384
|
-
)
|
|
385
|
-
] });
|
|
386
|
-
}, "CodeBlock");
|
|
387
|
-
var createMarkdownComponents = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((isUser = false, isCompact = false) => {
|
|
388
|
-
const textSize = isCompact ? "text-xs" : "text-sm";
|
|
389
|
-
const headingBase = isCompact ? "text-sm" : "text-base";
|
|
390
|
-
const headingSm = isCompact ? "text-xs" : "text-sm";
|
|
391
|
-
return {
|
|
392
|
-
// Headings - scaled for chat context
|
|
393
|
-
h1: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("h1", { className: `${headingBase} font-bold mb-2 mt-3 first:mt-0`, children }), "h1"),
|
|
394
|
-
h2: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("h2", { className: `${headingSm} font-bold mb-2 mt-3 first:mt-0`, children }), "h2"),
|
|
395
|
-
h3: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("h3", { className: `${headingSm} font-semibold mb-1 mt-2 first:mt-0`, children }), "h3"),
|
|
396
|
-
h4: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("h4", { className: `${headingSm} font-semibold mb-1 mt-2 first:mt-0`, children }), "h4"),
|
|
397
|
-
h5: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("h5", { className: `${headingSm} font-medium mb-1 mt-2 first:mt-0`, children }), "h5"),
|
|
398
|
-
h6: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("h6", { className: `${headingSm} font-medium mb-1 mt-2 first:mt-0`, children }), "h6"),
|
|
399
|
-
// Paragraphs - optimized for chat readability
|
|
400
|
-
p: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: `${textSize} mb-4 last:mb-0 leading-7 break-words font-light`, children }), "p"),
|
|
401
|
-
// Lists - compact
|
|
402
|
-
ul: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("ul", { className: `list-disc list-inside mb-2 space-y-1 ${textSize}`, children }), "ul"),
|
|
403
|
-
ol: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("ol", { className: `list-decimal list-inside mb-2 space-y-1 ${textSize}`, children }), "ol"),
|
|
404
|
-
li: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "break-words", children }), "li"),
|
|
405
|
-
// Links - appropriate for chat context
|
|
406
|
-
a: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ href, children }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
407
|
-
"a",
|
|
408
|
-
{
|
|
409
|
-
href,
|
|
410
|
-
className: `${textSize} ${isUser ? "text-white/90 underline hover:text-white" : "text-primary underline hover:text-primary/80"} transition-colors break-all`,
|
|
411
|
-
target: href?.startsWith("http") ? "_blank" : void 0,
|
|
412
|
-
rel: href?.startsWith("http") ? "noopener noreferrer" : void 0,
|
|
413
|
-
children
|
|
414
|
-
}
|
|
415
|
-
), "a"),
|
|
416
|
-
// Code blocks - using CodeBlock component with copy functionality
|
|
417
|
-
pre: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => {
|
|
418
|
-
let codeContent = "";
|
|
419
|
-
let language = "plaintext";
|
|
420
|
-
if (React3__namespace.default.isValidElement(children)) {
|
|
421
|
-
const child = children;
|
|
422
|
-
if (child.type === "code" || typeof child.type === "function" && child.type.name === "code") {
|
|
423
|
-
const codeProps = child.props;
|
|
424
|
-
const rawClassName = codeProps.className;
|
|
425
|
-
language = rawClassName?.replace(/language-/, "").trim() || "plaintext";
|
|
426
|
-
codeContent = extractTextFromChildren(codeProps.children).trim();
|
|
427
|
-
} else {
|
|
428
|
-
codeContent = extractTextFromChildren(children).trim();
|
|
429
|
-
}
|
|
430
|
-
} else {
|
|
431
|
-
codeContent = extractTextFromChildren(children).trim();
|
|
432
|
-
}
|
|
433
|
-
if (!codeContent) {
|
|
434
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-3 p-3 bg-muted rounded text-sm text-muted-foreground", children: "No content available" });
|
|
435
|
-
}
|
|
436
|
-
if (language === "mermaid") {
|
|
437
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-3 max-w-full overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsx(Mermaid_default, { chart: codeContent, className: "max-w-[600px] mx-auto", isCompact }) });
|
|
438
|
-
}
|
|
439
|
-
try {
|
|
440
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CodeBlock, { code: codeContent, language, isUser, isCompact });
|
|
441
|
-
} catch (error) {
|
|
442
|
-
console.warn("CodeBlock failed, using fallback:", error);
|
|
443
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative group my-3", children: [
|
|
444
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
445
|
-
components.CopyButton,
|
|
446
|
-
{
|
|
447
|
-
value: codeContent,
|
|
448
|
-
variant: "ghost",
|
|
449
|
-
className: `
|
|
450
|
-
absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity
|
|
451
|
-
h-8 w-8
|
|
452
|
-
${isUser ? "hover:bg-white/20 text-white" : "hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground"}
|
|
453
|
-
`,
|
|
454
|
-
title: "Copy code"
|
|
455
|
-
}
|
|
456
|
-
),
|
|
457
|
-
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: `
|
|
458
|
-
p-3 rounded text-xs font-mono overflow-x-auto
|
|
459
|
-
${isUser ? "bg-white/10 text-white" : "bg-muted text-foreground"}
|
|
460
|
-
`, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: codeContent }) })
|
|
461
|
-
] });
|
|
462
|
-
}
|
|
463
|
-
}, "pre"),
|
|
464
|
-
// Inline code
|
|
465
|
-
code: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children, className }) => {
|
|
466
|
-
if (className?.includes("language-")) {
|
|
467
|
-
return /* @__PURE__ */ jsxRuntime.jsx("code", { className, children });
|
|
468
|
-
}
|
|
469
|
-
const codeContent = extractTextFromChildren(children);
|
|
470
|
-
return /* @__PURE__ */ jsxRuntime.jsx("code", { className: "px-1.5 py-0.5 rounded text-xs font-mono bg-muted text-foreground break-all", children: codeContent });
|
|
471
|
-
}, "code"),
|
|
472
|
-
// Blockquotes
|
|
473
|
-
blockquote: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("blockquote", { className: `${textSize} border-l-2 border-border pl-3 my-2 italic text-muted-foreground break-words`, children }), "blockquote"),
|
|
474
|
-
// Tables - compact for chat
|
|
475
|
-
table: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto my-3", children: /* @__PURE__ */ jsxRuntime.jsx("table", { className: `min-w-full ${textSize} border-collapse`, children }) }), "table"),
|
|
476
|
-
thead: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-muted/50", children }), "thead"),
|
|
477
|
-
tbody: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { children }), "tbody"),
|
|
478
|
-
tr: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b border-border/50", children }), "tr"),
|
|
479
|
-
th: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-2 py-1 text-left font-medium break-words", children }), "th"),
|
|
480
|
-
td: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-1 break-words", children }), "td"),
|
|
481
|
-
// Horizontal rule
|
|
482
|
-
hr: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("hr", { className: "my-3 border-0 h-px bg-border" }), "hr"),
|
|
483
|
-
// Strong and emphasis
|
|
484
|
-
strong: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "font-semibold", children }), "strong"),
|
|
485
|
-
em: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ children }) => /* @__PURE__ */ jsxRuntime.jsx("em", { className: "italic", children }), "em")
|
|
486
|
-
};
|
|
487
|
-
}, "createMarkdownComponents");
|
|
488
|
-
var hasMarkdownSyntax = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((text) => {
|
|
489
|
-
if (text.trim().includes("\n")) {
|
|
490
|
-
return true;
|
|
491
|
-
}
|
|
492
|
-
const markdownPatterns = [
|
|
493
|
-
/^#{1,6}\s/m,
|
|
494
|
-
// Headers
|
|
495
|
-
/\*\*[^*]+\*\*/,
|
|
496
|
-
// Bold
|
|
497
|
-
/\*[^*]+\*/,
|
|
498
|
-
// Italic
|
|
499
|
-
/__[^_]+__/,
|
|
500
|
-
// Bold (underscore)
|
|
501
|
-
/_[^_]+_/,
|
|
502
|
-
// Italic (underscore)
|
|
503
|
-
/\[.+\]\(.+\)/,
|
|
504
|
-
// Links
|
|
505
|
-
/!\[.*\]\(.+\)/,
|
|
506
|
-
// Images
|
|
507
|
-
/```[\s\S]*```/,
|
|
508
|
-
// Code blocks
|
|
509
|
-
/`[^`]+`/,
|
|
510
|
-
// Inline code
|
|
511
|
-
/^\s*[-*+]\s/m,
|
|
512
|
-
// Unordered lists
|
|
513
|
-
/^\s*\d+\.\s/m,
|
|
514
|
-
// Ordered lists
|
|
515
|
-
/^\s*>/m,
|
|
516
|
-
// Blockquotes
|
|
517
|
-
/\|.+\|/,
|
|
518
|
-
// Tables
|
|
519
|
-
/^---+$/m,
|
|
520
|
-
// Horizontal rules
|
|
521
|
-
/~~[^~]+~~/
|
|
522
|
-
// Strikethrough
|
|
523
|
-
];
|
|
524
|
-
return markdownPatterns.some((pattern) => pattern.test(text));
|
|
525
|
-
}, "hasMarkdownSyntax");
|
|
526
|
-
var CollapseToggle = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({
|
|
527
|
-
isCollapsed,
|
|
528
|
-
onClick,
|
|
529
|
-
readMoreLabel,
|
|
530
|
-
showLessLabel,
|
|
531
|
-
isUser,
|
|
532
|
-
isCompact
|
|
533
|
-
}) => {
|
|
534
|
-
const textSize = isCompact ? "text-xs" : "text-sm";
|
|
535
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
536
|
-
"button",
|
|
537
|
-
{
|
|
538
|
-
type: "button",
|
|
539
|
-
onClick,
|
|
540
|
-
className: `
|
|
541
|
-
${textSize} font-medium cursor-pointer
|
|
542
|
-
transition-colors duration-200
|
|
543
|
-
${isUser ? "text-white/80 hover:text-white" : "text-primary hover:text-primary/80"}
|
|
544
|
-
inline-flex items-center gap-1
|
|
545
|
-
mt-1
|
|
546
|
-
`,
|
|
547
|
-
children: isCollapsed ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
548
|
-
readMoreLabel,
|
|
549
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
550
|
-
"svg",
|
|
551
|
-
{
|
|
552
|
-
className: "w-3 h-3",
|
|
553
|
-
fill: "none",
|
|
554
|
-
stroke: "currentColor",
|
|
555
|
-
viewBox: "0 0 24 24",
|
|
556
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
557
|
-
"path",
|
|
558
|
-
{
|
|
559
|
-
strokeLinecap: "round",
|
|
560
|
-
strokeLinejoin: "round",
|
|
561
|
-
strokeWidth: 2,
|
|
562
|
-
d: "M19 9l-7 7-7-7"
|
|
563
|
-
}
|
|
564
|
-
)
|
|
565
|
-
}
|
|
566
|
-
)
|
|
567
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
568
|
-
showLessLabel,
|
|
569
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
570
|
-
"svg",
|
|
571
|
-
{
|
|
572
|
-
className: "w-3 h-3",
|
|
573
|
-
fill: "none",
|
|
574
|
-
stroke: "currentColor",
|
|
575
|
-
viewBox: "0 0 24 24",
|
|
576
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
577
|
-
"path",
|
|
578
|
-
{
|
|
579
|
-
strokeLinecap: "round",
|
|
580
|
-
strokeLinejoin: "round",
|
|
581
|
-
strokeWidth: 2,
|
|
582
|
-
d: "M5 15l7-7 7 7"
|
|
583
|
-
}
|
|
584
|
-
)
|
|
585
|
-
}
|
|
586
|
-
)
|
|
587
|
-
] })
|
|
588
|
-
}
|
|
589
|
-
);
|
|
590
|
-
}, "CollapseToggle");
|
|
591
|
-
var MarkdownMessage = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({
|
|
592
|
-
content,
|
|
593
|
-
className = "",
|
|
594
|
-
isUser = false,
|
|
595
|
-
isCompact = false,
|
|
596
|
-
collapsible = false,
|
|
597
|
-
maxLength,
|
|
598
|
-
maxLines,
|
|
599
|
-
readMoreLabel = "Read more...",
|
|
600
|
-
showLessLabel = "Show less",
|
|
601
|
-
defaultExpanded = false,
|
|
602
|
-
onCollapseChange
|
|
603
|
-
}) => {
|
|
604
|
-
const trimmedContent = content.trim();
|
|
605
|
-
const collapsibleOptions = React3__namespace.default.useMemo(() => {
|
|
606
|
-
if (!collapsible) return {};
|
|
607
|
-
const effectiveMaxLength = maxLength ?? 1e3;
|
|
608
|
-
const effectiveMaxLines = maxLines ?? 10;
|
|
609
|
-
return { maxLength: effectiveMaxLength, maxLines: effectiveMaxLines, defaultExpanded };
|
|
610
|
-
}, [collapsible, maxLength, maxLines, defaultExpanded]);
|
|
611
|
-
const {
|
|
612
|
-
isCollapsed,
|
|
613
|
-
toggleCollapsed,
|
|
614
|
-
displayContent,
|
|
615
|
-
shouldCollapse
|
|
616
|
-
} = useCollapsibleContent(
|
|
617
|
-
trimmedContent,
|
|
618
|
-
collapsible ? collapsibleOptions : {}
|
|
619
|
-
);
|
|
620
|
-
React3__namespace.default.useEffect(() => {
|
|
621
|
-
if (collapsible && shouldCollapse && onCollapseChange) {
|
|
622
|
-
onCollapseChange(isCollapsed);
|
|
623
|
-
}
|
|
624
|
-
}, [isCollapsed, collapsible, shouldCollapse, onCollapseChange]);
|
|
625
|
-
const components = React3__namespace.default.useMemo(() => createMarkdownComponents(isUser, isCompact), [isUser, isCompact]);
|
|
626
|
-
const textSizeClass = isCompact ? "text-xs" : "text-sm";
|
|
627
|
-
const proseClass = isCompact ? "prose-xs" : "prose-sm";
|
|
628
|
-
const isPlainText = !hasMarkdownSyntax(displayContent);
|
|
629
|
-
if (isPlainText) {
|
|
630
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: `${textSizeClass} leading-7 break-words whitespace-pre-line font-light ${className}`, children: [
|
|
631
|
-
displayContent,
|
|
632
|
-
collapsible && shouldCollapse && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
633
|
-
isCollapsed && "... ",
|
|
634
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
635
|
-
CollapseToggle,
|
|
636
|
-
{
|
|
637
|
-
isCollapsed,
|
|
638
|
-
onClick: toggleCollapsed,
|
|
639
|
-
readMoreLabel,
|
|
640
|
-
showLessLabel,
|
|
641
|
-
isUser,
|
|
642
|
-
isCompact
|
|
643
|
-
}
|
|
644
|
-
)
|
|
645
|
-
] })
|
|
646
|
-
] });
|
|
647
|
-
}
|
|
648
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
|
|
649
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
650
|
-
"div",
|
|
651
|
-
{
|
|
652
|
-
className: `
|
|
653
|
-
prose ${proseClass} max-w-none break-words overflow-hidden ${textSizeClass}
|
|
654
|
-
${isUser ? "prose-invert" : "dark:prose-invert"}
|
|
655
|
-
[&>*]:leading-7
|
|
656
|
-
`,
|
|
657
|
-
style: {
|
|
658
|
-
// Inherit colors from parent - fixes issues with external CSS variables
|
|
659
|
-
"--tw-prose-body": "inherit",
|
|
660
|
-
"--tw-prose-headings": "inherit",
|
|
661
|
-
"--tw-prose-bold": "inherit",
|
|
662
|
-
"--tw-prose-links": "inherit",
|
|
663
|
-
color: "inherit"
|
|
664
|
-
},
|
|
665
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
666
|
-
ReactMarkdown__default.default,
|
|
667
|
-
{
|
|
668
|
-
remarkPlugins: [remarkGfm__default.default],
|
|
669
|
-
components,
|
|
670
|
-
children: displayContent
|
|
671
|
-
}
|
|
672
|
-
)
|
|
673
|
-
}
|
|
674
|
-
),
|
|
675
|
-
collapsible && shouldCollapse && /* @__PURE__ */ jsxRuntime.jsx(
|
|
676
|
-
CollapseToggle,
|
|
677
|
-
{
|
|
678
|
-
isCollapsed,
|
|
679
|
-
onClick: toggleCollapsed,
|
|
680
|
-
readMoreLabel,
|
|
681
|
-
showLessLabel,
|
|
682
|
-
isUser,
|
|
683
|
-
isCompact
|
|
684
|
-
}
|
|
685
|
-
)
|
|
686
|
-
] });
|
|
687
|
-
}, "MarkdownMessage");
|
|
688
215
|
var LazyMapContainer = createLazyComponent(
|
|
689
216
|
() => import('./MapContainer-RYG4HPH4.cjs').then((mod) => ({ default: mod.MapContainer })),
|
|
690
217
|
{
|
|
@@ -721,7 +248,7 @@ function CodeLoadingFallback() {
|
|
|
721
248
|
}
|
|
722
249
|
chunkWGEGR3DF_cjs.__name(CodeLoadingFallback, "CodeLoadingFallback");
|
|
723
250
|
var LazyPrettyCode = createLazyComponent(
|
|
724
|
-
() => import('./PrettyCode.client-
|
|
251
|
+
() => import('./PrettyCode.client-5GABIN2I.cjs'),
|
|
725
252
|
{
|
|
726
253
|
displayName: "LazyPrettyCode",
|
|
727
254
|
fallback: /* @__PURE__ */ jsxRuntime.jsx(CodeLoadingFallback, {})
|
|
@@ -734,15 +261,15 @@ function OpenapiLoadingFallback() {
|
|
|
734
261
|
] }) });
|
|
735
262
|
}
|
|
736
263
|
chunkWGEGR3DF_cjs.__name(OpenapiLoadingFallback, "OpenapiLoadingFallback");
|
|
737
|
-
var
|
|
738
|
-
() => import('./
|
|
264
|
+
var LazyDocsLayout = createLazyComponent(
|
|
265
|
+
() => import('./DocsLayout-BCVU6TTX.cjs').then((mod) => ({ default: mod.DocsLayout })),
|
|
739
266
|
{
|
|
740
|
-
displayName: "
|
|
267
|
+
displayName: "LazyDocsLayout",
|
|
741
268
|
fallback: /* @__PURE__ */ jsxRuntime.jsx(OpenapiLoadingFallback, {})
|
|
742
269
|
}
|
|
743
270
|
);
|
|
744
271
|
var LazyOpenapiViewer = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ config }) => {
|
|
745
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
272
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkIULI4XII_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(LazyDocsLayout, {}) });
|
|
746
273
|
}, "LazyOpenapiViewer");
|
|
747
274
|
LazyOpenapiViewer.displayName = "LazyOpenapiViewer";
|
|
748
275
|
var LazyJsonSchemaForm = createLazyComponent(
|
|
@@ -878,28 +405,28 @@ var LazyCronScheduler = createLazyComponent(
|
|
|
878
405
|
)
|
|
879
406
|
}
|
|
880
407
|
);
|
|
881
|
-
var LottiePlayerClient =
|
|
408
|
+
var LottiePlayerClient = React.lazy(
|
|
882
409
|
() => import('./LottiePlayer.client-6WVWDO75.cjs').then((mod) => ({ default: mod.LottiePlayer }))
|
|
883
410
|
);
|
|
884
|
-
var
|
|
411
|
+
var LoadingFallback6 = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
885
412
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-gray-300 border-t-gray-900" }),
|
|
886
413
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500", children: "Loading player..." })
|
|
887
414
|
] }) }), "LoadingFallback");
|
|
888
415
|
function LottiePlayer(props) {
|
|
889
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
416
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback6, {}), children: /* @__PURE__ */ jsxRuntime.jsx(LottiePlayerClient, { ...props }) });
|
|
890
417
|
}
|
|
891
418
|
chunkWGEGR3DF_cjs.__name(LottiePlayer, "LottiePlayer");
|
|
892
|
-
var
|
|
893
|
-
() => import('./
|
|
419
|
+
var DocsLayout = React.lazy(
|
|
420
|
+
() => import('./DocsLayout-BCVU6TTX.cjs').then((mod) => ({ default: mod.DocsLayout }))
|
|
894
421
|
);
|
|
895
|
-
var
|
|
422
|
+
var LoadingFallback7 = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground", children: "Loading API Playground..." }) }), "LoadingFallback");
|
|
896
423
|
var Playground = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(({ config }) => {
|
|
897
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
424
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkIULI4XII_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback7, {}), children: /* @__PURE__ */ jsxRuntime.jsx(DocsLayout, {}) }) });
|
|
898
425
|
}, "Playground");
|
|
899
426
|
var OpenapiViewer_default = Playground;
|
|
900
|
-
var CronSchedulerClient =
|
|
427
|
+
var CronSchedulerClient = React.lazy(() => import('./CronScheduler.client-A4GO6YBY.cjs'));
|
|
901
428
|
function CronScheduler(props) {
|
|
902
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
429
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerFallback, {}), children: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerClient, { ...props }) });
|
|
903
430
|
}
|
|
904
431
|
chunkWGEGR3DF_cjs.__name(CronScheduler, "CronScheduler");
|
|
905
432
|
function CronSchedulerFallback() {
|
|
@@ -929,10 +456,10 @@ chunkWGEGR3DF_cjs.__name(setupMonacoWorkers, "setupMonacoWorkers");
|
|
|
929
456
|
|
|
930
457
|
// src/tools/CodeEditor/hooks/useMonaco.ts
|
|
931
458
|
function useMonaco() {
|
|
932
|
-
const [monaco, setMonaco] =
|
|
933
|
-
const [isLoading, setIsLoading] =
|
|
934
|
-
const [error, setError] =
|
|
935
|
-
|
|
459
|
+
const [monaco, setMonaco] = React.useState(null);
|
|
460
|
+
const [isLoading, setIsLoading] = React.useState(true);
|
|
461
|
+
const [error, setError] = React.useState(null);
|
|
462
|
+
React.useEffect(() => {
|
|
936
463
|
let mounted = true;
|
|
937
464
|
async function loadMonaco() {
|
|
938
465
|
try {
|
|
@@ -960,8 +487,8 @@ function useMonaco() {
|
|
|
960
487
|
chunkWGEGR3DF_cjs.__name(useMonaco, "useMonaco");
|
|
961
488
|
function useEditorTheme(monaco, themeOverride) {
|
|
962
489
|
const appTheme = hooks.useResolvedTheme();
|
|
963
|
-
const registered =
|
|
964
|
-
|
|
490
|
+
const registered = React.useRef(false);
|
|
491
|
+
React.useEffect(() => {
|
|
965
492
|
if (!monaco || registered.current) return;
|
|
966
493
|
try {
|
|
967
494
|
const colors = _readCSSColors();
|
|
@@ -1028,7 +555,7 @@ function _readCSSColors() {
|
|
|
1028
555
|
if (typeof document === "undefined") return "";
|
|
1029
556
|
return getComputedStyle(document.documentElement).getPropertyValue(varName).trim();
|
|
1030
557
|
}, "get");
|
|
1031
|
-
const
|
|
558
|
+
const hslToHex = /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((hsl) => {
|
|
1032
559
|
if (!hsl) return "";
|
|
1033
560
|
const parts = hsl.split(/\s+/).map((s2) => parseFloat(s2.replace("%", "")));
|
|
1034
561
|
if (parts.length < 3 || parts.some(isNaN)) return "";
|
|
@@ -1041,13 +568,13 @@ function _readCSSColors() {
|
|
|
1041
568
|
}, "f");
|
|
1042
569
|
return `#${f(0)}${f(8)}${f(4)}`;
|
|
1043
570
|
}, "hslToHex");
|
|
1044
|
-
const background =
|
|
1045
|
-
const foreground =
|
|
1046
|
-
const card =
|
|
1047
|
-
const border =
|
|
1048
|
-
const mutedForeground =
|
|
571
|
+
const background = hslToHex(get("--background")) || "#0a0a0a";
|
|
572
|
+
const foreground = hslToHex(get("--foreground")) || "#f5f5f5";
|
|
573
|
+
const card = hslToHex(get("--card")) || "#141414";
|
|
574
|
+
const border = hslToHex(get("--border")) || "#262626";
|
|
575
|
+
const mutedForeground = hslToHex(get("--muted-foreground")) || "#858585";
|
|
1049
576
|
const lineHighlight = _adjustBrightness(background, 10);
|
|
1050
|
-
const primary =
|
|
577
|
+
const primary = hslToHex(get("--primary"));
|
|
1051
578
|
const selection = primary ? _adjustBrightness(primary, -40) : "#264F78";
|
|
1052
579
|
return {
|
|
1053
580
|
background,
|
|
@@ -1076,7 +603,7 @@ function _adjustBrightness(hex, amount) {
|
|
|
1076
603
|
return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, "0")}`;
|
|
1077
604
|
}
|
|
1078
605
|
chunkWGEGR3DF_cjs.__name(_adjustBrightness, "_adjustBrightness");
|
|
1079
|
-
var Editor =
|
|
606
|
+
var Editor = React.forwardRef(/* @__PURE__ */ chunkWGEGR3DF_cjs.__name(function Editor2({
|
|
1080
607
|
value = "",
|
|
1081
608
|
language = "plaintext",
|
|
1082
609
|
onChange,
|
|
@@ -1089,24 +616,24 @@ var Editor = React3.forwardRef(/* @__PURE__ */ chunkWGEGR3DF_cjs.__name(function
|
|
|
1089
616
|
minHeight = 100,
|
|
1090
617
|
maxHeight = 600
|
|
1091
618
|
}, ref) {
|
|
1092
|
-
const containerRef =
|
|
1093
|
-
const editorRef =
|
|
619
|
+
const containerRef = React.useRef(null);
|
|
620
|
+
const editorRef = React.useRef(null);
|
|
1094
621
|
const { monaco, isLoading } = useMonaco();
|
|
1095
622
|
const resolvedTheme = useEditorTheme(monaco, options.theme);
|
|
1096
|
-
const [contentHeight, setContentHeight] =
|
|
1097
|
-
const updateContentHeight =
|
|
623
|
+
const [contentHeight, setContentHeight] = React.useState(null);
|
|
624
|
+
const updateContentHeight = React.useCallback((editor) => {
|
|
1098
625
|
if (!autoHeight) return;
|
|
1099
626
|
const h = editor.getContentHeight();
|
|
1100
627
|
setContentHeight(Math.min(Math.max(h, minHeight), maxHeight));
|
|
1101
628
|
}, [autoHeight, minHeight, maxHeight]);
|
|
1102
|
-
const isInternalChangeRef =
|
|
1103
|
-
|
|
629
|
+
const isInternalChangeRef = React.useRef(false);
|
|
630
|
+
React.useImperativeHandle(ref, () => ({
|
|
1104
631
|
getEditor: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => editorRef.current, "getEditor"),
|
|
1105
632
|
getValue: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => editorRef.current?.getValue() || "", "getValue"),
|
|
1106
633
|
setValue: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((val) => editorRef.current?.setValue(val), "setValue"),
|
|
1107
634
|
focus: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => editorRef.current?.focus(), "focus")
|
|
1108
635
|
}));
|
|
1109
|
-
|
|
636
|
+
React.useEffect(() => {
|
|
1110
637
|
if (!monaco || !containerRef.current || editorRef.current) return;
|
|
1111
638
|
const editor = monaco.editor.create(containerRef.current, {
|
|
1112
639
|
value,
|
|
@@ -1152,7 +679,7 @@ var Editor = React3.forwardRef(/* @__PURE__ */ chunkWGEGR3DF_cjs.__name(function
|
|
|
1152
679
|
editorRef.current = null;
|
|
1153
680
|
};
|
|
1154
681
|
}, [monaco]);
|
|
1155
|
-
|
|
682
|
+
React.useEffect(() => {
|
|
1156
683
|
const editor = editorRef.current;
|
|
1157
684
|
if (!editor) return;
|
|
1158
685
|
if (isInternalChangeRef.current) {
|
|
@@ -1172,7 +699,7 @@ var Editor = React3.forwardRef(/* @__PURE__ */ chunkWGEGR3DF_cjs.__name(function
|
|
|
1172
699
|
}
|
|
1173
700
|
}
|
|
1174
701
|
}, [value]);
|
|
1175
|
-
|
|
702
|
+
React.useEffect(() => {
|
|
1176
703
|
const editor = editorRef.current;
|
|
1177
704
|
if (!editor || !monaco) return;
|
|
1178
705
|
const model = editor.getModel();
|
|
@@ -1180,7 +707,7 @@ var Editor = React3.forwardRef(/* @__PURE__ */ chunkWGEGR3DF_cjs.__name(function
|
|
|
1180
707
|
monaco.editor.setModelLanguage(model, language);
|
|
1181
708
|
}
|
|
1182
709
|
}, [language, monaco]);
|
|
1183
|
-
|
|
710
|
+
React.useEffect(() => {
|
|
1184
711
|
const editor = editorRef.current;
|
|
1185
712
|
if (!editor) return;
|
|
1186
713
|
editor.updateOptions({
|
|
@@ -1232,11 +759,11 @@ function DiffEditor({
|
|
|
1232
759
|
className = "",
|
|
1233
760
|
height = "100%"
|
|
1234
761
|
}) {
|
|
1235
|
-
const containerRef =
|
|
1236
|
-
const editorRef =
|
|
762
|
+
const containerRef = React.useRef(null);
|
|
763
|
+
const editorRef = React.useRef(null);
|
|
1237
764
|
const { monaco, isLoading } = useMonaco();
|
|
1238
765
|
const resolvedTheme = useEditorTheme(monaco, options.theme);
|
|
1239
|
-
|
|
766
|
+
React.useEffect(() => {
|
|
1240
767
|
if (!monaco || !containerRef.current || editorRef.current) return;
|
|
1241
768
|
const editor = monaco.editor.createDiffEditor(containerRef.current, {
|
|
1242
769
|
theme: resolvedTheme,
|
|
@@ -1262,7 +789,7 @@ function DiffEditor({
|
|
|
1262
789
|
editorRef.current = null;
|
|
1263
790
|
};
|
|
1264
791
|
}, [monaco]);
|
|
1265
|
-
|
|
792
|
+
React.useEffect(() => {
|
|
1266
793
|
const editor = editorRef.current;
|
|
1267
794
|
if (!editor || !monaco) return;
|
|
1268
795
|
const model = editor.getModel();
|
|
@@ -1271,7 +798,7 @@ function DiffEditor({
|
|
|
1271
798
|
model.modified.setValue(modified);
|
|
1272
799
|
}
|
|
1273
800
|
}, [original, modified, monaco]);
|
|
1274
|
-
|
|
801
|
+
React.useEffect(() => {
|
|
1275
802
|
const editor = editorRef.current;
|
|
1276
803
|
if (!editor || !monaco) return;
|
|
1277
804
|
const model = editor.getModel();
|
|
@@ -1498,9 +1025,9 @@ function getLanguageByFilename(filename) {
|
|
|
1498
1025
|
return LANGUAGE_MAP[extension] || "plaintext";
|
|
1499
1026
|
}
|
|
1500
1027
|
chunkWGEGR3DF_cjs.__name(getLanguageByFilename, "getLanguageByFilename");
|
|
1501
|
-
var EditorContext =
|
|
1028
|
+
var EditorContext = React.createContext(null);
|
|
1502
1029
|
function useEditorContext() {
|
|
1503
|
-
const context =
|
|
1030
|
+
const context = React.useContext(EditorContext);
|
|
1504
1031
|
if (!context) {
|
|
1505
1032
|
throw new Error("useEditorContext must be used within EditorProvider");
|
|
1506
1033
|
}
|
|
@@ -1509,14 +1036,14 @@ function useEditorContext() {
|
|
|
1509
1036
|
chunkWGEGR3DF_cjs.__name(useEditorContext, "useEditorContext");
|
|
1510
1037
|
function EditorProvider({ children, onSave }) {
|
|
1511
1038
|
const { monaco } = useMonaco();
|
|
1512
|
-
const [editor, setEditor] =
|
|
1513
|
-
const [openFiles, setOpenFiles] =
|
|
1514
|
-
const [activeFilePath, setActiveFilePath] =
|
|
1515
|
-
const activeFile =
|
|
1039
|
+
const [editor, setEditor] = React.useState(null);
|
|
1040
|
+
const [openFiles, setOpenFiles] = React.useState([]);
|
|
1041
|
+
const [activeFilePath, setActiveFilePath] = React.useState(null);
|
|
1042
|
+
const activeFile = React.useMemo(
|
|
1516
1043
|
() => openFiles.find((f) => f.path === activeFilePath) || null,
|
|
1517
1044
|
[openFiles, activeFilePath]
|
|
1518
1045
|
);
|
|
1519
|
-
const openFile =
|
|
1046
|
+
const openFile = React.useCallback(
|
|
1520
1047
|
(path, content, language) => {
|
|
1521
1048
|
setOpenFiles((files) => {
|
|
1522
1049
|
const existing = files.find((f) => f.path === path);
|
|
@@ -1537,7 +1064,7 @@ function EditorProvider({ children, onSave }) {
|
|
|
1537
1064
|
},
|
|
1538
1065
|
[]
|
|
1539
1066
|
);
|
|
1540
|
-
const closeFile =
|
|
1067
|
+
const closeFile = React.useCallback(
|
|
1541
1068
|
(path) => {
|
|
1542
1069
|
setOpenFiles((files) => {
|
|
1543
1070
|
const index = files.findIndex((f) => f.path === path);
|
|
@@ -1554,17 +1081,17 @@ function EditorProvider({ children, onSave }) {
|
|
|
1554
1081
|
},
|
|
1555
1082
|
[activeFilePath]
|
|
1556
1083
|
);
|
|
1557
|
-
const setActiveFile =
|
|
1084
|
+
const setActiveFile = React.useCallback((path) => {
|
|
1558
1085
|
setActiveFilePath(path);
|
|
1559
1086
|
}, []);
|
|
1560
|
-
const updateContent =
|
|
1087
|
+
const updateContent = React.useCallback((path, content) => {
|
|
1561
1088
|
setOpenFiles(
|
|
1562
1089
|
(files) => files.map(
|
|
1563
1090
|
(f) => f.path === path ? { ...f, content, isDirty: true } : f
|
|
1564
1091
|
)
|
|
1565
1092
|
);
|
|
1566
1093
|
}, []);
|
|
1567
|
-
const saveFile =
|
|
1094
|
+
const saveFile = React.useCallback(
|
|
1568
1095
|
async (path) => {
|
|
1569
1096
|
const file = openFiles.find((f) => f.path === path);
|
|
1570
1097
|
if (!file) return;
|
|
@@ -1579,21 +1106,21 @@ function EditorProvider({ children, onSave }) {
|
|
|
1579
1106
|
},
|
|
1580
1107
|
[openFiles, onSave]
|
|
1581
1108
|
);
|
|
1582
|
-
const isDirty =
|
|
1109
|
+
const isDirty = React.useCallback(
|
|
1583
1110
|
(path) => {
|
|
1584
1111
|
const file = openFiles.find((f) => f.path === path);
|
|
1585
1112
|
return file?.isDirty || false;
|
|
1586
1113
|
},
|
|
1587
1114
|
[openFiles]
|
|
1588
1115
|
);
|
|
1589
|
-
const getContent =
|
|
1116
|
+
const getContent = React.useCallback(
|
|
1590
1117
|
(path) => {
|
|
1591
1118
|
const file = openFiles.find((f) => f.path === path);
|
|
1592
1119
|
return file?.content || null;
|
|
1593
1120
|
},
|
|
1594
1121
|
[openFiles]
|
|
1595
1122
|
);
|
|
1596
|
-
const getFile =
|
|
1123
|
+
const getFile = React.useCallback(
|
|
1597
1124
|
(path) => {
|
|
1598
1125
|
return openFiles.find((f) => f.path === path) || null;
|
|
1599
1126
|
},
|
|
@@ -1618,8 +1145,8 @@ function EditorProvider({ children, onSave }) {
|
|
|
1618
1145
|
}
|
|
1619
1146
|
chunkWGEGR3DF_cjs.__name(EditorProvider, "EditorProvider");
|
|
1620
1147
|
function useEditor() {
|
|
1621
|
-
const [editor, setEditorState] =
|
|
1622
|
-
const setEditor =
|
|
1148
|
+
const [editor, setEditorState] = React.useState(null);
|
|
1149
|
+
const setEditor = React.useCallback((editorInstance) => {
|
|
1623
1150
|
setEditorState(editorInstance);
|
|
1624
1151
|
}, []);
|
|
1625
1152
|
return {
|
|
@@ -1630,25 +1157,25 @@ function useEditor() {
|
|
|
1630
1157
|
}
|
|
1631
1158
|
chunkWGEGR3DF_cjs.__name(useEditor, "useEditor");
|
|
1632
1159
|
function useLanguage(filename) {
|
|
1633
|
-
return
|
|
1160
|
+
return React.useMemo(() => {
|
|
1634
1161
|
if (!filename) return "plaintext";
|
|
1635
1162
|
const basename = filename.split("/").pop() || filename;
|
|
1636
1163
|
return getLanguageByFilename(basename);
|
|
1637
1164
|
}, [filename]);
|
|
1638
1165
|
}
|
|
1639
1166
|
chunkWGEGR3DF_cjs.__name(useLanguage, "useLanguage");
|
|
1640
|
-
var MentionList =
|
|
1167
|
+
var MentionList = React.forwardRef(
|
|
1641
1168
|
({ items, command }, ref) => {
|
|
1642
|
-
const [selectedIndex, setSelectedIndex] =
|
|
1643
|
-
|
|
1644
|
-
const select =
|
|
1169
|
+
const [selectedIndex, setSelectedIndex] = React.useState(0);
|
|
1170
|
+
React.useEffect(() => setSelectedIndex(0), [items]);
|
|
1171
|
+
const select = React.useCallback(
|
|
1645
1172
|
(index) => {
|
|
1646
1173
|
const item = items[index];
|
|
1647
1174
|
if (item) command(item);
|
|
1648
1175
|
},
|
|
1649
1176
|
[items, command]
|
|
1650
1177
|
);
|
|
1651
|
-
|
|
1178
|
+
React.useImperativeHandle(ref, () => ({
|
|
1652
1179
|
onKeyDown: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name((event) => {
|
|
1653
1180
|
if (event.key === "ArrowUp") {
|
|
1654
1181
|
setSelectedIndex((i) => (i + items.length - 1) % items.length);
|
|
@@ -1771,8 +1298,8 @@ function MarkdownEditor({
|
|
|
1771
1298
|
mentions,
|
|
1772
1299
|
onMentionIdsChange
|
|
1773
1300
|
}) {
|
|
1774
|
-
const isExternalUpdate =
|
|
1775
|
-
const extensions =
|
|
1301
|
+
const isExternalUpdate = React.useRef(false);
|
|
1302
|
+
const extensions = React.useMemo(() => {
|
|
1776
1303
|
const exts = [
|
|
1777
1304
|
StarterKit__default.default.configure({ heading: { levels: [1, 2, 3] } }),
|
|
1778
1305
|
Placeholder__default.default.configure({ placeholder }),
|
|
@@ -1808,7 +1335,7 @@ function MarkdownEditor({
|
|
|
1808
1335
|
}
|
|
1809
1336
|
}
|
|
1810
1337
|
});
|
|
1811
|
-
|
|
1338
|
+
React.useEffect(() => {
|
|
1812
1339
|
if (!editor) return;
|
|
1813
1340
|
const current = getMarkdown(editor);
|
|
1814
1341
|
if (current !== value) {
|
|
@@ -1825,7 +1352,7 @@ function MarkdownEditor({
|
|
|
1825
1352
|
}
|
|
1826
1353
|
chunkWGEGR3DF_cjs.__name(MarkdownEditor, "MarkdownEditor");
|
|
1827
1354
|
function MarkdownToolbar({ editor }) {
|
|
1828
|
-
const items =
|
|
1355
|
+
const items = React.useMemo(() => [
|
|
1829
1356
|
{ icon: lucideReact.Bold, title: "Bold", action: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => editor.chain().focus().toggleBold().run(), "action"), active: editor.isActive("bold") },
|
|
1830
1357
|
{ icon: lucideReact.Italic, title: "Italic", action: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => editor.chain().focus().toggleItalic().run(), "action"), active: editor.isActive("italic") },
|
|
1831
1358
|
{ icon: lucideReact.Strikethrough, title: "Strike", action: /* @__PURE__ */ chunkWGEGR3DF_cjs.__name(() => editor.chain().focus().toggleStrike().run(), "action"), active: editor.isActive("strike") },
|
|
@@ -2149,9 +1676,21 @@ Object.defineProperty(exports, "useCronWeekDays", {
|
|
|
2149
1676
|
enumerable: true,
|
|
2150
1677
|
get: function () { return chunkF2CMIIOH_cjs.useCronWeekDays; }
|
|
2151
1678
|
});
|
|
1679
|
+
Object.defineProperty(exports, "MarkdownMessage", {
|
|
1680
|
+
enumerable: true,
|
|
1681
|
+
get: function () { return chunkIULI4XII_cjs.MarkdownMessage; }
|
|
1682
|
+
});
|
|
1683
|
+
Object.defineProperty(exports, "Mermaid", {
|
|
1684
|
+
enumerable: true,
|
|
1685
|
+
get: function () { return chunkIULI4XII_cjs.Mermaid_default; }
|
|
1686
|
+
});
|
|
2152
1687
|
Object.defineProperty(exports, "PrettyCode", {
|
|
2153
1688
|
enumerable: true,
|
|
2154
|
-
get: function () { return
|
|
1689
|
+
get: function () { return chunkIULI4XII_cjs.PrettyCode_default; }
|
|
1690
|
+
});
|
|
1691
|
+
Object.defineProperty(exports, "useCollapsibleContent", {
|
|
1692
|
+
enumerable: true,
|
|
1693
|
+
get: function () { return chunkIULI4XII_cjs.useCollapsibleContent; }
|
|
2155
1694
|
});
|
|
2156
1695
|
Object.defineProperty(exports, "JsonTree", {
|
|
2157
1696
|
enumerable: true,
|
|
@@ -2273,12 +1812,9 @@ exports.LoadingFallback = LoadingFallback;
|
|
|
2273
1812
|
exports.LottiePlayer = LottiePlayer;
|
|
2274
1813
|
exports.MapLoadingFallback = MapLoadingFallback;
|
|
2275
1814
|
exports.MarkdownEditor = MarkdownEditor;
|
|
2276
|
-
exports.MarkdownMessage = MarkdownMessage;
|
|
2277
|
-
exports.Mermaid = Mermaid_default;
|
|
2278
1815
|
exports.OpenapiViewer = OpenapiViewer_default;
|
|
2279
1816
|
exports.Spinner = Spinner;
|
|
2280
1817
|
exports.createLazyComponent = createLazyComponent;
|
|
2281
|
-
exports.useCollapsibleContent = useCollapsibleContent;
|
|
2282
1818
|
exports.useEditor = useEditor;
|
|
2283
1819
|
exports.useEditorContext = useEditorContext;
|
|
2284
1820
|
exports.useLanguage = useLanguage;
|