Skip to content

Let's use AI to Earn!

feat: The pop-up writing assistant and preview coexist and are compatible with low widths

gaoSir535e06a3e13a
diff --git a/package.json b/package.json
index 3e34e53f..3abb4a02 100644
--- a/package.json
+++ b/package.json
@@ -56,6 +56,7 @@
"react-qrcode-logo": "^4.0.0",
"react-sortablejs": "^6.1.4",
"react-transition-group": "^4.4.5",
+ "react-use": "^17.6.0",
"sass": "^1.59.2",
"sortablejs": "^1.15.6",
"swiper": "^11.2.8",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4cc70351..a8fd57f3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -125,6 +125,9 @@ importers:
react-transition-group:
specifier: ^4.4.5
+ react-use:
+ specifier: ^17.6.0
sass:
specifier: ^1.59.2
version: 1.89.1
@@ -1332,6 +1335,9 @@ packages:
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-aLkWa0C0vO5b4Sr798E26QgOkss68Un0bLjs7u9qxzPT5CG+8DuNTffWES58YzJs3hrVAOs1wonycqEBqNJubA==}
+
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
@@ -1558,6 +1564,9 @@ packages:
'@webassemblyjs/[email protected]':
resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==}
+ '@xobotyi/[email protected]':
+ resolution: {integrity: sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==}
+
resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==}
@@ -1889,6 +1898,9 @@ packages:
resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==}
+ resolution: {integrity: sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A==}
+
resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==}
@@ -2057,6 +2069,9 @@ packages:
resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
+ resolution: {integrity: sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==}
+
resolution: {integrity: sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==}
engines: {node: '>= 0.4'}
@@ -2277,9 +2292,15 @@ packages:
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
+ resolution: {integrity: sha512-HPtaa38cPgWvaCFmRNhlc6NG7pv6NUHqjPgVAkWGoB9mQMwYB27/K0CvOM5Czy+qpT3e8XJ6Q4aPAnzpNpzNaw==}
+
resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==}
+ resolution: {integrity: sha512-bijHueCGd0LqqNK9b5oCMHc0MluJAx0cwqASgbWMvkO01lCYgIhacVRLcaDz3QnyYIRNJRDwMb41VuT6pHJ91Q==}
+
resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==}
@@ -2457,6 +2478,9 @@ packages:
resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==}
engines: {node: '>= 14'}
+ resolution: {integrity: sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==}
+
resolution: {integrity: sha512-f3frU3pIxD50/Tz20zx9TD9HobKYg47fmAETb117GKGPrhwcSSPJDoCposXlVycVebQ9GQohC3Efbpq7/nnJ5w==}
@@ -2509,6 +2533,9 @@ packages:
resolution: {integrity: sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
+ resolution: {integrity: sha512-lhYo5qNTQp3EvSSp3sRvXMbVQTLrvGV6DycRMJ5dm2BLMiJ30wpXKdDdgX+GmJZ5uQMucwRKHamXSst3Sj/Giw==}
+
resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==}
engines: {node: '>= 0.4'}
@@ -2645,6 +2672,9 @@ packages:
resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==}
engines: {node: '>= 10.13.0'}
+ resolution: {integrity: sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==}
+
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
@@ -2818,6 +2848,12 @@ packages:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
+ resolution: {integrity: sha512-+6bHaC8dSDGALM1HJjOHVXpuastdu2xFoZlC77Jh4cg+33Zcgm+Gxd+1xsnpZK14eyHObSp82+ll5y3SX75liw==}
+ peerDependencies:
+ react: '*'
+ react-dom: '*'
+
resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -3342,6 +3378,18 @@ packages:
react: '>=16.8.0'
react-dom: '>=16.8.0'
+ resolution: {integrity: sha512-dg8yXdcQmvgR13RIlZbTRQOoUrDciFVoSBZILwjE2LFISxZZ8loVJKAkuzswl5js8BHda79bIb2b84ehU8IjXw==}
+ peerDependencies:
+ react: '*'
+ tslib: '*'
+
+ resolution: {integrity: sha512-OmedEScUMKFfzn1Ir8dBxiLLSOzhKe/dPZwVxcujweSj45aNM7BEGPb9BEVIgVEqEXx6f3/TsXzwIktNgUR02g==}
+ peerDependencies:
+ react: '*'
+ react-dom: '*'
+
resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==}
engines: {node: '>=0.10.0'}
@@ -3414,6 +3462,9 @@ packages:
engines: {node: '>=14'}
hasBin: true
+ resolution: {integrity: sha512-lRQgou1mu19e+Ya0LsTvKrVJ5TYUbqCVPAiImX3UfLTenarvPUl1QFdvu5Z3PYmHT9RCcwIfbjRQBntExyj3Zg==}
+
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
@@ -3454,6 +3505,10 @@ packages:
resolution: {integrity: sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==}
engines: {node: '>= 10.13.0'}
+ resolution: {integrity: sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA==}
+ engines: {node: '>=0.10.0'}
+
resolution: {integrity: sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==}
@@ -3477,6 +3532,10 @@ packages:
resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-AhICkFV84tBP1aWqPwLZqFvAwqEoVA9kxNMniGEUvzOlm4vLmOFLiTT3UZ6bziJTy4bOVpzWGTfSCbmaayGx8g==}
+ engines: {node: '>=6.9'}
+
resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==}
engines: {node: '>= 0.4'}
@@ -3519,6 +3578,10 @@ packages:
resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
+ resolution: {integrity: sha512-MjZkVp0NHr5+TPihLcadqnlVoGIoWo4IBHptutGh9wI3ttUYvCG26HkSuDi+K6lsZ25syXJXcctwgyVCt//xqA==}
+ engines: {node: '>=0.10.0'}
+
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'}
@@ -3530,6 +3593,18 @@ packages:
resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==}
deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility'
+ resolution: {integrity: sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==}
+
+ resolution: {integrity: sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==}
+
+ resolution: {integrity: sha512-GcUgbO4Jsqqg6RxfyTHFiPxdPqF+3LFmQhm7MgCuYQOYuWyqxo5pwRPz5d/u6/WYJdEnWfK4r+jGbyD8TSggXQ==}
+
+ resolution: {integrity: sha512-Je5vBeY4S1r/RnLydLl0TBTi3F2qdfWmYsGvtfZgEI+SCprPppaIhQf5nGcal4gI4cGpCV/duLcAzT1np6sQqg==}
+
resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==}
engines: {node: '>= 0.4'}
@@ -3664,6 +3739,10 @@ packages:
resolution: {integrity: sha512-H7oLPV0P7+jgvrk+6mwwwBDmxTaxnu9HMXmloNLXwnNO0ZxZ31Orah2n8lU1eMPvsaowP2CX+USCgyovXfdOFQ==}
engines: {node: '>=8'}
+ resolution: {integrity: sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg==}
+ engines: {node: '>=10'}
+
resolution: {integrity: sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==}
engines: {node: '>=12.22'}
@@ -3694,6 +3773,9 @@ packages:
peerDependencies:
typescript: '>=4.8.4'
+ resolution: {integrity: sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ==}
+
resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==}
@@ -5173,6 +5255,8 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -5425,6 +5509,8 @@ snapshots:
'@webassemblyjs/ast': 1.14.1
'@xtuc/long': 4.2.2
+ '@xobotyi/[email protected]': {}
+
'@xtuc/[email protected]': {}
'@xtuc/[email protected]': {}
@@ -5826,6 +5912,10 @@ snapshots:
+ dependencies:
+ hyphenate-style-name: 1.1.0
+
dependencies:
boolbase: 1.0.0
@@ -6001,6 +6091,10 @@ snapshots:
dependencies:
is-arrayish: 0.2.1
+ dependencies:
+ stackframe: 1.3.4
+
dependencies:
array-buffer-byte-length: 1.0.2
@@ -6356,8 +6450,12 @@ snapshots:
+
+
dependencies:
reusify: 1.1.0
@@ -6551,6 +6649,8 @@ snapshots:
transitivePeerDependencies:
- supports-color
+
dependencies:
'@babel/runtime': 7.27.6
@@ -6595,6 +6695,10 @@ snapshots:
+ dependencies:
+ css-in-js-utils: 3.1.0
+
dependencies:
es-errors: 1.3.0
@@ -6741,6 +6845,8 @@ snapshots:
merge-stream: 2.0.0
supports-color: 8.1.1
+
@@ -6910,6 +7016,19 @@ snapshots:
+ dependencies:
+ '@jridgewell/sourcemap-codec': 1.5.5
+ css-tree: 1.1.3
+ csstype: 3.1.3
+ fastest-stable-stringify: 2.0.2
+ inline-style-prefixer: 7.0.1
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+ rtl-css-js: 1.16.1
+ stacktrace-js: 2.0.2
+ stylis: 4.3.6
+
@@ -7524,6 +7643,30 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1([email protected])
+ dependencies:
+ react: 18.3.1
+ tslib: 2.8.1
+
+ dependencies:
+ '@types/js-cookie': 2.2.7
+ '@xobotyi/scrollbar-width': 1.9.5
+ copy-to-clipboard: 3.3.3
+ fast-deep-equal: 3.1.3
+ fast-shallow-equal: 1.0.0
+ js-cookie: 2.2.1
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+ react-universal-interface: 0.6.2([email protected])([email protected])
+ resize-observer-polyfill: 1.5.1
+ screenfull: 5.2.0
+ set-harmonic-interval: 1.0.1
+ throttle-debounce: 3.0.1
+ ts-easing: 0.2.0
+ tslib: 2.8.1
+
dependencies:
loose-envify: 1.4.0
@@ -7605,6 +7748,10 @@ snapshots:
dependencies:
glob: 9.3.5
+ dependencies:
+ '@babel/runtime': 7.27.6
+
dependencies:
queue-microtask: 1.2.3
@@ -7659,6 +7806,8 @@ snapshots:
ajv-formats: 2.1.1([email protected])
ajv-keywords: 5.1.0([email protected])
+
dependencies:
compute-scroll-into-view: 3.1.1
@@ -7687,6 +7836,8 @@ snapshots:
functions-have-names: 1.2.3
has-property-descriptors: 1.0.2
+
dependencies:
dunder-proto: 1.0.1
@@ -7738,12 +7889,31 @@ snapshots:
buffer-from: 1.1.2
source-map: 0.6.1
+
+ dependencies:
+ stackframe: 1.3.4
+
+
+ dependencies:
+ source-map: 0.5.6
+ stackframe: 1.3.4
+
+ dependencies:
+ error-stack-parser: 2.1.4
+ stack-generator: 2.0.10
+ stacktrace-gps: 3.1.2
+
dependencies:
es-errors: 1.3.0
@@ -7888,6 +8058,8 @@ snapshots:
+
@@ -7913,6 +8085,8 @@ snapshots:
dependencies:
typescript: 5.8.3
+
dependencies:
'@types/json5': 0.0.29
diff --git a/src/components/PublishDialog/compoents/PublishDialogAi.tsx b/src/components/PublishDialog/compoents/PublishDialogAi.tsx
index d35d5f65..9106a6b6 100644
--- a/src/components/PublishDialog/compoents/PublishDialogAi.tsx
+++ b/src/components/PublishDialog/compoents/PublishDialogAi.tsx
@@ -2,20 +2,29 @@ import { ForwardedRef, forwardRef, memo } from "react";
import styles from "../publishDialog.module.scss";
import Chat from "@/components/Chat";
import { useTransClient } from "@/app/i18n/client";
+import { CloseCircleFilled } from "@ant-design/icons";
export interface IPublishDialogAiRef {}
-export interface IPublishDialogAiProps {}
+export interface IPublishDialogAiProps {
+ onClose: () => void;
+}
// AI写作
const PublishDialogAi = memo(
forwardRef(
- ({}: IPublishDialogAiProps, ref: ForwardedRef<IPublishDialogAiRef>) => {
+ (
+ { onClose }: IPublishDialogAiProps,
+ ref: ForwardedRef<IPublishDialogAiRef>,
+ ) => {
const { t } = useTransClient("publish");
return (
- <div className={styles.publishDialogAi}>
- <h1>{t("writingAssistant")}</h1>
+ <div className={styles.publishDialogAi} id="publishDialogAi">
+ <h1>
+ <span>{t("writingAssistant")}</span>
+ <CloseCircleFilled onClick={onClose} />
+ </h1>
<div className="publishDialogAi-wrapper">
<Chat />
</div>
diff --git a/src/components/PublishDialog/index.tsx b/src/components/PublishDialog/index.tsx
index 078769b5..ef8403d7 100644
--- a/src/components/PublishDialog/index.tsx
+++ b/src/components/PublishDialog/index.tsx
@@ -60,6 +60,9 @@ import { wxGzhSkip } from "@/app/[lng]/accounts/plat/WxGzh";
import { pinterestSkip } from "@/app/[lng]/accounts/plat/PinterestLogin";
import { linkedinSkip } from "@/app/[lng]/accounts/plat/LinkedinLogin";
import { useAccountStore } from "@/store/account";
+import PublishDialogPreview from "@/components/PublishDialog/compoents/PublishDialogPreview";
+import Aibrush from "./svgs/aibrush.svg";
+import { useWindowSize } from "react-use";
export interface IPublishDialogRef {
// 设置发布时间
@@ -91,6 +94,7 @@ const PublishDialog = memo(
}: IPublishDialogProps,
ref: ForwardedRef<IPublishDialogRef>,
) => {
+ const { width } = useWindowSize();
const [openLeft, setOpenLeft] = useState(false);
const {
pubListChoosed,
@@ -604,6 +608,16 @@ const PublishDialog = memo(
}
}, [pubListChoosed, expandedPubItem, step]);
+ // 是否打开左侧
+ const openLeftSide = useMemo(() => {
+ if (!openLeft) return false;
+ if (step === 0) {
+ return pubListChoosed.length !== 0;
+ } else {
+ return expandedPubItem !== undefined;
+ }
+ }, [openLeft, step, pubListChoosed.length, expandedPubItem]);
+
useEffect(() => {
setErrParamsMap(errParamsMap);
}, [errParamsMap]);
@@ -664,14 +678,16 @@ const PublishDialog = memo(
footer={null}
styles={{ wrapper: { textAlign: "center" } }}
>
- <CSSTransition
- in={openLeft}
- timeout={300}
- classNames="left"
- unmountOnExit
- >
- <PublishDialogAi />
- </CSSTransition>
+ {width >= 1400 && (
+ <CSSTransition
+ in={openLeftSide}
+ timeout={300}
+ classNames="left"
+ unmountOnExit
+ >
+ <PublishDialogAi onClose={() => setOpenLeft(false)} />
+ </CSSTransition>
+ )}
<div
className="publishDialog-wrapper"
@@ -714,6 +730,16 @@ const PublishDialog = memo(
>
{t("actions.selectDraft")}
</Button>
+ <Button
+ size="small"
+ icon={<Aibrush />}
+ onClick={(e) => {
+ e.stopPropagation();
+ setOpenLeft(true);
+ }}
+ >
+ {t("writingAssistant")}
+ </Button>
</div>
</div>
<div className="publishDialog-con-acconts">
@@ -1090,14 +1116,26 @@ const PublishDialog = memo(
</div>
</div>
- <CSSTransition
- in={openRight}
- timeout={300}
- classNames="right"
- unmountOnExit
- >
- <PublishDialogAi />
- </CSSTransition>
+ <div className="publishDialog-right">
+ {width < 1400 && (
+ <CSSTransition
+ in={openLeftSide}
+ timeout={300}
+ classNames="left"
+ unmountOnExit
+ >
+ <PublishDialogAi onClose={() => setOpenLeft(false)} />
+ </CSSTransition>
+ )}
+ <CSSTransition
+ in={openRight}
+ timeout={300}
+ classNames="right"
+ unmountOnExit
+ >
+ <PublishDialogPreview />
+ </CSSTransition>
+ </div>
</Modal>
{/* Draft Selection Modal */}
diff --git a/src/components/PublishDialog/publishDialog.module.scss b/src/components/PublishDialog/publishDialog.module.scss
index 16183f49..97c096e0 100644
--- a/src/components/PublishDialog/publishDialog.module.scss
+++ b/src/components/PublishDialog/publishDialog.module.scss
@@ -1,10 +1,20 @@
-$assistantWidth: 400px;
+$assistantWidth: 380px;
.publishDialog {
width: auto !important;
margin: 0 auto;
display: inline-block;
:global {
+ .publishDialog-right {
+ display: flex;
+ position: relative;
+ #publishDialogAi {
+ position: absolute;
+ top: 0;
+ height: 100%;
+ }
+ }
+
.ant-modal-content {
padding: 0 !important;
}
@@ -137,13 +147,20 @@ $assistantWidth: 400px;
.publishDialogAi {
display: flex;
flex-direction: column;
- margin-left: 15px;
+ z-index: 10;
+ margin: 0 15px;
:global {
h1 {
font-size: var(--fs-md);
font-weight: 600;
text-align: left;
- padding: 15px 0 0 15px;
+ padding: 15px 15px 0 15px;
+ display: flex;
+ justify-content: space-between;
+ .anticon {
+ cursor: pointer;
+ font-size: 20px;
+ }
}
.publishDialogAi-wrapper {
min-width: $assistantWidth;
diff --git a/src/components/PublishDialog/svgs/aibrush.svg b/src/components/PublishDialog/svgs/aibrush.svg
new file mode 100644
index 00000000..f962ea50
--- /dev/null
+++ b/src/components/PublishDialog/svgs/aibrush.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="publish_base_QFRw0" data-icon="wand-sparkles" aria-hidden="true" stroke-width="2.2" width="16" height="16"><path d="M14 7L17 10M5.00005 6V10M19 14V18M10 2V4M7.00004 8H3.00005M21 16H17M11 3H9.00004M21.64 3.64L20.36 2.36C20.2475 2.24632 20.1136 2.15607 19.966 2.09448C19.8184 2.03289 19.66 2.00118 19.5 2.00118C19.3401 2.00118 19.1817 2.03289 19.0341 2.09448C18.8865 2.15607 18.7526 2.24632 18.64 2.36L2.36004 18.64C2.24636 18.7525 2.15612 18.8865 2.09452 19.0341C2.03293 19.1817 2.00122 19.3401 2.00122 19.5C2.00122 19.6599 2.03293 19.8183 2.09452 19.9659C2.15612 20.1135 2.24636 20.2475 2.36004 20.36L3.64005 21.64C3.75187 21.7549 3.88558 21.8462 4.03329 21.9086C4.181 21.971 4.33971 22.0031 4.50005 22.0031C4.66038 22.0031 4.81909 21.971 4.9668 21.9086C5.11451 21.8462 5.24822 21.7549 5.36005 21.64L21.64 5.36C21.755 5.24818 21.8463 5.11447 21.9087 4.96676C21.971 4.81905 22.0031 4.66034 22.0031 4.5C22.0031 4.33966 21.971 4.18095 21.9087 4.03324C21.8463 3.88553 21.755 3.75182 21.64 3.64Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg>
\ No newline at end of file