dsh-tidy-display 0.2.3 → 0.2.4-beta.4

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/lib/client.js CHANGED
@@ -46310,14 +46310,22 @@ ${trimmed}
46310
46310
  }
46311
46311
  .tidychat-nav-tip-head { color: var(--tidychat-nav-tip-head, var(--dsw-alias-label-secondary, #666)) !important; font-size: 11px; margin-bottom: 2px; }
46312
46312
  /* 接管官方消息轨:官方 TurnNavigator 的类名是 CSS Module 产物(hash 随构建变化),
46313
- 双重锚定保证跨 hash 稳定;隐藏而非卸载(宿主 React 会还原被删节点)。 */
46313
+ 双重锚定保证跨 hash 稳定;隐藏而非卸载(宿主 React 会还原被删节点)。
46314
+ 恢复向规则:0.2.0 起宿主自带 @container (width<=900px) { frame: display:none },
46315
+ 接管关闭时若不显式压回,窄容器下官方轨被宿主自藏、用户只见本轨("开关无用"的
46316
+ 根因)。恢复锚定 frame 内的 _marks 子元素(TurnNavigator 模块表语义键,跨 hash
46317
+ 稳定),不会误伤宿主其他被响应式隐藏的组件。 */
46314
46318
  html[data-tidychat-hide-official-nav] [class*="_slot"]:has(> nav[class*="_frame"]),
46315
46319
  html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-natural-position"]) {
46316
46320
  display: none !important;
46317
46321
  }
46322
+ html:not([data-tidychat-hide-official-nav]) nav[class*="_frame"]:has([class*="_marks"]) {
46323
+ display: revert !important;
46324
+ }
46318
46325
  `;
46319
46326
  document.head.appendChild(style);
46320
46327
  }
46328
+ let takeoverOwners = 0;
46321
46329
  const findScrollContainer = () => document.querySelector("[data-conversation-scroll]");
46322
46330
  const scopedRows = (selector) => {
46323
46331
  const container = findScrollContainer();
@@ -46392,12 +46400,20 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
46392
46400
  function RailView({ enabled, side, style: railStyle, ring, hideOfficialNav, hasMore, loadOlder }) {
46393
46401
  ensureRailCss();
46394
46402
  react.useEffect(() => {
46395
- if (hideOfficialNav) document.documentElement.setAttribute("data-tidychat-hide-official-nav", "");
46396
- else document.documentElement.removeAttribute("data-tidychat-hide-official-nav");
46403
+ const owned = enabled && hideOfficialNav;
46404
+ if (owned) {
46405
+ takeoverOwners += 1;
46406
+ document.documentElement.setAttribute("data-tidychat-hide-official-nav", "");
46407
+ }
46397
46408
  return () => {
46398
- document.documentElement.removeAttribute("data-tidychat-hide-official-nav");
46409
+ if (!owned) return;
46410
+ takeoverOwners -= 1;
46411
+ if (takeoverOwners <= 0) {
46412
+ takeoverOwners = 0;
46413
+ document.documentElement.removeAttribute("data-tidychat-hide-official-nav");
46414
+ }
46399
46415
  };
46400
- }, [hideOfficialNav]);
46416
+ }, [enabled, hideOfficialNav]);
46401
46417
  const [pos, setPos] = react.useState(null);
46402
46418
  const [tip, setTip] = react.useState(null);
46403
46419
  const [hover, setHover] = react.useState(null);
@@ -49006,7 +49022,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49006
49022
  foldStandard: "On",
49007
49023
  foldSummary: "Summary",
49008
49024
  railTitle: "Message rail",
49009
- railDescription: "On by default: a canvas navigation rail at the conversation edge — fish-eye hover with summaries, click to jump, current-turn highlight.",
49025
+ railDescription: "On by default: a canvas navigation rail at the conversation edge — fish-eye hover with summaries, click to jump, current-turn highlight. Off: no rail in the reading view; the conversation view returns to the official rail.",
49010
49026
  railSide: "Rail position",
49011
49027
  railSideLeft: "Left edge",
49012
49028
  railSideRight: "Right edge (mirrored)",
@@ -49016,7 +49032,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49016
49032
  railRingTitle: "Rail sheen",
49017
49033
  railRingDescription: "On by default (matches the store default): a soft white sheen laid beneath the current and hovered marks, keeping them readable over busy wallpapers.",
49018
49034
  takeoverTitle: "Take over the official rail",
49019
- takeoverDescription: "On by default: the official right-edge TurnNavigator is hidden (hidden, not unmounted) so this rail is the only one. Turn off to see both.",
49035
+ takeoverDescription: "On by default: in the conversation view this rail replaces the official right-edge TurnNavigator (hidden, not unmounted). Turn off to hand the conversation view back to the official rail — this rail yields there. The reading view always uses this rail. At narrow widths the harness auto-hides the official rail; this switch restores it when off.",
49020
49036
  colorBarTitle: "Mark color",
49021
49037
  colorAccentTitle: "Accent color",
49022
49038
  colorAuto: "Auto",
@@ -49045,7 +49061,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49045
49061
  foldStandard: "开启",
49046
49062
  foldSummary: "摘要",
49047
49063
  railTitle: "消息轨",
49048
- railDescription: "默认开启:会话区边缘的 canvas 导航轨——鱼眼悬停看摘要、点击跳转、当前轮高亮。",
49064
+ railDescription: "默认开启:会话区边缘的 canvas 导航轨——鱼眼悬停看摘要、点击跳转、当前轮高亮。关闭后:阅读视图无轨,对话视图回到官方轨。",
49049
49065
  railSide: "显示位置",
49050
49066
  railSideLeft: "左缘",
49051
49067
  railSideRight: "右缘(镜像)",
@@ -49055,7 +49071,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49055
49071
  railRingTitle: "外圈柔光",
49056
49072
  railRingDescription: "默认开启:在当前轮与悬停轮的标记底下垫一层白色柔光,复杂壁纸上也能看清标记。",
49057
49073
  takeoverTitle: "接管官方消息轨",
49058
- takeoverDescription: "默认开启:隐藏官方右缘 TurnNavigator(隐藏而非卸载),只保留本轨。关闭后两条轨并存。",
49074
+ takeoverDescription: "默认开启:对话视图由本轨替换官方右缘 TurnNavigator(隐藏而非卸载)。关闭后对话视图交还官方轨,本轨在对话视图让位;阅读视图始终用本轨。窄宽度下宿主会自藏官方轨,关闭本开关时会一并恢复。",
49059
49075
  colorBarTitle: "标记色",
49060
49076
  colorAccentTitle: "强调色",
49061
49077
  colorAuto: "自动",
@@ -49084,7 +49100,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49084
49100
  foldStandard: "Activé",
49085
49101
  foldSummary: "Résumé",
49086
49102
  railTitle: "Rail des messages",
49087
- railDescription: "Activé par défaut : un rail de navigation en canvas au bord de la conversation — survol fisheye avec résumés, clic pour rejoindre un tour, tour active mis en évidence.",
49103
+ railDescription: "Activé par défaut : un rail de navigation en canvas au bord de la conversation — survol fisheye avec résumés, clic pour rejoindre un tour, tour active mis en évidence. Désactivé : pas de rail en vue lecture ; la vue conversation revient au rail officiel.",
49088
49104
  railSide: "Position du rail",
49089
49105
  railSideLeft: "Bord gauche",
49090
49106
  railSideRight: "Bord droit (en miroir)",
@@ -49094,7 +49110,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49094
49110
  railRingTitle: "Halo du rail",
49095
49111
  railRingDescription: "Activé par défaut (conforme au réglage d’origine) : un doux halo blanc posé sous les repères actifs et survolés, pour rester lisibles sur les fonds d’écran chargés.",
49096
49112
  takeoverTitle: "Remplacer le rail officiel",
49097
- takeoverDescription: "Activé par défaut : le TurnNavigator officiel du bord droit est masqué (masqué, pas démonté) pour que ce rail reste le seul. Désactivez pour voir les deux.",
49113
+ takeoverDescription: "Activé par défaut : dans la vue de conversation, ce rail remplace le TurnNavigator officiel du bord droit (masqué, pas démonté). Désactivez pour rendre la vue de conversation au rail officiel — ce rail s’y efface. La vue de lecture utilise toujours ce rail. Aux petites largeurs le harnais masque le rail officiel de lui-même ; ce commutateur le restaure quand il est désactivé.",
49098
49114
  colorBarTitle: "Couleur des repères",
49099
49115
  colorAccentTitle: "Couleur d’accent",
49100
49116
  colorAuto: "Auto",
@@ -49123,7 +49139,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49123
49139
  foldStandard: "Ein",
49124
49140
  foldSummary: "Zusammenfassung",
49125
49141
  railTitle: "Nachrichtenleiste",
49126
- railDescription: "Standardmäßig ein: eine Navigationsleiste aus Canvas am Rand des Gesprächs — Fischaugen-Hover mit Zusammenfassungen, Klick zum Springen, Hervorhebung des aktuellen Durchgangs.",
49142
+ railDescription: "Standardmäßig ein: eine Navigationsleiste aus Canvas am Rand des Gesprächs — Fischaugen-Hover mit Zusammenfassungen, Klick zum Springen, Hervorhebung des aktuellen Durchgangs. Aus: keine Leiste in der Leseansicht; die Konversationsansicht kehrt zur offiziellen Leiste zurück.",
49127
49143
  railSide: "Position der Leiste",
49128
49144
  railSideLeft: "Linker Rand",
49129
49145
  railSideRight: "Rechter Rand (gespiegelt)",
@@ -49133,7 +49149,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49133
49149
  railRingTitle: "Sanfter Schimmer",
49134
49150
  railRingDescription: "Standardmäßig ein (entspricht dem Store-Standard): ein weicher weißer Schimmer unter der aktuellen und der überfahrenen Marke, damit beide vor bunten Hintergründen lesbar bleiben.",
49135
49151
  takeoverTitle: "Offizielle Leiste übernehmen",
49136
- takeoverDescription: "Standardmäßig ein: Der offizielle TurnNavigator am rechten Rand wird ausgeblendet (verborgen, nicht entfernt), damit nur diese Leiste übrig bleibt. Ausschalten, um beide zu sehen.",
49152
+ takeoverDescription: "Standardmäßig ein: In der Konversationsansicht ersetzt diese Leiste den offiziellen TurnNavigator am rechten Rand (verborgen, nicht entfernt). Ausschalten, um die Konversationsansicht an die offizielle Leiste zurückzugeben — diese Leiste weicht dort. Die Leseansicht nutzt immer diese Leiste. Bei schmalen Breiten verbirgt der Host die offizielle Leiste selbst; dieser Schalter stellt sie bei ausgeschaltetem Zustand wieder her.",
49137
49153
  colorBarTitle: "Markierungsfarbe",
49138
49154
  colorAccentTitle: "Akzentfarbe",
49139
49155
  colorAuto: "Auto",
@@ -49162,7 +49178,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49162
49178
  foldStandard: "On",
49163
49179
  foldSummary: "Riepilogo",
49164
49180
  railTitle: "Barra dei messaggi",
49165
- railDescription: "Attivo per impostazione predefinita: una barra di navigazione in canvas al bordo della conversazione — hover fisheye con riepiloghi, clic per saltare, turno corrente evidenziato.",
49181
+ railDescription: "Attivo per impostazione predefinita: una barra di navigazione in canvas al bordo della conversazione — hover fisheye con riepiloghi, clic per saltare, turno corrente evidenziato. Spenta: nessuna barra nella vista di lettura; la vista conversazione torna alla barra ufficiale.",
49166
49182
  railSide: "Posizione della barra",
49167
49183
  railSideLeft: "Bordo sinistro",
49168
49184
  railSideRight: "Bordo destro (specchiato)",
@@ -49172,7 +49188,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49172
49188
  railRingTitle: "Alone della barra",
49173
49189
  railRingDescription: "Attivo per impostazione predefinita (come il valore di origine): un delicato alone bianco sotto i segni correnti e puntati, per tenerli leggibili su sfondi molto carichi.",
49174
49190
  takeoverTitle: "Sostituisci la barra ufficiale",
49175
- takeoverDescription: "Attivo per impostazione predefinita: il TurnNavigator ufficiale sul bordo destro viene nascosto (nascosto, non smontato) così questa barra resta l’unica. Disattiva per vederle entrambe.",
49191
+ takeoverDescription: "Attivo per impostazione predefinita: nella vista conversazione questa barra sostituisce il TurnNavigator ufficiale sul bordo destro (nascosto, non smontato). Disattiva per restituire la vista conversazione alla barra ufficiale — questa barra cede lì. La vista di lettura usa sempre questa barra. Alle larghezze ridotte l’host nasconde da solo la barra ufficiale; questo interruttore la ripristina quando è disattivato.",
49176
49192
  colorBarTitle: "Colore dei segni",
49177
49193
  colorAccentTitle: "Colore d’accento",
49178
49194
  colorAuto: "Auto",
@@ -49201,7 +49217,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49201
49217
  foldStandard: "Вкл.",
49202
49218
  foldSummary: "Сводка",
49203
49219
  railTitle: "Дорожка сообщений",
49204
- railDescription: "По умолчанию включено: навигационная дорожка на canvas у края беседы — «рыбий глаз» при наведении со сводками, переход по клику, подсветка текущего хода.",
49220
+ railDescription: "По умолчанию включено: навигационная дорожка на canvas у края беседы — «рыбий глаз» при наведении со сводками, переход по клику, подсветка текущего хода. Выключено: в режиме чтения дорожек нет; режим беседы возвращается к штатной дорожке.",
49205
49221
  railSide: "Положение дорожки",
49206
49222
  railSideLeft: "Левый край",
49207
49223
  railSideRight: "Правый край (зеркально)",
@@ -49211,7 +49227,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49211
49227
  railRingTitle: "Ореол дорожки",
49212
49228
  railRingDescription: "По умолчанию включено (совпадает с исходным значением): мягкий белый ореол под текущей и подсвеченной отметками, чтобы их было видно на пёстрых обоях.",
49213
49229
  takeoverTitle: "Заменить штатную дорожку",
49214
- takeoverDescription: "По умолчанию включено: штатный TurnNavigator у правого края скрывается (именно скрывается, а не удаляется), чтобы осталась только эта дорожка. Выключите, чтобы видеть обе.",
49230
+ takeoverDescription: "По умолчанию включено: в режиме беседы эта дорожка заменяет штатный TurnNavigator у правого края (скрывается, а не удаляется). Выключите, чтобы вернуть режим беседы штатной дорожке — эта дорожка там уступает. Режим чтения всегда использует эту дорожку. На узкой ширине хост скрывает штатную дорожку сам; этот переключатель возвращает её, когда выключен.",
49215
49231
  colorBarTitle: "Цвет отметок",
49216
49232
  colorAccentTitle: "Акцентный цвет",
49217
49233
  colorAuto: "Авто",
@@ -49240,7 +49256,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49240
49256
  foldStandard: "Sí",
49241
49257
  foldSummary: "Resumen",
49242
49258
  railTitle: "Raíl de mensajes",
49243
- railDescription: "Activado por defecto: un raíl de navegación en canvas al borde de la conversación — hover ojo de pez con resúmenes, clic para saltar, turno actual resaltado.",
49259
+ railDescription: "Activado por defecto: un raíl de navegación en canvas al borde de la conversación — hover ojo de pez con resúmenes, clic para saltar, turno actual resaltado. Apagado: sin raíl en la vista de lectura; la vista de conversación vuelve al raíl oficial.",
49244
49260
  railSide: "Posición del raíl",
49245
49261
  railSideLeft: "Borde izquierdo",
49246
49262
  railSideRight: "Borde derecho (en espejo)",
@@ -49250,7 +49266,7 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
49250
49266
  railRingTitle: "Brillo del raíl",
49251
49267
  railRingDescription: "Activado por defecto (coincide con el valor de fábrica): un suave brillo blanco bajo las marcas actual y apuntada, para que sigan legibles sobre fondos con muchos detalles.",
49252
49268
  takeoverTitle: "Reemplazar el raíl oficial",
49253
- takeoverDescription: "Activado por defecto: el TurnNavigator oficial del borde derecho se oculta (oculto, no desmontado) para que este raíl sea el único. Desactívalo para ver ambos.",
49269
+ takeoverDescription: "Activado por defecto: en la vista de conversación este raíl sustituye al TurnNavigator oficial del borde derecho (oculto, no desmontado). Desactívalo para devolver la vista de conversación al raíl oficial — este raíl cede allí. La vista de lectura siempre usa este raíl. En anchos reducidos el anfitrión oculta el raíl oficial por sí mismo; este interruptor lo restaura cuando está apagado.",
49254
49270
  colorBarTitle: "Color de las marcas",
49255
49271
  colorAccentTitle: "Color de acento",
49256
49272
  colorAuto: "Auto",
@@ -50382,12 +50398,13 @@ html[data-tidychat-hide-official-nav] nav[class*="_frame"]:has([style*="--turn-n
50382
50398
  const snap = react.useSyncExternalStore(prefs.subscribe, () => prefs.getSnapshot());
50383
50399
  const loadEarlierPattern = /^(加载更早|Load earlier|Load older)/;
50384
50400
  const hasMore = [...document.querySelectorAll("button")].some((b) => loadEarlierPattern.test((b.textContent || "").trim()));
50401
+ const takeover = snap.hideOfficialNav !== false;
50385
50402
  return react.createElement(RailView, {
50386
- enabled: snap.railEnabled !== false,
50403
+ enabled: snap.railEnabled !== false && takeover,
50387
50404
  side: snap.railSide === "right" ? "right" : "left",
50388
50405
  style: snap.railStyle === "dot" ? "dot" : "bar",
50389
50406
  ring: snap.railRing === true,
50390
- hideOfficialNav: snap.hideOfficialNav !== false,
50407
+ hideOfficialNav: takeover,
50391
50408
  hasMore,
50392
50409
  loadOlder: () => {
50393
50410
  [...document.querySelectorAll("button")].find((b) => loadEarlierPattern.test((b.textContent || "").trim()))?.click();