@djangocfg/ui-tools 2.1.416 → 2.1.418

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 (66) hide show
  1. package/dist/audio-player/index.cjs +2098 -0
  2. package/dist/audio-player/index.cjs.map +1 -0
  3. package/dist/audio-player/index.css +65 -0
  4. package/dist/audio-player/index.css.map +1 -0
  5. package/dist/audio-player/index.d.cts +166 -0
  6. package/dist/audio-player/index.d.ts +166 -0
  7. package/dist/audio-player/index.mjs +2075 -0
  8. package/dist/audio-player/index.mjs.map +1 -0
  9. package/dist/composer-registry/index.cjs +45 -0
  10. package/dist/composer-registry/index.cjs.map +1 -0
  11. package/dist/composer-registry/index.d.cts +73 -0
  12. package/dist/composer-registry/index.d.ts +73 -0
  13. package/dist/composer-registry/index.mjs +39 -0
  14. package/dist/composer-registry/index.mjs.map +1 -0
  15. package/dist/tree/index.cjs +82 -63
  16. package/dist/tree/index.cjs.map +1 -1
  17. package/dist/tree/index.d.cts +15 -1
  18. package/dist/tree/index.d.ts +15 -1
  19. package/dist/tree/index.mjs +83 -64
  20. package/dist/tree/index.mjs.map +1 -1
  21. package/package.json +38 -17
  22. package/src/tools/chat/composer/Composer.tsx +8 -8
  23. package/src/tools/chat/context/ChatProvider.tsx +13 -78
  24. package/src/tools/chat/hooks/useAutoFocusOnStreamEnd.ts +12 -15
  25. package/src/tools/chat/hooks/useFocusOnEmptyClick.ts +4 -5
  26. package/src/tools/chat/launcher/header/ChatHeader.tsx +14 -19
  27. package/src/tools/chat/launcher/header/ChatHeaderActionButton.tsx +8 -12
  28. package/src/tools/data/Tree/TreeRoot.tsx +33 -109
  29. package/src/tools/data/Tree/context/TreeContext.tsx +22 -3
  30. package/src/tools/data/Tree/context/menu/index.ts +1 -0
  31. package/src/tools/data/Tree/context/menu/render.tsx +75 -0
  32. package/src/tools/data/Tree/context/menu/use-resolved-menu.ts +16 -2
  33. package/src/tools/data/Tree/index.tsx +1 -0
  34. package/src/tools/data/Tree/types/index.ts +1 -1
  35. package/src/tools/data/Tree/types/root-props.ts +16 -0
  36. package/src/tools/dev/OpenapiViewer/components/DocsLayout/EndpointDoc/Header/MetaActions.tsx +6 -9
  37. package/src/tools/dev/OpenapiViewer/components/DocsLayout/index.tsx +2 -4
  38. package/src/tools/forms/CodeEditor/components/Editor.tsx +19 -0
  39. package/src/tools/forms/CodeEditor/types/index.ts +7 -0
  40. package/src/tools/forms/MarkdownEditor/MarkdownEditor.tsx +40 -0
  41. package/src/tools/forms/MarkdownEditor/styles.css +174 -21
  42. package/src/tools/forms/NotionEditor/CustomKeymap.ts +48 -0
  43. package/src/tools/forms/NotionEditor/LinkDialog.tsx +133 -0
  44. package/src/tools/forms/NotionEditor/NotionEditor.tsx +304 -0
  45. package/src/tools/forms/NotionEditor/SlashExtension.ts +32 -0
  46. package/src/tools/forms/NotionEditor/SlashList.tsx +136 -0
  47. package/src/tools/forms/NotionEditor/TaskItemView.tsx +41 -0
  48. package/src/tools/forms/NotionEditor/createSlashSuggestion.ts +121 -0
  49. package/src/tools/forms/NotionEditor/extensions.ts +105 -0
  50. package/src/tools/forms/NotionEditor/index.ts +1 -0
  51. package/src/tools/forms/NotionEditor/lazy.tsx +44 -0
  52. package/src/tools/forms/NotionEditor/slashItems.ts +159 -0
  53. package/src/tools/forms/NotionEditor/styles.css +478 -0
  54. package/src/tools/forms/NotionEditor/types.ts +28 -0
  55. package/src/tools/input/SpeechRecognition/widgets/VoiceComposerSlot.tsx +11 -12
  56. package/src/tools/integration/ComposerRegistry/index.ts +105 -0
  57. package/src/tools/media/AudioPlayer/Player.tsx +2 -0
  58. package/src/tools/media/AudioPlayer/PlayerShell.tsx +29 -22
  59. package/src/tools/media/AudioPlayer/lazy.tsx +30 -42
  60. package/src/tools/media/AudioPlayer/parts/Controls/IconButton.tsx +10 -11
  61. package/src/tools/media/AudioPlayer/parts/Controls/VolumeControl.tsx +52 -115
  62. package/src/tools/media/AudioPlayer/types.ts +8 -0
  63. package/src/tools/media/ImageViewer/components/ImageViewer.tsx +8 -0
  64. package/src/tools/media/ImageViewer/types.ts +4 -0
  65. package/src/tools/media/VideoPlayer/VideoPlayer.tsx +20 -1
  66. package/src/tools/media/VideoPlayer/types.ts +4 -0
