impact-nova 2.5.17 → 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.
Files changed (204) hide show
  1. package/README.md +27 -25
  2. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +28 -1
  3. package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.d.ts +0 -3
  4. package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +31 -38
  5. package/dist/components/data/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
  6. package/dist/components/data/ag-grid-react/chat/chat-capabilities.d.ts +9 -0
  7. package/dist/components/data/ag-grid-react/chat/chat-capabilities.js +22 -0
  8. package/dist/components/data/ag-grid-react/chat/chat-column.d.ts +20 -0
  9. package/dist/components/data/ag-grid-react/chat/chat-column.js +81 -0
  10. package/dist/components/data/ag-grid-react/chat/chat-composer.d.ts +10 -0
  11. package/dist/components/data/ag-grid-react/chat/chat-composer.js +352 -0
  12. package/dist/components/data/ag-grid-react/chat/chat-constants.d.ts +17 -0
  13. package/dist/components/data/ag-grid-react/chat/chat-constants.js +22 -0
  14. package/dist/components/data/ag-grid-react/chat/chat-format.d.ts +41 -0
  15. package/dist/components/data/ag-grid-react/chat/chat-format.js +94 -0
  16. package/dist/components/data/ag-grid-react/chat/chat-host.d.ts +10 -0
  17. package/dist/components/data/ag-grid-react/chat/chat-host.js +651 -0
  18. package/dist/components/data/ag-grid-react/chat/chat-host.types.d.ts +13 -0
  19. package/dist/components/data/ag-grid-react/chat/chat-html.d.ts +2 -0
  20. package/dist/components/data/ag-grid-react/chat/chat-html.js +40 -0
  21. package/dist/components/data/ag-grid-react/chat/chat-identity.d.ts +13 -0
  22. package/dist/components/data/ag-grid-react/chat/chat-identity.js +24 -0
  23. package/dist/components/data/ag-grid-react/chat/chat-menu.d.ts +13 -0
  24. package/dist/components/data/ag-grid-react/chat/chat-menu.js +15 -0
  25. package/dist/components/data/ag-grid-react/chat/chat-notify.d.ts +17 -0
  26. package/dist/components/data/ag-grid-react/chat/chat-notify.js +124 -0
  27. package/dist/components/data/ag-grid-react/chat/chat-persist.d.ts +13 -0
  28. package/dist/components/data/ag-grid-react/chat/chat-persist.js +34 -0
  29. package/dist/components/data/ag-grid-react/chat/chat-priority.d.ts +13 -0
  30. package/dist/components/data/ag-grid-react/chat/chat-priority.js +79 -0
  31. package/dist/components/data/ag-grid-react/chat/chat-summaries.d.ts +2 -0
  32. package/dist/components/data/ag-grid-react/chat/chat-summaries.js +24 -0
  33. package/dist/components/data/ag-grid-react/chat/chat-thread-ui.d.ts +72 -0
  34. package/dist/components/data/ag-grid-react/chat/chat-thread-ui.js +713 -0
  35. package/dist/components/data/ag-grid-react/chat/chat-toggle.d.ts +6 -0
  36. package/dist/components/data/ag-grid-react/chat/chat-toggle.js +25 -0
  37. package/dist/components/data/ag-grid-react/chat/chat-ui-actions.d.ts +13 -0
  38. package/dist/components/data/ag-grid-react/chat/chat-ui-actions.js +26 -0
  39. package/dist/components/data/ag-grid-react/chat/chat-window.d.ts +14 -0
  40. package/dist/components/data/ag-grid-react/chat/chat-window.js +82 -0
  41. package/dist/components/data/ag-grid-react/chat/chat-workspace.d.ts +91 -0
  42. package/dist/components/data/ag-grid-react/chat/chat-workspace.js +555 -0
  43. package/dist/components/data/ag-grid-react/chat/chat.types.d.ts +319 -0
  44. package/dist/components/data/ag-grid-react/chat/index.d.ts +6 -0
  45. package/dist/components/data/ag-grid-react/chat/index.js +24 -0
  46. package/dist/components/data/ag-grid-react/chat.story-data.d.ts +34 -0
  47. package/dist/components/data/ag-grid-react/chat.story-sources.d.ts +4 -0
  48. package/dist/components/data/ag-grid-react/comments/assets/comments-no-results.png.js +4 -0
  49. package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.d.ts +6 -0
  50. package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.js +29 -0
  51. package/dist/components/data/ag-grid-react/comments/comments-actions-menu.d.ts +8 -0
  52. package/dist/components/data/ag-grid-react/comments/comments-actions-menu.js +18 -0
  53. package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.d.ts +18 -0
  54. package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.js +16 -0
  55. package/dist/components/data/ag-grid-react/comments/comments-capabilities.d.ts +11 -0
  56. package/dist/components/data/ag-grid-react/comments/comments-capabilities.js +26 -0
  57. package/dist/components/data/ag-grid-react/comments/comments-constants.d.ts +12 -0
  58. package/dist/components/data/ag-grid-react/comments/comments-constants.js +21 -0
  59. package/dist/components/data/ag-grid-react/comments/comments-format.d.ts +20 -0
  60. package/dist/components/data/ag-grid-react/comments/comments-format.js +49 -0
  61. package/dist/components/data/ag-grid-react/comments/comments-generation.d.ts +14 -0
  62. package/dist/components/data/ag-grid-react/comments/comments-generation.js +18 -0
  63. package/dist/components/data/ag-grid-react/comments/comments-host.d.ts +10 -0
  64. package/dist/components/data/ag-grid-react/comments/comments-host.js +343 -0
  65. package/dist/components/data/ag-grid-react/comments/comments-host.types.d.ts +18 -0
  66. package/dist/components/data/ag-grid-react/comments/comments-identity.d.ts +7 -0
  67. package/dist/components/data/ag-grid-react/comments/comments-identity.js +20 -0
  68. package/dist/components/data/ag-grid-react/comments/comments-menu.d.ts +29 -0
  69. package/dist/components/data/ag-grid-react/comments/comments-menu.js +35 -0
  70. package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.d.ts +22 -0
  71. package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.js +98 -0
  72. package/dist/components/data/ag-grid-react/comments/comments-overlay.d.ts +21 -0
  73. package/dist/components/data/ag-grid-react/comments/comments-overlay.js +406 -0
  74. package/dist/components/data/ag-grid-react/comments/comments-panel.d.ts +9 -0
  75. package/dist/components/data/ag-grid-react/comments/comments-panel.js +272 -0
  76. package/dist/components/data/ag-grid-react/comments/comments-persist.d.ts +11 -0
  77. package/dist/components/data/ag-grid-react/comments/comments-persist.js +19 -0
  78. package/dist/components/data/ag-grid-react/comments/comments-reveal.d.ts +11 -0
  79. package/dist/components/data/ag-grid-react/comments/comments-reveal.js +31 -0
  80. package/dist/components/data/ag-grid-react/comments/comments-ui-actions.d.ts +18 -0
  81. package/dist/components/data/ag-grid-react/comments/comments-ui-actions.js +22 -0
  82. package/dist/components/data/ag-grid-react/comments/comments-window.d.ts +10 -0
  83. package/dist/components/data/ag-grid-react/comments/comments-window.js +62 -0
  84. package/dist/components/data/ag-grid-react/comments/comments.types.d.ts +178 -0
  85. package/dist/components/data/ag-grid-react/comments/index.d.ts +5 -0
  86. package/dist/components/data/ag-grid-react/comments/index.js +15 -0
  87. package/dist/components/data/ag-grid-react/comments-cell-renderers-showcase.d.ts +25 -0
  88. package/dist/components/data/ag-grid-react/comments.story-data.d.ts +37 -0
  89. package/dist/components/data/ag-grid-react/comments.story-sources.d.ts +11 -0
  90. package/dist/components/data/ag-grid-react/grid-cell-address.d.ts +21 -0
  91. package/dist/components/data/ag-grid-react/grid-cell-address.js +21 -0
  92. package/dist/components/data/ag-grid-react/grid-row-reveal.d.ts +34 -0
  93. package/dist/components/data/ag-grid-react/grid-row-reveal.js +33 -0
  94. package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +75 -65
  95. package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +1 -1
  96. package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +54 -54
  97. package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +1 -1
  98. package/dist/components/data/ag-grid-react/headers/header-search-input.js +122 -119
  99. package/dist/components/data/ag-grid-react/headers/utils/date-utils.d.ts +2 -1
  100. package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +25 -20
  101. package/dist/components/data/ag-grid-react/headers/utils/filter-utils.d.ts +1 -1
  102. package/dist/components/data/ag-grid-react/index.d.ts +1 -1
  103. package/dist/components/data/ag-grid-react/index.js +481 -254
  104. package/dist/components/data/ag-grid-react/notes/index.d.ts +2 -0
  105. package/dist/components/data/ag-grid-react/notes/index.js +1 -0
  106. package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.d.ts +25 -0
  107. package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.js +32 -0
  108. package/dist/components/data/ag-grid-react/notes/notes-constants.d.ts +2 -0
  109. package/dist/components/data/ag-grid-react/notes/notes-constants.js +4 -0
  110. package/dist/components/data/ag-grid-react/notes/notes.types.d.ts +12 -0
  111. package/dist/components/data/ag-grid-react/notes.story-sources.d.ts +7 -0
  112. package/dist/components/data/ag-grid-react/nova-system-column.d.ts +7 -0
  113. package/dist/components/data/ag-grid-react/nova-system-column.js +18 -0
  114. package/dist/components/data/ag-grid-react/theme.js +6 -2
  115. package/dist/components/data/ag-grid-react/value-formatter.types.d.ts +4 -0
  116. package/dist/components/data/ag-grid-react/value-formatters.d.ts +0 -19
  117. package/dist/components/data/ag-grid-react/value-formatters.js +88 -90
  118. package/dist/components/data/data-table/build-column-tree-from-grid.js +14 -13
  119. package/dist/components/data/data-table/data-table-column-def-pin.js +34 -31
  120. package/dist/components/data/data-table/data-table-context.js +5 -5
  121. package/dist/components/data/data-table/data-table-sheet-context.js +1 -1
  122. package/dist/components/data/data-table/data-table-sheet.js +2 -1
  123. package/dist/components/data-display/calendar/calendar-config.js +22 -21
  124. package/dist/components/data-display/calendar/calendar-day-button.js +21 -21
  125. package/dist/components/data-display/calendar/calendar-day-picker-view.js +36 -35
  126. package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +3 -3
  127. package/dist/components/data-display/calendar/calendar-fiscal-labels.js +50 -62
  128. package/dist/components/data-display/calendar/calendar.js +138 -137
  129. package/dist/components/data-display/calendar/fiscal-period-caption-select.js +23 -22
  130. package/dist/components/data-display/calendar/use-calendar-i18n.d.ts +1 -0
  131. package/dist/components/data-display/calendar/use-calendar-i18n.js +10 -9
  132. package/dist/components/data-display/chart/chart.js +72 -72
  133. package/dist/components/data-display/chart/chart.utils.d.ts +1 -1
  134. package/dist/components/data-display/chart/chart.utils.js +40 -31
  135. package/dist/components/feedback/sheet/sheet.js +1 -1
  136. package/dist/components/feedback/toast/toast.d.ts +1 -1
  137. package/dist/components/feedback/toast/toast.variants.d.ts +1 -1
  138. package/dist/components/flows/filter-panel/filter-panel.d.ts +1 -1
  139. package/dist/components/flows/filter-panel/filter-panel.js +65 -64
  140. package/dist/components/flows/filter-panel/filter-panel.types.d.ts +1 -0
  141. package/dist/components/forms/date-picker/date-picker.js +125 -126
  142. package/dist/components/forms/date-picker/date-range-picker.js +191 -192
  143. package/dist/components/forms/date-picker/multi-date-picker.js +66 -67
  144. package/dist/components/forms/date-picker/multi-week-picker.js +82 -83
  145. package/dist/components/forms/date-picker/use-picker-i18n.d.ts +6 -0
  146. package/dist/components/forms/date-picker/use-picker-i18n.js +11 -0
  147. package/dist/components/forms/date-picker/week-picker.js +146 -147
  148. package/dist/components/forms/date-picker/week-range-picker.js +158 -159
  149. package/dist/components/ui/local-raster-icons/message3d.webp.js +4 -0
  150. package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +1 -0
  151. package/dist/components/ui/local-raster-icons/rasterIcons.js +27 -25
  152. package/dist/form-react/Fields/WeekRangePicker.js +16 -16
  153. package/dist/form-react/fields.d.ts +0 -3
  154. package/dist/form-react/fields.js +29 -35
  155. package/dist/i18n/defaultMessages.d.ts +144 -0
  156. package/dist/i18n/defaultMessages.js +161 -19
  157. package/dist/i18n/format/collator.d.ts +1 -0
  158. package/dist/i18n/format/collator.js +7 -0
  159. package/dist/i18n/format/date-pattern.d.ts +5 -0
  160. package/dist/i18n/format/date-pattern.js +20 -0
  161. package/dist/i18n/format/format-date.d.ts +9 -0
  162. package/dist/i18n/format/format-date.js +56 -0
  163. package/dist/i18n/format/format-number.d.ts +20 -0
  164. package/dist/i18n/format/format-number.js +68 -0
  165. package/dist/i18n/format/formatter-cache.d.ts +9 -0
  166. package/dist/i18n/format/formatter-cache.js +66 -0
  167. package/dist/i18n/format/index.d.ts +6 -0
  168. package/dist/i18n/format/parse-number.d.ts +6 -0
  169. package/dist/i18n/format/parse-number.js +53 -0
  170. package/dist/i18n/getDateFnsLocale.d.ts +5 -4
  171. package/dist/i18n/getDateFnsLocale.js +46 -16
  172. package/dist/i18n/i18n.types.d.ts +13 -0
  173. package/dist/i18n/impact-nova-i18n-context.d.ts +1 -1
  174. package/dist/i18n/impact-nova-i18n-context.js +33 -25
  175. package/dist/i18n/impact-nova-i18n-defaults.js +8 -6
  176. package/dist/i18n/index.d.ts +4 -1
  177. package/dist/i18n/index.js +41 -16
  178. package/dist/i18n/locale-config.d.ts +28 -0
  179. package/dist/i18n/locale-config.js +32 -0
  180. package/dist/i18n/locales/de.js +142 -0
  181. package/dist/i18n/locales/es.js +142 -0
  182. package/dist/i18n/locales/hi.js +142 -0
  183. package/dist/i18n/locales/kn.js +142 -0
  184. package/dist/i18n/week-start.d.ts +6 -0
  185. package/dist/i18n/week-start.js +30 -0
  186. package/dist/impact-nova-components.css +249 -0
  187. package/dist/impact-nova-tokens.scss +6 -0
  188. package/dist/impact-nova.css +1 -1
  189. package/dist/index.d.ts +1 -1
  190. package/dist/index.js +624 -601
  191. package/dist/llms/index.js +26 -2
  192. package/dist/llms/rules/ag-grid.js +1 -1
  193. package/dist/llms/rules/best-practices.js +1 -1
  194. package/dist/llms/rules/data-table-chat.js +1 -0
  195. package/dist/llms/rules/data-table-comments.js +1 -0
  196. package/dist/llms/rules/data-table-notes.js +1 -0
  197. package/dist/llms/rules/installation.js +1 -1
  198. package/dist/llms/rules/migration.js +1 -1
  199. package/dist/llms/rules/real-world-patterns.js +1 -1
  200. package/dist/llms/rules/requirements.js +1 -1
  201. package/dist/llms/rules/troubleshooting.js +1 -1
  202. package/dist/providers/app-providers.d.ts +3 -1
  203. package/dist/providers/app-providers.js +22 -11
  204. package/package.json +13 -1
