@ai-matrx/agents 0.41.1 → 0.42.1
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 +14 -0
- package/dist/content-transfer/index.cjs.map +1 -1
- package/dist/content-transfer/index.js.map +1 -1
- package/dist/content-transfer/react/index.cjs.map +1 -1
- package/dist/content-transfer/react/index.js.map +1 -1
- package/dist/context/react/index.cjs +204 -142
- package/dist/context/react/index.cjs.map +1 -1
- package/dist/context/react/index.d.cts +3 -1
- package/dist/context/react/index.d.ts +3 -1
- package/dist/context/react/index.js +216 -151
- package/dist/context/react/index.js.map +1 -1
- package/dist/generated/workflow-events.cjs.map +1 -1
- package/dist/generated/workflow-events.d.cts +1 -0
- package/dist/generated/workflow-events.d.ts +1 -0
- package/dist/generated/workflow-events.js.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{keys.generated-B72Ds5EJ.d.cts → keys.generated-CtmYvYsN.d.cts} +4 -4
- package/dist/{keys.generated-B72Ds5EJ.d.ts → keys.generated-CtmYvYsN.d.ts} +4 -4
- package/dist/mandates/index.cjs +2 -2
- package/dist/mandates/index.cjs.map +1 -1
- package/dist/mandates/index.d.cts +2 -2
- package/dist/mandates/index.d.ts +2 -2
- package/dist/mandates/index.js +2 -2
- package/dist/mandates/index.js.map +1 -1
- package/dist/matrx/index.d.cts +1 -1
- package/dist/matrx/index.d.ts +1 -1
- package/generated/workflow-events.ts +1 -0
- package/mandates/snapshots/keys.0.42.0.json +653 -0
- package/mandates/snapshots/keys.0.42.1.json +653 -0
- package/package.json +3 -3
|
@@ -494,10 +494,43 @@ function summarizeContextRows(rows) {
|
|
|
494
494
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
495
495
|
var CONTEXT_RULES_GRID = {
|
|
496
496
|
compact: "grid grid-cols-[minmax(0,1fr)_2.75rem_4rem_6.5rem] items-center gap-x-2 px-2",
|
|
497
|
-
// Phone widths (375px): the fixed columns stay compact so Item always keeps
|
|
498
|
-
// the remaining width — ~125px at 375 — and truncates with an ellipsis.
|
|
499
497
|
comfortable: "grid grid-cols-[minmax(0,1fr)_2.75rem_3.5rem_6.75rem] items-center gap-x-1.5 px-3"
|
|
500
498
|
};
|
|
499
|
+
var NARROW_GRID = {
|
|
500
|
+
compact: "grid grid-cols-[minmax(0,1fr)_auto_auto_auto] items-center gap-x-1.5 px-2",
|
|
501
|
+
comfortable: "grid grid-cols-[minmax(0,1fr)_auto_auto_auto] items-center gap-x-1.5 px-3"
|
|
502
|
+
};
|
|
503
|
+
var CONTEXT_RULES_NARROW_BELOW = 400;
|
|
504
|
+
var useIsoLayoutEffect = typeof window === "undefined" ? React2.useEffect : React2.useLayoutEffect;
|
|
505
|
+
function useNarrow(ref) {
|
|
506
|
+
const [narrow, setNarrow] = React2.useState(false);
|
|
507
|
+
useIsoLayoutEffect(() => {
|
|
508
|
+
const el = ref.current;
|
|
509
|
+
if (!el) return void 0;
|
|
510
|
+
const fit = () => {
|
|
511
|
+
const width = el.clientWidth;
|
|
512
|
+
if (width > 0) setNarrow(width < CONTEXT_RULES_NARROW_BELOW);
|
|
513
|
+
};
|
|
514
|
+
fit();
|
|
515
|
+
if (typeof ResizeObserver === "undefined") return void 0;
|
|
516
|
+
const observer = new ResizeObserver(fit);
|
|
517
|
+
observer.observe(el);
|
|
518
|
+
return () => observer.disconnect();
|
|
519
|
+
}, [ref]);
|
|
520
|
+
return narrow;
|
|
521
|
+
}
|
|
522
|
+
var INDENT = ["", "pl-2", "pl-4", "pl-6"];
|
|
523
|
+
var indent = (depth) => INDENT[Math.min(depth, INDENT.length - 1)];
|
|
524
|
+
function sectionsOf(levels) {
|
|
525
|
+
const out = [];
|
|
526
|
+
for (const level of levels) {
|
|
527
|
+
const label = level.ref.path.length > 1 ? level.ref.path[0] : null;
|
|
528
|
+
const last = out[out.length - 1];
|
|
529
|
+
if (label !== null && last && last.label === label) last.levels.push(level);
|
|
530
|
+
else out.push({ id: label === null ? `level:${level.ref.id}` : `section:${label}`, label, levels: [level] });
|
|
531
|
+
}
|
|
532
|
+
return out;
|
|
533
|
+
}
|
|
501
534
|
function ContextRulesTable({
|
|
502
535
|
rows,
|
|
503
536
|
cap,
|
|
@@ -514,14 +547,23 @@ function ContextRulesTable({
|
|
|
514
547
|
className
|
|
515
548
|
}) {
|
|
516
549
|
const comfortable = density === "comfortable";
|
|
550
|
+
const rootRef = React2.useRef(null);
|
|
551
|
+
const narrow = useNarrow(rootRef);
|
|
552
|
+
const grid = narrow ? NARROW_GRID[density] : CONTEXT_RULES_GRID[density];
|
|
517
553
|
const levels = buildContextLevels(rows, hierarchy);
|
|
518
554
|
const headed = Boolean(hierarchy) || levels.length > 1;
|
|
555
|
+
const bulkChanges = (list, next) => includeChanges(list, next, cap);
|
|
556
|
+
const bulk = (list) => onSetInclude && !readOnly ? (next) => {
|
|
557
|
+
const changes = bulkChanges(list, next);
|
|
558
|
+
if (changes.length > 0) onSetInclude(changes);
|
|
559
|
+
} : void 0;
|
|
519
560
|
const renderRow = (row, depth) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
520
561
|
ContextRuleRow,
|
|
521
562
|
{
|
|
522
563
|
row,
|
|
523
564
|
cap,
|
|
524
|
-
|
|
565
|
+
grid,
|
|
566
|
+
narrow,
|
|
525
567
|
depth: headed ? depth : 0,
|
|
526
568
|
readOnly,
|
|
527
569
|
selected: selectedKey === row.key,
|
|
@@ -534,161 +576,135 @@ function ContextRulesTable({
|
|
|
534
576
|
},
|
|
535
577
|
rowId(row)
|
|
536
578
|
);
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
)
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
readOnly,
|
|
570
|
-
...levelSwitch(level, bulk(all))
|
|
571
|
-
}
|
|
572
|
-
) : null,
|
|
573
|
-
level.rows.map((row) => renderRow(row, 1)),
|
|
574
|
-
level.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "rowgroup", "aria-label": group.ref.label, "data-group": group.ref.id, children: [
|
|
575
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
576
|
-
LevelHeading,
|
|
577
|
-
{
|
|
578
|
-
kind: "group",
|
|
579
|
-
path: [group.ref.label],
|
|
580
|
-
rows: group.rows,
|
|
581
|
-
density,
|
|
582
|
-
readOnly,
|
|
583
|
-
onToggle: bulk(group.rows),
|
|
584
|
-
checked: group.rows.some((r) => r.include)
|
|
585
|
-
}
|
|
586
|
-
),
|
|
587
|
-
group.rows.map((row) => renderRow(row, 2))
|
|
588
|
-
] }, group.ref.id))
|
|
589
|
-
] }, level.ref.id);
|
|
590
|
-
})
|
|
591
|
-
] }) });
|
|
592
|
-
}
|
|
593
|
-
function levelSwitch(level, bulk) {
|
|
594
|
-
if (level.master) return { checked: level.master.on, onToggle: level.master.onToggle };
|
|
595
|
-
return { checked: levelRows(level).some((r) => r.include), onToggle: bulk };
|
|
596
|
-
}
|
|
597
|
-
var useIsoLayoutEffect = typeof window === "undefined" ? React2.useEffect : React2.useLayoutEffect;
|
|
598
|
-
function HeadingPath({ path, name }) {
|
|
599
|
-
const boxRef = React2.useRef(null);
|
|
600
|
-
const fullRef = React2.useRef(null);
|
|
601
|
-
const [compact, setCompact] = React2.useState(false);
|
|
602
|
-
const multi = path.length > 1;
|
|
603
|
-
useIsoLayoutEffect(() => {
|
|
604
|
-
const box = boxRef.current;
|
|
605
|
-
const full = fullRef.current;
|
|
606
|
-
if (!multi || !box || !full) return void 0;
|
|
607
|
-
const fit = () => setCompact(full.scrollWidth > box.clientWidth);
|
|
608
|
-
fit();
|
|
609
|
-
if (typeof ResizeObserver === "undefined") return void 0;
|
|
610
|
-
const observer = new ResizeObserver(fit);
|
|
611
|
-
observer.observe(box);
|
|
612
|
-
return () => observer.disconnect();
|
|
613
|
-
}, [multi, name]);
|
|
614
|
-
const shown = multi && compact ? path.slice(-1) : path;
|
|
615
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
616
|
-
"span",
|
|
579
|
+
const heading = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Heading, { ...props, comfortable, readOnly }, props.id);
|
|
580
|
+
const renderLevel = (level, depth) => {
|
|
581
|
+
const all = levelRows(level);
|
|
582
|
+
const name = level.ref.path[level.ref.path.length - 1] ?? "";
|
|
583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "rowgroup", "aria-label": headed ? level.ref.path.join(" \u203A ") : void 0, "data-level": level.ref.id, children: [
|
|
584
|
+
headed ? heading({
|
|
585
|
+
id: `h:${level.ref.id}`,
|
|
586
|
+
kind: "level",
|
|
587
|
+
label: name,
|
|
588
|
+
switchName: level.ref.path.join(" \u203A "),
|
|
589
|
+
depth,
|
|
590
|
+
rows: all,
|
|
591
|
+
...levelSwitch(level, bulk(all))
|
|
592
|
+
}) : null,
|
|
593
|
+
level.rows.map((row) => renderRow(row, depth + 1)),
|
|
594
|
+
level.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "rowgroup", "aria-label": group.ref.label, "data-group": group.ref.id, children: [
|
|
595
|
+
heading({
|
|
596
|
+
id: `h:${group.ref.id}`,
|
|
597
|
+
kind: "group",
|
|
598
|
+
label: group.ref.label,
|
|
599
|
+
switchName: group.ref.label,
|
|
600
|
+
depth: depth + 1,
|
|
601
|
+
rows: group.rows,
|
|
602
|
+
checked: group.rows.some((r) => r.include),
|
|
603
|
+
onToggle: bulk(group.rows)
|
|
604
|
+
}),
|
|
605
|
+
group.rows.map((row) => renderRow(row, depth + 2))
|
|
606
|
+
] }, group.ref.id))
|
|
607
|
+
] }, level.ref.id);
|
|
608
|
+
};
|
|
609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.TooltipProvider, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
610
|
+
"div",
|
|
617
611
|
{
|
|
618
|
-
ref:
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
612
|
+
ref: rootRef,
|
|
613
|
+
role: "table",
|
|
614
|
+
"aria-label": "Values",
|
|
615
|
+
"data-density": density,
|
|
616
|
+
"data-layout": narrow ? "narrow" : "wide",
|
|
617
|
+
className: (0, import_design_system2.cn)("text-xs", className),
|
|
622
618
|
children: [
|
|
623
|
-
|
|
624
|
-
"
|
|
619
|
+
narrow ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
620
|
+
"div",
|
|
625
621
|
{
|
|
626
|
-
|
|
627
|
-
"
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children:
|
|
632
|
-
|
|
622
|
+
role: "row",
|
|
623
|
+
className: (0, import_design_system2.cn)(grid, "sticky top-0 z-10 h-7 border-b border-border bg-card font-medium text-muted-foreground"),
|
|
624
|
+
children: [
|
|
625
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "columnheader", children: "Item" }),
|
|
626
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "columnheader", className: "text-center", children: "Include" }),
|
|
627
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "columnheader", className: "text-right", children: "Chars" }),
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "columnheader", className: "pr-6 text-right", children: "Inline max" })
|
|
629
|
+
]
|
|
633
630
|
}
|
|
634
|
-
)
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
)
|
|
643
|
-
|
|
631
|
+
),
|
|
632
|
+
levels.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "px-2 py-3 text-center text-muted-foreground", children: "None" }) : sectionsOf(levels).map((section) => {
|
|
633
|
+
if (section.label === null || !headed) return renderLevel(section.levels[0], 0);
|
|
634
|
+
const all = section.levels.flatMap(levelRows);
|
|
635
|
+
const several = section.levels.length > 1;
|
|
636
|
+
const toggleSection = several && !readOnly ? (next) => {
|
|
637
|
+
const changes = [];
|
|
638
|
+
for (const level of section.levels) {
|
|
639
|
+
if (level.master) level.master.onToggle?.(next);
|
|
640
|
+
else changes.push(...bulkChanges(levelRows(level), next));
|
|
644
641
|
}
|
|
645
|
-
|
|
646
|
-
|
|
642
|
+
if (changes.length > 0) onSetInclude?.(changes);
|
|
643
|
+
} : void 0;
|
|
644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "rowgroup", "aria-label": section.label, "data-section": section.label, children: [
|
|
645
|
+
heading({
|
|
646
|
+
id: `h:${section.id}`,
|
|
647
|
+
kind: "section",
|
|
648
|
+
label: section.label,
|
|
649
|
+
switchName: section.label,
|
|
650
|
+
depth: 0,
|
|
651
|
+
rows: all,
|
|
652
|
+
checked: section.levels.some((l) => l.master ? l.master.on : levelRows(l).some((r) => r.include)),
|
|
653
|
+
onToggle: toggleSection,
|
|
654
|
+
noSwitch: !several
|
|
655
|
+
}),
|
|
656
|
+
section.levels.map((level) => renderLevel(level, 1))
|
|
657
|
+
] }, section.id);
|
|
658
|
+
})
|
|
647
659
|
]
|
|
648
660
|
}
|
|
649
|
-
);
|
|
661
|
+
) });
|
|
662
|
+
}
|
|
663
|
+
function levelSwitch(level, bulk) {
|
|
664
|
+
if (level.master) return { checked: level.master.on, onToggle: level.master.onToggle };
|
|
665
|
+
return { checked: levelRows(level).some((r) => r.include), onToggle: bulk };
|
|
650
666
|
}
|
|
651
|
-
function
|
|
667
|
+
function Heading({
|
|
652
668
|
kind,
|
|
653
|
-
|
|
669
|
+
label,
|
|
670
|
+
switchName,
|
|
671
|
+
depth,
|
|
654
672
|
rows,
|
|
655
|
-
density,
|
|
656
|
-
readOnly,
|
|
657
673
|
checked,
|
|
658
|
-
onToggle
|
|
674
|
+
onToggle,
|
|
675
|
+
noSwitch,
|
|
676
|
+
comfortable,
|
|
677
|
+
readOnly
|
|
659
678
|
}) {
|
|
660
|
-
const name = path.join(" \u203A ");
|
|
661
679
|
const { count, charsLabel } = summarizeContextRows(rows);
|
|
662
680
|
const total = rows.length;
|
|
663
|
-
const showSwitch = Boolean(onToggle) || readOnly && total > 0;
|
|
681
|
+
const showSwitch = !noSwitch && (Boolean(onToggle) || readOnly && total > 0);
|
|
664
682
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
665
683
|
"div",
|
|
666
684
|
{
|
|
667
685
|
role: "row",
|
|
668
686
|
"data-heading": kind,
|
|
669
687
|
className: (0, import_design_system2.cn)(
|
|
670
|
-
|
|
671
|
-
"
|
|
672
|
-
|
|
673
|
-
kind === "level" ? "bg-muted/60 text-foreground" : "bg-muted/25 text-muted-foreground"
|
|
688
|
+
"flex items-center gap-2 border-b border-border/50 font-medium",
|
|
689
|
+
comfortable ? "min-h-11 px-3" : "h-7 px-2",
|
|
690
|
+
kind === "group" ? "bg-muted/25 text-muted-foreground" : "bg-muted/60 text-foreground"
|
|
674
691
|
),
|
|
675
692
|
children: [
|
|
676
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
677
|
-
|
|
678
|
-
total > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { role: "cell" })
|
|
693
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { role: "cell", className: (0, import_design_system2.cn)("flex min-w-0 flex-1 items-center", indent(depth)), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "min-w-0 truncate", title: label, children: label }) }),
|
|
694
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { role: "cell", className: "flex shrink-0 items-center gap-2 font-normal tabular-nums text-muted-foreground", children: [
|
|
695
|
+
total > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: count === total ? total : `${count}/${total}` }) : null,
|
|
696
|
+
total > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: charsLabel }) : null,
|
|
697
|
+
showSwitch ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
698
|
+
import_design_system2.Switch,
|
|
699
|
+
{
|
|
700
|
+
size: "sm",
|
|
701
|
+
"aria-label": `Include ${switchName}`,
|
|
702
|
+
checked,
|
|
703
|
+
disabled: readOnly || !onToggle,
|
|
704
|
+
onCheckedChange: (next) => onToggle?.(next)
|
|
705
|
+
}
|
|
706
|
+
) : null
|
|
707
|
+
] })
|
|
692
708
|
]
|
|
693
709
|
}
|
|
694
710
|
);
|
|
@@ -696,7 +712,8 @@ function LevelHeading({
|
|
|
696
712
|
function ContextRuleRow({
|
|
697
713
|
row,
|
|
698
714
|
cap,
|
|
699
|
-
|
|
715
|
+
grid,
|
|
716
|
+
narrow,
|
|
700
717
|
depth,
|
|
701
718
|
comfortable,
|
|
702
719
|
readOnly,
|
|
@@ -729,7 +746,7 @@ function ContextRuleRow({
|
|
|
729
746
|
"data-mismatch": mismatches.length > 0 ? "true" : void 0,
|
|
730
747
|
"aria-selected": selected || void 0,
|
|
731
748
|
className: (0, import_design_system2.cn)(
|
|
732
|
-
|
|
749
|
+
grid,
|
|
733
750
|
"border-b border-border/50",
|
|
734
751
|
comfortable ? "min-h-11" : "h-7",
|
|
735
752
|
selected && "bg-accent"
|
|
@@ -741,8 +758,7 @@ function ContextRuleRow({
|
|
|
741
758
|
role: "cell",
|
|
742
759
|
className: (0, import_design_system2.cn)(
|
|
743
760
|
"flex min-w-0 items-center gap-1.5",
|
|
744
|
-
depth
|
|
745
|
-
depth === 2 && "pl-4",
|
|
761
|
+
indent(depth),
|
|
746
762
|
!row.include && "opacity-50"
|
|
747
763
|
),
|
|
748
764
|
children: [
|
|
@@ -794,7 +810,7 @@ function ContextRuleRow({
|
|
|
794
810
|
]
|
|
795
811
|
}
|
|
796
812
|
),
|
|
797
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { role: "cell", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
813
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { role: "cell", children: narrow ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InlineMaxButton, { row, cap, readOnly, comfortable, onChange }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
798
814
|
InlineMaxInput,
|
|
799
815
|
{
|
|
800
816
|
label: row.label,
|
|
@@ -811,6 +827,52 @@ function ContextRuleRow({
|
|
|
811
827
|
}
|
|
812
828
|
);
|
|
813
829
|
}
|
|
830
|
+
function InlineMaxButton({
|
|
831
|
+
row,
|
|
832
|
+
cap,
|
|
833
|
+
readOnly,
|
|
834
|
+
comfortable,
|
|
835
|
+
onChange
|
|
836
|
+
}) {
|
|
837
|
+
const [open, setOpen] = React2.useState(false);
|
|
838
|
+
const own = row.userRule?.max_inline_chars ?? null;
|
|
839
|
+
const text = own !== null ? formatLimit(own) : limitPlaceholder(row, cap);
|
|
840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_design_system2.Popover, { open, onOpenChange: setOpen, children: [
|
|
841
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
842
|
+
"button",
|
|
843
|
+
{
|
|
844
|
+
type: "button",
|
|
845
|
+
"aria-label": `Inline max ${row.label}: ${text}`,
|
|
846
|
+
disabled: readOnly,
|
|
847
|
+
className: (0, import_design_system2.cn)(
|
|
848
|
+
"relative inline-flex min-w-[2.25rem] items-center justify-end gap-1 rounded px-1 tabular-nums hover:bg-accent disabled:opacity-60",
|
|
849
|
+
comfortable ? "h-8 after:absolute after:-inset-y-1.5 after:inset-x-0 after:content-['']" : "h-6",
|
|
850
|
+
own === null ? "text-muted-foreground" : "text-foreground"
|
|
851
|
+
),
|
|
852
|
+
children: [
|
|
853
|
+
own !== null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "aria-hidden": true, className: "h-1 w-1 rounded-full bg-primary" }) : null,
|
|
854
|
+
text
|
|
855
|
+
]
|
|
856
|
+
}
|
|
857
|
+
) }),
|
|
858
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_design_system2.PopoverContent, { align: "end", className: "w-auto p-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
859
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-muted-foreground", children: "Inline max" }),
|
|
860
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
861
|
+
InlineMaxInput,
|
|
862
|
+
{
|
|
863
|
+
label: row.label,
|
|
864
|
+
value: own,
|
|
865
|
+
inherited: inheritedLimit(row, cap),
|
|
866
|
+
placeholder: limitPlaceholder(row, cap),
|
|
867
|
+
cap,
|
|
868
|
+
disabled: readOnly,
|
|
869
|
+
comfortable,
|
|
870
|
+
onCommit: (next) => onChange(row.key, row.surfaceKey, withLimit(row, next))
|
|
871
|
+
}
|
|
872
|
+
)
|
|
873
|
+
] }) })
|
|
874
|
+
] });
|
|
875
|
+
}
|
|
814
876
|
|
|
815
877
|
// context/react/ContextRulesChip.tsx
|
|
816
878
|
var React3 = __toESM(require("react"), 1);
|
|
@@ -979,7 +1041,7 @@ function ContextRulesChip({
|
|
|
979
1041
|
import_design_system3.PopoverContent,
|
|
980
1042
|
{
|
|
981
1043
|
align: "end",
|
|
982
|
-
className: "w-[
|
|
1044
|
+
className: "w-[30rem] max-w-[calc(100vw-1rem)] overflow-hidden p-0",
|
|
983
1045
|
children: body
|
|
984
1046
|
}
|
|
985
1047
|
)
|