@@ -300,9 +300,23 @@ interface TreeRootProps<T> {
300
300
  * adapter for hotkeys / DnD.
301
301
  */
302
302
  defaultMenuItems?: TreeBuiltinAction[];
303
+ /**
304
+ * Imperative handle for outer code. The provided ref receives a
305
+ * stable handle to `useTreeActions` once Tree mounts. Lets host
306
+ * components trigger `refresh(id)` / `refreshAll()` from outside
307
+ * Tree (e.g. after a transport-level mutation completes).
308
+ */
309
+ actionsRef?: React.MutableRefObject<TreeActionsHandle | null>;
303
310
  className?: string;
304
311
  style?: CSSProperties;
305
312
  }
313
+ /** Subset of `useTreeActions()` exposed via `<TreeRoot actionsRef={…}>`. */
314
+ interface TreeActionsHandle {
315
+ refresh: (id: string) => Promise<void>;
316
+ refreshAll: () => Promise<void>;
317
+ expandAll: () => void;
318
+ collapseAll: () => void;
319
+ }
306
320
 
307
321
  /**
308
322
  * High-level entry point. Wraps Provider + (optional) search bar + content.
@@ -958,4 +972,4 @@ interface TreeEmptyAreaProps {
958
972
  */
959
973
  declare function TreeEmptyArea({ className }: TreeEmptyAreaProps): react_jsx_runtime.JSX.Element;
960
974
 
