@djangocfg/ui-tools 2.1.287 → 2.1.290
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/README.md +14 -3
- package/dist/DocsLayout-IKH7BLSU.cjs +3464 -0
- package/dist/DocsLayout-IKH7BLSU.cjs.map +1 -0
- package/dist/DocsLayout-JPXFUKAR.mjs +3457 -0
- package/dist/DocsLayout-JPXFUKAR.mjs.map +1 -0
- package/dist/{PrettyCode.client-5GABIN2I.cjs → PrettyCode.client-RPDIE5CH.cjs} +104 -3
- package/dist/PrettyCode.client-RPDIE5CH.cjs.map +1 -0
- package/dist/{PrettyCode.client-IZTXXYHG.mjs → PrettyCode.client-SPMTQEG4.mjs} +106 -5
- package/dist/PrettyCode.client-SPMTQEG4.mjs.map +1 -0
- package/dist/{chunk-IULI4XII.cjs → chunk-5Q4UMSWB.cjs} +355 -9
- package/dist/chunk-5Q4UMSWB.cjs.map +1 -0
- package/dist/{chunk-VZGQC3NG.mjs → chunk-EFWOJPA6.mjs} +349 -9
- package/dist/chunk-EFWOJPA6.mjs.map +1 -0
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -14
- package/src/components/markdown/MarkdownMessage.tsx +46 -0
- package/src/tools/OpenapiViewer/OpenapiViewer.story.tsx +93 -157
- package/src/tools/OpenapiViewer/README.md +114 -6
- package/src/tools/OpenapiViewer/components/DocsLayout/ApiIntroSection.tsx +20 -6
- package/src/tools/OpenapiViewer/components/DocsLayout/DocsView.tsx +331 -53
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/CodeSamples/LanguageTabs.tsx +36 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/CodeSamples/index.tsx +56 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/CodeSamples/useCodeSnippet.ts +77 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/MetaActions.tsx +146 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/MethodBadge.tsx +6 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/PathDisplay.tsx +26 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/index.tsx +87 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Parameters/ParamGroup.tsx +30 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Parameters/ParamRow.tsx +36 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Parameters/index.tsx +22 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/RequestBody/index.tsx +33 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/ResponseBody.tsx +76 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/ResponseRow.tsx +80 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/StatusTag.tsx +32 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Responses/index.tsx +21 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/FieldRow.tsx +106 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/buildTree.ts +127 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/index.tsx +31 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/SchemaFields/types.ts +28 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Section/SectionHeader.tsx +87 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Section/defaults.ts +27 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/Section/index.tsx +45 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/context.tsx +56 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/hooks/useSectionHash.ts +63 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/index.tsx +96 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/store/index.ts +133 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/store/selectors.ts +40 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc/types.ts +17 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/SchemaCopyMenu.tsx +40 -11
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/BrandHeader.tsx +48 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/CategoryBlock.tsx +33 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/EndpointRow.tsx +73 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/MethodChips.tsx +43 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SchemaSection.tsx +27 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SearchInput.tsx +45 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SidebarBody.tsx +50 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/Toolbar.tsx +64 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/buildVM.ts +126 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/index.tsx +112 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/types.ts +42 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/useDebouncedValue.ts +14 -0
- package/src/tools/OpenapiViewer/components/DocsLayout/SlideInPlayground.tsx +10 -7
- package/src/tools/OpenapiViewer/components/DocsLayout/TryItSheet.tsx +9 -6
- package/src/tools/OpenapiViewer/components/DocsLayout/anchor.ts +19 -2
- package/src/tools/OpenapiViewer/components/DocsLayout/grouping.ts +38 -21
- package/src/tools/OpenapiViewer/components/DocsLayout/index.tsx +168 -50
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel/PrettyView.tsx +55 -0
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel/PreviewView.tsx +115 -0
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel/RawView.tsx +24 -0
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel/StatusBar.tsx +63 -0
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel/ViewTabs.tsx +45 -0
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel/detectContent.ts +97 -0
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel/index.tsx +93 -0
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel/types.ts +26 -0
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel/useResponseView.ts +62 -0
- package/src/tools/OpenapiViewer/hooks/index.ts +3 -1
- package/src/tools/OpenapiViewer/hooks/useDocsUrlSync.ts +119 -0
- package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +164 -74
- package/src/tools/OpenapiViewer/types.ts +46 -1
- package/src/tools/OpenapiViewer/utils/codeSamples.ts +287 -0
- package/src/tools/OpenapiViewer/utils/index.ts +3 -0
- package/src/tools/OpenapiViewer/utils/operationToHar.ts +119 -0
- package/src/tools/OpenapiViewer/utils/sampler.ts +72 -0
- package/src/tools/OpenapiViewer/utils/scrollParent.ts +68 -0
- package/src/tools/PrettyCode/PrettyCode.client.tsx +88 -1
- package/src/tools/PrettyCode/PrettyCode.story.tsx +114 -361
- package/src/tools/PrettyCode/index.tsx +13 -0
- package/src/tools/PrettyCode/lazy.tsx +5 -0
- package/src/tools/PrettyCode/registerPrismLanguages.ts +111 -0
- package/dist/DocsLayout-BCVU6TTX.cjs +0 -2027
- package/dist/DocsLayout-BCVU6TTX.cjs.map +0 -1
- package/dist/DocsLayout-ERETJLLV.mjs +0 -2020
- package/dist/DocsLayout-ERETJLLV.mjs.map +0 -1
- package/dist/PrettyCode.client-5GABIN2I.cjs.map +0 -1
- package/dist/PrettyCode.client-IZTXXYHG.mjs.map +0 -1
- package/dist/chunk-IULI4XII.cjs.map +0 -1
- package/dist/chunk-VZGQC3NG.mjs.map +0 -1
- package/src/tools/OpenapiViewer/components/DocsLayout/EndpointDoc.tsx +0 -268
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar.tsx +0 -211
- package/src/tools/OpenapiViewer/components/shared/ResponsePanel.tsx +0 -127
package/dist/index.d.cts
CHANGED
|
@@ -318,6 +318,11 @@ interface PrettyCodeProps$1 {
|
|
|
318
318
|
inline?: boolean;
|
|
319
319
|
customBg?: string;
|
|
320
320
|
isCompact?: boolean;
|
|
321
|
+
scrollIsolation?: boolean;
|
|
322
|
+
maxLines?: number;
|
|
323
|
+
/** ``'card'`` (default) ships the full chrome. ``'plain'`` is
|
|
324
|
+
* chrome-less — for embedding inside another scroll container. */
|
|
325
|
+
variant?: 'card' | 'plain';
|
|
321
326
|
}
|
|
322
327
|
|
|
323
328
|
/**
|
|
@@ -361,6 +366,22 @@ interface PlaygroundConfig {
|
|
|
361
366
|
* a spinner instead of "no keys yet". */
|
|
362
367
|
apiKeys?: ApiKey[];
|
|
363
368
|
apiKeysLoading?: boolean;
|
|
369
|
+
/** How multiple schemas are presented in the sidebar.
|
|
370
|
+
* - ``'selector'`` (default): a Combobox switches between schemas, the
|
|
371
|
+
* docs column shows endpoints of the active schema only.
|
|
372
|
+
* - ``'sections'``: the Combobox is hidden and every schema becomes a
|
|
373
|
+
* top-level heading in the sidebar, with endpoints of all schemas
|
|
374
|
+
* rendered back-to-back in the docs column. Scrollspy picks the
|
|
375
|
+
* active schema based on what's visible. */
|
|
376
|
+
schemaGrouping?: 'selector' | 'sections';
|
|
377
|
+
/** Optional URL-hash sync. When enabled, the viewer reads/writes
|
|
378
|
+
* ``#<schemaId>/<anchor>`` on the browser location. Falsy value (the
|
|
379
|
+
* default) keeps the viewer hash-free. Set to an object with
|
|
380
|
+
* ``{ enabled: true }`` to opt in; future fields (e.g. a custom
|
|
381
|
+
* adapter) stay backwards compatible. */
|
|
382
|
+
urlSync?: boolean | {
|
|
383
|
+
enabled: boolean;
|
|
384
|
+
};
|
|
364
385
|
}
|
|
365
386
|
|
|
366
387
|
/**
|
|
@@ -1470,6 +1491,19 @@ interface PrettyCodeProps {
|
|
|
1470
1491
|
* to inline short snippets and cap long ones.
|
|
1471
1492
|
*/
|
|
1472
1493
|
maxLines?: number;
|
|
1494
|
+
/**
|
|
1495
|
+
* Visual variant:
|
|
1496
|
+
* - ``"card"`` (default) — full chrome: border, background, hover
|
|
1497
|
+
* toolbar (Copy + language tag), optional internal scroll. Suits
|
|
1498
|
+
* a standalone code block in documentation prose where the block
|
|
1499
|
+
* is its own surface.
|
|
1500
|
+
* - ``"plain"`` — chrome-less: no border, no background, no toolbar,
|
|
1501
|
+
* no internal scroll. Grows to fit its content. Use when
|
|
1502
|
+
* embedding inside another scroll container (e.g. the Response
|
|
1503
|
+
* panel) — avoids double-scroll surfaces and lets the parent
|
|
1504
|
+
* manage copy/language affordances.
|
|
1505
|
+
*/
|
|
1506
|
+
variant?: 'card' | 'plain';
|
|
1473
1507
|
}
|
|
1474
1508
|
declare const PrettyCode: React__default.FC<PrettyCodeProps>;
|
|
1475
1509
|
|
package/dist/index.d.ts
CHANGED
|
@@ -318,6 +318,11 @@ interface PrettyCodeProps$1 {
|
|
|
318
318
|
inline?: boolean;
|
|
319
319
|
customBg?: string;
|
|
320
320
|
isCompact?: boolean;
|
|
321
|
+
scrollIsolation?: boolean;
|
|
322
|
+
maxLines?: number;
|
|
323
|
+
/** ``'card'`` (default) ships the full chrome. ``'plain'`` is
|
|
324
|
+
* chrome-less — for embedding inside another scroll container. */
|
|
325
|
+
variant?: 'card' | 'plain';
|
|
321
326
|
}
|
|
322
327
|
|
|
323
328
|
/**
|
|
@@ -361,6 +366,22 @@ interface PlaygroundConfig {
|
|
|
361
366
|
* a spinner instead of "no keys yet". */
|
|
362
367
|
apiKeys?: ApiKey[];
|
|
363
368
|
apiKeysLoading?: boolean;
|
|
369
|
+
/** How multiple schemas are presented in the sidebar.
|
|
370
|
+
* - ``'selector'`` (default): a Combobox switches between schemas, the
|
|
371
|
+
* docs column shows endpoints of the active schema only.
|
|
372
|
+
* - ``'sections'``: the Combobox is hidden and every schema becomes a
|
|
373
|
+
* top-level heading in the sidebar, with endpoints of all schemas
|
|
374
|
+
* rendered back-to-back in the docs column. Scrollspy picks the
|
|
375
|
+
* active schema based on what's visible. */
|
|
376
|
+
schemaGrouping?: 'selector' | 'sections';
|
|
377
|
+
/** Optional URL-hash sync. When enabled, the viewer reads/writes
|
|
378
|
+
* ``#<schemaId>/<anchor>`` on the browser location. Falsy value (the
|
|
379
|
+
* default) keeps the viewer hash-free. Set to an object with
|
|
380
|
+
* ``{ enabled: true }`` to opt in; future fields (e.g. a custom
|
|
381
|
+
* adapter) stay backwards compatible. */
|
|
382
|
+
urlSync?: boolean | {
|
|
383
|
+
enabled: boolean;
|
|
384
|
+
};
|
|
364
385
|
}
|
|
365
386
|
|
|
366
387
|
/**
|
|
@@ -1470,6 +1491,19 @@ interface PrettyCodeProps {
|
|
|
1470
1491
|
* to inline short snippets and cap long ones.
|
|
1471
1492
|
*/
|
|
1472
1493
|
maxLines?: number;
|
|
1494
|
+
/**
|
|
1495
|
+
* Visual variant:
|
|
1496
|
+
* - ``"card"`` (default) — full chrome: border, background, hover
|
|
1497
|
+
* toolbar (Copy + language tag), optional internal scroll. Suits
|
|
1498
|
+
* a standalone code block in documentation prose where the block
|
|
1499
|
+
* is its own surface.
|
|
1500
|
+
* - ``"plain"`` — chrome-less: no border, no background, no toolbar,
|
|
1501
|
+
* no internal scroll. Grows to fit its content. Use when
|
|
1502
|
+
* embedding inside another scroll container (e.g. the Response
|
|
1503
|
+
* panel) — avoids double-scroll surfaces and lets the parent
|
|
1504
|
+
* manage copy/language affordances.
|
|
1505
|
+
*/
|
|
1506
|
+
variant?: 'card' | 'plain';
|
|
1473
1507
|
}
|
|
1474
1508
|
declare const PrettyCode: React__default.FC<PrettyCodeProps>;
|
|
1475
1509
|
|
package/dist/index.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import './chunk-JWB2EWQO.mjs';
|
|
|
4
4
|
export { ImageViewer } from './chunk-GGKGH5PM.mjs';
|
|
5
5
|
export { generateContentKey, useAudioCache, useBlobUrlCleanup, useImageCache, useMediaCacheStore, useVideoCache, useVideoPlayerSettings } from './chunk-5LBDYFWH.mjs';
|
|
6
6
|
export { CronSchedulerProvider, CustomInput, DayChips, MonthDayGrid, SchedulePreview, ScheduleTypeSelector, TimeSelector, buildCron, humanizeCron, isValidCron, parseCron, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays } from './chunk-PZKAH7WQ.mjs';
|
|
7
|
-
import { PlaygroundProvider } from './chunk-
|
|
8
|
-
export { MarkdownMessage, Mermaid_default as Mermaid, PrettyCode_default as PrettyCode, useCollapsibleContent } from './chunk-
|
|
7
|
+
import { PlaygroundProvider } from './chunk-EFWOJPA6.mjs';
|
|
8
|
+
export { MarkdownMessage, Mermaid_default as Mermaid, PrettyCode_default as PrettyCode, useCollapsibleContent } from './chunk-EFWOJPA6.mjs';
|
|
9
9
|
export { JsonTree_default as JsonTree } from './chunk-LFWQ36LJ.mjs';
|
|
10
10
|
import './chunk-SSUOENAZ.mjs';
|
|
11
11
|
export { ArrayFieldItemTemplate, ArrayFieldTemplate, BaseInputTemplate, CheckboxWidget, ColorWidget, ErrorListTemplate, FieldTemplate, JsonSchemaForm, NumberWidget, ObjectFieldTemplate, SelectWidget, SliderWidget, SwitchWidget, TextWidget, getRequiredFields, hasRequiredFields, mergeDefaults, normalizeFormData, safeJsonParse, safeJsonStringify, validateRequiredFields, validateSchema } from './chunk-JUGQNNDC.mjs';
|
|
@@ -223,7 +223,7 @@ function CodeLoadingFallback() {
|
|
|
223
223
|
}
|
|
224
224
|
__name(CodeLoadingFallback, "CodeLoadingFallback");
|
|
225
225
|
var LazyPrettyCode = createLazyComponent(
|
|
226
|
-
() => import('./PrettyCode.client-
|
|
226
|
+
() => import('./PrettyCode.client-SPMTQEG4.mjs'),
|
|
227
227
|
{
|
|
228
228
|
displayName: "LazyPrettyCode",
|
|
229
229
|
fallback: /* @__PURE__ */ jsx(CodeLoadingFallback, {})
|
|
@@ -237,7 +237,7 @@ function OpenapiLoadingFallback() {
|
|
|
237
237
|
}
|
|
238
238
|
__name(OpenapiLoadingFallback, "OpenapiLoadingFallback");
|
|
239
239
|
var LazyDocsLayout = createLazyComponent(
|
|
240
|
-
() => import('./DocsLayout-
|
|
240
|
+
() => import('./DocsLayout-JPXFUKAR.mjs').then((mod) => ({ default: mod.DocsLayout })),
|
|
241
241
|
{
|
|
242
242
|
displayName: "LazyDocsLayout",
|
|
243
243
|
fallback: /* @__PURE__ */ jsx(OpenapiLoadingFallback, {})
|
|
@@ -392,7 +392,7 @@ function LottiePlayer(props) {
|
|
|
392
392
|
}
|
|
393
393
|
__name(LottiePlayer, "LottiePlayer");
|
|
394
394
|
var DocsLayout = lazy(
|
|
395
|
-
() => import('./DocsLayout-
|
|
395
|
+
() => import('./DocsLayout-JPXFUKAR.mjs').then((mod) => ({ default: mod.DocsLayout }))
|
|
396
396
|
);
|
|
397
397
|
var LoadingFallback7 = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: "Loading API Playground..." }) }), "LoadingFallback");
|
|
398
398
|
var Playground = /* @__PURE__ */ __name(({ config }) => {
|