@ihabdevteam/core 0.18.0 → 0.19.0
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/dist/components.cjs.js +161 -161
- package/dist/components.esm.css +1 -1
- package/dist/ihabdevteam-core.cjs.js +169 -169
- package/dist/ihabdevteam-core.d.ts +13 -1
- package/dist/packages/core/src/components/SoundCompass.css +2 -0
- package/dist/packages/core/src/components/SoundCompass.d.ts +13 -1
- package/dist/packages/core/src/components/SoundCompass.js +8 -2
- package/package.json +1 -1
|
@@ -5119,7 +5119,7 @@ export declare interface SliderProps {
|
|
|
5119
5119
|
export declare function sortToValue(key: string, asc: boolean): string | undefined;
|
|
5120
5120
|
|
|
5121
5121
|
/** @public */
|
|
5122
|
-
export declare function SoundCompass({ speakers, size, viewT, activeSpeakerId, playedIds, selectedId, answerId, showFeedback, pulseSelected, clickable, onSelectSpeaker, buttonSize, showIcon, shortcutAnchor, shortcutScale, scaleShortcut, }: SoundCompassProps): JSX.Element;
|
|
5122
|
+
export declare function SoundCompass({ speakers, size, viewT, activeSpeakerId, playedIds, selectedId, answerId, showFeedback, pulseSelected, pulseSelectedDuration, clickable, onSelectSpeaker, buttonSize, showIcon, shortcutAnchor, shortcutScale, scaleShortcut, }: SoundCompassProps): JSX.Element;
|
|
5123
5123
|
|
|
5124
5124
|
export declare interface SoundCompassExam {
|
|
5125
5125
|
/** `<SoundCompass {...bind} />` 로 펼쳐 넣는 제어 props */
|
|
@@ -5200,6 +5200,18 @@ export declare interface SoundCompassProps {
|
|
|
5200
5200
|
* 일어난 순간을 알리는 것이라 되풀이할 까닭이 없다.
|
|
5201
5201
|
*/
|
|
5202
5202
|
pulseSelected?: boolean;
|
|
5203
|
+
/**
|
|
5204
|
+
* 고른 자리 울림이 번지는 시간(ms). 기본 1000.
|
|
5205
|
+
*
|
|
5206
|
+
* 고른 상태를 짧게만 잡아 두는 검사에서는 울림이 중간에 끊긴다 — 소비 앱 실측:
|
|
5207
|
+
* 선택을 350ms 만 잡아 두니 울림이 35% 지점(퍼짐 1.6배)에서 통째로 사라져,
|
|
5208
|
+
* 가장 잘 보이는 확산 구간이 잘려 나갔다. 상태를 오래 잡아 두는 대신 울림을
|
|
5209
|
+
* 그 시간에 맞추는 편이 검사를 늘리지 않는다.
|
|
5210
|
+
*
|
|
5211
|
+
* 소리가 나는 동안의 울림(`activeSpeakerId`)은 1s 고정이다 — 그쪽은 이어지는
|
|
5212
|
+
* 상태를 알리는 것이라 짧을 까닭이 없다. 필요해지면 그때 연다.
|
|
5213
|
+
*/
|
|
5214
|
+
pulseSelectedDuration?: number;
|
|
5203
5215
|
/** 스피커 클릭 가능 여부. 기본 false */
|
|
5204
5216
|
clickable?: boolean;
|
|
5205
5217
|
/** 스피커 선택 시 호출 */
|
|
@@ -140,6 +140,8 @@
|
|
|
140
140
|
되풀이를 끊는 것만으로 그대로 사라진다. */
|
|
141
141
|
.sound-compass__pulse--once {
|
|
142
142
|
animation-iteration-count: 1;
|
|
143
|
+
/* 고른 상태를 짧게만 잡아 두는 검사에서는 이 시간을 줄여야 울림이 안 끊긴다. */
|
|
144
|
+
animation-duration: var(--sc-pulse-duration-once, 1s);
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
/* 스피커 버튼 wrap의 정적 속성만 분리(나머지는 상태·좌표 기반 동적 값이라 인라인 유지) */
|
|
@@ -44,6 +44,18 @@ export interface SoundCompassProps {
|
|
|
44
44
|
* 일어난 순간을 알리는 것이라 되풀이할 까닭이 없다.
|
|
45
45
|
*/
|
|
46
46
|
pulseSelected?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 고른 자리 울림이 번지는 시간(ms). 기본 1000.
|
|
49
|
+
*
|
|
50
|
+
* 고른 상태를 짧게만 잡아 두는 검사에서는 울림이 중간에 끊긴다 — 소비 앱 실측:
|
|
51
|
+
* 선택을 350ms 만 잡아 두니 울림이 35% 지점(퍼짐 1.6배)에서 통째로 사라져,
|
|
52
|
+
* 가장 잘 보이는 확산 구간이 잘려 나갔다. 상태를 오래 잡아 두는 대신 울림을
|
|
53
|
+
* 그 시간에 맞추는 편이 검사를 늘리지 않는다.
|
|
54
|
+
*
|
|
55
|
+
* 소리가 나는 동안의 울림(`activeSpeakerId`)은 1s 고정이다 — 그쪽은 이어지는
|
|
56
|
+
* 상태를 알리는 것이라 짧을 까닭이 없다. 필요해지면 그때 연다.
|
|
57
|
+
*/
|
|
58
|
+
pulseSelectedDuration?: number;
|
|
47
59
|
/** 스피커 클릭 가능 여부. 기본 false */
|
|
48
60
|
clickable?: boolean;
|
|
49
61
|
/** 스피커 선택 시 호출 */
|
|
@@ -79,4 +91,4 @@ export interface SoundCompassProps {
|
|
|
79
91
|
scaleShortcut?: boolean;
|
|
80
92
|
}
|
|
81
93
|
/** @public */
|
|
82
|
-
export default function SoundCompass({ speakers, size, viewT, activeSpeakerId, playedIds, selectedId, answerId, showFeedback, pulseSelected, clickable, onSelectSpeaker, buttonSize, showIcon, shortcutAnchor, shortcutScale, scaleShortcut, }: SoundCompassProps): import("react").JSX.Element;
|
|
94
|
+
export default function SoundCompass({ speakers, size, viewT, activeSpeakerId, playedIds, selectedId, answerId, showFeedback, pulseSelected, pulseSelectedDuration, clickable, onSelectSpeaker, buttonSize, showIcon, shortcutAnchor, shortcutScale, scaleShortcut, }: SoundCompassProps): import("react").JSX.Element;
|
|
@@ -14,7 +14,7 @@ import ShortcutBadge from './ShortcutBadge';
|
|
|
14
14
|
import './SoundCompass.css';
|
|
15
15
|
const lerp = (a, b, t) => a + (b - a) * t;
|
|
16
16
|
/** @public */
|
|
17
|
-
export default function SoundCompass({ speakers, size = 300, viewT = 0, activeSpeakerId = null, playedIds, selectedId = null, answerId = null, showFeedback = false, pulseSelected = false, clickable = false, onSelectSpeaker, buttonSize = 40, showIcon = true, shortcutAnchor = 'top-right', shortcutScale, scaleShortcut = false, }) {
|
|
17
|
+
export default function SoundCompass({ speakers, size = 300, viewT = 0, activeSpeakerId = null, playedIds, selectedId = null, answerId = null, showFeedback = false, pulseSelected = false, pulseSelectedDuration, clickable = false, onSelectSpeaker, buttonSize = 40, showIcon = true, shortcutAnchor = 'top-right', shortcutScale, scaleShortcut = false, }) {
|
|
18
18
|
const t = Math.max(0, Math.min(1, viewT));
|
|
19
19
|
const CENTER = size / 2;
|
|
20
20
|
// ── 탑뷰 좌표 ──────────────────────────────────────────────────────────
|
|
@@ -192,6 +192,12 @@ export default function SoundCompass({ speakers, size = 300, viewT = 0, activeSp
|
|
|
192
192
|
const iconSize = Math.round(Math.max(10, Math.min(56, BTN * 0.38)));
|
|
193
193
|
const numberSize = Math.round(Math.max(7, Math.min(18, BTN * 0.2)));
|
|
194
194
|
const numberOnlySize = Math.round(Math.max(10, Math.min(56, BTN * 0.4)));
|
|
195
|
-
return (_jsxs("div", { className: "sound-compass__speaker-pos", style: { ...baseStyle, left: x - BTN / 2, top: y - BTN / 2 }, children: [pulse && (_jsx("div", { className: `sound-compass__pulse${pulse === 'once' ? ' sound-compass__pulse--once' : ''}`, style: {
|
|
195
|
+
return (_jsxs("div", { className: "sound-compass__speaker-pos", style: { ...baseStyle, left: x - BTN / 2, top: y - BTN / 2 }, children: [pulse && (_jsx("div", { className: `sound-compass__pulse${pulse === 'once' ? ' sound-compass__pulse--once' : ''}`, style: {
|
|
196
|
+
width: BTN, height: BTN,
|
|
197
|
+
// 안 주면 아예 얹지 않는다 — CSS 의 기본 1s 가 살아 있게.
|
|
198
|
+
...(pulse === 'once' && pulseSelectedDuration !== undefined
|
|
199
|
+
? { ['--sc-pulse-duration-once']: `${pulseSelectedDuration}ms` }
|
|
200
|
+
: null),
|
|
201
|
+
} })), _jsxs("button", { type: "button", tabIndex: clickable ? 0 : -1, "aria-disabled": clickable ? undefined : true, onClick: clickable ? () => onSelectSpeaker?.(sp.id) : undefined, className: `sound-compass__speaker-btn sound-compass__speaker-btn--${state}`, style: { width: BTN, height: BTN }, "aria-label": sp.label, children: [showIcon && getStateIcon(state, iconSize), _jsx("span", { className: "sound-compass__speaker-number", style: { fontSize: showIcon ? numberSize : numberOnlySize }, children: idx + 1 })] }), sp.shortcut && (_jsx(ShortcutBadge, { keys: sp.shortcut, anchor: shortcutAnchor, className: "sound-compass__speaker-shortcut" }))] }, sp.id));
|
|
196
202
|
})] }) }));
|
|
197
203
|
}
|