Skip to content

Commit

Permalink
Merge branch 'master' of github.com:FightingDesign/fighting-design
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Nov 21, 2023
2 parents ebbe4fc + 6f9ca93 commit 625e3ee
Show file tree
Hide file tree
Showing 22 changed files with 100 additions and 279 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/release-tag.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Create Release Tag
# name: Create Release Tag

on:
push:
branches:
- master
paths:
- 'packages/fighting-design/package.json'
# on:
# push:
# branches:
# - master
# paths:
# - 'packages/fighting-design/package.json'

jobs:
release-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
# jobs:
# release-tag:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@master

- name: Create Release Tag
id: release_tag
uses: yyx990803/release-tag@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
body: |
详细更新日志请参考 [CHANGELOG.md](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.md)。
# - name: Create Release Tag
# id: release_tag
# uses: yyx990803/release-tag@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# body: |
# 详细更新日志请参考 [CHANGELOG.md](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.md)。

Please refer to [CHANGELOG.en-US.md](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md) for details.
# Please refer to [CHANGELOG.en-US.md](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md) for details.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

中文 | [英文](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md)

## 0.64.0 (2023-10-07)

- Fixed `f-dialog` style details
- Fix `f-watermark` removable issue

## 0.63.1 (2023-08-28)

- 修复 `f-select` 组件多个不会触发滚动到选中元素问题
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

中文 | [英文](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md)

## 0.64.0 (2023-10-07)

- Fixed `f-dialog` style details
- Fix `f-watermark` removable issue

## 0.63.1 (2023-08-28)

- 修复 `f-select` 组件多个不会触发滚动到选中元素问题
Expand Down
68 changes: 39 additions & 29 deletions packages/fighting-design/_hooks/use-watermark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,37 @@ import { computed } from 'vue'
import type { WatermarkProps } from '../../watermark'
import type { ComputedRef } from 'vue'

export type UseWatermarkReturn = ComputedRef<{
/**
* useWatermark 返回值类型接口
*
* @param { string } base64 base64 格式图片
* @param { number } size 图片尺寸
*/
export interface UseWatermarkReturn {
base64: string
size: number
}>
}

/**
* 生成水印图片
*
*
* @param { Object } prop prop 参数
* @returns
* @returns
*/
export const useWatermark = (prop: WatermarkProps): UseWatermarkReturn => {
return computed((): { base64: string; size: number } => {
export const useWatermark = (prop: WatermarkProps): ComputedRef<UseWatermarkReturn> => {
return computed((): UseWatermarkReturn => {
/**
* 创建一个 canvas
*
* @see Canvas https://developer.mozilla.org/zh-CN/docs/Web/API/Canvas_API
*/
* 创建一个 canvas
*
* @see Canvas https://developer.mozilla.org/zh-CN/docs/Web/API/Canvas_API
*/
const canvas: HTMLCanvasElement = document.createElement('canvas')

/**
* 设备像素比率
*
* @see Window.devicePixelRatio https://developer.mozilla.org/zh-CN/docs/Web/API/Window/devicePixelRatio
*/
* 设备像素比率
*
* @see Window.devicePixelRatio https://developer.mozilla.org/zh-CN/docs/Web/API/Window/devicePixelRatio
*/
const devicePixeRatio: number = window.devicePixelRatio || 1

/** 文字大小 */
Expand All @@ -41,24 +47,28 @@ export const useWatermark = (prop: WatermarkProps): UseWatermarkReturn => {
*/
const ctx = canvas.getContext('2d') as CanvasRenderingContext2D

const { width } = ctx.measureText(prop.content)
if (ctx) {
const { width } = ctx.measureText(prop.content)

const cavasSize: number = Math.max(100, width) * devicePixeRatio + prop.gap

const cavasSize = Math.max(100, width) * devicePixeRatio + prop.gap
canvas.width = cavasSize
canvas.height = cavasSize

canvas.width = cavasSize
canvas.height = cavasSize
ctx.translate(canvas.width / 2, canvas.height / 2)
ctx.rotate((Math.PI / 190) * -45)
ctx.fillStyle = prop.fontColor
ctx.font = font
ctx.textAlign = 'center'
ctx.textBaseline = 'middle'
ctx.fillText(prop.content, 0, 0)

ctx.translate(canvas.width / 2, canvas.height / 2)
ctx.rotate((Math.PI / 190) * -45)
ctx.fillStyle = prop.fontColor
ctx.font = font
ctx.textAlign = 'center'
ctx.textBaseline = 'middle'
ctx.fillText(prop.content, 0, 0)
return {
base64: canvas.toDataURL(),
size: cavasSize / devicePixeRatio
} as const
}

return {
base64: canvas.toDataURL(),
size: cavasSize / devicePixeRatio
} as const
return { base64: '', size: 0 }
})
}
1 change: 1 addition & 0 deletions packages/fighting-design/avatar-group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { install } from '../_utils'

export const FAvatarGroup = install(AvatarGroup)

/** avatar-group 组件实例类型 */
export type AvatarGroupInstance = InstanceType<typeof AvatarGroup>

export * from './src/interface'
Expand Down
4 changes: 2 additions & 2 deletions packages/fighting-design/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fighting-design",
"version": "0.63.1",
"version": "0.64.0",
"description": "Fighting design can quickly build interactive interfaces in vue3 applications, which looks good.",
"keywords": [
"fighting",
Expand Down Expand Up @@ -60,4 +60,4 @@
},
"homepage": "https://fighting.tianyuhao.cn",
"repository": "https://github.com/FightingDesign/fighting-design"
}
}
1 change: 1 addition & 0 deletions packages/fighting-design/tabs-item/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { install } from '../_utils'

export const FTabsItem = install(TabsItem)

/** tabs-item 组件实例类型 */
export type TabsItemInstance = InstanceType<typeof TabsItem>

export * from './src/interface'
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/watermark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const FWatermark = install(Watermark)
/** watermark 组件实例类型 */
export type WatermarkInstance = InstanceType<typeof Watermark>

export * from './src/interface.d'
export * from './src/interface'

export default FWatermark
6 changes: 1 addition & 5 deletions packages/fighting-design/watermark/src/props.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
setStringProp,
setNumberProp,
setStringNumberProp
} from '../../_utils'
import { setStringProp, setNumberProp, setStringNumberProp } from '../../_utils'
import type { ExtractPropTypes } from 'vue'

export const Props = {
Expand Down
21 changes: 0 additions & 21 deletions packages/fighting-resolver/LICENSE

This file was deleted.

36 changes: 0 additions & 36 deletions packages/fighting-resolver/README.md

This file was deleted.

46 changes: 0 additions & 46 deletions packages/fighting-resolver/index.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/fighting-resolver/package.json

This file was deleted.

18 changes: 0 additions & 18 deletions packages/fighting-resolver/tsconfig.json

This file was deleted.

6 changes: 2 additions & 4 deletions packages/fighting-theme/src/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@
}

// 居中
&.f-alert__center {
.f-alert__content {
justify-content: center;
}
&.f-alert__center .f-alert__content {
justify-content: center;
}

// 固定定位
Expand Down
10 changes: 2 additions & 8 deletions packages/fighting-theme/src/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
content: '';
display: inline-block;
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
inset: 0;
opacity: 0;
border-radius: inherit;
transition: 0.3s;
Expand Down Expand Up @@ -96,10 +93,7 @@
// 涟漪容器
&__ripples-box {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
inset: 0;
overflow: hidden;

// 涟漪效果
Expand Down
Loading

0 comments on commit 625e3ee

Please sign in to comment.