From 5316a522a3a6d4968009e5ead0459fc0ddcefa6e Mon Sep 17 00:00:00 2001 From: zombieyang Date: Sun, 6 Apr 2025 17:37:27 +0800 Subject: [PATCH] login & bump to 1.8.0 --- package.json | 5 +---- plugins/photoshop/manifest.json | 4 ++-- pyproject.toml | 2 +- typescripts/modules/photoshop-internal | 1 + typescripts/src/common/zh-cn.mts | 8 ++++++++ typescripts/src/plugins/photoshop/index.d.ts | 4 ++-- .../src/plugins/photoshop/tsx/Content.tsx | 20 +++++++++---------- .../src/plugins/photoshop/tsx/Main.tsx | 2 +- 8 files changed, 26 insertions(+), 20 deletions(-) create mode 160000 typescripts/modules/photoshop-internal diff --git a/package.json b/package.json index 1e10546..6a8fb0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sdppp", - "version": "1.7.6", + "version": "1.8.0", "type": "module", "scripts": { "watch": "nodemon -w typescripts -e mjs,js,jsx,mts,ts,tsx,json,css,html -x node typescripts/src/build/index.build.ts", @@ -18,16 +18,13 @@ "@types/photoshop": "^25.0.4", "esbuild": "^0.24.0", "javascript-obfuscator": "^4.1.1", - "jsonc-parser": "^3.3.1", "nodemon": "^2.0.7", "typescript": "^5.5.4" }, "dependencies": { - "@ant-design/icons": "^6.0.0", "@tanstack/react-query": "^5.66.11", "@types/react": "^18.3.18", "@types/react-dom": "^18.3.5", - "antd": "^5.24.6", "buffer": "^6.0.3", "chai": "^5.1.2", "esbuild-plugin-external-global": "^1.0.1", diff --git a/plugins/photoshop/manifest.json b/plugins/photoshop/manifest.json index daa1d9e..3c0c88e 100644 --- a/plugins/photoshop/manifest.json +++ b/plugins/photoshop/manifest.json @@ -1,7 +1,7 @@ { "id": "sd-ppp", "name": "SD-PPP", - "version": "1.7.6", + "version": "1.8.0", "main": "index.html", "manifestVersion": 5, "host": { @@ -38,7 +38,7 @@ "type": "panel", "id": "sdppp-connect", "label": { - "default": "SD-PPP 1.7.6" + "default": "SD-PPP 1.8.0" }, "minimumSize": { "width": 300, diff --git a/pyproject.toml b/pyproject.toml index 6004730..da271e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "sd-ppp" description = "getting/sending picture from/to Photoshop with a simple connection. Make Photoshop become the workspace of your ComfyUI." -version = "1.7.6" +version = "1.8.0" license = { file = "LICENSE" } [project.urls] diff --git a/typescripts/modules/photoshop-internal b/typescripts/modules/photoshop-internal new file mode 160000 index 0000000..29a33d1 --- /dev/null +++ b/typescripts/modules/photoshop-internal @@ -0,0 +1 @@ +Subproject commit 29a33d14accc447b6e978e303bbb4a82a3671b2f diff --git a/typescripts/src/common/zh-cn.mts b/typescripts/src/common/zh-cn.mts index 0afb048..8e690b6 100644 --- a/typescripts/src/common/zh-cn.mts +++ b/typescripts/src/common/zh-cn.mts @@ -121,6 +121,13 @@ export default { 'search...': '搜索...', 'disabled when running in browser page': '接管网页时不可用', 'only supported in Photoshop': '仅在 Photoshop 中支持', + 'Login': '登录', + 'Invitation Code': '邀请码', + 'Username': '用户名', + 'Password': '密码', + 'Please input invitation code': '请输入邀请码', + 'Please input username': '请输入用户名', + 'Please input password': '请输入密码', // photoshop connect error '502: Maybe the server is not running': '502: 服务器可能未运行', @@ -130,6 +137,7 @@ export default { 'version mismatch, please reinstall PS plugin': '版本不匹配,请重新安装 PS 插件', 'instance type not recognized': '未识别的软件类型', 'Error: {0}': '错误: {0}', + 'Verification Error': '验证错误', // photoshop event error 'document {0} not found': '找不到文档: {0}', diff --git a/typescripts/src/plugins/photoshop/index.d.ts b/typescripts/src/plugins/photoshop/index.d.ts index 0a3b71f..674c010 100644 --- a/typescripts/src/plugins/photoshop/index.d.ts +++ b/typescripts/src/plugins/photoshop/index.d.ts @@ -8,8 +8,9 @@ declare module "uxp" { }; } declare module "SDPPPInternal" { - export function SDPPPProvider({ children }: { children: React.ReactNode }); + export function SDPPPProvider({ children, loginAppID, loginStyle }: { children: React.ReactNode, loginAppID: string, loginStyle?: 'invitation' | 'password' }); export function useSDPPPContext(): { + logout: () => void, connectOrDisconnect: () => void, lastConnectErrorMessage: string, setAutoRunning: (autoRunning: { type: 'workflow' | 'page', value: string } | null) => void, @@ -95,5 +96,4 @@ declare module "SDPPPInternal" { export type AddressBarType = () => JSX.Element; export type WorkflowEditPhotoshopType = () => JSX.Element; - } \ No newline at end of file diff --git a/typescripts/src/plugins/photoshop/tsx/Content.tsx b/typescripts/src/plugins/photoshop/tsx/Content.tsx index db3fb71..553d337 100644 --- a/typescripts/src/plugins/photoshop/tsx/Content.tsx +++ b/typescripts/src/plugins/photoshop/tsx/Content.tsx @@ -80,18 +80,18 @@ export function Content({ { connectState === "connected" && -
-
-
- {initAfter8s && !webviewAgentSID && {i18n('hidden webview load failed: {0}, please select a browser page to continue', i18n('timeout'))}} - - {workflowAgentSID && } -
-
-
- {editorMode && workflowAgentSID && } +
+
+
+ {initAfter8s && !webviewAgentSID && {i18n('hidden webview load failed: {0}, please select a browser page to continue', i18n('timeout'))}} + + {workflowAgentSID && }
+
+ {editorMode && workflowAgentSID && } +
+
} ); diff --git a/typescripts/src/plugins/photoshop/tsx/Main.tsx b/typescripts/src/plugins/photoshop/tsx/Main.tsx index 9681c71..2ce0ab6 100644 --- a/typescripts/src/plugins/photoshop/tsx/Main.tsx +++ b/typescripts/src/plugins/photoshop/tsx/Main.tsx @@ -3,7 +3,7 @@ import { SDPPP, SDPPPProvider } from "./SDPPPInternalBridge.js"; export default function Main() { return ( - +