dsh-thinking-levels 4.1.0-beta.2 → 4.1.0-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/CHANGELOG.ja.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  ## [Unreleased]
15
15
 
16
- ### 追加 — 思考レベルスライダー(鲸魚娘ランナーつまみ) — 4.1.0-beta.2
16
+ ### 追加 — 思考レベルスライダー(鲸魚娘ランナーつまみ) — 4.1.0-beta.4
17
17
 
18
18
  - 各行の思考レベル `<select>` をセグメントスライダーに改修:ストップ数はモデルの広告
19
19
  レベルに追従、`auto` は常に最左、つまみはポインターに連続追従・リリースでスナップ、
package/CHANGELOG.ko.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  ## [Unreleased]
15
15
 
16
- ### 추가 — 사고 레벨 슬라이더(고래소녀 러너 썸) — 4.1.0-beta.2
16
+ ### 추가 — 사고 레벨 슬라이더(고래소녀 러너 썸) — 4.1.0-beta.4
17
17
 
18
18
  - 각 행의 사고 레벨 `<select>`를 세그먼트 슬라이더로 개편: 스톱 수는 모델이 광고하는
19
19
  레벨에 적응, `auto`는 항상 최좌측, 썸은 포인터 연속 추적 후 놓을 때 스냅,
package/CHANGELOG.md CHANGED
@@ -13,7 +13,7 @@ All notable changes to `dsh-thinking-levels` are documented here.
13
13
 
14
14
  ## [Unreleased]
15
15
 
16
- ### Added — effort slider (whale-girl runner thumb) — 4.1.0-beta.2
16
+ ### Added — effort slider (whale-girl runner thumb) — 4.1.0-beta.4
17
17
 
18
18
  - **The model panel's per-line effort `<select>` became a segment slider.** Click a line's
19
19
  effort chip and a full-width slider expands under that line: the stop count adapts to the
package/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-thinking-levels",
3
- "version": "4.1.0-beta.2",
3
+ "version": "4.1.0-beta.4",
4
4
  "main": "./lib/index.js",
5
5
  "description": "thinking-level (reasoning_effort) control — auto-adjust per tool round, with optional manual lock and per-tool timing telemetry.",
