@treenity/react 3.0.4 → 3.0.7

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.
Files changed (101) hide show
  1. package/dist/AclEditor.js +3 -3
  2. package/dist/ActionCards.js +5 -5
  3. package/dist/App.d.ts.map +1 -1
  4. package/dist/App.js +9 -8
  5. package/dist/App.js.map +1 -1
  6. package/dist/CLAUDE.md +16 -0
  7. package/dist/ComponentSection.js +4 -4
  8. package/dist/ComponentSection.js.map +1 -1
  9. package/dist/ErrorBoundary.js +1 -1
  10. package/dist/Inspector.css +54 -0
  11. package/dist/Inspector.js +9 -9
  12. package/dist/Inspector.js.map +1 -1
  13. package/dist/Login.js +4 -4
  14. package/dist/NodeEditor.d.ts.map +1 -1
  15. package/dist/NodeEditor.js +10 -9
  16. package/dist/NodeEditor.js.map +1 -1
  17. package/dist/Tree.css +91 -0
  18. package/dist/Tree.js +3 -3
  19. package/dist/Treenity.d.ts +0 -1
  20. package/dist/Treenity.d.ts.map +1 -1
  21. package/dist/Treenity.js +1 -1
  22. package/dist/Treenity.js.map +1 -1
  23. package/dist/ViewPage.js +1 -1
  24. package/dist/bind/engine.js +2 -2
  25. package/dist/bind/hook.js +2 -2
  26. package/dist/components/ConfirmDialog.js +1 -1
  27. package/dist/components/ConfirmPopover.js +2 -2
  28. package/dist/components/PathBreadcrumb.js +1 -1
  29. package/dist/components/lib/utils.ts.bak +6 -0
  30. package/dist/components/ui/accordion.js +1 -1
  31. package/dist/components/ui/alert-dialog.js +2 -2
  32. package/dist/components/ui/badge.js +1 -1
  33. package/dist/components/ui/breadcrumb.js +1 -1
  34. package/dist/components/ui/button.js +1 -1
  35. package/dist/components/ui/card.js +1 -1
  36. package/dist/components/ui/checkbox.js +1 -1
  37. package/dist/components/ui/command.js +2 -2
  38. package/dist/components/ui/dialog.js +2 -2
  39. package/dist/components/ui/drawer.js +1 -1
  40. package/dist/components/ui/dropdown-menu.js +1 -1
  41. package/dist/components/ui/form-field.js +1 -1
  42. package/dist/components/ui/input.js +1 -1
  43. package/dist/components/ui/label.js +1 -1
  44. package/dist/components/ui/pagination.js +2 -2
  45. package/dist/components/ui/popover.js +1 -1
  46. package/dist/components/ui/progress.js +1 -1
  47. package/dist/components/ui/resizable.js +1 -1
  48. package/dist/components/ui/scroll-area.js +1 -1
  49. package/dist/components/ui/select.js +1 -1
  50. package/dist/components/ui/separator.js +1 -1
  51. package/dist/components/ui/sheet.js +1 -1
  52. package/dist/components/ui/skeleton.js +1 -1
  53. package/dist/components/ui/slider.js +1 -1
  54. package/dist/components/ui/switch.js +1 -1
  55. package/dist/components/ui/table.js +1 -1
  56. package/dist/components/ui/tabs.js +1 -1
  57. package/dist/components/ui/textarea.js +1 -1
  58. package/dist/components/ui/toggle-group.js +2 -2
  59. package/dist/components/ui/toggle.js +1 -1
  60. package/dist/components/ui/tooltip.js +1 -1
  61. package/dist/context/index.js +2 -2
  62. package/dist/lib/minimd.css +28 -0
  63. package/dist/mods/editor-ui/CLAUDE.md +3 -0
  64. package/dist/mods/editor-ui/DraftTextarea.d.ts +8 -0
  65. package/dist/mods/editor-ui/DraftTextarea.d.ts.map +1 -0
  66. package/dist/mods/editor-ui/DraftTextarea.js +23 -0
  67. package/dist/mods/editor-ui/DraftTextarea.js.map +1 -0
  68. package/dist/mods/editor-ui/FieldLabel.js +2 -2
  69. package/dist/mods/editor-ui/default-edit.js +3 -3
  70. package/dist/mods/editor-ui/default-view.js +4 -4
  71. package/dist/mods/editor-ui/dir-view.js +2 -2
  72. package/dist/mods/editor-ui/editor-ui.css +174 -0
  73. package/dist/mods/editor-ui/empty-placeholder.js +2 -2
  74. package/dist/mods/editor-ui/form-field.js +5 -5
  75. package/dist/mods/editor-ui/form-field.js.map +1 -1
  76. package/dist/mods/editor-ui/form-fields.d.ts.map +1 -1
  77. package/dist/mods/editor-ui/form-fields.js +17 -16
  78. package/dist/mods/editor-ui/form-fields.js.map +1 -1
  79. package/dist/mods/editor-ui/layout-view.js +2 -2
  80. package/dist/mods/editor-ui/list-items.js +1 -1
  81. package/dist/mods/editor-ui/node-utils.js +1 -1
  82. package/dist/mods/editor-ui/node-utils.js.map +1 -1
  83. package/dist/mods/editor-ui/type-picker.js +5 -5
  84. package/dist/mods/treenity/CLAUDE.md +7 -0
  85. package/dist/mods/treenity/groups/index.js +3 -3
  86. package/dist/mods/treenity/preview.js +2 -2
  87. package/dist/mods/treenity/ref-view.js +3 -3
  88. package/dist/root.css +117 -0
  89. package/dist/trpc.d.ts +8 -0
  90. package/dist/trpc.d.ts.map +1 -1
  91. package/package.json +2 -2
  92. package/src/App.tsx +3 -2
  93. package/src/ComponentSection.tsx +1 -1
  94. package/src/Inspector.tsx +2 -2
  95. package/src/NodeEditor.tsx +3 -2
  96. package/src/Treenity.tsx +1 -1
  97. package/src/mods/editor-ui/DraftTextarea.tsx +42 -0
  98. package/src/mods/editor-ui/form-field.tsx +4 -4
  99. package/src/mods/editor-ui/form-fields.tsx +11 -10
  100. package/src/mods/editor-ui/node-utils.ts +1 -1
  101. package/vite-plugin-treenity.ts +7 -1
