From 17335cb47a1e578b4536973b0d4e7dea7ca7e580 Mon Sep 17 00:00:00 2001 From: kang Date: Mon, 15 Jun 2026 11:08:19 +0800 Subject: [PATCH] feat(docs, integration): update integration documentation and redirect legacy paths Introduced a new public documentation site for client integration at `/docs` and `/docs/integration`, removing the need for admin login. Updated the integration guide to redirect from the old admin path to the new documentation site. Added localization support for the integration documentation in English, Nepali, and Chinese. Enhanced the layout structure and improved the handling of currency display in settlement bills. --- AGENTS.md | 2 + package-lock.json | 550 ++++++++++++++++++ package.json | 1 + src/app/admin/docs/integration-guide/page.tsx | 22 +- src/app/docs/integration/errors/page.tsx | 5 + .../docs/integration/fundamentals/page.tsx | 5 + src/app/docs/integration/go-live/page.tsx | 5 + src/app/docs/integration/iframe/page.tsx | 5 + src/app/docs/integration/layout.tsx | 11 + src/app/docs/integration/page.tsx | 5 + src/app/docs/integration/preparation/page.tsx | 5 + src/app/docs/integration/quickstart/page.tsx | 5 + src/app/docs/integration/sso/page.tsx | 5 + src/app/docs/integration/transfer/page.tsx | 5 + src/app/docs/integration/wallet/page.tsx | 5 + src/app/docs/layout.tsx | 16 + src/app/docs/page.tsx | 5 + src/app/layout.tsx | 9 +- src/components/docs/doc-code.tsx | 55 ++ src/components/docs/doc-ui.tsx | 129 ++++ src/components/docs/docs-shell.tsx | 53 ++ src/components/docs/docs-sidebar.tsx | 62 ++ src/i18n/index.ts | 9 +- src/i18n/locales/en/integrationDocs.json | 372 ++++++++++++ src/i18n/locales/ne/integrationDocs.json | 372 ++++++++++++ src/i18n/locales/zh/integrationDocs.json | 372 ++++++++++++ src/lib/admin-page-title.ts | 10 + src/lib/docs-nav-labels.ts | 31 + src/lib/docs-nav.ts | 35 ++ src/lib/highlight-code.ts | 25 + src/modules/config/config-hub-screen.tsx | 2 +- src/modules/docs/integration-guide-screen.tsx | 416 +------------ .../docs/integration/integration-doc-data.ts | 154 +++++ .../integration/integration-doc-screens.tsx | 314 ++++++++++ .../docs/integration/use-integration-doc.ts | 27 + 35 files changed, 2668 insertions(+), 436 deletions(-) create mode 100644 src/app/docs/integration/errors/page.tsx create mode 100644 src/app/docs/integration/fundamentals/page.tsx create mode 100644 src/app/docs/integration/go-live/page.tsx create mode 100644 src/app/docs/integration/iframe/page.tsx create mode 100644 src/app/docs/integration/layout.tsx create mode 100644 src/app/docs/integration/page.tsx create mode 100644 src/app/docs/integration/preparation/page.tsx create mode 100644 src/app/docs/integration/quickstart/page.tsx create mode 100644 src/app/docs/integration/sso/page.tsx create mode 100644 src/app/docs/integration/transfer/page.tsx create mode 100644 src/app/docs/integration/wallet/page.tsx create mode 100644 src/app/docs/layout.tsx create mode 100644 src/app/docs/page.tsx create mode 100644 src/components/docs/doc-code.tsx create mode 100644 src/components/docs/doc-ui.tsx create mode 100644 src/components/docs/docs-shell.tsx create mode 100644 src/components/docs/docs-sidebar.tsx create mode 100644 src/i18n/locales/en/integrationDocs.json create mode 100644 src/i18n/locales/ne/integrationDocs.json create mode 100644 src/i18n/locales/zh/integrationDocs.json create mode 100644 src/lib/docs-nav-labels.ts create mode 100644 src/lib/docs-nav.ts create mode 100644 src/lib/highlight-code.ts create mode 100644 src/modules/docs/integration/integration-doc-data.ts create mode 100644 src/modules/docs/integration/integration-doc-screens.tsx create mode 100644 src/modules/docs/integration/use-integration-doc.ts diff --git a/AGENTS.md b/AGENTS.md index 8122fd0..6214b9a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,3 +39,5 @@ This version has breaking changes — APIs, conventions, and file structure may - 超管判定用登录态 `is_super_admin`,勿用站点角色或 `admin_user_site_roles` 绑定推断。 - 站点管理员(`profile.site != null`)代理 UI 绕过选中代理的 `can_create_*` 门控,按自身 manage 权限展示 Tab/操作。 - 站点管理员在代理下创建玩家须传 `agent_node_id`(与超管同逻辑),勿默认挂根代理。 +- 客户接入文档公开站:`/docs`(首页)、`/docs/integration`(接入正文),无需 `/admin` 登录;旧 `/admin/docs/integration-guide` 重定向至此。 +- `SettlementBillRow` 无 `currency_code`;账单金额展示用玩家 `default_currency`。 diff --git a/package-lock.json b/package-lock.json index f9b75cb..34d3878 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "react-i18next": "^17.0.8", "recharts": "^3.8.0", "shadcn": "^4.7.0", + "shiki": "^4.2.0", "sonner": "^2.0.7", "swr": "^2.4.1", "tailwind-merge": "^3.5.0", @@ -2076,6 +2077,106 @@ "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", "license": "MIT" }, + "node_modules/@shikijs/core": { + "version": "4.2.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/@shikijs/core/-/core-4.2.0.tgz", + "integrity": "sha512-Hc87Ab1Ld/vEbZRCbwx344I5v+4RU8CVToUTRkqXL1+TjbuOp9U5Xa0M23V4GEWHxVn+yO5otb+HkQVm3ptWQQ==", + "license": "MIT", + "dependencies": { + "@shikijs/primitive": "4.2.0", + "@shikijs/types": "4.2.0", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4", + "hast-util-to-html": "^9.0.5" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/engine-javascript": { + "version": "4.2.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/@shikijs/engine-javascript/-/engine-javascript-4.2.0.tgz", + "integrity": "sha512-fjETeq1k5ffyXqRgS6+3hpvqseLalp1kjNfRbXpUgWR8FpZ1CmQfiNHovc5lncYjt/Vg5JK/WJEmLahjwMa0og==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.2.0", + "@shikijs/vscode-textmate": "^10.0.2", + "oniguruma-to-es": "^4.3.6" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "4.2.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/@shikijs/engine-oniguruma/-/engine-oniguruma-4.2.0.tgz", + "integrity": "sha512-hTorK1dffPkpbMUk6Z+828PgRo7d07HbnizoP0hNPFjhxMHctj0Px/qoHeGMYafc6ju+u9iMldN4JbVzNQM++g==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.2.0", + "@shikijs/vscode-textmate": "^10.0.2" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/langs": { + "version": "4.2.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/@shikijs/langs/-/langs-4.2.0.tgz", + "integrity": "sha512-bwrVRlJ0wUhZxAbVdvBbv2TTC9yLsh4C/IO5Ofz0T8MQntgDvyVnkbjw9vi50r1kx7RCIJdnJnjZAwmAsXFLZQ==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/primitive": { + "version": "4.2.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/@shikijs/primitive/-/primitive-4.2.0.tgz", + "integrity": "sha512-NOq+DtUkVBJtZMVXL5A0vI0Xk8nvDYaXetFHSJFlOqjDZIVhIPRYFdGkSoElDqNuegikcc3A76SNUa8dTqtAYA==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.2.0", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/themes": { + "version": "4.2.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/@shikijs/themes/-/themes-4.2.0.tgz", + "integrity": "sha512-RX8IHYeLv8Cu2W6ruc3RxUqWn0IYCqSrMBzi/uRGAmfyDNOnNO5BF/Px7o97n4XTpmFTo5GbRaazuOWj+2ak2w==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/types": { + "version": "4.2.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/@shikijs/types/-/types-4.2.0.tgz", + "integrity": "sha512-VT/MKtlpOhEPZloSH3Pb9WCZEBDoQVMa9jedp5UAwmJOar1DVc9DRODAxmYPW9M93IK4ryuqRejFfmlvlVDemw==", + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.0.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "license": "MIT" + }, "node_modules/@sindresorhus/merge-streams": { "version": "4.0.0", "resolved": "https://registry.npmmirror.com/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", @@ -2547,6 +2648,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://mirrors.cloud.tencent.com/npm/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -2561,6 +2671,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://mirrors.cloud.tencent.com/npm/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/@types/node": { "version": "20.19.40", "resolved": "https://registry.npmmirror.com/@types/node/-/node-20.19.40.tgz", @@ -2605,6 +2724,12 @@ "integrity": "sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==", "license": "MIT" }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://mirrors.cloud.tencent.com/npm/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "license": "MIT" + }, "node_modules/@types/use-sync-external-store": { "version": "0.0.6", "resolved": "https://mirrors.cloud.tencent.com/npm/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", @@ -2912,6 +3037,12 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/@ungap/structured-clone/-/structured-clone-1.3.1.tgz", + "integrity": "sha512-mUFwbeTqrVgDQxFveS+df2yfap6iuP20NAKAsBt5jDEoOTDew+zwLAOilHCeQJOVSvmgCX4ogqIrA0mnyr08yQ==", + "license": "ISC" + }, "node_modules/@unrs/resolver-binding-android-arm-eabi": { "version": "1.11.1", "resolved": "https://registry.npmmirror.com/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz", @@ -3834,6 +3965,16 @@ ], "license": "CC-BY-4.0" }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/cfb": { "version": "1.2.2", "resolved": "https://mirrors.cloud.tencent.com/npm/cfb/-/cfb-1.2.2.tgz", @@ -3864,6 +4005,26 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/class-variance-authority": { "version": "0.7.1", "resolved": "https://registry.npmmirror.com/class-variance-authority/-/class-variance-authority-0.7.1.tgz", @@ -4027,6 +4188,16 @@ "node": ">= 0.8" } }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://mirrors.cloud.tencent.com/npm/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/commander": { "version": "14.0.3", "resolved": "https://registry.npmmirror.com/commander/-/commander-14.0.3.tgz", @@ -4539,6 +4710,19 @@ "node": ">=8" } }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/diff": { "version": "8.0.4", "resolved": "https://registry.npmmirror.com/diff/-/diff-8.0.4.tgz", @@ -6111,6 +6295,42 @@ "node": ">= 0.4" } }, + "node_modules/hast-util-to-html": { + "version": "9.0.5", + "resolved": "https://mirrors.cloud.tencent.com/npm/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz", + "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/headers-polyfill": { "version": "5.0.1", "resolved": "https://registry.npmmirror.com/headers-polyfill/-/headers-polyfill-5.0.1.tgz", @@ -6156,6 +6376,16 @@ "void-elements": "3.1.0" } }, + "node_modules/html-void-elements": { + "version": "3.0.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/http-errors": { "version": "2.0.1", "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.1.tgz", @@ -7512,6 +7742,27 @@ "node": ">= 0.4" } }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/media-typer": { "version": "1.1.0", "resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-1.1.0.tgz", @@ -7548,6 +7799,95 @@ "node": ">= 8" } }, + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-types": { + "version": "2.0.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmmirror.com/micromatch/-/micromatch-4.0.8.tgz", @@ -8095,6 +8435,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/oniguruma-parser": { + "version": "0.12.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz", + "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==", + "license": "MIT" + }, + "node_modules/oniguruma-to-es": { + "version": "4.3.6", + "resolved": "https://mirrors.cloud.tencent.com/npm/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz", + "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==", + "license": "MIT", + "dependencies": { + "oniguruma-parser": "^0.12.2", + "regex": "^6.1.0", + "regex-recursion": "^6.0.2" + } + }, "node_modules/open": { "version": "11.0.0", "resolved": "https://registry.npmmirror.com/open/-/open-11.0.0.tgz", @@ -8462,6 +8819,16 @@ "react-is": "^16.13.1" } }, + "node_modules/property-information": { + "version": "7.2.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/property-information/-/property-information-7.2.0.tgz", + "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -8733,6 +9100,30 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/regex": { + "version": "6.1.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/regex/-/regex-6.1.0.tgz", + "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-recursion": { + "version": "6.0.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/regex-recursion/-/regex-recursion-6.0.2.tgz", + "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-utilities": { + "version": "2.3.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/regex-utilities/-/regex-utilities-2.3.0.tgz", + "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==", + "license": "MIT" + }, "node_modules/regexp.prototype.flags": { "version": "1.5.4", "resolved": "https://registry.npmmirror.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", @@ -9296,6 +9687,25 @@ "node": ">=8" } }, + "node_modules/shiki": { + "version": "4.2.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/shiki/-/shiki-4.2.0.tgz", + "integrity": "sha512-hjNax6o/ylDy9lefQEaSDtzaT3iVNtZ3WmpQnbuQNoG4xvnSKf2kSKbihZVO4JRG1TTMejs7CmNRYlWgAL66pQ==", + "license": "MIT", + "dependencies": { + "@shikijs/core": "4.2.0", + "@shikijs/engine-javascript": "4.2.0", + "@shikijs/engine-oniguruma": "4.2.0", + "@shikijs/langs": "4.2.0", + "@shikijs/themes": "4.2.0", + "@shikijs/types": "4.2.0", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz", @@ -9414,6 +9824,16 @@ "node": ">=0.10.0" } }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/ssf": { "version": "0.11.2", "resolved": "https://mirrors.cloud.tencent.com/npm/ssf/-/ssf-0.11.2.tgz", @@ -9610,6 +10030,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://mirrors.cloud.tencent.com/npm/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/stringify-object": { "version": "5.0.0", "resolved": "https://registry.npmmirror.com/stringify-object/-/stringify-object-5.0.0.tgz", @@ -9886,6 +10320,16 @@ "node": ">=16" } }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/ts-api-utils": { "version": "2.5.0", "resolved": "https://registry.npmmirror.com/ts-api-utils/-/ts-api-utils-2.5.0.tgz", @@ -10170,6 +10614,74 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/unist-util-is": { + "version": "6.0.1", + "resolved": "https://mirrors.cloud.tencent.com/npm/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.1.0", + "resolved": "https://mirrors.cloud.tencent.com/npm/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.2", + "resolved": "https://mirrors.cloud.tencent.com/npm/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.1.tgz", @@ -10305,6 +10817,34 @@ "node": ">= 0.8" } }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://mirrors.cloud.tencent.com/npm/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.3", + "resolved": "https://mirrors.cloud.tencent.com/npm/vfile-message/-/vfile-message-4.0.3.tgz", + "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/victory-vendor": { "version": "37.3.6", "resolved": "https://mirrors.cloud.tencent.com/npm/victory-vendor/-/victory-vendor-37.3.6.tgz", @@ -10760,6 +11300,16 @@ "optional": true } } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://mirrors.cloud.tencent.com/npm/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } } } } diff --git a/package.json b/package.json index 1addf45..fdacb8b 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "react-i18next": "^17.0.8", "recharts": "^3.8.0", "shadcn": "^4.7.0", + "shiki": "^4.2.0", "sonner": "^2.0.7", "swr": "^2.4.1", "tailwind-merge": "^3.5.0", diff --git a/src/app/admin/docs/integration-guide/page.tsx b/src/app/admin/docs/integration-guide/page.tsx index 08b846a..53ba31f 100644 --- a/src/app/admin/docs/integration-guide/page.tsx +++ b/src/app/admin/docs/integration-guide/page.tsx @@ -1,18 +1,6 @@ -import { AdminPermissionGate } from "@/components/admin/admin-permission-gate"; -import { ShellAuthGate } from "@/components/admin/auth-gate"; -import { IntegrationGuideScreen } from "@/modules/docs/integration-guide-screen"; -import { PRD_INTEGRATION_ACCESS_ANY } from "@/lib/admin-prd"; -import { buildPageMetadata } from "@/lib/page-metadata"; -import type { Metadata } from "next"; +import { redirect } from "next/navigation"; -export const metadata: Metadata = buildPageMetadata("config", "integrationGuide.title"); - -export default function AdminIntegrationGuidePage(): React.ReactElement { - return ( - - - - - - ); -} \ No newline at end of file +/** 旧后台路径保留,统一跳转到公开文档站 */ +export default function AdminIntegrationGuidePage(): never { + redirect("/docs/integration"); +} diff --git a/src/app/docs/integration/errors/page.tsx b/src/app/docs/integration/errors/page.tsx new file mode 100644 index 0000000..be28feb --- /dev/null +++ b/src/app/docs/integration/errors/page.tsx @@ -0,0 +1,5 @@ +import { ErrorsDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationErrorsPage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/integration/fundamentals/page.tsx b/src/app/docs/integration/fundamentals/page.tsx new file mode 100644 index 0000000..4bc28de --- /dev/null +++ b/src/app/docs/integration/fundamentals/page.tsx @@ -0,0 +1,5 @@ +import { FundamentalsDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationFundamentalsPage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/integration/go-live/page.tsx b/src/app/docs/integration/go-live/page.tsx new file mode 100644 index 0000000..36d3524 --- /dev/null +++ b/src/app/docs/integration/go-live/page.tsx @@ -0,0 +1,5 @@ +import { GoLiveDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationGoLivePage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/integration/iframe/page.tsx b/src/app/docs/integration/iframe/page.tsx new file mode 100644 index 0000000..78e0fa6 --- /dev/null +++ b/src/app/docs/integration/iframe/page.tsx @@ -0,0 +1,5 @@ +import { IframeDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationIframePage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/integration/layout.tsx b/src/app/docs/integration/layout.tsx new file mode 100644 index 0000000..0477c1b --- /dev/null +++ b/src/app/docs/integration/layout.tsx @@ -0,0 +1,11 @@ +import type { ReactNode } from "react"; + +import { DocsSidebar } from "@/components/docs/docs-sidebar"; +import { DocsBody } from "@/components/docs/docs-shell"; +import { DOCS_NAV_GROUPS } from "@/lib/docs-nav"; + +export default function IntegrationDocsLayout({ children }: { children: ReactNode }): React.ReactElement { + return ( + }>{children} + ); +} diff --git a/src/app/docs/integration/page.tsx b/src/app/docs/integration/page.tsx new file mode 100644 index 0000000..2829b59 --- /dev/null +++ b/src/app/docs/integration/page.tsx @@ -0,0 +1,5 @@ +import { OverviewDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationOverviewPage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/integration/preparation/page.tsx b/src/app/docs/integration/preparation/page.tsx new file mode 100644 index 0000000..67017ad --- /dev/null +++ b/src/app/docs/integration/preparation/page.tsx @@ -0,0 +1,5 @@ +import { SetupDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationPreparationPage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/integration/quickstart/page.tsx b/src/app/docs/integration/quickstart/page.tsx new file mode 100644 index 0000000..2346120 --- /dev/null +++ b/src/app/docs/integration/quickstart/page.tsx @@ -0,0 +1,5 @@ +import { QuickstartDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationQuickstartPage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/integration/sso/page.tsx b/src/app/docs/integration/sso/page.tsx new file mode 100644 index 0000000..0d51ce6 --- /dev/null +++ b/src/app/docs/integration/sso/page.tsx @@ -0,0 +1,5 @@ +import { SsoDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationSsoPage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/integration/transfer/page.tsx b/src/app/docs/integration/transfer/page.tsx new file mode 100644 index 0000000..c64b683 --- /dev/null +++ b/src/app/docs/integration/transfer/page.tsx @@ -0,0 +1,5 @@ +import { TransferDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationTransferPage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/integration/wallet/page.tsx b/src/app/docs/integration/wallet/page.tsx new file mode 100644 index 0000000..504f383 --- /dev/null +++ b/src/app/docs/integration/wallet/page.tsx @@ -0,0 +1,5 @@ +import { WalletDocScreen } from "@/modules/docs/integration/integration-doc-screens"; + +export default function IntegrationWalletPage(): React.ReactElement { + return ; +} diff --git a/src/app/docs/layout.tsx b/src/app/docs/layout.tsx new file mode 100644 index 0000000..41d5188 --- /dev/null +++ b/src/app/docs/layout.tsx @@ -0,0 +1,16 @@ +import type { Metadata } from "next"; +import type { ReactNode } from "react"; + +import { DocsShell } from "@/components/docs/docs-shell"; + +export const metadata: Metadata = { + title: { + template: "%s · Integration API", + default: "Integration API", + }, + description: "Lottery integration docs: SSO, wallet gateway, transfers.", +}; + +export default function DocsLayout({ children }: { children: ReactNode }): React.ReactElement { + return {children}; +} diff --git a/src/app/docs/page.tsx b/src/app/docs/page.tsx new file mode 100644 index 0000000..f7196c8 --- /dev/null +++ b/src/app/docs/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from "next/navigation"; + +export default function DocsHomePage(): never { + redirect("/docs/integration"); +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index cf48607..6907517 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,6 +1,5 @@ import type { Metadata } from "next"; import { Geist, Geist_Mono } from "next/font/google"; -import Script from "next/script"; import { Providers } from "@/components/providers"; import "./globals.css"; @@ -37,12 +36,12 @@ export default function RootLayout({ suppressHydrationWarning className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`} > - -