961
- export { type ChildCache, type ChildEntry, type ChildEntryStatus, DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, type DemoNode, FinderTree, FlatRow, type FlattenInput, type PersistedTreeState, type ResolvedAppearance, TREE_DND_MIME, TreeRoot as Tree, type TreeAccentIntensity, type TreeActivateOptions, type TreeActivationMode, type TreeAdapter, type TreeAppearance, type TreeBuiltinAction, TreeChevron, type TreeChevronProps, TreeContent, type TreeContentProps, TreeContextMenuActionsResolver, TreeContextMenuItem, TreeContextMenuSlot, type TreeContextValue, type TreeDensity, TreeDropIndicator, type TreeDropIndicatorProps, TreeEmpty, TreeEmptyArea, type TreeEmptyAreaProps, type TreeEmptyProps, TreeError, type TreeErrorProps, TreeIcon, type TreeIconProps, TreeIndentGuides, type TreeIndentGuidesProps, TreeItemId, TreeLabel, type TreeLabelProps, type TreeLabels, type TreeLoadChildren, type TreeMovePosition, TreeNode, TreeProvider, type TreeProviderProps, type TreeRadius, TreeRenameInput, type TreeRenameInputProps, TreeRoot, type TreeRootProps, TreeRow, type TreeRowProps, TreeRowRenderProps, TreeRowSlot, TreeSearchInput, type TreeSearchInputProps, type TreeSelectionMode, TreeSkeleton, type TreeSkeletonProps, type UseTreeFinderHotkeysOptions, type UseTreeKeyboardOptions, type UseTreeTypeAheadOptions, appearanceToStyle, autoSelectRange, clearTreeState, createChildCache, createDemoTree, TreeRoot as default, defaultCanDrop, flattenTree, loadTreeState, resolveAppearance, resolveChildren, resolveDropZone, saveTreeState, splitFileName, useTreeActions, useTreeClipboard, useTreeContext, useTreeDnd, useTreeExpansion, useTreeFinderHotkeys, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRename, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead };
975
+ export { type ChildCache, type ChildEntry, type ChildEntryStatus, DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, type DemoNode, FinderTree, FlatRow, type FlattenInput, type PersistedTreeState, type ResolvedAppearance, TREE_DND_MIME, TreeRoot as Tree, type TreeAccentIntensity, type TreeActionsHandle, type TreeActivateOptions, type TreeActivationMode, type TreeAdapter, type TreeAppearance, type TreeBuiltinAction, TreeChevron, type TreeChevronProps, TreeContent, type TreeContentProps, TreeContextMenuActionsResolver, TreeContextMenuItem, TreeContextMenuSlot, type TreeContextValue, type TreeDensity, TreeDropIndicator, type TreeDropIndicatorProps, TreeEmpty, TreeEmptyArea, type TreeEmptyAreaProps, type TreeEmptyProps, TreeError, type TreeErrorProps, TreeIcon, type TreeIconProps, TreeIndentGuides, type TreeIndentGuidesProps, TreeItemId, TreeLabel, type TreeLabelProps, type TreeLabels, type TreeLoadChildren, type TreeMovePosition, TreeNode, TreeProvider, type TreeProviderProps, type TreeRadius, TreeRenameInput, type TreeRenameInputProps, TreeRoot, type TreeRootProps, TreeRow, type TreeRowProps, TreeRowRenderProps, TreeRowSlot, TreeSearchInput, type TreeSearchInputProps, type TreeSelectionMode, TreeSkeleton, type TreeSkeletonProps, type UseTreeFinderHotkeysOptions, type UseTreeKeyboardOptions, type UseTreeTypeAheadOptions, appearanceToStyle, autoSelectRange, clearTreeState, createChildCache, createDemoTree, TreeRoot as default, defaultCanDrop, flattenTree, loadTreeState, resolveAppearance, resolveChildren, resolveDropZone, saveTreeState, splitFileName, useTreeActions, useTreeClipboard, useTreeContext, useTreeDnd, useTreeExpansion, useTreeFinderHotkeys, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRename, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead };
@@ -300,9 +300,23 @@ interface TreeRootProps<T> {
300
300
  * adapter for hotkeys / DnD.
301
301
  */
302
302
  defaultMenuItems?: TreeBuiltinAction[];
303
+ /**
304
+ * Imperative handle for outer code. The provided ref receives a
305
+ * stable handle to `useTreeActions` once Tree mounts. Lets host
306
+ * components trigger `refresh(id)` / `refreshAll()` from outside
307
+ * Tree (e.g. after a transport-level mutation completes).
308
+ */
309
+ actionsRef?: React.MutableRefObject<TreeActionsHandle | null>;
303
310
  className?: string;
304
311
  style?: CSSProperties;
305
312
  }
313
+ /** Subset of `useTreeActions()` exposed via `<TreeRoot actionsRef={…}>`. */
314
+ interface TreeActionsHandle {
315
+ refresh: (id: string) => Promise<void>;
316
+ refreshAll: () => Promise<void>;
317
+ expandAll: () => void;
318
+ collapseAll: () => void;
319
+ }
306
320
 
