elseware-ui 2.31.8 → 2.31.9

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/dist/index.d.mts CHANGED
@@ -1405,33 +1405,12 @@ interface ToggleReactionResult {
1405
1405
  disliked: boolean;
1406
1406
  }
1407
1407
  interface CommentDataSource {
1408
- /**
1409
- * Load comments for a resource
1410
- */
1411
1408
  getComments(): Promise<CommentEntity[]>;
1412
- /**
1413
- * Create root comment or reply
1414
- */
1415
1409
  createComment(input: CreateCommentInput): Promise<CommentEntity>;
1416
- /**
1417
- * Update existing comment
1418
- */
1419
1410
  updateComment(input: UpdateCommentInput): Promise<CommentEntity>;
1420
- /**
1421
- * Delete comment
1422
- */
1423
1411
  deleteComment(commentId: string): Promise<void>;
1424
- /**
1425
- * Toggle like
1426
- */
1427
1412
  toggleLike(commentId: string): Promise<ToggleReactionResult>;
1428
- /**
1429
- * Toggle dislike
1430
- */
1431
1413
  toggleDislike(commentId: string): Promise<ToggleReactionResult>;
1432
- /**
1433
- * Optional report functionality
1434
- */
1435
1414
  reportComment?(commentId: string, reason: string, description?: string): Promise<void>;
1436
1415
  }
1437
1416
 
@@ -1460,11 +1439,19 @@ interface CommentMenuProps {
1460
1439
  }
1461
1440
  interface CommentComposerProps {
1462
1441
  avatar?: string;
1442
+ placeholder?: string;
1443
+ submitLabel?: string;
1444
+ disabled?: boolean;
1445
+ loading?: boolean;
1463
1446
  onSubmit: (content: string) => Promise<void> | void;
1464
1447
  }
1465
1448
  interface ReplyComposerProps {
1466
1449
  avatar?: string;
1467
1450
  username?: string;
1451
+ placeholder?: string;
1452
+ submitLabel?: string;
1453
+ disabled?: boolean;
1454
+ loading?: boolean;
1468
1455
  onSubmit: (content: string) => Promise<void> | void;
1469
1456
  }
