Skip to content

Conversation

@Wesley-0808
Copy link
Collaborator

@Wesley-0808 Wesley-0808 commented Jul 22, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • feat(Watermark): 新增 Watermark 水印组件

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 22, 2025

Open in StackBlitz

npm i https://pkg.pr.new/tdesign-miniprogram@3799

commit: e3181c9

@anlyyao anlyyao requested a review from Copilot August 26, 2025 12:24
Copy link
Contributor

Copilot AI left a comment

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 introduces a new Watermark component to add watermarks to page areas. The component supports both text and image watermarks with various customization options including positioning, rotation, opacity, and moving animations.

Key changes:

  • Adds complete Watermark component implementation with TypeScript support
  • Provides comprehensive examples demonstrating different watermark types and features
  • Integrates watermark component into the project structure and documentation

Reviewed Changes

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

Show a summary per file
File Description
src/watermark/watermark.ts Main component implementation with canvas-based watermark rendering
src/watermark/watermark.wxml Component template with canvas and styling elements
src/watermark/utils/generateBase64Url.ts Utility for generating base64 watermark images from canvas
src/watermark/utils/randomMovingStyle.ts Utility for generating random animation styles for moving watermarks
src/watermark/props.ts Component property definitions with default values
src/watermark/type.ts TypeScript interfaces for component props and watermark content
src/watermark/_example/* Multiple example implementations showcasing different watermark features
site/site.config.mjs Documentation site configuration update
example/* Example app integration and navigation updates

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@anlyyao
Copy link
Collaborator

anlyyao commented Sep 4, 2025

FAQ:
Q: 为什么移除 wx.onThemeChange?
A: wx.onThemeChange 的引入主要是为了响应深色模式,但是只能监听到系统深/浅模式切换,其他方式的主题样式切换无法监听到。因此不如移除组件内部的 wx.onThemeChange,业务测主动调用实例的 renderWatermark() 函数,重新渲染水印组件。

@anlyyao anlyyao merged commit f9814b3 into Tencent:develop Sep 4, 2025
7 checks passed
@Wesley-0808 Wesley-0808 deleted the feat/watermark branch October 6, 2025 08:34
@github-actions github-actions bot mentioned this pull request Oct 20, 2025
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.

3 participants