307
321
  /**
308
322
  * High-level entry point. Wraps Provider + (optional) search bar + content.
@@ -958,4 +972,4 @@ interface TreeEmptyAreaProps {
958
972
  */
959
973
  declare function TreeEmptyArea({ className }: TreeEmptyAreaProps): react_jsx_runtime.JSX.Element;
960
974
 
961
- export { type ChildCache, type ChildEntry, type ChildEntryStatus, DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, type DemoNode, FinderTree, FlatRow, type FlattenInput, type PersistedTreeState, type ResolvedAppearance, TREE_DND_MIME, TreeRoot as Tree, type TreeAccentIntensity, type TreeActivateOptions, type TreeActivationMode, type TreeAdapter, type TreeAppearance, type TreeBuiltinAction, TreeChevron, type TreeChevronProps, TreeContent, type TreeContentProps, TreeContextMenuActionsResolver, TreeContextMenuItem, TreeContextMenuSlot, type TreeContextValue, type TreeDensity, TreeDropIndicator, type TreeDropIndicatorProps, TreeEmpty, TreeEmptyArea, type TreeEmptyAreaProps, type TreeEmptyProps, TreeError, type TreeErrorProps, TreeIcon, type TreeIconProps, TreeIndentGuides, type TreeIndentGuidesProps, TreeItemId, TreeLabel, type TreeLabelProps, type TreeLabels, type TreeLoadChildren, type TreeMovePosition, TreeNode, TreeProvider, type TreeProviderProps, type TreeRadius, TreeRenameInput, type TreeRenameInputProps, TreeRoot, type TreeRootProps, TreeRow, type TreeRowProps, TreeRowRenderProps, TreeRowSlot, TreeSearchInput, type TreeSearchInputProps, type TreeSelectionMode, TreeSkeleton, type TreeSkeletonProps, type UseTreeFinderHotkeysOptions, type UseTreeKeyboardOptions, type UseTreeTypeAheadOptions, appearanceToStyle, autoSelectRange, clearTreeState, createChildCache, createDemoTree, TreeRoot as default, defaultCanDrop, flattenTree, loadTreeState, resolveAppearance, resolveChildren, resolveDropZone, saveTreeState, splitFileName, useTreeActions, useTreeClipboard, useTreeContext, useTreeDnd, useTreeExpansion, useTreeFinderHotkeys, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRename, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead };
975
+ export { type ChildCache, type ChildEntry, type ChildEntryStatus, DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, type DemoNode, FinderTree, FlatRow, type FlattenInput, type PersistedTreeState, type ResolvedAppearance, TREE_DND_MIME, TreeRoot as Tree, type TreeAccentIntensity, type TreeActionsHandle, type TreeActivateOptions, type TreeActivationMode, type TreeAdapter, type TreeAppearance, type TreeBuiltinAction, TreeChevron, type TreeChevronProps, TreeContent, type TreeContentProps, TreeContextMenuActionsResolver, TreeContextMenuItem, TreeContextMenuSlot, type TreeContextValue, type TreeDensity, TreeDropIndicator, type TreeDropIndicatorProps, TreeEmpty, TreeEmptyArea, type TreeEmptyAreaProps, type TreeEmptyProps, TreeError, type TreeErrorProps, TreeIcon, type TreeIconProps, TreeIndentGuides, type TreeIndentGuidesProps, TreeItemId, TreeLabel, type TreeLabelProps, type TreeLabels, type TreeLoadChildren, type TreeMovePosition, TreeNode, TreeProvider, type TreeProviderProps, type TreeRadius, TreeRenameInput, type TreeRenameInputProps, TreeRoot, type TreeRootProps, TreeRow, type TreeRowProps, TreeRowRenderProps, TreeRowSlot, TreeSearchInput, type TreeSearchInputProps, type TreeSelectionMode, TreeSkeleton, type TreeSkeletonProps, type UseTreeFinderHotkeysOptions, type UseTreeKeyboardOptions, type UseTreeTypeAheadOptions, appearanceToStyle, autoSelectRange, clearTreeState, createChildCache, createDemoTree, TreeRoot as default, defaultCanDrop, flattenTree, loadTreeState, resolveAppearance, resolveChildren, resolveDropZone, saveTreeState, splitFileName, useTreeActions, useTreeClipboard, useTreeContext, useTreeDnd, useTreeExpansion, useTreeFinderHotkeys, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRename, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead };
@@ -2,10 +2,10 @@ import { __name } from '../chunk-PAWJFY3S.mjs';
2
2
  import * as React from 'react';
