fix(widgets): restore single-card reference UI for search and quote widgets

The 搜索框 and 一言 sidebar widgets fell into the generic renderer branch, so
they rendered a .jio-panel card wrapping a second bespoke card
(.jio-widget-search / .jio-widget-quote). In-article 一言 also used
divergent modifier classes and an extra hover rule.

- search: render through the shared jio_get_search_box() (legacy keyword,
  history and category pickers) inside one reference card, mirroring the
  reference widget's markup and title default 「搜索」
- quote: render the reference .yiyan-box card itself as the click root; the
  shell now emits only the reference widget-container/title wrapper
- article 一言: adopt the reference class lists for header, footer and the
  standalone after-article box; drop the invented yiyan--* modifiers and
  the duplicate hover/opacity rules
- client: fill .cn/.en in the reference order (first line .cn, second .en)
  and drop the stale window.JioYiyan bridge plus the dead qv-yiyan.php AJAX
  path in runtime main.js
- schema: replace the ad-hoc search_style radio with the reference switches
  (keywords, history, input category, more_cats) and default title
- assets: enqueue assets/js/yiyan.js through the quote widget's asset list

Tests: widget-system suite 820/821 (the one failure is the pre-existing
frontend-lifecycle theme-init stub); new search/quote card contracts pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-03 15:56:52 +08:00
1 parent 1549d5b25d
commit f80ca1e27d
19 files changed
+276 -182

No files matched your search

+2 -11
View File
@@ -43,17 +43,8 @@
.jio-widget--affix { position: sticky; top: 76px; }
.jio-widget--only-mobile { display: none; }
.jio-widget-search { display: flex; min-height: 42px; padding: 4px; border: 1px solid var(--main-border-color,rgba(127,127,127,.18)); border-radius: var(--main-radius,8px); background: var(--main-bg-color, #fff); }
.jio-widget-search label { flex: 1; display: flex; }
.jio-widget-search input { width: 100%; padding: 8px 12px; border: 0; outline: 0; background: transparent; color: inherit; }
.jio-widget-search button { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border: 0; border-radius: var(--mini-radius,4px); background: var(--focus-color, #ff5473); color: #fff; cursor: pointer; }
.jio-widget-search--compact button span { display: none; }
.jio-widget-search--large { min-height: 58px; border-radius: 14px; }
.jio-widget-quote { margin: 0; padding: 12px 15px; border-radius: var(--jio-widget-radius); background: var(--main-bg-color, #fff); color: var(--main-color, inherit); box-shadow: 0 0 10px var(--main-shadow, rgba(116,116,116,.08)); }
.jio-widget-quote .yiyan { line-height: 1.8; }
.jio-widget-quote .yiyan .en { font-size: .9em; opacity: .8; }
.jio-widget-quote.is-loading { opacity: .65; }
/* 搜索框与一言复用 main.css 中的参考卡片(.search-input / .yiyan-box),
* 这里不再重复定义表面样式,避免与卡片叠加。 */
/* The Jio base stylesheet already carries the icon-card and utility rules.
* Restore the one renamed primitive used verbatim by these two widget renderers. */