@imperosoft/cris-webui-components 1.1.2-beta.7 → 1.1.2-beta.9

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 CHANGED
@@ -316,11 +316,11 @@ declare function CrisCoDebug({ oid, title, className, style, itemClassName, item
316
316
 
317
317
  /** Shape of an input or output item from the backend */
318
318
  interface MatrixItem {
319
- ch: number;
319
+ id: number;
320
320
  lb: string;
321
321
  gp: number;
322
322
  sl: {
323
- on: boolean;
323
+ on?: boolean;
324
324
  en: boolean;
325
325
  vs: boolean;
326
326
  };
@@ -340,6 +340,8 @@ interface MatrixItem {
340
340
  }
341
341
  /** Shape of the matrix status from the backend */
342
342
  interface MatrixStatus {
343
+ /** Selected input id (exclusive selection) */
344
+ si: number;
343
345
  ip: MatrixItem[];
344
346
  op: MatrixItem[];
345
347
  }
package/dist/index.d.ts CHANGED
@@ -316,11 +316,11 @@ declare function CrisCoDebug({ oid, title, className, style, itemClassName, item
316
316
 
317
317
  /** Shape of an input or output item from the backend */
318
318
  interface MatrixItem {
319
- ch: number;
319
+ id: number;
320
320
  lb: string;
321
321
  gp: number;
322
322
  sl: {
323
- on: boolean;
323
+ on?: boolean;
324
324
  en: boolean;
325
325
  vs: boolean;
326
326
  };
@@ -340,6 +340,8 @@ interface MatrixItem {
340
340
  }
341
341
  /** Shape of the matrix status from the backend */
342
342
  interface MatrixStatus {
343
+ /** Selected input id (exclusive selection) */
344
+ si: number;
343
345
  ip: MatrixItem[];
344
346
  op: MatrixItem[];
345
347
  }
package/dist/index.js CHANGED
@@ -1418,6 +1418,7 @@ function DefaultSignalIndicator({ on }) {
1418
1418
  function MatrixItemRow({
1419
1419
  item,
1420
1420
  type,
1421
+ active,
1421
1422
  showChannels,
1422
1423
  onSelect,
1423
1424
  onToggleVideoMute,
@@ -1431,7 +1432,7 @@ function MatrixItemRow({
1431
1432
  renderIoIndicator,
1432
1433
  renderSignalIndicator
1433
1434
  }) {
1434
- const isActive = item.sl.on;
1435
+ const isActive = active;
1435
1436
  const isEnabled = item.sl.en;
1436
1437
  const classes = [
1437
1438
  "cris-co-matrix-item",
@@ -1455,8 +1456,8 @@ function MatrixItemRow({
1455
1456
  className: `cris-co-matrix-item-btn ${itemActiveClassName ?? ""}`,
1456
1457
  classActive: itemActiveClassName,
1457
1458
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, width: "100%" }, children: [
1458
- showChannels && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-matrix-ch", style: { flexShrink: 0, opacity: 0.6 }, children: item.ch }),
1459
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: defaults.itemLabel, children: item.lb || `${type === "input" ? "Input" : "Output"} ${item.ch}` }),
1459
+ showChannels && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-matrix-ch", style: { flexShrink: 0, opacity: 0.6 }, children: item.id }),
1460
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: defaults.itemLabel, children: item.lb || `${type === "input" ? "Input" : "Output"} ${item.id}` }),
1460
1461
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.indicators, children: [
1461
1462
  item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultIoIndicator, { on: item.io.on })),
1462
1463
  item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultSignalIndicator, { on: item.sg.on }))
@@ -1501,15 +1502,15 @@ function CrisCoMatrixListsTie({
1501
1502
  const matrix = (0, import_cris_webui_ch5_core8.useCustomObject)(oid);
1502
1503
  const send = (0, import_cris_webui_ch5_core8.useCustomObjectSend)();
1503
1504
  if (!matrix) return null;
1504
- const { ip: inputs, op: outputs } = matrix;
1505
- const handleSelectInput = (ch) => {
1506
- send(oid, { action: "selectInput", ch });
1505
+ const { si, ip: inputs, op: outputs } = matrix;
1506
+ const handleSelectInput = (id) => {
1507
+ send(oid, { action: "selectInput", id });
1507
1508
  };
1508
- const handleTie = (ch) => {
1509
- send(oid, { action: "tie", ch });
1509
+ const handleTie = (id) => {
1510
+ send(oid, { action: "tie", id });
1510
1511
  };
1511
- const handleToggleVideoMute = (type, ch) => {
1512
- send(oid, { action: "toggleVideoMute", type, ch });
1512
+ const handleToggleVideoMute = (type, id) => {
1513
+ send(oid, { action: "toggleVideoMute", type, id });
1513
1514
  };
1514
1515
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1515
1516
  "div",
@@ -1536,9 +1537,10 @@ function CrisCoMatrixListsTie({
1536
1537
  {
1537
1538
  item,
1538
1539
  type: "input",
1540
+ active: si === item.id,
1539
1541
  showChannels,
1540
- onSelect: () => handleSelectInput(item.ch),
1541
- onToggleVideoMute: () => handleToggleVideoMute("input", item.ch),
1542
+ onSelect: () => handleSelectInput(item.id),
1543
+ onToggleVideoMute: () => handleToggleVideoMute("input", item.id),
1542
1544
  itemClassName,
1543
1545
  itemStyle,
1544
1546
  itemActiveClassName,
@@ -1549,7 +1551,7 @@ function CrisCoMatrixListsTie({
1549
1551
  renderIoIndicator,
1550
1552
  renderSignalIndicator
1551
1553
  },
1552
- item.ch
1554
+ item.id
1553
1555
  )) })
1554
1556
  ]
1555
1557
  }
@@ -1573,9 +1575,10 @@ function CrisCoMatrixListsTie({
1573
1575
  {
1574
1576
  item,
1575
1577
  type: "output",
1578
+ active: !!item.sl.on,
1576
1579
  showChannels,
1577
- onSelect: () => handleTie(item.ch),
1578
- onToggleVideoMute: () => handleToggleVideoMute("output", item.ch),
1580
+ onSelect: () => handleTie(item.id),
1581
+ onToggleVideoMute: () => handleToggleVideoMute("output", item.id),
1579
1582
  itemClassName,
1580
1583
  itemStyle,
1581
1584
  itemActiveClassName,
@@ -1586,7 +1589,7 @@ function CrisCoMatrixListsTie({
1586
1589
  renderIoIndicator,
1587
1590
  renderSignalIndicator
1588
1591
  },
1589
- item.ch
1592
+ item.id
1590
1593
  )) })
1591
1594
  ]
1592
1595
  }