@imperosoft/cris-webui-components 1.1.2-beta.8 → 1.1.2
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/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +180 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +180 -41
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -319,11 +319,13 @@ interface MatrixItem {
|
|
|
319
319
|
id: number;
|
|
320
320
|
lb: string;
|
|
321
321
|
gp: number;
|
|
322
|
+
/** Selection state: en=enabled, vs=visible */
|
|
322
323
|
sl: {
|
|
323
|
-
on: boolean;
|
|
324
324
|
en: boolean;
|
|
325
325
|
vs: boolean;
|
|
326
326
|
};
|
|
327
|
+
/** Tied input id (outputs only) — which input is routed to this output */
|
|
328
|
+
ti?: number;
|
|
327
329
|
io: {
|
|
328
330
|
on: boolean;
|
|
329
331
|
vs: boolean;
|
|
@@ -340,6 +342,8 @@ interface MatrixItem {
|
|
|
340
342
|
}
|
|
341
343
|
/** Shape of the matrix status from the backend */
|
|
342
344
|
interface MatrixStatus {
|
|
345
|
+
/** Selected input id (exclusive selection) */
|
|
346
|
+
si: number;
|
|
343
347
|
ip: MatrixItem[];
|
|
344
348
|
op: MatrixItem[];
|
|
345
349
|
}
|
|
@@ -372,6 +376,8 @@ interface CrisCoMatrixListsTieProps {
|
|
|
372
376
|
itemActiveStyle?: CSSProperties;
|
|
373
377
|
/** Item disabled className */
|
|
374
378
|
itemDisabledClassName?: string;
|
|
379
|
+
/** Video mute button text (default: "Mute") */
|
|
380
|
+
vmText?: string;
|
|
375
381
|
/** Video mute button className */
|
|
376
382
|
vmButtonClassName?: string;
|
|
377
383
|
/** Video mute button active className */
|
|
@@ -383,7 +389,7 @@ interface CrisCoMatrixListsTieProps {
|
|
|
383
389
|
/** Custom render for signal indicator */
|
|
384
390
|
renderSignalIndicator?: (on: boolean) => ReactNode;
|
|
385
391
|
}
|
|
386
|
-
declare function CrisCoMatrixListsTie({ oid, inputTitle, outputTitle, showChannels, className, style, listClassName, listStyle, headerClassName, headerStyle, itemClassName, itemStyle, itemActiveClassName, itemActiveStyle, itemDisabledClassName, vmButtonClassName, vmButtonActiveClassName, renderIoIndicator, renderSignalIndicator, }: CrisCoMatrixListsTieProps): react_jsx_runtime.JSX.Element | null;
|
|
392
|
+
declare function CrisCoMatrixListsTie({ oid, inputTitle, outputTitle, showChannels, className, style, listClassName, listStyle, headerClassName, headerStyle, itemClassName, itemStyle, itemActiveClassName, itemActiveStyle, itemDisabledClassName, vmText, vmButtonClassName, vmButtonActiveClassName, renderIoIndicator, renderSignalIndicator, }: CrisCoMatrixListsTieProps): react_jsx_runtime.JSX.Element | null;
|
|
387
393
|
|
|
388
394
|
/**
|
|
389
395
|
* Icon configuration and utilities for CRIS components
|
package/dist/index.d.ts
CHANGED
|
@@ -319,11 +319,13 @@ interface MatrixItem {
|
|
|
319
319
|
id: number;
|
|
320
320
|
lb: string;
|
|
321
321
|
gp: number;
|
|
322
|
+
/** Selection state: en=enabled, vs=visible */
|
|
322
323
|
sl: {
|
|
323
|
-
on: boolean;
|
|
324
324
|
en: boolean;
|
|
325
325
|
vs: boolean;
|
|
326
326
|
};
|
|
327
|
+
/** Tied input id (outputs only) — which input is routed to this output */
|
|
328
|
+
ti?: number;
|
|
327
329
|
io: {
|
|
328
330
|
on: boolean;
|
|
329
331
|
vs: boolean;
|
|
@@ -340,6 +342,8 @@ interface MatrixItem {
|
|
|
340
342
|
}
|
|
341
343
|
/** Shape of the matrix status from the backend */
|
|
342
344
|
interface MatrixStatus {
|
|
345
|
+
/** Selected input id (exclusive selection) */
|
|
346
|
+
si: number;
|
|
343
347
|
ip: MatrixItem[];
|
|
344
348
|
op: MatrixItem[];
|
|
345
349
|
}
|
|
@@ -372,6 +376,8 @@ interface CrisCoMatrixListsTieProps {
|
|
|
372
376
|
itemActiveStyle?: CSSProperties;
|
|
373
377
|
/** Item disabled className */
|
|
374
378
|
itemDisabledClassName?: string;
|
|
379
|
+
/** Video mute button text (default: "Mute") */
|
|
380
|
+
vmText?: string;
|
|
375
381
|
/** Video mute button className */
|
|
376
382
|
vmButtonClassName?: string;
|
|
377
383
|
/** Video mute button active className */
|
|
@@ -383,7 +389,7 @@ interface CrisCoMatrixListsTieProps {
|
|
|
383
389
|
/** Custom render for signal indicator */
|
|
384
390
|
renderSignalIndicator?: (on: boolean) => ReactNode;
|
|
385
391
|
}
|
|
386
|
-
declare function CrisCoMatrixListsTie({ oid, inputTitle, outputTitle, showChannels, className, style, listClassName, listStyle, headerClassName, headerStyle, itemClassName, itemStyle, itemActiveClassName, itemActiveStyle, itemDisabledClassName, vmButtonClassName, vmButtonActiveClassName, renderIoIndicator, renderSignalIndicator, }: CrisCoMatrixListsTieProps): react_jsx_runtime.JSX.Element | null;
|
|
392
|
+
declare function CrisCoMatrixListsTie({ oid, inputTitle, outputTitle, showChannels, className, style, listClassName, listStyle, headerClassName, headerStyle, itemClassName, itemStyle, itemActiveClassName, itemActiveStyle, itemDisabledClassName, vmText, vmButtonClassName, vmButtonActiveClassName, renderIoIndicator, renderSignalIndicator, }: CrisCoMatrixListsTieProps): react_jsx_runtime.JSX.Element | null;
|
|
387
393
|
|
|
388
394
|
/**
|
|
389
395
|
* Icon configuration and utilities for CRIS components
|
package/dist/index.js
CHANGED
|
@@ -137,6 +137,8 @@ function CrisButton({
|
|
|
137
137
|
const pressedRef = (0, import_react.useRef)(false);
|
|
138
138
|
const touchingRef = (0, import_react.useRef)(false);
|
|
139
139
|
const touchStartedHereRef = (0, import_react.useRef)(false);
|
|
140
|
+
const touchStartYRef = (0, import_react.useRef)(0);
|
|
141
|
+
const touchMovedRef = (0, import_react.useRef)(false);
|
|
140
142
|
const feedbackJoin = joinFeedback ?? join;
|
|
141
143
|
const feedback = (0, import_cris_webui_ch5_core.useDigital)(feedbackJoin ?? 0);
|
|
142
144
|
const enabledJoin = (0, import_cris_webui_ch5_core.useDigital)(joinEnable ?? 0);
|
|
@@ -219,30 +221,42 @@ function CrisButton({
|
|
|
219
221
|
dSet(join, false);
|
|
220
222
|
}
|
|
221
223
|
};
|
|
222
|
-
const
|
|
224
|
+
const SCROLL_THRESHOLD = 8;
|
|
225
|
+
const handleTouchStart = (e) => {
|
|
223
226
|
log("handleTouchStart");
|
|
224
227
|
touchStart();
|
|
225
228
|
touchingRef.current = true;
|
|
226
229
|
touchStartedHereRef.current = true;
|
|
227
|
-
|
|
230
|
+
touchMovedRef.current = false;
|
|
231
|
+
touchStartYRef.current = e.touches[0]?.clientY ?? 0;
|
|
232
|
+
};
|
|
233
|
+
const handleTouchMove = (e) => {
|
|
234
|
+
if (touchMovedRef.current) return;
|
|
235
|
+
const dy = Math.abs((e.touches[0]?.clientY ?? 0) - touchStartYRef.current);
|
|
236
|
+
if (dy > SCROLL_THRESHOLD) {
|
|
237
|
+
touchMovedRef.current = true;
|
|
238
|
+
log("touchMove: scroll detected, dy:", dy);
|
|
239
|
+
}
|
|
228
240
|
};
|
|
229
241
|
const handleTouchEnd = () => {
|
|
230
|
-
log("handleTouchEnd", {
|
|
242
|
+
log("handleTouchEnd", { touchStartedHere: touchStartedHereRef.current, moved: touchMovedRef.current });
|
|
231
243
|
touchEnd();
|
|
232
244
|
touchingRef.current = true;
|
|
233
|
-
if (touchStartedHereRef.current) {
|
|
245
|
+
if (touchStartedHereRef.current && !touchMovedRef.current) {
|
|
234
246
|
touchStartedHereRef.current = false;
|
|
247
|
+
handlePress();
|
|
235
248
|
handleRelease();
|
|
236
249
|
} else {
|
|
237
|
-
|
|
250
|
+
touchStartedHereRef.current = false;
|
|
251
|
+
log("SKIPPED: touch moved or did not start here");
|
|
238
252
|
}
|
|
239
253
|
};
|
|
240
254
|
const handleTouchCancel = () => {
|
|
241
|
-
log("handleTouchCancel");
|
|
255
|
+
log("handleTouchCancel (scroll detected)");
|
|
242
256
|
touchEnd();
|
|
243
257
|
touchingRef.current = true;
|
|
244
258
|
touchStartedHereRef.current = false;
|
|
245
|
-
|
|
259
|
+
touchMovedRef.current = false;
|
|
246
260
|
};
|
|
247
261
|
const handleMouseDown = () => {
|
|
248
262
|
if (isTouchActive() || touchingRef.current) return;
|
|
@@ -343,7 +357,7 @@ function CrisButton({
|
|
|
343
357
|
cursor: suppressKeyClicks ? "default" : "pointer",
|
|
344
358
|
position: isFreePositioned ? void 0 : "relative",
|
|
345
359
|
overflow: isFreePositioned ? void 0 : "hidden",
|
|
346
|
-
touchAction: "
|
|
360
|
+
touchAction: "pan-x pan-y",
|
|
347
361
|
userSelect: "none",
|
|
348
362
|
WebkitUserSelect: "none"
|
|
349
363
|
},
|
|
@@ -351,6 +365,7 @@ function CrisButton({
|
|
|
351
365
|
onMouseUp: handleMouseUp,
|
|
352
366
|
onMouseLeave: handleMouseLeave,
|
|
353
367
|
onTouchStart: handleTouchStart,
|
|
368
|
+
onTouchMove: handleTouchMove,
|
|
354
369
|
onTouchEnd: handleTouchEnd,
|
|
355
370
|
onTouchCancel: handleTouchCancel,
|
|
356
371
|
children: [
|
|
@@ -1332,12 +1347,25 @@ function CrisCoDebug({
|
|
|
1332
1347
|
// src/components/CrisCoMatrixListsTie.tsx
|
|
1333
1348
|
var import_cris_webui_ch5_core8 = require("@imperosoft/cris-webui-ch5-core");
|
|
1334
1349
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1350
|
+
var colors = {
|
|
1351
|
+
itemBg: "#4f5152",
|
|
1352
|
+
itemActiveBg: "#007ca0",
|
|
1353
|
+
vmActiveBg: "#dc2626",
|
|
1354
|
+
text: "#ffffff",
|
|
1355
|
+
headerText: "#6b7280",
|
|
1356
|
+
ioOn: "#4caf50",
|
|
1357
|
+
ioOff: "#f44336",
|
|
1358
|
+
sgOn: "#2196f3",
|
|
1359
|
+
sgOff: "#666666"
|
|
1360
|
+
};
|
|
1335
1361
|
var defaults = {
|
|
1336
1362
|
container: {
|
|
1337
1363
|
display: "flex",
|
|
1338
1364
|
flexDirection: "row",
|
|
1339
|
-
gap:
|
|
1340
|
-
|
|
1365
|
+
gap: "1.5rem",
|
|
1366
|
+
padding: "1rem 2rem",
|
|
1367
|
+
height: "100%",
|
|
1368
|
+
width: "100%"
|
|
1341
1369
|
},
|
|
1342
1370
|
list: {
|
|
1343
1371
|
flex: 1,
|
|
@@ -1347,57 +1375,129 @@ var defaults = {
|
|
|
1347
1375
|
minHeight: 0
|
|
1348
1376
|
},
|
|
1349
1377
|
header: {
|
|
1350
|
-
fontSize:
|
|
1351
|
-
fontWeight:
|
|
1352
|
-
padding: "
|
|
1378
|
+
fontSize: "1.5em",
|
|
1379
|
+
fontWeight: 700,
|
|
1380
|
+
padding: "0.5rem 0.75rem",
|
|
1353
1381
|
textTransform: "uppercase",
|
|
1354
|
-
|
|
1355
|
-
|
|
1382
|
+
letterSpacing: "0.05em",
|
|
1383
|
+
color: colors.headerText,
|
|
1384
|
+
flexShrink: 0,
|
|
1385
|
+
textAlign: "center"
|
|
1356
1386
|
},
|
|
1357
1387
|
scroll: {
|
|
1358
1388
|
flex: 1,
|
|
1359
1389
|
minHeight: 0,
|
|
1360
1390
|
overflow: "auto",
|
|
1391
|
+
scrollbarWidth: "none",
|
|
1361
1392
|
WebkitOverflowScrolling: "touch",
|
|
1362
1393
|
display: "flex",
|
|
1363
1394
|
flexDirection: "column",
|
|
1364
|
-
gap:
|
|
1395
|
+
gap: "0.15rem"
|
|
1365
1396
|
},
|
|
1366
1397
|
item: {
|
|
1367
1398
|
display: "flex",
|
|
1368
|
-
alignItems: "
|
|
1369
|
-
gap:
|
|
1370
|
-
padding: "
|
|
1371
|
-
minHeight:
|
|
1399
|
+
alignItems: "stretch",
|
|
1400
|
+
gap: "0.5rem",
|
|
1401
|
+
padding: "0 0.4rem 0 0",
|
|
1402
|
+
minHeight: "3.7rem",
|
|
1372
1403
|
cursor: "pointer",
|
|
1373
|
-
userSelect: "none"
|
|
1404
|
+
userSelect: "none",
|
|
1405
|
+
background: colors.itemBg,
|
|
1406
|
+
borderRadius: "0.5rem",
|
|
1407
|
+
transition: "background 0.15s"
|
|
1408
|
+
},
|
|
1409
|
+
itemActive: {
|
|
1410
|
+
background: colors.itemActiveBg
|
|
1411
|
+
},
|
|
1412
|
+
itemBtn: {
|
|
1413
|
+
flex: 1,
|
|
1414
|
+
minWidth: 0,
|
|
1415
|
+
display: "flex",
|
|
1416
|
+
alignItems: "stretch",
|
|
1417
|
+
background: "transparent",
|
|
1418
|
+
border: "none",
|
|
1419
|
+
textAlign: "left",
|
|
1420
|
+
color: colors.text,
|
|
1421
|
+
height: "100%",
|
|
1422
|
+
borderRadius: "0.5rem",
|
|
1423
|
+
cursor: "pointer"
|
|
1424
|
+
},
|
|
1425
|
+
itemBtnInner: {
|
|
1426
|
+
display: "flex",
|
|
1427
|
+
alignItems: "center",
|
|
1428
|
+
gap: "0.4rem",
|
|
1429
|
+
width: "100%",
|
|
1430
|
+
flex: 1,
|
|
1431
|
+
padding: "0.5rem 0.9rem"
|
|
1432
|
+
},
|
|
1433
|
+
channelNum: {
|
|
1434
|
+
flexShrink: 0,
|
|
1435
|
+
opacity: 0.6,
|
|
1436
|
+
minWidth: "1.7em",
|
|
1437
|
+
textAlign: "right",
|
|
1438
|
+
fontWeight: 400,
|
|
1439
|
+
marginRight: "0.4em"
|
|
1374
1440
|
},
|
|
1375
1441
|
itemLabel: {
|
|
1376
1442
|
flex: 1,
|
|
1377
|
-
fontSize:
|
|
1443
|
+
fontSize: "1.4em",
|
|
1444
|
+
fontWeight: 700,
|
|
1378
1445
|
whiteSpace: "nowrap",
|
|
1379
1446
|
overflow: "hidden",
|
|
1380
|
-
textOverflow: "ellipsis"
|
|
1447
|
+
textOverflow: "ellipsis",
|
|
1448
|
+
color: colors.text
|
|
1381
1449
|
},
|
|
1382
1450
|
indicators: {
|
|
1383
1451
|
display: "flex",
|
|
1384
|
-
gap:
|
|
1452
|
+
gap: "0.25rem",
|
|
1385
1453
|
alignItems: "center"
|
|
1386
1454
|
},
|
|
1387
1455
|
indicator: {
|
|
1388
|
-
width:
|
|
1389
|
-
height:
|
|
1456
|
+
width: "1rem",
|
|
1457
|
+
height: "1rem",
|
|
1390
1458
|
borderRadius: "50%",
|
|
1391
1459
|
flexShrink: 0
|
|
1460
|
+
},
|
|
1461
|
+
vmBtn: {
|
|
1462
|
+
flexShrink: 0,
|
|
1463
|
+
alignSelf: "stretch",
|
|
1464
|
+
display: "flex",
|
|
1465
|
+
alignItems: "center",
|
|
1466
|
+
background: colors.itemBg,
|
|
1467
|
+
color: colors.text,
|
|
1468
|
+
border: "none",
|
|
1469
|
+
borderRadius: "0.4rem",
|
|
1470
|
+
padding: "0 0.6rem",
|
|
1471
|
+
margin: "0.3rem 0.3rem 0.3rem 0",
|
|
1472
|
+
fontSize: "0.85em",
|
|
1473
|
+
fontWeight: 700,
|
|
1474
|
+
cursor: "pointer",
|
|
1475
|
+
transition: "background 0.15s"
|
|
1476
|
+
},
|
|
1477
|
+
vmBtnActive: {
|
|
1478
|
+
background: colors.vmActiveBg,
|
|
1479
|
+
color: colors.text
|
|
1392
1480
|
}
|
|
1393
1481
|
};
|
|
1482
|
+
var INJECTED_CSS = `
|
|
1483
|
+
.cris-co-matrix-scroll::-webkit-scrollbar { display: none; }
|
|
1484
|
+
.cris-co-matrix-item > div:first-child > .cris-button { width: 100%; height: 100%; }
|
|
1485
|
+
`;
|
|
1486
|
+
var scrollbarStyleInjected = false;
|
|
1487
|
+
function injectScrollbarStyle() {
|
|
1488
|
+
if (scrollbarStyleInjected) return;
|
|
1489
|
+
scrollbarStyleInjected = true;
|
|
1490
|
+
const style = document.createElement("style");
|
|
1491
|
+
style.textContent = INJECTED_CSS;
|
|
1492
|
+
document.head.appendChild(style);
|
|
1493
|
+
}
|
|
1394
1494
|
function DefaultIoIndicator({ on }) {
|
|
1395
1495
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1396
1496
|
"div",
|
|
1397
1497
|
{
|
|
1398
1498
|
style: {
|
|
1399
1499
|
...defaults.indicator,
|
|
1400
|
-
backgroundColor: on ?
|
|
1500
|
+
backgroundColor: on ? colors.ioOn : colors.ioOff
|
|
1401
1501
|
},
|
|
1402
1502
|
title: on ? "Online" : "Offline"
|
|
1403
1503
|
}
|
|
@@ -1409,7 +1509,7 @@ function DefaultSignalIndicator({ on }) {
|
|
|
1409
1509
|
{
|
|
1410
1510
|
style: {
|
|
1411
1511
|
...defaults.indicator,
|
|
1412
|
-
backgroundColor: on ?
|
|
1512
|
+
backgroundColor: on ? colors.sgOn : colors.sgOff
|
|
1413
1513
|
},
|
|
1414
1514
|
title: on ? "Signal detected" : "No signal"
|
|
1415
1515
|
}
|
|
@@ -1418,7 +1518,9 @@ function DefaultSignalIndicator({ on }) {
|
|
|
1418
1518
|
function MatrixItemRow({
|
|
1419
1519
|
item,
|
|
1420
1520
|
type,
|
|
1521
|
+
active,
|
|
1421
1522
|
showChannels,
|
|
1523
|
+
vmText,
|
|
1422
1524
|
onSelect,
|
|
1423
1525
|
onToggleVideoMute,
|
|
1424
1526
|
itemClassName,
|
|
@@ -1431,22 +1533,39 @@ function MatrixItemRow({
|
|
|
1431
1533
|
renderIoIndicator,
|
|
1432
1534
|
renderSignalIndicator
|
|
1433
1535
|
}) {
|
|
1434
|
-
const isActive =
|
|
1536
|
+
const isActive = active;
|
|
1435
1537
|
const isEnabled = item.sl.en;
|
|
1538
|
+
const useDefaults = !itemClassName;
|
|
1436
1539
|
const classes = [
|
|
1437
1540
|
"cris-co-matrix-item",
|
|
1438
1541
|
itemClassName,
|
|
1439
1542
|
isActive && (itemActiveClassName || "active"),
|
|
1440
1543
|
!isEnabled && (itemDisabledClassName || "disabled")
|
|
1441
1544
|
].filter(Boolean).join(" ");
|
|
1442
|
-
const computedStyle =
|
|
1545
|
+
const computedStyle = useDefaults ? {
|
|
1443
1546
|
...defaults.item,
|
|
1444
1547
|
...itemStyleProp,
|
|
1445
|
-
...isActive ? itemActiveStyle : void 0,
|
|
1548
|
+
...isActive ? { ...defaults.itemActive, ...itemActiveStyle } : void 0,
|
|
1446
1549
|
opacity: isEnabled ? 1 : 0.4
|
|
1447
|
-
};
|
|
1550
|
+
} : { ...itemStyleProp };
|
|
1448
1551
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: classes, style: computedStyle, children: [
|
|
1449
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1552
|
+
useDefaults ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: defaults.itemBtn, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1553
|
+
CrisButton,
|
|
1554
|
+
{
|
|
1555
|
+
selected: isActive,
|
|
1556
|
+
enabled: isEnabled,
|
|
1557
|
+
onPress: onSelect,
|
|
1558
|
+
showLocalFeedback: false,
|
|
1559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.itemBtnInner, children: [
|
|
1560
|
+
showChannels && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-matrix-ch", style: defaults.channelNum, children: item.id }),
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: defaults.itemLabel, children: item.lb || `${type === "input" ? "Input" : "Output"} ${item.id}` }),
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.indicators, children: [
|
|
1563
|
+
item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultIoIndicator, { on: item.io.on })),
|
|
1564
|
+
item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultSignalIndicator, { on: item.sg.on }))
|
|
1565
|
+
] })
|
|
1566
|
+
] })
|
|
1567
|
+
}
|
|
1568
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1450
1569
|
CrisButton,
|
|
1451
1570
|
{
|
|
1452
1571
|
selected: isActive,
|
|
@@ -1454,9 +1573,9 @@ function MatrixItemRow({
|
|
|
1454
1573
|
onPress: onSelect,
|
|
1455
1574
|
className: `cris-co-matrix-item-btn ${itemActiveClassName ?? ""}`,
|
|
1456
1575
|
classActive: itemActiveClassName,
|
|
1457
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", gap:
|
|
1576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "0.4rem", width: "100%" }, children: [
|
|
1458
1577
|
showChannels && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-matrix-ch", style: { flexShrink: 0, opacity: 0.6 }, children: item.id }),
|
|
1459
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style:
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { flex: 1, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: item.lb || `${type === "input" ? "Input" : "Output"} ${item.id}` }),
|
|
1460
1579
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.indicators, children: [
|
|
1461
1580
|
item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultIoIndicator, { on: item.io.on })),
|
|
1462
1581
|
item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultSignalIndicator, { on: item.sg.on }))
|
|
@@ -1464,17 +1583,31 @@ function MatrixItemRow({
|
|
|
1464
1583
|
] })
|
|
1465
1584
|
}
|
|
1466
1585
|
),
|
|
1467
|
-
item.vm.vs && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1586
|
+
item.vm.vs && (useDefaults && !vmButtonClassName ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: {
|
|
1587
|
+
...defaults.vmBtn,
|
|
1588
|
+
...item.vm.on ? defaults.vmBtnActive : void 0,
|
|
1589
|
+
opacity: item.vm.en ? 1 : 0.4,
|
|
1590
|
+
pointerEvents: item.vm.en ? "auto" : "none"
|
|
1591
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1592
|
+
CrisButton,
|
|
1593
|
+
{
|
|
1594
|
+
selected: item.vm.on,
|
|
1595
|
+
enabled: item.vm.en,
|
|
1596
|
+
text: vmText,
|
|
1597
|
+
onPress: onToggleVideoMute,
|
|
1598
|
+
showLocalFeedback: false
|
|
1599
|
+
}
|
|
1600
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1468
1601
|
CrisButton,
|
|
1469
1602
|
{
|
|
1470
1603
|
selected: item.vm.on,
|
|
1471
1604
|
enabled: item.vm.en,
|
|
1472
|
-
text:
|
|
1605
|
+
text: vmText,
|
|
1473
1606
|
onPress: onToggleVideoMute,
|
|
1474
1607
|
className: vmButtonClassName,
|
|
1475
1608
|
classActive: vmButtonActiveClassName
|
|
1476
1609
|
}
|
|
1477
|
-
)
|
|
1610
|
+
))
|
|
1478
1611
|
] });
|
|
1479
1612
|
}
|
|
1480
1613
|
function CrisCoMatrixListsTie({
|
|
@@ -1493,6 +1626,7 @@ function CrisCoMatrixListsTie({
|
|
|
1493
1626
|
itemActiveClassName,
|
|
1494
1627
|
itemActiveStyle,
|
|
1495
1628
|
itemDisabledClassName,
|
|
1629
|
+
vmText = "Mute",
|
|
1496
1630
|
vmButtonClassName,
|
|
1497
1631
|
vmButtonActiveClassName,
|
|
1498
1632
|
renderIoIndicator,
|
|
@@ -1500,8 +1634,9 @@ function CrisCoMatrixListsTie({
|
|
|
1500
1634
|
}) {
|
|
1501
1635
|
const matrix = (0, import_cris_webui_ch5_core8.useCustomObject)(oid);
|
|
1502
1636
|
const send = (0, import_cris_webui_ch5_core8.useCustomObjectSend)();
|
|
1637
|
+
injectScrollbarStyle();
|
|
1503
1638
|
if (!matrix) return null;
|
|
1504
|
-
const { ip: inputs, op: outputs } = matrix;
|
|
1639
|
+
const { si, ip: inputs, op: outputs } = matrix;
|
|
1505
1640
|
const handleSelectInput = (id) => {
|
|
1506
1641
|
send(oid, { action: "selectInput", id });
|
|
1507
1642
|
};
|
|
@@ -1531,12 +1666,14 @@ function CrisCoMatrixListsTie({
|
|
|
1531
1666
|
children: inputTitle
|
|
1532
1667
|
}
|
|
1533
1668
|
),
|
|
1534
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: defaults.scroll, children: inputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1669
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "cris-co-matrix-scroll", style: defaults.scroll, children: inputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1535
1670
|
MatrixItemRow,
|
|
1536
1671
|
{
|
|
1537
1672
|
item,
|
|
1538
1673
|
type: "input",
|
|
1674
|
+
active: si === item.id,
|
|
1539
1675
|
showChannels,
|
|
1676
|
+
vmText,
|
|
1540
1677
|
onSelect: () => handleSelectInput(item.id),
|
|
1541
1678
|
onToggleVideoMute: () => handleToggleVideoMute("input", item.id),
|
|
1542
1679
|
itemClassName,
|
|
@@ -1568,12 +1705,14 @@ function CrisCoMatrixListsTie({
|
|
|
1568
1705
|
children: outputTitle
|
|
1569
1706
|
}
|
|
1570
1707
|
),
|
|
1571
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: defaults.scroll, children: outputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1708
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "cris-co-matrix-scroll", style: defaults.scroll, children: outputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1572
1709
|
MatrixItemRow,
|
|
1573
1710
|
{
|
|
1574
1711
|
item,
|
|
1575
1712
|
type: "output",
|
|
1713
|
+
active: item.ti === si,
|
|
1576
1714
|
showChannels,
|
|
1715
|
+
vmText,
|
|
1577
1716
|
onSelect: () => handleTie(item.id),
|
|
1578
1717
|
onToggleVideoMute: () => handleToggleVideoMute("output", item.id),
|
|
1579
1718
|
itemClassName,
|