@epam/ai-dial-react-file-manager

中文文档
0.4.3发布于 2026/11/16Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 2.5万

React file manager package for AI DIAL interfaces

原始使用文档
文档目录11 节
  1. Features
  2. Compatibility
  3. Installation
  4. Usage
  5. Public API
  6. Local development
  7. Publishing
  8. Versioning
  9. Contributing
  10. Security
  11. License

AI DIAL React File Manager

@epam/ai-dial-react-file-manager is the reusable React file manager used by AI DIAL interfaces. Shared controls and design tokens come from @epam/ai-dial-ui-kit; the file tree, file operations, upload flows, selection, conflict resolution, and file-manager-specific styles live in this package.

The package is ESM-only and is intended for React applications that supply their own persistence and backend integration through callbacks.

Features

  • File and folder navigation with tree, breadcrumb, and grid views
  • Upload, download, copy, move, rename, delete, and conflict-resolution flows
  • Controlled and uncontrolled navigation and selection state
  • Configurable actions, validation, metadata, and permission-management hooks
  • Responsive layouts and reusable standalone file-manager components

Compatibility

File managerAI DIAL UI KitReactAG GridModule format
Current development branch0.14.0-dev.12^19.2.5^35.2.1ESM

Installation

Install the package together with its peer dependencies:

npm install @epam/ai-dial-react-file-manager @epam/ai-dial-ui-kit \
  ag-grid-community ag-grid-react react react-dom

@tabler/icons-react is not in that list any more: this package imports the icon set itself, so it ships as a dependency and npm installs it for you (see issue epam/ai-dial-chat#8719). AG Grid stays a peer — the grid engine needs exactly one copy per host, or its module registration breaks — and so does the UI Kit, the design-system singleton a host renders with directly.

Import the UI Kit stylesheet first, followed by the file manager stylesheet:

import '@epam/ai-dial-ui-kit/styles.css';
import '@epam/ai-dial-react-file-manager/styles.css';

Usage

import {
  DialFileManager,
  DialFileNodeType,
  type DialFile,
} from '@epam/ai-dial-react-file-manager';

const files: DialFile[] = [
  {
    id: 'documents',
    folderId: 'documents',
    name: 'Documents',
    path: '/Documents',
    nodeType: DialFileNodeType.FOLDER,
    items: [],
  },
];

export const Files = () => (
  <DialFileManager
    items={files}
    defaultPath="/Documents"
    onPathChange={(path) => console.info(path)}
  />
);

DialFileManager manages the interaction state and calls consumer-provided handlers for persistence. The consuming application remains responsible for loading items, calling backend APIs, handling errors, and updating the items prop after an operation completes.

Common integration callbacks include:

  • onPathChange and onSelectedPathsChange
  • onUploadFiles, onUploadArchive, and onValidateUpload
  • onUploadValidationError, to show upload rejections (oversized or unsupported files) in the host's own UI instead of the built-in message
  • onCopyFiles, onMoveToFiles, and onDeleteFiles
  • onDownloadFiles, onUnshareFiles, and onRemoveFilesAccess
  • onManagePermissions, onPreview, and onOpenInNewTab

Public API

The primary export is DialFileManager. The package also exports:

  • FileManagerProvider and useFileManagerContext
  • DialDestinationFolderPopup and DialFoldersTree
  • File models, permissions, resource types, and selection modes
  • File-manager actions, tabs, trigger views, and column definitions
  • Public option and prop types used by the exported components

All supported public exports are declared in src/index.ts.

Local development

Install the npm dependencies and run the complete local verification:

npm ci
npm run typecheck
npm run lint
npm run test
npm run build

Run the interactive component examples with:

npm run storybook

Publishing

Publishing is restricted to project maintainers. Build the package and inspect the npm archive before starting a release:

npm run build
npm run publish:dry

Release automation is responsible for assigning the version and npm dist-tag. Do not publish directly from feature branches.

Versioning

The package follows Semantic Versioning. Changes to exported components, types, behavior, or styles that require consumer changes are treated as breaking changes and must be documented in CHANGELOG.md.

Contributing

See CONTRIBUTING.md for development and pull request guidelines.

Security

Please report vulnerabilities privately as described in SECURITY.md.

License

Licensed under the Apache License 2.0.

版本与发布记录

@epam/ai-dial-react-file-manager 共发布 85 个版本,首次发布于 2026/08/04;过去 12 个月发布了 85 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.3latest2026/11/16今天
0.5.0-dev.4development2026/11/16今天
0.4.22026/11/16今天
0.5.0-dev.32026/11/16今天
0.5.0-dev.22026/11/0511 天前
0.4.12026/11/0511 天前

其他发布通道:0.1-rc → 0.1.0-rc.0,0.2-rc → 0.2.0-rc.1,0.3-rc → 0.3.0-rc.0,0.4-rc → 0.4.0-rc.0,development → 0.5.0-dev.4。

关于 @epam/ai-dial-react-file-manager 的常见问题

@epam/ai-dial-react-file-manager 是什么?

React file manager package for AI DIAL interfaces

如何安装 @epam/ai-dial-react-file-manager?

在项目目录运行 npm install @epam/ai-dial-react-file-manager,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.2.5)、react-dom(^19.2.5)、ag-grid-react(^35.2.1)、ag-grid-community(^35.2.1)、@epam/ai-dial-ui-kit(^0.16.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@epam/ai-dial-react-file-manager 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@epam/ai-dial-react-file-manager 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@epam/ai-dial-react-file-manager 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.2.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@epam/ai-dial-react-file-manager 可以商用吗?

@epam/ai-dial-react-file-manager 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@epam/ai-dial-react-file-manager 的下载量有多少?

根据 npm 官方下载统计,@epam/ai-dial-react-file-manager 在 2026/10/14 – 2026/11/12 这 30 天内被下载 24,620 次,日均约 821 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@epam/ai-dial-react-file-manager 还在维护吗?

最新版本 0.4.3 发布于 2026/11/16(今天);至今共发布 85 个版本,其中过去 12 个月发布了 85 个;首次发布于 2026/08/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。