Skip to content

feat: component docs, utils modularization & antd v6 storybook migration - #13

Merged
shijistar merged 39 commits into
masterfrom
feature/component-docs
Aug 7, 2026
Merged

feat: component docs, utils modularization & antd v6 storybook migration#13
shijistar merged 39 commits into
masterfrom
feature/component-docs

Conversation

@shijistar

Copy link
Copy Markdown
Owner

Summary

This PR brings the feature/component-docs branch to master. It contains 33 commits covering Storybook bilingual documentation, antd v5 → v6 migration for stories, utils modularization, useMovable viewport support, and ModalAction destroyOnClose logic fixes.

Highlights

Storybook / Documentation

  • Migrate component stories to per-locale markdown docs (.storybook/stories/**/introduce.*.md, api-doc.*.md) with ?raw imports
  • Extract argTypes/story descriptions into i18n resources with storyT localization
  • Add bilingual (EN/CN) stories + markdown docs for 13 hooks and 7 utils modules
  • Clarify no-arg random() as a secure Math.random() replacement in utils/math docs
  • Add Sample code sections to all story introduce docs

antd v6 migration (Storybook only)

  • Migrate deprecated v5 props in 3 component stories (ConfirmAction, DeleteConfirmAction, ModalAction):
    • maskClosablemask: { closable }
    • destroyOnClosedestroyOnHidden
    • autoFocusButtonfocusable.autoFocusButton
  • Strictly limited to .storybook/, no src/ changes

Utils & Components

  • Split utils into modular implementations (base64, color, crypto, math, stream, string)
  • Add easy-full-height-table-v6 CSS utility
  • Enhance useMovable hook with viewport support and onMove callback
  • Change FloatDrawer event names

Bug fixes

  • fix(ModalAction): improve destroyOnClose logic — prefer destroyOnHidden with fallback to destroyOnClose
  • fix(ModalAction): ensure default values for destroyOnClose and destroyOnHidden props — restore defaults at render site (?? true), keeping the fallback branch reachable

Tests

  • Fix useMovable/useSplitter tests for viewport/enhanced APIs
  • Replace mouse events with pointer events in FloatDrawer dragResize tests

Verification

  • npx vitest run --coverage100% on all four thresholds (statements/branches/functions/lines)
  • npx tsc -p tsconfig.json --noEmit — clean
  • ✅ Prettier — clean
  • npx storybook build — succeeds

Commits

33 commits ahead of master (origin/master..HEAD), including:

  • ca93b0b fix(ModalAction): ensure default values for destroyOnClose and destroyOnHidden props
  • d916cb4 fix(ModalAction): improve destroyOnClose logic
  • 184dd83 fix(storybook): migrate antd v5 deprecated props to v6 APIs
  • 8982601 test(FloatDrawer): replace mouse events with pointer events in dragResize tests
  • 3a63ed9 docs: update changelog for version 2.2.0
  • cc1574c feat(utils): split utils into modular implementations, and change FloatDrawer event names
  • … (docs/storybook bilingual markdown commits)

Risks / Notes

  • Storybook doc migration touches a large number of .storybook/ files (docs-only, no runtime impact)
  • src/ changes are limited to ModalAction, useMovable, FloatDrawer, utils modularization, and CSS utility

shijistar and others added 30 commits August 3, 2026 23:46
- Move every component's API doc (including the 8 previously inline strings and
  VirtualTextViewer's i18n key) into <Name>.apidoc.md, imported with Vite ?raw.
- Remove the now-duplicated VirtualTextViewer.docs.component key from en-US/zh-CN.
- Each doc is organized by the component's own characteristics (overview, when-to-use,
  API table, notes/usage) rather than a fixed template.
- Preserves the existing autodocs render pipeline and EN/CN language toggle.

Co-Authored-By: Hermes <noreply@hermes.ai>
…ith index.stories.tsx

- Split each flat XXX.stories.tsx + XXX.apidoc.md into a per-component folder
- Rename main story to index.stories.tsx (matches Iconfont convention)
- Split apidoc.md at '## API' into introduce.md (intro/usage) + api-doc.md (API tables)
- Update import depths and docs description (introduce + apiDoc)
- 15 components migrated: BreakLines, ColumnSetting, ConfigProvider, ConfirmAction,
  ContextMenu, DeleteConfirmAction, EditableText, EllipsisTypography, FloatDrawer,
  FormItemControl, Loading, ModalAction, OverflowTags, PulseAnimation, VirtualTextViewer
- Verified via build-storybook (all index.stories.tsx scanned) and prettier
- Align with OverflowTags: each component folder now has introduce.en-US.md,
  introduce.zh-CN.md, api-doc.en-US.md, api-doc.zh-CN.md
- Split the previously bilingual (- **EN:** / - **CN:**) blocks and dual-language
  headings (## When to use | 适用场景, ## Notes | 说明) into separate locale files
- Drop the '# Component' title line from intro docs (matches OverflowTags)
- Update index.stories.tsx to import all four locale docs and switch the component
  description via storyI18n.language === 'zh-CN' ? CN : EN
- Components covered: BreakLines, ColumnSetting, ConfigProvider, ConfirmAction,
  ContextMenu, DeleteConfirmAction, EditableText, EllipsisTypography, FloatDrawer,
  FormItemControl, Iconfont, Loading, ModalAction, PulseAnimation, VirtualTextViewer
- Note: API table Description cells in en-US/zh-CN files keep the original English
  text (no CN translation added); bilingual narrative blocks are fully separated
- Verified via build-storybook (all 16 component stories scanned)
…sources

- Extract inline bilingual (- **EN:** / - **CN:**) description strings from
  argTypes[prop].description and story.parameters.docs.description.story across
  7 components into storybook.stories.<Comp>.{argTypes.<prop>|stories.<Story>}.description
  keys in en-US.ts / zh-CN.ts
- Replace inline strings with storyT('...') references (consistent with BreakLines pattern)
- EllipsisTypography's repeated 'text' description is merged into one shared key since
  the underlying text is identical across its four sub-stories
- Components covered: ConfirmAction, DeleteConfirmAction, EditableText, EllipsisTypography,
  Iconfont, ModalAction, PulseAnimation
- Verified via build-storybook (all 16 component stories scanned) and prettier
…i-doc tables

- Reorder every api-doc table column so the Description/说明 column sits
  immediately after the prop/field/method/参数/属性/方法 name column (2nd column)
- Affected tables include both primary component prop tables and nested type
  tables (ColumnSettingItem, ContextMenuItem/Submenu/Separator, ContextMenuRef)
- Order becomes: Name | Description | Type | (Default)  (or Name | Description | Type)
- Applied to all 16 api-doc.{en-US,zh-CN}.md files; prettier-formatted
…ction, ContextMenu)

