diff --git a/README.md b/README.md index fcccb86..a25540d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Fastest way to try PageAgent: ```html ``` @@ -46,8 +46,8 @@ Fastest way to try PageAgent: | Mirrors | URL | | ------- | ----------------------------------------------------------------------------------- | -| Global | https://cdn.jsdelivr.net/npm/@page-agent/cdn/dist/page-agent.demo.js | -| China | https://registry.npmmirror.com/@page-agent/cdn/latest/files/dist/page-agent.demo.js | +| Global | https://cdn.jsdelivr.net/npm/page-agent/dist/iife/page-agent.demo.js | +| China | https://registry.npmmirror.com/page-agent/latest/files/dist/iife/page-agent.demo.js | ### NPM Installation @@ -68,8 +68,6 @@ const agent = new PageAgent({ await agent.execute('Click the login button') ``` -For environments where NPM is not available. We do offer a IIFE build via CDN. [@see CDN Usage](https://alibaba.github.io/page-agent/#/docs/integration/cdn-setup) - ## 🏗️ Structure PageAgent adopts a simplified monorepo structure: diff --git a/packages/website/src/constants.ts b/packages/website/src/constants.ts index a20910c..c8d6afe 100644 --- a/packages/website/src/constants.ts +++ b/packages/website/src/constants.ts @@ -1,12 +1,7 @@ // Demo build (auto-init with demo LLM, for quick testing) -export const CDN_DEMO_URL = 'https://cdn.jsdelivr.net/npm/@page-agent/cdn/dist/page-agent.demo.js' +export const CDN_DEMO_URL = 'https://cdn.jsdelivr.net/npm/page-agent/dist/iife/page-agent.demo.js' export const CDN_DEMO_CN_URL = - 'https://registry.npmmirror.com/@page-agent/cdn/latest/files/dist/page-agent.demo.js' - -// Full build (exports PageAgent class, usage identical to npm) -export const CDN_FULL_URL = 'https://cdn.jsdelivr.net/npm/@page-agent/cdn/dist/page-agent.js' -export const CDN_FULL_CN_URL = - 'https://registry.npmmirror.com/@page-agent/cdn/latest/files/dist/page-agent.js' + 'https://registry.npmmirror.com/page-agent/latest/files/dist/iife/page-agent.demo.js' // Demo LLM for website testing export const DEMO_MODEL = 'PAGE-AGENT-FREE-TESTING-RANDOM' diff --git a/packages/website/src/pages/docs/integration/cdn-setup/page.tsx b/packages/website/src/pages/docs/integration/cdn-setup/page.tsx index 50b26c1..f4a4a10 100644 --- a/packages/website/src/pages/docs/integration/cdn-setup/page.tsx +++ b/packages/website/src/pages/docs/integration/cdn-setup/page.tsx @@ -1,7 +1,7 @@ import { useTranslation } from 'react-i18next' import CodeEditor from '@/components/CodeEditor' -import { CDN_DEMO_CN_URL, CDN_DEMO_URL, CDN_FULL_CN_URL, CDN_FULL_URL } from '@/constants' +import { CDN_DEMO_CN_URL, CDN_DEMO_URL } from '@/constants' export default function CdnSetup() { const { i18n } = useTranslation() @@ -63,63 +63,6 @@ export default function CdnSetup() { - - {/* CDN Build Section */} -
-

{isZh ? '📦 标准版' : '📦 Standard Build'}

- -

- {isZh - ? '将 PageAgent 类暴露到 globalThis,用法与 NPM 一致:' - : 'Exposes PageAgent class to globalThis, usage identical to NPM:'} -

- - -`} - /> - - - - - - - - - - - - - - - - - - -
- {isZh ? '位置' : 'Location'} - URL
{isZh ? '全球' : 'Global'}{CDN_FULL_URL}
{isZh ? '中国' : 'China'}{CDN_FULL_CN_URL}
-
- - {/* Tips */} -
-

- 💡 {isZh ? '提示' : 'Tips'} -

- -
) } diff --git a/packages/website/src/pages/docs/introduction/quick-start/page.tsx b/packages/website/src/pages/docs/introduction/quick-start/page.tsx index e92f139..b81e49a 100644 --- a/packages/website/src/pages/docs/introduction/quick-start/page.tsx +++ b/packages/website/src/pages/docs/introduction/quick-start/page.tsx @@ -1,6 +1,5 @@ import { useTranslation } from 'react-i18next' -import BetaNotice from '@/components/BetaNotice' import CodeEditor from '@/components/CodeEditor' import { CDN_DEMO_CN_URL, CDN_DEMO_URL } from '@/constants' @@ -28,11 +27,29 @@ export default function QuickStart() { `} + code={``} language="html" /> + + + + + + + + + + + + + + + + + +
+ {isZh ? '镜像' : 'Mirrors'} + URL
{isZh ? '全球' : 'Global'}{CDN_DEMO_URL}
{isZh ? '中国' : 'China'}{CDN_DEMO_CN_URL}
{/* NPM - Recommended */} @@ -41,7 +58,7 @@ export default function QuickStart() { {isZh ? '📦 NPM 安装(推荐)' : '📦 NPM Install (Recommended)'}