The version bump from 1.13.6 to 1.13.9 suggests these are mostly internal improvements and bug fixes rather than major feature additions.
This commit is contained in:
@@ -10,16 +10,76 @@ interface SponsorItem {
|
||||
description?: string;
|
||||
}
|
||||
|
||||
interface NavbarConfig {
|
||||
title?: string;
|
||||
logo?: {
|
||||
light?: string;
|
||||
dark?: string;
|
||||
};
|
||||
links?: Array<{
|
||||
title: string;
|
||||
href: string;
|
||||
external?: boolean;
|
||||
}>;
|
||||
}
|
||||
|
||||
interface FooterConfig {
|
||||
text?: string;
|
||||
links?: Array<{
|
||||
title: string;
|
||||
href: string;
|
||||
external?: boolean;
|
||||
}>;
|
||||
}
|
||||
|
||||
interface MetaConfig {
|
||||
title?: string;
|
||||
description?: string;
|
||||
favicon?: string;
|
||||
socialBanner?: string;
|
||||
}
|
||||
|
||||
interface RepositoryConfig {
|
||||
url: string;
|
||||
editUrl?: string;
|
||||
branch?: string;
|
||||
directory?: string;
|
||||
}
|
||||
|
||||
interface RouteItem {
|
||||
title: string;
|
||||
href: string;
|
||||
noLink?: boolean;
|
||||
context?: {
|
||||
icon: string;
|
||||
description: string;
|
||||
title: string;
|
||||
};
|
||||
items?: RouteItem[];
|
||||
}
|
||||
|
||||
interface RouteConfig {
|
||||
title: string;
|
||||
href: string;
|
||||
noLink?: boolean;
|
||||
context?: {
|
||||
icon: string;
|
||||
description: string;
|
||||
title: string;
|
||||
};
|
||||
items?: RouteItem[];
|
||||
}
|
||||
|
||||
interface DocuConfig {
|
||||
sponsor?: {
|
||||
title?: string;
|
||||
item?: SponsorItem;
|
||||
};
|
||||
navbar: any; // Anda bisa mendefinisikan tipe yang lebih spesifik jika diperlukan
|
||||
footer: any;
|
||||
meta: any;
|
||||
repository: any;
|
||||
routes: any[];
|
||||
navbar: NavbarConfig;
|
||||
footer: FooterConfig;
|
||||
meta: MetaConfig;
|
||||
repository: RepositoryConfig;
|
||||
routes: RouteConfig[];
|
||||
}
|
||||
|
||||
// Type assertion for docu.json
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import React from "react";
|
||||
import * as Icons from "lucide-react";
|
||||
import Link from "next/link";
|
||||
|
||||
type IconName = keyof typeof Icons;
|
||||
type ButtonProps = {
|
||||
icon?: keyof typeof Icons;
|
||||
text?: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { MDXRemote, MDXRemoteProps } from 'next-mdx-remote/rsc';
|
||||
import { MDXRemote } from 'next-mdx-remote/rsc';
|
||||
import { Kbd } from './KeyboardMdx';
|
||||
|
||||
// Define components mapping
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useRef, useMemo } from "react";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { Button } from "./ui/button";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { useScrollPosition, useActiveSection } from "@/hooks";
|
||||
import { useActiveSection } from "@/hooks";
|
||||
import { TocItem } from "@/lib/toc";
|
||||
|
||||
interface MobTocProps {
|
||||
|
||||
@@ -32,9 +32,6 @@ export default function SubLink({
|
||||
// Full path including parent's href
|
||||
const fullHref = `${parentHref}${href}`;
|
||||
|
||||
// Check if current path exactly matches this link's href
|
||||
const isExactActive = useMemo(() => path === fullHref, [path, fullHref]);
|
||||
|
||||
// Check if any child is active (for parent items)
|
||||
const hasActiveChild = useMemo(() => {
|
||||
if (!items) return false;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { getDocsTocs } from "@/lib/markdown";
|
||||
import clsx from "clsx";
|
||||
import Link from "next/link";
|
||||
import { useState, useRef, useEffect, useCallback } from "react";
|
||||
@@ -110,7 +109,6 @@ export default function TocObserver({
|
||||
|
||||
// Calculate scroll progress for the active section
|
||||
const [scrollProgress, setScrollProgress] = useState(0);
|
||||
const [activeSectionIndex, setActiveSectionIndex] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
@@ -137,15 +135,6 @@ export default function TocObserver({
|
||||
return () => window.removeEventListener('scroll', handleScroll);
|
||||
}, [activeId]);
|
||||
|
||||
// Update active section index when activeId changes
|
||||
useEffect(() => {
|
||||
if (activeId) {
|
||||
const index = data.findIndex(item => item.href.slice(1) === activeId);
|
||||
if (index !== -1) {
|
||||
setActiveSectionIndex(index);
|
||||
}
|
||||
}
|
||||
}, [activeId, data]);
|
||||
|
||||
return (
|
||||
<div className="relative">
|
||||
@@ -155,8 +144,9 @@ export default function TocObserver({
|
||||
const id = href.slice(1);
|
||||
const isActive = activeId === id;
|
||||
const indent = level > 1 ? (level - 1) * 20 : 0;
|
||||
const isParent = hasChildren(id, level);
|
||||
const isLastInLevel = index === data.length - 1 || data[index + 1].level <= level;
|
||||
// Prefix with underscore to indicate intentionally unused
|
||||
const _isParent = hasChildren(id, level);
|
||||
const _isLastInLevel = index === data.length - 1 || data[index + 1].level <= level;
|
||||
|
||||
return (
|
||||
<div key={href} className="relative">
|
||||
|
||||
@@ -24,7 +24,7 @@ function easeOutCubic(t: number): number {
|
||||
export function IconCloud({ icons, images }: IconCloudProps) {
|
||||
const canvasRef = useRef<HTMLCanvasElement>(null);
|
||||
const [iconPositions, setIconPositions] = useState<Icon[]>([]);
|
||||
const [rotation, setRotation] = useState({ x: 0, y: 0 });
|
||||
const [rotation] = useState({ x: 0, y: 0 });
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
const [lastMousePos, setLastMousePos] = useState({ x: 0, y: 0 });
|
||||
const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
|
||||
|
||||
@@ -2,8 +2,7 @@ import * as React from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
export interface InputProps
|
||||
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
||||
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
||||
|
||||
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
({ className, type, ...props }, ref) => {
|
||||
|
||||
@@ -2,8 +2,7 @@ import React from "react";
|
||||
import { ArrowRight } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface InteractiveHoverButtonProps
|
||||
extends React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
||||
type InteractiveHoverButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
||||
|
||||
export const InteractiveHoverButton = React.forwardRef<
|
||||
HTMLButtonElement,
|
||||
|
||||
Reference in New Issue
Block a user