@djangocfg/ui-nextjs 2.1.42 → 2.1.44
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/SplitHero/SplitHero.tsx +95 -0
- package/src/blocks/SplitHero/SplitHeroContent.tsx +117 -0
- package/src/blocks/SplitHero/SplitHeroMedia.tsx +66 -0
- package/src/blocks/SplitHero/index.ts +13 -0
- package/src/blocks/SplitHero/types.ts +75 -0
- package/src/blocks/SuperHero.tsx +10 -4
- package/src/blocks/index.ts +1 -0
- 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,10 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import
|
|
3
|
+
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
|
|
7
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
8
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
8
9
|
|
|
9
10
|
const Breadcrumb = React.forwardRef<
|
|
10
11
|
HTMLElement,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { AlertCircle, CheckCircle2, Download, Loader2 } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
|
|
6
|
+
import { Button, ButtonProps} from '@djangocfg/ui-core/components';
|
|
7
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
8
|
+
|
|
9
|
+
import { useLocalStorage } from '../hooks/useLocalStorage';
|
|
8
10
|
|
|
9
11
|
// Token key used by the API client
|
|
10
12
|
const TOKEN_KEY = "auth_token"
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import
|
|
3
|
+
import { Check, ChevronRight, Circle } from 'lucide-react';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
|
|
7
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
8
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
8
9
|
|
|
9
10
|
const DropdownMenu = DropdownMenuPrimitive.Root
|
|
10
11
|
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import ReactMarkdown from 'react-markdown';
|
|
5
5
|
import remarkGfm from 'remark-gfm';
|
|
6
|
-
|
|
7
|
-
import PrettyCode from '../../tools/PrettyCode';
|
|
6
|
+
|
|
8
7
|
import { CopyButton } from '@djangocfg/ui-core/components';
|
|
8
|
+
|
|
9
9
|
import { useResolvedTheme } from '../../hooks/useResolvedTheme';
|
|
10
|
+
import Mermaid from '../../tools/Mermaid';
|
|
11
|
+
import PrettyCode from '../../tools/PrettyCode';
|
|
12
|
+
|
|
10
13
|
import type { Components } from 'react-markdown';
|
|
11
14
|
|
|
12
15
|
// Helper function to extract text content from React children
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import
|
|
3
|
+
import { Check, ChevronRight, Circle } from 'lucide-react';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
|
|
7
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
8
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
8
9
|
|
|
9
10
|
function MenubarMenu({
|
|
10
11
|
...props
|
|
@@ -13,25 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
"use client"
|
|
15
15
|
|
|
16
|
-
import
|
|
17
|
-
import { Check, ChevronsUpDown, X, XCircle
|
|
18
|
-
import
|
|
19
|
-
|
|
16
|
+
import { cva } from 'class-variance-authority';
|
|
17
|
+
import { Check, ChevronsUpDown, Loader2, X, XCircle } from 'lucide-react';
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
CommandInput,
|
|
26
|
-
CommandItem,
|
|
27
|
-
CommandList,
|
|
28
|
-
CommandSeparator,
|
|
29
|
-
Popover,
|
|
30
|
-
PopoverContent,
|
|
31
|
-
PopoverTrigger,
|
|
32
|
-
Badge,
|
|
33
|
-
Separator,
|
|
34
|
-
} from "@djangocfg/ui-core/components"
|
|
21
|
+
Badge, Button, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList,
|
|
22
|
+
CommandSeparator, Popover, PopoverContent, PopoverTrigger, Separator
|
|
23
|
+
} from '@djangocfg/ui-core/components';
|
|
24
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
35
25
|
|
|
36
26
|
// ==================== TYPES ====================
|
|
37
27
|
|
|
@@ -1,24 +1,14 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { Check, ChevronsUpDown, X, XCircle } from 'lucide-react';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
CommandInput,
|
|
13
|
-
CommandItem,
|
|
14
|
-
CommandList,
|
|
15
|
-
CommandSeparator,
|
|
16
|
-
Popover,
|
|
17
|
-
PopoverContent,
|
|
18
|
-
PopoverTrigger,
|
|
19
|
-
Badge,
|
|
20
|
-
Separator,
|
|
21
|
-
} from "@djangocfg/ui-core/components"
|
|
8
|
+
Badge, Button, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList,
|
|
9
|
+
CommandSeparator, Popover, PopoverContent, PopoverTrigger, Separator
|
|
10
|
+
} from '@djangocfg/ui-core/components';
|
|
11
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
22
12
|
|
|
23
13
|
// ==================== TYPES ====================
|
|
24
14
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { ChevronDown } from 'lucide-react';
|
|
5
|
+
import Link from 'next/link';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
|
|
8
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
9
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
9
10
|
|
|
10
11
|
const NavigationMenu = React.forwardRef<
|
|
11
12
|
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { MinusIcon } from 'lucide-react'
|
|
11
|
-
import { useSmartOTP, createPasteHandler } from './use-otp-input'
|
|
3
|
+
import { MinusIcon } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
|
|
6
|
+
import { cn, InputOTP, InputOTPGroup, InputOTPSlot } from '@djangocfg/ui-core';
|
|
7
|
+
|
|
8
|
+
import { createPasteHandler, useSmartOTP } from './use-otp-input';
|
|
9
|
+
|
|
12
10
|
import type { SmartOTPProps } from './types'
|
|
13
11
|
|
|
14
12
|
/**
|
|
@@ -37,20 +37,17 @@
|
|
|
37
37
|
|
|
38
38
|
"use client"
|
|
39
39
|
|
|
40
|
+
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
40
41
|
import React from 'react';
|
|
41
|
-
|
|
42
|
-
import { useIsMobile } from '@djangocfg/ui-core/hooks';
|
|
42
|
+
|
|
43
43
|
import { Button } from '@djangocfg/ui-core/components';
|
|
44
|
+
import { useIsMobile } from '@djangocfg/ui-core/hooks';
|
|
45
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
46
|
+
|
|
44
47
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
PaginationEllipsis,
|
|
48
|
-
PaginationItem,
|
|
49
|
-
PaginationLink,
|
|
50
|
-
PaginationNext,
|
|
51
|
-
PaginationPrevious,
|
|
48
|
+
Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink,
|
|
49
|
+
PaginationNext, PaginationPrevious
|
|
52
50
|
} from './pagination';
|
|
53
|
-
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
54
51
|
|
|
55
52
|
/**
|
|
56
53
|
* DRF Pagination Response type
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
1
|
+
import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
import { ButtonProps, buttonVariants} from '@djangocfg/ui-core/components';
|
|
6
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
6
7
|
|
|
7
8
|
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
|
8
9
|
<nav
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { AsYouType, parsePhoneNumberFromString, CountryCode, getCountries, getCountryCallingCode } from 'libphonenumber-js'
|
|
5
|
-
import { Input, Button } from "@djangocfg/ui-core/components"
|
|
6
|
-
import { cn } from "@djangocfg/ui-core/lib"
|
|
7
3
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import {
|
|
4
|
+
AsYouType, CountryCode, getCountries, getCountryCallingCode, parsePhoneNumberFromString
|
|
5
|
+
} from 'libphonenumber-js';
|
|
6
|
+
import { ChevronDown, Search } from 'lucide-react';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
|
|
9
|
+
import { Button, Input } from '@djangocfg/ui-core/components';
|
|
10
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger
|
|
14
|
+
} from './dropdown-menu';
|
|
14
15
|
|
|
15
16
|
// Generate country flag emoji from country code
|
|
16
17
|
const getCountryFlag = (countryCode: CountryCode): string => {
|
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
3
|
+
import { cva, VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { PanelLeft } from 'lucide-react';
|
|
5
|
+
import Link from 'next/link';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
SheetHeader,
|
|
16
|
-
SheetTitle,
|
|
17
|
-
Skeleton,
|
|
18
|
-
Tooltip,
|
|
19
|
-
TooltipContent,
|
|
20
|
-
TooltipProvider,
|
|
21
|
-
TooltipTrigger,
|
|
22
|
-
} from "@djangocfg/ui-core/components"
|
|
23
|
-
import { PanelLeft } from "lucide-react"
|
|
24
|
-
import Link from "next/link"
|
|
9
|
+
Button, Input, Separator, Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle,
|
|
10
|
+
Skeleton, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger
|
|
11
|
+
} from '@djangocfg/ui-core/components';
|
|
12
|
+
import { useIsMobile } from '@djangocfg/ui-core/hooks';
|
|
13
|
+
import { cn } from '@djangocfg/ui-core/lib';
|
|
14
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
25
15
|
|
|
26
16
|
const SIDEBAR_COOKIE_NAME = "sidebar_state"
|
|
27
17
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
|
@@ -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
|