diff --git a/README.md b/README.md
index 63f2ffb..8c73cbf 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
## Poster Design
-迅排设计是一款漂亮易用且功能强大的开源创意图片编辑器,是对标稿定设计、创客贴、Canva 等商业产品的免费在线设计工具。
+一款漂亮易用且功能强大的开源创意图片编辑器,是对标稿定设计、创客贴、Canva 等商业产品的免费在线设计工具。
[](https://design.palxp.cn/)
@@ -13,7 +13,7 @@
- 丝滑的页面操作体验,丰富的交互细节,基础功能完善
- 采用服务端生成图片,能确保多端出图统一性,支持各种 CSS 特性
- 简易 AI 抠图工具,上传图片一键去除背景
-- 技术栈:Vue3 、Vite2 、Vuex 、ElementPlus,开发体验畅快
+- 技术栈:Vue3 、Vite5 、Vuex 、ElementPlus,开发体验畅快
- 图片生成:Puppeteer、Express
### 支持功能
@@ -35,12 +35,14 @@
git clone https://github.com/palxiao/poster-design.git
cd poster-design
npm run prepared
-npm run serve
+npm run dev
+cd screreenshot
+npm run dev
```

-访问 http://127.0.0.1:5173/ 查看网页。点此查看[完整说明文档](https://xp.palxp.cn/#/articles/1689319644311)。
+访问 http://127.0.0.1:5173/ 查看网页。点此查看[更多说明文档](https://xp.palxp.cn/#/articles/1689319644311)。
### 图片生成服务
@@ -50,10 +52,20 @@ npm run serve
### 服务端
-目前本项目演示 Demo 中的后端接口参考:[接口 API 文档](https://xp.palxp.cn/apidoc/index.html)。
+后端需要自己开发,目前本项目演示 Demo 中的后端接口参考:[接口 API 文档](https://xp.palxp.cn/apidoc/index.html)。
## 其它
+我们尝试沉淀一个高质量内容社区,形成可持续学习的平台,同时解决开发者在项目中遇到的疑难和困惑,帮大家少走一些弯路。
+
+
+
+也欢迎关注公众号:品味前端
+
+
+
+-----
+
本项目最早使用 Vue2 开发,现改用 Vue3 重构中。[一些迭代计划记录](https://xp.palxp.cn/#/articles/1689319986889?id=%e8%bf%ad%e4%bb%a3%e8%ae%a1%e5%88%92).
目前开源版仍在持续迭代中,还有很多的不足,可以将你遇到的问题在 Issues 中提出,或者提交 Pull Request 帮助完善。
@@ -67,13 +79,7 @@ npm run serve
- [qr-code-styling](https://qr-code-styling.com/): 风格化二维码
- [rembg](https://github.com/danielgatis/rembg): 图片抠图,使用 u2net 预训练模型
-### 交流群
-
-| 作者微信:备注加群 | 关注公众号 |
-| --- | --- |
-|
|
|
-
-开源不易,别忘了给本项目点个 **Star** ~
+开源不易,最后别忘了给本项目点个 **Star** ~
[](https://star-history.com/#palxiao/poster-design&Date)
diff --git a/src/components/modules/widgets/wGroup/wGroup.vue b/src/components/modules/widgets/wGroup/wGroup.vue
index 2d8c30d..b09ce00 100644
--- a/src/components/modules/widgets/wGroup/wGroup.vue
+++ b/src/components/modules/widgets/wGroup/wGroup.vue
@@ -26,7 +26,7 @@
// 组合组件
const NAME = 'w-group'
import { nextTick, onBeforeUnmount, onMounted, onUpdated, ref } from 'vue'
-import { useStore } from 'vuex'
+import { mapGetters, mapActions, useStore } from 'vuex'
import { setTransformAttribute } from '@/common/methods/handleTransform'
import { useSetupMapGetters } from '@/common/hooks/mapGetters';
@@ -55,26 +55,26 @@ const widget = ref(null)
const ratio = ref(0)
const temp = ref>({})
const compWidgetsRecord = ref>({})
-// const setting = {
-// name: '组合',
-// type: NAME,
-// uuid: -1,
-// width: 0,
-// height: 0,
-// left: 0,
-// top: 0,
-// transform: '',
-// opacity: 1,
-// parent: '-1',
-// isContainer: true,
-// record: {
-// width: 0,
-// height: 0,
-// minWidth: 0,
-// minHeight: 0,
-// dir: 'none',
-// },
-// }
+const setting = {
+ name: '组合',
+ type: NAME,
+ uuid: -1,
+ width: 0,
+ height: 0,
+ left: 0,
+ top: 0,
+ transform: '',
+ opacity: 1,
+ parent: '-1',
+ isContainer: true,
+ record: {
+ width: 0,
+ height: 0,
+ minWidth: 0,
+ minHeight: 0,
+ dir: 'none',
+ },
+}
const timer = ref(null)
const { dActiveElement, dWidgets } = useSetupMapGetters(['dActiveElement', 'dWidgets'])
@@ -235,9 +235,9 @@ function keySetValue(uuid: string, key: keyof TParamsData, value: number) {
}, 10)
}
-// defineExpose({
-// setting
-// })
+defineExpose({
+ setting
+})
diff --git a/src/components/modules/widgets/wText/wText.vue b/src/components/modules/widgets/wText/wText.vue
index 5b58a0f..a5943aa 100644
--- a/src/components/modules/widgets/wText/wText.vue
+++ b/src/components/modules/widgets/wText/wText.vue
@@ -1,9 +1,9 @@
dblclickText(e)"
>
-
+
-
+
-
diff --git a/src/components/modules/widgets/wText/wTextSetting.ts b/src/components/modules/widgets/wText/wTextSetting.ts
deleted file mode 100644
index 840f9e7..0000000
--- a/src/components/modules/widgets/wText/wTextSetting.ts
+++ /dev/null
@@ -1,101 +0,0 @@
-import { StyleValue } from "vue"
-
-export type TwTextData = {
- name: string
- type: string
- uuid: number
- editable: boolean,
- left: number
- top: number
- transform: string
- lineHeight: number
- letterSpacing: number
- fontSize: number
- zoom: number
- fontClass: {
- alias: string
- id: number
- value: string
- url: string
- },
- fontFamily: string
- fontWeight: string
- fontStyle: string
- writingMode: StyleProperty.WritingMode
- textDecoration: string
- color: string
- textAlign: StyleProperty.TextAlign
- text: string
- opacity: number
- backgroundColor: string
- parent: string
- record: {
- width: number
- height: number
- minWidth: number
- minHeight: number
- dir: string
- },
- textEffects?: {
- filling: {
- enable: boolean
- type: number
- color: string
- }
- stroke: {
- enable: boolean
- width: number
- color: string
- }
- shadow: {
- enable: boolean
- offsetY: number
- offsetX: number
- blur: number
- color: string
- }
- offset: {
- enable: boolean
- x: number
- y: number
- }
- }[]
-}
-
-export const wTextSetting: TwTextData = {
- name: '文本',
- type: 'w-text',
- uuid: -1,
- editable: false,
- left: 0,
- top: 0,
- transform: '',
- lineHeight: 1.5,
- letterSpacing: 0,
- fontSize: 24,
- zoom: 1,
- fontClass: {
- alias: '站酷快乐体',
- id: 543,
- value: 'zcool-kuaile-regular',
- url: 'https://lib.baomitu.com/fonts/zcool-kuaile/zcool-kuaile-regular.woff2',
- },
- fontFamily: 'SourceHanSansSC-Regular',
- fontWeight: 'normal',
- fontStyle: 'normal',
- writingMode: 'horizontal-tb',
- textDecoration: 'none',
- color: '#000000ff',
- textAlign: 'left',
- text: '',
- opacity: 1,
- backgroundColor: '',
- parent: '-1',
- record: {
- width: 0,
- height: 0,
- minWidth: 0,
- minHeight: 0,
- dir: 'horizontal',
- },
-}
\ No newline at end of file
diff --git a/src/mixins/methods/handlePaste.ts b/src/mixins/methods/handlePaste.ts
index 2cd8573..732001f 100644
--- a/src/mixins/methods/handlePaste.ts
+++ b/src/mixins/methods/handlePaste.ts
@@ -17,8 +17,7 @@ import Qiniu from '@/common/methods/QiNiu'
import _config from '@/config'
import { getImage } from '@/common/methods/getImgDetail'
import wImage from '@/components/modules/widgets/wImage/wImage.vue'
-// import wText from '@/components/modules/widgets/wText/wText.vue'
-import { wTextSetting } from '@/components/modules/widgets/wText/wTextSetting'
+import wText from '@/components/modules/widgets/wText/wText.vue'
export default () => {
navigator.clipboard
@@ -48,7 +47,7 @@ export default () => {
break
} else if (item.types.toString().indexOf('text') !== -1) {
store.commit('setShowMoveable', false) // 清理掉上一次的选择
- const setting = JSON.parse(JSON.stringify(wTextSetting))
+ const setting = JSON.parse(JSON.stringify(wText.setting))
setting.text = await navigator.clipboard.readText()
store.dispatch('addWidget', setting)
break
diff --git a/src/types/global.d.ts b/src/types/global.d.ts
index b93528d..c4e324d 100644
--- a/src/types/global.d.ts
+++ b/src/types/global.d.ts
@@ -63,14 +63,3 @@ interface MouseEvent {
layerY: number
}
-interface Document {
- selection?: Selection
-}
-
-interface HTMLElement {
- createTextRange(): {
- moveToElementText(el: HTMLElement): void
- select(): void
- }
-}
-
diff --git a/src/types/style.d.ts b/src/types/style.d.ts
deleted file mode 100644
index ba171d8..0000000
--- a/src/types/style.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-namespace StyleProperty {
- type TextAlign = "center" | "end" | "left" | "right" | "start";
- type WritingMode = Globals | "horizontal-tb" | "sideways-lr" | "sideways-rl" | "vertical-lr" | "vertical-rl";
-}
\ No newline at end of file
diff --git a/src/views/Psd.vue b/src/views/Psd.vue
index 4d12f2e..21f8c03 100644
--- a/src/views/Psd.vue
+++ b/src/views/Psd.vue
@@ -60,7 +60,7 @@ import { useStore } from 'vuex'
import RightClickMenu from '@/components/business/right-click-menu/RcMenu.vue'
import Moveable from '@/components/business/moveable/Moveable.vue'
import shortcuts from '@/mixins/shortcuts'
-// import wText from '@/components/modules/widgets/wText/wText.vue'
+import wText from '@/components/modules/widgets/wText/wText.vue'
import wImage from '@/components/modules/widgets/wImage/wImage.vue'
import useLoading from '@/common/methods/loading'
import uploader from '@/components/common/Uploader/index.vue'
@@ -71,7 +71,6 @@ import ProgressLoading from '@/components/common/ProgressLoading/index.vue'
// import MyWorker from '@/utils/plugins/webWorker'
import { processPSD2Page } from '@/utils/plugins/psd'
import { useSetupMapGetters } from '@/common/hooks/mapGetters'
-import { wTextSetting } from '@/components/modules/widgets/wText/wTextSetting'
type TState = {
isDone: boolean
@@ -125,7 +124,7 @@ async function loadPSD(file: File) {
setTimeout(async () => {
const types: any = {
- text: wTextSetting,
+ text: wText.setting,
image: wImage.setting,
}
for (let i = 0; i < data.clouds.length; i++) {