1470
1457
  interface CommentRepliesToggleProps {
@@ -1472,6 +1459,46 @@ interface CommentRepliesToggleProps {
1472
1459
  repliesCount: number;
1473
1460
  onToggle: () => void;
1474
1461
  }
1462
+ interface CommentItemProps {
1463
+ comment: CommentEntity;
1464
+ depth?: number;
1465
+ config: Required<CommentThreadConfig>;
1466
+ components?: CommentComponents;
1467
+ onLike?: (comment: CommentEntity) => void;
1468
+ onDislike?: (comment: CommentEntity) => void;
1469
+ onReply?: (comment: CommentEntity, content: string) => Promise<void> | void;
1470
+ onEdit?: (comment: CommentEntity) => void;
1471
+ onDelete?: (comment: CommentEntity) => void;
1472
+ onReport?: (comment: CommentEntity) => void;
1473
+ }
1474
+ interface CommentListProps {
1475
+ comments: CommentEntity[];
1476
+ depth?: number;
1477
+ config: Required<CommentThreadConfig>;
1478
+ components?: CommentComponents;
1479
+ onLike?: (comment: CommentEntity) => void;
1480
+ onDislike?: (comment: CommentEntity) => void;
1481
+ onReply?: (comment: CommentEntity, content: string) => Promise<void> | void;
1482
+ onEdit?: (comment: CommentEntity) => void;
1483
+ onDelete?: (comment: CommentEntity) => void;
1484
+ onReport?: (comment: CommentEntity) => void;
1485
+ }
1486
+ interface CommentThreadProps {
1487
+ postId: string;
1488
+ currentUser: CommentAuthor;
1489
+ dataSource: CommentDataSource;
1490
+ loading?: boolean;
1491
+ components?: CommentComponents;
1492
+ config?: CommentThreadConfig;
1493
+ onEdit?: (comment: CommentEntity) => void;
1494
+ onDelete?: (comment: CommentEntity) => void;
1495
+ onReport?: (comment: CommentEntity) => void;
1496
+ }
1497
+ interface CommentThreadConfig {
1498
+ maxDepth?: number;
1499
+ indentation?: number;
1500
+ dateFormat?: "relative" | "absolute";
1501
+ }
1475
1502
  interface CommentComponents {
1476
1503
  /**
1477
1504
  * Root comment composer
@@ -1503,17 +1530,7 @@ interface CommentComponents {
1503
1530
  RepliesToggle?: ComponentType<CommentRepliesToggleProps>;
1504
1531
  }
1505
1532
 
1506
- interface CommentThreadProps {
1507
- postId: string;
1508
- currentUser: CommentAuthor;
1509
- dataSource: CommentDataSource;
1510
- loading?: boolean;
1511
- components?: CommentComponents;
1512
- onEdit?: (comment: CommentEntity) => void;
1513
- onDelete?: (comment: CommentEntity) => void;
1514
- onReport?: (comment: CommentEntity) => void;
1515
- }
1516
- declare function CommentThread({ currentUser, dataSource, loading, components, onEdit, onDelete, onReport, }: CommentThreadProps): react_jsx_runtime.JSX.Element;
1533
+ declare function CommentThread({ currentUser, dataSource, loading, components, config, onEdit, onDelete, onReport, }: CommentThreadProps): react_jsx_runtime.JSX.Element;
1517
1534
 
1518
1535
  declare function formatCommentDate(date: string): string;
1519
1536
 
@@ -1777,4 +1794,4 @@ interface ResolveAppearanceStylesProps {
1777
1794
  }
1778
1795
  declare function resolveAppearanceStyles({ appearance, variant, solid, lite, ghost, }: ResolveAppearanceStylesProps): string;
1779
1796
 
1780
- export { Accordion, type AnimationComponentProps, type AnimationVariant, type Appearance, AsyncComponentWrapper, Avatar, Backdrop, Badge, BarChart, type BaseAnimationConfig, type BaseComponentProps, type BaseMenuNode, type BaseOverlayConfig, type BaseTopNavNode, type BlobAnimationConfig, Block, BlockGroup, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, Button, Caption, Card, CardContent, CardFooter, CardHeader, type CardinalPosition, Chapter, Checkbox, Chip, type CloudinaryConfig, CloudinaryImage, CloudinaryProvider, type CloudinaryProviderProps, CloudinaryVideo, Code, type CommentActionsProps, type CommentAuthor, type CommentComponents, type CommentComposerProps, type CommentContentProps, type CommentDataSource, type CommentEntity, type CommentHeaderProps, type CommentMenuProps, type CommentPermissions, type CommentRepliesToggleProps, CommentThread, Content, ContentArea, type CornerPosition, type CreateCommentInput, type CurrencyCode, DataView, DataViewTable, DateSelector, DefaultLayout, type DefaultMenuElements, Display, DocumentationPanel, Drawer, DrawerToggler, type EUIComponentDefaults, type EUIConfigs, EUIDevLayout, EUIProvider, type EUIRoute, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, GenericLayout, GlowWrapper, type GradientAnimationConfig, Graph, type GraphData, GraphEdge, type GraphEdgeType, type GraphLayoutType, GraphNode, type GraphNodeType, type GraphProps, GraphRenderer, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, type HorizontalPosition, type HyperRefTarget, Image, ImageInput, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Label, Layout, type LayoutContext, type LayoutExecutor, Lead, LineChart, Link, List, type ListAlign, type ListBulletType, type ListDirection, ListItem, type ListItemData, MarkdownEditor, MarkdownProvider, MarkdownTOC, MarkdownViewer, Menu, type MenuElementType, MenuGroup, type MenuGroupNode, MenuItem, type MenuItemNode, MenuItemTitle, type MenuNode, type MenuProps, type MenuTitleNode, type MeshAnimationConfig, Modal, MotionSurface, MultiImageInput, type NavItem, NumericRating, type OctilePosition, type OverlayVariant, Overline, Paragraph, PieChart, PriceTag, ProgressBar, type ProgressBarProps, ProgressBarRating, Quote, Radio, type ReplyComposerProps, RouteTab, type RouteTabMode, RouteTabs, ScrollToTop, Section, Select, type Shape$1 as Shape, ShapeSwitch, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, type Size$1 as Size, Skeleton, Slider, StarRating, StarRatingDistribution, StarRatingInput, Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table, Tag, Tags, TextArea, type TextDecoration, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, type TitleBannerLevel, Toast, type ToggleReactionResult, Tooltip, TopNav, type TopNavComponents, type TopNavGroupNode, type TopNavItemNode, type TopNavNode, type TopNavProps, type TopNavTitleNode, Transition, TransitionDropdown, TransitionFadeIn, Typography, UnderConstructionBanner, type UpdateCommentInput, ValueBadge, type Variant$1 as Variant, type VerticalPosition, WorldMap, WorldMapCountryTable, YoutubeVideo as YoutubeVideoPlayer, cn, createForceLayout, createGridLayout, createTreeLayout, enumValues, formatCommentDate, getCurrencySymbol, getLayout, isMatch, isRenderFn, normalize, registerLayout, resolveAppearanceStyles, resolveWithGlobal, sendToast, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useEUIConfig, useIsMobile, useModal, useTheme };
1797
+ export { Accordion, type AnimationComponentProps, type AnimationVariant, type Appearance, AsyncComponentWrapper, Avatar, Backdrop, Badge, BarChart, type BaseAnimationConfig, type BaseComponentProps, type BaseMenuNode, type BaseOverlayConfig, type BaseTopNavNode, type BlobAnimationConfig, Block, BlockGroup, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, Button, Caption, Card, CardContent, CardFooter, CardHeader, type CardinalPosition, Chapter, Checkbox, Chip, type CloudinaryConfig, CloudinaryImage, CloudinaryProvider, type CloudinaryProviderProps, CloudinaryVideo, Code, type CommentActionsProps, type CommentAuthor, type CommentComponents, type CommentComposerProps, type CommentContentProps, type CommentDataSource, type CommentEntity, type CommentHeaderProps, type CommentItemProps, type CommentListProps, type CommentMenuProps, type CommentPermissions, type CommentRepliesToggleProps, CommentThread, type CommentThreadConfig, type CommentThreadProps, Content, ContentArea, type CornerPosition, type CreateCommentInput, type CurrencyCode, DataView, DataViewTable, DateSelector, DefaultLayout, type DefaultMenuElements, Display, DocumentationPanel, Drawer, DrawerToggler, type EUIComponentDefaults, type EUIConfigs, EUIDevLayout, EUIProvider, type EUIRoute, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, GenericLayout, GlowWrapper, type GradientAnimationConfig, Graph, type GraphData, GraphEdge, type GraphEdgeType, type GraphLayoutType, GraphNode, type GraphNodeType, type GraphProps, GraphRenderer, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, type HorizontalPosition, type HyperRefTarget, Image, ImageInput, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Label, Layout, type LayoutContext, type LayoutExecutor, Lead, LineChart, Link, List, type ListAlign, type ListBulletType, type ListDirection, ListItem, type ListItemData, MarkdownEditor, MarkdownProvider, MarkdownTOC, MarkdownViewer, Menu, type MenuElementType, MenuGroup, type MenuGroupNode, MenuItem, type MenuItemNode, MenuItemTitle, type MenuNode, type MenuProps, type MenuTitleNode, type MeshAnimationConfig, Modal, MotionSurface, MultiImageInput, type NavItem, NumericRating, type OctilePosition, type OverlayVariant, Overline, Paragraph, PieChart, PriceTag, ProgressBar, type ProgressBarProps, ProgressBarRating, Quote, Radio, type ReplyComposerProps, RouteTab, type RouteTabMode, RouteTabs, ScrollToTop, Section, Select, type Shape$1 as Shape, ShapeSwitch, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, type Size$1 as Size, Skeleton, Slider, StarRating, StarRatingDistribution, StarRatingInput, Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table, Tag, Tags, TextArea, type TextDecoration, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, type TitleBannerLevel, Toast, type ToggleReactionResult, Tooltip, TopNav, type TopNavComponents, type TopNavGroupNode, type TopNavItemNode, type TopNavNode, type TopNavProps, type TopNavTitleNode, Transition, TransitionDropdown, TransitionFadeIn, Typography, UnderConstructionBanner, type UpdateCommentInput, ValueBadge, type Variant$1 as Variant, type VerticalPosition, WorldMap, WorldMapCountryTable, YoutubeVideo as YoutubeVideoPlayer, cn, createForceLayout, createGridLayout, createTreeLayout, enumValues, formatCommentDate, getCurrencySymbol, getLayout, isMatch, isRenderFn, normalize, registerLayout, resolveAppearanceStyles, resolveWithGlobal, sendToast, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useEUIConfig, useIsMobile, useModal, useTheme };
package/dist/index.d.ts CHANGED
@@ -1405,33 +1405,12 @@ interface ToggleReactionResult {
1405
1405
  disliked: boolean;
1406
1406
  }
1407
1407
  interface CommentDataSource {
1408
- /**
1409
- * Load comments for a resource
1410
- */
1411
1408
  getComments(): Promise<CommentEntity[]>;
1412
- /**
1413
- * Create root comment or reply
1414
- */
1415
1409
  createComment(input: CreateCommentInput): Promise<CommentEntity>;
1416
- /**
1417
- * Update existing comment
1418
- */
1419
1410
  updateComment(input: UpdateCommentInput): Promise<CommentEntity>;
1420
- /**
1421
- * Delete comment
1422
- */
1423
1411
  deleteComment(commentId: string): Promise<void>;
1424
- /**
1425
- * Toggle like
1426
- */
1427
1412
  toggleLike(commentId: string): Promise<ToggleReactionResult>;
1428
- /**
1429
- * Toggle dislike
1430
- */
1431
1413
  toggleDislike(commentId: string): Promise<ToggleReactionResult>;
1432
- /**
1433
- * Optional report functionality
1434
- */
1435
1414
  reportComment?(commentId: string, reason: string, description?: string): Promise<void>;
1436
1415
  }
1437
1416
 
@@ -1460,11 +1439,19 @@ interface CommentMenuProps {
1460
1439
  }
1461
1440
  interface CommentComposerProps {
1462
1441
  avatar?: string;
1442
+ placeholder?: string;
1443
+ submitLabel?: string;
1444
+ disabled?: boolean;
1445
+ loading?: boolean;
1463
1446
  onSubmit: (content: string) => Promise<void> | void;
1464
1447
  }
1465
1448
  interface ReplyComposerProps {
1466
1449
  avatar?: string;
1467
1450
  username?: string;
1451
+ placeholder?: string;
1452
+ submitLabel?: string;
1453
+ disabled?: boolean;
1454
+ loading?: boolean;
1468
1455
  onSubmit: (content: string) => Promise<void> | void;
1469
1456
  }
1470
1457
  interface CommentRepliesToggleProps {
@@ -1472,6 +1459,46 @@ interface CommentRepliesToggleProps {
1472
1459
  repliesCount: number;
1473
1460
  onToggle: () => void;
1474
1461
  }
1462
+ interface CommentItemProps {
1463
+ comment: CommentEntity;
1464
+ depth?: number;
1465
+ config: Required<CommentThreadConfig>;
1466
+ components?: CommentComponents;
1467
+ onLike?: (comment: CommentEntity) => void;
1468
+ onDislike?: (comment: CommentEntity) => void;
1469
+ onReply?: (comment: CommentEntity, content: string) => Promise<void> | void;
1470
+ onEdit?: (comment: CommentEntity) => void;
1471
+ onDelete?: (comment: CommentEntity) => void;
1472
+ onReport?: (comment: CommentEntity) => void;
1473
+ }
1474
+ interface CommentListProps {
1475
+ comments: CommentEntity[];
1476
+ depth?: number;
1477
+ config: Required<CommentThreadConfig>;
1478
+ components?: CommentComponents;
1479
+ onLike?: (comment: CommentEntity) => void;
1480
+ onDislike?: (comment: CommentEntity) => void;
1481
+ onReply?: (comment: CommentEntity, content: string) => Promise<void> | void;
1482
+ onEdit?: (comment: CommentEntity) => void;
1483
+ onDelete?: (comment: CommentEntity) => void;
1484
+ onReport?: (comment: CommentEntity) => void;
1485
+ }
1486
+ interface CommentThreadProps {
1487
+ postId: string;
1488
+ currentUser: CommentAuthor;
1489
+ dataSource: CommentDataSource;
1490
+ loading?: boolean;
1491
+ components?: CommentComponents;
1492
+ config?: CommentThreadConfig;
1493
+ onEdit?: (comment: CommentEntity) => void;
1494
+ onDelete?: (comment: CommentEntity) => void;
1495
+ onReport?: (comment: CommentEntity) => void;
1496
+ }
1497
+ interface CommentThreadConfig {
1498
+ maxDepth?: number;
1499
+ indentation?: number;
1500
+ dateFormat?: "relative" | "absolute";
1501
+ }
1475
1502
  interface CommentComponents {
1476
1503
  /**
1477
1504
  * Root comment composer
@@ -1503,17 +1530,7 @@ interface CommentComponents {
1503
1530
  RepliesToggle?: ComponentType<CommentRepliesToggleProps>;
1504
1531
  }
1505
1532
 
1506
- interface CommentThreadProps {
1507
- postId: string;
1508
- currentUser: CommentAuthor;
1509
- dataSource: CommentDataSource;
1510
- loading?: boolean;
1511
- components?: CommentComponents;
1512
- onEdit?: (comment: CommentEntity) => void;
1513
- onDelete?: (comment: CommentEntity) => void;
1514
- onReport?: (comment: CommentEntity) => void;
1515
- }
1516
- declare function CommentThread({ currentUser, dataSource, loading, components, onEdit, onDelete, onReport, }: CommentThreadProps): react_jsx_runtime.JSX.Element;
1533
+ declare function CommentThread({ currentUser, dataSource, loading, components, config, onEdit, onDelete, onReport, }: CommentThreadProps): react_jsx_runtime.JSX.Element;
1517
1534
 
1518
1535
  declare function formatCommentDate(date: string): string;
1519
1536
 
@@ -1777,4 +1794,4 @@ interface ResolveAppearanceStylesProps {
1777
1794
  }
1778
1795
  declare function resolveAppearanceStyles({ appearance, variant, solid, lite, ghost, }: ResolveAppearanceStylesProps): string;
1779
1796
 
1780
- export { Accordion, type AnimationComponentProps, type AnimationVariant, type Appearance, AsyncComponentWrapper, Avatar, Backdrop, Badge, BarChart, type BaseAnimationConfig, type BaseComponentProps, type BaseMenuNode, type BaseOverlayConfig, type BaseTopNavNode, type BlobAnimationConfig, Block, BlockGroup, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, Button, Caption, Card, CardContent, CardFooter, CardHeader, type CardinalPosition, Chapter, Checkbox, Chip, type CloudinaryConfig, CloudinaryImage, CloudinaryProvider, type CloudinaryProviderProps, CloudinaryVideo, Code, type CommentActionsProps, type CommentAuthor, type CommentComponents, type CommentComposerProps, type CommentContentProps, type CommentDataSource, type CommentEntity, type CommentHeaderProps, type CommentMenuProps, type CommentPermissions, type CommentRepliesToggleProps, CommentThread, Content, ContentArea, type CornerPosition, type CreateCommentInput, type CurrencyCode, DataView, DataViewTable, DateSelector, DefaultLayout, type DefaultMenuElements, Display, DocumentationPanel, Drawer, DrawerToggler, type EUIComponentDefaults, type EUIConfigs, EUIDevLayout, EUIProvider, type EUIRoute, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, GenericLayout, GlowWrapper, type GradientAnimationConfig, Graph, type GraphData, GraphEdge, type GraphEdgeType, type GraphLayoutType, GraphNode, type GraphNodeType, type GraphProps, GraphRenderer, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, type HorizontalPosition, type HyperRefTarget, Image, ImageInput, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Label, Layout, type LayoutContext, type LayoutExecutor, Lead, LineChart, Link, List, type ListAlign, type ListBulletType, type ListDirection, ListItem, type ListItemData, MarkdownEditor, MarkdownProvider, MarkdownTOC, MarkdownViewer, Menu, type MenuElementType, MenuGroup, type MenuGroupNode, MenuItem, type MenuItemNode, MenuItemTitle, type MenuNode, type MenuProps, type MenuTitleNode, type MeshAnimationConfig, Modal, MotionSurface, MultiImageInput, type NavItem, NumericRating, type OctilePosition, type OverlayVariant, Overline, Paragraph, PieChart, PriceTag, ProgressBar, type ProgressBarProps, ProgressBarRating, Quote, Radio, type ReplyComposerProps, RouteTab, type RouteTabMode, RouteTabs, ScrollToTop, Section, Select, type Shape$1 as Shape, ShapeSwitch, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, type Size$1 as Size, Skeleton, Slider, StarRating, StarRatingDistribution, StarRatingInput, Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table, Tag, Tags, TextArea, type TextDecoration, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, type TitleBannerLevel, Toast, type ToggleReactionResult, Tooltip, TopNav, type TopNavComponents, type TopNavGroupNode, type TopNavItemNode, type TopNavNode, type TopNavProps, type TopNavTitleNode, Transition, TransitionDropdown, TransitionFadeIn, Typography, UnderConstructionBanner, type UpdateCommentInput, ValueBadge, type Variant$1 as Variant, type VerticalPosition, WorldMap, WorldMapCountryTable, YoutubeVideo as YoutubeVideoPlayer, cn, createForceLayout, createGridLayout, createTreeLayout, enumValues, formatCommentDate, getCurrencySymbol, getLayout, isMatch, isRenderFn, normalize, registerLayout, resolveAppearanceStyles, resolveWithGlobal, sendToast, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useEUIConfig, useIsMobile, useModal, useTheme };
1797
+ export { Accordion, type AnimationComponentProps, type AnimationVariant, type Appearance, AsyncComponentWrapper, Avatar, Backdrop, Badge, BarChart, type BaseAnimationConfig, type BaseComponentProps, type BaseMenuNode, type BaseOverlayConfig, type BaseTopNavNode, type BlobAnimationConfig, Block, BlockGroup, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, Button, Caption, Card, CardContent, CardFooter, CardHeader, type CardinalPosition, Chapter, Checkbox, Chip, type CloudinaryConfig, CloudinaryImage, CloudinaryProvider, type CloudinaryProviderProps, CloudinaryVideo, Code, type CommentActionsProps, type CommentAuthor, type CommentComponents, type CommentComposerProps, type CommentContentProps, type CommentDataSource, type CommentEntity, type CommentHeaderProps, type CommentItemProps, type CommentListProps, type CommentMenuProps, type CommentPermissions, type CommentRepliesToggleProps, CommentThread, type CommentThreadConfig, type CommentThreadProps, Content, ContentArea, type CornerPosition, type CreateCommentInput, type CurrencyCode, DataView, DataViewTable, DateSelector, DefaultLayout, type DefaultMenuElements, Display, DocumentationPanel, Drawer, DrawerToggler, type EUIComponentDefaults, type EUIConfigs, EUIDevLayout, EUIProvider, type EUIRoute, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, GenericLayout, GlowWrapper, type GradientAnimationConfig, Graph, type GraphData, GraphEdge, type GraphEdgeType, type GraphLayoutType, GraphNode, type GraphNodeType, type GraphProps, GraphRenderer, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, type HorizontalPosition, type HyperRefTarget, Image, ImageInput, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Label, Layout, type LayoutContext, type LayoutExecutor, Lead, LineChart, Link, List, type ListAlign, type ListBulletType, type ListDirection, ListItem, type ListItemData, MarkdownEditor, MarkdownProvider, MarkdownTOC, MarkdownViewer, Menu, type MenuElementType, MenuGroup, type MenuGroupNode, MenuItem, type MenuItemNode, MenuItemTitle, type MenuNode, type MenuProps, type MenuTitleNode, type MeshAnimationConfig, Modal, MotionSurface, MultiImageInput, type NavItem, NumericRating, type OctilePosition, type OverlayVariant, Overline, Paragraph, PieChart, PriceTag, ProgressBar, type ProgressBarProps, ProgressBarRating, Quote, Radio, type ReplyComposerProps, RouteTab, type RouteTabMode, RouteTabs, ScrollToTop, Section, Select, type Shape$1 as Shape, ShapeSwitch, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, type Size$1 as Size, Skeleton, Slider, StarRating, StarRatingDistribution, StarRatingInput, Switch, TNDropdown, TNDropdownItem, TNDropdownTitle, TNGroup, Table, Tag, Tags, TextArea, type TextDecoration, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, type TitleBannerLevel, Toast, type ToggleReactionResult, Tooltip, TopNav, type TopNavComponents, type TopNavGroupNode, type TopNavItemNode, type TopNavNode, type TopNavProps, type TopNavTitleNode, Transition, TransitionDropdown, TransitionFadeIn, Typography, UnderConstructionBanner, type UpdateCommentInput, ValueBadge, type Variant$1 as Variant, type VerticalPosition, WorldMap, WorldMapCountryTable, YoutubeVideo as YoutubeVideoPlayer, cn, createForceLayout, createGridLayout, createTreeLayout, enumValues, formatCommentDate, getCurrencySymbol, getLayout, isMatch, isRenderFn, normalize, registerLayout, resolveAppearanceStyles, resolveWithGlobal, sendToast, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useEUIConfig, useIsMobile, useModal, useTheme };
package/dist/index.js CHANGED
@@ -17511,7 +17511,7 @@ function CommentComposer({
17511
17511
  }
17512
17512
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
17513
17513
  /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: avatar, size: "md" }),
17514
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex flex-col gap-3", children: [
17514
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-3", children: [
17515
17515
  /* @__PURE__ */ jsxRuntime.jsx(
17516
17516
  "textarea",
17517
17517
  {
@@ -17520,7 +17520,7 @@ function CommentComposer({
17520
17520
  placeholder,
17521
17521
  onFocus: () => setFocused(true),
17522
17522
  onChange: (e) => setValue(e.target.value),
17523
- className: "\n w-full\n min-h-[56px]\n resize-none\n bg-transparent\n border-b\n border-gray-300\n dark:border-neutral-700\n outline-none\n pb-2\n text-sm\n "
17523
+ className: "min-h-[56px] w-full resize-none border-b border-gray-300 bg-transparent pb-2 text-sm outline-none dark:border-neutral-700"
17524
17524
  }
17525
17525
  ),
17526
17526
  (focused || value.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
@@ -17560,56 +17560,44 @@ function CommentActions({
17560
17560
  const liked = comment.liked ?? false;
17561
17561
  const disliked = comment.disliked ?? false;
17562
17562
  const canReply = comment.permissions?.canReply ?? true;
17563
- return /* @__PURE__ */ jsxRuntime.jsxs(
17564
- "div",
17565
- {
17566
- className: "\n flex\n items-center\n gap-5\n text-sm\n text-gray-500\n dark:text-gray-400\n ",
17567
- children: [
17568
- /* @__PURE__ */ jsxRuntime.jsxs(
17569
- "button",
17570
- {
17571
- onClick: onLike,
17572
- className: `
17573
- inline-flex
17574
- items-center
17575
- gap-1
17576
- transition-colors
17563
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-5 text-sm text-gray-500 dark:text-gray-400", children: [
17564
+ /* @__PURE__ */ jsxRuntime.jsxs(
17565
+ "button",
17566
+ {
17567
+ onClick: onLike,
17568
+ className: `
17569
+ inline-flex items-center gap-1 transition-colors
17577
17570
  ${liked ? "text-blue-500" : "hover:text-gray-900 dark:hover:text-gray-100"}
17578
17571
  `,
17579
- children: [
17580
- liked ? /* @__PURE__ */ jsxRuntime.jsx(bi.BiSolidLike, { size: 18 }) : /* @__PURE__ */ jsxRuntime.jsx(bi.BiLike, { size: 18 }),
17581
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: likes })
17582
- ]
17583
- }
17584
- ),
17585
- /* @__PURE__ */ jsxRuntime.jsxs(
17586
- "button",
17587
- {
17588
- onClick: onDislike,
17589
- className: `
17590
- inline-flex
17591
- items-center
17592
- gap-1
17593
- transition-colors
17572
+ children: [
17573
+ liked ? /* @__PURE__ */ jsxRuntime.jsx(bi.BiSolidLike, { size: 18 }) : /* @__PURE__ */ jsxRuntime.jsx(bi.BiLike, { size: 18 }),
17574
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: likes })
17575
+ ]
17576
+ }
17577
+ ),
17578
+ /* @__PURE__ */ jsxRuntime.jsxs(
17579
+ "button",
17580
+ {
17581
+ onClick: onDislike,
17582
+ className: `
17583
+ inline-flex items-center gap-1 transition-colors
17594
17584
  ${disliked ? "text-red-500" : "hover:text-gray-900 dark:hover:text-gray-100"}
17595
17585
  `,
17596
- children: [
17597
- disliked ? /* @__PURE__ */ jsxRuntime.jsx(bi.BiSolidDislike, { size: 18 }) : /* @__PURE__ */ jsxRuntime.jsx(bi.BiDislike, { size: 18 }),
17598
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: dislikes })
17599
- ]
17600
- }
17601
- ),
17602
- canReply && /* @__PURE__ */ jsxRuntime.jsx(
17603
- "button",
17604
- {
17605
- onClick: onReply,
17606
- className: "\n font-medium\n transition-colors\n hover:text-gray-900\n dark:hover:text-gray-100\n ",
17607
- children: "Reply"
17608
- }
17609
- )
17610
- ]
17611
- }
17612
- );
17586
+ children: [
17587
+ disliked ? /* @__PURE__ */ jsxRuntime.jsx(bi.BiSolidDislike, { size: 18 }) : /* @__PURE__ */ jsxRuntime.jsx(bi.BiDislike, { size: 18 }),
17588
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: dislikes })
17589
+ ]
17590
+ }
17591
+ ),
17592
+ canReply && /* @__PURE__ */ jsxRuntime.jsx(
17593
+ "button",
17594
+ {
17595
+ onClick: onReply,
17596
+ className: "font-medium transition-colors hover:text-gray-900 dark:hover:text-gray-100",
17597
+ children: "Reply"
17598
+ }
17599
+ )
17600
+ ] });
17613
17601
  }
17614
17602
  var CommentActions_default = CommentActions;
17615
17603
  function CommentContent({ comment }) {
@@ -17702,63 +17690,57 @@ function CommentMenu({
17702
17690
  {
17703
17691
  type: "button",
17704
17692
  onClick: () => setOpen(!open),
17705
- className: "\n text-gray-500\n hover:text-gray-900\n dark:hover:text-gray-100\n transition-colors\n ",
17693
+ className: "text-gray-500 transition-colors hover:text-gray-900 dark:hover:text-gray-100",
17706
17694
  children: /* @__PURE__ */ jsxRuntime.jsx(bi.BiDotsVerticalRounded, { size: 18 })
17707
17695
  }
17708
17696
  ),
17709
- open && /* @__PURE__ */ jsxRuntime.jsxs(
17710
- "div",
17711
- {
17712
- className: "\n absolute\n right-0\n top-full\n mt-2\n min-w-[180px]\n overflow-hidden\n rounded-xl\n border\n border-gray-200\n dark:border-neutral-800\n bg-white\n dark:bg-neutral-900\n shadow-xl\n z-50\n ",
17713
- children: [
17714
- canEdit && /* @__PURE__ */ jsxRuntime.jsxs(
17715
- "button",
17716
- {
17717
- type: "button",
17718
- onClick: () => {
17719
- setOpen(false);
17720
- onEdit?.();
17721
- },
17722
- className: "\n w-full\n flex\n items-center\n gap-2\n px-4\n py-3\n text-sm\n hover:bg-gray-100\n dark:hover:bg-neutral-800\n ",
17723
- children: [
17724
- /* @__PURE__ */ jsxRuntime.jsx(bi.BiEdit, {}),
17725
- "Edit"
17726
- ]
17727
- }
17728
- ),
17729
- canDelete && /* @__PURE__ */ jsxRuntime.jsxs(
17730
- "button",
17731
- {
17732
- type: "button",
17733
- onClick: () => {
17734
- setOpen(false);
17735
- onDelete?.();
17736
- },
17737
- className: "\n w-full\n flex\n items-center\n gap-2\n px-4\n py-3\n text-sm\n text-red-500\n hover:bg-gray-100\n dark:hover:bg-neutral-800\n ",
17738
- children: [
17739
- /* @__PURE__ */ jsxRuntime.jsx(bi.BiTrash, {}),
17740
- "Delete"
17741
- ]
17742
- }
17743
- ),
17744
- canReport && /* @__PURE__ */ jsxRuntime.jsxs(
17745
- "button",
17746
- {
17747
- type: "button",
17748
- onClick: () => {
17749
- setOpen(false);
17750
- onReport?.();
17751
- },
17752
- className: "\n w-full\n flex\n items-center\n gap-2\n px-4\n py-3\n text-sm\n hover:bg-gray-100\n dark:hover:bg-neutral-800\n ",
17753
- children: [
17754
- /* @__PURE__ */ jsxRuntime.jsx(bi.BiFlag, {}),
17755
- "Report"
17756
- ]
17757
- }
17758
- )
17759
- ]
17760
- }
17761
- )
17697
+ open && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute right-0 top-full z-50 mt-2 min-w-[180px] overflow-hidden rounded-xl border border-gray-200 bg-white shadow-xl dark:border-neutral-800 dark:bg-neutral-900", children: [
17698
+ canEdit && /* @__PURE__ */ jsxRuntime.jsxs(
17699
+ "button",
17700
+ {
17701
+ type: "button",
17702
+ onClick: () => {
17703
+ setOpen(false);
17704
+ onEdit?.();
17705
+ },
17706
+ className: "flex w-full items-center gap-2 px-4 py-3 text-sm hover:bg-gray-100 dark:hover:bg-neutral-800",
17707
+ children: [
17708
+ /* @__PURE__ */ jsxRuntime.jsx(bi.BiEdit, {}),
17709
+ "Edit"
17710
+ ]
17711
+ }
17712
+ ),
17713
+ canDelete && /* @__PURE__ */ jsxRuntime.jsxs(
17714
+ "button",
17715
+ {
17716
+ type: "button",
17717
+ onClick: () => {
17718
+ setOpen(false);
17719
+ onDelete?.();
17720
+ },
17721
+ className: "flex w-full items-center gap-2 px-4 py-3 text-sm text-red-500 hover:bg-gray-100 dark:hover:bg-neutral-800",
17722
+ children: [
17723
+ /* @__PURE__ */ jsxRuntime.jsx(bi.BiTrash, {}),
17724
+ "Delete"
17725
+ ]
17726
+ }
17727
+ ),
17728
+ canReport && /* @__PURE__ */ jsxRuntime.jsxs(
17729
+ "button",
17730
+ {
17731
+ type: "button",
17732
+ onClick: () => {
17733
+ setOpen(false);
17734
+ onReport?.();
17735
+ },
17736
+ className: "flex w-full items-center gap-2 px-4 py-3 text-sm hover:bg-gray-100 dark:hover:bg-neutral-800",
17737
+ children: [
17738
+ /* @__PURE__ */ jsxRuntime.jsx(bi.BiFlag, {}),
17739
+ "Report"
17740
+ ]
17741
+ }
17742
+ )
17743
+ ] })
17762
17744
  ] });
