From c966eae471033767bdcf25d8168d9825cbbb7640 Mon Sep 17 00:00:00 2001 From: tyh666999 <1469442737@qq.com> Date: Sat, 7 Oct 2023 16:38:12 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20dialog=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fighting-theme/src/dialog.scss | 37 +++++++------------------ 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/packages/fighting-theme/src/dialog.scss b/packages/fighting-theme/src/dialog.scss index 67d53b1c19..ea9d5d7cba 100644 --- a/packages/fighting-theme/src/dialog.scss +++ b/packages/fighting-theme/src/dialog.scss @@ -1,18 +1,12 @@ .f-dialog { position: fixed; - top: 0; - right: 0; - left: 0; - bottom: 0; + inset: 0; z-index: var(--dialog-z-index, 2000); // 遮罩层 &__mask { position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; opacity: var(--dialog-mask-opacity, 0.4); background-color: var(--dialog-mask-background, #000); } @@ -25,25 +19,21 @@ // 主容器公共样式 &__wrapper { position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; z-index: 1999; transition: 0.3s; overflow: auto; - padding: 24px; - box-sizing: border-box; - text-align: center; + display: flex; + justify-content: center; + align-items: center; // 主要内容容器 .f-dialog__container { background-color: #fff; - display: inline-block; - top: 0; - position: relative; + display: flex; + flex-direction: column; border-radius: 6px; - vertical-align: middle; + margin: auto; padding: var(--dialog-padding); width: var(--dialog-width); @@ -79,6 +69,7 @@ box-sizing: border-box; padding: 5px 15px; text-align: left; + flex: 1; } // 页脚 @@ -103,14 +94,6 @@ opacity: 0; } } - - &::after { - content: ''; - display: inline-block; - width: 0; - vertical-align: middle; - height: 100%; - } } // 遮罩层动画 From aa22befdb4cd4d5c8c2bbbc3c563fddf106ab10b Mon Sep 17 00:00:00 2001 From: tyh666999 <1469442737@qq.com> Date: Sat, 7 Oct 2023 16:39:26 +0800 Subject: [PATCH 2/8] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f9aaf2f36..35d34cb466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ 中文 | [英文](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md) +- 修复 `f-dialog` 样式细节 +- 修复 `f-watermark` 可去除的问题 + ## 0.63.1 (2023-08-28) - 修复 `f-select` 组件多个不会触发滚动到选中元素问题 From 768b8337f10044927504e49da1ef579f671ba1ae Mon Sep 17 00:00:00 2001 From: tyh666999 <1469442737@qq.com> Date: Sat, 7 Oct 2023 16:45:11 +0800 Subject: [PATCH 3/8] =?UTF-8?q?style:=20=E7=AE=80=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fighting-theme/src/alert.scss | 6 ++-- packages/fighting-theme/src/button.scss | 10 ++----- packages/fighting-theme/src/confirm-box.scss | 10 ++----- packages/fighting-theme/src/drawer.scss | 29 ++----------------- packages/fighting-theme/src/dropdown.scss | 1 - .../fighting-theme/src/image-preview.scss | 15 ++-------- 6 files changed, 12 insertions(+), 59 deletions(-) diff --git a/packages/fighting-theme/src/alert.scss b/packages/fighting-theme/src/alert.scss index 163e75d0a8..d98f0f0260 100644 --- a/packages/fighting-theme/src/alert.scss +++ b/packages/fighting-theme/src/alert.scss @@ -55,10 +55,8 @@ } // 居中 - &.f-alert__center { - .f-alert__content { - justify-content: center; - } + &.f-alert__center .f-alert__content { + justify-content: center; } // 固定定位 diff --git a/packages/fighting-theme/src/button.scss b/packages/fighting-theme/src/button.scss index 66882772a2..0d048f43ab 100644 --- a/packages/fighting-theme/src/button.scss +++ b/packages/fighting-theme/src/button.scss @@ -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; @@ -96,10 +93,7 @@ // 涟漪容器 &__ripples-box { position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; + inset: 0; overflow: hidden; // 涟漪效果 diff --git a/packages/fighting-theme/src/confirm-box.scss b/packages/fighting-theme/src/confirm-box.scss index 3225d6c75c..39e2067f8c 100644 --- a/packages/fighting-theme/src/confirm-box.scss +++ b/packages/fighting-theme/src/confirm-box.scss @@ -4,18 +4,12 @@ justify-content: center; align-items: center; position: fixed; - top: 0; - right: 0; - left: 0; - bottom: 0; + inset: 0; // 遮罩层 &__mask { position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; background-color: rgba(0, 0, 0, 0.5); display: flex; transition: opacity 0.3s ease; diff --git a/packages/fighting-theme/src/drawer.scss b/packages/fighting-theme/src/drawer.scss index 19fd62b091..2d6706588e 100644 --- a/packages/fighting-theme/src/drawer.scss +++ b/packages/fighting-theme/src/drawer.scss @@ -1,9 +1,6 @@ .f-drawer { position: fixed; - top: 0; - right: 0; - left: 0; - bottom: 0; + inset: 0; z-index: var(--drawer-z-index, 2000); // 不同方向 @@ -58,10 +55,7 @@ // 遮罩层 &__mask { position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; opacity: var(--drawer-mask-opacity, 0.4); background-color: var(--drawer-mask-background, #000); } @@ -74,10 +68,7 @@ // 主容器公共样式 &__wrapper { position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; z-index: 1999; transition: 0.3s; @@ -157,18 +148,4 @@ &__trans-leave-to { opacity: 0; } - - // // 全屏展示 - // &.f-drawer__fullscreen { - // .f-drawer__wrapper { - // overflow: hidden; - - // .f-drawer__container { - // height: 100vh; - // width: 100vw; - // border-radius: 0; - // overflow: auto; - // } - // } - // } } diff --git a/packages/fighting-theme/src/dropdown.scss b/packages/fighting-theme/src/dropdown.scss index 6ef04228d5..1d0ad1cc08 100644 --- a/packages/fighting-theme/src/dropdown.scss +++ b/packages/fighting-theme/src/dropdown.scss @@ -1,5 +1,4 @@ .f-dropdown { - // display: inline-block; vertical-align: middle; position: relative; diff --git a/packages/fighting-theme/src/image-preview.scss b/packages/fighting-theme/src/image-preview.scss index 3caf010b9e..d0e02f78f3 100644 --- a/packages/fighting-theme/src/image-preview.scss +++ b/packages/fighting-theme/src/image-preview.scss @@ -1,18 +1,12 @@ .f-image-preview { position: fixed; - top: 0; - right: 0; - left: 0; - bottom: 0; + inset: 0; z-index: 2000; // 遮罩层 &__mask { position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; opacity: 0.5; background-color: #23272e; } @@ -20,10 +14,7 @@ // 主容器 &__container { position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; + inset: 0; z-index: 1999; transition: 0.3s; display: flex; From 3c9b1077d8db35391a844e2999d1b982f31d27ac Mon Sep 17 00:00:00 2001 From: tyh666999 <1469442737@qq.com> Date: Sat, 7 Oct 2023 16:57:42 +0800 Subject: [PATCH 4/8] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_hooks/use-watermark/index.ts | 64 +++++++++++-------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/packages/fighting-design/_hooks/use-watermark/index.ts b/packages/fighting-design/_hooks/use-watermark/index.ts index 320851cd45..6e78470557 100644 --- a/packages/fighting-design/_hooks/use-watermark/index.ts +++ b/packages/fighting-design/_hooks/use-watermark/index.ts @@ -2,10 +2,16 @@ 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 -}> +} /** * 生成水印图片 @@ -13,20 +19,20 @@ export type UseWatermarkReturn = ComputedRef<{ * @param { Object } prop prop 参数 * @returns */ -export const useWatermark = (prop: WatermarkProps): UseWatermarkReturn => { - return computed((): { base64: string; size: number } => { +export const useWatermark = (prop: WatermarkProps): ComputedRef => { + 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 /** 文字大小 */ @@ -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 } }) } From 5fd58db74e7cbf2b2581b1402e90ed36bdf23d00 Mon Sep 17 00:00:00 2001 From: tyh666999 <1469442737@qq.com> Date: Sat, 7 Oct 2023 17:01:05 +0800 Subject: [PATCH 5/8] =?UTF-8?q?revert:=20=E5=8F=91=E5=B8=83=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=200.64.0=20(2023-10-07)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++-- docs/docs/changelog.md | 5 +++++ packages/fighting-design/package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d34cb466..9e036492e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,10 @@ 中文 | [英文](https://github.com/FightingDesign/fighting-design/blob/master/CHANGELOG.en-US.md) -- 修复 `f-dialog` 样式细节 -- 修复 `f-watermark` 可去除的问题 +## 0.64.0 (2023-10-07) + +- Fixed `f-dialog` style details +- Fix `f-watermark` removable issue ## 0.63.1 (2023-08-28) diff --git a/docs/docs/changelog.md b/docs/docs/changelog.md index 6f9aaf2f36..9e036492e5 100644 --- a/docs/docs/changelog.md +++ b/docs/docs/changelog.md @@ -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` 组件多个不会触发滚动到选中元素问题 diff --git a/packages/fighting-design/package.json b/packages/fighting-design/package.json index f1e26ba6d7..5a1d6b0148 100644 --- a/packages/fighting-design/package.json +++ b/packages/fighting-design/package.json @@ -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", From e33819c0031c60b7b6b965f900403a36cad59206 Mon Sep 17 00:00:00 2001 From: tyh666999 <1469442737@qq.com> Date: Sat, 7 Oct 2023 17:02:30 +0800 Subject: [PATCH 6/8] =?UTF-8?q?style:=20=E5=85=A8=E5=B1=80=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fighting-design/_hooks/use-watermark/index.ts | 6 +++--- packages/fighting-design/package.json | 2 +- packages/fighting-design/watermark/src/props.ts | 6 +----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/fighting-design/_hooks/use-watermark/index.ts b/packages/fighting-design/_hooks/use-watermark/index.ts index 6e78470557..b000cf7794 100644 --- a/packages/fighting-design/_hooks/use-watermark/index.ts +++ b/packages/fighting-design/_hooks/use-watermark/index.ts @@ -4,7 +4,7 @@ import type { ComputedRef } from 'vue' /** * useWatermark 返回值类型接口 - * + * * @param { string } base64 base64 格式图片 * @param { number } size 图片尺寸 */ @@ -15,9 +15,9 @@ export interface UseWatermarkReturn { /** * 生成水印图片 - * + * * @param { Object } prop prop 参数 - * @returns + * @returns */ export const useWatermark = (prop: WatermarkProps): ComputedRef => { return computed((): UseWatermarkReturn => { diff --git a/packages/fighting-design/package.json b/packages/fighting-design/package.json index 5a1d6b0148..136cf160ae 100644 --- a/packages/fighting-design/package.json +++ b/packages/fighting-design/package.json @@ -60,4 +60,4 @@ }, "homepage": "https://fighting.tianyuhao.cn", "repository": "https://github.com/FightingDesign/fighting-design" -} \ No newline at end of file +} diff --git a/packages/fighting-design/watermark/src/props.ts b/packages/fighting-design/watermark/src/props.ts index 3416146099..017f3e8a61 100644 --- a/packages/fighting-design/watermark/src/props.ts +++ b/packages/fighting-design/watermark/src/props.ts @@ -1,8 +1,4 @@ -import { - setStringProp, - setNumberProp, - setStringNumberProp -} from '../../_utils' +import { setStringProp, setNumberProp, setStringNumberProp } from '../../_utils' import type { ExtractPropTypes } from 'vue' export const Props = { From 4227c05ae06239fb33d9e10904c5178fa2399587 Mon Sep 17 00:00:00 2001 From: tyh666999 <1469442737@qq.com> Date: Sun, 8 Oct 2023 10:22:03 +0800 Subject: [PATCH 7/8] =?UTF-8?q?ci:=20=E6=9B=B4=E6=96=B0=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=20=E4=BC=98=E5=8C=96=E7=BB=84=E4=BB=B6=E7=BB=86?= =?UTF-8?q?=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-tag.yaml | 46 +++++++++---------- .../fighting-design/avatar-group/index.ts | 1 + packages/fighting-design/tabs-item/index.ts | 1 + packages/fighting-design/watermark/index.ts | 2 +- .../src/{interface.d.ts => interface.ts} | 0 5 files changed, 26 insertions(+), 24 deletions(-) rename packages/fighting-design/watermark/src/{interface.d.ts => interface.ts} (100%) diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml index 167ccd185a..25238d1ee6 100644 --- a/.github/workflows/release-tag.yaml +++ b/.github/workflows/release-tag.yaml @@ -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. diff --git a/packages/fighting-design/avatar-group/index.ts b/packages/fighting-design/avatar-group/index.ts index 8047aea4bd..54d389cb26 100644 --- a/packages/fighting-design/avatar-group/index.ts +++ b/packages/fighting-design/avatar-group/index.ts @@ -4,6 +4,7 @@ import { install } from '../_utils' export const FAvatarGroup = install(AvatarGroup) +/** avatar-group 组件实例类型 */ export type AvatarGroupInstance = InstanceType export * from './src/interface' diff --git a/packages/fighting-design/tabs-item/index.ts b/packages/fighting-design/tabs-item/index.ts index 99cd6024c6..8626bc8386 100644 --- a/packages/fighting-design/tabs-item/index.ts +++ b/packages/fighting-design/tabs-item/index.ts @@ -4,6 +4,7 @@ import { install } from '../_utils' export const FTabsItem = install(TabsItem) +/** tabs-item 组件实例类型 */ export type TabsItemInstance = InstanceType export * from './src/interface' diff --git a/packages/fighting-design/watermark/index.ts b/packages/fighting-design/watermark/index.ts index 1fefbbb0bf..9438756c69 100644 --- a/packages/fighting-design/watermark/index.ts +++ b/packages/fighting-design/watermark/index.ts @@ -7,6 +7,6 @@ export const FWatermark = install(Watermark) /** watermark 组件实例类型 */ export type WatermarkInstance = InstanceType -export * from './src/interface.d' +export * from './src/interface' export default FWatermark diff --git a/packages/fighting-design/watermark/src/interface.d.ts b/packages/fighting-design/watermark/src/interface.ts similarity index 100% rename from packages/fighting-design/watermark/src/interface.d.ts rename to packages/fighting-design/watermark/src/interface.ts From 6f9ca930323a0529d90aeda8af694ff3d6155cbb Mon Sep 17 00:00:00 2001 From: tyh666999 <1469442737@qq.com> Date: Sun, 8 Oct 2023 13:58:15 +0800 Subject: [PATCH 8/8] =?UTF-8?q?style:=20=E5=BA=9F=E9=99=A4=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fighting-resolver/LICENSE | 21 ----------- packages/fighting-resolver/README.md | 36 ------------------- packages/fighting-resolver/index.ts | 46 ------------------------ packages/fighting-resolver/package.json | 12 ------- packages/fighting-resolver/tsconfig.json | 18 ---------- 5 files changed, 133 deletions(-) delete mode 100644 packages/fighting-resolver/LICENSE delete mode 100644 packages/fighting-resolver/README.md delete mode 100644 packages/fighting-resolver/index.ts delete mode 100644 packages/fighting-resolver/package.json delete mode 100644 packages/fighting-resolver/tsconfig.json diff --git a/packages/fighting-resolver/LICENSE b/packages/fighting-resolver/LICENSE deleted file mode 100644 index b754b5238b..0000000000 --- a/packages/fighting-resolver/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Tyh2001 (田同学) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/fighting-resolver/README.md b/packages/fighting-resolver/README.md deleted file mode 100644 index 6a5b2ebdc4..0000000000 --- a/packages/fighting-resolver/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# @fighting-design/fighting-resolver - -用于 [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) 的导入配置 - -## 自动导入 - -首先你需要安装 unplugin-vue-components 和 unplugin-auto-import 这两款插件 - -```node -npm install -D unplugin-vue-components unplugin-auto-import -``` - -然后把下列代码插入到你的 Vite 或 Webpack 的配置文件中 - -### vite - -```js -// vite.config.ts -import { defineConfig } from 'vite' -import AutoImport from 'unplugin-auto-import/vite' // 自动注入api -import Components from 'unplugin-vue-components/vite' // 自动注册组件 -import { FightingDesignResolver } from '@fighting-design/fighting-resolver' - -export default defineConfig({ - // ... - plugins: [ - // ... - AutoImport({ - resolvers: [FightingDesignResolver()] - }), - Components({ - resolvers: [FightingDesignResolver()] - }) - ] -}) -``` diff --git a/packages/fighting-resolver/index.ts b/packages/fighting-resolver/index.ts deleted file mode 100644 index 2e51049501..0000000000 --- a/packages/fighting-resolver/index.ts +++ /dev/null @@ -1,46 +0,0 @@ -// import { existsSync } from 'fs' - -// const setWebComponentName = ( -// name: string -// ): string => { -// /** -// * 区分F、f- -// */ -// if (name.includes('F')) { -// const result = name.slice(1).replace(/([A-Z])/g, ' $1').trim() -// return result.split(' ').join('-').toLowerCase() -// } else if (name.includes('f-')) { -// return name.slice(2) -// } -// return '' -// } - -// interface ResolveReturnInterface { -// name: string -// from: string -// sideEffects: string[] -// } - -// function FightingDesignResolver(): { -// type: string, -// resolve: (name: string) => ResolveReturnInterface | undefined -// } -// function FightingDesignResolver () { -// return { -// type: 'component', -// resolve: (name: string) => { -// if (name.match(/^(F[A-Z]|f-[a-z])/)) { -// const cssPath = `fighting-design/theme/${setWebComponentName(name)}.css` -// const sideEffects = existsSync(cssPath) ? [cssPath] : [] - -// return { -// name, -// sideEffects, -// from: 'fighting-design' -// } -// } -// } -// } -// } - -// export default FightingDesignResolver diff --git a/packages/fighting-resolver/package.json b/packages/fighting-resolver/package.json deleted file mode 100644 index bc60ffa708..0000000000 --- a/packages/fighting-resolver/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "@fighting-design/fighting-resolver", - "version": "1.0.0", - "description": "Configuration item for unplugin-vue-components", - "main": "index", - "module": "index", - "types": "index.d.ts", - "scripts": { - "build": "tsc" - }, - "license": "MIT" -} diff --git a/packages/fighting-resolver/tsconfig.json b/packages/fighting-resolver/tsconfig.json deleted file mode 100644 index 6dcf691507..0000000000 --- a/packages/fighting-resolver/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "outDir": "../../dist/resolver", - "useDefineForClassFields": true, - "module": "CommonJS", - "moduleResolution": "node", - "strict": true, - "sourceMap": false, - "resolveJsonModule": true, - "isolatedModules": true, - "esModuleInterop": true, - "declaration": true, - "lib": ["esnext"], - "skipLibCheck": true - }, - "include": ["index.ts"] -}