3
3
  import { createContext, memo, useRef, useCallback, useMemo, useEffect, useState, useReducer, Fragment as Fragment$1 } from 'react';
4
4
  import { cn } from '@djangocfg/ui-core/lib';
5
- import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuSeparator, ContextMenuItem, ContextMenuShortcut } from '@djangocfg/ui-core/components';
6
5
  import { getDialog } from '@djangocfg/ui-core/lib/dialog-service';
7
6
  import { CornerUpLeft, Pencil, Copy, Scissors, Trash2, FilePlus, FolderPlus, ChevronDown, ChevronRight, FolderOpen, Folder, File, Loader2, Search, X, AlertCircle } from 'lucide-react';
8
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
7
+ import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuSeparator, ContextMenuItem, ContextMenuShortcut } from '@djangocfg/ui-core/components';
8
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
9
9
  import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, useDraggable, useDroppable } from '@dnd-kit/core';
10
10
  import { useHotkey } from '@djangocfg/ui-core/hooks';
11
11
 
@@ -1048,6 +1048,47 @@ function useResolvedMenu(opts) {
1048
1048
  ]);
1049
1049
  }
1050
1050
  __name(useResolvedMenu, "useResolvedMenu");
1051
+ function renderItemsAsContextMenu(rowProps, items, trigger) {
1052
+ return /* @__PURE__ */ jsxs(ContextMenu, { children: [
1053
+ /* @__PURE__ */ jsx(ContextMenuTrigger, { asChild: true, children: trigger }),
1054
+ /* @__PURE__ */ jsx(ContextMenuContent, { children: items.map((item, idx) => {
1055
+ if (item === "separator") {
1056
+ return /* @__PURE__ */ jsx(ContextMenuSeparator, {}, `sep-${idx}`);
1057
+ }
1058
+ const Icon = item.icon;
1059
+ return /* @__PURE__ */ jsxs(
1060
+ ContextMenuItem,
1061
+ {
1062
+ disabled: item.disabled,
1063
+ variant: item.destructive ? "destructive" : void 0,
1064
+ onSelect: () => item.onSelect(rowProps),
1065
+ children: [
1066
+ Icon ? /* @__PURE__ */ jsx(Icon, {}) : null,
1067
+ item.label,
1068
+ item.shortcut ? /* @__PURE__ */ jsx(ContextMenuShortcut, { children: item.shortcut }) : null
1069
+ ]
1070
+ },
1071
+ item.id
1072
+ );
1073
+ }) })
1074
+ ] });
1075
+ }
1076
+ __name(renderItemsAsContextMenu, "renderItemsAsContextMenu");
1077
+ function tidyMenuItems(items) {
1078
+ const out = [];
1079
+ for (const it of items) {
1080
+ if (it === "separator") {
1081
+ if (out.length === 0) continue;
1082
+ if (out[out.length - 1] === "separator") continue;
1083
+ out.push(it);
1084
+ } else {
1085
+ out.push(it);
1086
+ }
1087
+ }
1088
+ while (out.length > 0 && out[out.length - 1] === "separator") out.pop();
1089
+ return out;
1090
+ }
1091
+ __name(tidyMenuItems, "tidyMenuItems");
1051
1092
 
1052
1093
  // src/tools/data/Tree/data/dnd.ts
