Add beforeCopy prop to customize copyText before clipboard action
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by locating the copy feature and the relevant Copied or main JsonView component mentioned in the issue. Trace how copyText reaches the clipboard action, then check existing component tests or examples. Done means an optional beforeCopy callback can transform the computed text while preserving the current behavior when it is absent.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Feature Request: beforeCopy Prop for Custom Clipboard Content
Summary:
When using the copy feature, allow developers to intercept and modify the copied content before it is sent to the clipboard, by introducing a beforeCopy function prop.
Motivation:
Currently, the copied value (copyText) is determined internally and cannot be changed by the consumer. In some cases, developers may want to format, sanitize, or otherwise modify the value before it is copied. Providing a hook/prop for this increases flexibility and control for library users.
Proposed API:
Add a new optional prop beforeCopy to the relevant component (e.g., <Copied /> or main JsonView), which receives the computed copyText and returns the new string to be copied. For example:
copyText = beforeCopy ? beforeCopy(copyText) : copyText
Example Usage:
<JsonView.Copied beforeCopy={(text) => text.replace(/\"/g, '')} />
Benefits:
- Allows custom transformations on copied content
- Backwards compatible (default: no change)
- Simple implementation
Labels:
- enhancement
- Ngôn ngữ chính
- TypeScript
- Star
- 420
- Fork
- 24
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của uiwjs/react-json-view
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
uiwjs/react-json-view#92 · 3 bình luận ·
-
Alpha Release Reliable?Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
uiwjs/react-json-view#93 ·
-
Named exportĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
uiwjs/react-json-view#90 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 52/100
uiwjs/react-json-view#89 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
uiwjs/react-json-view#88 · 1 reaction ·
Tất cả issue của uiwjs/react-json-view
Issue tương tự
-
Resources: New palettes of MacaoĐang mởresources
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
railmapgen/rmg-palette#2445 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
danielmiessler/LifeOS#2242 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
good first issue hacktoberfest help wanted translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
callstackincubator/appduct#129 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100