/* * Copyright 2025 coze-dev Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { useState } from 'react'; import { getOpenSDKUrl } from '@coze-studio/open-env-adapter'; import { I18n } from '@coze-arch/i18n'; import { MdBoxLazy } from '@coze-arch/bot-md-box-adapter/lazy'; import { Button, Modal, Typography } from '@coze-arch/coze-design'; import s from './index.module.less'; export interface WebSdkGuideParams { projectId: string; workflowId: string; token?: string; version?: string; } function getWebSdkScriptTagMD({ projectId, workflowId, version = '', }: WebSdkGuideParams) { return `${'```'}html ${'```'}`; } function ListIndex({ index }: { index: number }) { return (
{index}
); } export function useWebSdkGuideModal() { const [visible, setVisible] = useState(false); const [scriptTagMd, setScriptTagMd] = useState(''); const show = (params: WebSdkGuideParams) => { const md = getWebSdkScriptTagMD(params); setScriptTagMd(md); setVisible(true); }; const close = () => setVisible(false); const node = ( {I18n.t('app_publish_sdk_confirm')} } // z-index 需要大于 publish-status 的 Popover zIndex={2000} > {I18n.t('app_publish_sdk_step_1', { doc_link: ( {I18n.t('app_publish_sdk_step_1_doc')} ), })} {I18n.t('app_publish_sdk_step_2')} {I18n.t('app_publish_sdk_step_3')} ); return { node, show }; }