@tbox.cn/app-template-agent 1.0.0-alpha.20 → 1.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/._.gitignore +0 -0
- package/{.tbox/cache/._apps-client-strict.tsbuildinfo → ._.ignore} +0 -0
- package/._.nvmrc +0 -0
- package/._AGENTS.md +0 -0
- package/._ENV.md +0 -0
- package/._LEGAL.md +0 -0
- package/._LICENSE +0 -0
- package/._README.md +0 -0
- package/._eslint.config.mjs +0 -0
- package/._package.json +0 -0
- package/._pnpm-lock.template.yaml +0 -0
- package/._pnpm-workspace.template.yaml +0 -0
- package/._tsconfig.base.json +0 -0
- package/.ignore +9 -0
- package/.tbox/._app.json +0 -0
- package/.tbox/._default-modules.json +0 -0
- package/.tbox/._miniapp-containers.json +0 -0
- package/.tbox/app.json +1 -1
- package/.tbox/cache/{._apps-server-strict.tsbuildinfo → ._.eslintcache} +0 -0
- package/.tbox/cache/._apps-client.tsbuildinfo +0 -0
- package/.tbox/cache/._apps-server.tsbuildinfo +0 -0
- package/.tbox/cache/._packages-agent-ui-kit.tsbuildinfo +0 -0
- package/.tbox/cache/._packages-shared.tsbuildinfo +0 -0
- package/.tbox/cache/.eslintcache +1 -0
- package/.tbox/cache/apps-client.tsbuildinfo +1 -1
- package/.tbox/cache/apps-server.tsbuildinfo +1 -1
- package/.tbox/cache/packages-agent-ui-kit.tsbuildinfo +1 -1
- package/.tbox/default-modules.json +1 -1
- package/.tbox/factory/._chat.json +0 -0
- package/.tbox/miniapp-containers.json +1 -1
- package/AGENTS.md +1 -1
- package/apps/._AGENTS.md +0 -0
- package/apps/client/._index.html +0 -0
- package/apps/client/._package.json +0 -0
- package/apps/client/._tsconfig.json +0 -0
- package/apps/client/._vite.config.ts +0 -0
- package/apps/client/scripts/._acceptance-changes.test.mjs +0 -0
- package/apps/client/scripts/._check-evidence.mjs +0 -0
- package/apps/client/scripts/._color-scan.mjs +0 -0
- package/apps/client/scripts/._color-scan.test.mjs +0 -0
- package/apps/client/scripts/._evidence-gate.mjs +0 -0
- package/apps/client/scripts/._evidence-gate.test.mjs +0 -0
- package/apps/client/scripts/._experience-checks.mjs +0 -0
- package/apps/client/scripts/._geometry-kernel.test.mjs +0 -0
- package/apps/client/scripts/._home-preset-wiring.test.ts +0 -0
- package/apps/client/scripts/._home-preset-wiring.ts +0 -0
- package/apps/client/scripts/._in-process-checks.mjs +0 -0
- package/apps/client/scripts/._probe-checks.mjs +0 -0
- package/apps/client/scripts/._render-card.mjs +0 -0
- package/apps/client/scripts/._sample-entries.test.mjs +0 -0
- package/apps/client/scripts/._static-checks.test.mjs +0 -0
- package/apps/client/scripts/._storyboard.test.mjs +0 -0
- package/apps/client/scripts/._surface-css.mjs +0 -0
- package/apps/client/scripts/._theme-kernel.mjs +0 -0
- package/apps/client/scripts/._theme-kernel.test.mjs +0 -0
- package/apps/client/scripts/check-evidence.mjs +61 -15
- package/apps/client/scripts/experience-checks.mjs +50 -5
- package/apps/client/scripts/in-process-checks.mjs +52 -2
- package/apps/client/scripts/lib/._card-registry.mjs +0 -0
- package/apps/client/scripts/lib/._card-registry.test.mjs +0 -0
- package/apps/client/scripts/lib/._evidence-inputs.mjs +0 -0
- package/apps/client/scripts/lib/._evidence-inputs.test.mjs +0 -0
- package/apps/client/scripts/lib/._static-render.mjs +0 -0
- package/apps/client/scripts/lib/._static-render.test.mjs +0 -0
- package/{.tbox/cache/._packages-agent-ui-kit-strict.tsbuildinfo → apps/client/scripts/lib/._tool-cards-static.mjs} +0 -0
- package/apps/client/scripts/lib/tool-cards-static.mjs +91 -0
- package/apps/client/scripts/probe-checks.mjs +1 -0
- package/apps/client/src/._app.config.ts +0 -0
- package/apps/client/src/._vite-env.d.ts +0 -0
- package/apps/client/src/cards/._AGENTS.md +0 -0
- package/apps/client/src/cards/._home-preset.test.ts +0 -0
- package/apps/client/src/cards/._home-preset.ts +0 -0
- package/apps/client/src/cards/._registry.ts +0 -0
- package/apps/client/src/pages/._page.tsx +0 -0
- package/apps/client/src/pages/index/._index.tsx +0 -0
- package/apps/client/src/store/._chat.ts +0 -0
- package/apps/client/src/styles/._brand.css +0 -0
- package/apps/client/src/styles/._tailwind.css +0 -0
- package/apps/client/src/test/._setup.ts +0 -0
- package/apps/server/._package.json +0 -0
- package/apps/server/._tsconfig.json +0 -0
- package/apps/server/._tsup.config.ts +0 -0
- package/apps/server/._vitest.config.ts +0 -0
- package/apps/server/scripts/._probe.mjs +0 -0
- package/apps/server/scripts/._scenario-lib.mjs +0 -0
- package/apps/server/scripts/._scenario.mjs +0 -0
- package/apps/server/src/._app.ts +0 -0
- package/apps/server/src/._dev.ts +0 -0
- package/apps/server/src/._index.ts +0 -0
- package/apps/server/src/._intent-routes.ts +0 -0
- package/apps/server/src/._pre-tools.ts +0 -0
- package/apps/server/src/actions/._AGENTS.md +0 -0
- package/apps/server/src/cards/._AGENTS.md +0 -0
- package/apps/server/src/cli/._collect-registry.ts +0 -0
- package/apps/server/src/cli/._plugin-doctor.ts +0 -0
- package/apps/server/src/cli/._plugin-inspect.ts +0 -0
- package/apps/server/src/config/._integration.ts +0 -0
- package/apps/server/src/tools/._AGENTS.md +0 -0
- package/apps/server/tests/._agent-prompt.test.ts +0 -0
- package/apps/server/tests/._cards-registry.test.ts +0 -0
- package/apps/server/tests/._deployment-loader.test.ts +0 -0
- package/apps/server/tests/._intent-dispatcher.test.ts +0 -0
- package/apps/server/tests/._tool-runtime.test.ts +0 -0
- package/apps/server/tests/helpers/._register.ts +0 -0
- package/config/._AGENTS.md +0 -0
- package/config/._README.md +0 -0
- package/config/._agent.jsonc +0 -0
- package/config/._chat.json +0 -0
- package/config/._integrations.json +0 -0
- package/config/._llm_provider.json +0 -0
- package/config/._plugins.json +0 -0
- package/docs/agent/._agent-prompt.md +0 -0
- package/docs/agent/._card-action.md +0 -0
- package/docs/agent/._card.md +0 -0
- package/docs/agent/._conversation.md +0 -0
- package/docs/agent/._errors.md +0 -0
- package/docs/agent/._kit.md +0 -0
- package/docs/agent/._shell.md +0 -0
- package/docs/agent/._state.md +0 -0
- package/docs/agent/._style.md +0 -0
- package/docs/agent/._tool-emits-card.md +0 -0
- package/docs/agent/._tool.md +0 -0
- package/docs/agent/._verify.md +0 -0
- package/docs/agent/card.md +1 -1
- package/docs/agent/errors.md +4 -1
- package/docs/agent/kit.md +6 -5
- package/docs/agent/shell.md +34 -3
- package/docs/agent/style.md +3 -3
- package/modules/provider-custom/._AGENTS.md +0 -0
- package/modules/provider-custom/._INTEGRATION.md +0 -0
- package/modules/provider-custom/._LICENSE +0 -0
- package/modules/provider-custom/._README.md +0 -0
- package/modules/provider-custom/._package.json +0 -0
- package/modules/provider-custom/._tbox.module.json +0 -0
- package/modules/provider-custom/._tsconfig.json +0 -0
- package/modules/provider-custom/._tsup.config.ts +0 -0
- package/modules/provider-custom/src/._index.ts +0 -0
- package/modules/provider-custom/src/server/._example-adapter.ts +0 -0
- package/modules/provider-custom/src/server/._index.ts +0 -0
- package/modules/provider-custom/tests/._provider-custom.test.ts +0 -0
- package/package.json +5 -4
- package/packages/agent-ui-kit/._AGENTS.md +0 -0
- package/packages/agent-ui-kit/._LICENSE +0 -0
- package/packages/agent-ui-kit/._README.md +0 -0
- package/packages/agent-ui-kit/._catalog.json +0 -0
- package/packages/agent-ui-kit/._package.json +0 -0
- package/packages/agent-ui-kit/._tsconfig.json +0 -0
- package/packages/agent-ui-kit/._vitest.config.ts +0 -0
- package/packages/agent-ui-kit/assets/._keyboard-circle.svg +0 -0
- package/packages/agent-ui-kit/assets/._more-circle.svg +0 -0
- package/packages/agent-ui-kit/assets/._new-chat.svg +0 -0
- package/packages/agent-ui-kit/assets/._quick-command-star.svg +0 -0
- package/packages/agent-ui-kit/assets/._send-gradient.svg +0 -0
- package/packages/agent-ui-kit/assets/._stop@2x.png +0 -0
- package/packages/agent-ui-kit/assets/._voice-circle.svg +0 -0
- package/packages/agent-ui-kit/catalog.json +20 -5
- package/packages/agent-ui-kit/package.json +1 -1
- package/packages/agent-ui-kit/src/._ChatPage.tsx +0 -0
- package/packages/agent-ui-kit/src/._chat-config.test.ts +0 -0
- package/packages/agent-ui-kit/src/._chat-config.ts +0 -0
- package/packages/agent-ui-kit/src/._contract.test.tsx +0 -0
- package/packages/agent-ui-kit/src/._icons.ts +0 -0
- package/packages/agent-ui-kit/src/._index.ts +0 -0
- package/packages/agent-ui-kit/src/._preview-provider.tsx +0 -0
- package/packages/agent-ui-kit/src/._shell.contract.json +0 -0
- package/packages/agent-ui-kit/src/._shell.test.ts +0 -0
- package/packages/agent-ui-kit/src/._shell.ts +0 -0
- package/packages/agent-ui-kit/src/._store-context.tsx +0 -0
- package/packages/agent-ui-kit/src/._surface.test.tsx +0 -0
- package/packages/agent-ui-kit/src/._surface.tsx +0 -0
- package/packages/agent-ui-kit/src/._types.ts +0 -0
- package/packages/agent-ui-kit/src/._vite-env.d.ts +0 -0
- package/packages/agent-ui-kit/src/ChatPage.tsx +50 -12
- package/packages/agent-ui-kit/src/card/._action-list-pending.test.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._confirm-fields.test.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._define-card.test.ts +0 -0
- package/packages/agent-ui-kit/src/card/._define-card.ts +0 -0
- package/packages/agent-ui-kit/src/card/._primitives.test.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._primitives.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._use-card-actions.ts +0 -0
- package/packages/agent-ui-kit/src/card/._view-card-inline.test.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._view-card.test.tsx +0 -0
- package/packages/agent-ui-kit/src/card/._view-card.tsx +0 -0
- package/packages/agent-ui-kit/src/card/primitives.tsx +38 -17
- package/packages/agent-ui-kit/src/card/view-card.tsx +4 -1
- package/packages/agent-ui-kit/src/chat-config.test.ts +19 -1
- package/packages/agent-ui-kit/src/chat-config.ts +23 -1
- package/packages/agent-ui-kit/src/components/._CardRenderer.tsx +0 -0
- package/packages/agent-ui-kit/src/components/._HistoryList.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ActionBar/._DebugButton.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ActionBar/._DebugButton.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ActionBar/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ActionBar/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/BottomSheet/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/BottomSheet/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/._use-auto-rows.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/._use-auto-rows.ts +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/index.tsx +1 -1
- package/packages/agent-ui-kit/src/components/ChatInput/voice/._VoicePressField.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/voice/._VoiceRecordingOverlay.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/voice/._machine.ts +0 -0
- package/packages/agent-ui-kit/src/components/ChatInput/voice/._useVoicePress.ts +0 -0
- package/packages/agent-ui-kit/src/components/HistoryEntry/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/HistoryEntry/index.tsx +3 -1
- package/packages/agent-ui-kit/src/components/MediaList/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/MessageBubble/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/MessageBubble/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/PullDownIndicator/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/QuickCommands/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/QuickCommands/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/QuickCommands/index.test.tsx +55 -0
- package/packages/agent-ui-kit/src/components/QuickCommands/index.tsx +72 -11
- package/packages/agent-ui-kit/src/components/ReasoningBlock/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ScrollToBottomButton/._index.tsx +0 -0
- package/{.tbox/cache/._packages-shared-strict.tsbuildinfo → packages/agent-ui-kit/src/components/StarterQuestions/._index.test.tsx} +0 -0
- package/packages/agent-ui-kit/src/components/StarterQuestions/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/StarterQuestions/index.test.tsx +115 -0
- package/packages/agent-ui-kit/src/components/StarterQuestions/index.tsx +61 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._detail.test.ts +0 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._detail.ts +0 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._index.test.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._index.tsx +0 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/._titles.ts +0 -0
- package/packages/agent-ui-kit/src/contract.test.tsx +13 -1
- package/packages/agent-ui-kit/src/hooks/._use-drag-gesture.test.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._use-drag-gesture.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._use-pull-down-history.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._use-pull-down-wheel-native.test.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._use-stick-to-bottom.test.tsx +0 -0
- package/packages/agent-ui-kit/src/hooks/._use-stick-to-bottom.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._useMediaUpload.ts +0 -0
- package/packages/agent-ui-kit/src/hooks/._useTTSAutoPlay.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._Overlay.tsx +0 -0
- package/packages/agent-ui-kit/src/overlay/._focus.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._index.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._inert.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._layers.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._overlay.ssr.test.tsx +0 -0
- package/packages/agent-ui-kit/src/overlay/._overlay.test.tsx +0 -0
- package/packages/agent-ui-kit/src/overlay/._presence.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._scroll-lock.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._stack.ts +0 -0
- package/packages/agent-ui-kit/src/overlay/._use-overlay.ts +0 -0
- package/packages/agent-ui-kit/src/shell.contract.json +11 -4
- package/packages/agent-ui-kit/src/shell.test.ts +9 -5
- package/packages/agent-ui-kit/src/test/._setup.ts +0 -0
- package/packages/agent-ui-kit/src/theme/._base.css +0 -0
- package/packages/agent-ui-kit/src/theme/._contract.json +0 -0
- package/packages/agent-ui-kit/src/theme/._motion.css +0 -0
- package/packages/agent-ui-kit/src/theme/._theme-contract.test.ts +0 -0
- package/packages/agent-ui-kit/src/theme/._theme.ts +0 -0
- package/packages/agent-ui-kit/src/theme/._tokens.css +0 -0
- package/packages/agent-ui-kit/src/theme/base.css +10 -5
- package/packages/agent-ui-kit/src/utils/._copyText.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._haptics.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._haptics.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._image-preview-host.tsx +0 -0
- package/packages/agent-ui-kit/src/utils/._imagePreview.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._imagePreview.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._pull-down-machine.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._pull-down-machine.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._session-error.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._toast.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._toast.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._tool-call-display.test.ts +0 -0
- package/packages/agent-ui-kit/src/utils/._tool-call-display.ts +0 -0
- package/packages/contracts-mall/._package.json +0 -0
- package/packages/contracts-mall/._tsconfig.json +0 -0
- package/packages/contracts-mall/src/._index.ts +0 -0
- package/packages/contracts-mall/src/._runtime.ts +0 -0
- package/packages/contracts-mall/src/server/._index.ts +0 -0
- package/packages/shared/._AGENTS.md +0 -0
- package/packages/shared/._package.json +0 -0
- package/packages/shared/._tsconfig.json +0 -0
- package/packages/shared/src/._index.ts +0 -0
- package/pnpm-lock.template.yaml +241 -245
- package/pnpm-workspace.template.yaml +11 -11
- package/profiles/._mall.json +0 -0
- package/profiles/mall/._TEMPLATE.md +0 -0
- package/profiles/mall/._chat.overrides.json +0 -0
- package/profiles/mall/config/._agent.jsonc +0 -0
- package/profiles/mall/config/._chat.json +0 -0
- package/profiles/mall/config/._knowledge.json +0 -0
- package/profiles/mall.json +14 -3
- package/scenarios/._README.md +0 -0
- package/scripts/._assert-pack.mjs +0 -0
- package/scripts/._build.sh +0 -0
- package/scripts/._check-css-target.mjs +0 -0
- package/scripts/._check-fast.mjs +0 -0
- package/scripts/._check-workspace.mjs +0 -0
- package/scripts/._checks.json +0 -0
- package/scripts/._deliver.mjs +0 -0
- package/scripts/._dev-alipay.mjs +0 -0
- package/scripts/._dev.sh +0 -0
- package/scripts/._generate.mjs +0 -0
- package/scripts/._interaction-probe.mjs +0 -0
- package/scripts/._prepare.sh +0 -0
- package/scripts/._shell-probe.mjs +0 -0
- package/scripts/._smoke.mjs +0 -0
- package/scripts/._start.sh +0 -0
- package/scripts/._stop.sh +0 -0
- package/scripts/._storyboard.mjs +0 -0
- package/scripts/._verify-generated.mjs +0 -0
- package/scripts/check-fast.mjs +3 -1
- package/scripts/checks.json +42 -3
- package/scripts/lib/._chrome-pipe.mjs +0 -0
- package/scripts/lib/._geometry-kernel.mjs +0 -0
- package/scripts/shell-probe.mjs +82 -5
- package/scripts/storyboard.mjs +37 -0
- package/.tbox/cache/apps-client-strict.tsbuildinfo +0 -1
- package/.tbox/cache/apps-server-strict.tsbuildinfo +0 -1
- package/.tbox/cache/packages-agent-ui-kit-strict.tsbuildinfo +0 -1
- package/.tbox/cache/packages-shared-strict.tsbuildinfo +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 猜你想问(L0 声明式首页,chat.json starterQuestions;2026-11)。
|
|
3
|
+
*
|
|
4
|
+
* - 仅空会话首屏渲染(ChatPage 按 showWelcome 门控),进入对话随欢迎态自动卸载;
|
|
5
|
+
* - 超过 pageSize 自动出现「换一换」(循环分页,不与快捷指令重复——那是服务入口,这是问题推荐);
|
|
6
|
+
* - 全语义令牌 + 44px 触控行 + 内联 phosphor 图标(icons.ts 白名单),零外链零硬编码色。
|
|
7
|
+
*/
|
|
8
|
+
import { useState } from 'react';
|
|
9
|
+
import { ArrowsClockwise, CaretRight, Sparkle } from '../../icons';
|
|
10
|
+
import { useChatConfigStore } from '../../chat-config';
|
|
11
|
+
|
|
12
|
+
export function StarterQuestions({ onCommand }: { onCommand: (query: string) => void }) {
|
|
13
|
+
const starterQuestions = useChatConfigStore((s) => s.starterQuestions);
|
|
14
|
+
const [page, setPage] = useState(0);
|
|
15
|
+
const items = starterQuestions?.items ?? [];
|
|
16
|
+
if (items.length === 0) return null;
|
|
17
|
+
const pageSizeRaw = starterQuestions?.pageSize;
|
|
18
|
+
const pageSize = Number.isInteger(pageSizeRaw) && pageSizeRaw !== undefined
|
|
19
|
+
? Math.min(6, Math.max(2, pageSizeRaw as number))
|
|
20
|
+
: 3;
|
|
21
|
+
const canRotate = items.length > pageSize;
|
|
22
|
+
const shown = canRotate
|
|
23
|
+
? Array.from({ length: pageSize }, (_, offset) => items[(page * pageSize + offset) % items.length])
|
|
24
|
+
: items;
|
|
25
|
+
const handleRotate = () => {
|
|
26
|
+
setPage((value) => (value + 1) % Math.max(1, Math.ceil(items.length / pageSize)));
|
|
27
|
+
};
|
|
28
|
+
return (
|
|
29
|
+
<section className="chat-page__starter-questions mx-page mt-3 flex flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs">
|
|
30
|
+
<header className="flex items-center justify-between gap-2">
|
|
31
|
+
<span className="flex min-w-0 items-center gap-1.5 truncate text-base font-semibold text-foreground">
|
|
32
|
+
<Sparkle size={16} weight="fill" className="text-primary" />
|
|
33
|
+
{starterQuestions?.title || '猜你想问'}
|
|
34
|
+
</span>
|
|
35
|
+
{canRotate ? (
|
|
36
|
+
<button
|
|
37
|
+
type="button"
|
|
38
|
+
className="flex min-h-11 shrink-0 cursor-pointer items-center gap-1 rounded-full px-3 text-sm font-medium text-primary active:opacity-80"
|
|
39
|
+
onClick={handleRotate}
|
|
40
|
+
>
|
|
41
|
+
<ArrowsClockwise size={16} className="text-primary" aria-hidden="true" />
|
|
42
|
+
<span className="whitespace-nowrap">换一换</span>
|
|
43
|
+
</button>
|
|
44
|
+
) : null}
|
|
45
|
+
</header>
|
|
46
|
+
<div className="flex flex-col gap-1.5">
|
|
47
|
+
{shown.map((item, pageIndex) => (
|
|
48
|
+
<button
|
|
49
|
+
key={item.label + '#' + pageIndex}
|
|
50
|
+
type="button"
|
|
51
|
+
className="flex min-h-11 w-full cursor-pointer items-center justify-between gap-2 rounded-lg px-2 text-left active:bg-muted"
|
|
52
|
+
onClick={() => onCommand(item.query?.trim() ? item.query : item.label)}
|
|
53
|
+
>
|
|
54
|
+
<span className="flex min-w-0 flex-1 items-center gap-2 truncate text-sm text-foreground">{item.label}</span>
|
|
55
|
+
<CaretRight size={16} weight="bold" className="shrink-0 text-muted-foreground" />
|
|
56
|
+
</button>
|
|
57
|
+
))}
|
|
58
|
+
</div>
|
|
59
|
+
</section>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -78,8 +78,20 @@ describe('欢迎区表面(L1)', () => {
|
|
|
78
78
|
expect(cls.title).not.toContain('text-foreground');
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
+
it('实体表面栅格(2026-11):brand/subtle 带 mx-page 屏边距 + mt-3 + py-5 最小垂直内距', () => {
|
|
82
|
+
for (const surface of ['brand', 'subtle'] as const) {
|
|
83
|
+
const cls = welcomeSurfaceClasses(surface);
|
|
84
|
+
expect(cls.container).toContain('mx-page');
|
|
85
|
+
expect(cls.container).toContain('mt-3');
|
|
86
|
+
expect(cls.container).toContain('py-5');
|
|
87
|
+
// 缺 mx-page 时欢迎卡 0px 贴屏边(真实构建 case 实测);不与 pb-4/pt-6 固定段混串。
|
|
88
|
+
expect(cls.container).not.toContain('pb-4');
|
|
89
|
+
expect(cls.container).not.toContain('pt-6');
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
81
93
|
it('default / subtle:不误伤出厂深色文字', () => {
|
|
82
|
-
expect(welcomeSurfaceClasses('default')).toEqual({ container: '', title: 'text-foreground', subtitle: 'text-muted-foreground' });
|
|
94
|
+
expect(welcomeSurfaceClasses('default')).toEqual({ container: 'pb-4 pt-6', title: 'text-foreground', subtitle: 'text-muted-foreground' });
|
|
83
95
|
const subtle = welcomeSurfaceClasses('subtle');
|
|
84
96
|
expect(subtle.container).toContain('bg-card');
|
|
85
97
|
expect(subtle.title).toBe('text-foreground');
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"id": "welcome",
|
|
12
12
|
"area": "welcome",
|
|
13
13
|
"selector": ".chat-page__welcome",
|
|
14
|
-
"drivenBy": ["chat.json welcome.title", "chat.json welcome.subtitle"],
|
|
14
|
+
"drivenBy": ["chat.json welcome.title", "chat.json welcome.subtitle", "chat.json welcome.badge"],
|
|
15
15
|
"brandable": true
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"id": "history-entry",
|
|
26
26
|
"area": "history",
|
|
27
27
|
"selector": ".history-entry",
|
|
28
|
-
"drivenBy": ["chat store historyHasMore / isLoadingHistory"],
|
|
28
|
+
"drivenBy": ["chat store historyHasMore / isLoadingHistory", "常驻 home 槽或 --tbox-compact-chat(紧凑胶囊)"],
|
|
29
29
|
"brandable": false
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"id": "home-slot",
|
|
33
33
|
"area": "home",
|
|
34
34
|
"selector": ".chat-page__home-slot",
|
|
35
|
-
"drivenBy": ["客户端槽 home"],
|
|
35
|
+
"drivenBy": ["客户端槽 home", "HomeSlotMeta(register 第三参数:lifecycle home-only|persistent / gutter inset|bleed / hideBottomQuickCommands)"],
|
|
36
36
|
"brandable": false
|
|
37
37
|
},
|
|
38
38
|
{
|
|
@@ -42,11 +42,18 @@
|
|
|
42
42
|
"drivenBy": ["客户端槽 conversationOverlay"],
|
|
43
43
|
"brandable": false
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
"id": "starter-questions",
|
|
47
|
+
"area": "starter-questions",
|
|
48
|
+
"selector": ".chat-page__starter-questions",
|
|
49
|
+
"drivenBy": ["chat.json starterQuestions.title", "chat.json starterQuestions.pageSize", "chat.json starterQuestions.items[].label/query"],
|
|
50
|
+
"brandable": true
|
|
51
|
+
},
|
|
45
52
|
{
|
|
46
53
|
"id": "quick-commands",
|
|
47
54
|
"area": "quick-commands",
|
|
48
55
|
"selector": ".quick-commands",
|
|
49
|
-
"drivenBy": ["HELLO_ACK chatConfig.quickCommands(缺省回落 chat.json)", "chat.json quickCommands[].icon(图片或 icon:calendar)"],
|
|
56
|
+
"drivenBy": ["HELLO_ACK chatConfig.quickCommands(缺省回落 chat.json)", "chat.json quickCommands[].icon(图片或 icon:calendar)", "常驻 home 槽或 --tbox-compact-chat(底部紧凑胶囊)"],
|
|
50
57
|
"brandable": true
|
|
51
58
|
},
|
|
52
59
|
{
|
|
@@ -21,6 +21,7 @@ const SELECTOR_SOURCES: Record<string, string[]> = {
|
|
|
21
21
|
'.chat-page__body': ['ChatPage.tsx'],
|
|
22
22
|
'.history-entry': ['components/HistoryEntry/index.tsx'],
|
|
23
23
|
'.chat-page__home-slot': ['ChatPage.tsx'],
|
|
24
|
+
'.chat-page__starter-questions': ['components/StarterQuestions/index.tsx'],
|
|
24
25
|
'.chat-page__conversation-overlay': ['ChatPage.tsx'],
|
|
25
26
|
'.quick-commands': ['components/QuickCommands/index.tsx'],
|
|
26
27
|
'.tbox-chat-input': ['components/ChatInput/index.tsx'],
|
|
@@ -102,7 +103,7 @@ describe('壳行为不变式', () => {
|
|
|
102
103
|
});
|
|
103
104
|
|
|
104
105
|
describe('商场对话壳的主题布局', () => {
|
|
105
|
-
it.each([false, true])('
|
|
106
|
+
it.each([false, true])('常驻首页使用紧凑胶囊,紧凑输入框由主题决定(%s)', async (compact) => {
|
|
106
107
|
const rootStyle = document.documentElement.style;
|
|
107
108
|
const previousConfig = useChatConfigStore.getState();
|
|
108
109
|
const container = document.createElement('div');
|
|
@@ -129,11 +130,14 @@ describe('商场对话壳的主题布局', () => {
|
|
|
129
130
|
// 有 home 槽:快捷胶囊固定在输入框上方,不沉到首页正文底部
|
|
130
131
|
expect(container.querySelector('.chat-page__body .quick-commands')).toBeNull();
|
|
131
132
|
expect(container.querySelector('.quick-commands + .tbox-chat-input')).not.toBeNull();
|
|
132
|
-
expect(
|
|
133
|
-
|
|
134
|
-
).toBe(true);
|
|
133
|
+
expect(container.querySelector('.quick-commands--compact')).not.toBeNull();
|
|
134
|
+
expect(container.querySelector<HTMLElement>('.quick-commands__label')?.style.fontSize).toBe('13px');
|
|
135
135
|
expect(container.querySelector('textarea')?.classList.contains('h-6')).toBe(compact);
|
|
136
|
-
|
|
136
|
+
const history = container.querySelector<HTMLButtonElement>('.history-entry__button');
|
|
137
|
+
expect(history?.classList.contains('min-h-11')).toBe(true);
|
|
138
|
+
expect(history?.classList.contains('before:inset-y-[11px]')).toBe(true);
|
|
139
|
+
expect(history?.style.fontSize).toBe('11.5px');
|
|
140
|
+
expect(container.querySelector<HTMLElement>('.tbox-chat-input__disclaimer')?.style.fontSize).toBe('10px');
|
|
137
141
|
} finally {
|
|
138
142
|
await act(async () => root.unmount());
|
|
139
143
|
container.remove();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -150,13 +150,18 @@
|
|
|
150
150
|
(contract.json 是封闭清单,加键即 doctor/主题包门禁报错)。 */
|
|
151
151
|
.chat-page__welcome--brand {
|
|
152
152
|
border-radius: var(--tbox-radius-lg);
|
|
153
|
-
/*
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
/* 全用现有平台变量,不引 color-mix(兼容门禁要求 color-mix 必须带静态回退)。
|
|
154
|
+
文字承载渐变只走 primary-dark → primary 双停(浅字对比度由 shell.contrast 的
|
|
155
|
+
primary-light/primary-dark 对保障);--tbox-accent 降级为右上角低占比径向氛围光晕——
|
|
156
|
+
浅暖金 accent 直接垫在字下(三停 62%→100% 段)时叠 18% 黑罩仍只有 ~3.1:1
|
|
157
|
+
(真实构建实测),角部化之后文字区对比度与 accent 选色解耦。
|
|
158
|
+
min-height 保住最小迎宾块高度(subtitle 缺席时也不塌成细条)。 */
|
|
159
|
+
min-height: 96px;
|
|
156
160
|
background-color: var(--tbox-primary-dark);
|
|
157
161
|
background-image:
|
|
158
|
-
linear-gradient(0deg, rgba(0, 0, 0, 0.
|
|
159
|
-
|
|
162
|
+
linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
|
|
163
|
+
radial-gradient(circle at 92% 18%, var(--tbox-accent) 0%, transparent 48%),
|
|
164
|
+
linear-gradient(142deg, var(--tbox-primary-dark) 0%, var(--tbox-primary) 100%);
|
|
160
165
|
box-shadow: var(--tbox-shadow-md);
|
|
161
166
|
}
|
|
162
167
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|