@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
|
@@ -297,7 +297,9 @@ interface ContextRulesTableProps {
|
|
|
297
297
|
className?: string;
|
|
298
298
|
}
|
|
299
299
|
/**
|
|
300
|
-
* The context rules table: Item | Include | Chars | Inline max
|
|
300
|
+
* The context rules table: Item | Include | Chars | Inline max, under nested
|
|
301
|
+
* heading rows — section ("Marketing"), page ("Marketing Brand Cockpit"), the
|
|
302
|
+
* page's own groups — each heading full width with its switch. Presentational
|
|
301
303
|
* and state-agnostic — every edit goes out through `onChange`.
|
|
302
304
|
*/
|
|
303
305
|
declare function ContextRulesTable({ rows, cap, readOnly, mismatches, onChange, onOpenRow, density, selectedKey, hierarchy, onSetInclude, renderRowLead, renderRowTrail, className, }: ContextRulesTableProps): react.JSX.Element;
|
|
@@ -297,7 +297,9 @@ interface ContextRulesTableProps {
|
|
|
297
297
|
className?: string;
|
|
298
298
|
}
|
|
299
299
|
/**
|
|
300
|
-
* The context rules table: Item | Include | Chars | Inline max
|
|
300
|
+
* The context rules table: Item | Include | Chars | Inline max, under nested
|
|
301
|
+
* heading rows — section ("Marketing"), page ("Marketing Brand Cockpit"), the
|
|
302
|
+
* page's own groups — each heading full width with its switch. Presentational
|
|
301
303
|
* and state-agnostic — every edit goes out through `onChange`.
|
|
302
304
|
*/
|
|
303
305
|
declare function ContextRulesTable({ rows, cap, readOnly, mismatches, onChange, onOpenRow, density, selectedKey, hierarchy, onSetInclude, renderRowLead, renderRowTrail, className, }: ContextRulesTableProps): react.JSX.Element;
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
// context/react/ContextRulesTable.tsx
|
|
4
4
|
import * as React2 from "react";
|
|
5
5
|
import {
|
|
6
|
+
Popover,
|
|
7
|
+
PopoverContent,
|
|
8
|
+
PopoverTrigger,
|
|
6
9
|
Switch,
|
|
7
10
|
Tooltip as Tooltip2,
|
|
8
11
|
TooltipContent as TooltipContent2,
|
|
@@ -456,10 +459,43 @@ function summarizeContextRows(rows) {
|
|
|
456
459
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
457
460
|
var CONTEXT_RULES_GRID = {
|
|
458
461
|
compact: "grid grid-cols-[minmax(0,1fr)_2.75rem_4rem_6.5rem] items-center gap-x-2 px-2",
|
|
459
|
-
// Phone widths (375px): the fixed columns stay compact so Item always keeps
|
|
460
|
-
// the remaining width — ~125px at 375 — and truncates with an ellipsis.
|
|
461
462
|
comfortable: "grid grid-cols-[minmax(0,1fr)_2.75rem_3.5rem_6.75rem] items-center gap-x-1.5 px-3"
|
|
462
463
|
};
|
|
464
|
+
var NARROW_GRID = {
|
|
465
|
+
compact: "grid grid-cols-[minmax(0,1fr)_auto_auto_auto] items-center gap-x-1.5 px-2",
|
|
466
|
+
comfortable: "grid grid-cols-[minmax(0,1fr)_auto_auto_auto] items-center gap-x-1.5 px-3"
|
|
467
|
+
};
|
|
468
|
+
var CONTEXT_RULES_NARROW_BELOW = 400;
|
|
469
|
+
var useIsoLayoutEffect = typeof window === "undefined" ? React2.useEffect : React2.useLayoutEffect;
|
|
470
|
+
function useNarrow(ref) {
|
|
471
|
+
const [narrow, setNarrow] = React2.useState(false);
|
|
472
|
+
useIsoLayoutEffect(() => {
|
|
473
|
+
const el = ref.current;
|
|
474
|
+
if (!el) return void 0;
|
|
475
|
+
const fit = () => {
|
|
476
|
+
const width = el.clientWidth;
|
|
477
|
+
if (width > 0) setNarrow(width < CONTEXT_RULES_NARROW_BELOW);
|
|
478
|
+
};
|
|
479
|
+
fit();
|
|
480
|
+
if (typeof ResizeObserver === "undefined") return void 0;
|
|
481
|
+
const observer = new ResizeObserver(fit);
|
|
482
|
+
observer.observe(el);
|
|
483
|
+
return () => observer.disconnect();
|
|
484
|
+
}, [ref]);
|
|
485
|
+
return narrow;
|
|
486
|
+
}
|
|
487
|
+
var INDENT = ["", "pl-2", "pl-4", "pl-6"];
|
|
488
|
+
var indent = (depth) => INDENT[Math.min(depth, INDENT.length - 1)];
|
|
489
|
+
function sectionsOf(levels) {
|
|
490
|
+
const out = [];
|
|
491
|
+
for (const level of levels) {
|
|
492
|
+
const label = level.ref.path.length > 1 ? level.ref.path[0] : null;
|
|
493
|
+
const last = out[out.length - 1];
|
|
494
|
+
if (label !== null && last && last.label === label) last.levels.push(level);
|
|
495
|
+
else out.push({ id: label === null ? `level:${level.ref.id}` : `section:${label}`, label, levels: [level] });
|
|
496
|
+
}
|
|
497
|
+
return out;
|
|
498
|
+
}
|
|
463
499
|
function ContextRulesTable({
|
|
464
500
|
rows,
|
|
465
501
|
cap,
|
|
@@ -476,14 +512,23 @@ function ContextRulesTable({
|
|
|
476
512
|
className
|
|
477
513
|
}) {
|
|
478
514
|
const comfortable = density === "comfortable";
|
|
515
|
+
const rootRef = React2.useRef(null);
|
|
516
|
+
const narrow = useNarrow(rootRef);
|
|
517
|
+
const grid = narrow ? NARROW_GRID[density] : CONTEXT_RULES_GRID[density];
|
|
479
518
|
const levels = buildContextLevels(rows, hierarchy);
|
|
480
519
|
const headed = Boolean(hierarchy) || levels.length > 1;
|
|
520
|
+
const bulkChanges = (list, next) => includeChanges(list, next, cap);
|
|
521
|
+
const bulk = (list) => onSetInclude && !readOnly ? (next) => {
|
|
522
|
+
const changes = bulkChanges(list, next);
|
|
523
|
+
if (changes.length > 0) onSetInclude(changes);
|
|
524
|
+
} : void 0;
|
|
481
525
|
const renderRow = (row, depth) => /* @__PURE__ */ jsx3(
|
|
482
526
|
ContextRuleRow,
|
|
483
527
|
{
|
|
484
528
|
row,
|
|
485
529
|
cap,
|
|
486
|
-
|
|
530
|
+
grid,
|
|
531
|
+
narrow,
|
|
487
532
|
depth: headed ? depth : 0,
|
|
488
533
|
readOnly,
|
|
489
534
|
selected: selectedKey === row.key,
|
|
@@ -496,161 +541,135 @@ function ContextRulesTable({
|
|
|
496
541
|
},
|
|
497
542
|
rowId(row)
|
|
498
543
|
);
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
)
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
readOnly,
|
|
532
|
-
...levelSwitch(level, bulk(all))
|
|
533
|
-
}
|
|
534
|
-
) : null,
|
|
535
|
-
level.rows.map((row) => renderRow(row, 1)),
|
|
536
|
-
level.groups.map((group) => /* @__PURE__ */ jsxs3("div", { role: "rowgroup", "aria-label": group.ref.label, "data-group": group.ref.id, children: [
|
|
537
|
-
/* @__PURE__ */ jsx3(
|
|
538
|
-
LevelHeading,
|
|
539
|
-
{
|
|
540
|
-
kind: "group",
|
|
541
|
-
path: [group.ref.label],
|
|
542
|
-
rows: group.rows,
|
|
543
|
-
density,
|
|
544
|
-
readOnly,
|
|
545
|
-
onToggle: bulk(group.rows),
|
|
546
|
-
checked: group.rows.some((r) => r.include)
|
|
547
|
-
}
|
|
548
|
-
),
|
|
549
|
-
group.rows.map((row) => renderRow(row, 2))
|
|
550
|
-
] }, group.ref.id))
|
|
551
|
-
] }, level.ref.id);
|
|
552
|
-
})
|
|
553
|
-
] }) });
|
|
554
|
-
}
|
|
555
|
-
function levelSwitch(level, bulk) {
|
|
556
|
-
if (level.master) return { checked: level.master.on, onToggle: level.master.onToggle };
|
|
557
|
-
return { checked: levelRows(level).some((r) => r.include), onToggle: bulk };
|
|
558
|
-
}
|
|
559
|
-
var useIsoLayoutEffect = typeof window === "undefined" ? React2.useEffect : React2.useLayoutEffect;
|
|
560
|
-
function HeadingPath({ path, name }) {
|
|
561
|
-
const boxRef = React2.useRef(null);
|
|
562
|
-
const fullRef = React2.useRef(null);
|
|
563
|
-
const [compact, setCompact] = React2.useState(false);
|
|
564
|
-
const multi = path.length > 1;
|
|
565
|
-
useIsoLayoutEffect(() => {
|
|
566
|
-
const box = boxRef.current;
|
|
567
|
-
const full = fullRef.current;
|
|
568
|
-
if (!multi || !box || !full) return void 0;
|
|
569
|
-
const fit = () => setCompact(full.scrollWidth > box.clientWidth);
|
|
570
|
-
fit();
|
|
571
|
-
if (typeof ResizeObserver === "undefined") return void 0;
|
|
572
|
-
const observer = new ResizeObserver(fit);
|
|
573
|
-
observer.observe(box);
|
|
574
|
-
return () => observer.disconnect();
|
|
575
|
-
}, [multi, name]);
|
|
576
|
-
const shown = multi && compact ? path.slice(-1) : path;
|
|
577
|
-
return /* @__PURE__ */ jsxs3(
|
|
578
|
-
"span",
|
|
544
|
+
const heading = (props) => /* @__PURE__ */ jsx3(Heading, { ...props, comfortable, readOnly }, props.id);
|
|
545
|
+
const renderLevel = (level, depth) => {
|
|
546
|
+
const all = levelRows(level);
|
|
547
|
+
const name = level.ref.path[level.ref.path.length - 1] ?? "";
|
|
548
|
+
return /* @__PURE__ */ jsxs3("div", { role: "rowgroup", "aria-label": headed ? level.ref.path.join(" \u203A ") : void 0, "data-level": level.ref.id, children: [
|
|
549
|
+
headed ? heading({
|
|
550
|
+
id: `h:${level.ref.id}`,
|
|
551
|
+
kind: "level",
|
|
552
|
+
label: name,
|
|
553
|
+
switchName: level.ref.path.join(" \u203A "),
|
|
554
|
+
depth,
|
|
555
|
+
rows: all,
|
|
556
|
+
...levelSwitch(level, bulk(all))
|
|
557
|
+
}) : null,
|
|
558
|
+
level.rows.map((row) => renderRow(row, depth + 1)),
|
|
559
|
+
level.groups.map((group) => /* @__PURE__ */ jsxs3("div", { role: "rowgroup", "aria-label": group.ref.label, "data-group": group.ref.id, children: [
|
|
560
|
+
heading({
|
|
561
|
+
id: `h:${group.ref.id}`,
|
|
562
|
+
kind: "group",
|
|
563
|
+
label: group.ref.label,
|
|
564
|
+
switchName: group.ref.label,
|
|
565
|
+
depth: depth + 1,
|
|
566
|
+
rows: group.rows,
|
|
567
|
+
checked: group.rows.some((r) => r.include),
|
|
568
|
+
onToggle: bulk(group.rows)
|
|
569
|
+
}),
|
|
570
|
+
group.rows.map((row) => renderRow(row, depth + 2))
|
|
571
|
+
] }, group.ref.id))
|
|
572
|
+
] }, level.ref.id);
|
|
573
|
+
};
|
|
574
|
+
return /* @__PURE__ */ jsx3(TooltipProvider, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsxs3(
|
|
575
|
+
"div",
|
|
579
576
|
{
|
|
580
|
-
ref:
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
577
|
+
ref: rootRef,
|
|
578
|
+
role: "table",
|
|
579
|
+
"aria-label": "Values",
|
|
580
|
+
"data-density": density,
|
|
581
|
+
"data-layout": narrow ? "narrow" : "wide",
|
|
582
|
+
className: cn2("text-xs", className),
|
|
584
583
|
children: [
|
|
585
|
-
|
|
586
|
-
"
|
|
584
|
+
narrow ? null : /* @__PURE__ */ jsxs3(
|
|
585
|
+
"div",
|
|
587
586
|
{
|
|
588
|
-
|
|
589
|
-
"
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
/* @__PURE__ */ jsx3("span", { children:
|
|
594
|
-
|
|
587
|
+
role: "row",
|
|
588
|
+
className: cn2(grid, "sticky top-0 z-10 h-7 border-b border-border bg-card font-medium text-muted-foreground"),
|
|
589
|
+
children: [
|
|
590
|
+
/* @__PURE__ */ jsx3("span", { role: "columnheader", children: "Item" }),
|
|
591
|
+
/* @__PURE__ */ jsx3("span", { role: "columnheader", className: "text-center", children: "Include" }),
|
|
592
|
+
/* @__PURE__ */ jsx3("span", { role: "columnheader", className: "text-right", children: "Chars" }),
|
|
593
|
+
/* @__PURE__ */ jsx3("span", { role: "columnheader", className: "pr-6 text-right", children: "Inline max" })
|
|
594
|
+
]
|
|
595
595
|
}
|
|
596
|
-
)
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
)
|
|
605
|
-
|
|
596
|
+
),
|
|
597
|
+
levels.length === 0 ? /* @__PURE__ */ jsx3("div", { className: "px-2 py-3 text-center text-muted-foreground", children: "None" }) : sectionsOf(levels).map((section) => {
|
|
598
|
+
if (section.label === null || !headed) return renderLevel(section.levels[0], 0);
|
|
599
|
+
const all = section.levels.flatMap(levelRows);
|
|
600
|
+
const several = section.levels.length > 1;
|
|
601
|
+
const toggleSection = several && !readOnly ? (next) => {
|
|
602
|
+
const changes = [];
|
|
603
|
+
for (const level of section.levels) {
|
|
604
|
+
if (level.master) level.master.onToggle?.(next);
|
|
605
|
+
else changes.push(...bulkChanges(levelRows(level), next));
|
|
606
606
|
}
|
|
607
|
-
|
|
608
|
-
|
|
607
|
+
if (changes.length > 0) onSetInclude?.(changes);
|
|
608
|
+
} : void 0;
|
|
609
|
+
return /* @__PURE__ */ jsxs3("div", { role: "rowgroup", "aria-label": section.label, "data-section": section.label, children: [
|
|
610
|
+
heading({
|
|
611
|
+
id: `h:${section.id}`,
|
|
612
|
+
kind: "section",
|
|
613
|
+
label: section.label,
|
|
614
|
+
switchName: section.label,
|
|
615
|
+
depth: 0,
|
|
616
|
+
rows: all,
|
|
617
|
+
checked: section.levels.some((l) => l.master ? l.master.on : levelRows(l).some((r) => r.include)),
|
|
618
|
+
onToggle: toggleSection,
|
|
619
|
+
noSwitch: !several
|
|
620
|
+
}),
|
|
621
|
+
section.levels.map((level) => renderLevel(level, 1))
|
|
622
|
+
] }, section.id);
|
|
623
|
+
})
|
|
609
624
|
]
|
|
610
625
|
}
|
|
611
|
-
);
|
|
626
|
+
) });
|
|
612
627
|
}
|
|
613
|
-
function
|
|
628
|
+
function levelSwitch(level, bulk) {
|
|
629
|
+
if (level.master) return { checked: level.master.on, onToggle: level.master.onToggle };
|
|
630
|
+
return { checked: levelRows(level).some((r) => r.include), onToggle: bulk };
|
|
631
|
+
}
|
|
632
|
+
function Heading({
|
|
614
633
|
kind,
|
|
615
|
-
|
|
634
|
+
label,
|
|
635
|
+
switchName,
|
|
636
|
+
depth,
|
|
616
637
|
rows,
|
|
617
|
-
density,
|
|
618
|
-
readOnly,
|
|
619
638
|
checked,
|
|
620
|
-
onToggle
|
|
639
|
+
onToggle,
|
|
640
|
+
noSwitch,
|
|
641
|
+
comfortable,
|
|
642
|
+
readOnly
|
|
621
643
|
}) {
|
|
622
|
-
const name = path.join(" \u203A ");
|
|
623
644
|
const { count, charsLabel } = summarizeContextRows(rows);
|
|
624
645
|
const total = rows.length;
|
|
625
|
-
const showSwitch = Boolean(onToggle) || readOnly && total > 0;
|
|
646
|
+
const showSwitch = !noSwitch && (Boolean(onToggle) || readOnly && total > 0);
|
|
626
647
|
return /* @__PURE__ */ jsxs3(
|
|
627
648
|
"div",
|
|
628
649
|
{
|
|
629
650
|
role: "row",
|
|
630
651
|
"data-heading": kind,
|
|
631
652
|
className: cn2(
|
|
632
|
-
|
|
633
|
-
"
|
|
634
|
-
|
|
635
|
-
kind === "level" ? "bg-muted/60 text-foreground" : "bg-muted/25 text-muted-foreground"
|
|
653
|
+
"flex items-center gap-2 border-b border-border/50 font-medium",
|
|
654
|
+
comfortable ? "min-h-11 px-3" : "h-7 px-2",
|
|
655
|
+
kind === "group" ? "bg-muted/25 text-muted-foreground" : "bg-muted/60 text-foreground"
|
|
636
656
|
),
|
|
637
657
|
children: [
|
|
638
|
-
/* @__PURE__ */
|
|
639
|
-
|
|
640
|
-
total > 0 ? /* @__PURE__ */ jsx3("span", {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
/* @__PURE__ */ jsx3("div", { role: "cell" })
|
|
658
|
+
/* @__PURE__ */ jsx3("div", { role: "cell", className: cn2("flex min-w-0 flex-1 items-center", indent(depth)), children: /* @__PURE__ */ jsx3("span", { className: "min-w-0 truncate", title: label, children: label }) }),
|
|
659
|
+
/* @__PURE__ */ jsxs3("div", { role: "cell", className: "flex shrink-0 items-center gap-2 font-normal tabular-nums text-muted-foreground", children: [
|
|
660
|
+
total > 0 ? /* @__PURE__ */ jsx3("span", { children: count === total ? total : `${count}/${total}` }) : null,
|
|
661
|
+
total > 0 ? /* @__PURE__ */ jsx3("span", { children: charsLabel }) : null,
|
|
662
|
+
showSwitch ? /* @__PURE__ */ jsx3(
|
|
663
|
+
Switch,
|
|
664
|
+
{
|
|
665
|
+
size: "sm",
|
|
666
|
+
"aria-label": `Include ${switchName}`,
|
|
667
|
+
checked,
|
|
668
|
+
disabled: readOnly || !onToggle,
|
|
669
|
+
onCheckedChange: (next) => onToggle?.(next)
|
|
670
|
+
}
|
|
671
|
+
) : null
|
|
672
|
+
] })
|
|
654
673
|
]
|
|
655
674
|
}
|
|
656
675
|
);
|
|
@@ -658,7 +677,8 @@ function LevelHeading({
|
|
|
658
677
|
function ContextRuleRow({
|
|
659
678
|
row,
|
|
660
679
|
cap,
|
|
661
|
-
|
|
680
|
+
grid,
|
|
681
|
+
narrow,
|
|
662
682
|
depth,
|
|
663
683
|
comfortable,
|
|
664
684
|
readOnly,
|
|
@@ -691,7 +711,7 @@ function ContextRuleRow({
|
|
|
691
711
|
"data-mismatch": mismatches.length > 0 ? "true" : void 0,
|
|
692
712
|
"aria-selected": selected || void 0,
|
|
693
713
|
className: cn2(
|
|
694
|
-
|
|
714
|
+
grid,
|
|
695
715
|
"border-b border-border/50",
|
|
696
716
|
comfortable ? "min-h-11" : "h-7",
|
|
697
717
|
selected && "bg-accent"
|
|
@@ -703,8 +723,7 @@ function ContextRuleRow({
|
|
|
703
723
|
role: "cell",
|
|
704
724
|
className: cn2(
|
|
705
725
|
"flex min-w-0 items-center gap-1.5",
|
|
706
|
-
depth
|
|
707
|
-
depth === 2 && "pl-4",
|
|
726
|
+
indent(depth),
|
|
708
727
|
!row.include && "opacity-50"
|
|
709
728
|
),
|
|
710
729
|
children: [
|
|
@@ -756,7 +775,7 @@ function ContextRuleRow({
|
|
|
756
775
|
]
|
|
757
776
|
}
|
|
758
777
|
),
|
|
759
|
-
/* @__PURE__ */ jsx3("div", { role: "cell", children: /* @__PURE__ */ jsx3(
|
|
778
|
+
/* @__PURE__ */ jsx3("div", { role: "cell", children: narrow ? /* @__PURE__ */ jsx3(InlineMaxButton, { row, cap, readOnly, comfortable, onChange }) : /* @__PURE__ */ jsx3(
|
|
760
779
|
InlineMaxInput,
|
|
761
780
|
{
|
|
762
781
|
label: row.label,
|
|
@@ -773,14 +792,60 @@ function ContextRuleRow({
|
|
|
773
792
|
}
|
|
774
793
|
);
|
|
775
794
|
}
|
|
795
|
+
function InlineMaxButton({
|
|
796
|
+
row,
|
|
797
|
+
cap,
|
|
798
|
+
readOnly,
|
|
799
|
+
comfortable,
|
|
800
|
+
onChange
|
|
801
|
+
}) {
|
|
802
|
+
const [open, setOpen] = React2.useState(false);
|
|
803
|
+
const own = row.userRule?.max_inline_chars ?? null;
|
|
804
|
+
const text = own !== null ? formatLimit(own) : limitPlaceholder(row, cap);
|
|
805
|
+
return /* @__PURE__ */ jsxs3(Popover, { open, onOpenChange: setOpen, children: [
|
|
806
|
+
/* @__PURE__ */ jsx3(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs3(
|
|
807
|
+
"button",
|
|
808
|
+
{
|
|
809
|
+
type: "button",
|
|
810
|
+
"aria-label": `Inline max ${row.label}: ${text}`,
|
|
811
|
+
disabled: readOnly,
|
|
812
|
+
className: cn2(
|
|
813
|
+
"relative inline-flex min-w-[2.25rem] items-center justify-end gap-1 rounded px-1 tabular-nums hover:bg-accent disabled:opacity-60",
|
|
814
|
+
comfortable ? "h-8 after:absolute after:-inset-y-1.5 after:inset-x-0 after:content-['']" : "h-6",
|
|
815
|
+
own === null ? "text-muted-foreground" : "text-foreground"
|
|
816
|
+
),
|
|
817
|
+
children: [
|
|
818
|
+
own !== null ? /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "h-1 w-1 rounded-full bg-primary" }) : null,
|
|
819
|
+
text
|
|
820
|
+
]
|
|
821
|
+
}
|
|
822
|
+
) }),
|
|
823
|
+
/* @__PURE__ */ jsx3(PopoverContent, { align: "end", className: "w-auto p-2", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
824
|
+
/* @__PURE__ */ jsx3("span", { className: "text-muted-foreground", children: "Inline max" }),
|
|
825
|
+
/* @__PURE__ */ jsx3(
|
|
826
|
+
InlineMaxInput,
|
|
827
|
+
{
|
|
828
|
+
label: row.label,
|
|
829
|
+
value: own,
|
|
830
|
+
inherited: inheritedLimit(row, cap),
|
|
831
|
+
placeholder: limitPlaceholder(row, cap),
|
|
832
|
+
cap,
|
|
833
|
+
disabled: readOnly,
|
|
834
|
+
comfortable,
|
|
835
|
+
onCommit: (next) => onChange(row.key, row.surfaceKey, withLimit(row, next))
|
|
836
|
+
}
|
|
837
|
+
)
|
|
838
|
+
] }) })
|
|
839
|
+
] });
|
|
840
|
+
}
|
|
776
841
|
|
|
777
842
|
// context/react/ContextRulesChip.tsx
|
|
778
843
|
import * as React3 from "react";
|
|
779
844
|
import {
|
|
780
845
|
BottomSheet,
|
|
781
|
-
Popover,
|
|
782
|
-
PopoverContent,
|
|
783
|
-
PopoverTrigger,
|
|
846
|
+
Popover as Popover2,
|
|
847
|
+
PopoverContent as PopoverContent2,
|
|
848
|
+
PopoverTrigger as PopoverTrigger2,
|
|
784
849
|
Switch as Switch2,
|
|
785
850
|
Tooltip as Tooltip3,
|
|
786
851
|
TooltipContent as TooltipContent3,
|
|
@@ -946,13 +1011,13 @@ function ContextRulesChip({
|
|
|
946
1011
|
/* @__PURE__ */ jsx4(BottomSheet, { open, onOpenChange: setOpen, title: name || faceName, surface: "solid", children: body })
|
|
947
1012
|
] });
|
|
948
1013
|
}
|
|
949
|
-
return /* @__PURE__ */ jsx4(TooltipProvider2, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsxs4(
|
|
950
|
-
withBlindTip(/* @__PURE__ */ jsx4(
|
|
1014
|
+
return /* @__PURE__ */ jsx4(TooltipProvider2, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsxs4(Popover2, { open, onOpenChange: setOpen, children: [
|
|
1015
|
+
withBlindTip(/* @__PURE__ */ jsx4(PopoverTrigger2, { asChild: true, children: faceButton })),
|
|
951
1016
|
/* @__PURE__ */ jsx4(
|
|
952
|
-
|
|
1017
|
+
PopoverContent2,
|
|
953
1018
|
{
|
|
954
1019
|
align: "end",
|
|
955
|
-
className: "w-[
|
|
1020
|
+
className: "w-[30rem] max-w-[calc(100vw-1rem)] overflow-hidden p-0",
|
|
956
1021
|
children: body
|
|
957
1022
|
}
|
|
958
1023
|
)
|
|
@@ -1182,7 +1247,7 @@ function ContextReceiptBlockDetail({
|
|
|
1182
1247
|
}
|
|
1183
1248
|
|
|
1184
1249
|
// context/react/ContextRulesPanelBody.tsx
|
|
1185
|
-
import { Fragment as
|
|
1250
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1186
1251
|
function layerCells(row) {
|
|
1187
1252
|
const { surface, agent, default_max } = row.layers ?? {};
|
|
1188
1253
|
const declared = agent?.declared === true;
|
|
@@ -1389,7 +1454,7 @@ function ContextRulesPanelBody({
|
|
|
1389
1454
|
}
|
|
1390
1455
|
) : null;
|
|
1391
1456
|
if (isMobile) {
|
|
1392
|
-
return /* @__PURE__ */ jsx7(TooltipProvider3, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsx7("div", { className: cn6("flex h-full min-h-0 flex-col", className), children: detail ? /* @__PURE__ */ jsxs7(
|
|
1457
|
+
return /* @__PURE__ */ jsx7(TooltipProvider3, { delayDuration: 300, titleTooltips: false, children: /* @__PURE__ */ jsx7("div", { className: cn6("flex h-full min-h-0 flex-col", className), children: detail ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1393
1458
|
/* @__PURE__ */ jsx7("div", { className: "flex h-12 shrink-0 items-center border-b border-border px-1", children: /* @__PURE__ */ jsxs7(
|
|
1394
1459
|
"button",
|
|
1395
1460
|
{
|
|
@@ -1403,7 +1468,7 @@ function ContextRulesPanelBody({
|
|
|
1403
1468
|
}
|
|
1404
1469
|
) }),
|
|
1405
1470
|
/* @__PURE__ */ jsx7("div", { className: "min-h-0 flex-1 overflow-y-auto", children: detail })
|
|
1406
|
-
] }) : /* @__PURE__ */ jsxs7(
|
|
1471
|
+
] }) : /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1407
1472
|
search,
|
|
1408
1473
|
table
|
|
1409
1474
|
] }) }) });
|