package/dist/ViewPage.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // ViewPage — standalone read-only node view at /{path}
3
- import { Render, RenderContext } from '#context';
3
+ import { Render, RenderContext } from './context.js';
4
4
  import { usePath } from './hooks';
5
5
  export function ViewPage({ path, editorLink }) {
6
6
  const node = usePath(path);
@@ -1,8 +1,8 @@
1
1
  // Binding engine — scans cache for $ref+$map fields, subscribes to sources,
2
2
  // evaluates on change, writes to computed store.
3
3
  // Supports $ref: "." (self) and @/path.field ref args in $map expressions.
4
- import * as cache from '#cache';
5
- import { trpc } from '#trpc';
4
+ import * as cache from '../cache.js';
5
+ import { trpc } from '../trpc.js';
6
6
  import { isRef } from '@treenity/core';
7
7
  import { clearComputed, getComputed, setComputed } from './computed';
8
8
  import { evaluateRef, extractArgPaths, hasOnce, isCollectionRef } from './eval';
package/dist/bind/hook.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // React hooks for computed bindings
2
- import * as cache from '#cache';
3
- import { set, usePath } from '#hooks';
2
+ import * as cache from '../cache.js';
3
+ import { set, usePath } from '../hooks.js';
4
4
  import { isRef } from '@treenity/core';
5
5
  import { useCallback, useMemo, useSyncExternalStore } from 'react';
6
6
  import { useSnapshot } from 'valtio';
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '#components/ui/alert-dialog';
2
+ import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './ui/alert-dialog.js';
3
3
  export function ConfirmDialog({ open, onOpenChange, title, description, onConfirm, variant = 'default' }) {
4
4
  return (_jsx(AlertDialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: title }), description && _jsx(AlertDialogDescription, { children: description })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { variant: variant, onClick: onConfirm, children: "Confirm" })] })] }) }));
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button } from '#components/ui/button';
3
- import { Popover, PopoverContent, PopoverTrigger } from '#components/ui/popover';
2
+ import { Button } from './ui/button.js';
3
+ import { Popover, PopoverContent, PopoverTrigger } from './ui/popover.js';
4
4
  import { useState } from 'react';
