@autono/open-pages 0.1.0 → 0.3.0
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 +8 -5
- package/dist/{build-TP72kiw7.js → build-Cq6uszaI.js} +3 -3
- package/dist/cli/bin.js +4 -4
- package/dist/{config-L0IbktJ0.js → config-DniCVIl6.js} +34 -7
- package/dist/{dev-I2IyEh5W.js → dev-DyY9SvwF.js} +2 -2
- package/dist/export-DqLDEQkL.js +4 -0
- package/dist/{export-ic28osQP.js → export-pYjzc4Cl.js} +10 -3
- package/dist/{open-pages-plugin-D_DN_zjh.js → open-pages-plugin-CACQ7TVo.js} +40 -6
- package/dist/{preview-BrDuvgAN.js → preview-CLb35jHx.js} +2 -2
- package/dist/vite/index.js +2 -2
- package/package.json +1 -1
- package/skills/apply-comments/SKILL.md +4 -4
- package/skills/create-page/SKILL.md +26 -8
- package/skills/create-theme/SKILL.md +137 -150
- package/skills/current-page/SKILL.md +1 -1
- package/skills/page-authoring/SKILL.md +97 -42
- package/skills/page-authoring/references/interactivity.md +70 -22
- package/skills/page-authoring/references/layout-and-responsive.md +38 -17
- package/skills/page-authoring/references/typography-and-color.md +50 -32
- package/skills/shadcn/SKILL.md +277 -0
- package/skills/shadcn/assets/shadcn-small.png +0 -0
- package/skills/shadcn/assets/shadcn.png +0 -0
- package/skills/shadcn/cli.md +290 -0
- package/skills/shadcn/customization.md +209 -0
- package/skills/shadcn/mcp.md +105 -0
- package/skills/shadcn/registry.md +277 -0
- package/skills/shadcn/rules/base-vs-radix.md +306 -0
- package/skills/shadcn/rules/chat.md +224 -0
- package/skills/shadcn/rules/composition.md +213 -0
- package/skills/shadcn/rules/forms.md +192 -0
- package/skills/shadcn/rules/icons.md +101 -0
- package/skills/shadcn/rules/styling.md +185 -0
- package/src/app/components/asset-view.tsx +11 -11
- package/src/app/components/command/command-menu.tsx +6 -6
- package/src/app/components/command/command.tsx +2 -2
- package/src/app/components/command/home-command-menu.tsx +2 -2
- package/src/app/components/icon-tooltip.tsx +1 -1
- package/src/app/components/language-toggle.tsx +7 -7
- package/src/app/components/sidebar/folder-item.tsx +5 -5
- package/src/app/components/sidebar/icon-picker.tsx +3 -3
- package/src/app/components/sidebar/sidebar-footer.tsx +4 -4
- package/src/app/components/sidebar/sidebar.tsx +6 -6
- package/src/app/components/theme-toggle.tsx +6 -6
- package/src/app/components/themes/theme-detail.tsx +4 -4
- package/src/app/components/themes/themes-gallery.tsx +1 -1
- package/src/app/components/ui/badge.tsx +1 -1
- package/src/app/components/ui/button.tsx +1 -1
- package/src/app/components/ui/card.tsx +1 -1
- package/src/app/components/ui/context-menu.tsx +1 -1
- package/src/app/components/ui/dialog.tsx +2 -2
- package/src/app/components/ui/dropdown-menu.tsx +1 -1
- package/src/app/components/ui/input.tsx +1 -1
- package/src/app/components/ui/label.tsx +1 -1
- package/src/app/components/ui/popover.tsx +1 -1
- package/src/app/components/ui/progress.tsx +1 -1
- package/src/app/components/ui/scroll-area.tsx +1 -1
- package/src/app/components/ui/select.tsx +1 -1
- package/src/app/components/ui/separator.tsx +1 -1
- package/src/app/components/ui/slider.tsx +1 -1
- package/src/app/components/ui/tabs.tsx +1 -1
- package/src/app/components/ui/textarea.tsx +1 -1
- package/src/app/components/ui/toggle-group.tsx +2 -2
- package/src/app/components/ui/toggle.tsx +1 -1
- package/src/app/components/ui/tooltip.tsx +1 -1
- package/src/app/frame/main.tsx +3 -1
- package/src/app/lib/themes.ts +1 -0
- package/src/app/lib/use-restart-server.ts +1 -1
- package/src/app/routes/home-shell.tsx +7 -7
- package/src/app/routes/home.tsx +5 -5
- package/src/app/routes/page.tsx +2 -2
- package/src/app/routes/themes.tsx +1 -1
- package/src/app/virtual.d.ts +3 -0
- package/dist/export-B-kBRWB1.js +0 -4
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from 'lucide-react';
|
|
23
23
|
import { useDeferredValue, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
24
24
|
import { toast } from 'sonner';
|
|
25
|
-
import { Button, buttonVariants } from '
|
|
25
|
+
import { Button, buttonVariants } from '~/components/ui/button';
|
|
26
26
|
import {
|
|
27
27
|
Dialog,
|
|
28
28
|
DialogContent,
|
|
@@ -30,23 +30,23 @@ import {
|
|
|
30
30
|
DialogFooter,
|
|
31
31
|
DialogHeader,
|
|
32
32
|
DialogTitle,
|
|
33
|
-
} from '
|
|
33
|
+
} from '~/components/ui/dialog';
|
|
34
34
|
import {
|
|
35
35
|
DropdownMenu,
|
|
36
36
|
DropdownMenuContent,
|
|
37
37
|
DropdownMenuItem,
|
|
38
38
|
DropdownMenuTrigger,
|
|
39
|
-
} from '
|
|
39
|
+
} from '~/components/ui/dropdown-menu';
|
|
40
40
|
import {
|
|
41
41
|
Select,
|
|
42
42
|
SelectContent,
|
|
43
43
|
SelectItem,
|
|
44
44
|
SelectTrigger,
|
|
45
45
|
SelectValue,
|
|
46
|
-
} from '
|
|
47
|
-
import { Slider } from '
|
|
48
|
-
import { Tabs, TabsList, TabsTrigger } from '
|
|
49
|
-
import { ToggleGroup, ToggleGroupItem } from '
|
|
46
|
+
} from '~/components/ui/select';
|
|
47
|
+
import { Slider } from '~/components/ui/slider';
|
|
48
|
+
import { Tabs, TabsList, TabsTrigger } from '~/components/ui/tabs';
|
|
49
|
+
import { ToggleGroup, ToggleGroupItem } from '~/components/ui/toggle-group';
|
|
50
50
|
import {
|
|
51
51
|
type AssetSortDirection,
|
|
52
52
|
type AssetSortKey,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
type AssetUsageFilter,
|
|
56
56
|
filterAssets,
|
|
57
57
|
sortAssets,
|
|
58
|
-
} from '
|
|
58
|
+
} from '~/lib/asset-filter';
|
|
59
59
|
import {
|
|
60
60
|
type AssetEntry,
|
|
61
61
|
type AssetUsage,
|
|
@@ -66,9 +66,9 @@ import {
|
|
|
66
66
|
type SvglItem,
|
|
67
67
|
searchSvgl,
|
|
68
68
|
useAssets,
|
|
69
|
-
} from '
|
|
70
|
-
import { format, useLocale } from '
|
|
71
|
-
import { cn } from '
|
|
69
|
+
} from '~/lib/assets';
|
|
70
|
+
import { format, useLocale } from '~/lib/use-locale';
|
|
71
|
+
import { cn } from '~/lib/utils';
|
|
72
72
|
|
|
73
73
|
type Props = { pageId: string | null };
|
|
74
74
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Check, Languages, Loader2, Monitor, Moon, RotateCw, Search, Sun } from 'lucide-react';
|
|
2
2
|
import { useTheme } from 'next-themes';
|
|
3
3
|
import { type ReactNode, useEffect, useMemo, useState } from 'react';
|
|
4
|
-
import { IconTooltip } from '
|
|
5
|
-
import { buttonVariants } from '
|
|
6
|
-
import { TooltipTrigger } from '
|
|
7
|
-
import { LOCALE_OPTIONS, setLocale } from '
|
|
8
|
-
import { format, useLocale } from '
|
|
9
|
-
import { useRestartServer } from '
|
|
4
|
+
import { IconTooltip } from '~/components/icon-tooltip';
|
|
5
|
+
import { buttonVariants } from '~/components/ui/button';
|
|
6
|
+
import { TooltipTrigger } from '~/components/ui/tooltip';
|
|
7
|
+
import { LOCALE_OPTIONS, setLocale } from '~/lib/locale-store';
|
|
8
|
+
import { format, useLocale } from '~/lib/use-locale';
|
|
9
|
+
import { useRestartServer } from '~/lib/use-restart-server';
|
|
10
10
|
import {
|
|
11
11
|
Command,
|
|
12
12
|
CommandDialog,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
2
|
import { Search } from 'lucide-react';
|
|
3
3
|
import type * as React from 'react';
|
|
4
|
-
import { Dialog, DialogContent, DialogDescription, DialogTitle } from '
|
|
5
|
-
import { cn } from '
|
|
4
|
+
import { Dialog, DialogContent, DialogDescription, DialogTitle } from '~/components/ui/dialog';
|
|
5
|
+
import { cn } from '~/lib/utils';
|
|
6
6
|
|
|
7
7
|
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
|
8
8
|
return (
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Image as ImageIcon, Palette, Presentation } from 'lucide-react';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { useNavigate } from 'react-router-dom';
|
|
4
|
-
import { useLocale } from '
|
|
5
|
-
import { usePageTitles } from '
|
|
4
|
+
import { useLocale } from '~/lib/use-locale';
|
|
5
|
+
import { usePageTitles } from '~/lib/use-page-titles';
|
|
6
6
|
import { pageIds } from '../../lib/pages';
|
|
7
7
|
import type { Folder } from '../../lib/sdk';
|
|
8
8
|
import { FolderIconChip } from '../sidebar/folder-item';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import { Tooltip, TooltipContent, TooltipProvider } from '
|
|
2
|
+
import { Tooltip, TooltipContent, TooltipProvider } from '~/components/ui/tooltip';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Shared hover label for the toolbar icon buttons. `children` supplies the
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Languages } from 'lucide-react';
|
|
2
|
-
import { IconTooltip } from '
|
|
3
|
-
import { buttonVariants } from '
|
|
2
|
+
import { IconTooltip } from '~/components/icon-tooltip';
|
|
3
|
+
import { buttonVariants } from '~/components/ui/button';
|
|
4
4
|
import {
|
|
5
5
|
DropdownMenu,
|
|
6
6
|
DropdownMenuContent,
|
|
7
7
|
DropdownMenuItem,
|
|
8
8
|
DropdownMenuTrigger,
|
|
9
|
-
} from '
|
|
10
|
-
import { TooltipTrigger } from '
|
|
11
|
-
import { LOCALE_OPTIONS, setLocale } from '
|
|
12
|
-
import { useLocale } from '
|
|
13
|
-
import { cn } from '
|
|
9
|
+
} from '~/components/ui/dropdown-menu';
|
|
10
|
+
import { TooltipTrigger } from '~/components/ui/tooltip';
|
|
11
|
+
import { LOCALE_OPTIONS, setLocale } from '~/lib/locale-store';
|
|
12
|
+
import { useLocale } from '~/lib/use-locale';
|
|
13
|
+
import { cn } from '~/lib/utils';
|
|
14
14
|
|
|
15
15
|
export function LanguageToggle() {
|
|
16
16
|
const t = useLocale();
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
DropdownMenuContent,
|
|
6
6
|
DropdownMenuItem,
|
|
7
7
|
DropdownMenuTrigger,
|
|
8
|
-
} from '
|
|
9
|
-
import { Popover, PopoverContent, PopoverTrigger } from '
|
|
10
|
-
import type { Folder, FolderIcon } from '
|
|
11
|
-
import { useLocale } from '
|
|
12
|
-
import { cn } from '
|
|
8
|
+
} from '~/components/ui/dropdown-menu';
|
|
9
|
+
import { Popover, PopoverContent, PopoverTrigger } from '~/components/ui/popover';
|
|
10
|
+
import type { Folder, FolderIcon } from '~/lib/sdk';
|
|
11
|
+
import { useLocale } from '~/lib/use-locale';
|
|
12
|
+
import { cn } from '~/lib/utils';
|
|
13
13
|
import { IconPicker } from './icon-picker';
|
|
14
14
|
|
|
15
15
|
export const DOC_DND_MIME = 'application/x-page-id';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EmojiPicker, { EmojiStyle, Theme } from 'emoji-picker-react';
|
|
2
|
-
import { Tabs, TabsContent, TabsList, TabsTrigger } from '
|
|
3
|
-
import type { FolderIcon } from '
|
|
4
|
-
import { useLocale } from '
|
|
2
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '~/components/ui/tabs';
|
|
3
|
+
import type { FolderIcon } from '~/lib/sdk';
|
|
4
|
+
import { useLocale } from '~/lib/use-locale';
|
|
5
5
|
|
|
6
6
|
export const PRESET_COLORS = [
|
|
7
7
|
'#e5484d', // red
|
|
@@ -2,10 +2,10 @@ import config from 'virtual:open-pages/config';
|
|
|
2
2
|
import { Loader2, RefreshCw, RotateCw } from 'lucide-react';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { toast } from 'sonner';
|
|
5
|
-
import { Button } from '
|
|
6
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '
|
|
7
|
-
import { format, useLocale } from '
|
|
8
|
-
import { useRestartServer } from '
|
|
5
|
+
import { Button } from '~/components/ui/button';
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '~/components/ui/tooltip';
|
|
7
|
+
import { format, useLocale } from '~/lib/use-locale';
|
|
8
|
+
import { useRestartServer } from '~/lib/use-restart-server';
|
|
9
9
|
|
|
10
10
|
type UpdateCheck = { current: string; latest: string | null; outdated: boolean };
|
|
11
11
|
type UpdateStatus = 'idle' | 'running' | 'done' | 'error';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Plus } from 'lucide-react';
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { toast } from 'sonner';
|
|
4
|
-
import { LanguageToggle } from '
|
|
5
|
-
import { ThemeToggle } from '
|
|
6
|
-
import { Popover, PopoverContent, PopoverTrigger } from '
|
|
7
|
-
import type { Folder, FolderIcon } from '
|
|
8
|
-
import { format, useLocale } from '
|
|
9
|
-
import { cn } from '
|
|
4
|
+
import { LanguageToggle } from '~/components/language-toggle';
|
|
5
|
+
import { ThemeToggle } from '~/components/theme-toggle';
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from '~/components/ui/popover';
|
|
7
|
+
import type { Folder, FolderIcon } from '~/lib/sdk';
|
|
8
|
+
import { format, useLocale } from '~/lib/use-locale';
|
|
9
|
+
import { cn } from '~/lib/utils';
|
|
10
10
|
import { CommandMenuTrigger } from '../command/command-menu';
|
|
11
11
|
import { FolderIconChip, FolderItem } from './folder-item';
|
|
12
12
|
import { IconPicker, PRESET_COLORS } from './icon-picker';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Monitor, Moon, Sun } from 'lucide-react';
|
|
2
2
|
import { useTheme } from 'next-themes';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
|
-
import { IconTooltip } from '
|
|
5
|
-
import { buttonVariants } from '
|
|
4
|
+
import { IconTooltip } from '~/components/icon-tooltip';
|
|
5
|
+
import { buttonVariants } from '~/components/ui/button';
|
|
6
6
|
import {
|
|
7
7
|
DropdownMenu,
|
|
8
8
|
DropdownMenuContent,
|
|
9
9
|
DropdownMenuItem,
|
|
10
10
|
DropdownMenuTrigger,
|
|
11
|
-
} from '
|
|
12
|
-
import { TooltipTrigger } from '
|
|
13
|
-
import { useLocale } from '
|
|
14
|
-
import { cn } from '
|
|
11
|
+
} from '~/components/ui/dropdown-menu';
|
|
12
|
+
import { TooltipTrigger } from '~/components/ui/tooltip';
|
|
13
|
+
import { useLocale } from '~/lib/use-locale';
|
|
14
|
+
import { cn } from '~/lib/utils';
|
|
15
15
|
|
|
16
16
|
export function ThemeToggle() {
|
|
17
17
|
const { theme, setTheme } = useTheme();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChevronDown, ChevronLeft } from 'lucide-react';
|
|
2
2
|
import { Fragment, type ReactNode, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
|
-
import { Button } from '
|
|
5
|
-
import { useLocale } from '
|
|
6
|
-
import { cn } from '
|
|
4
|
+
import { Button } from '~/components/ui/button';
|
|
5
|
+
import { useLocale } from '~/lib/use-locale';
|
|
6
|
+
import { cn } from '~/lib/utils';
|
|
7
7
|
import { frameUrl } from '../../lib/frame';
|
|
8
8
|
import { PageThumb } from '../../lib/page-thumb';
|
|
9
9
|
import { loadPage, pageKinds, pagesByTheme } from '../../lib/pages';
|
|
@@ -174,7 +174,7 @@ function ThemeDocCard({ id }: { id: string }) {
|
|
|
174
174
|
|
|
175
175
|
const PROMPT_COLLAPSED_PX = 320;
|
|
176
176
|
|
|
177
|
-
const HEX_RE = /#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})\b/g;
|
|
177
|
+
const HEX_RE = /#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})\b|oklch\([^)]*\)/g;
|
|
178
178
|
|
|
179
179
|
function renderBodyWithSwatches(body: string): ReactNode[] {
|
|
180
180
|
const out: ReactNode[] = [];
|
|
@@ -3,7 +3,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
4
4
|
import { useRender } from '@base-ui/react/use-render';
|
|
5
5
|
|
|
6
|
-
import { cn } from '
|
|
6
|
+
import { cn } from '~/lib/utils';
|
|
7
7
|
|
|
8
8
|
const badgeVariants = cva(
|
|
9
9
|
'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!',
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
4
4
|
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from '~/lib/utils';
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
* Editorial button. Tight square-ish radius, hairline borders instead of
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
5
5
|
import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';
|
|
6
6
|
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from '~/lib/utils';
|
|
8
8
|
|
|
9
9
|
function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
10
10
|
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { XIcon } from 'lucide-react';
|
|
2
2
|
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
3
3
|
import type * as React from 'react';
|
|
4
|
-
import { Button } from '
|
|
5
|
-
import { cn } from '
|
|
4
|
+
import { Button } from '~/components/ui/button';
|
|
5
|
+
import { cn } from '~/lib/utils';
|
|
6
6
|
|
|
7
7
|
function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
8
8
|
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
5
5
|
import { Menu as DropdownMenuPrimitive } from '@base-ui/react/menu';
|
|
6
6
|
|
|
7
|
-
import { cn } from '
|
|
7
|
+
import { cn } from '~/lib/utils';
|
|
8
8
|
|
|
9
9
|
type DropdownMenuPositionerProps = Pick<
|
|
10
10
|
React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
3
3
|
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from '~/lib/utils';
|
|
5
5
|
|
|
6
6
|
function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
7
7
|
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
|
|
@@ -4,7 +4,7 @@ import * as React from "react"
|
|
|
4
4
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
5
5
|
import { Select as SelectPrimitive } from "@base-ui/react/select"
|
|
6
6
|
|
|
7
|
-
import { cn } from "
|
|
7
|
+
import { cn } from "~/lib/utils"
|
|
8
8
|
|
|
9
9
|
const Select = SelectPrimitive.Root
|
|
10
10
|
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
|
|
4
4
|
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from '~/lib/utils';
|
|
6
6
|
|
|
7
7
|
function Tabs({
|
|
8
8
|
className,
|
|
@@ -5,8 +5,8 @@ import { type VariantProps } from "class-variance-authority"
|
|
|
5
5
|
import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group"
|
|
6
6
|
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
|
|
7
7
|
|
|
8
|
-
import { cn } from "
|
|
9
|
-
import { toggleVariants } from "
|
|
8
|
+
import { cn } from "~/lib/utils"
|
|
9
|
+
import { toggleVariants } from "~/components/ui/toggle"
|
|
10
10
|
|
|
11
11
|
const ToggleGroupContext = React.createContext<
|
|
12
12
|
VariantProps<typeof toggleVariants> & {
|
|
@@ -2,7 +2,7 @@ import * as React from "react"
|
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
3
|
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "~/lib/utils"
|
|
6
6
|
|
|
7
7
|
const toggleVariants = cva(
|
|
8
8
|
"inline-flex items-center justify-center gap-2 rounded-[5px] text-[12px] font-medium whitespace-nowrap outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 data-pressed:bg-foreground data-pressed:text-background [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
|
package/src/app/frame/main.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'virtual:open-pages/pages.css';
|
|
2
2
|
import { loadPage } from 'virtual:open-pages/pages';
|
|
3
|
-
import { loadThemeDemo } from 'virtual:open-pages/themes';
|
|
3
|
+
import { loadThemeCss, loadThemeDemo, themeCssIds } from 'virtual:open-pages/themes';
|
|
4
4
|
import { createElement, StrictMode } from 'react';
|
|
5
5
|
import { createRoot } from 'react-dom/client';
|
|
6
6
|
import type { FrameMessage, WorkspaceMessage } from '../lib/frame';
|
|
@@ -59,6 +59,8 @@ async function mount() {
|
|
|
59
59
|
`${themeId ? `themes/${themeId}.demo.tsx` : `pages/${pageId}/index.tsx`} must default-export a component. Got: ${typeof mod.default}`,
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
+
const theme = themeId ?? mod.meta?.theme;
|
|
63
|
+
if (theme && themeCssIds.includes(theme)) await loadThemeCss(theme);
|
|
62
64
|
const title = mod.meta?.title ?? pageId ?? themeId ?? '';
|
|
63
65
|
document.title = title;
|
|
64
66
|
root.render(createElement(StrictMode, null, createElement(mod.default)));
|
package/src/app/lib/themes.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useSyncExternalStore } from 'react';
|
|
2
2
|
import { toast } from 'sonner';
|
|
3
|
-
import { useLocale } from '
|
|
3
|
+
import { useLocale } from '~/lib/use-locale';
|
|
4
4
|
|
|
5
5
|
type ServerStatus = { executionId: string; canRestart: boolean };
|
|
6
6
|
|
|
@@ -2,18 +2,18 @@ import { Menu } from 'lucide-react';
|
|
|
2
2
|
import { useCallback, useMemo, useState } from 'react';
|
|
3
3
|
import { Outlet, useLocation, useNavigate, useSearchParams } from 'react-router-dom';
|
|
4
4
|
import { toast } from 'sonner';
|
|
5
|
-
import { LanguageToggle } from '
|
|
6
|
-
import { ThemeToggle } from '
|
|
5
|
+
import { LanguageToggle } from '~/components/language-toggle';
|
|
6
|
+
import { ThemeToggle } from '~/components/theme-toggle';
|
|
7
7
|
import {
|
|
8
8
|
DropdownMenu,
|
|
9
9
|
DropdownMenuContent,
|
|
10
10
|
DropdownMenuItem,
|
|
11
11
|
DropdownMenuTrigger,
|
|
12
|
-
} from '
|
|
13
|
-
import { useAssets } from '
|
|
14
|
-
import { useFolders } from '
|
|
15
|
-
import { format, useLocale } from '
|
|
16
|
-
import { cn } from '
|
|
12
|
+
} from '~/components/ui/dropdown-menu';
|
|
13
|
+
import { useAssets } from '~/lib/assets';
|
|
14
|
+
import { useFolders } from '~/lib/folders';
|
|
15
|
+
import { format, useLocale } from '~/lib/use-locale';
|
|
16
|
+
import { cn } from '~/lib/utils';
|
|
17
17
|
import { CommandMenuTrigger } from '../components/command/command-menu';
|
|
18
18
|
import { HomeCommandMenu } from '../components/command/home-command-menu';
|
|
19
19
|
import { FolderIconChip } from '../components/sidebar/folder-item';
|
package/src/app/routes/home.tsx
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
16
16
|
import { Link, useOutletContext } from 'react-router-dom';
|
|
17
17
|
import { toast } from 'sonner';
|
|
18
|
-
import { Button } from '
|
|
18
|
+
import { Button } from '~/components/ui/button';
|
|
19
19
|
import {
|
|
20
20
|
Dialog,
|
|
21
21
|
DialogContent,
|
|
@@ -23,15 +23,15 @@ import {
|
|
|
23
23
|
DialogFooter,
|
|
24
24
|
DialogHeader,
|
|
25
25
|
DialogTitle,
|
|
26
|
-
} from '
|
|
26
|
+
} from '~/components/ui/dialog';
|
|
27
27
|
import {
|
|
28
28
|
DropdownMenu,
|
|
29
29
|
DropdownMenuContent,
|
|
30
30
|
DropdownMenuItem,
|
|
31
31
|
DropdownMenuTrigger,
|
|
32
|
-
} from '
|
|
33
|
-
import { format, useLocale } from '
|
|
34
|
-
import { cn } from '
|
|
32
|
+
} from '~/components/ui/dropdown-menu';
|
|
33
|
+
import { format, useLocale } from '~/lib/use-locale';
|
|
34
|
+
import { cn } from '~/lib/utils';
|
|
35
35
|
import { DOC_DND_MIME, FolderIconChip } from '../components/sidebar/folder-item';
|
|
36
36
|
import { ALL_DOCS_ID, DRAFT_ID } from '../components/sidebar/sidebar';
|
|
37
37
|
import { PageThumb } from '../lib/page-thumb';
|
package/src/app/routes/page.tsx
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15
15
|
import { Link, useParams } from 'react-router-dom';
|
|
16
16
|
import { toast } from 'sonner';
|
|
17
|
-
import { Button } from '
|
|
18
|
-
import { cn } from '
|
|
17
|
+
import { Button } from '~/components/ui/button';
|
|
18
|
+
import { cn } from '~/lib/utils';
|
|
19
19
|
import { type FrameMessage, frameUrl, isFrameMessage, type WorkspaceMessage } from '../lib/frame';
|
|
20
20
|
import { pageChangeIncludes, pageIds, pageKinds } from '../lib/pages';
|
|
21
21
|
import { usePageModule } from '../lib/use-page-module';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useNavigate, useParams } from 'react-router-dom';
|
|
2
|
-
import { useLocale } from '
|
|
2
|
+
import { useLocale } from '~/lib/use-locale';
|
|
3
3
|
import { FolderIconChip } from '../components/sidebar/folder-item';
|
|
4
4
|
import { ThemeDetail } from '../components/themes/theme-detail';
|
|
5
5
|
import { ThemesGallery } from '../components/themes/themes-gallery';
|
package/src/app/virtual.d.ts
CHANGED
|
@@ -43,9 +43,12 @@ declare module 'virtual:open-pages/themes' {
|
|
|
43
43
|
description: string;
|
|
44
44
|
body: string;
|
|
45
45
|
hasDemo: boolean;
|
|
46
|
+
hasCss: boolean;
|
|
46
47
|
};
|
|
47
48
|
|
|
48
49
|
export const themes: ThemeMeta[];
|
|
50
|
+
export const themeCssIds: string[];
|
|
51
|
+
export function loadThemeCss(id: string): Promise<void>;
|
|
49
52
|
export function loadThemeDemo(id: string): Promise<{
|
|
50
53
|
default: PageComponent;
|
|
51
54
|
design?: DesignSystem;
|
package/dist/export-B-kBRWB1.js
DELETED