@spaced-out/ui-design-system 0.6.2 → 0.6.7
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.md +36 -0
- package/lib/components/DraggableWrapper/DraggableWrapper.d.ts +25 -0
- package/lib/components/DraggableWrapper/DraggableWrapper.d.ts.map +1 -0
- package/lib/components/DraggableWrapper/DraggableWrapper.js +102 -0
- package/lib/components/DraggableWrapper/DraggableWrapper.module.css +59 -0
- package/lib/components/DraggableWrapper/index.d.ts +3 -0
- package/lib/components/DraggableWrapper/index.d.ts.map +1 -0
- package/lib/components/DraggableWrapper/index.js +12 -0
- package/lib/components/Icon/Icon.module.css +4 -0
- package/lib/components/Link/Link.js +2 -4
- package/lib/components/PageTitle/PageTitle.d.ts +5 -0
- package/lib/components/PageTitle/PageTitle.d.ts.map +1 -1
- package/lib/components/PageTitle/PageTitle.js +5 -0
- package/lib/components/SideMenuLink/SideMenuLink.d.ts +5 -0
- package/lib/components/SideMenuLink/SideMenuLink.d.ts.map +1 -1
- package/lib/components/SideMenuLink/SideMenuLink.js +5 -0
- package/lib/components/VoiceOrb/Microphone/Microphone.d.ts.map +1 -1
- package/lib/components/VoiceOrb/Microphone/Microphone.js +21 -18
- package/lib/components/VoiceOrb/VoiceOrb/VoiceOrb.d.ts +2 -2
- package/lib/components/VoiceOrb/VoiceOrb/VoiceOrb.d.ts.map +1 -1
- package/lib/components/VoiceOrb/VoiceOrb/VoiceOrb.js +19 -4
- package/lib/components/VoiceOrb/constants.d.ts +1 -1
- package/lib/components/VoiceOrb/constants.d.ts.map +1 -1
- package/lib/components/VoiceOrb/constants.js +3 -3
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +11 -0
- package/lib/hooks/useAudioAnalyzer/useAudioAnalyzer.d.ts +2 -2
- package/lib/hooks/useAudioAnalyzer/useAudioAnalyzer.d.ts.map +1 -1
- package/lib/hooks/useAudioAnalyzer/useAudioAnalyzer.js +6 -5
- package/mcp/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.6.7](https://github.com/spaced-out/ui-design-system/compare/v0.6.6...v0.6.7) (2026-04-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add DraggableWrapper component ([#468](https://github.com/spaced-out/ui-design-system/issues/468)) ([4599260](https://github.com/spaced-out/ui-design-system/commit/4599260c4371325df0d3a3556ee1450e03e821e8))
|
|
11
|
+
* added task option in side menu link and page title ([#472](https://github.com/spaced-out/ui-design-system/issues/472)) ([59e41f0](https://github.com/spaced-out/ui-design-system/commit/59e41f0194e68a53ef5dc4f0c233122e7deaf8c8))
|
|
12
|
+
|
|
13
|
+
### [0.6.6](https://github.com/spaced-out/ui-design-system/compare/v0.6.6-beta.2...v0.6.6) (2026-03-24)
|
|
14
|
+
|
|
15
|
+
### [0.6.6-beta.2](https://github.com/spaced-out/ui-design-system/compare/v0.6.6-beta.1...v0.6.6-beta.2) (2026-03-23)
|
|
16
|
+
|
|
17
|
+
### [0.6.6-beta.1](https://github.com/spaced-out/ui-design-system/compare/v0.6.6-beta.0...v0.6.6-beta.1) (2026-03-23)
|
|
18
|
+
|
|
19
|
+
### [0.6.6-beta.0](https://github.com/spaced-out/ui-design-system/compare/v0.6.4...v0.6.6-beta.0) (2026-03-23)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* add ref for microphone animations ([#470](https://github.com/spaced-out/ui-design-system/issues/470)) ([6aedae2](https://github.com/spaced-out/ui-design-system/commit/6aedae264108a9344ca8d5669a832d80f80a783e))
|
|
25
|
+
|
|
26
|
+
### [0.6.5](https://github.com/spaced-out/ui-design-system/compare/v0.6.4...v0.6.5) (2026-03-23)
|
|
27
|
+
|
|
28
|
+
### Performance
|
|
29
|
+
|
|
30
|
+
* Optimize Voice-Orb and Microphone animations by skipping react lifecycle and updating DOM directly (https://github.com/Spaced-Out/ui-design-system/pull/469)
|
|
31
|
+
|
|
32
|
+
### [0.6.4](https://github.com/spaced-out/ui-design-system/compare/v0.6.3...v0.6.4) (2026-03-18)
|
|
33
|
+
|
|
34
|
+
### [0.6.3](https://github.com/spaced-out/ui-design-system/compare/v0.6.2...v0.6.3) (2026-03-18)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* disable state link icon color issue ([#467](https://github.com/spaced-out/ui-design-system/issues/467)) ([43cc16f](https://github.com/spaced-out/ui-design-system/commit/43cc16f958f99a3c653e36bfd896b23903da3d9d))
|
|
40
|
+
|
|
5
41
|
### [0.6.2](https://github.com/spaced-out/ui-design-system/compare/v0.6.2-beta.0...v0.6.2) (2026-03-10)
|
|
6
42
|
|
|
7
43
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type DraggableWrapperClassNames = Readonly<{
|
|
3
|
+
/** Override or extend the root wrapper element. */
|
|
4
|
+
wrapper?: string;
|
|
5
|
+
/** Override or extend the drag handle element. */
|
|
6
|
+
dragHandle?: string;
|
|
7
|
+
}>;
|
|
8
|
+
export interface DraggableWrapperProps extends Pick<React.HTMLAttributes<HTMLDivElement>, 'onDragStart' | 'onDragEnd' | 'onDragOver' | 'onDrop'> {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/** Applies the dragging visual state (purple outline + reduced opacity). */
|
|
11
|
+
isDragging?: boolean;
|
|
12
|
+
/** Label for the drag handle (tooltip and aria-label). Pass a translated string for i18n. */
|
|
13
|
+
dragHandleLabel?: string;
|
|
14
|
+
/** Class names to override or extend internal elements (e.g. from parent CSS modules). */
|
|
15
|
+
classNames?: DraggableWrapperClassNames;
|
|
16
|
+
/**
|
|
17
|
+
* Called when the user presses ArrowUp/ArrowLeft or ArrowDown/ArrowRight while
|
|
18
|
+
* the item is keyboard-grabbed. Use this to reorder the list in state.
|
|
19
|
+
*/
|
|
20
|
+
onKeyboardReorder?: (direction: 'up' | 'down') => void;
|
|
21
|
+
testId?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const DraggableWrapper: ({ children, isDragging, dragHandleLabel, classNames, testId, onDragStart, onDragEnd, onDragOver, onDrop, onKeyboardReorder, }: DraggableWrapperProps) => React.JSX.Element;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=DraggableWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DraggableWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/DraggableWrapper/DraggableWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,KAAK,0BAA0B,GAAG,QAAQ,CAAC;IACzC,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,qBACf,SAAQ,IAAI,CACV,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ,CACtD;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6FAA6F;IAC7F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,UAAU,CAAC,EAAE,0BAA0B,CAAC;IACxC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,gBAAgB,GAAI,+HAW9B,qBAAqB,sBA6EvB,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DraggableWrapper = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
9
|
+
var _qa = require("../../utils/qa");
|
|
10
|
+
var _Icon = require("../Icon");
|
|
11
|
+
var _Tooltip = require("../Tooltip");
|
|
12
|
+
var _DraggableWrapperModule = _interopRequireDefault(require("./DraggableWrapper.module.css"));
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
const DraggableWrapper = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
isDragging,
|
|
20
|
+
dragHandleLabel = 'Drag to move',
|
|
21
|
+
classNames,
|
|
22
|
+
testId,
|
|
23
|
+
onDragStart,
|
|
24
|
+
onDragEnd,
|
|
25
|
+
onDragOver,
|
|
26
|
+
onDrop,
|
|
27
|
+
onKeyboardReorder
|
|
28
|
+
} = _ref;
|
|
29
|
+
const wrapperRef = React.useRef(null);
|
|
30
|
+
const isKeyboardGrabbed = React.useRef(false);
|
|
31
|
+
const dispatchDragEvent = type => {
|
|
32
|
+
wrapperRef.current?.dispatchEvent(new DragEvent(type, {
|
|
33
|
+
bubbles: true,
|
|
34
|
+
dataTransfer: new DataTransfer()
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
const releaseKeyboardGrab = () => {
|
|
38
|
+
isKeyboardGrabbed.current = false;
|
|
39
|
+
dispatchDragEvent('dragend');
|
|
40
|
+
};
|
|
41
|
+
const handleBlur = () => {
|
|
42
|
+
if (isKeyboardGrabbed.current) {
|
|
43
|
+
releaseKeyboardGrab();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const handleKeyDown = e => {
|
|
47
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
if (!isKeyboardGrabbed.current) {
|
|
50
|
+
isKeyboardGrabbed.current = true;
|
|
51
|
+
dispatchDragEvent('dragstart');
|
|
52
|
+
} else {
|
|
53
|
+
releaseKeyboardGrab();
|
|
54
|
+
}
|
|
55
|
+
} else if (e.key === 'Escape' && isKeyboardGrabbed.current) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
// Capture Escape before Tooltip/useDismiss closes itself and stops bubbling.
|
|
58
|
+
releaseKeyboardGrab();
|
|
59
|
+
} else if (isKeyboardGrabbed.current && onKeyboardReorder) {
|
|
60
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
onKeyboardReorder('up');
|
|
63
|
+
} else if (e.key === 'ArrowDown' || e.key === 'ArrowRight') {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
onKeyboardReorder('down');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
70
|
+
ref: wrapperRef,
|
|
71
|
+
draggable: true,
|
|
72
|
+
onDragStart: onDragStart,
|
|
73
|
+
onDragEnd: onDragEnd,
|
|
74
|
+
onDragOver: onDragOver,
|
|
75
|
+
onDrop: onDrop,
|
|
76
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
77
|
+
base: testId
|
|
78
|
+
}),
|
|
79
|
+
className: (0, _classify.default)(_DraggableWrapperModule.default.wrapper, {
|
|
80
|
+
[_DraggableWrapperModule.default.dragging]: !!isDragging
|
|
81
|
+
}, classNames?.wrapper),
|
|
82
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
83
|
+
className: (0, _classify.default)(_DraggableWrapperModule.default.dragHandle, classNames?.dragHandle),
|
|
84
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
85
|
+
base: testId,
|
|
86
|
+
slot: 'drag-handle'
|
|
87
|
+
}),
|
|
88
|
+
onKeyDownCapture: handleKeyDown,
|
|
89
|
+
onBlur: handleBlur,
|
|
90
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
|
|
91
|
+
title: dragHandleLabel,
|
|
92
|
+
placement: "top",
|
|
93
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.ClickableIcon, {
|
|
94
|
+
name: "grip-dots-vertical",
|
|
95
|
+
size: "medium",
|
|
96
|
+
ariaLabel: dragHandleLabel
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
}), children]
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
exports.DraggableWrapper = DraggableWrapper;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@value (colorBorderTertiary, colorFillPrimary, colorButtonFillSecondaryPressed) from '../../styles/variables/_color.css';
|
|
2
|
+
@value (spaceSmall) from '../../styles/variables/_space.css';
|
|
3
|
+
@value (borderRadiusMedium, borderWidthPrimary, borderWidthTertiary) from '../../styles/variables/_border.css';
|
|
4
|
+
@value (motionDurationNormal, motionEaseInEaseOut) from '../../styles/variables/_motion.css';
|
|
5
|
+
@value (opacity50, opacity100, opacity0) from '../../styles/variables/_opacity.css';
|
|
6
|
+
@value (elevationCard) from '../../styles/variables/_elevation.css';
|
|
7
|
+
|
|
8
|
+
.wrapper {
|
|
9
|
+
position: relative;
|
|
10
|
+
border: borderWidthPrimary solid colorBorderTertiary;
|
|
11
|
+
border-radius: borderRadiusMedium;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.wrapper:hover:not(.dragging) {
|
|
15
|
+
outline: borderWidthPrimary solid colorBorderTertiary;
|
|
16
|
+
outline-offset: calc(-1 * borderWidthPrimary);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* ── Drag handle ──────────────────────────────────────────── */
|
|
20
|
+
|
|
21
|
+
.dragHandle {
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: spaceSmall;
|
|
24
|
+
left: borderWidthPrimary;
|
|
25
|
+
opacity: opacity0;
|
|
26
|
+
cursor: grab;
|
|
27
|
+
transition: opacity motionDurationNormal motionEaseInEaseOut;
|
|
28
|
+
line-height: 0;
|
|
29
|
+
z-index: calc(elevationCard / 4);
|
|
30
|
+
border-radius: borderRadiusMedium;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (prefers-reduced-motion: reduce) {
|
|
34
|
+
.dragHandle {
|
|
35
|
+
transition: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dragHandle:focus-within {
|
|
40
|
+
opacity: opacity100;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.wrapper:hover .dragHandle {
|
|
44
|
+
opacity: opacity100;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* ── Dragging state ───────────────────────────────────────── */
|
|
48
|
+
|
|
49
|
+
.wrapper.dragging {
|
|
50
|
+
opacity: opacity50;
|
|
51
|
+
border: borderWidthPrimary solid colorFillPrimary;
|
|
52
|
+
outline: borderWidthTertiary solid colorButtonFillSecondaryPressed;
|
|
53
|
+
outline-offset: borderWidthPrimary;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.wrapper.dragging .dragHandle {
|
|
57
|
+
opacity: opacity100;
|
|
58
|
+
cursor: grabbing;
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DraggableWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,kDAAkD,CAAC;AAClF,YAAY,EAAC,qBAAqB,EAAC,MAAM,kDAAkD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "DraggableWrapper", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _DraggableWrapper.DraggableWrapper;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _DraggableWrapper = require("./DraggableWrapper");
|
|
@@ -118,9 +118,7 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
118
118
|
name: iconLeftName,
|
|
119
119
|
size: iconLeftSize,
|
|
120
120
|
type: iconLeftType,
|
|
121
|
-
className:
|
|
122
|
-
[_typographyModule.default.disabled]: disabled
|
|
123
|
-
}),
|
|
121
|
+
className: _IconModule.default.inherit,
|
|
124
122
|
testId: (0, _qa.generateTestId)({
|
|
125
123
|
base: testId,
|
|
126
124
|
slot: 'icon-left'
|
|
@@ -142,7 +140,7 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
142
140
|
name: iconRightName,
|
|
143
141
|
size: iconRightSize,
|
|
144
142
|
type: iconRightType,
|
|
145
|
-
className: _IconModule.default
|
|
143
|
+
className: _IconModule.default.inherit,
|
|
146
144
|
testId: (0, _qa.generateTestId)({
|
|
147
145
|
base: testId,
|
|
148
146
|
slot: 'icon-right'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageTitle.d.ts","sourceRoot":"","sources":["../../../src/components/PageTitle/PageTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAkBrD,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAgBD,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"PageTitle.d.ts","sourceRoot":"","sources":["../../../src/components/PageTitle/PageTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAkBrD,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAgBD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyHzB,CAAC;AAKH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,OAAO;gDAKjB,YAAY;;CAQd,CAAC;AAIF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,SAAS;qCAAkC,cAAc;;CAIrE,CAAC;AAIF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ;qCAAkC,aAAa;;CAQnE,CAAC;AAIF,eAAO,MAAM,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,cAAc,CA8F1E,CAAC"}
|
|
@@ -26,6 +26,11 @@ const PAGE_NAME_LIST = exports.PAGE_NAME_LIST = Object.freeze({
|
|
|
26
26
|
iconName: 'house',
|
|
27
27
|
iconType: 'duotone'
|
|
28
28
|
},
|
|
29
|
+
tasks: {
|
|
30
|
+
title: 'Tasks',
|
|
31
|
+
iconName: 'list-check',
|
|
32
|
+
iconType: 'duotone'
|
|
33
|
+
},
|
|
29
34
|
engage: {
|
|
30
35
|
title: 'Engage',
|
|
31
36
|
iconName: 'bullseye-pointer',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideMenuLink.d.ts","sourceRoot":"","sources":["../../../src/components/SideMenuLink/SideMenuLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AASrD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAGvE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAM7D,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"SideMenuLink.d.ts","sourceRoot":"","sources":["../../../src/components/SideMenuLink/SideMenuLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AASrD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAGvE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAM7D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0LzB,CAAC;AAEH,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CACT,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACpC,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,aAAa,CAAC,EAAE,IAAI,CAAC,iBAAiB,CACpC,aAAa,EACb,iBAAiB,GAAG,IAAI,GAAG,SAAS,CACrC,CAAC;IACF,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAC/C,iBAAiB,EACjB,iBAAiB,CA+IlB,CAAC"}
|
|
@@ -25,6 +25,11 @@ const MENU_NAME_LIST = exports.MENU_NAME_LIST = Object.freeze({
|
|
|
25
25
|
iconName: 'house',
|
|
26
26
|
iconType: 'duotone'
|
|
27
27
|
},
|
|
28
|
+
tasks: {
|
|
29
|
+
title: 'Tasks',
|
|
30
|
+
iconName: 'list-check',
|
|
31
|
+
iconType: 'duotone'
|
|
32
|
+
},
|
|
28
33
|
engage: {
|
|
29
34
|
title: 'Engage',
|
|
30
35
|
iconName: 'bullseye-pointer',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Microphone.d.ts","sourceRoot":"","sources":["../../../../src/components/VoiceOrb/Microphone/Microphone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,KAAK,UAAU,GAAG,QAAQ,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"Microphone.d.ts","sourceRoot":"","sources":["../../../../src/components/VoiceOrb/Microphone/Microphone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,KAAK,UAAU,GAAG,QAAQ,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyDzC,CAAC;AAEF,OAAO,EAAC,UAAU,EAAC,CAAC"}
|
|
@@ -20,40 +20,43 @@ const Microphone = _ref => {
|
|
|
20
20
|
classNames,
|
|
21
21
|
testId
|
|
22
22
|
} = _ref;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const barsRef = React.useRef(null);
|
|
24
|
+
const onAnalyze = React.useCallback(intensities => {
|
|
25
|
+
const container = barsRef.current;
|
|
26
|
+
if (!container || container.children.length !== _constants.BAR_COUNT) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const bars = container.children;
|
|
30
|
+
for (let i = 0; i < intensities.length; i++) {
|
|
31
|
+
const multiplier = 1 + intensities[i] * (_constants.MAX_MULTIPLIERS[i] - 1);
|
|
32
|
+
const height = _constants.BASE_HEIGHT * multiplier;
|
|
33
|
+
bars[i].style.height = `${height}px`;
|
|
34
|
+
}
|
|
35
|
+
}, []);
|
|
36
|
+
(0, _useAudioAnalyzer.useAudioAnalyzer)({
|
|
26
37
|
isListening: enableMicrophone,
|
|
27
38
|
audioStream: null,
|
|
28
|
-
barCount: _constants.BAR_COUNT
|
|
39
|
+
barCount: _constants.BAR_COUNT,
|
|
40
|
+
onAnalyze
|
|
29
41
|
});
|
|
30
42
|
const barKeys = React.useMemo(() => Array.from({
|
|
31
43
|
length: _constants.BAR_COUNT
|
|
32
44
|
}, () => (0, _constants.uuid)()), [_constants.BAR_COUNT]);
|
|
33
|
-
// Calculate dynamic styles for each bar based on audio intensity
|
|
34
|
-
const barStyles = barIntensities.map((intensity, index) => {
|
|
35
|
-
// Height from BASE_HEIGHT (no audio) to BASE_HEIGHT * MAX_MULTIPLIERS[index] (max audio)
|
|
36
|
-
const multiplier = 1 + intensity * (_constants.MAX_MULTIPLIERS[index] - 1);
|
|
37
|
-
const height = _constants.BASE_HEIGHT * multiplier;
|
|
38
|
-
return {
|
|
39
|
-
height: `${height}px`
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
45
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
43
46
|
"data-testid": (0, _qa.generateTestId)({
|
|
44
47
|
base: testId,
|
|
45
48
|
slot: 'container'
|
|
46
49
|
}),
|
|
47
50
|
className: (0, _classify.default)(_MicrophoneModule.default.barsContainer, classNames?.barsContainer),
|
|
48
|
-
|
|
51
|
+
ref: barsRef,
|
|
52
|
+
children: enableMicrophone ? barKeys.map(barKey => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
49
53
|
"data-testid": (0, _qa.generateTestId)({
|
|
50
54
|
base: testId,
|
|
51
55
|
slot: 'bar',
|
|
52
|
-
index
|
|
56
|
+
index: barKey
|
|
53
57
|
}),
|
|
54
|
-
className: (0, _classify.default)(_MicrophoneModule.default.bar, classNames?.bar)
|
|
55
|
-
|
|
56
|
-
}, barKeys[index])) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
58
|
+
className: (0, _classify.default)(_MicrophoneModule.default.bar, classNames?.bar)
|
|
59
|
+
}, barKey)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
57
60
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MicIcon.MicIcon, {})
|
|
58
61
|
})
|
|
59
62
|
});
|
|
@@ -8,8 +8,8 @@ export interface VoiceOrbProps {
|
|
|
8
8
|
classNames?: ClassNames;
|
|
9
9
|
/** Enable listening to microphone audio input for bar animation */
|
|
10
10
|
enableMicrophone?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/** Custom event name to listen for agent volume updates. Default `'agent_volume_update'`. */
|
|
12
|
+
volumeTickEvent?: string;
|
|
13
13
|
testId?: string;
|
|
14
14
|
}
|
|
15
15
|
export declare const VoiceOrb: React.ForwardRefExoticComponent<VoiceOrbProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceOrb.d.ts","sourceRoot":"","sources":["../../../../src/components/VoiceOrb/VoiceOrb/VoiceOrb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B
|
|
1
|
+
{"version":3,"file":"VoiceOrb.d.ts","sourceRoot":"","sources":["../../../../src/components/VoiceOrb/VoiceOrb/VoiceOrb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6FAA6F;IAC7F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,sFAmDpB,CAAC"}
|
|
@@ -16,12 +16,27 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
16
16
|
const VoiceOrb = exports.VoiceOrb = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
17
17
|
let {
|
|
18
18
|
classNames,
|
|
19
|
-
volume = 0,
|
|
20
19
|
enableMicrophone = false,
|
|
20
|
+
volumeTickEvent = 'agent_volume_update',
|
|
21
21
|
testId
|
|
22
22
|
} = _ref;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const orbRef = React.useRef(null);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
const handleAgentVolumeUpdate = event => {
|
|
26
|
+
const el = orbRef.current;
|
|
27
|
+
if (!el) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const vars = (0, _constants.calculateOrbShadowVars)(event.detail.volume);
|
|
31
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
32
|
+
el.style.setProperty(key, value);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
window.addEventListener(volumeTickEvent, handleAgentVolumeUpdate);
|
|
36
|
+
return () => {
|
|
37
|
+
window.removeEventListener(volumeTickEvent, handleAgentVolumeUpdate);
|
|
38
|
+
};
|
|
39
|
+
}, [volumeTickEvent]);
|
|
25
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
26
41
|
ref: ref,
|
|
27
42
|
"data-testid": (0, _qa.generateTestId)({
|
|
@@ -32,8 +47,8 @@ const VoiceOrb = exports.VoiceOrb = /*#__PURE__*/React.forwardRef((_ref, ref) =>
|
|
|
32
47
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
33
48
|
className: (0, _classify.default)(_VoiceOrbModule.default.orbContainer, classNames?.orbContainer),
|
|
34
49
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
50
|
+
ref: orbRef,
|
|
35
51
|
className: (0, _classify.default)(_VoiceOrbModule.default.orb, classNames?.orb),
|
|
36
|
-
style: orbShadowVars,
|
|
37
52
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Microphone.Microphone, {
|
|
38
53
|
enableMicrophone: enableMicrophone
|
|
39
54
|
})
|
|
@@ -13,6 +13,6 @@ export declare const MIN_OPACITY_2 = 0.2;
|
|
|
13
13
|
export declare const MAX_OPACITY_2 = 0.6;
|
|
14
14
|
export declare const MIN_OPACITY_3 = 0.15;
|
|
15
15
|
export declare const MAX_OPACITY_3 = 0.4;
|
|
16
|
-
export declare function calculateOrbShadowVars(volume: number):
|
|
16
|
+
export declare function calculateOrbShadowVars(volume: number): Record<string, string>;
|
|
17
17
|
export declare function uuid(): string;
|
|
18
18
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/VoiceOrb/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,SAAS,IAAI,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AgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4B7E;AAGD,wBAAgB,IAAI,WAQnB"}
|
|
@@ -47,9 +47,9 @@ function calculateOrbShadowVars(volume) {
|
|
|
47
47
|
'--shadow-blur-1': `${blur1}px`,
|
|
48
48
|
'--shadow-blur-2': `${blur2}px`,
|
|
49
49
|
'--shadow-blur-3': `${blur3}px`,
|
|
50
|
-
'--shadow-opacity-1': opacity1,
|
|
51
|
-
'--shadow-opacity-2': opacity2,
|
|
52
|
-
'--shadow-opacity-3': opacity3
|
|
50
|
+
'--shadow-opacity-1': String(opacity1),
|
|
51
|
+
'--shadow-opacity-2': String(opacity2),
|
|
52
|
+
'--shadow-opacity-3': String(opacity3)
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -21,6 +21,7 @@ export * from '../components/ConditionalWrapper';
|
|
|
21
21
|
export * from '../components/DateRangePicker';
|
|
22
22
|
export * from '../components/Dialog';
|
|
23
23
|
export * from '../components/Disclaimer';
|
|
24
|
+
export * from '../components/DraggableWrapper';
|
|
24
25
|
export * from '../components/Dropdown';
|
|
25
26
|
export * from '../components/EmptyState';
|
|
26
27
|
export * from '../components/ErrorMessage';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC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;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yCAAyC,CAAC;AACxD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -256,6 +256,17 @@ Object.keys(_Disclaimer).forEach(function (key) {
|
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
258
|
});
|
|
259
|
+
var _DraggableWrapper = require("./DraggableWrapper");
|
|
260
|
+
Object.keys(_DraggableWrapper).forEach(function (key) {
|
|
261
|
+
if (key === "default" || key === "__esModule") return;
|
|
262
|
+
if (key in exports && exports[key] === _DraggableWrapper[key]) return;
|
|
263
|
+
Object.defineProperty(exports, key, {
|
|
264
|
+
enumerable: true,
|
|
265
|
+
get: function () {
|
|
266
|
+
return _DraggableWrapper[key];
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
});
|
|
259
270
|
var _Dropdown = require("./Dropdown");
|
|
260
271
|
Object.keys(_Dropdown).forEach(function (key) {
|
|
261
272
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -9,12 +9,12 @@ export interface AudioAnalyzerOptions {
|
|
|
9
9
|
smoothingTimeConstant?: number;
|
|
10
10
|
/** FFT size for frequency analysis */
|
|
11
11
|
fftSize?: number;
|
|
12
|
+
/** Called on every rAF tick with computed intensities -- can use for imperative DOM updates */
|
|
13
|
+
onAnalyze?: (intensities: number[]) => void;
|
|
12
14
|
/** Minimum ms between state updates (throttle). Default 50 (~20fps). */
|
|
13
15
|
updateIntervalMs?: number;
|
|
14
16
|
}
|
|
15
17
|
export interface AudioAnalyzerResult {
|
|
16
|
-
/** Array of intensity values (0-1) for each bar */
|
|
17
|
-
barIntensities: number[];
|
|
18
18
|
/** Whether the audio stream is active */
|
|
19
19
|
isActive: boolean;
|
|
20
20
|
/** Any error that occurred */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAudioAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAudioAnalyzer/useAudioAnalyzer.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,
|
|
1
|
+
{"version":3,"file":"useAudioAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAudioAnalyzer/useAudioAnalyzer.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,QAAQ,EAAE,OAAO,CAAC;IAClB,8BAA8B;IAC9B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAcD,eAAO,MAAM,gBAAgB;cAClB,oBAAoB,GAC5B,mBAAmB;;CAsLrB,CAAC"}
|
|
@@ -23,11 +23,13 @@ const useAudioAnalyzer = options => {
|
|
|
23
23
|
barCount = DEFAULT_BAR_COUNT,
|
|
24
24
|
smoothingTimeConstant = DEFAULT_SMOOTHING,
|
|
25
25
|
fftSize = DEFAULT_FFT_SIZE,
|
|
26
|
-
updateIntervalMs = DEFAULT_UPDATE_INTERVAL_MS
|
|
26
|
+
updateIntervalMs = DEFAULT_UPDATE_INTERVAL_MS,
|
|
27
|
+
onAnalyze
|
|
27
28
|
} = options;
|
|
28
|
-
const [barIntensities, setBarIntensities] = (0, _react.useState)(() => Array(barCount).fill(0));
|
|
29
29
|
const [isActive, setIsActive] = (0, _react.useState)(false);
|
|
30
30
|
const [error, setError] = (0, _react.useState)(null);
|
|
31
|
+
const onAnalyzeRef = (0, _react.useRef)(onAnalyze);
|
|
32
|
+
onAnalyzeRef.current = onAnalyze;
|
|
31
33
|
const audioContextRef = (0, _react.useRef)(null);
|
|
32
34
|
const analyzerRef = (0, _react.useRef)(null);
|
|
33
35
|
const sourceRef = (0, _react.useRef)(null);
|
|
@@ -84,7 +86,7 @@ const useAudioAnalyzer = options => {
|
|
|
84
86
|
const now = Date.now();
|
|
85
87
|
if (now - lastUpdateTimeRef.current >= updateIntervalMs) {
|
|
86
88
|
lastUpdateTimeRef.current = now;
|
|
87
|
-
|
|
89
|
+
onAnalyzeRef.current?.(intensities);
|
|
88
90
|
}
|
|
89
91
|
animationFrameRef.current = requestAnimationFrame(analyze);
|
|
90
92
|
};
|
|
@@ -115,7 +117,7 @@ const useAudioAnalyzer = options => {
|
|
|
115
117
|
audioContextRef.current = null;
|
|
116
118
|
}
|
|
117
119
|
setIsActive(false);
|
|
118
|
-
|
|
120
|
+
onAnalyzeRef.current?.(Array(barCount).fill(0));
|
|
119
121
|
}, [barCount]);
|
|
120
122
|
(0, _react.useEffect)(() => {
|
|
121
123
|
if (!isListening) {
|
|
@@ -162,7 +164,6 @@ const useAudioAnalyzer = options => {
|
|
|
162
164
|
return cleanup;
|
|
163
165
|
}, [isListening, externalStream, fftSize, smoothingTimeConstant, analyzeAudio, cleanup]);
|
|
164
166
|
return {
|
|
165
|
-
barIntensities,
|
|
166
167
|
isActive,
|
|
167
168
|
error
|
|
168
169
|
};
|
package/mcp/package.json
CHANGED