5
5
  export function ConfirmPopover({ title, onConfirm, variant = 'default', children, }) {
6
6
  const [open, setOpen] = useState(false);
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from '#components/ui/breadcrumb';
2
+ import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from './ui/breadcrumb.js';
3
3
  export function PathBreadcrumb({ path, onSelect }) {
4
4
  const parts = path.split('/').filter(Boolean);
5
5
  const crumbs = [{ label: 'root', path: '/' }];
@@ -0,0 +1,6 @@
1
+ import { type ClassValue, clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { ChevronDownIcon } from 'lucide-react';
4
4
  import { Accordion as AccordionPrimitive } from 'radix-ui';
5
5
  function Accordion({ ...props }) {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
3
- import { buttonVariants } from '#components/ui/button';
2
+ import { cn } from '../lib/utils.js';
3
+ import { buttonVariants } from './button.js';
4
4
  import { AlertDialog as AlertDialogPrimitive } from 'radix-ui';
5
5
  function AlertDialog({ ...props }) {
6
6
  return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { cva } from 'class-variance-authority';
4
4
  const badgeVariants = cva('inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', {
5
5
  variants: {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { ChevronRight, MoreHorizontal } from 'lucide-react';
4
4
  import { Slot } from 'radix-ui';
5
5
  function Breadcrumb({ ...props }) {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { Slot } from 'radix-ui';
5
5
  const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  function Card({ className, ...props }) {
4
4
  return (_jsx("div", { "data-slot": "card", className: cn("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm", className), ...props }));
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { forwardRef } from 'react';
4
4
  const Checkbox = forwardRef(({ className, ...props }, ref) => (_jsx("input", { type: "checkbox", className: cn('h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 accent-primary', className), ref: ref, ...props })));
5
5
  Checkbox.displayName = 'Checkbox';
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
4
- import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '#components/ui/dialog';
3
+ import { cn } from '../lib/utils.js';
4
+ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './dialog.js';
5
5
  import { Command as CommandPrimitive } from 'cmdk';
6
6
  import { SearchIcon } from 'lucide-react';
7
7
  function Command({ className, ...props }) {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
3
- import { Button } from '#components/ui/button';
2
+ import { cn } from '../lib/utils.js';
3
+ import { Button } from './button.js';
4
4
  import { XIcon } from 'lucide-react';
5
5
  import { Dialog as DialogPrimitive } from 'radix-ui';
6
6
  function Dialog({ ...props }) {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { Drawer as DrawerPrimitive } from 'vaul';
4
4
  function Drawer({ ...props }) {
5
5
  return _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", ...props });
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
5
5
  import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
6
6
  function DropdownMenu({ ...props }) {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // Adaptive form field — label left when content is short, label on top when tall
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  import { useLayoutEffect, useRef, useState } from 'react';
5
5
  const STACK_THRESHOLD = 48; // px — above this, label goes on top
6
6
  export function FormField({ label, labelClass, className, children }) {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { forwardRef } from 'react';
4
4
  const Input = forwardRef(({ className, type, ...props }, ref) => (_jsx("input", { type: type, className: cn('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', className), ref: ref, ...props })));
5
5
  Input.displayName = 'Input';
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { Label as LabelPrimitive } from 'radix-ui';
4
4
  function Label({ className, ...props }) {
5
5
  return (_jsx(LabelPrimitive.Root, { "data-slot": "label", className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className), ...props }));
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
3
- import { buttonVariants } from '#components/ui/button';
2
+ import { cn } from '../lib/utils.js';
3
+ import { buttonVariants } from './button.js';
4
4
  import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
5
5
  function Pagination({ className, ...props }) {
6
6
  return (_jsx("nav", { role: "navigation", "aria-label": "pagination", "data-slot": "pagination", className: cn("mx-auto flex w-full justify-center", className), ...props }));
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { Popover as PopoverPrimitive } from 'radix-ui';
4
4
  function Popover({ ...props }) {
5
5
  return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  import { Progress as ProgressPrimitive } from 'radix-ui';
5
5
  function Progress({ className, value, ...props }) {
6
6
  return (_jsx(ProgressPrimitive.Root, { "data-slot": "progress", className: cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className), ...props, children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: "bg-primary h-full w-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) }));
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import * as ResizablePrimitive from 'react-resizable-panels';
4
4
  function ResizablePanelGroup({ className, ...props }) {
5
5
  return (_jsx(ResizablePrimitive.Group, { "data-slot": "resizable-panel-group", className: cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className), ...props }));
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';
4
4
  function ScrollArea({ className, children, ...props }) {
5
5
  return (_jsxs(ScrollAreaPrimitive.Root, { "data-slot": "scroll-area", className: cn("relative", className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { "data-slot": "scroll-area-viewport", className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1", children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] }));
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
5
5
  import { Select as SelectPrimitive } from 'radix-ui';
6
6
  function Select({ ...props }) {
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  import { Separator as SeparatorPrimitive } from 'radix-ui';
5
5
  function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
6
6
  return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className), ...props }));
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { XIcon } from 'lucide-react';
4
4
  import { Dialog as SheetPrimitive } from 'radix-ui';
5
5
  function Sheet({ ...props }) {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  function Skeleton({ className, ...props }) {
4
4
  return (_jsx("div", { "data-slot": "skeleton", className: cn("animate-pulse rounded-md bg-accent", className), ...props }));
5
5
  }
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  import { Slider as SliderPrimitive } from 'radix-ui';
5
5
  import * as React from 'react';
6
6
  function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  import { Switch as SwitchPrimitive } from 'radix-ui';
5
5
  function Switch({ className, size = "default", ...props }) {
6
6
  return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: cn("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0") }) }));
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  function Table({ className, ...props }) {
5
5
  return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { Tabs as TabsPrimitive } from 'radix-ui';
5
5
  function Tabs({ className, orientation = "horizontal", ...props }) {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '#components/lib/utils';
2
+ import { cn } from '../lib/utils.js';
3
3
  function Textarea({ className, ...props }) {
4
4
  return (_jsx("textarea", { "data-slot": "textarea", className: cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 max-h-64 overflow-y-auto w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className), ...props }));
5
5
  }
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
4
- import { toggleVariants } from '#components/ui/toggle';
3
+ import { cn } from '../lib/utils.js';
4
+ import { toggleVariants } from './toggle.js';
5
5
  import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
6
6
  import * as React from 'react';
7
7
  const ToggleGroupContext = React.createContext({
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import { Toggle as TogglePrimitive } from 'radix-ui';
6
6
  const toggleVariants = cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cn } from '#components/lib/utils';
3
+ import { cn } from '../lib/utils.js';
4
4
  import { Tooltip as TooltipPrimitive } from 'radix-ui';
5
5
  function TooltipProvider({ delayDuration = 0, ...props }) {
6
6
  return (_jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delayDuration: delayDuration, ...props }));
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // Treenity React Binding — Layer 2
3
3
  // <Render> + <RenderContext> + <NodeProvider>
4
4
  // Depends on: core (resolve), React
5
- import { execute } from '#hooks';
6
- import { $key, $node } from '#symbols';
5
+ import { execute } from '../hooks.js';
6
+ import { $key, $node } from '../symbols.js';
7
7
  import { hasMissResolver, resolve, resolveExact, subscribeRegistry, } from '@treenity/core';
8
8
  import { createContext, createElement, useContext, useEffect, useMemo, useState } from 'react';
9
9
  // ── Tree context (rendering context string) ──
@@ -0,0 +1,28 @@
1
+ /* minimd — lightweight markdown rendering */
2
+ .minimd *:first-child { margin-top: 0; }
3
+ .minimd h1, .minimd h2, .minimd h3 { font-weight: 600; margin: 14px 0 6px; color: var(--text); }
4
+ .minimd h1 { font-size: 1.3em; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
5
+ .minimd h2 { font-size: 1.15em; }
6
+ .minimd h3 { font-size: 1.05em; color: var(--text-2); }
7
+ .minimd p { margin: 4px 0; }
8
+ .minimd ul, .minimd ol { padding-left: 20px; margin: 4px 0; }
9
+ .minimd li { margin: 2px 0; }
10
+ .minimd li::marker { color: var(--text-3); }
11
+ .minimd code {
12
+ font-family: var(--mono); font-size: 0.88em;
13
+ background: var(--surface-3); padding: 1px 5px; border-radius: 4px; color: #f0abfc;
14
+ }
15
+ .minimd pre {
16
+ background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
17
+ padding: 10px 12px; margin: 8px 0; overflow-x: auto; font-size: 12px; line-height: 1.5;
18
+ }
19
+ .minimd pre code { background: none; padding: 0; color: var(--text); font-size: inherit; }
20
+ .minimd strong { font-weight: 600; }
21
+ .minimd em { color: var(--text-2); }
22
+ .minimd a { color: #58a6ff; text-decoration: none; }
23
+ .minimd a:hover { text-decoration: underline; }
24
+ .minimd blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--text-2); margin: 6px 0; }
25
+ .minimd hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
26
+ .minimd table { border-collapse: collapse; margin: 8px 0; font-size: 12px; width: 100%; }
27
+ .minimd th, .minimd td { border: 1px solid var(--border); padding: 6px 12px; }
28
+ .minimd th { background: var(--surface-3); font-weight: 600; color: var(--text); text-align: left; }
@@ -0,0 +1,3 @@
1
+ # editor-ui
2
+
3
+ View-слой админки. Fallback `react`-рендерер для всех нод/компонентов, специализированные views (layout, page, dir, user, list), schema-driven form fields для NodeEditor.
@@ -0,0 +1,8 @@
1
+ import { Textarea } from '#components/ui/textarea';
2
+ type Props = Omit<React.ComponentProps<typeof Textarea>, 'value' | 'defaultValue' | 'onChange'> & {
3
+ value: string;
4
+ onChange: (text: string) => void;
5
+ };
6
+ export declare const DraftTextarea: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
7
+ export {};
8
+ //# sourceMappingURL=DraftTextarea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DraftTextarea.d.ts","sourceRoot":"","sources":["../../../src/mods/editor-ui/DraftTextarea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,KAAK,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC,GAAG;IAChG,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,aAAa,oHA8BzB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Uncontrolled textarea that preserves cursor position during external re-renders.
3
+ // Uses ref + defaultValue so React never touches the DOM value while user is editing.
4
+ import { Textarea } from '../../components/ui/textarea.js';
5
+ import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
6
+ export const DraftTextarea = forwardRef(({ value, onChange, ...props }, fwd) => {
7
+ const ref = useRef(null);
8
+ const editing = useRef(false);
9
+ useImperativeHandle(fwd, () => ref.current);
10
+ // Sync external value into DOM only when not focused
11
+ useEffect(() => {
12
+ if (!editing.current && ref.current && ref.current.value !== value) {
13
+ ref.current.value = value;
14
+ }
15
+ }, [value]);
16
+ return (_jsx(Textarea, { ref: ref, defaultValue: value, onFocus: () => { editing.current = true; }, onBlur: () => {
17
+ editing.current = false;
18
+ if (ref.current && ref.current.value !== value) {
19
+ ref.current.value = value;
20
+ }
21
+ }, onChange: (e) => onChange(e.target.value), ...props }));
22
+ });
23
+ //# sourceMappingURL=DraftTextarea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DraftTextarea.js","sourceRoot":"","sources":["../../../src/mods/editor-ui/DraftTextarea.tsx"],"names":[],"mappings":";AAAA,mFAAmF;AACnF,sFAAsF;AAEtF,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAO3E,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CACrC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrC,MAAM,GAAG,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAE9B,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,OAAQ,CAAC,CAAC;IAE7C,qDAAqD;IACrD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;YACnE,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CACL,KAAC,QAAQ,IACP,GAAG,EAAE,GAAG,EACR,YAAY,EAAE,KAAK,EACnB,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,EAC1C,MAAM,EAAE,GAAG,EAAE;YACX,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;YACxB,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;gBAC/C,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;YAC5B,CAAC;QACH,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KACrC,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // FieldLabel — interactive label for Inspector fields
3
3
  // Click → dropdown menu (value/$ref/$map + copy/clear), drop target for tree nodes
4
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '#components/ui/dropdown-menu';
5
- import { Input } from '#components/ui/input';
4
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from '../../components/ui/dropdown-menu.js';
5
+ import { Input } from '../../components/ui/input.js';
6
6
  import { isRef } from '@treenity/core';
7
7
  import { useState } from 'react';
8
8
  function getFieldMode(v) {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Checkbox } from '#components/ui/checkbox';
3
- import { Input } from '#components/ui/input';
4
- import { useSchema } from '#schema-loader';
2
+ import { Checkbox } from '../../components/ui/checkbox.js';
3
+ import { Input } from '../../components/ui/input.js';
4
+ import { useSchema } from '../../schema-loader.js';
5
5
  import { isRef, register, resolve } from '@treenity/core';
6
6
  import { createElement } from 'react';
7
7
  import { FieldLabel, RefEditor } from './FieldLabel';
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import './editor-ui.css';
3
- import { Button } from '#components/ui/button';
4
- import { Render, RenderContext } from '#context';
5
- import { useChildren } from '#hooks';
6
- import { trpc } from '#trpc';
3
+ import { Button } from '../../components/ui/button.js';
4
+ import { Render, RenderContext } from '../../context.js';
5
+ import { useChildren } from '../../hooks.js';
6
+ import { trpc } from '../../trpc.js';
7
7
  import { register } from '@treenity/core';
8
8
  import { useCallback, useState } from 'react';
9
9
  import { EmptyNodePlaceholder } from './empty-placeholder';
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Render, RenderContext } from '#context';
3
- import { useChildren } from '#hooks';
2
+ import { Render, RenderContext } from '../../context.js';
3
+ import { useChildren } from '../../hooks.js';
4
4
  const STATUS_COLORS = {
5
5
  draft: ['var(--accent-subtle, #1a2a3a)', 'var(--accent)'],
6
6
  published: ['#1a2e1a', '#4c8'],