@celljs/ta-glance 4.11.0 → 4.12.0
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/package.json +3 -3
- package/web/index.js +189 -109
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-glance",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "A pi package for Ta: replies lead with the answer, short, and show results as cards (key numbers, files, steps, comparisons, choices) rather than paragraphs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@celljs/ta-protocol": "4.
|
|
30
|
-
"@celljs/ta-web": "4.
|
|
29
|
+
"@celljs/ta-protocol": "4.12.0",
|
|
30
|
+
"@celljs/ta-web": "4.12.0",
|
|
31
31
|
"@types/react": "^19.3.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
package/web/index.js
CHANGED
|
@@ -141,10 +141,10 @@ function change(item) {
|
|
|
141
141
|
...note ? { note } : {}
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
function step(item) {
|
|
144
|
+
function step(item, partial) {
|
|
145
145
|
const value = object(item);
|
|
146
146
|
const shown = text(value?.text ?? value?.label ?? item);
|
|
147
|
-
return shown ? { text: shown, status: oneOf(value?.status, STEPS) ?? "done" } : undefined;
|
|
147
|
+
return shown ? { text: shown, status: oneOf(value?.status, STEPS) ?? (partial ? "todo" : "done") } : undefined;
|
|
148
148
|
}
|
|
149
149
|
function option(item) {
|
|
150
150
|
const value = object(item);
|
|
@@ -166,7 +166,7 @@ function note(item) {
|
|
|
166
166
|
const shown = text(value?.text ?? item);
|
|
167
167
|
return shown ? { text: shown, tone: oneOf(value?.tone, NOTES) ?? "info" } : undefined;
|
|
168
168
|
}
|
|
169
|
-
function block(item) {
|
|
169
|
+
function block(item, partial) {
|
|
170
170
|
const value = object(item);
|
|
171
171
|
const type = typeof value?.type === "string" ? value.type.trim().toLowerCase() : undefined;
|
|
172
172
|
const unit = text(value?.unit, 16);
|
|
@@ -180,7 +180,7 @@ function block(item) {
|
|
|
180
180
|
return list.length ? { type, items: list } : undefined;
|
|
181
181
|
}
|
|
182
182
|
case "steps": {
|
|
183
|
-
const list = items(value?.items, step);
|
|
183
|
+
const list = items(value?.items, (entry) => step(entry, partial));
|
|
184
184
|
return list.length ? { type, items: list } : undefined;
|
|
185
185
|
}
|
|
186
186
|
case "compare": {
|
|
@@ -240,14 +240,14 @@ function block(item) {
|
|
|
240
240
|
}
|
|
241
241
|
var GlanceSpec;
|
|
242
242
|
((GlanceSpec) => {
|
|
243
|
-
function read(value) {
|
|
243
|
+
function read(value, partial = false) {
|
|
244
244
|
const card = object(value);
|
|
245
245
|
if (!card) {
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
248
|
const status = oneOf(card.status, STATUSES);
|
|
249
249
|
const title = text(card.title);
|
|
250
|
-
const blocks = items(card.blocks, block).slice(0, BLOCKS);
|
|
250
|
+
const blocks = items(card.blocks, (entry) => block(entry, partial)).slice(0, BLOCKS);
|
|
251
251
|
if (!blocks.length && !title) {
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
@@ -355,7 +355,9 @@ function glanceCard(pi) {
|
|
|
355
355
|
text: item.value
|
|
356
356
|
})), /* @__PURE__ */ React.createElement("div", {
|
|
357
357
|
className: "tag-stat-label"
|
|
358
|
-
}, /* @__PURE__ */ React.createElement(
|
|
358
|
+
}, item.tone && !item.delta && /* @__PURE__ */ React.createElement("i", {
|
|
359
|
+
className: "tag-tone-dot"
|
|
360
|
+
}), /* @__PURE__ */ React.createElement(Text, {
|
|
359
361
|
text: item.label
|
|
360
362
|
}), item.delta && /* @__PURE__ */ React.createElement("span", {
|
|
361
363
|
className: "tag-delta"
|
|
@@ -447,7 +449,7 @@ function glanceCard(pi) {
|
|
|
447
449
|
return /* @__PURE__ */ React.createElement("div", {
|
|
448
450
|
className: "tag-compare"
|
|
449
451
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
450
|
-
className: "tag-legend"
|
|
452
|
+
className: "tag-section-head tag-legend"
|
|
451
453
|
}, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("i", {
|
|
452
454
|
"data-bar": "before"
|
|
453
455
|
}), words.before), /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement("i", {
|
|
@@ -506,8 +508,9 @@ function glanceCard(pi) {
|
|
|
506
508
|
function Flow({ block: block2 }) {
|
|
507
509
|
return /* @__PURE__ */ React.createElement("div", {
|
|
508
510
|
className: "tag-flow"
|
|
509
|
-
}, block2.items.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
510
|
-
key: index
|
|
511
|
+
}, block2.items.map((item, index) => /* @__PURE__ */ React.createElement("span", {
|
|
512
|
+
key: index,
|
|
513
|
+
className: "tag-flow-step"
|
|
511
514
|
}, index > 0 && /* @__PURE__ */ React.createElement("span", {
|
|
512
515
|
className: "tag-flow-arrow",
|
|
513
516
|
"aria-hidden": "true"
|
|
@@ -637,7 +640,7 @@ function glanceCard(pi) {
|
|
|
637
640
|
"aria-expanded": open,
|
|
638
641
|
onClick: () => setOpen(!open)
|
|
639
642
|
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
640
|
-
name:
|
|
643
|
+
name: "ChevronRight",
|
|
641
644
|
size: 14
|
|
642
645
|
}), /* @__PURE__ */ React.createElement("span", null, block2.title ?? words.details)), open && /* @__PURE__ */ React.createElement("div", {
|
|
643
646
|
className: "tag-details-body"
|
|
@@ -723,7 +726,7 @@ ${block2.mermaid}
|
|
|
723
726
|
}
|
|
724
727
|
return function GlanceCard({ code, closed }) {
|
|
725
728
|
const words = GlanceWords.of(pi.ui.language);
|
|
726
|
-
const card = React.useMemo(() => GlanceSpec.read(GlanceJson.parse(code, !closed)), [code, closed]);
|
|
729
|
+
const card = React.useMemo(() => GlanceSpec.read(GlanceJson.parse(code, !closed), !closed), [code, closed]);
|
|
727
730
|
if (!card) {
|
|
728
731
|
return closed ? /* @__PURE__ */ React.createElement(Markdown, {
|
|
729
732
|
text: `\`\`\`json
|
|
@@ -758,155 +761,232 @@ var LANGUAGE = "ta-glance";
|
|
|
758
761
|
|
|
759
762
|
// web-src/style.ts
|
|
760
763
|
var STYLE = `
|
|
761
|
-
/*
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
764
|
+
/*
|
|
765
|
+
* A card of a reply (\`\`\`ta-glance): parts one under another, a hairline between them. Its sizes follow the font
|
|
766
|
+
* scale of the conversation, and its layout the width of the card itself (a container), not the screen's, so that it
|
|
767
|
+
* reads the same in a phone, in the workbench and in a wide window.
|
|
768
|
+
* --tag-x / --tag-y the padding of a part (12 / 10 when narrow); tables and diagrams reach the edges with them
|
|
769
|
+
* --tag-lh the line of body text; marks (kinds, steps, notes) are centred on its first line
|
|
770
|
+
* --tag-mark the size of those marks
|
|
771
|
+
* Radii: the card 12, a box in it 8, a node 6, a letter 4, chips and pills round.
|
|
772
|
+
*/
|
|
773
|
+
.tag-card {
|
|
774
|
+
--tag-s: var(--ta-font-scale, 1);
|
|
775
|
+
--tag-x: 14px;
|
|
776
|
+
--tag-y: 12px;
|
|
777
|
+
--tag-text: calc(13px * var(--tag-s));
|
|
778
|
+
--tag-small: calc(12px * var(--tag-s));
|
|
779
|
+
--tag-tiny: calc(11px * var(--tag-s));
|
|
780
|
+
--tag-lh: calc(19.5px * var(--tag-s));
|
|
781
|
+
--tag-mark: calc(16px * var(--tag-s));
|
|
782
|
+
--tag-mark-top: calc((var(--tag-lh) - var(--tag-mark)) / 2);
|
|
783
|
+
--tag-line: var(--ta-border-muted);
|
|
784
|
+
container: tag-card / inline-size;
|
|
785
|
+
position: relative;
|
|
786
|
+
margin: 2px 0 12px;
|
|
787
|
+
border: 1px solid var(--ta-border);
|
|
788
|
+
border-radius: 12px;
|
|
789
|
+
background: var(--ta-card);
|
|
790
|
+
overflow: hidden;
|
|
791
|
+
font-size: var(--tag-text);
|
|
792
|
+
line-height: 1.5;
|
|
793
|
+
color: var(--ta-text);
|
|
794
|
+
overflow-wrap: anywhere;
|
|
795
|
+
text-align: left;
|
|
796
|
+
}
|
|
797
|
+
@container tag-card (max-width: 400px) { .tag-card > * { --tag-x: 12px; --tag-y: 10px; } }
|
|
798
|
+
.tag-card > * + * { border-top: 1px solid var(--tag-line); }
|
|
770
799
|
.tag-card ul, .tag-card ol { margin: 0; padding: 0; list-style: none; }
|
|
771
800
|
.tag-card li { margin: 0; }
|
|
772
|
-
.tag-
|
|
773
|
-
.tag-
|
|
801
|
+
.tag-card button { font-family: inherit; }
|
|
802
|
+
.tag-part { padding: var(--tag-y) var(--tag-x); min-width: 0; }
|
|
803
|
+
.tag-card[data-streaming] > .tag-part:last-child { animation: ta-in 200ms var(--ta-ease, ease) both; }
|
|
804
|
+
.tag-writing { display: flex; align-items: center; gap: 8px; padding: var(--tag-y) var(--tag-x); color: var(--ta-muted); font-size: var(--tag-small); }
|
|
805
|
+
.tag-inline .ta-markdown, .tag-inline .ta-markdown > p { display: inline; margin: 0; }
|
|
806
|
+
.tag-inline .ta-markdown :not(pre) > code { padding: 0 4px; font-size: 0.92em; }
|
|
807
|
+
.tag-num { font-variant-numeric: tabular-nums; }
|
|
808
|
+
|
|
809
|
+
/* The head: how it went, as a pill, and a title beside it that wraps under it when long */
|
|
810
|
+
.tag-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: var(--tag-y) var(--tag-x) 0; }
|
|
811
|
+
.tag-card > .tag-head + .tag-part { border-top: 0; padding-top: 8px; }
|
|
812
|
+
.tag-title { flex: 1 1 14em; min-width: 0; font-weight: 600; font-size: calc(14px * var(--tag-s)); line-height: 1.45; color: var(--ta-text); }
|
|
813
|
+
.tag-status { --tag-tone: var(--ta-muted); flex: none; display: inline-flex; align-items: center; gap: 6px; height: calc(22px * var(--tag-s)); padding: 0 9px; border-radius: 999px; font-size: var(--tag-small); font-weight: 600; line-height: 1; white-space: nowrap; color: var(--tag-tone); background: color-mix(in srgb, var(--tag-tone) 12%, transparent); }
|
|
774
814
|
.tag-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
|
|
775
815
|
.tag-status[data-status='done'] { --tag-tone: var(--ta-green); }
|
|
776
816
|
.tag-status[data-status='partial'], .tag-status[data-status='blocked'] { --tag-tone: var(--ta-yellow); }
|
|
777
817
|
.tag-status[data-status='failed'] { --tag-tone: var(--ta-red); }
|
|
778
|
-
|
|
818
|
+
|
|
819
|
+
/* What a part is about, in small muted type above it */
|
|
820
|
+
.tag-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 6px; color: var(--ta-muted); font-size: var(--tag-small); line-height: 1.4; }
|
|
821
|
+
.tag-section-head > span { display: inline-flex; align-items: center; gap: 5px; }
|
|
779
822
|
.tag-add { color: var(--ta-green); font-variant-numeric: tabular-nums; }
|
|
780
823
|
.tag-del { color: var(--ta-red); font-variant-numeric: tabular-nums; }
|
|
781
|
-
.tag-delta { margin-left: 6px; font-size:
|
|
782
|
-
[data-tone='good'] > .tag-stat-label > .tag-delta
|
|
783
|
-
[data-tone='bad'] > .tag-stat-label > .tag-delta
|
|
824
|
+
.tag-delta { margin-left: 6px; font-size: var(--tag-small); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ta-muted); }
|
|
825
|
+
.tag-delta[data-tone='good'], [data-tone='good'] > .tag-stat-label > .tag-delta { color: var(--ta-green); }
|
|
826
|
+
.tag-delta[data-tone='bad'], [data-tone='bad'] > .tag-stat-label > .tag-delta { color: var(--ta-red); }
|
|
784
827
|
[data-tone='warn'] > .tag-stat-label > .tag-delta { color: var(--ta-yellow); }
|
|
785
828
|
|
|
786
|
-
/* Key numbers: large, their names under them */
|
|
787
|
-
.tag-stats { --tag-columns: 3; display: grid; grid-template-columns: repeat(var(--tag-columns), minmax(0, 1fr)); gap:
|
|
829
|
+
/* Key numbers: large, their names under them; as many in a row as the card holds well */
|
|
830
|
+
.tag-stats { --tag-columns: 3; display: grid; grid-template-columns: repeat(var(--tag-columns), minmax(0, 1fr)); gap: 8px; }
|
|
788
831
|
.tag-stats[data-count='1'] { --tag-columns: 1; }
|
|
789
832
|
.tag-stats[data-count='2'], .tag-stats[data-count='4'] { --tag-columns: 2; }
|
|
790
|
-
@container (min-width:
|
|
791
|
-
@container (
|
|
792
|
-
.tag-
|
|
793
|
-
|
|
794
|
-
.tag-stat
|
|
795
|
-
.tag-stat
|
|
796
|
-
|
|
797
|
-
.tag-stat-label { margin-top: 2px; color: var(--ta-muted); font-size:
|
|
833
|
+
@container tag-card (min-width: 480px) { .tag-stats[data-count='4'] { --tag-columns: 4; } }
|
|
834
|
+
@container tag-card (min-width: 640px) { .tag-stats[data-count='5'] { --tag-columns: 5; } }
|
|
835
|
+
@container tag-card (max-width: 400px) { .tag-stats[data-count='5'], .tag-stats[data-count='6'] { --tag-columns: 2; } .tag-stats { gap: 6px; } .tag-stat { padding: 8px 10px; } }
|
|
836
|
+
@container tag-card (max-width: 300px) { .tag-stats[data-count='3'] { --tag-columns: 2; } }
|
|
837
|
+
.tag-stat { min-width: 0; padding: 10px 12px; border-radius: 8px; background: var(--ta-raised); }
|
|
838
|
+
.tag-stat-value { font-size: calc(20px * var(--tag-s)); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--ta-text); }
|
|
839
|
+
@container tag-card (max-width: 400px) { .tag-stat-value { font-size: calc(18px * var(--tag-s)); } }
|
|
840
|
+
.tag-stat-label { margin-top: 2px; color: var(--ta-muted); font-size: var(--tag-small); line-height: 1.4; }
|
|
841
|
+
.tag-tone-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; vertical-align: 0.1em; background: var(--ta-muted); }
|
|
842
|
+
[data-tone='good'] > .tag-stat-label > .tag-tone-dot { background: var(--ta-green); }
|
|
843
|
+
[data-tone='bad'] > .tag-stat-label > .tag-tone-dot { background: var(--ta-red); }
|
|
844
|
+
[data-tone='warn'] > .tag-stat-label > .tag-tone-dot { background: var(--ta-yellow); }
|
|
845
|
+
|
|
846
|
+
/* Rows with a mark: the mark on the first line of the text, whatever the font size */
|
|
847
|
+
.tag-change, .tag-step, .tag-notes li { padding: 3px 0; }
|
|
848
|
+
.tag-kind, .tag-step-mark, .tag-note-mark { flex: none; box-sizing: border-box; width: var(--tag-mark); height: var(--tag-mark); margin-top: var(--tag-mark-top); }
|
|
798
849
|
|
|
799
|
-
/* Files: a letter of what happened, the
|
|
800
|
-
.tag-change { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 8px;
|
|
801
|
-
.tag-
|
|
802
|
-
.tag-kind { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font: 600 10px/1 var(--ta-mono, ui-monospace, monospace); color: var(--ta-blue); background: color-mix(in srgb, currentColor 14%, transparent); margin-top: 3px; }
|
|
850
|
+
/* Files: a letter of what happened, the name and its folder, the lines, the squares of a forge */
|
|
851
|
+
.tag-change { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; column-gap: 8px; }
|
|
852
|
+
.tag-kind { display: inline-grid; place-items: center; border-radius: 4px; font: 600 calc(10px * var(--tag-s)) / 1 var(--ta-mono, ui-monospace, monospace); color: var(--ta-blue); background: color-mix(in srgb, currentColor 14%, transparent); }
|
|
803
853
|
.tag-kind[data-kind='add'] { color: var(--ta-green); }
|
|
804
854
|
.tag-kind[data-kind='delete'] { color: var(--ta-red); }
|
|
805
|
-
.tag-change-path {
|
|
806
|
-
.tag-change-file { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
|
|
807
|
-
.tag-change-name { flex:
|
|
808
|
-
.tag-change-name .ta-markdown a { color: var(--ta-text); }
|
|
809
|
-
.tag-change-
|
|
855
|
+
.tag-change-path { min-width: 0; }
|
|
856
|
+
.tag-change-file { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; min-width: 0; line-height: var(--tag-lh); }
|
|
857
|
+
.tag-change-name { flex: 0 1 auto; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
|
|
858
|
+
.tag-change-name .ta-markdown :is(a, .ta-link-path) { color: var(--ta-text); }
|
|
859
|
+
.tag-change-name :is(a, button) { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
|
|
860
|
+
.tag-change-dir { flex: 1 1 7em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; color: var(--ta-muted); font-size: var(--tag-small); line-height: 1.4; }
|
|
810
861
|
.tag-change-dir bdi { direction: ltr; unicode-bidi: isolate; }
|
|
811
|
-
.tag-change-note { color: var(--ta-muted); font-size:
|
|
812
|
-
.tag-change-count { display: inline-flex; align-items: center;
|
|
862
|
+
.tag-change-note { margin-top: 1px; color: var(--ta-muted); font-size: var(--tag-small); line-height: 1.45; }
|
|
863
|
+
.tag-change-count { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; height: var(--tag-lh); font-size: var(--tag-small); white-space: nowrap; }
|
|
813
864
|
.tag-squares { display: inline-flex; gap: 2px; }
|
|
814
|
-
.tag-squares i { width: 7px; height: 7px; border-radius: 1.5px; background: var(--ta-border); }
|
|
865
|
+
.tag-squares i { width: calc(7px * var(--tag-s)); height: calc(7px * var(--tag-s)); border-radius: 1.5px; background: var(--ta-border); }
|
|
815
866
|
.tag-squares i[data-kind='add'] { background: var(--ta-green); }
|
|
816
867
|
.tag-squares i[data-kind='del'] { background: var(--ta-red); }
|
|
868
|
+
@container tag-card (max-width: 400px) { .tag-squares { display: none; } }
|
|
817
869
|
|
|
818
|
-
/* Steps: marks on a thread */
|
|
819
|
-
.tag-
|
|
820
|
-
.tag-step { position:
|
|
821
|
-
.tag-step
|
|
822
|
-
.tag-step-mark {
|
|
870
|
+
/* Steps: marks on a thread; the thread is green where the steps are done */
|
|
871
|
+
.tag-step { position: relative; display: flex; gap: 10px; }
|
|
872
|
+
.tag-step:not(:last-child)::after { content: ''; position: absolute; left: calc(var(--tag-mark) / 2 - 0.5px); width: 1px; top: calc(3px + var(--tag-mark-top) + var(--tag-mark) + 2px); bottom: calc(2px - 3px - var(--tag-mark-top)); background: var(--ta-border); }
|
|
873
|
+
.tag-step[data-status='done']:not(:last-child)::after { background: color-mix(in srgb, var(--ta-green) 45%, var(--ta-border)); }
|
|
874
|
+
.tag-step-mark { display: inline-grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--ta-border-field); color: var(--ta-card); }
|
|
875
|
+
.tag-step-mark svg { width: calc(10px * var(--tag-s)); height: calc(10px * var(--tag-s)); stroke-width: 3; }
|
|
823
876
|
.tag-step[data-status='done'] .tag-step-mark { border: 0; background: var(--ta-green); }
|
|
824
877
|
.tag-step[data-status='failed'] .tag-step-mark { border: 0; background: var(--ta-red); }
|
|
825
|
-
.tag-step[data-status='skipped'] .tag-step-mark { color: var(--ta-muted); }
|
|
878
|
+
.tag-step[data-status='skipped'] .tag-step-mark { border-style: dashed; color: var(--ta-muted); }
|
|
826
879
|
.tag-step[data-status='doing'] .tag-step-mark { border-color: var(--ta-blue); border-top-color: transparent; animation: ta-spin 1s linear infinite; }
|
|
880
|
+
.tag-step-text { flex: 1; min-width: 0; }
|
|
881
|
+
.tag-step[data-status='doing'] .tag-step-text { font-weight: 500; }
|
|
827
882
|
.tag-step[data-status='todo'] .tag-step-text, .tag-step[data-status='skipped'] .tag-step-text { color: var(--ta-muted); }
|
|
828
|
-
.tag-step[data-status='skipped'] .tag-step-text { text-decoration: line-through; }
|
|
829
|
-
.tag-step-text { min-width: 0; overflow-wrap: anywhere; }
|
|
883
|
+
.tag-step[data-status='skipped'] .tag-step-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 60%, transparent); }
|
|
830
884
|
|
|
831
|
-
/* Before and after: two bars
|
|
832
|
-
.tag-legend { display:
|
|
833
|
-
.tag-
|
|
834
|
-
.tag-
|
|
835
|
-
.tag-measure
|
|
836
|
-
.tag-measure-
|
|
837
|
-
.tag-measure-label { min-width: 0; overflow-wrap: anywhere; }
|
|
838
|
-
.tag-measure-value { color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
885
|
+
/* Before and after: a measure, its numbers, two bars */
|
|
886
|
+
.tag-legend i { display: inline-block; width: 10px; height: 6px; border-radius: 3px; }
|
|
887
|
+
.tag-measure + .tag-measure { margin-top: 10px; }
|
|
888
|
+
.tag-measure-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; }
|
|
889
|
+
.tag-measure-label { flex: 1 1 auto; min-width: 0; }
|
|
890
|
+
.tag-measure-value { margin-left: auto; color: var(--ta-muted); font-size: var(--tag-small); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
839
891
|
.tag-measure-value b { color: var(--ta-text); font-weight: 600; }
|
|
840
|
-
.tag-track {
|
|
841
|
-
.tag-track
|
|
842
|
-
|
|
843
|
-
.tag-
|
|
844
|
-
|
|
845
|
-
[data-bar='
|
|
892
|
+
.tag-measure .tag-track { height: 5px; background: none; }
|
|
893
|
+
.tag-measure .tag-track + .tag-track { margin-top: 3px; }
|
|
894
|
+
.tag-measure-head + .tag-track { margin-top: 5px; }
|
|
895
|
+
.tag-track { display: block; height: 6px; border-radius: 3px; background: var(--ta-hover); overflow: hidden; }
|
|
896
|
+
.tag-track i { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--ta-accent); transition: width 0.4s var(--ta-ease, ease); }
|
|
897
|
+
.tag-track i[data-bar='before'], .tag-legend i[data-bar='before'] { background: var(--ta-border-field); }
|
|
898
|
+
.tag-legend i[data-bar='after'], .tag-track i[data-bar='after'][data-tone='good'] { background: var(--ta-green); }
|
|
899
|
+
.tag-track i[data-bar='after'][data-tone='bad'] { background: var(--ta-red); }
|
|
900
|
+
.tag-track i[data-bar='after'][data-tone='neutral'] { background: var(--ta-secondary); }
|
|
846
901
|
|
|
847
|
-
/* Amounts side by side */
|
|
848
|
-
.tag-bars { display: grid; grid-template-columns: minmax(0, max-content) minmax(
|
|
902
|
+
/* Amounts side by side: label, bar, value in a row; when narrow, the bar under its label and value */
|
|
903
|
+
.tag-bars { display: grid; grid-template-columns: minmax(0, max-content) minmax(64px, 1fr) auto; align-items: center; gap: 8px 12px; }
|
|
849
904
|
.tag-bar { display: contents; }
|
|
850
|
-
.tag-bar-label { min-width: 0;
|
|
851
|
-
.tag-bar .tag-track {
|
|
852
|
-
.tag-bar-
|
|
905
|
+
.tag-bar-label { min-width: 0; max-width: 16em; line-height: 1.4; }
|
|
906
|
+
.tag-bar .tag-track { height: 6px; }
|
|
907
|
+
.tag-bar .tag-track i { background: var(--ta-blue); }
|
|
908
|
+
.tag-bar-value { text-align: right; color: var(--ta-muted); font-size: var(--tag-small); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
909
|
+
@container tag-card (max-width: 400px) {
|
|
910
|
+
.tag-bars { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
|
|
911
|
+
.tag-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 5px 12px; }
|
|
912
|
+
.tag-bar-label { max-width: none; grid-area: 1 / 1; }
|
|
913
|
+
.tag-bar-value { grid-area: 1 / 2; }
|
|
914
|
+
.tag-bar .tag-track { grid-area: 2 / 1 / 3 / 3; }
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
/* A path: nodes and arrows; an arrow keeps to the node after it, so that no line ends with one */
|
|
918
|
+
.tag-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; }
|
|
919
|
+
.tag-flow-step { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; }
|
|
920
|
+
.tag-flow-node { min-width: 0; padding: 2px 10px; border: 1px solid var(--ta-border); border-radius: 6px; background: var(--ta-raised); line-height: var(--tag-lh); }
|
|
921
|
+
.tag-flow-arrow { flex: none; display: inline-flex; color: var(--ta-muted); }
|
|
922
|
+
.tag-flow-arrow svg { width: calc(13px * var(--tag-s)); height: calc(13px * var(--tag-s)); }
|
|
853
923
|
|
|
854
|
-
/* A
|
|
855
|
-
.tag-
|
|
856
|
-
.tag-flow-node { padding: 3px 10px; border: 1px solid var(--ta-border); border-radius: 8px; background: var(--ta-hover); overflow-wrap: anywhere; }
|
|
857
|
-
.tag-flow-arrow { display: inline-flex; color: var(--ta-muted); }
|
|
858
|
-
.tag-part[data-type='diagram'] .ta-markdown > :last-child { margin-bottom: 0; }
|
|
859
|
-
.tag-card > .tag-part[data-type='table'] { padding: 0; }
|
|
924
|
+
/* A table and a diagram reach the edges of the card, their columns lined up with the text above */
|
|
925
|
+
.tag-card > .tag-part[data-type='table'], .tag-card > .tag-part[data-type='diagram'] { padding: 0; }
|
|
860
926
|
.tag-card .tag-table { margin: 0; border: 0; border-radius: 0; }
|
|
861
|
-
.tag-card .tag-table
|
|
862
|
-
.tag-card .tag-table th
|
|
863
|
-
.tag-card .tag-table th:
|
|
927
|
+
.tag-card .tag-table table { font-size: var(--tag-text); }
|
|
928
|
+
.tag-card .tag-table th, .tag-card .tag-table td { padding: 7px 10px; }
|
|
929
|
+
.tag-card .tag-table th:first-child, .tag-card .tag-table td:first-child { padding-left: var(--tag-x); }
|
|
930
|
+
.tag-card .tag-table th:last-child, .tag-card .tag-table td:last-child { padding-right: var(--tag-x); }
|
|
931
|
+
.tag-card .tag-table th { font-size: var(--tag-small); color: var(--ta-secondary); }
|
|
932
|
+
.tag-card .ta-mermaid { margin: 0; border: 0; border-radius: 0; background: transparent; }
|
|
933
|
+
.tag-card .ta-mermaid .ta-code-bar { padding-left: var(--tag-x); padding-right: calc(var(--tag-x) - 4px); }
|
|
934
|
+
.tag-card .ta-markdown:has(> .ta-mermaid) { margin: 0; }
|
|
864
935
|
|
|
865
|
-
/* Choices: a
|
|
936
|
+
/* Choices: a box each, a button that answers; when narrow, the button under its choice */
|
|
866
937
|
.tag-question { margin-bottom: 8px; font-weight: 600; }
|
|
867
938
|
.tag-options { display: flex; flex-direction: column; gap: 8px; }
|
|
868
|
-
.tag-option { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ta-border); border-radius:
|
|
869
|
-
.tag-option-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap:
|
|
870
|
-
.tag-option[data-recommended] { border-color: color-mix(in srgb, var(--ta-green)
|
|
939
|
+
.tag-option { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ta-border); border-radius: 8px; transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s; }
|
|
940
|
+
.tag-option-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
941
|
+
.tag-option[data-recommended] { border-color: color-mix(in srgb, var(--ta-green) 50%, var(--ta-border)); background: color-mix(in srgb, var(--ta-green) 4%, transparent); }
|
|
871
942
|
.tag-option[data-chosen] { border-color: var(--ta-green); box-shadow: 0 0 0 1px var(--ta-green) inset; }
|
|
872
943
|
.tag-option[data-other] { opacity: 0.5; }
|
|
873
|
-
.tag-option-head { display: flex; align-items: center;
|
|
874
|
-
.tag-option-label { font-weight: 600;
|
|
875
|
-
.tag-badge { padding: 0 6px; border-radius: 999px; font-size:
|
|
876
|
-
.tag-option-detail { color: var(--ta-secondary); font-size:
|
|
877
|
-
.tag-points { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size:
|
|
878
|
-
.tag-points span { overflow-wrap: anywhere; }
|
|
944
|
+
.tag-option-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
|
|
945
|
+
.tag-option-label { font-weight: 600; }
|
|
946
|
+
.tag-badge { flex: none; padding: 0 6px; border-radius: 999px; font-size: var(--tag-tiny); line-height: calc(18px * var(--tag-s)); font-weight: 600; white-space: nowrap; color: var(--ta-green); background: color-mix(in srgb, var(--ta-green) 13%, transparent); }
|
|
947
|
+
.tag-option-detail { color: var(--ta-secondary); font-size: var(--tag-small); line-height: 1.45; }
|
|
948
|
+
.tag-points { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: var(--tag-small); line-height: 1.45; color: var(--ta-secondary); }
|
|
879
949
|
.tag-points span::before { margin-right: 3px; font-weight: 700; }
|
|
880
950
|
.tag-points span[data-tone='good']::before { content: '+'; color: var(--ta-green); }
|
|
881
951
|
.tag-points span[data-tone='bad']::before { content: '−'; color: var(--ta-red); }
|
|
882
952
|
.tag-choose { flex: none; display: inline-flex; align-items: center; gap: 4px; }
|
|
953
|
+
@container tag-card (max-width: 400px) {
|
|
954
|
+
.tag-option { flex-direction: column; align-items: stretch; gap: 10px; }
|
|
955
|
+
.tag-choose { width: 100%; }
|
|
956
|
+
}
|
|
883
957
|
|
|
884
958
|
/* Risks, notes, what to do */
|
|
885
|
-
.tag-notes {
|
|
886
|
-
.tag-notes li
|
|
887
|
-
.tag-
|
|
888
|
-
.tag-note-mark {
|
|
959
|
+
.tag-notes li { display: flex; gap: 8px; }
|
|
960
|
+
.tag-notes li > span:last-child { flex: 1; min-width: 0; }
|
|
961
|
+
.tag-note-mark { display: inline-grid; place-items: center; color: var(--ta-muted); }
|
|
962
|
+
.tag-note-mark svg { width: calc(14px * var(--tag-s)); height: calc(14px * var(--tag-s)); }
|
|
889
963
|
.tag-notes li[data-tone='risk'] .tag-note-mark { color: var(--ta-yellow); }
|
|
890
964
|
.tag-notes li[data-tone='todo'] .tag-note-mark { color: var(--ta-blue); }
|
|
891
965
|
|
|
892
966
|
/* What to ask next: chips that send it */
|
|
893
967
|
.tag-next { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
894
|
-
.tag-chip { display: inline-flex; align-items: center; gap:
|
|
895
|
-
.tag-chip svg { flex: none; color: var(--ta-muted); }
|
|
896
|
-
.tag-chip:hover:not(:disabled) { background: var(--ta-hover); }
|
|
968
|
+
.tag-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: calc(28px * var(--tag-s)); padding: 3px 12px 3px 10px; border: 1px solid var(--ta-border); border-radius: 999px; background: transparent; color: var(--ta-text); font-size: var(--tag-small); line-height: 1.4; cursor: pointer; text-align: left; transition: background 120ms, border-color 120ms; }
|
|
969
|
+
.tag-chip svg { flex: none; width: calc(13px * var(--tag-s)); height: calc(13px * var(--tag-s)); color: var(--ta-muted); }
|
|
897
970
|
.tag-chip:disabled { opacity: 0.5; cursor: default; }
|
|
898
|
-
.tag-part[data-type='next'] { padding-top:
|
|
971
|
+
.tag-part[data-type='next'] { padding-top: calc(var(--tag-y) - 2px); padding-bottom: calc(var(--tag-y) - 2px); }
|
|
899
972
|
|
|
900
973
|
/* Details, folded */
|
|
901
974
|
.tag-part[data-type='details'] { padding-top: 8px; padding-bottom: 8px; }
|
|
902
|
-
.tag-details-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--ta-muted); font
|
|
903
|
-
.tag-details-toggle
|
|
904
|
-
.tag-details-
|
|
975
|
+
.tag-details-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: calc(24px * var(--tag-s)); margin-left: -4px; padding: 0 6px 0 4px; border: 0; border-radius: 6px; background: none; color: var(--ta-muted); font-size: var(--tag-small); cursor: pointer; transition: color 120ms, background 120ms; }
|
|
976
|
+
.tag-details-toggle svg { width: calc(14px * var(--tag-s)); height: calc(14px * var(--tag-s)); transition: transform 150ms var(--ta-ease, ease); }
|
|
977
|
+
.tag-details-toggle[aria-expanded='true'] svg { transform: rotate(90deg); }
|
|
978
|
+
.tag-details-body { margin-top: 4px; padding-bottom: 4px; font-size: var(--tag-text); color: var(--ta-body); animation: ta-in 180ms var(--ta-ease, ease); }
|
|
905
979
|
.tag-details-body .ta-markdown > :last-child { margin-bottom: 0; }
|
|
906
980
|
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
981
|
+
@media (hover: hover) {
|
|
982
|
+
.tag-chip:hover:not(:disabled) { background: var(--ta-hover); border-color: var(--ta-border-field); }
|
|
983
|
+
.tag-details-toggle:hover { color: var(--ta-text); background: var(--ta-hover); }
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/* Touch: what is tapped is a finger high */
|
|
987
|
+
[data-touch] .tag-chip { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
|
|
988
|
+
[data-touch] .tag-choose { height: 36px; }
|
|
989
|
+
[data-touch] .tag-details-toggle { min-height: 32px; }
|
|
910
990
|
`;
|
|
911
991
|
function injectStyle() {
|
|
912
992
|
const element = document.createElement("style");
|