impact-nova 2.5.16 → 2.6.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -25
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +28 -1
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.d.ts +0 -3
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +31 -38
- package/dist/components/data/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.d.ts +9 -0
- package/dist/components/data/ag-grid-react/chat/chat-capabilities.js +22 -0
- package/dist/components/data/ag-grid-react/chat/chat-column.d.ts +20 -0
- package/dist/components/data/ag-grid-react/chat/chat-column.js +81 -0
- package/dist/components/data/ag-grid-react/chat/chat-composer.d.ts +10 -0
- package/dist/components/data/ag-grid-react/chat/chat-composer.js +352 -0
- package/dist/components/data/ag-grid-react/chat/chat-constants.d.ts +17 -0
- package/dist/components/data/ag-grid-react/chat/chat-constants.js +22 -0
- package/dist/components/data/ag-grid-react/chat/chat-format.d.ts +41 -0
- package/dist/components/data/ag-grid-react/chat/chat-format.js +94 -0
- package/dist/components/data/ag-grid-react/chat/chat-host.d.ts +10 -0
- package/dist/components/data/ag-grid-react/chat/chat-host.js +651 -0
- package/dist/components/data/ag-grid-react/chat/chat-host.types.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-html.d.ts +2 -0
- package/dist/components/data/ag-grid-react/chat/chat-html.js +40 -0
- package/dist/components/data/ag-grid-react/chat/chat-identity.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-identity.js +24 -0
- package/dist/components/data/ag-grid-react/chat/chat-menu.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-menu.js +15 -0
- package/dist/components/data/ag-grid-react/chat/chat-notify.d.ts +17 -0
- package/dist/components/data/ag-grid-react/chat/chat-notify.js +124 -0
- package/dist/components/data/ag-grid-react/chat/chat-persist.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-persist.js +34 -0
- package/dist/components/data/ag-grid-react/chat/chat-priority.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-priority.js +79 -0
- package/dist/components/data/ag-grid-react/chat/chat-summaries.d.ts +2 -0
- package/dist/components/data/ag-grid-react/chat/chat-summaries.js +24 -0
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.d.ts +72 -0
- package/dist/components/data/ag-grid-react/chat/chat-thread-ui.js +713 -0
- package/dist/components/data/ag-grid-react/chat/chat-toggle.d.ts +6 -0
- package/dist/components/data/ag-grid-react/chat/chat-toggle.js +25 -0
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.d.ts +13 -0
- package/dist/components/data/ag-grid-react/chat/chat-ui-actions.js +26 -0
- package/dist/components/data/ag-grid-react/chat/chat-window.d.ts +14 -0
- package/dist/components/data/ag-grid-react/chat/chat-window.js +82 -0
- package/dist/components/data/ag-grid-react/chat/chat-workspace.d.ts +91 -0
- package/dist/components/data/ag-grid-react/chat/chat-workspace.js +555 -0
- package/dist/components/data/ag-grid-react/chat/chat.types.d.ts +319 -0
- package/dist/components/data/ag-grid-react/chat/index.d.ts +6 -0
- package/dist/components/data/ag-grid-react/chat/index.js +24 -0
- package/dist/components/data/ag-grid-react/chat.story-data.d.ts +34 -0
- package/dist/components/data/ag-grid-react/chat.story-sources.d.ts +4 -0
- package/dist/components/data/ag-grid-react/comments/assets/comments-no-results.png.js +4 -0
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.d.ts +6 -0
- package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.js +29 -0
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.d.ts +8 -0
- package/dist/components/data/ag-grid-react/comments/comments-actions-menu.js +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.d.ts +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.js +16 -0
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.d.ts +11 -0
- package/dist/components/data/ag-grid-react/comments/comments-capabilities.js +26 -0
- package/dist/components/data/ag-grid-react/comments/comments-constants.d.ts +12 -0
- package/dist/components/data/ag-grid-react/comments/comments-constants.js +21 -0
- package/dist/components/data/ag-grid-react/comments/comments-format.d.ts +20 -0
- package/dist/components/data/ag-grid-react/comments/comments-format.js +49 -0
- package/dist/components/data/ag-grid-react/comments/comments-generation.d.ts +14 -0
- package/dist/components/data/ag-grid-react/comments/comments-generation.js +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-host.d.ts +10 -0
- package/dist/components/data/ag-grid-react/comments/comments-host.js +343 -0
- package/dist/components/data/ag-grid-react/comments/comments-host.types.d.ts +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-identity.d.ts +7 -0
- package/dist/components/data/ag-grid-react/comments/comments-identity.js +20 -0
- package/dist/components/data/ag-grid-react/comments/comments-menu.d.ts +29 -0
- package/dist/components/data/ag-grid-react/comments/comments-menu.js +35 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.d.ts +22 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.js +98 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay.d.ts +21 -0
- package/dist/components/data/ag-grid-react/comments/comments-overlay.js +406 -0
- package/dist/components/data/ag-grid-react/comments/comments-panel.d.ts +9 -0
- package/dist/components/data/ag-grid-react/comments/comments-panel.js +272 -0
- package/dist/components/data/ag-grid-react/comments/comments-persist.d.ts +11 -0
- package/dist/components/data/ag-grid-react/comments/comments-persist.js +19 -0
- package/dist/components/data/ag-grid-react/comments/comments-reveal.d.ts +11 -0
- package/dist/components/data/ag-grid-react/comments/comments-reveal.js +31 -0
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.d.ts +18 -0
- package/dist/components/data/ag-grid-react/comments/comments-ui-actions.js +22 -0
- package/dist/components/data/ag-grid-react/comments/comments-window.d.ts +10 -0
- package/dist/components/data/ag-grid-react/comments/comments-window.js +62 -0
- package/dist/components/data/ag-grid-react/comments/comments.types.d.ts +178 -0
- package/dist/components/data/ag-grid-react/comments/index.d.ts +5 -0
- package/dist/components/data/ag-grid-react/comments/index.js +15 -0
- package/dist/components/data/ag-grid-react/comments-cell-renderers-showcase.d.ts +25 -0
- package/dist/components/data/ag-grid-react/comments.story-data.d.ts +37 -0
- package/dist/components/data/ag-grid-react/comments.story-sources.d.ts +11 -0
- package/dist/components/data/ag-grid-react/grid-cell-address.d.ts +21 -0
- package/dist/components/data/ag-grid-react/grid-cell-address.js +21 -0
- package/dist/components/data/ag-grid-react/grid-row-reveal.d.ts +34 -0
- package/dist/components/data/ag-grid-react/grid-row-reveal.js +33 -0
- package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +75 -65
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +54 -54
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +1 -1
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +122 -119
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.d.ts +2 -1
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +25 -20
- package/dist/components/data/ag-grid-react/headers/utils/filter-utils.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +481 -254
- package/dist/components/data/ag-grid-react/notes/index.d.ts +2 -0
- package/dist/components/data/ag-grid-react/notes/index.js +1 -0
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.d.ts +25 -0
- package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.js +32 -0
- package/dist/components/data/ag-grid-react/notes/notes-constants.d.ts +2 -0
- package/dist/components/data/ag-grid-react/notes/notes-constants.js +4 -0
- package/dist/components/data/ag-grid-react/notes/notes.types.d.ts +12 -0
- package/dist/components/data/ag-grid-react/notes.story-sources.d.ts +7 -0
- package/dist/components/data/ag-grid-react/nova-system-column.d.ts +7 -0
- package/dist/components/data/ag-grid-react/nova-system-column.js +18 -0
- package/dist/components/data/ag-grid-react/theme.js +6 -2
- package/dist/components/data/ag-grid-react/value-formatter.types.d.ts +4 -0
- package/dist/components/data/ag-grid-react/value-formatters.d.ts +0 -19
- package/dist/components/data/ag-grid-react/value-formatters.js +88 -90
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +0 -1
- package/dist/components/data/data-table/build-column-tree-from-grid.js +49 -53
- package/dist/components/data/data-table/data-table-column-apply.d.ts +0 -2
- package/dist/components/data/data-table/data-table-column-apply.js +73 -84
- package/dist/components/data/data-table/data-table-column-def-pin.js +34 -31
- package/dist/components/data/data-table/data-table-column-list.js +64 -94
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +6 -12
- package/dist/components/data/data-table/data-table-column-tree-cache.js +131 -250
- package/dist/components/data/data-table/data-table-context.js +5 -5
- package/dist/components/data/data-table/data-table-sheet-context.js +1 -1
- package/dist/components/data/data-table/data-table-sheet.js +2 -1
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +0 -5
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +11 -28
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +0 -10
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +196 -250
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +2 -10
- package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
- package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
- package/dist/components/data/nested-list/components/SortableItem.js +60 -62
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
- package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
- package/dist/components/data/nested-list/nested-list-constants.js +4 -10
- package/dist/components/data/nested-list/nested-list.js +336 -322
- package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
- package/dist/components/data-display/calendar/calendar-config.js +22 -21
- package/dist/components/data-display/calendar/calendar-day-button.js +21 -21
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +36 -35
- package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +3 -3
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +50 -62
- package/dist/components/data-display/calendar/calendar.js +138 -137
- package/dist/components/data-display/calendar/fiscal-period-caption-select.js +23 -22
- package/dist/components/data-display/calendar/use-calendar-i18n.d.ts +1 -0
- package/dist/components/data-display/calendar/use-calendar-i18n.js +10 -9
- package/dist/components/data-display/chart/chart.js +72 -72
- package/dist/components/data-display/chart/chart.utils.d.ts +1 -1
- package/dist/components/data-display/chart/chart.utils.js +40 -31
- package/dist/components/feedback/sheet/sheet.js +1 -1
- package/dist/components/feedback/toast/toast.d.ts +1 -1
- package/dist/components/feedback/toast/toast.variants.d.ts +1 -1
- package/dist/components/flows/filter-panel/filter-panel.d.ts +1 -1
- package/dist/components/flows/filter-panel/filter-panel.js +65 -64
- package/dist/components/flows/filter-panel/filter-panel.types.d.ts +1 -0
- package/dist/components/forms/date-picker/date-picker.js +125 -126
- package/dist/components/forms/date-picker/date-range-picker.js +191 -192
- package/dist/components/forms/date-picker/multi-date-picker.js +66 -67
- package/dist/components/forms/date-picker/multi-week-picker.js +82 -83
- package/dist/components/forms/date-picker/use-picker-i18n.d.ts +6 -0
- package/dist/components/forms/date-picker/use-picker-i18n.js +11 -0
- package/dist/components/forms/date-picker/week-picker.js +146 -147
- package/dist/components/forms/date-picker/week-range-picker.js +158 -159
- package/dist/components/ui/local-raster-icons/message3d.webp.js +4 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +1 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.js +27 -25
- package/dist/form-react/Fields/WeekRangePicker.js +16 -16
- package/dist/i18n/defaultMessages.d.ts +144 -0
- package/dist/i18n/defaultMessages.js +161 -19
- package/dist/i18n/format/collator.d.ts +1 -0
- package/dist/i18n/format/collator.js +7 -0
- package/dist/i18n/format/date-pattern.d.ts +5 -0
- package/dist/i18n/format/date-pattern.js +20 -0
- package/dist/i18n/format/format-date.d.ts +9 -0
- package/dist/i18n/format/format-date.js +56 -0
- package/dist/i18n/format/format-number.d.ts +20 -0
- package/dist/i18n/format/format-number.js +68 -0
- package/dist/i18n/format/formatter-cache.d.ts +9 -0
- package/dist/i18n/format/formatter-cache.js +66 -0
- package/dist/i18n/format/index.d.ts +6 -0
- package/dist/i18n/format/parse-number.d.ts +6 -0
- package/dist/i18n/format/parse-number.js +53 -0
- package/dist/i18n/getDateFnsLocale.d.ts +5 -4
- package/dist/i18n/getDateFnsLocale.js +46 -16
- package/dist/i18n/i18n.types.d.ts +13 -0
- package/dist/i18n/impact-nova-i18n-context.d.ts +1 -1
- package/dist/i18n/impact-nova-i18n-context.js +33 -25
- package/dist/i18n/impact-nova-i18n-defaults.js +8 -6
- package/dist/i18n/index.d.ts +4 -1
- package/dist/i18n/index.js +41 -16
- package/dist/i18n/locale-config.d.ts +28 -0
- package/dist/i18n/locale-config.js +32 -0
- package/dist/i18n/locales/de.js +142 -0
- package/dist/i18n/locales/es.js +142 -0
- package/dist/i18n/locales/hi.js +142 -0
- package/dist/i18n/locales/kn.js +142 -0
- package/dist/i18n/week-start.d.ts +6 -0
- package/dist/i18n/week-start.js +30 -0
- package/dist/impact-nova-components.css +249 -0
- package/dist/impact-nova-tokens.scss +6 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +624 -601
- package/dist/llms/index.js +26 -2
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/best-practices.js +1 -1
- package/dist/llms/rules/data-table-chat.js +1 -0
- package/dist/llms/rules/data-table-comments.js +1 -0
- package/dist/llms/rules/data-table-notes.js +1 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/migration.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/llms/rules/troubleshooting.js +1 -1
- package/dist/providers/app-providers.d.ts +3 -1
- package/dist/providers/app-providers.js +22 -11
- package/package.json +13 -1
- package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
- package/dist/components/data/data-table/column-picker-authority.js +0 -116
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
- package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
- package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
- package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
- package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
- package/dist/lib/hash/fnv1a128.d.ts +0 -16
- package/dist/lib/hash/fnv1a128.js +0 -21
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface CommentModeToggleProps {
|
|
2
|
+
pressed: boolean;
|
|
3
|
+
onPressedChange: (pressed: boolean) => void;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function CommentModeToggle({ pressed, onPressedChange, disabled, }: CommentModeToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useImpactNovaI18n as a } from "../../../../i18n/use-impact-nova-i18n.js";
|
|
3
|
+
import { Button as c } from "../../../primitives/button/button.js";
|
|
4
|
+
import { cn as i } from "../../../../lib/utils.js";
|
|
5
|
+
function f({
|
|
6
|
+
pressed: o,
|
|
7
|
+
onPressedChange: t,
|
|
8
|
+
disabled: m
|
|
9
|
+
}) {
|
|
10
|
+
const { t: n } = a();
|
|
11
|
+
return /* @__PURE__ */ e(
|
|
12
|
+
c,
|
|
13
|
+
{
|
|
14
|
+
type: "button",
|
|
15
|
+
size: "sm",
|
|
16
|
+
variant: o ? "default" : "outline",
|
|
17
|
+
"aria-pressed": o,
|
|
18
|
+
disabled: m,
|
|
19
|
+
"data-component": "comment-mode-toggle",
|
|
20
|
+
"data-iv-comments-mode": "",
|
|
21
|
+
className: i(o && "shadow-none"),
|
|
22
|
+
onClick: () => t(!o),
|
|
23
|
+
children: n("comments.commentMode")
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
f as CommentModeToggle
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CommentMenuItem } from './comments.types';
|
|
3
|
+
export declare function CommentActionsMenu({ label, items, render, align, }: {
|
|
4
|
+
label: string;
|
|
5
|
+
items: CommentMenuItem[];
|
|
6
|
+
render?: (items: CommentMenuItem[]) => ReactNode;
|
|
7
|
+
align?: "start" | "end";
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as n, Fragment as l, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { Button as a } from "../../../primitives/button/button.js";
|
|
3
|
+
import { DropdownMenu as u, DropdownMenuTrigger as c, DropdownMenuContent as s, DropdownMenuItem as p } from "../../../feedback/dropdown-menu/dropdown-menu.js";
|
|
4
|
+
import { ThreeDots as h } from "impact-nova-icons";
|
|
5
|
+
function D({
|
|
6
|
+
label: t,
|
|
7
|
+
items: e,
|
|
8
|
+
render: o,
|
|
9
|
+
align: i
|
|
10
|
+
}) {
|
|
11
|
+
return o ? /* @__PURE__ */ n(l, { children: o(e) }) : e.length === 0 ? null : /* @__PURE__ */ d(u, { children: [
|
|
12
|
+
/* @__PURE__ */ n(c, { asChild: !0, children: /* @__PURE__ */ n(a, { type: "button", size: "iconSm", variant: "ghost", className: "[&_svg]:size-4", "aria-label": t, children: /* @__PURE__ */ n(h, {}) }) }),
|
|
13
|
+
/* @__PURE__ */ n(s, { align: i, children: e.map((r) => /* @__PURE__ */ n(p, { disabled: r.disabled, onSelect: r.onSelect, children: r.label }, r.id)) })
|
|
14
|
+
] });
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
D as CommentActionsMenu
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GridCellAddress } from '../grid-cell-address';
|
|
2
|
+
import { IV_HAS_CELL_COMMENT } from './comments-constants';
|
|
3
|
+
export { IV_HAS_CELL_COMMENT };
|
|
4
|
+
export type CommentCellClassParams = {
|
|
5
|
+
node?: {
|
|
6
|
+
id?: string | null;
|
|
7
|
+
} | null;
|
|
8
|
+
column?: {
|
|
9
|
+
getColId?: () => string;
|
|
10
|
+
} | null;
|
|
11
|
+
};
|
|
12
|
+
export declare function isCommentPresenceClass(params: CommentCellClassParams, hasIndicator: (address: GridCellAddress) => boolean, onMissingRowId?: () => void): boolean;
|
|
13
|
+
export type CommentsRefreshApi = {
|
|
14
|
+
isDestroyed?: () => boolean;
|
|
15
|
+
getContainer?: () => HTMLElement | null;
|
|
16
|
+
hasIndicator: (address: GridCellAddress) => boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare function refreshCommentsPresence(api: CommentsRefreshApi, address: GridCellAddress): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cellElementFromAddress as s } from "../grid-cell-address.js";
|
|
2
|
+
import { IV_HAS_CELL_COMMENT as l } from "./comments-constants.js";
|
|
3
|
+
function f(e, n, r) {
|
|
4
|
+
const t = e.node?.id, o = e.column?.getColId?.();
|
|
5
|
+
return t ? o ? n({ rowId: t, colId: o }) : !1 : (r?.(), !1);
|
|
6
|
+
}
|
|
7
|
+
function m(e, n) {
|
|
8
|
+
if (e.isDestroyed?.()) return;
|
|
9
|
+
const r = s(e.getContainer?.() ?? null, n);
|
|
10
|
+
r && r.classList.toggle(l, e.hasIndicator(n));
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
l as IV_HAS_CELL_COMMENT,
|
|
14
|
+
f as isCommentPresenceClass,
|
|
15
|
+
m as refreshCommentsPresence
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CellAddress, CommentsCapabilities } from './comments.types';
|
|
2
|
+
export declare const DEFAULT_NOTES_CAPABILITIES: CommentsCapabilities;
|
|
3
|
+
export declare function resolveCommentsCapabilities(getCapabilities: ((address: CellAddress) => CommentsCapabilities) | undefined, address: CellAddress): CommentsCapabilities;
|
|
4
|
+
export declare function commentsOverlayActions(capabilities: CommentsCapabilities): {
|
|
5
|
+
showOverlay: boolean;
|
|
6
|
+
showComposer: boolean;
|
|
7
|
+
showEdit: boolean;
|
|
8
|
+
showDelete: boolean;
|
|
9
|
+
showResolve: boolean;
|
|
10
|
+
canStartThread: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
canView: !0,
|
|
3
|
+
canCreate: !0,
|
|
4
|
+
canReply: !0,
|
|
5
|
+
canEdit: !0,
|
|
6
|
+
canDelete: !0,
|
|
7
|
+
canResolve: !0
|
|
8
|
+
};
|
|
9
|
+
function t(e, n) {
|
|
10
|
+
return e?.(n) ?? r;
|
|
11
|
+
}
|
|
12
|
+
function o(e) {
|
|
13
|
+
return {
|
|
14
|
+
showOverlay: e.canView,
|
|
15
|
+
showComposer: e.canView && (e.canCreate || e.canReply),
|
|
16
|
+
showEdit: e.canEdit,
|
|
17
|
+
showDelete: e.canDelete,
|
|
18
|
+
showResolve: e.canResolve,
|
|
19
|
+
canStartThread: e.canCreate
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
r as DEFAULT_NOTES_CAPABILITIES,
|
|
24
|
+
o as commentsOverlayActions,
|
|
25
|
+
t as resolveCommentsCapabilities
|
|
26
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const COMMENTS_WRAPPER_ATTR = "data-iv-comments";
|
|
2
|
+
export declare const IV_HAS_CELL_COMMENT = "iv-has-cell-comment";
|
|
3
|
+
export declare const COMMENTS_HOVER_SHOW_DELAY_MS = 180;
|
|
4
|
+
export declare const COMMENTS_HOVER_HIDE_DELAY_MS = 220;
|
|
5
|
+
export declare const COMMENTS_PANEL_PAGE_SIZE = 50;
|
|
6
|
+
export declare const COMMENTS_THREAD_PAGE_SIZE = 50;
|
|
7
|
+
export declare const COMMENTS_VIRTUALIZE_AFTER = 32;
|
|
8
|
+
export declare const NATIVE_AG_GRID_NOTE_MENU_ITEMS: Set<string>;
|
|
9
|
+
export declare const COMMENTS_MENU_ADD = "iv-comments-add";
|
|
10
|
+
export declare const COMMENTS_MENU_OPEN = "iv-comments-open";
|
|
11
|
+
export declare const COMMENTS_MENU_DELETE = "iv-comments-delete-thread";
|
|
12
|
+
export declare const COMMENTS_MISSING_ROW_ID_WARNING = "[impact-nova] comments requires getRowId so CellAddress.rowId is a stable business key.";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const e = "iv-has-cell-comment", E = 180, _ = 220, t = 50, o = 50, M = 32, N = /* @__PURE__ */ new Set([
|
|
2
|
+
"note",
|
|
3
|
+
"addNote",
|
|
4
|
+
"editNote",
|
|
5
|
+
"deleteNote",
|
|
6
|
+
"viewNote",
|
|
7
|
+
"removeNote"
|
|
8
|
+
]), s = "iv-comments-add", n = "iv-comments-open", S = "iv-comments-delete-thread", c = "[impact-nova] comments requires getRowId so CellAddress.rowId is a stable business key.";
|
|
9
|
+
export {
|
|
10
|
+
_ as COMMENTS_HOVER_HIDE_DELAY_MS,
|
|
11
|
+
E as COMMENTS_HOVER_SHOW_DELAY_MS,
|
|
12
|
+
s as COMMENTS_MENU_ADD,
|
|
13
|
+
S as COMMENTS_MENU_DELETE,
|
|
14
|
+
n as COMMENTS_MENU_OPEN,
|
|
15
|
+
c as COMMENTS_MISSING_ROW_ID_WARNING,
|
|
16
|
+
t as COMMENTS_PANEL_PAGE_SIZE,
|
|
17
|
+
o as COMMENTS_THREAD_PAGE_SIZE,
|
|
18
|
+
M as COMMENTS_VIRTUALIZE_AFTER,
|
|
19
|
+
e as IV_HAS_CELL_COMMENT,
|
|
20
|
+
N as NATIVE_AG_GRID_NOTE_MENU_ITEMS
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare function commentInitials(author: string): string;
|
|
2
|
+
export declare function commentAvatarTone(author: string): string;
|
|
3
|
+
export declare function formatRelativeTime(iso: string, locale: string, now?: number): string;
|
|
4
|
+
export declare function formatPanelTimestamp(iso: string, locale: string): string;
|
|
5
|
+
export declare function commentTextSegments(text: string): ReadonlyArray<{
|
|
6
|
+
mention: boolean;
|
|
7
|
+
value: string;
|
|
8
|
+
}>;
|
|
9
|
+
/** Hover card: Sheets-style first + latest, collapse the middle. Cap 3 DOM rows. */
|
|
10
|
+
export declare const COMMENTS_PREVIEW_VISIBLE = 3;
|
|
11
|
+
export type CommentPreviewSlice<T> = {
|
|
12
|
+
kind: "all";
|
|
13
|
+
messages: readonly T[];
|
|
14
|
+
} | {
|
|
15
|
+
kind: "collapsed";
|
|
16
|
+
head: readonly T[];
|
|
17
|
+
hiddenCount: number;
|
|
18
|
+
tail: readonly T[];
|
|
19
|
+
};
|
|
20
|
+
export declare function commentPreviewSlice<T>(messages: readonly T[]): CommentPreviewSlice<T>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { formatRelativeTime as c, formatDateTime as a } from "../../../../i18n/format/format-date.js";
|
|
2
|
+
function u(t) {
|
|
3
|
+
return (t.trim()[0] ?? "?").toUpperCase();
|
|
4
|
+
}
|
|
5
|
+
const r = [
|
|
6
|
+
"bg-brand text-brand-foreground",
|
|
7
|
+
"bg-success text-success-foreground",
|
|
8
|
+
"bg-secondary text-secondary-foreground"
|
|
9
|
+
];
|
|
10
|
+
function d(t) {
|
|
11
|
+
let n = 0;
|
|
12
|
+
for (const e of t) n = (n + e.charCodeAt(0)) % r.length;
|
|
13
|
+
return r[n] ?? r[0];
|
|
14
|
+
}
|
|
15
|
+
function l(t, n, e = Date.now()) {
|
|
16
|
+
return c(t, n, e) || t;
|
|
17
|
+
}
|
|
18
|
+
function s(t, n) {
|
|
19
|
+
return a(t, n, {
|
|
20
|
+
hour: "numeric",
|
|
21
|
+
minute: "2-digit",
|
|
22
|
+
day: "2-digit",
|
|
23
|
+
month: "2-digit",
|
|
24
|
+
year: "numeric"
|
|
25
|
+
}) || t;
|
|
26
|
+
}
|
|
27
|
+
function T(t) {
|
|
28
|
+
return t.split(/(@[A-Za-z0-9._-]+)/g).flatMap(
|
|
29
|
+
(n) => n ? [{ mention: n.startsWith("@"), value: n }] : []
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
const m = 3, o = 1, i = 2;
|
|
33
|
+
function E(t) {
|
|
34
|
+
return t.length <= m ? { kind: "all", messages: t } : {
|
|
35
|
+
kind: "collapsed",
|
|
36
|
+
head: t.slice(0, o),
|
|
37
|
+
hiddenCount: t.length - o - i,
|
|
38
|
+
tail: t.slice(-i)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
m as COMMENTS_PREVIEW_VISIBLE,
|
|
43
|
+
d as commentAvatarTone,
|
|
44
|
+
u as commentInitials,
|
|
45
|
+
E as commentPreviewSlice,
|
|
46
|
+
T as commentTextSegments,
|
|
47
|
+
s as formatPanelTimestamp,
|
|
48
|
+
l as formatRelativeTime
|
|
49
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class CommentsGenerationGate {
|
|
2
|
+
private generation;
|
|
3
|
+
private destroyed;
|
|
4
|
+
next(): number;
|
|
5
|
+
isCurrent(token: number): boolean;
|
|
6
|
+
destroy(): void;
|
|
7
|
+
}
|
|
8
|
+
export declare class ThreadGenerationMap {
|
|
9
|
+
private tokens;
|
|
10
|
+
private destroyed;
|
|
11
|
+
next(threadId: string): number;
|
|
12
|
+
isCurrent(threadId: string, token: number): boolean;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class r {
|
|
2
|
+
tokens = /* @__PURE__ */ new Map();
|
|
3
|
+
destroyed = !1;
|
|
4
|
+
next(e) {
|
|
5
|
+
this.destroyed && (this.destroyed = !1, this.tokens.clear());
|
|
6
|
+
const t = (this.tokens.get(e) ?? 0) + 1;
|
|
7
|
+
return this.tokens.set(e, t), t;
|
|
8
|
+
}
|
|
9
|
+
isCurrent(e, t) {
|
|
10
|
+
return !this.destroyed && this.tokens.get(e) === t;
|
|
11
|
+
}
|
|
12
|
+
destroy() {
|
|
13
|
+
this.destroyed = !0, this.tokens.clear();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
r as ThreadGenerationMap
|
|
18
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { GridApi } from 'ag-grid-community';
|
|
3
|
+
import { DataTableCommentsConfig } from './comments.types';
|
|
4
|
+
import { CommentsCellEvent, CommentsHostHandle } from './comments-host.types';
|
|
5
|
+
export type { CommentsCellEvent, CommentsHostHandle };
|
|
6
|
+
export declare const CommentsHost: import('react').ForwardRefExoticComponent<{
|
|
7
|
+
comments: DataTableCommentsConfig;
|
|
8
|
+
gridApi: GridApi | null;
|
|
9
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
10
|
+
} & import('react').RefAttributes<CommentsHostHandle>>;
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { jsxs as J, jsx as T } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ce, useRef as O, useState as c, useMemo as we, useCallback as I, useEffect as oe, useImperativeHandle as ye } from "react";
|
|
3
|
+
import { Popover as Oe, PopoverAnchor as Ie, PopoverContent as Ee } from "../../../feedback/popover/popover.js";
|
|
4
|
+
import { subscribeGridApiEvents as Me } from "../grid-api-event-subscription.js";
|
|
5
|
+
import { Button as Te } from "../../../primitives/button/button.js";
|
|
6
|
+
import { toast as be } from "../../../../hooks/use-toast.js";
|
|
7
|
+
import { useImpactNovaI18n as Se } from "../../../../i18n/use-impact-nova-i18n.js";
|
|
8
|
+
import { cn as De } from "../../../../lib/utils.js";
|
|
9
|
+
import { resolveCommentsCapabilities as xe, commentsOverlayActions as Ve } from "./comments-capabilities.js";
|
|
10
|
+
import { COMMENTS_HOVER_HIDE_DELAY_MS as se, COMMENTS_HOVER_SHOW_DELAY_MS as Re } from "./comments-constants.js";
|
|
11
|
+
import { boundLoadedThread as Le, commentsThreadPageRequest as L } from "./comments-window.js";
|
|
12
|
+
import { ThreadGenerationMap as Ne } from "./comments-generation.js";
|
|
13
|
+
import { resolveThreadId as Pe, isValidCommentMessageText as _e, mintCommentMessageId as Fe } from "./comments-identity.js";
|
|
14
|
+
import { measureCommentOverlayAnchor as ae, findCommentScrollViewports as He, commentAnchorRectsEqual as Ae } from "./comments-overlay-anchor.js";
|
|
15
|
+
import { CommentsOverlayBody as Be } from "./comments-overlay.js";
|
|
16
|
+
import { CommentsPanel as Ge } from "./comments-panel.js";
|
|
17
|
+
import { commitCommentsPersist as ke } from "./comments-persist.js";
|
|
18
|
+
import { revealCommentCell as je, waitForCommentCell as ze } from "./comments-reveal.js";
|
|
19
|
+
import { cellElementFromAddress as Ye, cellAddressFromGridEvent as le, cellElementFromGridEvent as ie } from "../grid-cell-address.js";
|
|
20
|
+
function qe(N, s, i) {
|
|
21
|
+
return {
|
|
22
|
+
isDestroyed: () => N?.isDestroyed?.() ?? !1,
|
|
23
|
+
getContainer: () => s.current,
|
|
24
|
+
hasIndicator: i
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function Q(N, s) {
|
|
28
|
+
return { threadId: N, address: s, messages: [], resolved: !1, hasMoreOlder: !1, hiddenCount: 0, messageCount: 0 };
|
|
29
|
+
}
|
|
30
|
+
const Ke = [
|
|
31
|
+
"bodyScroll",
|
|
32
|
+
"bodyScrollEnd",
|
|
33
|
+
"gridSizeChanged",
|
|
34
|
+
"modelUpdated",
|
|
35
|
+
"virtualColumnsChanged",
|
|
36
|
+
"columnPinned",
|
|
37
|
+
"columnMoved",
|
|
38
|
+
"columnResized",
|
|
39
|
+
"displayedColumnsChanged"
|
|
40
|
+
], mt = Ce(function({ comments: s, gridApi: i, containerRef: d }, ce) {
|
|
41
|
+
const { t: u } = Se(), E = O(new Ne()), P = O(null), h = O(null), G = O(null), k = O(!1), b = O(!1), [m, j] = c("closed"), [n, X] = c(null), [z, Y] = c(null), [de, _] = c(!0), [o, f] = c(null), [ue, q] = c(!1), [me, S] = c(!1), [fe, D] = c(null), [x, V] = c(""), [F, H] = c(null), [pe, Z] = c(!1), [$, R] = c(!1), [ee, K] = c(!1), [te, U] = c(!1), W = m !== "closed" && n != null, re = W && de, he = we(
|
|
42
|
+
() => ({
|
|
43
|
+
current: {
|
|
44
|
+
getBoundingClientRect: () => z ?? new DOMRect(),
|
|
45
|
+
getClientRects: () => [z ?? new DOMRect()]
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
[z]
|
|
49
|
+
), p = I(() => {
|
|
50
|
+
P.current != null && window.clearTimeout(P.current), h.current != null && window.clearTimeout(h.current), P.current = null, h.current = null;
|
|
51
|
+
}, []), g = I(() => {
|
|
52
|
+
p(), j("closed"), X(null), f(null), V(""), H(null), D(null), q(!1), U(!1), S(!1), R(!1), K(!1), Y(null), _(!0), b.current = !1;
|
|
53
|
+
const e = G.current;
|
|
54
|
+
G.current = null, e?.isConnected && e.focus();
|
|
55
|
+
}, [p]);
|
|
56
|
+
oe(() => {
|
|
57
|
+
const e = E.current;
|
|
58
|
+
return () => {
|
|
59
|
+
e.destroy(), p();
|
|
60
|
+
};
|
|
61
|
+
}, [p]);
|
|
62
|
+
const C = I(
|
|
63
|
+
async (e, t, r = "replace") => {
|
|
64
|
+
const a = Pe(e, s.getThreadId), l = E.current.next(a);
|
|
65
|
+
r === "replace" ? (f(
|
|
66
|
+
(w) => w?.threadId === a ? w : Q(a, e)
|
|
67
|
+
), q(!0)) : U(!0), D(null);
|
|
68
|
+
try {
|
|
69
|
+
const w = await s.loadThread(a, e, t);
|
|
70
|
+
if (!E.current.isCurrent(a, l)) return;
|
|
71
|
+
const y = Le(w ?? Q(a, e), t);
|
|
72
|
+
f(r === "prepend" ? (B) => !B || B.threadId !== a ? y : {
|
|
73
|
+
...y,
|
|
74
|
+
messages: [...y.messages, ...B.messages],
|
|
75
|
+
hasMoreOlder: y.hasMoreOlder,
|
|
76
|
+
hiddenCount: y.hiddenCount,
|
|
77
|
+
messageCount: y.messageCount ?? B.messageCount
|
|
78
|
+
} : y);
|
|
79
|
+
} catch {
|
|
80
|
+
if (!E.current.isCurrent(a, l)) return;
|
|
81
|
+
D(u("comments.loadError")), r === "replace" && f(Q(a, e));
|
|
82
|
+
} finally {
|
|
83
|
+
E.current.isCurrent(a, l) && (q(!1), U(!1));
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
[s, u]
|
|
87
|
+
), v = I(
|
|
88
|
+
(e, t, r) => {
|
|
89
|
+
p();
|
|
90
|
+
const a = r ?? Ye(d.current, e);
|
|
91
|
+
a && (G.current = a);
|
|
92
|
+
const l = ae(d.current, i, e);
|
|
93
|
+
b.current = !l.usable, _(l.usable), Y(l.rect), X(e), j(t), V(""), H(null), R(!1), C(e, L(t === "preview" ? "preview" : "page"));
|
|
94
|
+
},
|
|
95
|
+
[p, d, i, C]
|
|
96
|
+
), M = I(
|
|
97
|
+
async (e, t) => {
|
|
98
|
+
if (!n) return "rejected";
|
|
99
|
+
S(!0), D(null);
|
|
100
|
+
const r = await ke({
|
|
101
|
+
persist: s.persist,
|
|
102
|
+
event: e,
|
|
103
|
+
generations: E.current,
|
|
104
|
+
threadId: e.threadId,
|
|
105
|
+
api: qe(i, d, s.hasIndicator)
|
|
106
|
+
});
|
|
107
|
+
return r === "stale" ? r : r === "rejected" ? (S(!1), r) : r === "failed" || r === "conflict" ? (S(!1), D(u(r === "conflict" ? "comments.conflict" : "comments.saveError")), t && f(t), be({ title: u(r === "conflict" ? "comments.conflict" : "comments.saveError") }), r === "conflict" && C(n, L("page")), r) : (S(!1), V(""), H(null), e.type !== "delete-thread" && C(n, L("page")), r);
|
|
108
|
+
},
|
|
109
|
+
[n, i, C, s.persist, s.hasIndicator, d, u]
|
|
110
|
+
), ve = I(() => {
|
|
111
|
+
if (!n || !o || !_e(x)) return;
|
|
112
|
+
const e = o, t = (/* @__PURE__ */ new Date()).toISOString();
|
|
113
|
+
if (F) {
|
|
114
|
+
const a = { ...F, text: x.trim(), updatedAt: t };
|
|
115
|
+
f({
|
|
116
|
+
...o,
|
|
117
|
+
messages: o.messages.map((l) => l.id === F.id ? a : l)
|
|
118
|
+
}), M(
|
|
119
|
+
{ type: "edit-message", threadId: o.threadId, address: n, message: a },
|
|
120
|
+
e
|
|
121
|
+
);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const r = {
|
|
125
|
+
id: Fe(),
|
|
126
|
+
text: x.trim(),
|
|
127
|
+
author: s.getAuthor(),
|
|
128
|
+
createdAt: t
|
|
129
|
+
};
|
|
130
|
+
f({
|
|
131
|
+
...o,
|
|
132
|
+
resolved: !1,
|
|
133
|
+
messages: [...o.messages, r]
|
|
134
|
+
}), M({ type: "add-message", threadId: o.threadId, address: n, message: r }, e);
|
|
135
|
+
}, [n, x, F, s, M, o]);
|
|
136
|
+
ye(
|
|
137
|
+
ce,
|
|
138
|
+
() => ({
|
|
139
|
+
onCellMouseOver(e) {
|
|
140
|
+
if (s.previewOnHover === !1) return;
|
|
141
|
+
const t = le(e);
|
|
142
|
+
if (!t || !s.hasIndicator(t) || m === "expanded" || m === "composer") return;
|
|
143
|
+
const r = ie(e);
|
|
144
|
+
p(), P.current = window.setTimeout(() => {
|
|
145
|
+
v(t, "preview", r);
|
|
146
|
+
}, Re);
|
|
147
|
+
},
|
|
148
|
+
onCellMouseOut() {
|
|
149
|
+
m === "expanded" || m === "composer" || (p(), h.current = window.setTimeout(() => {
|
|
150
|
+
k.current || g();
|
|
151
|
+
}, se));
|
|
152
|
+
},
|
|
153
|
+
onCellClicked(e) {
|
|
154
|
+
const t = le(e);
|
|
155
|
+
if (!t) return;
|
|
156
|
+
const r = ie(e), a = xe(s.getCapabilities, t), l = Ve(a);
|
|
157
|
+
if (s.hasIndicator(t) && l.showOverlay) {
|
|
158
|
+
v(t, "expanded", r);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
s.commentMode && l.canStartThread && v(t, "composer", r);
|
|
162
|
+
},
|
|
163
|
+
openAt(e, t) {
|
|
164
|
+
v(e, t);
|
|
165
|
+
},
|
|
166
|
+
close: g
|
|
167
|
+
}),
|
|
168
|
+
[p, g, m, s, v]
|
|
169
|
+
);
|
|
170
|
+
const A = O(0), ge = I(
|
|
171
|
+
(e) => {
|
|
172
|
+
const t = ++A.current;
|
|
173
|
+
R(!1), K(!0), (async () => {
|
|
174
|
+
try {
|
|
175
|
+
const r = await je(i, e, {
|
|
176
|
+
locateRow: s.locateRow,
|
|
177
|
+
pagination: i?.getGridOption?.("pagination") === !0
|
|
178
|
+
});
|
|
179
|
+
if (t !== A.current) return;
|
|
180
|
+
if (r === "missing") {
|
|
181
|
+
R(!0);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const a = await ze(d.current, e);
|
|
185
|
+
if (t !== A.current) return;
|
|
186
|
+
if (!a) {
|
|
187
|
+
R(!0);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
v(e, "expanded", a);
|
|
191
|
+
} finally {
|
|
192
|
+
t === A.current && K(!1);
|
|
193
|
+
}
|
|
194
|
+
})();
|
|
195
|
+
},
|
|
196
|
+
[s.locateRow, d, i, v]
|
|
197
|
+
);
|
|
198
|
+
oe(() => {
|
|
199
|
+
if (!W || !n || !i || i.isDestroyed()) return;
|
|
200
|
+
let e = 0;
|
|
201
|
+
const t = () => {
|
|
202
|
+
cancelAnimationFrame(e), e = requestAnimationFrame(() => {
|
|
203
|
+
const l = ae(d.current, i, n);
|
|
204
|
+
if (!l.usable) {
|
|
205
|
+
b.current = !0, _(!1);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
b.current = !1, _(!0), l.rect && Y((w) => Ae(w, l.rect) ? w : l.rect);
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
t();
|
|
212
|
+
const r = He(d.current);
|
|
213
|
+
for (const l of r) l.addEventListener("scroll", t, { passive: !0 });
|
|
214
|
+
const a = Me(i, Ke, t);
|
|
215
|
+
return () => {
|
|
216
|
+
cancelAnimationFrame(e);
|
|
217
|
+
for (const l of r) l.removeEventListener("scroll", t);
|
|
218
|
+
a();
|
|
219
|
+
};
|
|
220
|
+
}, [n, d, i, W]);
|
|
221
|
+
const ne = !!s.getSummaries;
|
|
222
|
+
return /* @__PURE__ */ J("div", { "data-iv-comments-host": "", className: "contents", children: [
|
|
223
|
+
ne ? /* @__PURE__ */ T("div", { className: "pointer-events-none absolute right-2 top-2 z-20", children: /* @__PURE__ */ T(
|
|
224
|
+
Te,
|
|
225
|
+
{
|
|
226
|
+
type: "button",
|
|
227
|
+
size: "sm",
|
|
228
|
+
variant: "outline",
|
|
229
|
+
className: "pointer-events-auto",
|
|
230
|
+
"data-iv-comments-panel-trigger": "",
|
|
231
|
+
onClick: () => Z(!0),
|
|
232
|
+
children: u("comments.panelTitle")
|
|
233
|
+
}
|
|
234
|
+
) }) : null,
|
|
235
|
+
/* @__PURE__ */ J(
|
|
236
|
+
Oe,
|
|
237
|
+
{
|
|
238
|
+
open: re,
|
|
239
|
+
onOpenChange: (e) => {
|
|
240
|
+
!e && b.current || e || g();
|
|
241
|
+
},
|
|
242
|
+
children: [
|
|
243
|
+
re ? /* @__PURE__ */ T(Ie, { virtualRef: he }) : null,
|
|
244
|
+
/* @__PURE__ */ J(
|
|
245
|
+
Ee,
|
|
246
|
+
{
|
|
247
|
+
container: d.current ?? void 0,
|
|
248
|
+
align: "start",
|
|
249
|
+
side: "right",
|
|
250
|
+
sideOffset: 8,
|
|
251
|
+
collisionPadding: 16,
|
|
252
|
+
className: De(
|
|
253
|
+
"overflow-hidden rounded-none border-0 p-0 shadow-none",
|
|
254
|
+
m === "preview" ? "w-[350px]" : "w-[400px]"
|
|
255
|
+
),
|
|
256
|
+
"data-iv-comments-popover": "",
|
|
257
|
+
"data-slot": "comments-popover",
|
|
258
|
+
onOpenAutoFocus: (e) => {
|
|
259
|
+
m === "preview" && e.preventDefault();
|
|
260
|
+
},
|
|
261
|
+
onMouseEnter: () => {
|
|
262
|
+
k.current = !0, h.current != null && (window.clearTimeout(h.current), h.current = null);
|
|
263
|
+
},
|
|
264
|
+
onMouseLeave: () => {
|
|
265
|
+
k.current = !1, m === "preview" && (h.current = window.setTimeout(g, se));
|
|
266
|
+
},
|
|
267
|
+
children: [
|
|
268
|
+
o && n ? /* @__PURE__ */ T(
|
|
269
|
+
Be,
|
|
270
|
+
{
|
|
271
|
+
thread: o,
|
|
272
|
+
mode: m === "closed" ? "preview" : m,
|
|
273
|
+
loading: ue,
|
|
274
|
+
error: fe,
|
|
275
|
+
saving: me,
|
|
276
|
+
draft: x,
|
|
277
|
+
config: s,
|
|
278
|
+
onDraftChange: V,
|
|
279
|
+
onSave: ve,
|
|
280
|
+
onRetry: () => {
|
|
281
|
+
n && C(n, L("page"));
|
|
282
|
+
},
|
|
283
|
+
onLoadOlder: () => {
|
|
284
|
+
const e = o.messages[0];
|
|
285
|
+
!n || !e || te || !o.hasMoreOlder || C(n, L("page", e.id), "prepend");
|
|
286
|
+
},
|
|
287
|
+
loadingOlder: te,
|
|
288
|
+
onExpand: () => {
|
|
289
|
+
n && v(n, "expanded");
|
|
290
|
+
},
|
|
291
|
+
onEdit: (e) => {
|
|
292
|
+
H(e), V(e.text), j("expanded");
|
|
293
|
+
},
|
|
294
|
+
onDeleteMessage: (e) => {
|
|
295
|
+
if (!o || !n) return;
|
|
296
|
+
const t = o;
|
|
297
|
+
f({ ...o, messages: o.messages.filter((r) => r.id !== e) }), M(
|
|
298
|
+
{ type: "delete-message", threadId: o.threadId, address: n, messageId: e },
|
|
299
|
+
t
|
|
300
|
+
);
|
|
301
|
+
},
|
|
302
|
+
onDeleteThread: () => {
|
|
303
|
+
!o || !n || M(
|
|
304
|
+
{ type: "delete-thread", threadId: o.threadId, address: n },
|
|
305
|
+
o
|
|
306
|
+
).then((e) => {
|
|
307
|
+
e === "applied" && g();
|
|
308
|
+
});
|
|
309
|
+
},
|
|
310
|
+
onClose: g,
|
|
311
|
+
onResolve: (e) => {
|
|
312
|
+
if (!o || !n) return;
|
|
313
|
+
const t = o;
|
|
314
|
+
f({ ...o, resolved: e }), M(
|
|
315
|
+
{ type: "resolve", threadId: o.threadId, address: n, resolved: e },
|
|
316
|
+
t
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
) : null,
|
|
321
|
+
$ ? /* @__PURE__ */ T("p", { className: "text-sm text-content-secondary", children: u("comments.notInView") }) : null
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
)
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
ne ? /* @__PURE__ */ T(
|
|
329
|
+
Ge,
|
|
330
|
+
{
|
|
331
|
+
open: pe,
|
|
332
|
+
onOpenChange: Z,
|
|
333
|
+
config: s,
|
|
334
|
+
onSelect: ge,
|
|
335
|
+
status: ee ? u("comments.loading") : $ ? u("comments.notInView") : null,
|
|
336
|
+
locating: ee
|
|
337
|
+
}
|
|
338
|
+
) : null
|
|
339
|
+
] });
|
|
340
|
+
});
|
|
341
|
+
export {
|
|
342
|
+
mt as CommentsHost
|
|
343
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CellAddress } from './comments.types';
|
|
2
|
+
export type CommentsCellEvent = {
|
|
3
|
+
node?: {
|
|
4
|
+
id?: string | null;
|
|
5
|
+
} | null;
|
|
6
|
+
column?: {
|
|
7
|
+
getColId?: () => string;
|
|
8
|
+
} | null;
|
|
9
|
+
eventTarget?: EventTarget | null;
|
|
10
|
+
event?: Event | null;
|
|
11
|
+
};
|
|
12
|
+
export type CommentsHostHandle = {
|
|
13
|
+
onCellMouseOver: (event: CommentsCellEvent) => void;
|
|
14
|
+
onCellMouseOut: (event: CommentsCellEvent) => void;
|
|
15
|
+
onCellClicked: (event: CommentsCellEvent) => void;
|
|
16
|
+
openAt: (address: CellAddress, mode: "preview" | "expanded" | "composer") => void;
|
|
17
|
+
close: () => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CellAddress, ThreadId } from './comments.types';
|
|
2
|
+
export { cellAddressFromGridEvent, cellElementFromAddress, cellElementFromGridEvent, } from '../grid-cell-address';
|
|
3
|
+
export declare const THREAD_ID_SEPARATOR = "\0";
|
|
4
|
+
export declare function defaultGetThreadId(address: CellAddress): ThreadId;
|
|
5
|
+
export declare function resolveThreadId(address: CellAddress, getThreadId?: (address: CellAddress) => ThreadId): ThreadId;
|
|
6
|
+
export declare function mintCommentMessageId(): string;
|
|
7
|
+
export declare function isValidCommentMessageText(text: string): boolean;
|