@djangocfg/ui-nextjs 2.1.41 → 2.1.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/package.json +4 -4
- package/src/animations/AnimatedBackground.tsx +1 -0
- package/src/blocks/ArticleCard.tsx +6 -7
- package/src/blocks/ArticleList.tsx +14 -13
- package/src/blocks/FeatureSection.tsx +87 -15
- package/src/blocks/SuperHero.tsx +10 -4
- package/src/components/breadcrumb-navigation.tsx +6 -9
- package/src/components/breadcrumb.tsx +6 -5
- package/src/components/button-download.tsx +7 -5
- package/src/components/dropdown-menu.tsx +6 -5
- package/src/components/markdown/MarkdownMessage.tsx +5 -2
- package/src/components/menubar.tsx +6 -5
- package/src/components/multi-select-pro/async.tsx +8 -18
- package/src/components/multi-select-pro/index.tsx +8 -18
- package/src/components/navigation-menu.tsx +7 -6
- package/src/components/otp/index.tsx +7 -9
- package/src/components/otp/use-otp-input.ts +2 -1
- package/src/components/pagination-static.tsx +7 -10
- package/src/components/pagination.tsx +6 -5
- package/src/components/phone-input.tsx +11 -10
- package/src/components/sidebar.tsx +11 -21
- package/src/components/sonner.tsx +2 -2
- package/src/components/ssr-pagination.tsx +6 -9
- package/src/hooks/useDeviceDetect.ts +1 -1
- package/src/hooks/useHotkey.ts +2 -1
- package/src/hooks/useLocalStorage.ts +1 -1
- package/src/hooks/useQueryParams.ts +1 -1
- package/src/theme/ForceTheme.tsx +1 -0
- package/src/theme/ThemeProvider.tsx +1 -0
- package/src/theme/ThemeToggle.tsx +4 -2
- package/src/tools/JsonForm/JsonSchemaForm.tsx +12 -21
- package/src/tools/JsonForm/examples/BotConfigExample.tsx +7 -3
- package/src/tools/JsonForm/examples/RealBotConfigExample.tsx +7 -3
- package/src/tools/JsonForm/templates/ArrayFieldItemTemplate.tsx +2 -1
- package/src/tools/JsonForm/templates/ArrayFieldTemplate.tsx +3 -2
- package/src/tools/JsonForm/templates/BaseInputTemplate.tsx +3 -2
- package/src/tools/JsonForm/templates/ErrorListTemplate.tsx +3 -2
- package/src/tools/JsonForm/templates/FieldTemplate.tsx +2 -1
- package/src/tools/JsonForm/templates/ObjectFieldTemplate.tsx +4 -7
- package/src/tools/JsonForm/utils.ts +2 -1
- package/src/tools/JsonForm/widgets/CheckboxWidget.tsx +2 -1
- package/src/tools/JsonForm/widgets/ColorWidget.tsx +3 -2
- package/src/tools/JsonForm/widgets/NumberWidget.tsx +3 -2
- package/src/tools/JsonForm/widgets/SelectWidget.tsx +4 -7
- package/src/tools/JsonForm/widgets/SliderWidget.tsx +4 -3
- package/src/tools/JsonForm/widgets/SwitchWidget.tsx +2 -1
- package/src/tools/JsonForm/widgets/TextWidget.tsx +3 -2
- package/src/tools/JsonTree/index.tsx +2 -1
- package/src/tools/LottiePlayer/LottiePlayer.client.tsx +1 -0
- package/src/tools/LottiePlayer/index.tsx +1 -0
- package/src/tools/LottiePlayer/useLottie.ts +2 -1
- package/src/tools/Mermaid/Mermaid.client.tsx +3 -2
- package/src/tools/Mermaid/components/MermaidFullscreenModal.tsx +1 -0
- package/src/tools/Mermaid/hooks/useMermaidFullscreen.ts +1 -1
- package/src/tools/Mermaid/hooks/useMermaidRenderer.ts +3 -2
- package/src/tools/OpenapiViewer/components/EndpointInfo.tsx +22 -16
- package/src/tools/OpenapiViewer/components/EndpointsLibrary.tsx +12 -4
- package/src/tools/OpenapiViewer/components/PlaygroundLayout.tsx +4 -2
- package/src/tools/OpenapiViewer/components/PlaygroundStepper.tsx +3 -1
- package/src/tools/OpenapiViewer/components/RequestBuilder.tsx +9 -6
- package/src/tools/OpenapiViewer/components/RequestParametersForm.tsx +7 -7
- package/src/tools/OpenapiViewer/components/ResponseViewer.tsx +8 -4
- package/src/tools/OpenapiViewer/components/VersionSelector.tsx +7 -3
- package/src/tools/OpenapiViewer/context/PlaygroundContext.tsx +9 -3
- package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +3 -7
- package/src/tools/OpenapiViewer/index.tsx +3 -1
- package/src/tools/PrettyCode/PrettyCode.client.tsx +2 -0
- package/src/tools/PrettyCode/index.tsx +1 -0
- package/src/tools/VideoPlayer/VideoControls.tsx +4 -3
- package/src/tools/VideoPlayer/VideoPlayer.tsx +9 -8
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import { usePathname } from 'next/navigation';
|
|
5
|
-
import
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
6
|
import { useIsMobile } from '@djangocfg/ui-core/hooks';
|
|
7
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
8
|
+
|
|
7
9
|
import { useQueryParams } from '../hooks';
|
|
8
10
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
PaginationEllipsis,
|
|
12
|
-
PaginationItem,
|
|
13
|
-
PaginationLink,
|
|
14
|
-
PaginationNext,
|
|
15
|
-
PaginationPrevious,
|
|
11
|
+
Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink,
|
|
12
|
+
PaginationNext, PaginationPrevious
|
|
16
13
|
} from './pagination';
|
|
17
14
|
|
|
18
15
|
interface SSRPaginationProps {
|
package/src/hooks/useHotkey.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import type { RefObject } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { Options as HotkeysOptions, useHotkeys } from 'react-hotkeys-hook';
|
|
5
|
+
|
|
5
6
|
import type { HotkeyCallback, Keys } from 'react-hotkeys-hook';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
'use client';
|
|
17
17
|
|
|
18
|
-
import { useState, useEffect, useRef } from 'react';
|
|
19
18
|
import { usePathname } from 'next/navigation';
|
|
19
|
+
import { useEffect, useRef, useState } from 'react';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Hook to safely access URL query parameters without useSearchParams()
|
package/src/theme/ForceTheme.tsx
CHANGED
|
@@ -21,12 +21,14 @@
|
|
|
21
21
|
|
|
22
22
|
'use client';
|
|
23
23
|
|
|
24
|
-
import { useEffect, useState } from 'react';
|
|
25
24
|
import { Moon, Sun } from 'lucide-react';
|
|
25
|
+
import { useEffect, useState } from 'react';
|
|
26
|
+
|
|
26
27
|
import { Button } from '@djangocfg/ui-core/components';
|
|
27
28
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
28
|
-
|
|
29
|
+
|
|
29
30
|
import { useIsMobile } from '../hooks';
|
|
31
|
+
import { useThemeContext } from './ThemeProvider';
|
|
30
32
|
|
|
31
33
|
export interface ThemeToggleProps {
|
|
32
34
|
/** Custom className */
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import consola from 'consola';
|
|
4
|
+
import { AlertCircle } from 'lucide-react';
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Alert, AlertDescription, Button } from '@djangocfg/ui-core/components';
|
|
4
8
|
import Form from '@rjsf/core';
|
|
5
|
-
import validator from '@rjsf/validator-ajv8';
|
|
6
9
|
import { RegistryWidgetsType } from '@rjsf/utils';
|
|
7
|
-
import
|
|
8
|
-
import { AlertCircle } from 'lucide-react';
|
|
9
|
-
import consola from 'consola';
|
|
10
|
+
import validator from '@rjsf/validator-ajv8';
|
|
10
11
|
|
|
12
|
+
import {
|
|
13
|
+
ArrayFieldItemTemplate, ArrayFieldTemplate, BaseInputTemplate, ErrorListTemplate, FieldTemplate,
|
|
14
|
+
ObjectFieldTemplate
|
|
15
|
+
} from './templates';
|
|
11
16
|
import { JsonSchemaFormProps } from './types';
|
|
17
|
+
import { normalizeFormData, validateSchema } from './utils';
|
|
12
18
|
import {
|
|
13
|
-
|
|
14
|
-
NumberWidget,
|
|
15
|
-
CheckboxWidget,
|
|
16
|
-
SelectWidget,
|
|
17
|
-
SwitchWidget,
|
|
18
|
-
ColorWidget,
|
|
19
|
-
SliderWidget,
|
|
19
|
+
CheckboxWidget, ColorWidget, NumberWidget, SelectWidget, SliderWidget, SwitchWidget, TextWidget
|
|
20
20
|
} from './widgets';
|
|
21
|
-
import {
|
|
22
|
-
FieldTemplate,
|
|
23
|
-
ObjectFieldTemplate,
|
|
24
|
-
ArrayFieldTemplate,
|
|
25
|
-
ArrayFieldItemTemplate,
|
|
26
|
-
ErrorListTemplate,
|
|
27
|
-
BaseInputTemplate,
|
|
28
|
-
} from './templates';
|
|
29
|
-
import { validateSchema, normalizeFormData } from './utils';
|
|
30
21
|
|
|
31
22
|
/**
|
|
32
23
|
* JSON Schema Form Component
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import consola from 'consola';
|
|
3
4
|
import React, { useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Card, CardContent, CardDescription, CardHeader, CardTitle
|
|
8
|
+
} from '@djangocfg/ui-core/components';
|
|
6
9
|
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
7
|
-
|
|
10
|
+
|
|
11
|
+
import { JsonSchemaForm } from '../JsonSchemaForm';
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* Example JSON Schema for Bot Configuration
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import consola from 'consola';
|
|
3
4
|
import React, { useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Card, CardContent, CardDescription, CardHeader, CardTitle
|
|
8
|
+
} from '@djangocfg/ui-core/components';
|
|
6
9
|
import { RJSFSchema } from '@rjsf/utils';
|
|
7
|
-
|
|
10
|
+
|
|
11
|
+
import { JsonSchemaForm } from '../JsonSchemaForm';
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* Real Bot Config Schema from API
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
6
|
+
import { ArrayFieldItemTemplateProps, getTemplate, getUiOptions } from '@rjsf/utils';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Array field item template for JSON Schema Form
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import { Plus } from 'lucide-react';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
import { Button } from '@djangocfg/ui-core/components';
|
|
6
|
-
import {
|
|
7
|
+
import { ArrayFieldTemplateProps } from '@rjsf/utils';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Array field template for JSON Schema Form
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
3
|
+
import React, { ChangeEvent, FocusEvent, useCallback, useMemo } from 'react';
|
|
4
|
+
|
|
5
5
|
import { Input } from '@djangocfg/ui-core/components';
|
|
6
|
+
import { getInputProps, WidgetProps } from '@rjsf/utils';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Base input template for JSON Schema Form
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import { AlertCircle } from 'lucide-react';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
import { Alert, AlertDescription, AlertTitle } from '@djangocfg/ui-core/components';
|
|
6
|
-
import {
|
|
7
|
+
import { ErrorListProps } from '@rjsf/utils';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Error list template for JSON Schema Form
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { Label } from '@djangocfg/ui-core/components';
|
|
6
6
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
7
|
+
import { FieldTemplateProps } from '@rjsf/utils';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Field template for JSON Schema Form
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import { ChevronDown } from 'lucide-react';
|
|
3
4
|
import React, { useState } from 'react';
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@djangocfg/ui-core/components';
|
|
5
7
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
6
|
-
import {
|
|
7
|
-
Collapsible,
|
|
8
|
-
CollapsibleContent,
|
|
9
|
-
CollapsibleTrigger,
|
|
10
|
-
} from '@djangocfg/ui-core/components';
|
|
11
|
-
import { ChevronDown } from 'lucide-react';
|
|
8
|
+
import { ObjectFieldTemplateProps } from '@rjsf/utils';
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* Object field template for JSON Schema Form
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
3
|
+
import React, { useCallback, useMemo, useRef } from 'react';
|
|
4
|
+
|
|
5
5
|
import { Input } from '@djangocfg/ui-core/components';
|
|
6
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Color input widget for JSON Schema Form
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
|
|
5
5
|
import { Input } from '@djangocfg/ui-core/components';
|
|
6
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Number input widget for JSON Schema Form
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
SelectContent,
|
|
8
|
-
SelectItem,
|
|
9
|
-
SelectTrigger,
|
|
10
|
-
SelectValue,
|
|
6
|
+
Select, SelectContent, SelectItem, SelectTrigger, SelectValue
|
|
11
7
|
} from '@djangocfg/ui-core/components';
|
|
8
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* Select dropdown widget for JSON Schema Form
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
5
|
-
import {
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
|
|
5
|
+
import { Input, Slider } from '@djangocfg/ui-core/components';
|
|
6
6
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
7
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Slider widget for JSON Schema Form
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
|
|
5
5
|
import { Input } from '@djangocfg/ui-core/components';
|
|
6
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Text input widget for JSON Schema Form
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { ChevronDown, ChevronUp, Download } from 'lucide-react';
|
|
3
4
|
import React, { useState } from 'react';
|
|
4
5
|
import { CommonExternalProps, JSONTree } from 'react-json-tree';
|
|
5
|
-
|
|
6
|
+
|
|
6
7
|
import { Button, CopyButton } from '@djangocfg/ui-core/components';
|
|
7
8
|
|
|
8
9
|
export type { Language } from 'prism-react-renderer';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
+
|
|
4
5
|
import { useResolvedTheme } from '../../hooks/useResolvedTheme';
|
|
5
|
-
import { useMermaidRenderer } from './hooks/useMermaidRenderer';
|
|
6
|
-
import { useMermaidFullscreen } from './hooks/useMermaidFullscreen';
|
|
7
6
|
import { MermaidFullscreenModal } from './components/MermaidFullscreenModal';
|
|
7
|
+
import { useMermaidFullscreen } from './hooks/useMermaidFullscreen';
|
|
8
|
+
import { useMermaidRenderer } from './hooks/useMermaidRenderer';
|
|
8
9
|
|
|
9
10
|
interface MermaidProps {
|
|
10
11
|
chart: string;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Hook for rendering Mermaid diagrams with debounce and validation
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { useEffect, useRef, useState } from 'react';
|
|
6
5
|
import mermaid from 'mermaid';
|
|
7
|
-
import {
|
|
6
|
+
import { useEffect, useRef, useState } from 'react';
|
|
7
|
+
|
|
8
8
|
import { useMermaidCleanup } from './useMermaidCleanup';
|
|
9
|
+
import { useMermaidValidation } from './useMermaidValidation';
|
|
9
10
|
|
|
10
11
|
interface UseMermaidRendererProps {
|
|
11
12
|
chart: string;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { AlertCircle, ChevronDown, Code, Database, FileText } from 'lucide-react';
|
|
3
4
|
import React, { useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Badge, Card, CardContent, CardHeader, CardTitle, Collapsible, CollapsibleContent,
|
|
8
|
+
CollapsibleTrigger, CopyButton
|
|
9
|
+
} from '@djangocfg/ui-core/components';
|
|
10
|
+
|
|
6
11
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
12
|
import { getMethodColor, getStatusColor } from '../utils';
|
|
8
13
|
|
|
@@ -119,20 +124,21 @@ export const EndpointInfo: React.FC = () => {
|
|
|
119
124
|
<ChevronDown className="h-4 w-4" />
|
|
120
125
|
</CollapsibleTrigger>
|
|
121
126
|
<CollapsibleContent className="mt-2 space-y-2">
|
|
122
|
-
{selectedEndpoint.responses.map((response, index) =>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
{selectedEndpoint.responses.map((response, index) => {
|
|
128
|
+
const statusColor = getStatusColor(parseInt(response.code));
|
|
129
|
+
const badgeVariant = statusColor === 'success' ? 'default' :
|
|
130
|
+
statusColor === 'error' ? 'destructive' : 'secondary';
|
|
131
|
+
return (
|
|
132
|
+
<div key={index} className="flex items-center space-x-2 text-xs">
|
|
133
|
+
<Badge variant={badgeVariant} className="text-xs">
|
|
134
|
+
{response.code}
|
|
135
|
+
</Badge>
|
|
136
|
+
<span className="text-muted-foreground">
|
|
137
|
+
{response.description}
|
|
138
|
+
</span>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
})}
|
|
136
142
|
</CollapsibleContent>
|
|
137
143
|
</Collapsible>
|
|
138
144
|
)}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
BarChart3, Code, Database, FileText, Filter, Grid3X3, List, Search, Settings, Shield, Users
|
|
5
|
+
} from 'lucide-react';
|
|
3
6
|
import React, { useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
Badge, Button, Card, CardContent, CardHeader, CardTitle, Input, Select, SelectContent,
|
|
10
|
+
SelectItem, SelectTrigger, SelectValue, Skeleton, Table, TableBody, TableCell, TableHead,
|
|
11
|
+
TableHeader, TableRow
|
|
12
|
+
} from '@djangocfg/ui-core/components';
|
|
13
|
+
|
|
6
14
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
|
-
import type { ApiEndpoint } from '../types';
|
|
8
|
-
import { getMethodColor } from '../utils';
|
|
9
15
|
import useOpenApiSchema from '../hooks/useOpenApiSchema';
|
|
16
|
+
import { getMethodColor } from '../utils';
|
|
10
17
|
import { deduplicateEndpoints } from '../utils/versionManager';
|
|
11
18
|
import { VersionSelector } from './VersionSelector';
|
|
12
19
|
|
|
20
|
+
import type { ApiEndpoint } from '../types';
|
|
13
21
|
const categoryIcons: Record<string, React.ReactNode> = {
|
|
14
22
|
'Authentication': <Shield className="h-4 w-4" />,
|
|
15
23
|
'Users': <Users className="h-4 w-4" />,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { Menu, X } from 'lucide-react';
|
|
3
4
|
import React from 'react';
|
|
5
|
+
|
|
4
6
|
import { Button, Sheet, SheetContent, SheetTrigger } from '@djangocfg/ui-core/components';
|
|
5
|
-
|
|
7
|
+
|
|
6
8
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
9
|
import { useMobile } from '../hooks/useMobile';
|
|
8
|
-
import { PlaygroundStepper } from './PlaygroundStepper';
|
|
9
10
|
import { EndpointsLibrary } from './EndpointsLibrary';
|
|
11
|
+
import { PlaygroundStepper } from './PlaygroundStepper';
|
|
10
12
|
import { RequestBuilder } from './RequestBuilder';
|
|
11
13
|
import { ResponseViewer } from './ResponseViewer';
|
|
12
14
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { Check, ChevronLeft, ChevronRight, Code, FileText, Send } from 'lucide-react';
|
|
3
4
|
import React from 'react';
|
|
5
|
+
|
|
4
6
|
import { Badge, Button } from '@djangocfg/ui-core/components';
|
|
5
|
-
|
|
7
|
+
|
|
6
8
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
9
|
import { PlaygroundStep } from '../types';
|
|
8
10
|
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { Key, Loader2, Send } from 'lucide-react';
|
|
3
4
|
import React, { useCallback } from 'react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Button, Card, CardContent, CardHeader, CardTitle, CopyButton, Input, Textarea
|
|
8
|
+
} from '@djangocfg/ui-core/components';
|
|
9
|
+
|
|
10
|
+
import PrettyCode from '../../PrettyCode';
|
|
6
11
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
7
|
-
import { findApiKeyById } from '../utils';
|
|
8
|
-
import { isValidJson, parseRequestHeaders } from '../utils';
|
|
9
|
-
import { RequestParametersForm } from './RequestParametersForm';
|
|
12
|
+
import { findApiKeyById, isValidJson, parseRequestHeaders } from '../utils';
|
|
10
13
|
import { EndpointInfo } from './EndpointInfo';
|
|
11
|
-
import
|
|
14
|
+
import { RequestParametersForm } from './RequestParametersForm';
|
|
12
15
|
|
|
13
16
|
export const RequestBuilder: React.FC = () => {
|
|
14
17
|
const {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { HelpCircle } from 'lucide-react';
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
|
+
|
|
4
6
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Accordion, AccordionContent, AccordionItem, AccordionTrigger,
|
|
9
|
-
Tooltip, TooltipContent, TooltipProvider, TooltipTrigger
|
|
7
|
+
Accordion, AccordionContent, AccordionItem, AccordionTrigger, Badge, Button, Card, CardContent,
|
|
8
|
+
CardHeader, CardTitle, Input, Label, Tabs, TabsContent, TabsList, TabsTrigger, Textarea,
|
|
9
|
+
Tooltip, TooltipContent, TooltipProvider, TooltipTrigger
|
|
10
10
|
} from '@djangocfg/ui-core/components';
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
import { usePlaygroundContext } from '../context/PlaygroundContext';
|
|
13
13
|
|
|
14
14
|
interface Parameter {
|