From 6a159d35190074905e86ce9b7d1363b07f757e54 Mon Sep 17 00:00:00 2001 From: JarvisArt <1120886013@qq.com> Date: Sun, 4 Dec 2022 19:59:56 +0800 Subject: [PATCH] feat: Watermark calculates the width and height of content by default * docs: update docs * docs: update demo * test: update snapshot --- .../__snapshots__/demo-extend.test.ts.snap | 1286 ++++++++++++++++- .../__tests__/__snapshots__/demo.test.ts.snap | 784 +++++++++- .../__snapshots__/index.test.tsx.snap | 13 +- components/watermark/demo/custom.md | 7 + components/watermark/demo/custom.tsx | 167 +++ components/watermark/demo/z-index.md | 7 - components/watermark/demo/z-index.tsx | 44 - components/watermark/index.en-US.md | 6 +- components/watermark/index.tsx | 69 +- components/watermark/index.zh-CN.md | 6 +- 10 files changed, 2245 insertions(+), 144 deletions(-) create mode 100644 components/watermark/demo/custom.md create mode 100644 components/watermark/demo/custom.tsx delete mode 100644 components/watermark/demo/z-index.md delete mode 100644 components/watermark/demo/z-index.tsx diff --git a/components/watermark/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/watermark/__tests__/__snapshots__/demo-extend.test.ts.snap index d397a83e1ed3..e5dc9abb7590 100644 --- a/components/watermark/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/watermark/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -10,17 +10,1266 @@ exports[`renders ./components/watermark/demo/basic.tsx extend context correctly `; -exports[`renders ./components/watermark/demo/image.tsx extend context correctly 1`] = ` +exports[`renders ./components/watermark/demo/custom.tsx extend context correctly 1`] = `
+ style="position:relative" + > +
+
+ The light-speed iteration of the digital world makes products more complex. However, human consciousness and attention resources are limited. Facing this design contradiction, the pursuit of natural interaction will be the consistent direction of Ant Design. +
+
+ Natural user cognition: According to cognitive psychology, about 80% of external information is obtained through visual channels. The most important visual elements in the interface design, including layout, colors, illustrations, icons, etc., should fully absorb the laws of nature, thereby reducing the user's cognitive cost and bringing authentic and smooth feelings. In some scenarios, opportunely adding other sensory channels such as hearing, touch can create a richer and more natural product experience. +
+
+ Natural user behavior: In the interaction with the system, the designer should fully understand the relationship between users, system roles, and task objectives, and also contextually organize system functions and services. At the same time, a series of methods such as behavior analysis, artificial intelligence and sensors could be applied to assist users to make effective decisions and reduce extra operations of users, to save users' mental and physical resources and make human-computer interaction more natural. +
+
+ 示例图片 +
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+