6
6
  "engines": {
package/lib/client.js CHANGED
@@ -793,34 +793,44 @@ window.__ModuleLoader__.load({
793
793
  * Segment slider for one model line's reasoning effort (the 改造 of the retired
794
794
  * per-line `<select>`).
795
795
  *
796
- * Visual baseline follows the approved dsh-reasoning-effort visual spec where
797
- * it applies: the thumb follows the pointer CONTINUOUSLY and snaps to a stop on
798
- * release (one `directory.select` per gesture), the plain thumb is pure white in
799
- * every theme, the full character stays visible at both track endpoints, and
800
- * reduced-motion freezes the run cycle. Deviations requested for this plugin:
801
- * the stop count adapts to the model's advertised efforts (not a fixed triple),
796
+ * Interaction follows the approved dsh-reasoning-effort visual spec: the thumb
797
+ * follows the pointer CONTINUOUSLY and snaps to a stop on release (one
798
+ * `directory.select` per gesture), the plain thumb is pure white in every
799
+ * theme, the full thumb stays visible at both track endpoints, and
800
+ * reduced-motion freezes motion. Deviations requested for this plugin: the
801
+ * stop count adapts to the model's advertised efforts (not a fixed triple),
802
802
  * `auto` is pinned leftmost (see `orderEffortsForSlider`), and the whale-girl
803
803
  * runner thumb is per-line — DeepSeek lines run the 8-frame strip, every other
804
804
  * model gets the plain knob.
805
805
  *
806
- * Inline styling only (no CSS modules in the client bundle) — the one thing
807
- * inline styles cannot express, the `@keyframes` of the run cycle plus its
808
- * reduced-motion freeze, is injected once into `document.head` under a
809
- * plugin-prefixed id. All math is defensive: a render throw here would abdicate
810
- * the whole model-seat takeover back to the shipped selector.
806
+ * The track carries the reference plugin's signature FX, ported from its
807
+ * published bundle: a procedural canvas "radiation" (three sine waves with a
808
+ * sharp crest, exponential trail decay from the thumb, a 4px pixel grid with
809
+ * grain, 14 particle streaks flying left, and a radial glow at the thumb — all
810
+ * clipped LEFT of the thumb, screen-blended over the track, pixelated), a CSS
811
+ * flare at the thumb, theme-split tracks via `body[data-ds-dark-theme]`, a
812
+ * light-theme progress fill, and a `[data-top]` breathe pulse. Dragging speeds
813
+ * and brightens everything. The canvas runs a rAF loop unless
814
+ * `prefers-reduced-motion` is set (then single frames on change).
815
+ *
816
+ * Inline styling only (no CSS modules in the client bundle) — everything a
817
+ * stylesheet needs (pseudo-elements, keyframes, theme selectors, blend modes)
818
+ * is injected once into `document.head` under a plugin-prefixed id. All math
819
+ * is defensive: a render throw here would abdicate the whole model-seat entry
820
+ * back to the shipped selector.
811
821
  */
812
822
  /** Editor-row zone height: label row + track + headroom for the standing girl. */
813
- const ZONE_H = 78;
814
- /** Track thickness; sits `TRACK_B` px above the zone bottom. */
823
+ const ZONE_H = 70;
824
+ /** Track thickness; sits `TRACK_B` px above the zone bottom (above the 14px label row). */
815
825
  const TRACK_H = 16;
816
- const TRACK_B = 20;
826
+ const TRACK_B = 16;
817
827
  /** Horizontal inset keeping the thumb fully visible at both endpoint stops. */
818
828
  const PAD_MASCOT = 18;
819
829
  const PAD_KNOB = 14;
820
830
  /** Thumb metrics. */
821
831
  const GIRL_W = WHALE_RUN_STRIP.frameW / 2;
822
832
  const GIRL_H = WHALE_RUN_STRIP.frameH / 2;
823
- const GIRL_B = 25;
833
+ const GIRL_B = 21;
824
834
  const KNOB = 28;
825
835
  /** Label row height under the track. */
826
836
  const LABEL_H = 14;
@@ -828,42 +838,252 @@ window.__ModuleLoader__.load({
828
838
  const STRIP_CSS_W = WHALE_RUN_STRIP.frameW * WHALE_RUN_STRIP.frames / 2;
829
839
  const STRIP_CSS_H = WHALE_RUN_STRIP.frameH / 2;
830
840
  const KEYFRAMES_ID = "dsh-thinking-levels-effort-slider";
831
- const ZONE_CLASS = "dsh-tl-effort-zone";
832
- const RUN_CLASS = "dsh-tl-whale-run";
841
+ const ZONE_CLASS = "dsh-tl-zone";
842
+ const RUN_CLASS = "dsh-tl-run";
843
+ const GIRL_CLASS = "dsh-tl-girl";
844
+ const KNOB_CLASS = "dsh-tl-knob";
845
+ const TRACK_CLASS = "dsh-tl-track";
846
+ const FILL_CLASS = "dsh-tl-fill";
847
+ const CANVAS_CLASS = "dsh-tl-canvas";
848
+ const FLARE_CLASS = "dsh-tl-flare";
833
849
  const RUN_KEYFRAMES = "dsh-tl-whale-run-keyframes";
834
- let styleInjected = false;
835
850
  /**
836
- * Inject the run-cycle keyframes + reduced-motion freeze once per document.
837
- * The dragging speed overrides the class shorthand via inline
838
- * `animationDuration` (inline wins over the stylesheet).
851
+ * The effect stylesheet: radiation track themes (dark violet gradient vs pale
852
+ * blue + progress fill), the screen-blended pixelated canvas, the flare with
853
+ * its cross streaks, dragging boosts, the `[data-top]` breathe pulses, the
854
+ * girl's run cycle with drop-shadow glow, and the reduced-motion freezes.
839
855
  */
840
- function ensureRunStyle() {
841
- if (styleInjected || document.getElementById(KEYFRAMES_ID) !== null) {
842
- styleInjected = true;
843
- return;
844
- }
845
- const style = document.createElement("style");
846
- style.id = KEYFRAMES_ID;
847
- style.textContent = `
856
+ const EFFECT_CSS = `
848
857
  .${ZONE_CLASS}:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }
858
+ .${TRACK_CLASS} {
859
+ border-radius: 999px;
860
+ overflow: hidden;
861
+ isolation: isolate;
862
+ background: linear-gradient(100deg, #03040a 0%, #071126 22%, #101d4c 45%, #302262 70%, #5d35a0 100%);
863
+ box-shadow:
864
+ inset 0 1px 0 rgba(189, 199, 255, .15),
865
+ inset 0 -1px 0 rgba(0, 0, 0, .55),
866
+ 0 3px 10px rgba(12, 17, 55, .34);
867
+ }
868
+ .${TRACK_CLASS}::after {
869
+ content: "";
870
+ position: absolute;
871
+ inset: 0;
872
+ pointer-events: none;
873
+ background:
874
+ radial-gradient(circle at 18% 45%, rgba(82, 130, 255, .12), transparent 24%),
875
+ linear-gradient(90deg, rgba(0, 0, 0, .28), transparent 42%, rgba(168, 113, 255, .12));
876
+ }
877
+ body:not([data-ds-dark-theme]) .${TRACK_CLASS} {
878
+ background: var(--dsw-static-blue-75, #e5f0ff);
879
+ box-shadow:
880
+ inset 0 1px 0 rgba(255, 255, 255, .9),
881
+ inset 0 0 0 1px rgba(80, 133, 194, .14),
882
+ 0 3px 10px rgba(48, 101, 165, .13);
883
+ }
884
+ .${FILL_CLASS} {
885
+ position: absolute;
886
+ top: 0;
887
+ bottom: 0;
888
+ left: 0;
889
+ width: var(--dsh-tl-progress, 0%);
890
+ border-radius: inherit;
891
+ background: linear-gradient(90deg, #ffffff 0%, #d7eaff 18%, #75afea 54%, #0751ad 100%);
892
+ transition: width 190ms cubic-bezier(.22, 1, .36, 1);
893
+ display: none;
894
+ }
895
+ body:not([data-ds-dark-theme]) .${FILL_CLASS} { display: block; }
896
+ .${CANVAS_CLASS} {
897
+ position: absolute;
898
+ inset: 0;
899
+ width: 100%;
900
+ height: 100%;
901
+ image-rendering: pixelated;
902
+ mix-blend-mode: screen;
903
+ pointer-events: none;
904
+ transition: filter 140ms ease;
905
+ }
906
+ .${FLARE_CLASS} {
907
+ position: absolute;
908
+ top: 50%;
909
+ width: 78px;
910
+ height: 46px;
911
+ border-radius: 50%;
912
+ background: radial-gradient(ellipse at 100% 50%, rgba(255,255,255,.96) 0 4%, rgba(188,189,255,.8) 11%, rgba(106,87,255,.5) 28%, rgba(105,31,255,.2) 49%, transparent 74%);
913
+ filter: blur(2px) saturate(1.25);
914
+ mix-blend-mode: screen;
915
+ transform: translate(-100%, -50%);
916
+ transition: left 70ms linear, filter 140ms ease;
917
+ pointer-events: none;
918
+ }
919
+ .${FLARE_CLASS}::before,
920
+ .${FLARE_CLASS}::after {
921
+ content: "";
922
+ position: absolute;
923
+ inset: 50% auto auto 100%;
924
+ border-radius: 999px;
925
+ transform: translate(-50%, -50%);
926
+ }
927
+ .${FLARE_CLASS}::before {
928
+ width: 52px;
929
+ height: 1px;
930
+ background: linear-gradient(90deg, transparent, rgba(100,160,255,.42), #f1ecff, rgba(193,82,255,.65), transparent);
931
+ box-shadow: 0 0 7px #9b7cff, 0 0 13px rgba(72,132,255,.64);
932
+ }
933
+ .${FLARE_CLASS}::after {
934
+ width: 1px;
935
+ height: 20px;
936
+ background: linear-gradient(180deg, transparent, rgba(196,190,255,.84), transparent);
937
+ box-shadow: 0 0 7px #9c7cff;
938
+ }
939
+ .${ZONE_CLASS}[data-drag="1"] .${CANVAS_CLASS} { filter: saturate(1.45) brightness(1.28) contrast(1.06); }
940
+ .${ZONE_CLASS}[data-drag="1"] .${FLARE_CLASS} { filter: blur(1.5px) saturate(1.6) brightness(1.42); transition: none; }
941
+ .${KNOB_CLASS} {
942
+ border-radius: 50%;
943
+ background: #fff;
944
+ border: 1px solid rgba(255, 255, 255, .94);
945
+ box-shadow:
946
+ 0 0 0 2px rgba(92, 105, 255, .12),
947
+ 0 0 14px rgba(121, 82, 255, .48),
948
+ 0 2px 7px rgba(0, 0, 0, .3);
949
+ transition: left 190ms cubic-bezier(.22, 1, .36, 1), transform 160ms ease, box-shadow 180ms ease;
950
+ }
951
+ .${ZONE_CLASS}[data-drag="1"] .${KNOB_CLASS} {
952
+ transform: translateX(-50%) scale(1.07);
953
+ transition: none;
954
+ box-shadow:
955
+ 0 0 0 3px rgba(113, 115, 255, .25),
956
+ 0 0 20px rgba(74, 145, 255, .86),
957
+ 0 0 31px rgba(171, 53, 255, .66),
958
+ 0 3px 8px rgba(0, 0, 0, .32);
959
+ }
960
+ .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { animation: dsh-tl-dark-breathe 1.9s ease-in-out infinite; }
961
+ @keyframes dsh-tl-dark-breathe {
962
+ 0%, 100% { box-shadow: inset 0 1px 0 rgba(196,204,255,.16), 0 3px 10px rgba(18,25,72,.4); }
963
+ 50% { box-shadow: inset 0 1px 0 rgba(220,214,255,.24), 0 0 21px rgba(111,66,255,.5); }
964
+ }
965
+ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { animation-name: dsh-tl-light-breathe; }
966
+ @keyframes dsh-tl-light-breathe {
967
+ 0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 0 0 1px rgba(67,124,193,.16), 0 3px 10px rgba(48,101,165,.13); }
968
+ 50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(67,124,193,.22), 0 3px 10px rgba(31,102,190,.22), 0 0 19px rgba(31,105,201,.24); }
969
+ }
849
970
  .${RUN_CLASS} { animation: ${RUN_KEYFRAMES} 0.72s steps(8, end) infinite alternate; }
850
971
  @keyframes ${RUN_KEYFRAMES} {
851
972
  from { background-position-x: 0; }
852
973
  to { background-position-x: -${STRIP_CSS_W}px; }
853
974
  }
975
+ .${GIRL_CLASS} {
976
+ filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .28)) drop-shadow(0 0 5px rgba(92, 105, 255, .34));
977
+ transform-origin: 50% 68%;
978
+ transition: left 190ms cubic-bezier(.22, 1, .36, 1);
979
+ }
980
+ .${ZONE_CLASS}[data-drag="1"] .${GIRL_CLASS} {
981
+ animation-duration: 0.42s;
982
+ transition: none;
983
+ filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .28)) drop-shadow(0 0 8px rgba(87, 137, 255, .68));
984
+ }
854
985
  @media (prefers-reduced-motion: reduce) {
986
+ .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { animation: none; }
855
987
  .${RUN_CLASS} { animation: none; }
988
+ .${FLARE_CLASS}, .${FILL_CLASS}, .${KNOB_CLASS} { transition: none; }
856
989
  }
857
990
  `;
991
+ let styleInjected = false;
992
+ /** Inject the effect stylesheet once per document. */
993
+ function ensureEffectStyle() {
994
+ if (styleInjected || document.getElementById(KEYFRAMES_ID) !== null) {
995
+ styleInjected = true;
996
+ return;
997
+ }
998
+ const style = document.createElement("style");
999
+ style.id = KEYFRAMES_ID;
1000
+ style.textContent = EFFECT_CSS;
858
1001
  document.head.appendChild(style);
859
1002
  styleInjected = true;
860
1003
  }
861
1004
  const clamp01 = (value) => Math.min(1, Math.max(0, value));
1005
+ /**
1006
+ * Draw one frame of the track FX: sine-wave columns with a sharp crest and an
1007
+ * exponential trail decaying from the thumb, a 4px pixel grid with grain and a
1008
+ * radial halo around the thumb, particle streaks streaming LEFT, and a radial
1009
+ * glow at the origin — everything clipped LEFT of the thumb, theme-split by
1010
+ * the harness `data-ds-dark-theme` body attribute.
1011
+ */
1012
+ function drawRadiation(context, width, height, time, state) {
1013
+ const origin = state.origin;
1014
+ const isDark = document.body.hasAttribute("data-ds-dark-theme");
1015
+ const cell = 4;
1016
+ const speed = state.dragging ? 2.8 : 1;
1017
+ context.clearRect(0, 0, width, height);
1018
+ if (origin <= 0) return;
1019
+ context.save();
1020
+ context.beginPath();
1021
+ context.rect(0, 0, origin, height);
1022
+ context.clip();
1023
+ for (let x = 0; x < origin; x += cell) {
1024
+ const delta = x + cell * .5 - origin;
1025
+ const distance = Math.abs(delta);
1026
+ const phaseA = distance / 10 - time * .0074 * speed;
1027
+ const phaseB = distance / 23 - time * .0041 * speed + 1.7;
1028
+ const phaseC = distance / 40 - time * .0022 * speed + 3.4;
1029
+ const sinA = Math.max(0, Math.sin(phaseA));
1030
+ const sinB = Math.max(0, Math.sin(phaseB));
1031
+ const sinC = Math.max(0, Math.sin(phaseC));
1032
+ const waveA = Math.pow(sinA, 2.6);
1033
+ const waveB = Math.pow(sinB, 3.2);
1034
+ const waveC = Math.pow(sinC, 4);
1035
+ const crest = Math.pow(sinA, 15) + Math.pow(sinB, 18) * .78;
1036
+ const wave = Math.min(1, waveA * .76 + waveB * .58 + waveC * .32);
1037
+ const trail = .38 + .62 * Math.exp(-distance / Math.max(55, width * .72));
1038
+ const pillar = Math.pow(Math.max(0, Math.sin(x / 20 + time * .0016)), 3) * .27;
1039
+ const columnEnergy = trail * (wave * 1.04 + pillar + crest * .32);
1040
+ if (columnEnergy > .012) {
1041
+ const nearness = Math.max(0, 1 - distance / Math.max(1, width * .78));
1042
+ context.fillStyle = `rgba(${isDark ? Math.round(42 + 124 * nearness + 75 * wave) : Math.round(28 + 58 * nearness + 15 * wave)}, ${isDark ? Math.round(56 + 58 * nearness + 44 * crest) : Math.round(88 + 72 * nearness + 30 * crest)}, ${isDark ? Math.round(175 + 72 * nearness + 8 * wave) : Math.round(182 + 62 * nearness)}, ${isDark ? Math.min(.88, columnEnergy * .72) : Math.min(.62, columnEnergy * .54)})`;
1043
+ context.fillRect(x, 0, 3, height);
1044
+ }
1045
+ for (let y = 0; y < height; y += cell) {
1046
+ const deltaY = y + cell * .5 - height * .5;
1047
+ const radial = Math.hypot(delta / 38, deltaY / 11);
1048
+ const halo = Math.exp(-radial * .96) * 1.08;
1049
+ const verticalShape = .58 + .42 * Math.cos(deltaY / height * Math.PI);
1050
+ const grain = .72 + .28 * Math.sin(x * .73 + y * 1.31 + time * .006);
1051
+ const alpha = Math.min(.96, (columnEnergy * .88 + halo + crest * .19) * verticalShape * grain);
1052
+ if (alpha < .035) continue;
1053
+ const hot = Math.max(0, 1 - radial / 2.4);
1054
+ context.fillStyle = `rgba(${isDark ? Math.round(54 + 148 * hot + 42 * wave + 35 * crest) : Math.round(25 + 72 * hot + 12 * wave)}, ${isDark ? Math.round(68 + 78 * hot + 46 * crest) : Math.round(98 + 72 * hot + 24 * crest)}, ${isDark ? Math.round(186 + 64 * hot) : Math.round(194 + 56 * hot)}, ${isDark ? alpha : alpha * .72})`;
1055
+ context.fillRect(x, y, 3, 3);
1056
+ }
1057
+ }
1058
+ for (let i = 0; i < 14; i += 1) {
1059
+ const particleX = origin - (time * (state.dragging ? .16 : .065) * (.78 + i % 5 * .09) + i * 23) % Math.max(30, origin + 64);
1060
+ if (particleX < -24 || particleX > width + 16) continue;
1061
+ const particleY = 3 + (i * 13 + Math.sin(time * .003 + i) * 5) % Math.max(7, height - 6);
1062
+ const length = 4 + i % 4 * 4 + (state.dragging ? 6 : 0);
1063
+ const alpha = .28 + i % 5 * .1;
1064
+ const streak = context.createLinearGradient(particleX, 0, particleX + length, 0);
1065
+ streak.addColorStop(0, isDark ? "rgba(72,118,255,0)" : "rgba(24,94,184,0)");
1066
+ streak.addColorStop(.68, isDark ? `rgba(112,135,255,${alpha})` : `rgba(36,108,202,${alpha * .72})`);
1067
+ streak.addColorStop(1, isDark ? `rgba(236,222,255,${Math.min(1, alpha + .26)})` : `rgba(103,175,248,${Math.min(.82, alpha + .18)})`);
1068
+ context.fillStyle = streak;
1069
+ context.fillRect(particleX, particleY, length, i % 3 === 0 ? 2 : 1);
1070
+ }
1071
+ const glow = context.createRadialGradient(origin, height / 2, 0, origin, height / 2, 24);
1072
+ glow.addColorStop(0, isDark ? "rgba(255,255,255,.82)" : "rgba(255,255,255,.86)");
1073
+ glow.addColorStop(.14, isDark ? "rgba(183,190,255,.54)" : "rgba(162,210,255,.48)");
1074
+ glow.addColorStop(.44, isDark ? "rgba(103,74,255,.28)" : "rgba(37,112,207,.22)");
1075
+ glow.addColorStop(1, isDark ? "rgba(86,31,210,0)" : "rgba(25,91,181,0)");
1076
+ context.fillStyle = glow;
1077
+ context.fillRect(origin - 26, 0, 52, height);
1078
+ context.restore();
1079
+ }
862
1080
  const zoneStyle = {
863
1081
  position: "relative",
864
1082
  flex: "1 1 auto",
865
- minWidth: "140px",
1083
+ minWidth: "100px",
866
1084
  height: `${ZONE_H}px`,
1085
+ isolation: "isolate",
1086
+ zIndex: 1,
867
1087
  touchAction: "none",
868
1088
  userSelect: "none",
869
1089
  WebkitUserSelect: "none"
@@ -877,49 +1097,8 @@ window.__ModuleLoader__.load({
877
1097
  ...zoneStyle,
878
1098
  cursor: "pointer"
879
1099
  };
880
- const trackStyle = {
881
- position: "absolute",
882
- bottom: `${TRACK_B}px`,
883
- height: `${TRACK_H}px`,
884
- borderRadius: "999px",
885
- background: "linear-gradient(90deg, rgba(94,140,255,0.32), rgba(150,110,255,0.14)), var(--dsw-alias-bg-layer-1)",
886
- border: "1px solid var(--dsw-alias-border-l2)",
887
- boxSizing: "border-box"
888
- };
889
- const fillStyle = {
890
- position: "absolute",
891
- bottom: `${TRACK_B}px`,
892
- height: `${TRACK_H}px`,
893
- borderRadius: "999px",
894
- background: "linear-gradient(90deg, rgba(88,131,255,0.92), rgba(122,90,255,0.80))",
895
- pointerEvents: "none"
896
- };
897
- const tickStyle = {
898
- position: "absolute",
899
- bottom: `24.5px`,
900
- width: "7px",
901
- height: "7px",
902
- borderRadius: "50%",
903
- background: "#fff",
904
- border: "1px solid var(--dsw-alias-border-l2)",
905
- boxSizing: "border-box",
906
- transform: "translateX(-50%)",
907
- pointerEvents: "none"
908
- };
909
- const shadowStyle = {
910
- position: "absolute",
911
- bottom: `26px`,
912
- width: `${GIRL_W + 6}px`,
913
- height: "6px",
914
- borderRadius: "50%",
915
- background: "rgba(0,0,0,0.22)",
916
- filter: "blur(2px)",
917
- transform: "translateX(-50%)",
918
- pointerEvents: "none"
919
- };
920
1100
  const girlStyle = {
921
1101
  position: "absolute",
922
- bottom: `${GIRL_B}px`,
923
1102
  width: `${GIRL_W}px`,
924
1103
  height: `${GIRL_H}px`,
925
1104
  backgroundImage: `url(${WHALE_RUN_STRIP_SRC})`,
@@ -930,16 +1109,11 @@ window.__ModuleLoader__.load({
930
1109
  };
931
1110
  const knobStyle = {
932
1111
  position: "absolute",
933
- bottom: `${28 - KNOB / 2}px`,
934
1112
  width: `${KNOB}px`,
935
1113
  height: `${KNOB}px`,
936
- borderRadius: "50%",
937
- background: "#fff",
938
- border: "2px solid var(--dsw-alias-state-business-primary)",
939
- boxShadow: "0 1px 4px rgba(0,0,0,0.25)",
940
- boxSizing: "border-box",
941
1114
  transform: "translateX(-50%)",
942
- pointerEvents: "none"
1115
+ pointerEvents: "none",
1116
+ boxSizing: "border-box"
943
1117
  };
944
1118
  const labelStyle$2 = {
945
1119
  position: "absolute",
@@ -965,15 +1139,85 @@ window.__ModuleLoader__.load({
965
1139
  const [dragPos, setDragPos] = (0, react.useState)(null);
966
1140
  const dragRef = (0, react.useRef)(null);
967
1141
  const [keyIndex, setKeyIndex] = (0, react.useState)(null);
1142
+ const canvasRef = (0, react.useRef)(null);
1143
+ const fractionRef = (0, react.useRef)(0);
1144
+ const draggingRef = (0, react.useRef)(false);
1145
+ const padRef = (0, react.useRef)(mascot ? PAD_MASCOT : PAD_KNOB);
1146
+ const redrawRef = (0, react.useRef)(null);
1147
+ (0, react.useEffect)(() => {
1148
+ redrawRef.current?.();
1149
+ });
1150
+ /**
1151
+ * The canvas FX loop: dpr-aware resize, theme-following redraws, one rAF
1152
+ * frame per tick — or static single frames when the user prefers reduced
1153
+ * motion. Everything dies with the effect (the editor row unmount). Mounted
1154
+ * before the empty-stops early return: hooks must run unconditionally (with
1155
+ * no stops the canvas never renders and the effect no-ops).
1156
+ */
1157
+ (0, react.useEffect)(() => {
1158
+ const canvas = canvasRef.current;
1159
+ if (canvas === null) return;
1160
+ const context = canvas.getContext("2d");
1161
+ if (context === null) return;
1162
+ const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
1163
+ let width = 1;
1164
+ let height = 1;
1165
+ let frame = 0;
1166
+ const resize = () => {
1167
+ const bounds = canvas.getBoundingClientRect();
1168
+ const ratio = Math.min(window.devicePixelRatio || 1, 2);
1169
+ width = Math.max(1, bounds.width);
1170
+ height = Math.max(1, bounds.height);
1171
+ canvas.width = Math.max(1, Math.round(width * ratio));
1172
+ canvas.height = Math.max(1, Math.round(height * ratio));
1173
+ context.setTransform(ratio, 0, 0, ratio, 0, 0);
1174
+ };
1175
+ const draw = (time = performance.now()) => {
1176
+ drawRadiation(context, width, height, time, {
1177
+ origin: fractionRef.current * width,
1178
+ dragging: draggingRef.current
1179
+ });
1180
+ };
1181
+ const loop = (time) => {
1182
+ draw(time);
1183
+ frame = window.requestAnimationFrame(loop);
1184
+ };
1185
+ const redraw = () => {
1186
+ if (reducedMotion.matches) draw();
1187
+ };
1188
+ const resizeObserver = new ResizeObserver(() => {
1189
+ resize();
1190
+ draw();
1191
+ });
1192
+ const themeObserver = new MutationObserver(() => draw());
1193
+ resizeObserver.observe(canvas);
1194
+ themeObserver.observe(document.body, {
1195
+ attributes: true,
1196
+ attributeFilter: ["data-ds-dark-theme"]
1197
+ });
1198
+ redrawRef.current = redraw;
1199
+ resize();
1200
+ draw();
1201
+ if (!reducedMotion.matches) frame = window.requestAnimationFrame(loop);
1202
+ return () => {
1203
+ window.cancelAnimationFrame(frame);
1204
+ resizeObserver.disconnect();
1205
+ themeObserver.disconnect();
1206
+ redrawRef.current = null;
1207
+ };
1208
+ }, []);
968
1209
  if (stops.length === 0) return null;
969
- if (mascot) ensureRunStyle();
1210
+ ensureEffectStyle();
970
1211
  const pad = mascot ? PAD_MASCOT : PAD_KNOB;
1212
+ padRef.current = pad;
971
1213
  const count = stops.length;
972
1214
  const indexOf = (fraction) => count <= 1 ? 0 : Math.min(count - 1, Math.max(0, Math.round(fraction * (count - 1))));
973
1215
  const fractionOf = (index) => count <= 1 ? 0 : index / (count - 1);
974
1216
  const committedIndex = nearestEffortStopIndex(stops, value);
975
1217
  const shownFraction = dragPos ?? fractionOf(keyIndex ?? committedIndex);
976
1218
  const shownIndex = indexOf(shownFraction);
1219
+ fractionRef.current = shownFraction;
1220
+ draggingRef.current = dragPos !== null;
977
1221
  /** Pointer → 0..1 fraction within the padded rail of the zone's box. */
978
1222
  const fractionFromEvent = (event) => {
979
1223
  const rect = event.currentTarget.getBoundingClientRect();
@@ -1027,8 +1271,11 @@ window.__ModuleLoader__.load({
1027
1271
  setKeyIndex(null);
1028
1272
  if (id !== void 0 && id !== value) onCommit(id);
1029
1273
  };
1030
- /** Tick/label/thumb x position inside the padded rail (percent of the zone). */
1274
+ /**
1275
+ * Tick/label/thumb x position inside the padded rail (percent of the zone).
1276
+ */
1031
1277
  const at = (fraction) => `calc(${pad}px + ${fraction} * (100% - ${2 * pad}px))`;
1278
+ const dragging = dragPos !== null;
1032
1279
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1033
1280
  role: "slider",
1034
1281
  className: ZONE_CLASS,
@@ -1038,6 +1285,8 @@ window.__ModuleLoader__.load({
1038
1285
  "aria-valuemax": count - 1,
1039
1286
  "aria-valuenow": shownIndex,
1040
1287
  "aria-valuetext": stops[shownIndex]?.name ?? stops[committedIndex]?.id ?? "",
1288
+ "data-drag": dragging ? "1" : "0",
1289
+ "data-top": shownIndex === count - 1 ? "1" : "0",
1041
1290
  style: disabled ? zoneDisabledStyle : zoneActiveStyle,
1042
1291
  onPointerDown,
1043
1292
  onPointerMove,
@@ -1046,35 +1295,57 @@ window.__ModuleLoader__.load({
1046
1295
  onKeyDown,
1047
1296
  onKeyUp,
1048
1297
  children: [
1049
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
1050
- ...trackStyle,
1051
- left: `${pad}px`,
1052
- right: `${pad}px`
1053
- } }),
1054
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
1055
- ...fillStyle,
1056
- left: `${pad}px`,
1057
- width: shownFraction <= 0 ? "0px" : `calc(${pad}px + ${shownFraction} * (100% - ${2 * pad}px) - ${pad}px)`
1058
- } }),
1059
- stops.map((stop, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
1060
- ...tickStyle,
1061
- left: at(fractionOf(index)),
1062
- opacity: index <= shownIndex ? 1 : .65
1063
- } }, stop.id)),
1064
- mascot ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
1065
- ...shadowStyle,
1066
- left: at(shownFraction)
1067
- } }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1068
- className: RUN_CLASS,
1298
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1299
+ className: TRACK_CLASS,
1300
+ style: {
1301
+ position: "absolute",
1302
+ left: `${pad}px`,
1303
+ right: `${pad}px`,
1304
+ bottom: `${TRACK_B}px`,
1305
+ height: `${TRACK_H}px`
1306
+ },
1307
+ children: [
1308
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: FILL_CLASS }),
1309
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("canvas", {
1310
+ ref: canvasRef,
1311
+ className: CANVAS_CLASS
1312
+ }),
1313
+ stops.map((stop, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
1314
+ position: "absolute",
1315
+ bottom: `${TRACK_H / 2 - 3.5}px`,
1316
+ left: `${index / Math.max(1, count - 1) * 100}%`,
1317
+ width: "7px",
1318
+ height: "7px",
1319
+ borderRadius: "50%",
1320
+ background: "#fff",
1321
+ border: "1px solid var(--dsw-alias-border-l2)",
1322
+ boxSizing: "border-box",
1323
+ transform: "translateX(-50%)",
1324
+ pointerEvents: "none",
1325
+ zIndex: 2,
1326
+ opacity: index <= shownIndex ? 1 : .65
1327
+ } }, stop.id))
1328
+ ]
1329
+ }),
1330
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1331
+ className: FLARE_CLASS,
1332
+ style: { left: at(shownFraction) }
1333
+ }),
1334
+ mascot ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1335
+ className: `${RUN_CLASS} ${GIRL_CLASS}`,
1069
1336
  style: {
1070
1337
  ...girlStyle,
1071
1338
  left: at(shownFraction),
1072
- ...dragPos !== null ? { animationDuration: "0.42s" } : {}
1339
+ bottom: `${GIRL_B}px`
1340
+ }
1341
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1342
+ className: KNOB_CLASS,
1343
+ style: {
1344
+ ...knobStyle,
1345
+ left: at(shownFraction),
1346
+ bottom: `${24 - KNOB / 2}px`
1073
1347
  }
1074
- })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
1075
- ...knobStyle,
1076
- left: at(shownFraction)
1077
- } }),
1348
+ }),
1078
1349
  count <= 6 && stops.map((stop, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1079
1350
  style: {
1080
1351
  ...index === shownIndex ? labelActiveStyle : labelStyle$2,
@@ -1248,8 +1519,8 @@ window.__ModuleLoader__.load({
1248
1519
  position: "absolute",
1249
1520
  bottom: "calc(100% + 8px)",
1250
1521
  left: "0",
1251
- zIndex: 1200,
1252
- width: "320px",
1522
+ zIndex: 1300,
1523
+ width: "min(320px, calc(100vw - 24px))",
1253
1524
  padding: "8px",
1254
1525
  background: "var(--dsw-alias-bg-layer-3)",
1255
1526
  color: "var(--dsw-alias-label-primary)",
@@ -1263,7 +1534,7 @@ window.__ModuleLoader__.load({
1263
1534
  const backdropStyle = {
1264
1535
  position: "fixed",
1265
1536
  inset: 0,
1266
- zIndex: 1199
1537
+ zIndex: 1299
1267
1538
  };
1268
1539
  const modelsStyle = {
1269
1540
  maxHeight: "320px",
@@ -1391,7 +1662,9 @@ window.__ModuleLoader__.load({
1391
1662
  border: "1px solid var(--dsw-alias-border-l2)",
1392
1663
  borderRadius: "6px",
1393
1664
  background: "var(--dsw-alias-bg-layer-1)",
1394
- fontSize: "12px"
1665
+ fontSize: "12px",
1666
+ position: "relative",
1667
+ zIndex: 2
1395
1668
  };
1396
1669
  const labelStyle$1 = {
1397
1670
  flex: "0 0 auto",