@@ -0,0 +1,20 @@
1
+ const o = "\0";
2
+ function e(t) {
3
+ return `${t.rowId}\0${t.colId}`;
4
+ }
5
+ function r(t, n) {
6
+ return n?.(t) ?? e(t);
7
+ }
8
+ function i() {
9
+ return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `comment-${Date.now().toString(36)}-${Math.random().toString(16).slice(2)}`;
10
+ }
11
+ function c(t) {
12
+ return t.trim().length > 0;
13
+ }
14
+ export {
15
+ o as THREAD_ID_SEPARATOR,
16
+ e as defaultGetThreadId,
17
+ c as isValidCommentMessageText,
18
+ i as mintCommentMessageId,
19
+ r as resolveThreadId
20
+ };
@@ -0,0 +1,29 @@
1
+ import { CellAddress, DataTableCommentsConfig } from './comments.types';
2
+ export type CommentsMenuItem = string | {
3
+ name?: string;
4
+ action?: () => void;
5
+ [key: string]: unknown;
6
+ };
7
+ export declare function filterNativeAgGridNoteMenuItems(items: readonly CommentsMenuItem[]): CommentsMenuItem[];
8
+ export declare function mergeCommentsContextMenuItems(args: {
9
+ items: readonly CommentsMenuItem[];
10
+ config: DataTableCommentsConfig;
11
+ address: CellAddress | undefined;
12
+ labels: {
13
+ addComment: string;
14
+ openComment: string;
15
+ deleteThread: string;
16
+ };
17
+ onAdd: (address: CellAddress) => void;
18
+ onOpen: (address: CellAddress) => void;
19
+ onDeleteThread: (address: CellAddress) => void;
20
+ preserveNativeNoteItems?: boolean;
21
+ }): CommentsMenuItem[];
22
+ export declare function addressFromMenuParams(params: {
23
+ node?: {
24
+ id?: string | null;
25
+ } | null;
26
+ column?: {
27
+ getColId?: () => string;
28
+ } | null;
29
+ }): CellAddress | undefined;
@@ -0,0 +1,35 @@
1
+ import { COMMENTS_MENU_OPEN as r, COMMENTS_MENU_ADD as a, COMMENTS_MENU_DELETE as c, NATIVE_AG_GRID_NOTE_MENU_ITEMS as m } from "./comments-constants.js";
2
+ import { resolveCommentsCapabilities as d, commentsOverlayActions as l } from "./comments-capabilities.js";
3
+ function f(e) {
4
+ return e.filter((t) => !p(t));
5
+ }
6
+ function p(e) {
7
+ if (typeof e == "string") return m.has(e);
8
+ const t = e.cssClasses;
9
+ if (Array.isArray(t) && t.some((s) => typeof s == "string" && s.startsWith("iv-comments-")))
10
+ return !1;
11
+ const o = typeof e.name == "string" ? e.name : "";
12
+ return /\bnotes?\b/i.test(o);
13
+ }
14
+ function h(e) {
15
+ const t = e.preserveNativeNoteItems ? [...e.items] : f(e.items);
16
+ if (!e.address) return t;
17
+ const o = d(e.config.getCapabilities, e.address), s = l(o), i = e.config.hasIndicator(e.address), n = [];
18
+ return i && s.showOverlay ? n.push({
19
+ name: e.labels.openComment,
20
+ action: () => e.onOpen(e.address),
21
+ cssClasses: [r]
22
+ }) : !i && s.canStartThread && n.push({
23
+ name: e.labels.addComment,
24
+ action: () => e.onAdd(e.address),
25
+ cssClasses: [a]
26
+ }), i && s.showDelete && n.push({
27
+ name: e.labels.deleteThread,
28
+ action: () => e.onDeleteThread(e.address),
29
+ cssClasses: [c]
30
+ }), n.length === 0 ? t : t.length > 0 ? [...t, "separator", ...n] : n;
31
+ }
32
+ export {
33
+ f as filterNativeAgGridNoteMenuItems,
34
+ h as mergeCommentsContextMenuItems
35
+ };
@@ -0,0 +1,22 @@
1
+ import { GridCellAddress } from '../grid-cell-address';
2
+ export type CommentOverlayAnchorApi = {
3
+ isDestroyed?: () => boolean;
4
+ getColumn: (id: string) => {
5
+ getPinned: () => "left" | "right" | boolean | null | undefined;
6
+ } | null | undefined;
7
+ };
8
+ export type CommentOverlayPin = "left" | "right" | null;
9
+ export declare function copyDomRect(rect: DOMRectReadOnly): DOMRect;
10
+ export declare function intersectDomRects(a: DOMRectReadOnly, b: DOMRectReadOnly): DOMRect;
11
+ /** Visible intersection of the live cell with the usable grid clip. Fully clipped cells are unusable. */
12
+ export declare function stickCommentAnchorRect(cell: DOMRectReadOnly, clip: DOMRectReadOnly): DOMRect;
13
+ export declare function resolveCommentOverlayPin(api: CommentOverlayAnchorApi | null | undefined, colId: string): CommentOverlayPin;
14
+ export declare function findCommentScrollViewports(container: HTMLElement | null): HTMLElement[];
15
+ export declare function commentOverlayClipRect(container: HTMLElement, pinned: CommentOverlayPin): DOMRect | null;
16
+ export declare function isCommentAnchorUsable(cell: DOMRectReadOnly, clip: DOMRectReadOnly): boolean;
17
+ export type CommentOverlayAnchor = {
18
+ usable: boolean;
19
+ rect: DOMRect | null;
20
+ };
21
+ export declare function measureCommentOverlayAnchor(container: HTMLElement | null, api: CommentOverlayAnchorApi | null | undefined, address: GridCellAddress): CommentOverlayAnchor;
22
+ export declare function commentAnchorRectsEqual(a: DOMRectReadOnly | null, b: DOMRectReadOnly | null): boolean;
@@ -0,0 +1,98 @@
1
+ import { cellElementFromAddress as p } from "../grid-cell-address.js";
2
+ const w = [".ag-grid-viewport", ".ag-body-viewport"], M = [
3
+ ".ag-grid-viewport",
4
+ ".ag-body-viewport",
5
+ ".ag-body-vertical-scroll-viewport",
6
+ ".ag-body-horizontal-scroll-viewport",
7
+ ".ag-center-cols-viewport"
8
+ ], m = [".ag-pinned-left-cols-viewport", ".ag-grid-pinned-left-cells"], d = [".ag-pinned-right-cols-viewport", ".ag-grid-pinned-right-cells"];
9
+ function h(t) {
10
+ return new DOMRect(t.x, t.y, t.width, t.height);
11
+ }
12
+ function g(t, n) {
13
+ const r = Math.max(t.left, n.left), e = Math.max(t.top, n.top), o = Math.min(t.right, n.right), i = Math.min(t.bottom, n.bottom);
14
+ return new DOMRect(r, e, Math.max(0, o - r), Math.max(0, i - e));
15
+ }
16
+ function R(t, n) {
17
+ return g(t, n);
18
+ }
19
+ function v(t, n) {
20
+ const r = t?.getColumn?.(n)?.getPinned?.();
21
+ return r === "left" || r === !0 ? "left" : r === "right" ? "right" : null;
22
+ }
23
+ function u(t, n) {
24
+ for (const r of n) {
25
+ const e = t.querySelector(r);
26
+ if (e instanceof HTMLElement) return e;
27
+ }
28
+ return null;
29
+ }
30
+ function s(t) {
31
+ if (!t) return null;
32
+ const n = t.getBoundingClientRect();
33
+ return n.width < 2 || n.height < 2 ? null : n;
34
+ }
35
+ function x(t) {
36
+ if (!t) return [];
37
+ const n = [];
38
+ for (const r of M) {
39
+ const e = t.querySelector(r);
40
+ e instanceof HTMLElement && !n.includes(e) && n.push(e);
41
+ }
42
+ return n;
43
+ }
44
+ function f(t, n, r, e) {
45
+ const o = Math.max(t.top, n), i = Math.max(t.left, r), c = Math.min(t.right, e);
46
+ return new DOMRect(i, o, Math.max(0, c - i), Math.max(0, t.bottom - o));
47
+ }
48
+ function C(t, n) {
49
+ const r = u(t, w);
50
+ if (!r) return null;
51
+ let e = h(r.getBoundingClientRect());
52
+ const o = u(t, [".ag-header"]);
53
+ if (o && (e = f(e, o.getBoundingClientRect().bottom, e.left, e.right)), n === "left") {
54
+ const l = s(u(t, m));
55
+ return l && (e = f(e, e.top, l.left, l.right)), e;
56
+ }
57
+ if (n === "right") {
58
+ const l = s(u(t, d));
59
+ return l && (e = f(e, e.top, l.left, l.right)), e;
60
+ }
61
+ const i = s(u(t, m));
62
+ i && (e = f(e, e.top, i.right, e.right));
63
+ const c = s(u(t, d));
64
+ c && (e = f(e, e.top, e.left, c.left));
65
+ const a = s(u(t, [".ag-center-cols-viewport"]));
66
+ if (a) {
67
+ const l = g(e, a);
68
+ if (l.width > 2 && l.height > 2) return l;
69
+ }
70
+ return e;
71
+ }
72
+ function b(t, n) {
73
+ const r = g(t, n);
74
+ return r.width > 1 && r.height > 1;
75
+ }
76
+ function O(t, n, r) {
77
+ if (!t) return { usable: !1, rect: null };
78
+ const e = v(n, r.colId), o = p(t, r), i = C(t, e);
79
+ if (!i)
80
+ return o ? { usable: !0, rect: h(o.getBoundingClientRect()) } : { usable: !0, rect: h(t.getBoundingClientRect()) };
81
+ if (!o) return { usable: !1, rect: null };
82
+ const c = h(o.getBoundingClientRect());
83
+ return b(c, i) ? { usable: !0, rect: R(c, i) } : { usable: !1, rect: null };
84
+ }
85
+ function S(t, n) {
86
+ return t === n ? !0 : !t || !n ? !1 : Math.abs(t.x - n.x) < 0.5 && Math.abs(t.y - n.y) < 0.5 && Math.abs(t.width - n.width) < 0.5 && Math.abs(t.height - n.height) < 0.5;
87
+ }
88
+ export {
89
+ S as commentAnchorRectsEqual,
90
+ C as commentOverlayClipRect,
91
+ h as copyDomRect,
92
+ x as findCommentScrollViewports,
93
+ g as intersectDomRects,
94
+ b as isCommentAnchorUsable,
95
+ O as measureCommentOverlayAnchor,
96
+ v as resolveCommentOverlayPin,
97
+ R as stickCommentAnchorRect
98
+ };
@@ -0,0 +1,21 @@
1
+ import { CellCommentThread, CommentMessage, DataTableCommentsConfig } from './comments.types';
2
+ export declare function CommentsOverlayBody({ thread, mode, loading, error, saving, draft, onDraftChange, onSave, onRetry, onExpand, onEdit, onDeleteMessage, onDeleteThread, onResolve, onClose, onLoadOlder, loadingOlder, config, }: {
3
+ thread: CellCommentThread;
4
+ mode: "preview" | "expanded" | "composer";
5
+ loading: boolean;
6
+ error: string | null;
7
+ saving: boolean;
8
+ draft: string;
9
+ onDraftChange: (value: string) => void;
10
+ onSave: () => void;
11
+ onRetry: () => void;
12
+ onExpand: () => void;
13
+ onEdit: (message: CommentMessage) => void;
14
+ onDeleteMessage: (messageId: string) => void;
15
+ onDeleteThread: () => void;
16
+ onResolve: (resolved: boolean) => void;
17
+ onClose: () => void;
18
+ onLoadOlder: () => void;
19
+ loadingOlder: boolean;
20
+ config: DataTableCommentsConfig;
21
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,406 @@
1
+ import { jsx as t, jsxs as s, Fragment as S } from "react/jsx-runtime";
2
+ import { Avatar as j, AvatarFallback as F } from "../../../data-display/avatar/avatar.js";
3
+ import { Button as M } from "../../../primitives/button/button.js";
4
+ import { Textarea as P } from "../../../forms/textarea/textarea.js";
5
+ import { AlertDialog as K, AlertDialogContent as Z, AlertDialogHeader as q, AlertDialogTitle as H, AlertDialogDescription as U, AlertDialogFooter as Y, AlertDialogCancel as $, AlertDialogAction as G } from "../../../feedback/alert-dialog/alert-dialog.js";
6
+ import { useImpactNovaI18n as J } from "../../../../i18n/use-impact-nova-i18n.js";
7
+ import { cn as Q } from "../../../../lib/utils.js";
8
+ import { CheckTickcircle as W, Cross as X } from "impact-nova-icons";
9
+ import { resolveCommentsCapabilities as ee, commentsOverlayActions as te } from "./comments-capabilities.js";
10
+ import { commentPreviewSlice as ne, formatRelativeTime as E, commentInitials as le, commentAvatarTone as oe, commentTextSegments as re } from "./comments-format.js";
11
+ import { buildCommentThreadMenuItems as ae, buildCommentMessageMenuItems as se } from "./comments-ui-actions.js";
12
+ import { CommentActionsMenu as _ } from "./comments-actions-menu.js";
13
+ import { useState as ie, useRef as I, useLayoutEffect as ce } from "react";
14
+ import { useVirtualizedList as de } from "../../../../lib/virtualized/useVirtualizedList.js";
15
+ import { COMMENTS_VIRTUALIZE_AFTER as me } from "./comments-constants.js";
16
+ const ue = "!h-8 !w-8 !rounded-md text-sm font-extrabold";
17
+ function he({ text: e }) {
18
+ return re(e).map(
19
+ (o, c) => o.mention ? /* @__PURE__ */ t("span", { className: "font-semibold text-brand", children: o.value }, c) : o.value
20
+ );
21
+ }
22
+ function pe() {
23
+ return /* @__PURE__ */ t("svg", { width: "9", height: "14", viewBox: "0 0 9 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ t(
24
+ "path",
25
+ {
26
+ d: "M0.195 4.86167C0.455 5.12167 0.875 5.12167 1.135 4.86167L3.72167 2.28167V12.395C3.72167 12.7617 4.02167 13.0617 4.38833 13.0617C4.755 13.0617 5.055 12.7617 5.055 12.395V2.28167L7.64167 4.86833C7.90167 5.12833 8.32167 5.12833 8.58167 4.86833C8.84167 4.60833 8.84167 4.18833 8.58167 3.92833L4.855 0.195C4.595 -0.065 4.175 -0.065 3.915 0.195L0.195 3.92167C-0.065 4.18167 -0.065 4.60833 0.195 4.86167Z",
27
+ fill: "currentColor"
28
+ }
29
+ ) });
30
+ }
31
+ function xe({ author: e }) {
32
+ return /* @__PURE__ */ t(j, { size: "sm", shape: "square", className: ue, children: /* @__PURE__ */ t(F, { className: Q("text-sm font-extrabold", oe(e)), children: le(e) }) });
33
+ }
34
+ function R({
35
+ author: e,
36
+ renderAvatar: o
37
+ }) {
38
+ return o ? o({ author: e }) : /* @__PURE__ */ t(xe, { author: e });
39
+ }
40
+ function O({
41
+ message: e,
42
+ renderMessageBody: o
43
+ }) {
44
+ return o ? o({ message: e }) : /* @__PURE__ */ t(he, { text: e.text });
45
+ }
46
+ function z({
47
+ message: e,
48
+ locale: o,
49
+ config: c
50
+ }) {
51
+ return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
52
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-1", children: [
53
+ /* @__PURE__ */ t(R, { author: e.author, renderAvatar: c.renderAvatar }),
54
+ /* @__PURE__ */ t("p", { className: "truncate text-sm font-semibold leading-[21px] text-content", children: e.author }),
55
+ /* @__PURE__ */ t("p", { className: "shrink-0 text-xs font-medium text-content-secondary", children: E(e.updatedAt ?? e.createdAt, o) })
56
+ ] }),
57
+ /* @__PURE__ */ t("p", { className: "line-clamp-3 pl-9 text-sm font-medium leading-5 text-content", children: /* @__PURE__ */ t(O, { message: e, renderMessageBody: c.renderMessageBody }) })
58
+ ] });
59
+ }
60
+ function fe(e) {
61
+ return (e.hiddenCount ?? 0) > 0 && e.messages.length > 0 ? {
62
+ kind: "collapsed",
63
+ head: e.messages.slice(0, 1),
64
+ tail: e.messages.slice(1),
65
+ hiddenCount: e.hiddenCount ?? 0
66
+ } : ne(e.messages);
67
+ }
68
+ function B({
69
+ message: e,
70
+ thread: o,
71
+ locale: c,
72
+ showEdit: p,
73
+ showDelete: i,
74
+ onEdit: x,
75
+ onDelete: v,
76
+ messageActionsLabel: u,
77
+ editLabel: b,
78
+ deleteLabel: C,
79
+ config: d
80
+ }) {
81
+ const h = {
82
+ address: o.address,
83
+ threadId: o.threadId,
84
+ resolved: o.resolved,
85
+ message: e
86
+ }, A = se({
87
+ showEdit: p,
88
+ showDelete: i,
89
+ editLabel: b,
90
+ deleteLabel: C,
91
+ extras: d.messageActions,
92
+ context: h,
93
+ onEdit: () => x(e),
94
+ onDelete: () => v(e.id)
95
+ });
96
+ return /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", "data-iv-comments-message": e.id, "data-slot": "comments-message", children: [
97
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2", children: [
98
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-1", children: [
99
+ /* @__PURE__ */ t(R, { author: e.author, renderAvatar: d.renderAvatar }),
100
+ /* @__PURE__ */ t("p", { className: "truncate text-sm font-semibold leading-[21px] text-content", children: e.author }),
101
+ /* @__PURE__ */ t("p", { className: "shrink-0 text-xs font-medium leading-[1.25] text-content-secondary", children: E(e.updatedAt ?? e.createdAt, c) })
102
+ ] }),
103
+ /* @__PURE__ */ t(
104
+ _,
105
+ {
106
+ label: u,
107
+ items: A,
108
+ render: d.renderMessageActions ? (y) => d.renderMessageActions({ items: y, context: h }) : void 0
109
+ }
110
+ )
111
+ ] }),
112
+ /* @__PURE__ */ t("p", { className: "whitespace-pre-wrap break-words pl-9 text-sm font-medium leading-5 text-content", children: /* @__PURE__ */ t(O, { message: e, renderMessageBody: d.renderMessageBody }) })
113
+ ] });
114
+ }
115
+ function ve({
116
+ messages: e,
117
+ thread: o,
118
+ config: c,
119
+ hasMoreOlder: p,
120
+ loadingOlder: i,
121
+ olderLabel: x,
122
+ onLoadOlder: v,
123
+ locale: u,
124
+ showEdit: b,
125
+ showDelete: C,
126
+ onEdit: d,
127
+ onDelete: h,
128
+ messageActionsLabel: A,
129
+ editLabel: y,
130
+ deleteLabel: g
131
+ }) {
132
+ const T = I(null), w = p || e.length > me, r = de({
133
+ scrollElementRef: T,
134
+ rowCount: w ? e.length : 0,
135
+ getRowId: (l) => e[l]?.id ?? String(l),
136
+ getRowData: (l) => e[l],
137
+ estimateSize: () => 76,
138
+ overscan: 4,
139
+ initialRect: { width: 400, height: 205 }
140
+ }), n = I(0), f = I(!1);
141
+ ce(() => {
142
+ if (!w || e.length === 0) {
143
+ n.current = e.length;
144
+ return;
145
+ }
146
+ if (!f.current) {
147
+ r.scrollToIndex(e.length - 1, { align: "end" }), f.current = !0, n.current = e.length;
148
+ return;
149
+ }
150
+ const l = e.length - n.current;
151
+ l > 0 && r.scrollToIndex(l, { align: "start" }), n.current = e.length;
152
+ }, [r, e.length, w]);
153
+ const D = p ? /* @__PURE__ */ t(
154
+ "button",
155
+ {
156
+ type: "button",
157
+ "data-iv-comments-load-older": "",
158
+ className: "px-1 py-2 text-left text-sm font-semibold text-brand",
159
+ disabled: i,
160
+ "aria-busy": i,
161
+ onClick: v,
162
+ children: x
163
+ }
164
+ ) : null;
165
+ return w ? /* @__PURE__ */ s("div", { ref: T, className: "max-h-[205px] overflow-y-auto", "data-iv-comments-virtual": "", "data-slot": "comments-thread", children: [
166
+ D,
167
+ /* @__PURE__ */ t("div", { style: { height: r.totalSize, position: "relative" }, children: r.virtualItems.map((l) => {
168
+ const m = e[l.index];
169
+ return m ? /* @__PURE__ */ t(
170
+ "div",
171
+ {
172
+ ref: r.measureElement,
173
+ "data-index": l.index,
174
+ className: "pb-4",
175
+ style: {
176
+ position: "absolute",
177
+ top: 0,
178
+ left: 0,
179
+ width: "100%",
180
+ transform: `translateY(${l.start}px)`
181
+ },
182
+ children: /* @__PURE__ */ t(
183
+ B,
184
+ {
185
+ message: m,
186
+ thread: o,
187
+ config: c,
188
+ locale: u,
189
+ showEdit: b,
190
+ showDelete: C,
191
+ onEdit: d,
192
+ onDelete: h,
193
+ messageActionsLabel: A,
194
+ editLabel: y,
195
+ deleteLabel: g
196
+ }
197
+ )
198
+ },
199
+ m.id
200
+ ) : null;
201
+ }) })
202
+ ] }) : /* @__PURE__ */ s("div", { className: "flex max-h-[205px] flex-col gap-4 overflow-y-auto", "data-slot": "comments-thread", children: [
203
+ D,
204
+ /* @__PURE__ */ t("ul", { className: "flex flex-col gap-4", children: e.map((l) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
205
+ B,
206
+ {
207
+ message: l,
208
+ thread: o,
209
+ config: c,
210
+ locale: u,
211
+ showEdit: b,
212
+ showDelete: C,
213
+ onEdit: d,
214
+ onDelete: h,
215
+ messageActionsLabel: A,
216
+ editLabel: y,
217
+ deleteLabel: g
218
+ }
219
+ ) }, l.id)) })
220
+ ] });
221
+ }
222
+ function Se({
223
+ thread: e,
224
+ mode: o,
225
+ loading: c,
226
+ error: p,
227
+ saving: i,
228
+ draft: x,
229
+ onDraftChange: v,
230
+ onSave: u,
231
+ onRetry: b,
232
+ onExpand: C,
233
+ onEdit: d,
234
+ onDeleteMessage: h,
235
+ onDeleteThread: A,
236
+ onResolve: y,
237
+ onClose: g,
238
+ onLoadOlder: T,
239
+ loadingOlder: w,
240
+ config: r
241
+ }) {
242
+ const { t: n, dateLocale: f } = J(), D = ee(r.getCapabilities, e.address), l = te(D), m = fe(e), [N, k] = ie(
243
+ null
244
+ ), L = {
245
+ address: e.address,
246
+ threadId: e.threadId,
247
+ resolved: e.resolved
248
+ }, V = ae({
249
+ showDelete: l.showDelete && e.messages.length > 0,
250
+ deleteLabel: n("comments.deleteThread"),
251
+ extras: r.threadActions,
252
+ context: L,
253
+ onDelete: () => k({ type: "thread" })
254
+ });
255
+ return l.showOverlay ? o === "preview" ? /* @__PURE__ */ t(
256
+ "button",
257
+ {
258
+ type: "button",
259
+ "data-iv-comments-preview": "",
260
+ "data-slot": "comments-preview",
261
+ className: "flex w-full flex-col gap-4 p-3 text-left",
262
+ onClick: C,
263
+ children: m.kind === "all" ? m.messages.map((a) => /* @__PURE__ */ t(z, { message: a, locale: f, config: r }, a.id)) : /* @__PURE__ */ s(S, { children: [
264
+ m.head.map((a) => /* @__PURE__ */ t(z, { message: a, locale: f, config: r }, a.id)),
265
+ /* @__PURE__ */ t("p", { className: "pl-9 text-sm font-semibold text-brand", children: n("comments.moreReplies", { count: m.hiddenCount }) }),
266
+ m.tail.map((a) => /* @__PURE__ */ t(z, { message: a, locale: f, config: r }, a.id))
267
+ ] })
268
+ }
269
+ ) : /* @__PURE__ */ s("div", { "data-iv-comments-overlay": "", "data-slot": "comments-overlay", className: "flex w-full flex-col", children: [
270
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b border-border p-2", "data-slot": "comments-header", children: [
271
+ /* @__PURE__ */ t("h3", { className: "text-sm font-extrabold leading-[21px] text-content", children: n("comments.title") }),
272
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-3", "data-slot": "comments-actions", children: [
273
+ /* @__PURE__ */ t(
274
+ _,
275
+ {
276
+ label: n("comments.threadActions"),
277
+ items: V,
278
+ render: r.renderThreadActions ? (a) => r.renderThreadActions({ items: a, context: L }) : void 0
279
+ }
280
+ ),
281
+ l.showResolve ? /* @__PURE__ */ t(
282
+ M,
283
+ {
284
+ type: "button",
285
+ size: "iconSm",
286
+ variant: "ghost",
287
+ className: "[&_svg]:size-4",
288
+ disabled: i,
289
+ "aria-label": e.resolved ? n("comments.unresolve") : n("comments.resolve"),
290
+ onClick: () => y(!e.resolved),
291
+ children: /* @__PURE__ */ t(W, {})
292
+ }
293
+ ) : null,
294
+ /* @__PURE__ */ t(
295
+ M,
296
+ {
297
+ type: "button",
298
+ size: "iconSm",
299
+ variant: "ghost",
300
+ className: "[&_svg]:size-4",
301
+ "aria-label": n("aria.close"),
302
+ onClick: g,
303
+ children: /* @__PURE__ */ t(X, {})
304
+ }
305
+ )
306
+ ] })
307
+ ] }),
308
+ /* @__PURE__ */ s("div", { className: "flex flex-col gap-4 p-4", children: [
309
+ c ? /* @__PURE__ */ t("p", { "aria-busy": "true", children: n("comments.loading") }) : e.messages.length > 0 ? /* @__PURE__ */ t(
310
+ ve,
311
+ {
312
+ messages: e.messages,
313
+ thread: e,
314
+ config: r,
315
+ hasMoreOlder: !!e.hasMoreOlder,
316
+ loadingOlder: w,
317
+ olderLabel: (e.hiddenCount ?? 0) > 0 ? n("comments.moreReplies", { count: e.hiddenCount }) : n("comments.viewOlder"),
318
+ onLoadOlder: T,
319
+ locale: f,
320
+ showEdit: l.showEdit,
321
+ showDelete: l.showDelete,
322
+ onEdit: d,
323
+ onDelete: h,
324
+ messageActionsLabel: n("comments.messageActions"),
325
+ editLabel: n("comments.edit"),
326
+ deleteLabel: n("comments.delete")
327
+ }
328
+ ) : null,
329
+ p ? /* @__PURE__ */ s("div", { role: "alert", className: "flex items-center justify-between gap-2 text-sm text-destructive", "data-slot": "comments-error", children: [
330
+ /* @__PURE__ */ t("span", { children: p }),
331
+ /* @__PURE__ */ t(M, { type: "button", size: "sm", variant: "outline", onClick: b, children: n("comments.retry") })
332
+ ] }) : null,
333
+ l.showComposer ? /* @__PURE__ */ t("div", { className: "flex items-start gap-2.5", "data-slot": "comments-composer", children: r.renderComposer ? r.renderComposer({
334
+ value: x,
335
+ onChange: v,
336
+ onSave: u,
337
+ disabled: i,
338
+ saving: i,
339
+ author: r.getAuthor()
340
+ }) : /* @__PURE__ */ s(S, { children: [
341
+ /* @__PURE__ */ t(R, { author: r.getAuthor(), renderAvatar: r.renderAvatar }),
342
+ /* @__PURE__ */ s(
343
+ "div",
344
+ {
345
+ className: "relative min-w-0 flex-1",
346
+ onKeyDown: (a) => {
347
+ a.key === "Enter" && (a.metaKey || a.ctrlKey) && (a.preventDefault(), u());
348
+ },
349
+ children: [
350
+ /* @__PURE__ */ t(
351
+ P,
352
+ {
353
+ "data-iv-comments-composer": "",
354
+ value: x,
355
+ onChange: (a) => v(a.target.value),
356
+ placeholder: n("comments.composerPlaceholder"),
357
+ disabled: i,
358
+ size: "default",
359
+ className: "h-[100px] min-h-[100px] resize-none rounded-lg !p-3 !pb-10"
360
+ }
361
+ ),
362
+ /* @__PURE__ */ t(
363
+ M,
364
+ {
365
+ type: "button",
366
+ size: "iconSm",
367
+ variant: "default",
368
+ className: "absolute bottom-3 right-3 rounded-lg [&_svg]:!h-[14px] [&_svg]:!w-[9px]",
369
+ "data-iv-comments-save": "",
370
+ disabled: i || x.trim().length === 0,
371
+ "aria-busy": i,
372
+ "aria-label": n(i ? "comments.saving" : "comments.save"),
373
+ onClick: u,
374
+ children: /* @__PURE__ */ t(pe, {})
375
+ }
376
+ )
377
+ ]
378
+ }
379
+ )
380
+ ] }) }) : null
381
+ ] }),
382
+ /* @__PURE__ */ t(K, { open: N != null, onOpenChange: (a) => {
383
+ a || k(null);
384
+ }, children: /* @__PURE__ */ s(Z, { children: [
385
+ /* @__PURE__ */ s(q, { children: [
386
+ /* @__PURE__ */ t(H, { children: N?.type === "thread" ? n("comments.confirmDeleteThreadTitle") : n("comments.confirmDeleteTitle") }),
387
+ /* @__PURE__ */ t(U, { children: N?.type === "thread" ? n("comments.confirmDeleteThreadDescription") : n("comments.confirmDeleteDescription") })
388
+ ] }),
389
+ /* @__PURE__ */ s(Y, { children: [
390
+ /* @__PURE__ */ t($, { children: n("comments.cancel") }),
391
+ /* @__PURE__ */ t(
392
+ G,
393
+ {
394
+ onClick: () => {
395
+ N?.type === "thread" && A(), N?.type === "message" && h(N.id), k(null);
396
+ },
397
+ children: n("comments.delete")
398
+ }
399
+ )
400
+ ] })
401
+ ] }) })
402
+ ] }) : /* @__PURE__ */ t("p", { className: "text-sm text-content-secondary", children: n("comments.noAccess") });
403
+ }
404
+ export {
405
+ Se as CommentsOverlayBody
406
+ };
@@ -0,0 +1,9 @@
1
+ import { CellAddress, DataTableCommentsConfig } from './comments.types';
2
+ export declare function CommentsPanel({ open, onOpenChange, config, onSelect, status, locating, }: {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ config: DataTableCommentsConfig;
6
+ onSelect: (address: CellAddress, threadId: string) => void;
7
+ status?: string | null;
8
+ locating?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;