- Add structured bilingual introduce sections (Overview / When to use / Key
  features / Usage notes) to BreakLines, ConfirmAction, ContextMenu
- ConfirmAction: add api-doc.en-US/zh-CN.md (component-specific props + ref
  methods) and wire it into index.stories.tsx imports/description
- All content derived from component source (Props JSDoc, behavior)
- prettier-formatted; build-storybook verified
- Add structured bilingual introduce (Overview / When to use / Key features /
  Usage notes) for all 16 components
- Add api-doc.en-US/zh-CN for the 7 components that lacked one
  (ConfigProvider, DeleteConfirmAction, EditableText, EllipsisTypography,
  ModalAction, PulseAnimation, VirtualTextViewer), wiring imports + description
  in each index.stories.tsx
- api-doc rule: list component-specific props fully + core/inherited props
  (not exhaustive)
- All content derived from component source (Props + behavior)
- prettier-formatted; build-storybook verified
…rkdown docs

- Convert flat hooks stories (useDebounce, useAudioPlayer, useStreamDownloader)
  to per-hook folders with bilingual introduce + api-doc markdown
- Align Utils/StreamDownloader story with the same component doc standard
- Wire index.stories.tsx component descriptions via storyI18n.language ternary
- Remove un-referenced stray introduce.mdx in Utils/StreamDownloader
…g hooks

- Add component-standard markdown docs (introduce.en-US.md, introduce.zh-CN.md, api-doc.en-US.md, api-doc.zh-CN.md) and index.stories.tsx for:
  useLocalStorage, useMovable, useProcessingText, useRefFunction, useRefValue, useRowSelection, useSplitter, useSSE, useStompSocket, useUserMedia, useValidators, useValidator, useValidatorBuilder
- Update locale files (en-US.ts, zh-CN.ts) with 162 new i18n keys for all 13 hooks
- All stories follow the established pattern: storyI18n.language ternary for component description, ?raw imports for markdown, t()/useStoryT() for UI strings
- Verified: prettier, tsc, build-storybook all pass
- Updated useMovable hook to accept viewPortRef for container-bound movement.
- Added onMove callback to notify position changes during dragging.
- Improved API documentation for useMovable with clearer parameter descriptions.
- Refactored useMovable implementation to handle viewport size and position clamping more effectively.
- Enhanced Storybook examples for useMovable to demonstrate new features.
- Updated various components to use title prop for Alert messages instead of message prop for consistency.
- Improved documentation for several components and hooks to clarify default values and usage.
…ed APIs

- useMovable: adapt tests to the new viewport-aware API (movableDomRef,
  viewPortRef, onMove callback, pointer capture fallbacks). Cover all
  branches including viewport rect fallbacks, clamp without dom ref,
  persistence + onMove on clamp, and pointermove when not dragging.
- useSplitter: switch event simulation from mouse to pointer events
  (pointerDown/pointerEnter/pointerLeave) to match the new onPointerDown
  implementation; cover setPointerCapture failure branch.
- Verified: vitest node+browser 537/537 pass, global coverage 100%
  (lines/stmts/funcs/branches), prettier + tsc + eslint clean.
Insert a bilingual 'Sample code' / '示例代码' section after Key features
and before Usage notes in all 66 introduce markdown files (33 stories x
en-US/zh-CN). Each sample shows the most typical usage backed by real
source API, kept concise (10-32 lines).
…ecks

- Update useMovable story examples to reflect simplified hook usage
- Add guard checks for theme and language globals in Storybook preview
- Add 26 rows (11 names x 3 roles) and enable pagination (pageSize 10) so
  multi-page selection can actually be demonstrated.
- Fix '{count}' not being interpolated: i18next default delimiters are {{ }},
  but selectedCount labels used single braces {count}.
- Replace the row-based <List> of selected rows with a compact inline Space+Tag
  display.
Add complete bilingual (en-US/zh-CN) Storybook stories for the utils
modules introduced by the recent utils refactor: AudioPlayer, base64,
color, crypto, math, stream, string.

Each story includes:
- index.stories.tsx with an interactive Playground demo
- introduce.*.md with Overview, When to use, Key features, Sample code,
  Usage notes
- api-doc.*.md with API tables verified against the real source exports

Also register the corresponding storybook.stories.* locale keys in
en-US.ts and zh-CN.ts.

Verified: prettier, eslint, tsc --noEmit, storybook build all pass.
- Replace Modal maskClosable with mask.closable in ConfirmAction/DeleteConfirmAction/ModalAction stories
- Replace Modal destroyOnClose with destroyOnHidden in ModalAction story
- Replace Modal autoFocusButton arg/control with focusable.autoFocusButton in ConfirmAction/DeleteConfirmAction stories
Copilot AI lite review requested due to automatic review settings August 7, 2026 05:09
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 254 files, which is 154 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 76a7639c-ed21-4fc4-add3-fe312a83a010

📥 Commits

Reviewing files that changed from the base of the PR and between 2c1e36a and 0972011.