17763
17745
  }
17764
17746
  var CommentMenu_default = CommentMenu;
@@ -17776,7 +17758,7 @@ function CommentRepliesToggle({
17776
17758
  {
17777
17759
  type: "button",
17778
17760
  onClick: onToggle,
17779
- className: "\n inline-flex\n items-center\n gap-1\n w-fit\n text-sm\n font-medium\n text-blue-500\n hover:text-blue-400\n transition-colors\n ",
17761
+ className: "inline-flex w-fit items-center gap-1 text-sm font-medium text-blue-500 transition-colors hover:text-blue-400",
17780
17762
  children: [
17781
17763
  collapsed ? /* @__PURE__ */ jsxRuntime.jsx(bi.BiChevronDown, { size: 18 }) : /* @__PURE__ */ jsxRuntime.jsx(bi.BiChevronUp, { size: 18 }),
17782
17764
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
@@ -17788,7 +17770,10 @@ var CommentRepliesToggle_default = CommentRepliesToggle;
17788
17770
  function ReplyComposer({
17789
17771
  avatar,
17790
17772
  username,
17773
+ placeholder,
17774
+ submitLabel = "Reply",
17791
17775
  loading,
17776
+ disabled,
17792
17777
  onSubmit
17793
17778
  }) {
17794
17779
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -17796,20 +17781,18 @@ function ReplyComposer({
17796
17781
  {
17797
17782
  avatar,
17798
17783
  loading,
17799
- submitLabel: "Reply",
17800
- placeholder: `Reply to @${username}`,
17784
+ disabled,
17785
+ submitLabel,
17786
+ placeholder: placeholder ?? `Reply to @${username}`,
17801
17787
  onSubmit
17802
17788
  }
17803
17789
  ) });
17804
17790
  }
17805
17791
  var ReplyComposer_default = ReplyComposer;
17806
-
17807
- // src/compositions/comment-thread/constants/comment.constants.ts
17808
- var MAX_COMMENT_DEPTH = 5;
17809
- var COMMENT_INDENTATION = 24;
17810
17792
  function CommentItem({
17811
17793
  comment,
17812
17794
  depth = 0,
17795
+ config,
17813
17796
  components,
17814
17797
  onLike,
17815
17798
  onDislike,
@@ -17820,7 +17803,7 @@ function CommentItem({
17820
17803
  }) {
17821
17804
  const [collapsed, setCollapsed] = React4.useState(false);
17822
17805
  const [isReplying, setIsReplying] = React4.useState(false);
17823
- const resolvedDepth = Math.min(depth, MAX_COMMENT_DEPTH);
17806
+ const resolvedDepth = Math.min(depth, config.maxDepth);
17824
17807
  const {
17825
17808
  Header: HeaderComponent = CommentHeader_default,
17826
17809
  Content: ContentComponent = CommentContent_default,
@@ -17839,7 +17822,7 @@ function CommentItem({
17839
17822
  {
17840
17823
  className: "flex flex-col gap-4",
17841
17824
  style: {
17842
- paddingLeft: resolvedDepth * COMMENT_INDENTATION
17825
+ paddingLeft: resolvedDepth * config.indentation
17843
17826
  },
17844
17827
  children: [
17845
17828
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 flex-col gap-3 min-w-0", children: [
@@ -17875,6 +17858,8 @@ function CommentItem({
17875
17858
  {
17876
17859
  avatar: comment.author?.avatar,
17877
17860
  username: comment.author?.username,
17861
+ placeholder: `Reply to @${comment.author?.username}`,
17862
+ submitLabel: "Reply",
17878
17863
  onSubmit: handleReply
17879
17864
  }
17880
17865
  ),
@@ -17899,6 +17884,7 @@ function CommentItem({
17899
17884
  {
17900
17885
  comments: comment.replies,
17901
17886
  depth: depth + 1,
17887
+ config,
17902
17888
  components,
17903
17889
  onLike,
17904
17890
  onDislike,
@@ -17918,6 +17904,7 @@ var CommentItem_default = CommentItem;
17918
17904
  function CommentList({
17919
17905
  comments,
17920
17906
  depth = 0,
17907
+ config,
17921
17908
  components,
17922
17909
  onLike,
17923
17910
  onDislike,
@@ -17934,6 +17921,7 @@ function CommentList({
17934
17921
  {
17935
17922
  comment,
17936
17923
  depth,
17924
+ config,
17937
17925
  components,
17938
17926
  onLike,
17939
17927
  onDislike,
@@ -17999,18 +17987,30 @@ function insertReply(comments, parentId, reply) {
17999
17987
  };
18000
17988
  });
18001
17989
  }
17990
+
17991
+ // src/compositions/comment-thread/constants/comment.constants.ts
17992
+ var DEFAULT_COMMENT_THREAD_CONFIG = {
17993
+ maxDepth: 5,
17994
+ indentation: 24,
17995
+ dateFormat: "relative"
17996
+ };
18002
17997
  function CommentThread({
18003
17998
  currentUser,
18004
17999
  dataSource,
18005
18000
  loading = false,
18006
18001
  components,
18002
+ config,
18007
18003
  onEdit,
18008
18004
  onDelete,
18009
18005
  onReport
18010
18006
  }) {
18011
18007
  const [comments, setComments] = React4.useState([]);
18012
18008
  const [isLoadingComments, setIsLoadingComments] = React4.useState(true);
18013
- const ComposerComponent = components?.ReplyComposer ?? CommentComposer_default;
18009
+ const ComposerComponent = components?.Composer ?? CommentComposer_default;
18010
+ const resolvedConfig = {
18011
+ ...DEFAULT_COMMENT_THREAD_CONFIG,
18012
+ ...config
18013
+ };
18014
18014
  React4.useEffect(() => {
18015
18015
  async function loadComments() {
18016
18016
  try {
@@ -18088,6 +18088,8 @@ function CommentThread({
18088
18088
  ComposerComponent,
18089
18089
  {
18090
18090
  avatar: currentUser.avatar,
18091
+ placeholder: "Add a comment...",
18092
+ submitLabel: "Comment",
18091
18093
  onSubmit: handleCreateComment
18092
18094
  }
18093
18095
  ),
@@ -18096,6 +18098,7 @@ function CommentThread({
18096
18098
  {
18097
18099
  comments,
18098
18100
  components,
18101
+ config: resolvedConfig,
18099
18102
  onLike: handleLike,
18100
18103
  onDislike: handleDislike,
18101
18104
  onReply: handleReply,