@medipha/feed 0.0.0-stage → 0.1.1

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 (119) hide show
  1. package/dist/app/admin/newsfeed-admin-module.d.ts +3 -0
  2. package/dist/app/admin/newsfeed-admin-routes.d.ts +1 -0
  3. package/dist/app/header/feed-header.d.ts +1 -0
  4. package/dist/app/header/mentions-dropdown.d.ts +4 -0
  5. package/dist/app/newsfeed-module.d.ts +2 -0
  6. package/dist/app/newsfeed-module.types.d.ts +15 -0
  7. package/dist/app/newsfeed-routes.d.ts +1 -0
  8. package/dist/app/runtime/feed-runtime-context.d.ts +16 -0
  9. package/dist/app/runtime/feed-runtime-provider.d.ts +9 -0
  10. package/dist/app/runtime/feed-session.d.ts +11 -0
  11. package/dist/chunk-7ZGTUZFB-BT9LoQAb.cjs +1 -0
  12. package/dist/chunk-7ZGTUZFB-QFtA37kH.js +25972 -0
  13. package/dist/core/content.d.ts +19 -0
  14. package/dist/core/errors.d.ts +8 -0
  15. package/dist/core/feed-api.d.ts +134 -0
  16. package/dist/core/formatting.d.ts +55 -0
  17. package/dist/core/http.d.ts +18 -0
  18. package/dist/core/index.d.ts +16 -0
  19. package/dist/core/media-limits.d.ts +7 -0
  20. package/dist/core/mention.d.ts +10 -0
  21. package/dist/core/query-string.d.ts +3 -0
  22. package/dist/core/types.d.ts +208 -0
  23. package/dist/emojis-6L3GRBAP-Bdg3RGHz.js +5 -0
  24. package/dist/emojis-6L3GRBAP-DEEnjLJd.cjs +1 -0
  25. package/dist/features/comments/comment-composer.d.ts +10 -0
  26. package/dist/features/comments/comment-item.d.ts +12 -0
  27. package/dist/features/comments/comment-thread.d.ts +10 -0
  28. package/dist/features/comments/mention-box.d.ts +6 -0
  29. package/dist/features/comments/mention-filter.d.ts +8 -0
  30. package/dist/features/comments/mention-input.d.ts +4 -0
  31. package/dist/features/comments/mention-options.d.ts +3 -0
  32. package/dist/features/comments/post-comments-modal.d.ts +11 -0
  33. package/dist/features/comments/use-mention-search.d.ts +9 -0
  34. package/dist/features/composer/category-select.d.ts +8 -0
  35. package/dist/features/composer/composer-form.d.ts +19 -0
  36. package/dist/features/composer/create-post-button.d.ts +8 -0
  37. package/dist/features/composer/create-post-modal.d.ts +12 -0
  38. package/dist/features/composer/format-text.d.ts +26 -0
  39. package/dist/features/composer/format-toolbar.d.ts +21 -0
  40. package/dist/features/composer/media-picker.d.ts +18 -0
  41. package/dist/features/composer/post-preview-modal.d.ts +7 -0
  42. package/dist/features/feed/department-filter.d.ts +8 -0
  43. package/dist/features/feed/feed-page.d.ts +1 -0
  44. package/dist/features/feed/left-rail.d.ts +9 -0
  45. package/dist/features/feed/my-posts-page.d.ts +1 -0
  46. package/dist/features/feed/post-detail-page.d.ts +1 -0
  47. package/dist/features/feed/sidebar/category-nav.d.ts +9 -0
  48. package/dist/features/feed/sidebar/discussion-channels.d.ts +9 -0
  49. package/dist/features/feed/sidebar/feed-calendar.d.ts +12 -0
  50. package/dist/features/feed/sidebar/profile-card.d.ts +1 -0
  51. package/dist/features/feed/use-feed-filters.d.ts +15 -0
  52. package/dist/features/feed/widgets/birthdays-widget.d.ts +1 -0
  53. package/dist/features/feed/widgets/feed-footer.d.ts +1 -0
  54. package/dist/features/feed/widgets/mentions-widget.d.ts +1 -0
  55. package/dist/features/feed/widgets/post-detail-modal.d.ts +10 -0
  56. package/dist/features/feed/widgets/review-progress-widget.d.ts +3 -0
  57. package/dist/features/feed/widgets/top-contributors-widget.d.ts +1 -0
  58. package/dist/features/feed/widgets/trending-hashtags-widget.d.ts +8 -0
  59. package/dist/features/feed/widgets/weekly-highlight-widget.d.ts +1 -0
  60. package/dist/features/feed/widgets/widget-card.d.ts +9 -0
  61. package/dist/features/manage/categories/category-settings-page.d.ts +2 -0
  62. package/dist/features/manage/posts/author-select.d.ts +7 -0
  63. package/dist/features/manage/posts/manage-posts-page.d.ts +1 -0
  64. package/dist/features/manage/posts/post-summary-cell.d.ts +8 -0
  65. package/dist/features/manage/posts/review-drawer.d.ts +13 -0
  66. package/dist/features/manage/reports/overview-cards.d.ts +7 -0
  67. package/dist/features/manage/reports/period-switch.d.ts +8 -0
  68. package/dist/features/manage/reports/reports-page.d.ts +1 -0
  69. package/dist/features/manage/reports/top-posts-table.d.ts +8 -0
  70. package/dist/features/manage/reports/top-users-table.d.ts +5 -0
  71. package/dist/features/manage/reports/trend-chart.d.ts +4 -0
  72. package/dist/features/manage/settings/settings-page.d.ts +2 -0
  73. package/dist/features/post/card/confirm-delete-post.d.ts +2 -0
  74. package/dist/features/post/card/featured-tag.d.ts +2 -0
  75. package/dist/features/post/card/post-actions-menu.d.ts +7 -0
  76. package/dist/features/post/card/post-card.d.ts +15 -0
  77. package/dist/features/post/card/post-delete-button.d.ts +10 -0
  78. package/dist/features/post/card/post-header.d.ts +9 -0
  79. package/dist/features/post/card/post-status-tag.d.ts +5 -0
  80. package/dist/features/post/card/post-status.d.ts +13 -0
  81. package/dist/features/post/content/clamped-text.d.ts +11 -0
  82. package/dist/features/post/content/document-icon.d.ts +3 -0
  83. package/dist/features/post/content/document-preview-url.d.ts +7 -0
  84. package/dist/features/post/content/link-preview-card.d.ts +9 -0
  85. package/dist/features/post/content/mention-card.d.ts +8 -0
  86. package/dist/features/post/content/post-documents.d.ts +4 -0
  87. package/dist/features/post/content/post-images.d.ts +4 -0
  88. package/dist/features/post/content/post-videos.d.ts +4 -0
  89. package/dist/features/post/content/rich-content.d.ts +10 -0
  90. package/dist/features/post/content/use-link-preview.d.ts +15 -0
  91. package/dist/features/post/interactions/post-engagement-stats.d.ts +5 -0
  92. package/dist/features/post/interactions/post-reaction-bar.d.ts +11 -0
  93. package/dist/features/post/interactions/reaction-button.d.ts +11 -0
  94. package/dist/features/post/interactions/reaction-picker.d.ts +7 -0
  95. package/dist/features/post/interactions/reactors-modal.d.ts +8 -0
  96. package/dist/features/post/interactions/share-button.d.ts +11 -0
  97. package/dist/features/post/list/post-list.d.ts +10 -0
  98. package/dist/index.cjs +28 -0
  99. package/dist/index.d.ts +4 -0
  100. package/dist/index.js +11873 -0
  101. package/dist/shared/brand.d.ts +5 -0
  102. package/dist/shared/components/date-range-select.d.ts +8 -0
  103. package/dist/shared/components/emoji-picker.d.ts +6 -0
  104. package/dist/shared/components/page-header.d.ts +8 -0
  105. package/dist/shared/components/publisher-avatar.d.ts +3 -0
  106. package/dist/shared/components/typing-dots.d.ts +6 -0
  107. package/dist/shared/components/user-avatar.d.ts +7 -0
  108. package/dist/shared/hooks/use-async-data.d.ts +8 -0
  109. package/dist/shared/hooks/use-cursor-list.d.ts +18 -0
  110. package/dist/shared/hooks/use-in-view.d.ts +2 -0
  111. package/dist/shared/hooks/use-keyed-request.d.ts +8 -0
  112. package/dist/shared/hooks/use-optimistic-reaction.d.ts +10 -0
  113. package/dist/shared/utils/date-range.d.ts +7 -0
  114. package/dist/shared/utils/format.d.ts +7 -0
  115. package/dist/shared/utils/reactions.d.ts +8 -0
  116. package/dist/shared/utils/upload-error.d.ts +5 -0
  117. package/dist/styles.css +2 -0
  118. package/package.json +81 -3
  119. package/README.md +0 -3