📒 Files selected for processing (254)
  • .storybook/locales/langs/en-US.ts
  • .storybook/locales/langs/zh-CN.ts
  • .storybook/preview-head.html
  • .storybook/preview.tsx
  • .storybook/stories/components/BreakLines.stories.tsx
  • .storybook/stories/components/BreakLines/api-doc.en-US.md
  • .storybook/stories/components/BreakLines/api-doc.zh-CN.md
  • .storybook/stories/components/BreakLines/index.stories.tsx
  • .storybook/stories/components/BreakLines/introduce.en-US.md
  • .storybook/stories/components/BreakLines/introduce.zh-CN.md
  • .storybook/stories/components/ColumnSetting/api-doc.en-US.md
  • .storybook/stories/components/ColumnSetting/api-doc.zh-CN.md
  • .storybook/stories/components/ColumnSetting/index.stories.tsx
  • .storybook/stories/components/ColumnSetting/introduce.en-US.md
  • .storybook/stories/components/ColumnSetting/introduce.zh-CN.md
  • .storybook/stories/components/ConfigProvider/api-doc.en-US.md
  • .storybook/stories/components/ConfigProvider/api-doc.zh-CN.md
  • .storybook/stories/components/ConfigProvider/index.stories.tsx
  • .storybook/stories/components/ConfigProvider/introduce.en-US.md
  • .storybook/stories/components/ConfigProvider/introduce.zh-CN.md
  • .storybook/stories/components/ConfirmAction/api-doc.en-US.md
  • .storybook/stories/components/ConfirmAction/api-doc.zh-CN.md
  • .storybook/stories/components/ConfirmAction/index.stories.tsx
  • .storybook/stories/components/ConfirmAction/introduce.en-US.md
  • .storybook/stories/components/ConfirmAction/introduce.zh-CN.md
  • .storybook/stories/components/ContextMenu/api-doc.en-US.md
  • .storybook/stories/components/ContextMenu/api-doc.zh-CN.md
  • .storybook/stories/components/ContextMenu/index.stories.tsx
  • .storybook/stories/components/ContextMenu/introduce.en-US.md
  • .storybook/stories/components/ContextMenu/introduce.zh-CN.md
  • .storybook/stories/components/DeleteConfirmAction/api-doc.en-US.md
  • .storybook/stories/components/DeleteConfirmAction/api-doc.zh-CN.md
  • .storybook/stories/components/DeleteConfirmAction/index.stories.tsx
  • .storybook/stories/components/DeleteConfirmAction/introduce.en-US.md
  • .storybook/stories/components/DeleteConfirmAction/introduce.zh-CN.md
  • .storybook/stories/components/EditableText/api-doc.en-US.md
  • .storybook/stories/components/EditableText/api-doc.zh-CN.md
  • .storybook/stories/components/EditableText/index.stories.tsx
  • .storybook/stories/components/EditableText/introduce.en-US.md
  • .storybook/stories/components/EditableText/introduce.zh-CN.md
  • .storybook/stories/components/EllipsisTypography/api-doc.en-US.md
  • .storybook/stories/components/EllipsisTypography/api-doc.zh-CN.md
  • .storybook/stories/components/EllipsisTypography/index.stories.tsx
  • .storybook/stories/components/EllipsisTypography/introduce.en-US.md
  • .storybook/stories/components/EllipsisTypography/introduce.zh-CN.md
  • .storybook/stories/components/FloatDrawer/api-doc.en-US.md
  • .storybook/stories/components/FloatDrawer/api-doc.zh-CN.md
  • .storybook/stories/components/FloatDrawer/index.stories.tsx
  • .storybook/stories/components/FloatDrawer/introduce.en-US.md
  • .storybook/stories/components/FloatDrawer/introduce.zh-CN.md
  • .storybook/stories/components/FormItemControl/api-doc.en-US.md
  • .storybook/stories/components/FormItemControl/api-doc.zh-CN.md
  • .storybook/stories/components/FormItemControl/index.stories.tsx
  • .storybook/stories/components/FormItemControl/introduce.en-US.md
  • .storybook/stories/components/FormItemControl/introduce.zh-CN.md
  • .storybook/stories/components/Iconfont/api-doc.en-US.md
  • .storybook/stories/components/Iconfont/api-doc.md
  • .storybook/stories/components/Iconfont/api-doc.zh-CN.md
  • .storybook/stories/components/Iconfont/index.stories.tsx
  • .storybook/stories/components/Iconfont/introduce.en-US.md
  • .storybook/stories/components/Iconfont/introduce.md
  • .storybook/stories/components/Iconfont/introduce.zh-CN.md
  • .storybook/stories/components/Loading/api-doc.en-US.md
  • .storybook/stories/components/Loading/api-doc.zh-CN.md
  • .storybook/stories/components/Loading/index.stories.tsx
  • .storybook/stories/components/Loading/introduce.en-US.md
  • .storybook/stories/components/Loading/introduce.zh-CN.md
  • .storybook/stories/components/ModalAction/api-doc.en-US.md
  • .storybook/stories/components/ModalAction/api-doc.zh-CN.md
  • .storybook/stories/components/ModalAction/index.stories.tsx
  • .storybook/stories/components/ModalAction/introduce.en-US.md
  • .storybook/stories/components/ModalAction/introduce.zh-CN.md
  • .storybook/stories/components/OverflowTags/api-doc.en-US.md
  • .storybook/stories/components/OverflowTags/api-doc.zh-CN.md
  • .storybook/stories/components/OverflowTags/index.stories.tsx
  • .storybook/stories/components/OverflowTags/introduce.en-US.md
  • .storybook/stories/components/OverflowTags/introduce.zh-CN.md
  • .storybook/stories/components/PulseAnimation/api-doc.en-US.md
  • .storybook/stories/components/PulseAnimation/api-doc.zh-CN.md
  • .storybook/stories/components/PulseAnimation/index.stories.tsx
  • .storybook/stories/components/PulseAnimation/introduce.en-US.md
  • .storybook/stories/components/PulseAnimation/introduce.zh-CN.md
  • .storybook/stories/components/VirtualTextViewer/api-doc.en-US.md
  • .storybook/stories/components/VirtualTextViewer/api-doc.zh-CN.md
  • .storybook/stories/components/VirtualTextViewer/index.stories.tsx
  • .storybook/stories/components/VirtualTextViewer/introduce.en-US.md
  • .storybook/stories/components/VirtualTextViewer/introduce.zh-CN.md
  • .storybook/stories/hooks/useAudioPlayer/api-doc.en-US.md
  • .storybook/stories/hooks/useAudioPlayer/api-doc.zh-CN.md
  • .storybook/stories/hooks/useAudioPlayer/index.stories.tsx
  • .storybook/stories/hooks/useAudioPlayer/introduce.en-US.md
  • .storybook/stories/hooks/useAudioPlayer/introduce.zh-CN.md
  • .storybook/stories/hooks/useDebounce/api-doc.en-US.md
  • .storybook/stories/hooks/useDebounce/api-doc.zh-CN.md
  • .storybook/stories/hooks/useDebounce/index.stories.tsx
  • .storybook/stories/hooks/useDebounce/introduce.en-US.md
  • .storybook/stories/hooks/useDebounce/introduce.zh-CN.md
  • .storybook/stories/hooks/useLocalStorage/api-doc.en-US.md
  • .storybook/stories/hooks/useLocalStorage/api-doc.zh-CN.md
  • .storybook/stories/hooks/useLocalStorage/index.stories.tsx
  • .storybook/stories/hooks/useLocalStorage/introduce.en-US.md
  • .storybook/stories/hooks/useLocalStorage/introduce.zh-CN.md
  • .storybook/stories/hooks/useMovable/api-doc.en-US.md
  • .storybook/stories/hooks/useMovable/api-doc.zh-CN.md
  • .storybook/stories/hooks/useMovable/index.stories.tsx
  • .storybook/stories/hooks/useMovable/introduce.en-US.md
  • .storybook/stories/hooks/useMovable/introduce.zh-CN.md
  • .storybook/stories/hooks/useProcessingText/api-doc.en-US.md
  • .storybook/stories/hooks/useProcessingText/api-doc.zh-CN.md
  • .storybook/stories/hooks/useProcessingText/index.stories.tsx
  • .storybook/stories/hooks/useProcessingText/introduce.en-US.md
  • .storybook/stories/hooks/useProcessingText/introduce.zh-CN.md
  • .storybook/stories/hooks/useRefFunction/api-doc.en-US.md
  • .storybook/stories/hooks/useRefFunction/api-doc.zh-CN.md
  • .storybook/stories/hooks/useRefFunction/index.stories.tsx
  • .storybook/stories/hooks/useRefFunction/introduce.en-US.md
  • .storybook/stories/hooks/useRefFunction/introduce.zh-CN.md
  • .storybook/stories/hooks/useRefValue/api-doc.en-US.md
  • .storybook/stories/hooks/useRefValue/api-doc.zh-CN.md
  • .storybook/stories/hooks/useRefValue/index.stories.tsx
  • .storybook/stories/hooks/useRefValue/introduce.en-US.md
  • .storybook/stories/hooks/useRefValue/introduce.zh-CN.md
  • .storybook/stories/hooks/useRowSelection/api-doc.en-US.md
  • .storybook/stories/hooks/useRowSelection/api-doc.zh-CN.md
  • .storybook/stories/hooks/useRowSelection/index.stories.tsx
  • .storybook/stories/hooks/useRowSelection/introduce.en-US.md
  • .storybook/stories/hooks/useRowSelection/introduce.zh-CN.md
  • .storybook/stories/hooks/useSSE/api-doc.en-US.md
  • .storybook/stories/hooks/useSSE/api-doc.zh-CN.md
  • .storybook/stories/hooks/useSSE/index.stories.tsx
  • .storybook/stories/hooks/useSSE/introduce.en-US.md
  • .storybook/stories/hooks/useSSE/introduce.zh-CN.md
  • .storybook/stories/hooks/useSplitter/api-doc.en-US.md
  • .storybook/stories/hooks/useSplitter/api-doc.zh-CN.md
  • .storybook/stories/hooks/useSplitter/index.stories.tsx
  • .storybook/stories/hooks/useSplitter/introduce.en-US.md
  • .storybook/stories/hooks/useSplitter/introduce.zh-CN.md
  • .storybook/stories/hooks/useStompSocket/api-doc.en-US.md
  • .storybook/stories/hooks/useStompSocket/api-doc.zh-CN.md
  • .storybook/stories/hooks/useStompSocket/index.stories.tsx
  • .storybook/stories/hooks/useStompSocket/introduce.en-US.md
  • .storybook/stories/hooks/useStompSocket/introduce.zh-CN.md
  • .storybook/stories/hooks/useStreamDownloader/api-doc.en-US.md
  • .storybook/stories/hooks/useStreamDownloader/api-doc.zh-CN.md
  • .storybook/stories/hooks/useStreamDownloader/index.stories.tsx
  • .storybook/stories/hooks/useStreamDownloader/introduce.en-US.md
  • .storybook/stories/hooks/useStreamDownloader/introduce.zh-CN.md
  • .storybook/stories/hooks/useUserMedia/api-doc.en-US.md
  • .storybook/stories/hooks/useUserMedia/api-doc.zh-CN.md
  • .storybook/stories/hooks/useUserMedia/index.stories.tsx
  • .storybook/stories/hooks/useUserMedia/introduce.en-US.md
  • .storybook/stories/hooks/useUserMedia/introduce.zh-CN.md
  • .storybook/stories/hooks/useValidator/api-doc.en-US.md
  • .storybook/stories/hooks/useValidator/api-doc.zh-CN.md
  • .storybook/stories/hooks/useValidator/index.stories.tsx
  • .storybook/stories/hooks/useValidator/introduce.en-US.md
  • .storybook/stories/hooks/useValidator/introduce.zh-CN.md
  • .storybook/stories/hooks/useValidatorBuilder/api-doc.en-US.md
  • .storybook/stories/hooks/useValidatorBuilder/api-doc.zh-CN.md
  • .storybook/stories/hooks/useValidatorBuilder/index.stories.tsx
  • .storybook/stories/hooks/useValidatorBuilder/introduce.en-US.md
  • .storybook/stories/hooks/useValidatorBuilder/introduce.zh-CN.md
  • .storybook/stories/hooks/useValidators/api-doc.en-US.md
  • .storybook/stories/hooks/useValidators/api-doc.zh-CN.md
  • .storybook/stories/hooks/useValidators/index.stories.tsx
  • .storybook/stories/hooks/useValidators/introduce.en-US.md
  • .storybook/stories/hooks/useValidators/introduce.zh-CN.md
  • .storybook/stories/shared/streamDownloaderDemo.tsx
  • .storybook/stories/utils/AudioPlayer/api-doc.en-US.md
  • .storybook/stories/utils/AudioPlayer/api-doc.zh-CN.md
  • .storybook/stories/utils/AudioPlayer/index.stories.tsx
  • .storybook/stories/utils/AudioPlayer/introduce.en-US.md
  • .storybook/stories/utils/AudioPlayer/introduce.zh-CN.md
  • .storybook/stories/utils/StreamDownloader/api-doc.en-US.md
  • .storybook/stories/utils/StreamDownloader/api-doc.zh-CN.md
  • .storybook/stories/utils/StreamDownloader/index.stories.tsx
  • .storybook/stories/utils/StreamDownloader/introduce.en-US.md
  • .storybook/stories/utils/StreamDownloader/introduce.mdx
  • .storybook/stories/utils/StreamDownloader/introduce.zh-CN.md
  • .storybook/stories/utils/base64/api-doc.en-US.md
  • .storybook/stories/utils/base64/api-doc.zh-CN.md
  • .storybook/stories/utils/base64/index.stories.tsx
  • .storybook/stories/utils/base64/introduce.en-US.md
  • .storybook/stories/utils/base64/introduce.zh-CN.md
  • .storybook/stories/utils/color/api-doc.en-US.md
  • .storybook/stories/utils/color/api-doc.zh-CN.md
  • .storybook/stories/utils/color/index.stories.tsx
  • .storybook/stories/utils/color/introduce.en-US.md
  • .storybook/stories/utils/color/introduce.zh-CN.md
  • .storybook/stories/utils/crypto/api-doc.en-US.md
  • .storybook/stories/utils/crypto/api-doc.zh-CN.md
  • .storybook/stories/utils/crypto/index.stories.tsx
  • .storybook/stories/utils/crypto/introduce.en-US.md
  • .storybook/stories/utils/crypto/introduce.zh-CN.md
  • .storybook/stories/utils/math/api-doc.en-US.md
  • .storybook/stories/utils/math/api-doc.zh-CN.md
  • .storybook/stories/utils/math/index.stories.tsx
  • .storybook/stories/utils/math/introduce.en-US.md
  • .storybook/stories/utils/math/introduce.zh-CN.md
  • .storybook/stories/utils/stream/api-doc.en-US.md
  • .storybook/stories/utils/stream/api-doc.zh-CN.md
  • .storybook/stories/utils/stream/index.stories.tsx
  • .storybook/stories/utils/stream/introduce.en-US.md
  • .storybook/stories/utils/stream/introduce.zh-CN.md
  • .storybook/stories/utils/string/api-doc.en-US.md
  • .storybook/stories/utils/string/api-doc.zh-CN.md
  • .storybook/stories/utils/string/index.stories.tsx
  • .storybook/stories/utils/string/introduce.en-US.md
  • .storybook/stories/utils/string/introduce.zh-CN.md
  • .storybook/utils/doc.ts
  • CHANGELOG.md
  • package.json
  • src/components/Animation/Pulse/index.tsx
  • src/components/ConfigProvider/style/index.ts
  • src/components/ConfirmAction/index.tsx
  • src/components/ContextMenu/index.tsx
  • src/components/FloatDrawer/index.tsx
  • src/components/FloatDrawer/style/index.ts
  • src/components/Lexical/nodes/SelectNode.tsx
  • src/components/Lexical/nodes/base.ts
  • src/components/ModalAction/index.tsx
  • src/components/OverflowTags/index.tsx
  • src/hooks/useDebounce.ts
  • src/hooks/useMovable.ts
  • src/hooks/useProcessingText.ts
  • src/hooks/useSplitter.tsx
  • src/hooks/useValidators.ts
  • src/utils/base64.ts
  • src/utils/base64/arrayBufferToBase64.ts
  • src/utils/base64/base64ToArrayBuffer.ts
  • src/utils/base64/base64ToString.ts
  • src/utils/base64/index.ts
  • src/utils/base64/stringToBase64.ts
  • src/utils/color/getColorLuminance.ts
  • src/utils/color/index.ts
  • src/utils/crypto.ts
  • src/utils/crypto/advancedDecrypt.ts
  • src/utils/crypto/advancedEncrypt.ts
  • src/utils/crypto/decryptAES.ts
  • src/utils/crypto/decryptWithCryptoJS.ts
  • src/utils/crypto/encryptAES.ts
  • src/utils/crypto/encryptWithCryptoJS.ts
  • src/utils/crypto/index.ts
  • src/utils/math/index.ts
  • src/utils/math/random.ts
  • src/utils/stream/StreamTimeSlicerClass.ts
  • src/utils/stream/index.ts
  • src/utils/string/index.ts
  • src/utils/string/randomChars.ts
  • src/utils/string/readTextAnyEncoding.ts
  • test/components/FloatDrawer.test.tsx
  • test/hooks/useMovable.test.tsx
  • test/hooks/useSplitter.test.tsx
  • test/utils/string.test.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR lands a broad set of Storybook documentation and story migrations (bilingual, per-locale markdown via ?raw, antd v6 story-only adjustments) while also modularizing src/utils/* and updating a few runtime hooks/components (notably useSplitter, ModalAction, validators, and some styling tweaks).

Changes:

  • Migrate Storybook docs/stories to bilingual per-locale markdown docs and localized argTypes/descriptions.
  • Modularize utilities into base64 / crypto / math / color / stream / string submodules with barrel exports.
  • Update runtime behavior in src/ (pointer interactions in useSplitter, ModalAction destroy flags handling, validators allowing spaces, and styling adjustments).

Reviewed changes

Copilot reviewed 253 out of 253 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/hooks/useSplitter.test.tsx Updates splitter tests for pointer-event entry points.
src/utils/string/readTextAnyEncoding.ts Converts to default export as part of utils modularization.
src/utils/string/randomChars.ts Adds randomChars utility as default export.
src/utils/string/index.ts Barrels string utilities for public re-export.
src/utils/stream/StreamTimeSlicerClass.ts Switches to default export while keeping types exported.
src/utils/stream/index.ts Barrels stream utilities/types for public re-export.
src/utils/math/random.ts Refactors random to default export (keeps overloads).
src/utils/math/index.ts Barrels math utilities for public re-export.
src/utils/crypto/index.ts Barrels crypto utilities for public re-export.
src/utils/crypto/encryptWithCryptoJS.ts Adds CryptoJS-based AES encryption helper (dynamic imports).
src/utils/crypto/decryptWithCryptoJS.ts Adds CryptoJS-based AES decryption helper (dynamic imports).
src/utils/crypto/advancedEncrypt.ts Adds “advanced” encryption wrapper (noted security concern in review).
src/utils/crypto/advancedDecrypt.ts Adds decrypt counterpart for advancedEncrypt.
src/utils/color/index.ts Barrels color utilities for public re-export.
src/utils/color/getColorLuminance.ts Converts luminance helper to default export.
src/utils/base64/stringToBase64.ts Adds UTF-8 aware Base64 encoder (std + URL-safe).
src/utils/base64/index.ts Barrels base64 utilities for public re-export.
src/utils/base64/base64ToString.ts Adds UTF-8 aware Base64 decoder (std + URL-safe).
src/utils/base64/arrayBufferToBase64.ts Adds ArrayBuffer → Base64 conversion helper.
src/hooks/useValidators.ts Extends name validators to allow spaces.
src/hooks/useSplitter.tsx Migrates splitter interaction to pointer events (noted event-listener mismatch in review).
src/hooks/useProcessingText.ts Improves JSDoc with explicit @default annotations.
src/hooks/useDebounce.ts Improves JSDoc defaults + minor formatting.
src/components/ModalAction/index.tsx Adjusts destroy flag handling (destroyOnHidden vs destroyOnClose) and render defaults (noted ref-default mismatch in review).
src/components/Lexical/nodes/SelectNode.tsx JSDoc default annotation alignment.
src/components/Lexical/nodes/base.ts JSDoc default annotation alignment.
src/components/FloatDrawer/style/index.ts Tweaks toggle positioning offsets for FloatDrawer.
src/components/ContextMenu/index.tsx JSDoc default annotation alignment.
src/components/ConfirmAction/index.tsx Tightens typing via satisfies ModalFuncProps and updates JSDoc defaults.
src/components/ConfigProvider/style/index.ts Adds global .easy-full-height-table-v6 utility style.
src/components/Animation/Pulse/index.tsx JSDoc default annotation alignment.
package.json Bumps package version to 2.2.0.
CHANGELOG.md Adds 2.2.0 release notes.
.storybook/stories/utils/string/introduce.zh-CN.md Adds CN introduce doc for string utils.
.storybook/stories/utils/string/introduce.en-US.md Adds EN introduce doc for string utils.
.storybook/stories/utils/string/api-doc.zh-CN.md Adds CN API doc for string utils.
.storybook/stories/utils/string/api-doc.en-US.md Adds EN API doc for string utils.
.storybook/stories/utils/StreamDownloader/introduce.mdx Removes placeholder MDX introduce doc.
.storybook/stories/utils/StreamDownloader/introduce.en-US.md Adds EN introduce doc for StreamDownloader.
.storybook/stories/utils/stream/api-doc.en-US.md Adds EN API doc for stream utils.
.storybook/stories/utils/math/api-doc.zh-CN.md Adds CN API doc for math utils.
.storybook/stories/utils/math/api-doc.en-US.md Adds EN API doc for math utils.
.storybook/stories/utils/crypto/api-doc.zh-CN.md Adds CN API doc for crypto utils.
.storybook/stories/utils/crypto/api-doc.en-US.md Adds EN API doc for crypto utils.
.storybook/stories/utils/color/introduce.zh-CN.md Adds CN introduce doc for color utils.
.storybook/stories/utils/color/introduce.en-US.md Adds EN introduce doc for color utils.
.storybook/stories/utils/color/api-doc.zh-CN.md Adds CN API doc for color utils.
.storybook/stories/utils/color/api-doc.en-US.md Adds EN API doc for color utils.
.storybook/stories/utils/base64/introduce.en-US.md Adds EN introduce doc for base64 utils.
.storybook/stories/shared/streamDownloaderDemo.tsx Adjusts Alert props for story compatibility.
.storybook/stories/hooks/useValidators/introduce.zh-CN.md Adds CN introduce doc for useValidators.
.storybook/stories/hooks/useValidators/introduce.en-US.md Adds EN introduce doc for useValidators.
.storybook/stories/hooks/useValidators/api-doc.en-US.md Adds EN API doc for useValidators.
.storybook/stories/hooks/useValidatorBuilder/api-doc.en-US.md Adds EN API doc for useValidatorBuilder.
.storybook/stories/hooks/useValidator/introduce.zh-CN.md Adds CN introduce doc for useValidator.
.storybook/stories/hooks/useValidator/introduce.en-US.md Adds EN introduce doc for useValidator.
.storybook/stories/hooks/useValidator/api-doc.zh-CN.md Adds CN API doc for useValidator.
.storybook/stories/hooks/useValidator/api-doc.en-US.md Adds EN API doc for useValidator.
.storybook/stories/hooks/useUserMedia/introduce.en-US.md Adds EN introduce doc for useUserMedia.
.storybook/stories/hooks/useUserMedia/api-doc.zh-CN.md Adds CN API doc for useUserMedia.
.storybook/stories/hooks/useUserMedia/api-doc.en-US.md Adds EN API doc for useUserMedia.
.storybook/stories/hooks/useStreamDownloader/api-doc.zh-CN.md Adds CN API doc for useStreamDownloader.
.storybook/stories/hooks/useStreamDownloader/api-doc.en-US.md Adds EN API doc for useStreamDownloader.
.storybook/stories/hooks/useStompSocket/introduce.zh-CN.md Adds CN introduce doc for useStompSocket.
.storybook/stories/hooks/useStompSocket/introduce.en-US.md Adds EN introduce doc for useStompSocket.
.storybook/stories/hooks/useStompSocket/api-doc.zh-CN.md Adds CN API doc for useStompSocket.
.storybook/stories/hooks/useStompSocket/api-doc.en-US.md Adds EN API doc for useStompSocket.
.storybook/stories/hooks/useSSE/api-doc.zh-CN.md Adds CN API doc for useSSE.
.storybook/stories/hooks/useSSE/api-doc.en-US.md Adds EN API doc for useSSE.
.storybook/stories/hooks/useSplitter/introduce.en-US.md Adds EN introduce doc for useSplitter.
.storybook/stories/hooks/useSplitter/api-doc.zh-CN.md Adds CN API doc for useSplitter.
.storybook/stories/hooks/useSplitter/api-doc.en-US.md Adds EN API doc for useSplitter.
.storybook/stories/hooks/useRowSelection/introduce.zh-CN.md Adds CN introduce doc for useRowSelection.
.storybook/stories/hooks/useRowSelection/introduce.en-US.md Adds EN introduce doc for useRowSelection.
.storybook/stories/hooks/useRowSelection/api-doc.zh-CN.md Adds CN API doc for useRowSelection.
.storybook/stories/hooks/useRowSelection/api-doc.en-US.md Adds EN API doc for useRowSelection.
.storybook/stories/hooks/useRefValue/introduce.zh-CN.md Adds CN introduce doc for useRefValue.
.storybook/stories/hooks/useRefValue/introduce.en-US.md Adds EN introduce doc for useRefValue.
.storybook/stories/hooks/useRefValue/api-doc.zh-CN.md Adds CN API doc for useRefValue.
.storybook/stories/hooks/useRefValue/api-doc.en-US.md Adds EN API doc for useRefValue.
.storybook/stories/hooks/useRefFunction/introduce.zh-CN.md Adds CN introduce doc for useRefFunction.
.storybook/stories/hooks/useRefFunction/introduce.en-US.md Adds EN introduce doc for useRefFunction.
.storybook/stories/hooks/useRefFunction/api-doc.zh-CN.md Adds CN API doc for useRefFunction.
.storybook/stories/hooks/useRefFunction/api-doc.en-US.md Adds EN API doc for useRefFunction.
.storybook/stories/hooks/useProcessingText/introduce.zh-CN.md Adds CN introduce doc for useProcessingText.
.storybook/stories/hooks/useProcessingText/introduce.en-US.md Adds EN introduce doc for useProcessingText.
.storybook/stories/hooks/useProcessingText/api-doc.zh-CN.md Adds CN API doc for useProcessingText.
.storybook/stories/hooks/useProcessingText/api-doc.en-US.md Adds EN API doc for useProcessingText.
.storybook/stories/hooks/useMovable/introduce.zh-CN.md Adds CN introduce doc for useMovable.
.storybook/stories/hooks/useMovable/introduce.en-US.md Adds EN introduce doc for useMovable.
.storybook/stories/hooks/useMovable/api-doc.zh-CN.md Adds CN API doc for useMovable.
.storybook/stories/hooks/useMovable/api-doc.en-US.md Adds EN API doc for useMovable.
.storybook/stories/hooks/useLocalStorage/introduce.zh-CN.md Adds CN introduce doc for useLocalStorage.
.storybook/stories/hooks/useLocalStorage/introduce.en-US.md Adds EN introduce doc for useLocalStorage.
.storybook/stories/hooks/useLocalStorage/api-doc.zh-CN.md Adds CN API doc for useLocalStorage.
.storybook/stories/hooks/useLocalStorage/api-doc.en-US.md Adds EN API doc for useLocalStorage.
.storybook/stories/hooks/useDebounce/introduce.en-US.md Adds EN introduce doc for useDebounce.
.storybook/stories/hooks/useDebounce/api-doc.zh-CN.md Adds CN API doc for useDebounce.
.storybook/stories/hooks/useDebounce/api-doc.en-US.md Adds EN API doc for useDebounce.
.storybook/stories/components/VirtualTextViewer/introduce.zh-CN.md Adds CN introduce doc for VirtualTextViewer.
.storybook/stories/components/VirtualTextViewer/introduce.en-US.md Adds EN introduce doc for VirtualTextViewer.
.storybook/stories/components/VirtualTextViewer/index.stories.tsx Migrates story to ?raw markdown docs + new locales wiring.
.storybook/stories/components/VirtualTextViewer/api-doc.zh-CN.md Adds CN API doc for VirtualTextViewer.
.storybook/stories/components/VirtualTextViewer/api-doc.en-US.md Adds EN API doc for VirtualTextViewer.
.storybook/stories/components/PulseAnimation/introduce.zh-CN.md Adds CN introduce doc for PulseAnimation.
.storybook/stories/components/PulseAnimation/introduce.en-US.md Adds EN introduce doc for PulseAnimation.
.storybook/stories/components/PulseAnimation/api-doc.zh-CN.md Adds CN API doc for PulseAnimation.
.storybook/stories/components/PulseAnimation/api-doc.en-US.md Adds EN API doc for PulseAnimation.
.storybook/stories/components/OverflowTags/introduce.zh-CN.md Adds CN introduce doc for OverflowTags.
.storybook/stories/components/OverflowTags/introduce.en-US.md Adds EN introduce doc for OverflowTags.
.storybook/stories/components/OverflowTags/index.stories.tsx Migrates story to ?raw markdown docs + localized argTypes.
.storybook/stories/components/OverflowTags/api-doc.zh-CN.md Adds CN API doc for OverflowTags.
.storybook/stories/components/OverflowTags/api-doc.en-US.md Adds EN API doc for OverflowTags.
.storybook/stories/components/ModalAction/api-doc.zh-CN.md Adds CN API doc for ModalAction.
.storybook/stories/components/ModalAction/api-doc.en-US.md Adds EN API doc for ModalAction.
.storybook/stories/components/Loading/introduce.zh-CN.md Adds CN introduce doc for Loading.
.storybook/stories/components/Loading/introduce.en-US.md Adds EN introduce doc for Loading.
.storybook/stories/components/Loading/index.stories.tsx Migrates story to ?raw markdown docs wiring.
.storybook/stories/components/Loading/api-doc.zh-CN.md Adds CN API doc for Loading.
.storybook/stories/components/Loading/api-doc.en-US.md Adds EN API doc for Loading.
.storybook/stories/components/Iconfont/introduce.zh-CN.md Adds CN introduce doc for Iconfont.
.storybook/stories/components/Iconfont/introduce.md Removes old combined bilingual introduce doc.
.storybook/stories/components/Iconfont/introduce.en-US.md Adds EN introduce doc for Iconfont.
.storybook/stories/components/Iconfont/api-doc.zh-CN.md Adds CN API doc for Iconfont.
.storybook/stories/components/Iconfont/api-doc.md Removes old combined bilingual API doc.
.storybook/stories/components/Iconfont/api-doc.en-US.md Adds EN API doc for Iconfont.
.storybook/stories/components/FormItemControl/introduce.zh-CN.md Adds CN introduce doc for FormItemControl.
.storybook/stories/components/FormItemControl/introduce.en-US.md Adds EN introduce doc for FormItemControl.
.storybook/stories/components/FormItemControl/index.stories.tsx Migrates story to ?raw markdown docs wiring.
.storybook/stories/components/FormItemControl/api-doc.zh-CN.md Adds CN API doc for FormItemControl.
.storybook/stories/components/FormItemControl/api-doc.en-US.md Adds EN API doc for FormItemControl.
.storybook/stories/components/FloatDrawer/introduce.zh-CN.md Adds CN introduce doc for FloatDrawer.
.storybook/stories/components/FloatDrawer/introduce.en-US.md Adds EN introduce doc for FloatDrawer.
.storybook/stories/components/FloatDrawer/index.stories.tsx Migrates story to ?raw markdown docs wiring.
.storybook/stories/components/FloatDrawer/api-doc.zh-CN.md Adds CN API doc for FloatDrawer.
.storybook/stories/components/FloatDrawer/api-doc.en-US.md Adds EN API doc for FloatDrawer.
.storybook/stories/components/EllipsisTypography/introduce.zh-CN.md Adds CN introduce doc for EllipsisTypography.
.storybook/stories/components/EllipsisTypography/introduce.en-US.md Adds EN introduce doc for EllipsisTypography.
.storybook/stories/components/EllipsisTypography/api-doc.zh-CN.md Adds CN API doc for EllipsisTypography.
.storybook/stories/components/EllipsisTypography/api-doc.en-US.md Adds EN API doc for EllipsisTypography.
.storybook/stories/components/EditableText/introduce.zh-CN.md Adds CN introduce doc for EditableText.
.storybook/stories/components/EditableText/introduce.en-US.md Adds EN introduce doc for EditableText.
.storybook/stories/components/EditableText/api-doc.zh-CN.md Adds CN API doc for EditableText.
.storybook/stories/components/EditableText/api-doc.en-US.md Adds EN API doc for EditableText.
.storybook/stories/components/DeleteConfirmAction/introduce.zh-CN.md Adds CN introduce doc for DeleteConfirmAction.
.storybook/stories/components/DeleteConfirmAction/introduce.en-US.md Adds EN introduce doc for DeleteConfirmAction.
.storybook/stories/components/DeleteConfirmAction/api-doc.zh-CN.md Adds CN API doc for DeleteConfirmAction.
.storybook/stories/components/DeleteConfirmAction/api-doc.en-US.md Adds EN API doc for DeleteConfirmAction.
.storybook/stories/components/ContextMenu/introduce.en-US.md Adds EN introduce doc for ContextMenu.
.storybook/stories/components/ContextMenu/index.stories.tsx Migrates story to ?raw markdown docs wiring.
.storybook/stories/components/ContextMenu/api-doc.zh-CN.md Adds CN API doc for ContextMenu.
.storybook/stories/components/ContextMenu/api-doc.en-US.md Adds EN API doc for ContextMenu.
.storybook/stories/components/ConfirmAction/api-doc.en-US.md Adds EN API doc for ConfirmAction.
.storybook/stories/components/ConfigProvider/introduce.zh-CN.md Adds CN introduce doc for ConfigProvider.
.storybook/stories/components/ConfigProvider/introduce.en-US.md Adds EN introduce doc for ConfigProvider.
.storybook/stories/components/ConfigProvider/index.stories.tsx Migrates story to ?raw markdown docs wiring + Space prop update.
.storybook/stories/components/ConfigProvider/api-doc.zh-CN.md Adds CN API doc for ConfigProvider.
.storybook/stories/components/ConfigProvider/api-doc.en-US.md Adds EN API doc for ConfigProvider.
.storybook/stories/components/ColumnSetting/introduce.en-US.md Adds EN introduce doc for ColumnSetting.
.storybook/stories/components/ColumnSetting/index.stories.tsx Migrates story to ?raw markdown docs wiring + import path updates.
.storybook/stories/components/ColumnSetting/api-doc.zh-CN.md Adds CN API doc for ColumnSetting.
.storybook/stories/components/ColumnSetting/api-doc.en-US.md Adds EN API doc for ColumnSetting.
.storybook/stories/components/BreakLines/introduce.zh-CN.md Adds CN introduce doc for BreakLines.
.storybook/stories/components/BreakLines/introduce.en-US.md Adds EN introduce doc for BreakLines.
.storybook/stories/components/BreakLines/index.stories.tsx Adds new story file with ?raw markdown docs wiring.
.storybook/stories/components/BreakLines/api-doc.zh-CN.md Adds CN API doc for BreakLines.
.storybook/stories/components/BreakLines/api-doc.en-US.md Adds EN API doc for BreakLines.
.storybook/stories/components/BreakLines.stories.tsx Removes old story file in favor of new structure.
.storybook/preview-head.html Adds docs wrapper padding adjustments.

Comment thread src/components/ModalAction/index.tsx Outdated
const formRef = useRefValue(form);
const onBeforeOpenRef = useRefValue(onBeforeOpen);
const destroyOnCloseRef = useRefValue(destroyOnClose || destroyOnHidden);
const destroyOnCloseRef = useRefValue(destroyOnHidden ?? destroyOnClose);
Comment on lines +1 to +4
import { stringToBase64 } from '../base64';
import { random } from '../math';
import { randomChars } from '../string';
import encryptAES from './encryptAES';
Comment thread src/hooks/useSplitter.tsx
Comment on lines +202 to +211
onPointerDown={(e) => {
try {
splitterRef?.setPointerCapture?.(e.pointerId);
} catch {
// do nothing
}
setDragging(true);
}}
onPointerEnter={() => setIsOver(true)}
onPointerLeave={() => setIsOver(false)}
@shijistar
shijistar merged commit 4ad2ebe into master Aug 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants