recappi 0.1.17 → 0.1.19

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.js CHANGED
@@ -111,14 +111,8 @@ var init_recordingCore = __esm({
111
111
  {
112
112
  id: "system",
113
113
  kind: "system",
114
- label: "System audio",
114
+ label: "System audio \xB7 all apps",
115
115
  canIncludeMicrophone: true
116
- },
117
- {
118
- id: "microphone",
119
- kind: "microphone",
120
- label: "Microphone only",
121
- canIncludeMicrophone: false
122
116
  }
123
117
  ];
124
118
  DEFAULT_RECORDING_SCENES = [{ id: "default", label: "Default" }];
@@ -1463,11 +1457,6 @@ var init_PermissionPreflightView = __esm({
1463
1457
  import { useState as useState5 } from "react";
1464
1458
  import { Box as Box14, Text as Text14, useInput as useInput5 } from "ink";
1465
1459
  import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
1466
- function levelBar(level, width = 8) {
1467
- const v = Math.max(0, Math.min(1, level ?? 0));
1468
- const n = Math.round(v * width);
1469
- return "\u2587".repeat(n) + "\u2581".repeat(width - n);
1470
- }
1471
1460
  function RecordSetupView({
1472
1461
  model,
1473
1462
  onStart,
@@ -1479,17 +1468,18 @@ function RecordSetupView({
1479
1468
  const [sceneIdx, setSceneIdx] = useState5(0);
1480
1469
  const sources = model.sources;
1481
1470
  const selected = sources[Math.min(srcIdx, Math.max(0, sources.length - 1))];
1482
- const micApplicable = selected?.canIncludeMicrophone ?? selected?.kind !== "microphone";
1483
1471
  const wide = size.columns >= 100;
1472
+ const hasAppSource = sources.some((source) => source.kind === "app");
1473
+ const hasMultipleSources = sources.length > 1;
1484
1474
  useInput5((input, key) => {
1485
1475
  if (key.upArrow || input === "k") setSrcIdx((i) => Math.max(0, i - 1));
1486
1476
  else if (key.downArrow || input === "j") setSrcIdx((i) => Math.min(sources.length - 1, i + 1));
1487
- else if (input === " " && micApplicable) setIncludeMic((m) => !m);
1477
+ else if (input === " ") setIncludeMic((m) => !m);
1488
1478
  else if (input === "s" && model.scenes.length > 1) setSceneIdx((i) => (i + 1) % model.scenes.length);
1489
1479
  else if (key.return && selected) {
1490
1480
  onStart({
1491
1481
  sourceId: selected.id,
1492
- includeMicrophone: micApplicable ? includeMic : false,
1482
+ includeMicrophone: includeMic,
1493
1483
  sceneId: model.scenes[sceneIdx]?.id
1494
1484
  });
1495
1485
  } else if (key.escape) onCancel();
@@ -1502,32 +1492,40 @@ function RecordSetupView({
1502
1492
  on ? "\u25B8 \u25CF " : " \u25CB ",
1503
1493
  s.label
1504
1494
  ] }, s.id);
1505
- })
1495
+ }),
1496
+ !hasAppSource ? /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "App-specific capture coming soon" }) : null
1506
1497
  ] });
1507
- const preview = /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", children: [
1508
- /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "INPUT PREVIEW" }),
1509
- /* @__PURE__ */ jsx16(Text14, { color: "green", children: levelBar(model.previewLevel, 10) }),
1510
- /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "live level of selection" })
1498
+ const capturePlan = /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", children: [
1499
+ /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "CAPTURE PLAN" }),
1500
+ /* @__PURE__ */ jsx16(Text14, { children: includeMic ? `${selected?.label ?? "System audio"} + microphone` : `${selected?.label ?? "System audio"} only` }),
1501
+ /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: includeMic ? "Mic is mixed into the recording" : "Mic stays muted" })
1511
1502
  ] });
1503
+ const shortcuts = [
1504
+ hasMultipleSources ? "\u2191\u2193 source" : void 0,
1505
+ "space mic",
1506
+ model.scenes.length > 1 ? "s scene" : void 0,
1507
+ "\u23CE start recording",
1508
+ "esc cancel"
1509
+ ].filter(Boolean).join(" \xB7 ");
1512
1510
  return /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", paddingX: 1, children: [
1513
1511
  /* @__PURE__ */ jsx16(Text14, { bold: true, color: "magenta", children: "New recording" }),
1514
1512
  /* @__PURE__ */ jsxs13(Box14, { marginTop: 1, flexDirection: wide ? "row" : "column", children: [
1515
1513
  /* @__PURE__ */ jsx16(Box14, { flexGrow: 1, flexDirection: "column", children: sourceList }),
1516
- wide ? /* @__PURE__ */ jsx16(Box14, { marginLeft: 4, children: preview }) : null
1514
+ /* @__PURE__ */ jsx16(Box14, { marginLeft: wide ? 4 : 0, marginTop: wide ? 0 : 1, children: capturePlan })
1517
1515
  ] }),
1518
1516
  /* @__PURE__ */ jsxs13(Box14, { marginTop: 1, flexDirection: "column", children: [
1519
- micApplicable ? /* @__PURE__ */ jsxs13(Text14, { children: [
1517
+ /* @__PURE__ */ jsxs13(Text14, { children: [
1520
1518
  /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "Microphone " }),
1521
1519
  /* @__PURE__ */ jsx16(Text14, { color: includeMic ? "green" : "gray", children: includeMic ? "[x] include mic" : "[ ] include mic" }),
1522
1520
  /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: " (space)" })
1523
- ] }) : /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "Microphone is the source" }),
1521
+ ] }),
1524
1522
  model.scenes.length > 0 ? /* @__PURE__ */ jsxs13(Text14, { children: [
1525
1523
  /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "Scene " }),
1526
1524
  /* @__PURE__ */ jsx16(Text14, { children: model.scenes[sceneIdx]?.label ?? "Default" }),
1527
1525
  model.scenes.length > 1 ? /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: " (s to change)" }) : null
1528
1526
  ] }) : null
1529
1527
  ] }),
1530
- /* @__PURE__ */ jsx16(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: "\u2191\u2193 source \xB7 space mic \xB7 \u23CE start recording \xB7 esc cancel" }) })
1528
+ /* @__PURE__ */ jsx16(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx16(Text14, { dimColor: true, children: shortcuts }) })
1531
1529
  ] });
1532
1530
  }
1533
1531
  var init_RecordSetupView = __esm({