chore: run bun format to automatically format the frontend code
This commit is contained in:
+1
@@ -19,6 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
import { Accordion as AccordionPrimitive } from '@base-ui/react/accordion'
|
||||
import { ArrowDown01Icon, ArrowUp01Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
|
||||
|
||||
+3
-2
@@ -18,10 +18,11 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
|
||||
return <AlertDialogPrimitive.Root data-slot='alert-dialog' {...props} />
|
||||
|
||||
+2
-1
@@ -16,8 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const alertVariants = cva(
|
||||
|
||||
+2
-1
@@ -16,8 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Avatar({
|
||||
|
||||
+1
@@ -19,6 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
import { mergeProps } from '@base-ui/react/merge-props'
|
||||
import { useRender } from '@base-ui/react/use-render'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const badgeVariants = cva(
|
||||
|
||||
+2
-1
@@ -16,7 +16,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { mergeProps } from '@base-ui/react/merge-props'
|
||||
import { useRender } from '@base-ui/react/use-render'
|
||||
import {
|
||||
@@ -24,6 +23,8 @@ import {
|
||||
MoreHorizontalCircle01Icon,
|
||||
} from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Breadcrumb({ className, ...props }: React.ComponentProps<'nav'>) {
|
||||
|
||||
+2
-1
@@ -19,8 +19,9 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
import { mergeProps } from '@base-ui/react/merge-props'
|
||||
import { useRender } from '@base-ui/react/use-render'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
import { Separator } from '@/components/ui/separator'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const buttonGroupVariants = cva(
|
||||
"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
||||
|
||||
+2
-1
@@ -16,9 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { isValidElement } from 'react'
|
||||
import { Button as ButtonPrimitive } from '@base-ui/react/button'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import { isValidElement } from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const buttonVariants = cva(
|
||||
|
||||
+3
-2
@@ -16,21 +16,22 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import {
|
||||
ArrowLeftIcon,
|
||||
ArrowRightIcon,
|
||||
ArrowDownIcon,
|
||||
} from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import * as React from 'react'
|
||||
import {
|
||||
DayPicker,
|
||||
getDefaultClassNames,
|
||||
type DayButton,
|
||||
type Locale,
|
||||
} from 'react-day-picker'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
import { Button, buttonVariants } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Calendar({
|
||||
className,
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Card({
|
||||
|
||||
+3
-2
@@ -18,14 +18,15 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { ArrowLeft01Icon, ArrowRight01Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import useEmblaCarousel, {
|
||||
type UseEmblaCarouselType,
|
||||
} from 'embla-carousel-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
type CarouselApi = UseEmblaCarouselType[1]
|
||||
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
||||
|
||||
+1
@@ -19,6 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
import * as React from 'react'
|
||||
import * as RechartsPrimitive from 'recharts'
|
||||
import type { TooltipValueType } from 'recharts'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
// Format: { THEME_NAME: CSS_SELECTOR }
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'
|
||||
import { Tick02Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
||||
|
||||
+3
-2
@@ -16,11 +16,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { Check, ChevronsUpDown } from 'lucide-react'
|
||||
import * as React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
export type ComboboxInputOption = {
|
||||
value: string
|
||||
|
||||
+3
-2
@@ -16,7 +16,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { Combobox as ComboboxPrimitive } from '@base-ui/react'
|
||||
import {
|
||||
ArrowDown01Icon,
|
||||
@@ -24,7 +23,8 @@ import {
|
||||
Tick02Icon,
|
||||
} from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import {
|
||||
ComboboxInput as LegacyComboboxInput,
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
InputGroupButton,
|
||||
InputGroupInput,
|
||||
} from '@/components/ui/input-group'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
type LegacyComboboxProps = {
|
||||
options: ComboboxInputOption[]
|
||||
|
||||
+3
-2
@@ -18,11 +18,11 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { SearchIcon, Tick02Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { Command as CommandPrimitive } from 'cmdk'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog'
|
||||
import { InputGroup, InputGroupAddon } from '@/components/ui/input-group'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Command({
|
||||
className,
|
||||
|
||||
+2
-1
@@ -18,10 +18,11 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu'
|
||||
import { ArrowRight01Icon, Tick02Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {
|
||||
|
||||
+3
-2
@@ -16,12 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'
|
||||
import { Cancel01Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
||||
return <DialogPrimitive.Root data-slot='dialog' {...props} />
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import * as React from 'react'
|
||||
import { Drawer as DrawerPrimitive } from 'vaul'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Drawer({
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { describe, test } from 'node:test'
|
||||
|
||||
import { handleDropdownMenuItemSelect } from './dropdown-menu-events'
|
||||
|
||||
function createMenuEvent() {
|
||||
|
||||
+3
-1
@@ -16,11 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { Menu as MenuPrimitive } from '@base-ui/react/menu'
|
||||
import { ArrowRight01Icon, Tick02Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
import {
|
||||
handleDropdownMenuItemSelect,
|
||||
type DropdownMenuItemSelectHandler,
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Empty({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
|
||||
+3
-2
@@ -16,11 +16,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { useMemo } from 'react'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { useMemo } from 'react'
|
||||
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Separator } from '@/components/ui/separator'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {
|
||||
return (
|
||||
|
||||
+3
-2
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { useRender } from '@base-ui/react/use-render'
|
||||
import * as React from 'react'
|
||||
import {
|
||||
Controller,
|
||||
@@ -26,10 +27,10 @@ import {
|
||||
type FieldPath,
|
||||
type FieldValues,
|
||||
} from 'react-hook-form'
|
||||
import { useRender } from '@base-ui/react/use-render'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
type FormRootContextValue = {
|
||||
id: string
|
||||
|
||||
@@ -19,6 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
'use client'
|
||||
|
||||
import { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {
|
||||
|
||||
+3
-2
@@ -18,12 +18,13 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
return (
|
||||
|
||||
+2
-1
@@ -16,10 +16,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { MinusSignIcon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { OTPInput, OTPInputContext } from 'input-otp'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function InputOTP({
|
||||
|
||||
+2
-1
@@ -16,8 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { Input as InputPrimitive } from '@base-ui/react/input'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
|
||||
|
||||
+3
-2
@@ -16,12 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { mergeProps } from '@base-ui/react/merge-props'
|
||||
import { useRender } from '@base-ui/react/use-render'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Separator } from '@/components/ui/separator'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function ItemGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
return (
|
||||
|
||||
+1
@@ -19,6 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Label({ className, ...props }: React.ComponentProps<'label'>) {
|
||||
|
||||
+55
-16
@@ -18,9 +18,11 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import DOMPurify from 'dompurify'
|
||||
import * as katex from 'katex'
|
||||
|
||||
import 'katex/dist/katex.min.css'
|
||||
import { Marked, Renderer, type MarkedExtension, type Tokens } from 'marked'
|
||||
import { useMemo } from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
interface MarkdownProps {
|
||||
@@ -232,7 +234,8 @@ function splitFlowLabel(label: string, maxUnits: number): string[] {
|
||||
|
||||
function renderFlowText(layout: FlowNodeLayout): string {
|
||||
const lineHeight = 18
|
||||
const firstLineY = layout.y - ((layout.labelLines.length - 1) * lineHeight) / 2 + 5
|
||||
const firstLineY =
|
||||
layout.y - ((layout.labelLines.length - 1) * lineHeight) / 2 + 5
|
||||
|
||||
return layout.labelLines
|
||||
.map((line, index) => {
|
||||
@@ -241,10 +244,16 @@ function renderFlowText(layout: FlowNodeLayout): string {
|
||||
.join('')
|
||||
}
|
||||
|
||||
function getFlowNodeLayout(node: FlowNode, index: number, centerX: number): FlowNodeLayout {
|
||||
function getFlowNodeLayout(
|
||||
node: FlowNode,
|
||||
index: number,
|
||||
centerX: number
|
||||
): FlowNodeLayout {
|
||||
const isCondition = node.type === 'condition'
|
||||
const labelLines = splitFlowLabel(node.label, isCondition ? 14 : 18)
|
||||
const labelWidth = Math.max(...labelLines.map((line) => getTextUnits(line) * 7.2))
|
||||
const labelWidth = Math.max(
|
||||
...labelLines.map((line) => getTextUnits(line) * 7.2)
|
||||
)
|
||||
const textHeight = labelLines.length * 18
|
||||
|
||||
if (isCondition) {
|
||||
@@ -279,7 +288,10 @@ function getFlowNodeLayout(node: FlowNode, index: number, centerX: number): Flow
|
||||
}
|
||||
}
|
||||
|
||||
function getFlowAnchor(layout: FlowNodeLayout, side: 'bottom' | 'left' | 'right' | 'top'): {
|
||||
function getFlowAnchor(
|
||||
layout: FlowNodeLayout,
|
||||
side: 'bottom' | 'left' | 'right' | 'top'
|
||||
): {
|
||||
x: number
|
||||
y: number
|
||||
} {
|
||||
@@ -323,7 +335,10 @@ function renderFlowShape(layout: FlowNodeLayout): string {
|
||||
`
|
||||
}
|
||||
|
||||
function parseFlowDiagram(source: string): { edges: FlowEdge[]; nodes: FlowNode[] } {
|
||||
function parseFlowDiagram(source: string): {
|
||||
edges: FlowEdge[]
|
||||
nodes: FlowNode[]
|
||||
} {
|
||||
const lines = source
|
||||
.split('\n')
|
||||
.map((line) => line.trim())
|
||||
@@ -347,8 +362,12 @@ function parseFlowDiagram(source: string): { edges: FlowEdge[]; nodes: FlowNode[
|
||||
}
|
||||
|
||||
for (let index = 0; index < edgeParts.length - 1; index += 1) {
|
||||
const fromMatch = /^([A-Za-z][\w-]*)(?:\(([^)]+)\))?$/.exec(edgeParts[index])
|
||||
const toMatch = /^([A-Za-z][\w-]*)(?:\(([^)]+)\))?$/.exec(edgeParts[index + 1])
|
||||
const fromMatch = /^([A-Za-z][\w-]*)(?:\(([^)]+)\))?$/.exec(
|
||||
edgeParts[index]
|
||||
)
|
||||
const toMatch = /^([A-Za-z][\w-]*)(?:\(([^)]+)\))?$/.exec(
|
||||
edgeParts[index + 1]
|
||||
)
|
||||
|
||||
if (!fromMatch || !toMatch) {
|
||||
continue
|
||||
@@ -371,10 +390,17 @@ function renderFlowDiagram(source: string): string {
|
||||
const loopX = 520
|
||||
const nodeIndex = new Map(nodes.map((node, index) => [node.id, index]))
|
||||
const nodePositions = new Map(
|
||||
nodes.map((node, index) => [node.id, getFlowNodeLayout(node, index, centerX)])
|
||||
nodes.map((node, index) => [
|
||||
node.id,
|
||||
getFlowNodeLayout(node, index, centerX),
|
||||
])
|
||||
)
|
||||
const lastNode =
|
||||
nodes.length > 0 ? nodePositions.get(nodes.at(-1)?.id ?? '') : undefined
|
||||
const height = Math.max(
|
||||
180,
|
||||
(lastNode?.y ?? 64) + (lastNode?.height ?? 40) / 2 + 54
|
||||
)
|
||||
const lastNode = nodes.length > 0 ? nodePositions.get(nodes.at(-1)?.id ?? '') : undefined
|
||||
const height = Math.max(180, (lastNode?.y ?? 64) + (lastNode?.height ?? 40) / 2 + 54)
|
||||
const renderedEdges = edges
|
||||
.map((edge) => {
|
||||
const from = nodePositions.get(edge.from)
|
||||
@@ -384,7 +410,8 @@ function renderFlowDiagram(source: string): string {
|
||||
return ''
|
||||
}
|
||||
|
||||
const isBackward = (nodeIndex.get(edge.to) ?? 0) <= (nodeIndex.get(edge.from) ?? 0)
|
||||
const isBackward =
|
||||
(nodeIndex.get(edge.to) ?? 0) <= (nodeIndex.get(edge.from) ?? 0)
|
||||
|
||||
if (isBackward) {
|
||||
const fromAnchor = getFlowAnchor(from, 'right')
|
||||
@@ -436,7 +463,10 @@ function renderFlowDiagram(source: string): string {
|
||||
`
|
||||
}
|
||||
|
||||
function parseSequenceDiagram(source: string): { messages: SequenceMessage[]; participants: string[] } {
|
||||
function parseSequenceDiagram(source: string): {
|
||||
messages: SequenceMessage[]
|
||||
participants: string[]
|
||||
} {
|
||||
const lines = source
|
||||
.split('\n')
|
||||
.map((line) => line.trim())
|
||||
@@ -466,7 +496,9 @@ function parseSequenceDiagram(source: string): { messages: SequenceMessage[]; pa
|
||||
return
|
||||
}
|
||||
|
||||
const messageMatch = /^([^-\s]+)\s*(-{1,2}>>?|-->)\s*([^:]+):\s*(.+)$/.exec(line)
|
||||
const messageMatch = /^([^-\s]+)\s*(-{1,2}>>?|-->)\s*([^:]+):\s*(.+)$/.exec(
|
||||
line
|
||||
)
|
||||
|
||||
if (!messageMatch) {
|
||||
return
|
||||
@@ -495,10 +527,16 @@ function renderSequenceDiagram(source: string): string {
|
||||
const marginX = 80
|
||||
const top = 42
|
||||
const rowGap = 72
|
||||
const width = Math.max(360, marginX * 2 + Math.max(0, participants.length - 1) * laneGap)
|
||||
const width = Math.max(
|
||||
360,
|
||||
marginX * 2 + Math.max(0, participants.length - 1) * laneGap
|
||||
)
|
||||
const height = Math.max(180, 126 + messages.length * rowGap)
|
||||
const positions = new Map(
|
||||
participants.map((participant, index) => [participant, marginX + index * laneGap])
|
||||
participants.map((participant, index) => [
|
||||
participant,
|
||||
marginX + index * laneGap,
|
||||
])
|
||||
)
|
||||
const participantBoxes = participants
|
||||
.map((participant) => {
|
||||
@@ -539,7 +577,8 @@ function renderSequenceDiagram(source: string): string {
|
||||
const toX = positions.get(message.to ?? '') ?? marginX
|
||||
const labelX = (fromX + toX) / 2
|
||||
const label = escapeHtml(message.label)
|
||||
const dash = message.lineStyle === 'dashed' ? ' stroke-dasharray="4 4"' : ''
|
||||
const dash =
|
||||
message.lineStyle === 'dashed' ? ' stroke-dasharray="4 4"' : ''
|
||||
|
||||
return `
|
||||
<line x1="${fromX}" y1="${y}" x2="${toX}" y2="${y}" class="markdown-diagram-edge"${dash} marker-end="url(#markdown-diagram-arrow)" />
|
||||
|
||||
+3
-2
@@ -18,12 +18,12 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { Menu as MenuPrimitive } from '@base-ui/react/menu'
|
||||
import { Menubar as MenubarPrimitive } from '@base-ui/react/menubar'
|
||||
import { Tick02Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
@@ -39,6 +39,7 @@ import {
|
||||
DropdownMenuSubTrigger,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/components/ui/dropdown-menu'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Menubar({ className, ...props }: MenubarPrimitive.Props) {
|
||||
return (
|
||||
|
||||
+2
-1
@@ -16,9 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { UnfoldMoreIcon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
type NativeSelectProps = Omit<React.ComponentProps<'select'>, 'size'> & {
|
||||
|
||||
@@ -20,6 +20,7 @@ import { NavigationMenu as NavigationMenuPrimitive } from '@base-ui/react/naviga
|
||||
import { ArrowDown01Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { cva } from 'class-variance-authority'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function NavigationMenu({
|
||||
|
||||
+3
-2
@@ -16,15 +16,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import {
|
||||
ArrowLeft01Icon,
|
||||
ArrowRight01Icon,
|
||||
MoreHorizontalCircle01Icon,
|
||||
} from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
|
||||
return (
|
||||
|
||||
+2
-1
@@ -16,8 +16,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { Popover as PopoverPrimitive } from '@base-ui/react/popover'
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Popover({ ...props }: PopoverPrimitive.Root.Props) {
|
||||
|
||||
+1
@@ -19,6 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
'use client'
|
||||
|
||||
import { Progress as ProgressPrimitive } from '@base-ui/react/progress'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Progress({
|
||||
|
||||
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { Radio as RadioPrimitive } from '@base-ui/react/radio'
|
||||
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
|
||||
|
||||
+1
@@ -19,6 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
'use client'
|
||||
|
||||
import * as ResizablePrimitive from 'react-resizable-panels'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function ResizablePanelGroup({
|
||||
|
||||
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function ScrollArea({
|
||||
|
||||
+3
-2
@@ -18,8 +18,6 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { useMediaQuery } from '@/hooks'
|
||||
import { Select as SelectPrimitive } from '@base-ui/react/select'
|
||||
import {
|
||||
UnfoldMoreIcon,
|
||||
@@ -28,6 +26,9 @@ import {
|
||||
ArrowDown01Icon,
|
||||
} from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import * as React from 'react'
|
||||
|
||||
import { useMediaQuery } from '@/hooks'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const Select = SelectPrimitive.Root
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { Separator as SeparatorPrimitive } from '@base-ui/react/separator'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Separator({
|
||||
|
||||
+3
-2
@@ -18,12 +18,13 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { Dialog as SheetPrimitive } from '@base-ui/react/dialog'
|
||||
import { Cancel01Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Sheet({ ...props }: SheetPrimitive.Root.Props) {
|
||||
return <SheetPrimitive.Root data-slot='sheet' {...props} />
|
||||
|
||||
+4
-3
@@ -18,14 +18,13 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { mergeProps } from '@base-ui/react/merge-props'
|
||||
import { useRender } from '@base-ui/react/use-render'
|
||||
import { SidebarLeftIcon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { useIsMobile } from '@/hooks/use-mobile'
|
||||
import * as React from 'react'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Separator } from '@/components/ui/separator'
|
||||
@@ -43,6 +42,8 @@ import {
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
} from '@/components/ui/tooltip'
|
||||
import { useIsMobile } from '@/hooks/use-mobile'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const SIDEBAR_COOKIE_NAME = 'sidebar_state'
|
||||
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { Slider as SliderPrimitive } from '@base-ui/react/slider'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Slider({
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ import {
|
||||
} from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
import { Toaster as Sonner, type ToasterProps } from 'sonner'
|
||||
|
||||
import { useTheme } from '@/context/theme-provider'
|
||||
|
||||
const Toaster = (props: ToasterProps) => {
|
||||
|
||||
+1
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { Loading03Icon } from '@hugeicons/core-free-icons'
|
||||
import { HugeiconsIcon } from '@hugeicons/react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
type SpinnerProps = Omit<
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { Switch as SwitchPrimitive } from '@base-ui/react/switch'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Switch({
|
||||
|
||||
+1
@@ -19,6 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Table({ className, ...props }: React.ComponentProps<'table'>) {
|
||||
|
||||
+1
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { Tabs as TabsPrimitive } from '@base-ui/react/tabs'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Tabs({
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {
|
||||
|
||||
@@ -17,7 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
|
||||
+3
-2
@@ -16,12 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import * as React from 'react'
|
||||
import { Toggle as TogglePrimitive } from '@base-ui/react/toggle'
|
||||
import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group'
|
||||
import { type VariantProps } from 'class-variance-authority'
|
||||
import { cn } from '@/lib/utils'
|
||||
import * as React from 'react'
|
||||
|
||||
import { toggleVariants } from '@/components/ui/toggle'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const ToggleGroupContext = React.createContext<
|
||||
VariantProps<typeof toggleVariants> & {
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import { Toggle as TogglePrimitive } from '@base-ui/react/toggle'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const toggleVariants = cva(
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
function TooltipProvider({
|
||||
|
||||
Reference in New Issue
Block a user