@@ -0,0 +1,26 @@
1
+ import { TextColor, TextSize } from '../../core';
2
+ export type InlineFormat = 'bold' | 'italic' | 'underline' | 'strike';
3
+ export type LineFormat = 'heading' | 'bullets' | 'numbers' | 'quote';
4
+ export interface TextEdit {
5
+ text: string;
6
+ selectionStart: number;
7
+ selectionEnd: number;
8
+ }
9
+ /** Wraps the selection in the marker, or unwraps it when it is already wrapped. */
10
+ export declare function toggleInline(text: string, start: number, end: number, format: InlineFormat): TextEdit;
11
+ /** Inline formats already wrapping the selection, so the toolbar can show them as pressed. */
12
+ export declare function detectInline(text: string, start: number, end: number): InlineFormat[];
13
+ /** The prefixes of the line the caret sits on; lists and headings are per line, not per selection. */
14
+ export declare function detectLines(text: string, caret: number): LineFormat[];
15
+ /** Turns an Enter keypress into "next number / same bullet", or null to let the browser break. */
16
+ export declare function continueList(text: string, caret: number): TextEdit | null;
17
+ /** Adds the prefix to every selected line; removes it when all of them already have it. */
18
+ export declare function toggleLines(text: string, start: number, end: number, format: LineFormat): TextEdit;
19
+ /** Indents (or, with delta -1, outdents) every selected line by one level, capped at MAX_INDENT. */
20
+ export declare function shiftIndent(text: string, start: number, end: number, delta: 1 | -1): TextEdit;
21
+ /** Wraps the selection in "{color|…}", or recolours / uncolours the span the caret is in. */
22
+ export declare function toggleColor(text: string, start: number, end: number, color: TextColor): TextEdit;
23
+ /** Same for the size scale: "{lg|…}", or resizes / resets the span the caret is in. */
24
+ export declare function toggleSize(text: string, start: number, end: number, size: TextSize): TextEdit;
25
+ export declare function detectColor(text: string, caret: number): TextColor | null;
26
+ export declare function detectSize(text: string, caret: number): TextSize | null;
@@ -0,0 +1,21 @@
1
+ import { TextColor, TextSize } from '../../core';
2
+ import { InlineFormat, LineFormat } from './format-text';
3
+ interface FormatToolbarProps {
4
+ onInline: (format: InlineFormat) => void;
5
+ onLines: (format: LineFormat) => void;
6
+ /** Formats already wrapping the caret, so their buttons read as pressed. */
7
+ activeInline?: InlineFormat[];
8
+ activeLines?: LineFormat[];
9
+ onColor?: (color: TextColor) => void;
10
+ activeColor?: TextColor | null;
11
+ onIndent?: (delta: 1 | -1) => void;
12
+ onSize?: (size: TextSize) => void;
13
+ activeSize?: TextSize | null;
14
+ onUndo?: () => void;
15
+ onRedo?: () => void;
16
+ canUndo?: boolean;
17
+ canRedo?: boolean;
18
+ }
19
+ /** Formatting buttons above the composer; the post keeps Markdown-style markers in its text. */
20
+ export declare function FormatToolbar({ onInline, onLines, activeInline, activeLines, onColor, activeColor, onIndent, onSize, activeSize, onUndo, onRedo, canUndo, canRedo, }: FormatToolbarProps): import('react/jsx-runtime').JSX.Element;
21
+ export {};
@@ -0,0 +1,18 @@
1
+ import { FeedMedia } from '../../core';
2
+ export declare const MAX_POST_MEDIA = 10;
3
+ interface MediaPickerButtonsProps {
4
+ count: number;
5
+ disabled?: boolean;
6
+ variant?: 'label' | 'icon';
7
+ onUploadStart: () => void;
8
+ onUploaded: (media: FeedMedia | null) => void;
9
+ onQuestion?: () => void;
10
+ }
11
+ export declare function MediaPickerButtons({ count, disabled, variant, onUploadStart, onUploaded, onQuestion, }: MediaPickerButtonsProps): import('react/jsx-runtime').JSX.Element;
12
+ interface AttachedMediaProps {
13
+ media: FeedMedia[];
14
+ uploadingCount: number;
15
+ onRemove: (mediaId: string) => void;
16
+ }
17
+ export declare function AttachedMedia({ media, uploadingCount, onRemove }: AttachedMediaProps): import('react/jsx-runtime').JSX.Element | null;
18
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FeedPost } from '../../core';
2
+ interface PostPreviewModalProps {
3
+ post: FeedPost | null;
4
+ onClose: () => void;
5
+ }
6
+ export declare function PostPreviewModal({ post, onClose }: PostPreviewModalProps): import('react/jsx-runtime').JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ interface DepartmentFilterProps {
2
+ value: string | null;
3
+ onChange: (departmentId: string | null) => void;
4
+ size?: 'small' | 'middle';
5
+ className?: string;
6
+ }
7
+ export declare function DepartmentFilter({ value, onChange, size, className, }: DepartmentFilterProps): import('react/jsx-runtime').JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare function FeedPage(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { FeedCategory } from '../../core';
2
+ import { FeedFilters } from './use-feed-filters';
3
+ interface LeftRailProps {
4
+ categories: FeedCategory[];
5
+ filters: FeedFilters;
6
+ onSelect: (filters: Partial<FeedFilters>) => void;
7
+ }
8
+ export declare function LeftRail({ categories, filters, onSelect }: LeftRailProps): import('react/jsx-runtime').JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export declare function MyPostsPage(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function PostDetailPage(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { FeedCategory } from '../../../core';
2
+ import { FeedFilters } from '../use-feed-filters';
3
+ interface CategoryNavProps {
4
+ categories: FeedCategory[];
5
+ filters: FeedFilters;
6
+ onSelect: (filters: Partial<FeedFilters>) => void;
7
+ }
8
+ export declare function CategoryNav({ categories, filters, onSelect }: CategoryNavProps): import('react/jsx-runtime').JSX.Element;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import { TrendingHashtag } from '../../../core';
2
+ import { FeedFilters } from '../use-feed-filters';
3
+ interface DiscussionChannelsProps {
4
+ hashtags: TrendingHashtag[];
5
+ filters: FeedFilters;
6
+ onSelect: (filters: Partial<FeedFilters>) => void;
7
+ }
8
+ export declare function DiscussionChannels({ hashtags, filters, onSelect }: DiscussionChannelsProps): import('react/jsx-runtime').JSX.Element | null;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ import { FeedFilters } from '../use-feed-filters';
2
+ interface FeedCalendarProps {
3
+ filters: FeedFilters;
4
+ onSelect: (filters: Partial<FeedFilters>) => void;
5
+ }
6
+ /**
7
+ * Compact month grid with range selection:
8
+ * first click sets the start day, second click sets the end day (auto-swapped if needed),
9
+ * clicking the same day again clears the range.
10
+ */
11
+ export declare function FeedCalendar({ filters, onSelect }: FeedCalendarProps): import('react/jsx-runtime').JSX.Element;
12
+ export {};
@@ -0,0 +1 @@
1
+ export declare function ProfileCard(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,15 @@
1
+ export interface FeedFilters {
2
+ q: string | null;
3
+ categoryId: string | null;
4
+ departmentId: string | null;
5
+ hashtag: string | null;
6
+ /** Inclusive day range (YYYY-MM-DD) picked on the sidebar calendar. */
7
+ from: string | null;
8
+ to: string | null;
9
+ }
10
+ export declare function readFeedFilters(searchParams: URLSearchParams): FeedFilters;
11
+ export declare function buildFeedSearch(filters: Partial<FeedFilters>): string;
12
+ export declare function useFeedFilters(): {
13
+ filters: FeedFilters;
14
+ setFilters: (next: Partial<FeedFilters>) => void;
15
+ };
@@ -0,0 +1 @@
1
+ export declare function BirthdaysWidget(): import('react/jsx-runtime').JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare function FeedFooter(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function MentionsWidget(): import('react/jsx-runtime').JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ import { FeedPost } from '../../../core';
2
+ interface PostDetailModalProps {
3
+ post: FeedPost | null;
4
+ onClose: () => void;
5
+ onChange: (post: FeedPost) => void;
6
+ onRemoved?: (postId: string) => void;
7
+ }
8
+ /** "Chi tiết" on a highlight opens the whole post in a modal instead of a separate route. */
9
+ export declare function PostDetailModal({ post, onClose, onChange, onRemoved }: PostDetailModalProps): import('react/jsx-runtime').JSX.Element;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function ReviewProgressWidget({ onApproved }: {
2
+ onApproved: () => void;
3
+ }): import('react/jsx-runtime').JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare function TopContributorsWidget(): import('react/jsx-runtime').JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import { TrendingHashtag } from '../../../core';
2
+ import { FeedFilters } from '../use-feed-filters';
3
+ interface TrendingHashtagsWidgetProps {
4
+ hashtags: TrendingHashtag[];
5
+ onSelect: (filters: Partial<FeedFilters>) => void;
6
+ }
7
+ export declare function TrendingHashtagsWidget({ hashtags, onSelect }: TrendingHashtagsWidgetProps): import('react/jsx-runtime').JSX.Element | null;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare function WeeklyHighlightWidget(): import('react/jsx-runtime').JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ interface WidgetCardProps {
3
+ title: ReactNode;
4
+ icon?: ReactNode;
5
+ extra?: ReactNode;
6
+ children: ReactNode;
7
+ }
8
+ export declare function WidgetCard({ title, icon, extra, children }: WidgetCardProps): import('react/jsx-runtime').JSX.Element;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Admin settings: create, edit, hide and delete the newsfeed categories. */
2
+ export declare function CategorySettingsPage(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,7 @@
1
+ interface AuthorSelectProps {
2
+ value?: string;
3
+ onChange: (authorId: string | undefined) => void;
4
+ placeholder?: string;
5
+ }
6
+ export declare function AuthorSelect({ value, onChange, placeholder, }: AuthorSelectProps): import('react/jsx-runtime').JSX.Element;
7
+ export {};
@@ -0,0 +1 @@
1
+ export declare function ManagePostsPage(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { FeedPost } from '../../../core';
2
+ interface PostSummaryCellProps {
3
+ post: FeedPost;
4
+ onOpen: (post: FeedPost) => void;
5
+ }
6
+ /** Thumbnail, two lines of text and the date it was sent; clicking opens the post. */
7
+ export declare function PostSummaryCell({ post, onOpen }: PostSummaryCellProps): import('react/jsx-runtime').JSX.Element;
8
+ export {};
@@ -0,0 +1,13 @@
1
+ import { FeedPost } from '../../../core';
2
+ interface ReviewDrawerProps {
3
+ post: FeedPost | null;
4
+ onClose: () => void;
5
+ onChanged: (post: FeedPost) => void;
6
+ onRemoved: (postId: string) => void;
7
+ /** Opens the composer on an unpublished post; without it the drawer offers no "Sửa". */
8
+ onEdit?: (post: FeedPost) => void;
9
+ /** Reports: look only, no moderation buttons. */
10
+ readOnly?: boolean;
11
+ }
12
+ export declare function ReviewDrawer({ post, onClose, onChanged, onRemoved, onEdit, readOnly, }: ReviewDrawerProps): import('react/jsx-runtime').JSX.Element;
13
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ReportsOverview } from '../../../core';
2
+ interface OverviewCardsProps {
3
+ overview: ReportsOverview | undefined;
4
+ loading: boolean;
5
+ }
6
+ export declare function OverviewCards({ overview, loading }: OverviewCardsProps): import('react/jsx-runtime').JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { DateRangeChoice } from '../../../shared/utils/date-range';
2
+ interface PeriodSwitchProps {
3
+ value: DateRangeChoice;
4
+ onChange: (choice: DateRangeChoice) => void;
5
+ }
6
+ /** Ngày / Tuần / Tháng shortcuts kept in step with the date range next to them. */
7
+ export declare function PeriodSwitch({ value, onChange }: PeriodSwitchProps): import('react/jsx-runtime').JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare function ReportsPage(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ReportFilterParams } from '../../../core';
2
+ /**
3
+ * Tab content of the reports page. `range` is the page filter (dates + department); the tab can
4
+ * narrow the dates and search the text without touching the rest of the page.
5
+ */
6
+ export declare function TopPostsTable({ range }: {
7
+ range: ReportFilterParams;
8
+ }): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ReportFilterParams } from '../../../core';
2
+ /** Tab content: the most active people, or one chosen employee's numbers. */
3
+ export declare function TopUsersTable({ range }: {
4
+ range: ReportFilterParams;
5
+ }): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { ReportFilterParams } from '../../../core';
2
+ export declare function TrendChart({ range }: {
3
+ range: ReportFilterParams;
4
+ }): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,2 @@
1
+ /** "Cấu hình" section: a tab per setting page, so more settings can be added beside categories. */
2
+ export declare function SettingsPage(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,2 @@
1
+ /** The one delete confirmation every entry point goes through. */
2
+ export declare function confirmDeletePost(onConfirm: () => Promise<unknown>): void;
@@ -0,0 +1,2 @@
1
+ /** "Nổi bật" pill for a pinned post; the same one on the feed and in the admin tables. */
2
+ export declare function FeaturedTag(): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { FeedPost } from '../../../core';
2
+ interface PostActionsMenuProps {
3
+ post: FeedPost;
4
+ onChange: (post: FeedPost) => void;
5
+ }
6
+ export declare function PostActionsMenu({ post, onChange }: PostActionsMenuProps): import('react/jsx-runtime').JSX.Element | null;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ import { FeedPost } from '../../../core';
3
+ export interface PostCardProps {
4
+ post: FeedPost;
5
+ /** modal: the full post inside the comments modal, comments open with the composer at the bottom. */
6
+ mode?: 'feed' | 'detail' | 'preview' | 'modal';
7
+ footer?: ReactNode;
8
+ onChange?: (post: FeedPost) => void;
9
+ onRemoved?: (postId: string) => void;
10
+ /** modal mode: where the comment composer renders, outside the scrolling area. */
11
+ composerSlot?: HTMLElement | null;
12
+ /** Posted-at links to the post page; on by default in the feed only, where it leads somewhere new. */
13
+ linkTime?: boolean;
14
+ }
15
+ export declare function PostCard({ post, mode, footer, onChange, onRemoved, composerSlot, linkTime, }: PostCardProps): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { FeedPost } from '../../../core';
2
+ interface PostDeleteButtonProps {
3
+ post: FeedPost;
4
+ onRemoved: (postId: string) => void;
5
+ /** Labelled danger button instead of the compact X. */
6
+ labelled?: boolean;
7
+ }
8
+ /** Delete per status rules (see canDeletePost). */
9
+ export declare function PostDeleteButton({ post, onRemoved, labelled }: PostDeleteButtonProps): import('react/jsx-runtime').JSX.Element | null;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { FeedPost } from '../../../core';
3
+ interface PostHeaderProps {
4
+ post: FeedPost;
5
+ linkToDetail: boolean;
6
+ extra?: ReactNode;
7
+ }
8
+ export declare function PostHeader({ post, linkToDetail, extra }: PostHeaderProps): import('react/jsx-runtime').JSX.Element;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ import { PostStatus } from '../../../core';
2
+ export declare function PostStatusTag({ status, short }: {
3
+ status: PostStatus;
4
+ short?: boolean;
5
+ }): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { FeedMe, FeedPost, PostStatus } from '../../../core';
2
+ export declare const POST_STATUS_META: Record<PostStatus, {
3
+ label: string;
4
+ shortLabel: string;
5
+ color: string;
6
+ background: string;
7
+ }>;
8
+ type Viewer = Pick<FeedMe, 'userId' | 'canManage'>;
9
+ /** DRAFT/PENDING: author or manager; UNPUBLISHED: manager only. */
10
+ export declare function canDeletePost(post: FeedPost, me: Viewer): boolean;
11
+ /** DRAFT/PENDING: author; UNPUBLISHED: manager (saving sends it back to review). */
12
+ export declare function canEditPost(post: FeedPost, me: Viewer): boolean;
13
+ export {};
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ interface ClampedTextProps {
3
+ children: ReactNode;
4
+ /** Lines kept while collapsed; 1 seats the pill at the end of that single line, more stacks it below. */
5
+ lines?: number;
6
+ /** Extra class for the clamped box — rich content brings its own typography onto it. */
7
+ className?: string;
8
+ }
9
+ /** Cuts long post text to a few lines ending in "..." with a "Xem thêm" toggle. */
10
+ export declare function ClampedText({ children, lines, className }: ClampedTextProps): import('react/jsx-runtime').JSX.Element;
11
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function DocumentIcon({ fileName }: {
2
+ fileName: string;
3
+ }): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { FeedMedia } from '../../../core';
2
+ /**
3
+ * The page that shows the file: PDFs open in the browser's own viewer, Office files in Microsoft's
4
+ * online viewer (it fetches the file itself, so the file URL must be reachable from the internet).
5
+ * Anything else just opens the file.
6
+ */
7
+ export declare function documentViewUrl(document: FeedMedia): string;
@@ -0,0 +1,9 @@
1
+ import { LinkPreviewModel } from './use-link-preview';
2
+ interface LinkPreviewCardProps {
3
+ /** Composer: the card loads its own preview for this URL. */
4
+ url?: string;
5
+ /** Post card: a model shared with the text, which hides the URL while the card shows it. */
6
+ model?: LinkPreviewModel;
7
+ }
8
+ export declare function LinkPreviewCard({ url: urlProp, model }: LinkPreviewCardProps): import('react/jsx-runtime').JSX.Element | null;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FeedUser } from '../../../core';
2
+ interface MentionTagProps {
3
+ /** Null when the tagged person is no longer known: the tag stays plain text. */
4
+ user: FeedUser | null;
5
+ }
6
+ /** "@Name" inside a post or comment; clicking it opens who that colleague is. */
7
+ export declare function MentionTag({ user }: MentionTagProps): import('react/jsx-runtime').JSX.Element;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ import { FeedMedia } from '../../../core';
2
+ export declare function PostDocuments({ documents }: {
3
+ documents: FeedMedia[];
4
+ }): import('react/jsx-runtime').JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import { FeedMedia } from '../../../core';
2
+ export declare function PostImages({ images }: {
3
+ images: FeedMedia[];
4
+ }): import('react/jsx-runtime').JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import { FeedMedia } from '../../../core';
2
+ export declare function PostVideos({ videos }: {
3
+ videos: FeedMedia[];
4
+ }): import('react/jsx-runtime').JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ import { FeedUser } from '../../../core';
2
+ interface RichContentProps {
3
+ content: string;
4
+ mentionedUsers: FeedUser[];
5
+ collapsible?: boolean;
6
+ /** Lines kept before "Xem thêm"; takes over from the word clamp, which cannot see line breaks. */
7
+ clampLines?: number;
8
+ }
9
+ export declare function RichContent({ content, mentionedUsers, collapsible, clampLines, }: RichContentProps): import('react/jsx-runtime').JSX.Element;
10
+ export {};
@@ -0,0 +1,15 @@
1
+ import { FeedApi, LinkPreview } from '../../../core';
2
+ export declare function useLinkPreview(api: FeedApi, url: string): import('../../../shared/hooks/use-async-data').AsyncData<LinkPreview | null>;
3
+ export declare function hostnameOf(url: string): string;
4
+ /** Google Maps links (long and short forms): shown neither as a card nor as text. */
5
+ export declare function isMapUrl(url: string): boolean;
6
+ export type LinkPreviewModel = ReturnType<typeof useLinkPreviewModel>;
7
+ /** Shared by the card and the post body, which drops the URL from the text once the card shows it. */
8
+ export declare function useLinkPreviewModel(url: string | null): {
9
+ url: string | null;
10
+ preview: LinkPreview | null | undefined;
11
+ loading: boolean;
12
+ youtubeId: string | null;
13
+ renders: boolean;
14
+ isMap: boolean;
15
+ };
@@ -0,0 +1,5 @@
1
+ import { FeedPost } from '../../../core';
2
+ /** Read-only counters for the admin side, in place of the Like / Comment / Share row. */
3
+ export declare function PostEngagementStats({ post }: {
4
+ post: FeedPost;
5
+ }): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { FeedPost } from '../../../core';
2
+ interface PostReactionBarProps {
3
+ post: FeedPost;
4
+ disabled?: boolean;
5
+ /** Read-only view: counts stay visible, reacting and sharing are disabled. */
6
+ readOnly?: boolean;
7
+ onChange: (post: FeedPost) => void;
8
+ onToggleComments: () => void;
9
+ }
10
+ export declare function PostReactionBar({ post, disabled, readOnly, onChange, onToggleComments, }: PostReactionBarProps): import('react/jsx-runtime').JSX.Element;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { ReactionType } from '../../../core';
2
+ interface ReactionButtonProps {
3
+ myReaction: ReactionType | null;
4
+ disabled?: boolean;
5
+ compact?: boolean;
6
+ count?: number;
7
+ onReact: (type: ReactionType | null) => void;
8
+ }
9
+ /** One gesture: like and unlike — no picker, no emoji menu. */
10
+ export declare function ReactionButton({ myReaction, disabled, compact, count, onReact, }: ReactionButtonProps): import('react/jsx-runtime').JSX.Element;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ReactionType } from '../../../core';
2
+ export declare function ReactionPicker({ onPick }: {
3
+ onPick: (type: ReactionType) => void;
4
+ }): import('react/jsx-runtime').JSX.Element;
5
+ export declare function ReactionSummaryIcons({ types }: {
6
+ types: ReactionType[];
7
+ }): import('react/jsx-runtime').JSX.Element;
@@ -0,0 +1,8 @@
1
+ interface ReactorsModalProps {
2
+ postId: string;
3
+ open: boolean;
4
+ onClose: () => void;
5
+ }
6
+ /** Facebook-style "who reacted": an "all" tab plus one tab per reaction type with its count. */
7
+ export declare function ReactorsModal({ postId, open, onClose }: ReactorsModalProps): import('react/jsx-runtime').JSX.Element;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { FeedPost } from '../../../core';
2
+ interface ShareButtonProps {
3
+ post: FeedPost;
4
+ label?: string;
5
+ /** Footer row: the share count replaces the label. */
6
+ count?: number;
7
+ disabled?: boolean;
8
+ onChange: (post: FeedPost) => void;
9
+ }
10
+ export declare function ShareButton({ post, label, count, disabled, onChange, }: ShareButtonProps): import('react/jsx-runtime').JSX.Element;
11
+ export {};
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ import { FeedPost } from '../../../core';
3
+ import { CursorList } from '../../../shared/hooks/use-cursor-list';
4
+ interface PostListProps {
5
+ list: CursorList<FeedPost>;
6
+ emptyText: string;
7
+ renderFooter?: (post: FeedPost) => ReactNode;
8
+ }
9
+ export declare function PostList({ list, emptyText, renderFooter }: PostListProps): import('react/jsx-runtime').JSX.Element;
10
+ export {};