1053
1094
  function resolveDropZone(input) {
@@ -1412,6 +1453,20 @@ function TreeProvider(props) {
1412
1453
  copyToClipboard: clipboard.copyToClipboard,
1413
1454
  pasteFromClipboard: clipboard.pasteFromClipboard
1414
1455
  });
1456
+ const finalRenderContextMenu = useMemo(
1457
+ () => {
1458
+ if (renderContextMenu) return renderContextMenu;
1459
+ const resolve = resolvedContextMenuActions;
1460
+ if (!resolve) return void 0;
1461
+ return (rowProps, trigger) => {
1462
+ const items = resolve(rowProps);
1463
+ const cleaned = items ? tidyMenuItems(items) : null;
1464
+ if (!cleaned || cleaned.length === 0) return trigger;
1465
+ return renderItemsAsContextMenu(rowProps, cleaned, trigger);
1466
+ };
1467
+ },
1468
+ [renderContextMenu, resolvedContextMenuActions]
1469
+ );
1415
1470
  const value = useMemo(
1416
1471
  () => ({
1417
1472
  // state
@@ -1453,7 +1508,7 @@ function TreeProvider(props) {
1453
1508
  renderIcon,
1454
1509
  renderLabel,
1455
1510
  renderActions,
1456
- renderContextMenu,
1511
+ renderContextMenu: finalRenderContextMenu,
1457
1512
  adapter,
1458
1513
  resolvedContextMenuActions,
1459
1514
  getNodeById: /* @__PURE__ */ __name((id) => nodeById.get(id), "getNodeById"),
@@ -1490,7 +1545,7 @@ function TreeProvider(props) {
1490
1545
  renderIcon,
1491
1546
  renderLabel,
1492
1547
  renderActions,
1493
- renderContextMenu,
1548
+ finalRenderContextMenu,
1494
1549
  adapter,
1495
1550
  resolvedContextMenuActions,
1496
1551
  nodeById,
@@ -2766,47 +2821,6 @@ function useTreeFinderHotkeys(opts) {
2766
2821
  return { ref };
2767
2822
  }
2768
2823
  __name(useTreeFinderHotkeys, "useTreeFinderHotkeys");
2769
- function renderItemsAsContextMenu(rowProps, items, trigger) {
2770
- return /* @__PURE__ */ jsxs(ContextMenu, { children: [
2771
- /* @__PURE__ */ jsx(ContextMenuTrigger, { asChild: true, children: trigger }),
2772
- /* @__PURE__ */ jsx(ContextMenuContent, { children: items.map((item, idx) => {
2773
- if (item === "separator") {
2774
- return /* @__PURE__ */ jsx(ContextMenuSeparator, {}, `sep-${idx}`);
2775
- }
2776
- const Icon = item.icon;
2777
- return /* @__PURE__ */ jsxs(
2778
- ContextMenuItem,
2779
- {
2780
- disabled: item.disabled,
2781
- variant: item.destructive ? "destructive" : void 0,
2782
- onSelect: () => item.onSelect(rowProps),
2783
- children: [
2784
- Icon ? /* @__PURE__ */ jsx(Icon, {}) : null,
2785
- item.label,
2786
- item.shortcut ? /* @__PURE__ */ jsx(ContextMenuShortcut, { children: item.shortcut }) : null
2787
- ]
2788
- },
2789
- item.id
2790
- );
2791
- }) })
2792
- ] });
2793
- }
2794
- __name(renderItemsAsContextMenu, "renderItemsAsContextMenu");
2795
- function tidyMenuItems(items) {
2796
- const out = [];
2797
- for (const it of items) {
2798
- if (it === "separator") {
2799
- if (out.length === 0) continue;
2800
- if (out[out.length - 1] === "separator") continue;
2801
- out.push(it);
2802
- } else {
2803
- out.push(it);
2804
- }
2805
- }
2806
- while (out.length > 0 && out[out.length - 1] === "separator") out.pop();
2807
- return out;
2808
- }
2809
- __name(tidyMenuItems, "tidyMenuItems");
2810
2824
  function TreeRoot(props) {
2811
2825
  const {
2812
2826
  data,
@@ -2840,6 +2854,7 @@ function TreeRoot(props) {
2840
2854
  persistSelection = false,
2841
2855
  adapter,
2842
2856
  defaultMenuItems,
2857
+ actionsRef,
2843
2858
  className,
2844
2859
  style
2845
2860
  } = props;
@@ -2882,7 +2897,8 @@ function TreeRoot(props) {
2882
2897
  enableSearch,
2883
2898
  enableTypeAhead,
2884
2899
  enableFinderHotkeys,
2885
- renderRow
2900
+ renderRow,
2901
+ actionsRef
2886
2902
  }
2887
2903
  )
2888
2904
  }
@@ -2895,10 +2911,29 @@ function TreeRootShell({
2895
2911
  enableSearch,
2896
2912
  enableTypeAhead,
2897
2913
  enableFinderHotkeys,
2898
- renderRow
2914
+ renderRow,
2915
+ actionsRef
2899
2916
  }) {
2900
2917
  const containerRef = useRef(null);
2901
2918
  const ctx = useTreeContext();
2919
+ useEffect(() => {
2920
+ if (!actionsRef) return;
2921
+ actionsRef.current = {
2922
+ refresh: ctx.refresh,
2923
+ refreshAll: ctx.refreshAll,
2924
+ expandAll: ctx.expandAll,
2925
+ collapseAll: ctx.collapseAll
2926
+ };
2927
+ return () => {
2928
+ if (actionsRef.current) actionsRef.current = null;
2929
+ };
2930
+ }, [
2931
+ actionsRef,
2932
+ ctx.refresh,
2933
+ ctx.refreshAll,
2934
+ ctx.expandAll,
2935
+ ctx.collapseAll
2936
+ ]);
2902
2937
  const isMulti = ctx.selectionMode === "multiple";
2903
2938
  const { ref: keyboardRef } = useTreeKeyboard({
2904
2939
  rows: ctx.flatRows,
@@ -2975,21 +3010,6 @@ function TreeRootShell({
2975
3010
  onMatch: onTypeAheadMatch,
2976
3011
  enabled: enableTypeAhead
2977
3012
  });
2978
- const finalRenderContextMenu = useMemo(() => {
2979
- if (ctx.renderContextMenu) return ctx.renderContextMenu;
2980
- const resolve = ctx.resolvedContextMenuActions;
2981
- if (!resolve) return void 0;
2982
- return (rowProps, trigger) => {
2983
- const items = resolve(rowProps);
2984
- const cleaned = items ? tidyMenuItems(items) : null;
2985
- if (!cleaned || cleaned.length === 0) return trigger;
2986
- return renderItemsAsContextMenu(rowProps, cleaned, trigger);
2987
- };
2988
- }, [ctx.renderContextMenu, ctx.resolvedContextMenuActions]);
2989
- const childCtx = useMemo(
2990
- () => ({ ...ctx, renderContextMenu: finalRenderContextMenu }),
2991
- [ctx, finalRenderContextMenu]
2992
- );
2993
3013
  const treeBody = /* @__PURE__ */ jsxs(
2994
3014
  "div",
2995
3015
  {
@@ -3015,8 +3035,7 @@ function TreeRootShell({
3015
3035
  ]
3016
3036
  }
3017
3037
  );
3018
- const body = finalRenderContextMenu === ctx.renderContextMenu ? treeBody : /* @__PURE__ */ jsx(TreeContext.Provider, { value: childCtx, children: treeBody });
3019
- return /* @__PURE__ */ jsx(TreeDndProvider, { children: body });
3038
+ return /* @__PURE__ */ jsx(TreeDndProvider, { children: treeBody });
3020
3039
  }
3021
3040
  __name(TreeRootShell, "TreeRootShell");
3022
3041
  var TreeRoot_default = TreeRoot;