@cardstack/boxel-cli 0.11.0-unstable.1 → 0.11.0-unstable.3
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/bundled-realms/pretui/components/agent-mark.gts +98 -0
- package/bundled-realms/pretui/components/agent-question.gts +340 -37
- package/bundled-realms/pretui/components/answer-footer.gts +249 -0
- package/bundled-realms/pretui/components/card-embed.gts +523 -0
- package/bundled-realms/pretui/components/card-pills.gts +725 -0
- package/bundled-realms/pretui/components/code-block.gts +87 -45
- package/bundled-realms/pretui/components/collapsed-turn.gts +133 -12
- package/bundled-realms/pretui/components/compaction-chip.gts +81 -67
- package/bundled-realms/pretui/components/composer-cap.gts +516 -0
- package/bundled-realms/pretui/components/context-ring.gts +108 -0
- package/bundled-realms/pretui/components/diff-block.gts +1002 -31
- package/bundled-realms/pretui/components/diff-stat.gts +102 -0
- package/bundled-realms/pretui/components/jump-chip.gts +86 -53
- package/bundled-realms/pretui/components/markdown-stream.gts +799 -0
- package/bundled-realms/pretui/components/markdown-surface.gts +71 -0
- package/bundled-realms/pretui/components/plan-mark.gts +147 -0
- package/bundled-realms/pretui/components/prose.gts +185 -8
- package/bundled-realms/pretui/components/prose.md +6 -8
- package/bundled-realms/pretui/components/quick-look.gts +377 -0
- package/bundled-realms/pretui/components/reactions.gts +136 -0
- package/bundled-realms/pretui/components/recommendation.gts +67 -36
- package/bundled-realms/pretui/components/result-card.gts +58 -22
- package/bundled-realms/pretui/components/segmented-control.gts +13 -8
- package/bundled-realms/pretui/components/session-prep.gts +12 -11
- package/bundled-realms/pretui/components/sliding-highlight.gts +8 -3
- package/bundled-realms/pretui/components/speaker-label.gts +132 -0
- package/bundled-realms/pretui/components/state-glyph.gts +121 -0
- package/bundled-realms/pretui/components/step-list.gts +62 -60
- package/bundled-realms/pretui/components/stick-to-bottom.gts +1150 -0
- package/bundled-realms/pretui/components/system-line.gts +143 -0
- package/bundled-realms/pretui/components/task-checklist.gts +184 -0
- package/bundled-realms/pretui/components/thinking.gts +63 -94
- package/bundled-realms/pretui/components/tool-change-table.gts +285 -0
- package/bundled-realms/pretui/components/tool-gate.gts +462 -0
- package/bundled-realms/pretui/components/tool-group.gts +920 -0
- package/bundled-realms/pretui/components/tool-icon.ts +64 -0
- package/bundled-realms/pretui/components/tool-meta.gts +82 -0
- package/bundled-realms/pretui/components/tool-plan.gts +197 -0
- package/bundled-realms/pretui/components/tool-row.gts +2087 -0
- package/bundled-realms/pretui/components/turn-changes.gts +227 -0
- package/bundled-realms/pretui/components/user-bubble.gts +575 -0
- package/bundled-realms/pretui/components/work-item.gts +185 -48
- package/bundled-realms/pretui/docs/scroll-anchoring-protocol.md +136 -0
- package/bundled-realms/pretui/internal/markdown-projection.ts +438 -0
- package/bundled-realms/pretui/internal/mount-queue.ts +79 -0
- package/bundled-realms/pretui/internal/tool-phrases.ts +168 -0
- package/bundled-realms/pretui/package.json +2 -1
- package/bundled-test-harness/assets/{ai-module-creation-test-beRNwH-e.js → ai-module-creation-test-B6FQKqIl.js} +1 -1
- package/bundled-test-harness/assets/{app-QAuw0l8v.js → app-KpPqdyX3.js} +4 -4
- package/bundled-test-harness/assets/{binary-upload-dedupe-test-bI8T0QLl.js → binary-upload-dedupe-test-DN00y1tM.js} +1 -1
- package/bundled-test-harness/assets/{can-invoke-test-DVaU_yRT.js → can-invoke-test-Bl-EUFM3.js} +1 -1
- package/bundled-test-harness/assets/{card-chooser-paging-test-DnxMnXKR.js → card-chooser-paging-test-BNuZRHX3.js} +1 -1
- package/bundled-test-harness/assets/{card-chooser-test-DUSnLr-u.js → card-chooser-test-wKfPOOT4.js} +1 -1
- package/bundled-test-harness/assets/{card-def-field-def-relationships-test-GBUr3tFK.js → card-def-field-def-relationships-test-CduQ6zan.js} +1 -1
- package/bundled-test-harness/assets/{card-delete-test-CQveO1VC.js → card-delete-test-DKxolj5o.js} +1 -1
- package/bundled-test-harness/assets/{check-correctness-test-D2M2p66N.js → check-correctness-test-B-kgHztp.js} +1 -1
- package/bundled-test-harness/assets/choreo-BEHW-NOc.js +2 -0
- package/bundled-test-harness/assets/{choreo-CJfBb_EY.js → choreo-C2cpCfhA.js} +164 -13
- package/bundled-test-harness/assets/{choreo-feature-reel-test-D2OrygZv.js → choreo-feature-reel-test-CPI_6nkT.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-w07xqtO-.js → choreo-gallery-BxA9cyzF.js} +3 -3
- package/bundled-test-harness/assets/{choreo-gallery-build-order-test-yQg4JER6.js → choreo-gallery-build-order-test-CLVoseAJ.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-compositor-test-C2THCXJN.js → choreo-gallery-compositor-test-BpT5Ia6B.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-cover-test-D4T_Tk4s.js → choreo-gallery-cover-test-DL_fdSsh.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-crossing-stage-test-tHUPJ-Hy.js → choreo-gallery-crossing-stage-test-BcKHhpOK.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-demos-alive-test-BOtBOnEZ.js → choreo-gallery-demos-alive-test-KufLhXG8.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-drift-test-D_6U1Z2c.js → choreo-gallery-drift-test-Cx58rYIA.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-escort-test-DDBU0n4C.js → choreo-gallery-escort-test-Wz-emmID.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-films-test-CgW1NSdr.js → choreo-gallery-films-test-BFrVs5WW.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-filter-test-DUIsNwdO.js → choreo-gallery-filter-test-DCKQkhwe.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-fold-test-Chzlxvdr.js → choreo-gallery-fold-test-UtpDgpG9.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-guide-pages-test-DOWnqALT.js → choreo-gallery-guide-pages-test-rXDU9JLM.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-guides-test-Dra2J4LJ.js → choreo-gallery-guides-test-DfVFdIuU.js} +3 -3
- package/bundled-test-harness/assets/{choreo-gallery-hang-test-zzn1eiB-.js → choreo-gallery-hang-test-Cj7MbkFf.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-highlight-test-CW99hncQ.js → choreo-gallery-highlight-test-D6CF3IYZ.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-inline-edit-test-CYFm1kUz.js → choreo-gallery-inline-edit-test-LfHWsbqc.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-interruption-test-CYIBrKV9.js → choreo-gallery-interruption-test-CvQQAgTp.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-lone-stack-test-DL8R3SG7.js → choreo-gallery-lone-stack-test-D7Zci7fm.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-navigation-test-Dcv04kDx.js → choreo-gallery-navigation-test-DB1EnBEW.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-playhead-transport-test-Cfz7GsXl.js → choreo-gallery-playhead-transport-test-CtBlc6AJ.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-poplayout-subtree-test-CwoklBkW.js → choreo-gallery-poplayout-subtree-test-BQbmjsvI.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-presence-modes-test-BDCIZzJ0.js → choreo-gallery-presence-modes-test-CIdXVG1K.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-presentation-test-DlyiHwFf.js → choreo-gallery-presentation-test-C_rPFp29.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-reduced-motion-test-DVz5SKNR.js → choreo-gallery-reduced-motion-test-CH5w8Lw-.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-sheet-standalone-test-CpD_-BvS.js → choreo-gallery-sheet-standalone-test-CDgI4mGX.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-sheet-test-BjvAKHDL.js → choreo-gallery-sheet-test-5lsFX7Rk.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-site-test-oq_7y_PN.js → choreo-gallery-site-test-DbMa2xeC.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-stage-Bzr4_8Xd.js → choreo-gallery-stage-b3Sk86hp.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-stage-keyboard-test-a83d2euJ.js → choreo-gallery-stage-keyboard-test-ds6fT5Eg.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-stages-test-C9Sl1kH6.js → choreo-gallery-stages-test-ahioKCct.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-subdivision-test-BVVnkOwk.js → choreo-gallery-subdivision-test-g7anTDhT.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-table-plan-test-B0YdYEA0.js → choreo-gallery-table-plan-test-Bozc4uUf.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-theater-test-BLA147xw.js → choreo-gallery-theater-test-kE535d-b.js} +3 -3
- package/bundled-test-harness/assets/{choreo-gallery-tuning-test-DSXiNzCh.js → choreo-gallery-tuning-test-6rHkQBnZ.js} +1 -1
- package/bundled-test-harness/assets/{choreo-gallery-widget-room-test-BI574PdO.js → choreo-gallery-widget-room-test-0Vq-uTo1.js} +2 -2
- package/bundled-test-harness/assets/{choreo-gallery-wires-test-B6Mz2WZl.js → choreo-gallery-wires-test-CdtnAWYO.js} +1 -1
- package/bundled-test-harness/assets/clip-BLfuHi8g.js +2 -0
- package/bundled-test-harness/assets/{clip-C_pXjVvY.js → clip-q1QE5f73.js} +1 -1
- package/bundled-test-harness/assets/{codeblocks-test-AdolhdCA.js → codeblocks-test-BDD7qK_V.js} +1 -1
- package/bundled-test-harness/assets/{compaction-test-DvyAQq56.js → compaction-test-BweolkhG.js} +1 -1
- package/bundled-test-harness/assets/{container-DIF_9lZ9.css → container-B5B6u-xm.css} +29 -22
- package/bundled-test-harness/assets/{container-DvvqmNpg.js → container-BnJjIM6J.js} +9 -6
- package/bundled-test-harness/assets/{create-listing-modal-test-D95JfQab.js → create-listing-modal-test-FvcAKpIa.js} +1 -1
- package/bundled-test-harness/assets/{debug-message-test-BcNtj7Wr.js → debug-message-test-CJ18Evt7.js} +1 -1
- package/bundled-test-harness/assets/{externals-6ZWftYIb.js → externals-BWjhmCD4.js} +12 -12
- package/bundled-test-harness/assets/{fallback-banner-live-delete-test-5lnN1pv2.js → fallback-banner-live-delete-test-C2H3BrT-.js} +1 -1
- package/bundled-test-harness/assets/{fallback-banner-test-DFb_m_Kq.js → fallback-banner-test-C10aYjkj.js} +1 -1
- package/bundled-test-harness/assets/{fallback-models-test-p3YIwj1L.js → fallback-models-test-BxoPiaGF.js} +1 -1
- package/bundled-test-harness/assets/{file-attachment-test-CmyjNWRR.js → file-attachment-test-DeKyzYaz.js} +1 -1
- package/bundled-test-harness/assets/film-B68PjRlr.js +2 -0
- package/bundled-test-harness/assets/{film-D7vtJO5q.js → film-CeUpnHN_.js} +6 -6
- package/bundled-test-harness/assets/{film-DN0A8JHx.js → film-DBZqyqW4.js} +6 -6
- package/bundled-test-harness/assets/{general-test-CX-TFDuX.js → general-test-BewzrpoB.js} +1 -1
- package/bundled-test-harness/assets/{glimmer-motion-and-choreo-in-cards-test-BHte2t9G.js → glimmer-motion-and-choreo-in-cards-test-HA-INN3d.js} +14 -14
- package/bundled-test-harness/assets/{glimmer-motion-and-choreo-test-BPNVeIio.js → glimmer-motion-and-choreo-test-BZ0ZuuAw.js} +3 -3
- package/bundled-test-harness/assets/{index-query-engine-test-Dz7Q4Xmk.js → index-query-engine-test-BtI8Y2LR.js} +1 -1
- package/bundled-test-harness/assets/{instance-filter-matcher-test-BoLU3bVg.js → instance-filter-matcher-test-BHXHGHjE.js} +1 -1
- package/bundled-test-harness/assets/{main-Dlgp8c7v.js → main-CqAHZ2kK.js} +1 -1
- package/bundled-test-harness/assets/{message-tool-test-CfjRSJvt.js → message-tool-test-NMaPJFsd.js} +1 -1
- package/bundled-test-harness/assets/{model-cost-tier-test-mZG84Uso.js → model-cost-tier-test-BgbfN2LH.js} +1 -1
- package/bundled-test-harness/assets/{operation-lowering-test-B0KpI1xu.js → operation-lowering-test-C4IaOjsA.js} +1 -1
- package/bundled-test-harness/assets/{operator-mode-card-chooser-test-KWS8lq16.js → operator-mode-card-chooser-test-Bwe47Rn7.js} +1 -1
- package/bundled-test-harness/assets/{operator-mode-links-test-CViFt0Ws.js → operator-mode-links-test-BU4jkC-B.js} +1 -1
- package/bundled-test-harness/assets/{operator-mode-test-D0gZM2yw.js → operator-mode-test-Bh0rGM9z.js} +1 -1
- package/bundled-test-harness/assets/{operator-mode-ui-test-CEvHJ9DS.js → operator-mode-ui-test-whgUw0ju.js} +1 -1
- package/bundled-test-harness/assets/{overlay-menu-items-test-Pw80RXsr.js → overlay-menu-items-test-Cwn1vr8q.js} +1 -1
- package/bundled-test-harness/assets/{overlays-BnOM360u.js → overlays-BOzLbVDK.js} +1 -1
- package/bundled-test-harness/assets/{overlays-kBVfa4i8.js → overlays-C_PuGDGh.js} +1 -1
- package/bundled-test-harness/assets/{past-sessions-test-CW0-Bjav.js → past-sessions-test-Bh24N-Kz.js} +1 -1
- package/bundled-test-harness/assets/{permission-checking-realm-test-D5uXQypS.js → permission-checking-realm-test-DKnnAy0f.js} +1 -1
- package/bundled-test-harness/assets/{plate-CFvCDv2t.js → plate-BL7UtyKE.js} +1 -1
- package/bundled-test-harness/assets/plate-CqG3igCJ.js +2 -0
- package/bundled-test-harness/assets/player-BJfsgdSI.js +2 -0
- package/bundled-test-harness/assets/{player-DzuYjrTU.js → player-Da_CIsp_.js} +1 -1
- package/bundled-test-harness/assets/{realm-config-policy-standing-test-Btatheni.js → realm-config-policy-standing-test-DngdYypq.js} +1 -1
- package/bundled-test-harness/assets/{realm-config-routing-rule-edit-test-Dh5zW13o.js → realm-config-routing-rule-edit-test-_rkFU8SN.js} +1 -1
- package/bundled-test-harness/assets/{realm-config-settings-test-BJa8gv_C.js → realm-config-settings-test-CR9NH0Zn.js} +1 -1
- package/bundled-test-harness/assets/{reasoning-test-2Zp37cQB.js → reasoning-test-0lH10kRl.js} +1 -1
- package/bundled-test-harness/assets/{room-message-test-BsrON13e.js → room-message-test-C-PddE4Y.js} +1 -1
- package/bundled-test-harness/assets/{run-BMyvn_UL.js → run-D4n4LPcK.js} +96 -6
- package/bundled-test-harness/assets/{run-realm-code-BxktQf6R.js → run-realm-code-C8N7DtN-.js} +1 -1
- package/bundled-test-harness/assets/{run-realm-code-test-7grpTos-.js → run-realm-code-test-DBdp147q.js} +1 -1
- package/bundled-test-harness/assets/{schema-generation-test-CM9ggQji.js → schema-generation-test-CB1Hb7GQ.js} +1 -1
- package/bundled-test-harness/assets/{scrolling-test-BER00htB.js → scrolling-test-3PhVin8h.js} +1 -1
- package/bundled-test-harness/assets/{searchable-option-test-BBr5BPow.js → searchable-option-test-BAdOiL4U.js} +1 -1
- package/bundled-test-harness/assets/{sending-test-BJGobs2E.js → sending-test-KSmu1tSJ.js} +1 -1
- package/bundled-test-harness/assets/{skills-test-GPOsHRN6.js → skills-test-D-dlcFpd.js} +1 -1
- package/bundled-test-harness/assets/{src-Df148w_b.js → src-B_DEhPze.js} +4 -4
- package/bundled-test-harness/assets/{src-Cf2wv-Le.js → src-BoTgwqUA.js} +2 -2
- package/bundled-test-harness/assets/{store-test-QvvHimzH.js → store-test-CEW7xQjZ.js} +1 -1
- package/bundled-test-harness/assets/{test-support-rNHuieEc.js → test-support-FXDPpIl3.js} +1 -1
- package/bundled-test-harness/assets/{test-support-C6N_2X-l.js → test-support-VX6ukQNR.js} +1 -1
- package/bundled-test-harness/assets/{tests-CmsQ-Z_3.js → tests-QYqqa6nv.js} +84 -84
- package/bundled-test-harness/assets/{text-input-validator-test-CYYH2N0L.js → text-input-validator-test-D8iNOWep.js} +1 -1
- package/bundled-test-harness/assets/{titles-B1pTaIfP.js → titles-DFJj5O0E.js} +1 -1
- package/bundled-test-harness/assets/titles-xGlgu7ys.js +2 -0
- package/bundled-test-harness/assets/{to-device-streaming-test-Ctqa0bVp.js → to-device-streaming-test-trCX-505.js} +1 -1
- package/bundled-test-harness/assets/{token-usage-test-BQVbK3X0.js → token-usage-test-C6sULooH.js} +1 -1
- package/bundled-test-harness/assets/{tools-DU8Rc15s.js → tools-UJfD-_al.js} +1 -1
- package/bundled-test-harness/assets/{tools-test-B13yvEKE.js → tools-test-Brav31AV.js} +1 -1
- package/bundled-test-harness/assets/{worker-DHBEBihX.js → worker-9ph9_Lpv.js} +31 -26
- package/bundled-test-harness/index.html +8 -8
- package/bundled-test-harness/tests/index.html +8 -8
- package/bundled-types/choreo/beacons.ts +16 -4
- package/bundled-types/choreo/changeset.ts +25 -5
- package/bundled-types/choreo/choreo.gts +245 -3
- package/bundled-types/choreo/far.ts +39 -0
- package/bundled-types/choreo/index.ts +2 -0
- package/bundled-types/choreo/run.ts +104 -1
- package/bundled-types/host-app/lib/realm-runner/worker.ts +8 -51
- package/bundled-types/runtime-common/realm-runner-script.d.ts +3 -0
- package/package.json +1 -1
- package/bundled-test-harness/assets/choreo-B3Z9QhDH.js +0 -2
- package/bundled-test-harness/assets/clip-BjcXuTwN.js +0 -2
- package/bundled-test-harness/assets/film-DMDPP7ma.js +0 -2
- package/bundled-test-harness/assets/plate-66qnQ-M9.js +0 -2
- package/bundled-test-harness/assets/player-pygg1PwA.js +0 -2
- package/bundled-test-harness/assets/titles-Ccpcl-jq.js +0 -2
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
// Pretui — ToolChangeTable: a bulk write's changes, one line per card, folded after a few.
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { on } from '@ember/modifier';
|
|
5
|
+
import { fn } from '@ember/helper';
|
|
6
|
+
import { modifier } from 'ember-modifier';
|
|
7
|
+
import ArrowRight from '@cardstack/boxel-icons/arrow-right';
|
|
8
|
+
|
|
9
|
+
export interface ToolChangeRow {
|
|
10
|
+
/** the card the change is on: 'Lena Ruiz' */
|
|
11
|
+
card: string;
|
|
12
|
+
/** what the change was, as the card says it: 'Became a Regular'. A
|
|
13
|
+
* change from one value to another gives `from` and `to` instead, and
|
|
14
|
+
* the table draws the arrow between them */
|
|
15
|
+
change?: string;
|
|
16
|
+
/** the value before: 'Member' */
|
|
17
|
+
from?: string;
|
|
18
|
+
/** the value after: 'Regular' */
|
|
19
|
+
to?: string;
|
|
20
|
+
/** a change that did not land: 'changed since the preview' */
|
|
21
|
+
skipped?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ToolChangeTableSignature {
|
|
25
|
+
Args: {
|
|
26
|
+
rows: ToolChangeRow[];
|
|
27
|
+
/** the change column's heading. Default 'Change' */
|
|
28
|
+
changeLabel?: string;
|
|
29
|
+
/** how many rows show before "Show N more". Default 4 */
|
|
30
|
+
limit?: number;
|
|
31
|
+
/** the table's caption, for a screen reader. Default 'Changes' */
|
|
32
|
+
caption?: string;
|
|
33
|
+
/** each row gets a checkbox: the reader keeps some of a bulk write */
|
|
34
|
+
selectable?: boolean;
|
|
35
|
+
/** the cards chosen, by name; controlled */
|
|
36
|
+
selected?: string[];
|
|
37
|
+
onSelectionChange?: (cards: string[]) => void;
|
|
38
|
+
};
|
|
39
|
+
Element: HTMLDivElement;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* What a write did to each card, for a write across many: Lena Ruiz ·
|
|
44
|
+
* Member to Regular, then "Show 36 more". One ToolChange says one field's
|
|
45
|
+
* change; this says one change across forty cards.
|
|
46
|
+
*/
|
|
47
|
+
export class ToolChangeTable extends Component<ToolChangeTableSignature> {
|
|
48
|
+
@tracked showAll = false;
|
|
49
|
+
get limit() {
|
|
50
|
+
return this.args.limit ?? 4;
|
|
51
|
+
}
|
|
52
|
+
get shown(): ToolChangeRow[] {
|
|
53
|
+
return this.showAll ? this.args.rows : this.args.rows.slice(0, this.limit);
|
|
54
|
+
}
|
|
55
|
+
get more(): number {
|
|
56
|
+
return this.args.rows.length - this.shown.length;
|
|
57
|
+
}
|
|
58
|
+
/** set by "Show N more": the first row it reveals takes focus, since
|
|
59
|
+
* the button the reader pressed leaves the page */
|
|
60
|
+
private focusFrom: number | undefined;
|
|
61
|
+
expand = () => {
|
|
62
|
+
this.focusFrom = this.limit;
|
|
63
|
+
this.showAll = true;
|
|
64
|
+
};
|
|
65
|
+
focusIfFirstShown = modifier(
|
|
66
|
+
(element: HTMLElement, [index]: [number]) => {
|
|
67
|
+
if (index === this.focusFrom) {
|
|
68
|
+
this.focusFrom = undefined;
|
|
69
|
+
element.setAttribute('tabindex', '-1');
|
|
70
|
+
element.focus();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
isSelected = (row: ToolChangeRow) =>
|
|
75
|
+
(this.args.selected ?? []).includes(row.card);
|
|
76
|
+
get allSelected(): boolean {
|
|
77
|
+
let chosen = this.args.selected ?? [];
|
|
78
|
+
return this.args.rows.every((r) => r.skipped || chosen.includes(r.card));
|
|
79
|
+
}
|
|
80
|
+
toggleRow = (row: ToolChangeRow, event: Event) => {
|
|
81
|
+
let on = (event.target as HTMLInputElement).checked;
|
|
82
|
+
let chosen = new Set(this.args.selected ?? []);
|
|
83
|
+
if (on) {
|
|
84
|
+
chosen.add(row.card);
|
|
85
|
+
} else {
|
|
86
|
+
chosen.delete(row.card);
|
|
87
|
+
}
|
|
88
|
+
this.args.onSelectionChange?.(
|
|
89
|
+
this.args.rows.map((r) => r.card).filter((c) => chosen.has(c)),
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
toggleAll = (event: Event) => {
|
|
93
|
+
let on = (event.target as HTMLInputElement).checked;
|
|
94
|
+
this.args.onSelectionChange?.(
|
|
95
|
+
on ? this.args.rows.filter((r) => !r.skipped).map((r) => r.card) : [],
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
<template>
|
|
99
|
+
<div
|
|
100
|
+
class='pretui-changetable'
|
|
101
|
+
data-test-pretui-tool-change-table
|
|
102
|
+
...attributes
|
|
103
|
+
>
|
|
104
|
+
<table>
|
|
105
|
+
<caption class='pretui-changetable-caption'>{{if
|
|
106
|
+
@caption
|
|
107
|
+
@caption
|
|
108
|
+
'Changes'
|
|
109
|
+
}}</caption>
|
|
110
|
+
<thead>
|
|
111
|
+
<tr>
|
|
112
|
+
{{#if @selectable}}<th
|
|
113
|
+
scope='col'
|
|
114
|
+
class='pretui-changetable-pick'
|
|
115
|
+
><input
|
|
116
|
+
type='checkbox'
|
|
117
|
+
aria-label='Keep every change'
|
|
118
|
+
checked={{this.allSelected}}
|
|
119
|
+
{{on 'change' this.toggleAll}}
|
|
120
|
+
data-test-pretui-tool-change-table-all
|
|
121
|
+
/></th>{{/if}}
|
|
122
|
+
<th scope='col'>Card</th>
|
|
123
|
+
<th scope='col'>{{if @changeLabel @changeLabel 'Change'}}</th>
|
|
124
|
+
</tr>
|
|
125
|
+
</thead>
|
|
126
|
+
<tbody>
|
|
127
|
+
{{#each this.shown as |row index|}}
|
|
128
|
+
<tr
|
|
129
|
+
data-skipped={{if row.skipped 'true'}}
|
|
130
|
+
{{this.focusIfFirstShown index}}
|
|
131
|
+
data-test-pretui-tool-change-row={{row.card}}
|
|
132
|
+
>
|
|
133
|
+
{{#if @selectable}}<td class='pretui-changetable-pick'><input
|
|
134
|
+
type='checkbox'
|
|
135
|
+
aria-label='Keep the change to {{row.card}}'
|
|
136
|
+
checked={{this.isSelected row}}
|
|
137
|
+
disabled={{if row.skipped true}}
|
|
138
|
+
{{on 'change' (fn this.toggleRow row)}}
|
|
139
|
+
data-test-pretui-tool-change-pick={{row.card}}
|
|
140
|
+
/></td>{{/if}}
|
|
141
|
+
<th scope='row'>{{row.card}}</th>
|
|
142
|
+
<td>
|
|
143
|
+
{{#if row.to}}{{#if row.from}}<span
|
|
144
|
+
class='pretui-changetable-from'
|
|
145
|
+
>{{row.from}}</span><ArrowRight
|
|
146
|
+
class='pretui-changetable-arrow'
|
|
147
|
+
width='12'
|
|
148
|
+
height='12'
|
|
149
|
+
role='img'
|
|
150
|
+
aria-label='changed to'
|
|
151
|
+
/>{{/if}}{{row.to}}{{else}}{{row.change}}{{/if}}
|
|
152
|
+
{{#if row.skipped}}<span
|
|
153
|
+
class='pretui-changetable-skipped'
|
|
154
|
+
>{{row.skipped}}</span>{{/if}}
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
{{/each}}
|
|
158
|
+
</tbody>
|
|
159
|
+
</table>
|
|
160
|
+
{{#if this.more}}
|
|
161
|
+
<button
|
|
162
|
+
type='button'
|
|
163
|
+
class='pretui-changetable-more'
|
|
164
|
+
{{on 'click' this.expand}}
|
|
165
|
+
data-test-pretui-tool-change-table-more
|
|
166
|
+
>Show {{this.more}} more</button>
|
|
167
|
+
{{/if}}
|
|
168
|
+
</div>
|
|
169
|
+
<style scoped>
|
|
170
|
+
@layer PretComponent {
|
|
171
|
+
.pretui-changetable-from {
|
|
172
|
+
color: var(--subtle-foreground);
|
|
173
|
+
}
|
|
174
|
+
.pretui-changetable-arrow {
|
|
175
|
+
margin-inline: var(--boxel-sp-4xs);
|
|
176
|
+
vertical-align: -0.1em;
|
|
177
|
+
color: var(--subtle-foreground);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
@layer PretComponent {
|
|
181
|
+
.pretui-changetable {
|
|
182
|
+
display: grid;
|
|
183
|
+
justify-items: start;
|
|
184
|
+
gap: var(--boxel-sp-4xs);
|
|
185
|
+
padding-inline-start: calc(
|
|
186
|
+
var(--pretui-toolrow-disc, var(--boxel-sp)) +
|
|
187
|
+
var(--pretui-toolrow-gap, var(--boxel-sp-xs))
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
table {
|
|
191
|
+
width: 100%;
|
|
192
|
+
border-collapse: collapse;
|
|
193
|
+
font-size: var(--boxel-ui-label-font-size);
|
|
194
|
+
line-height: var(--boxel-ui-label-line-height);
|
|
195
|
+
font-variant-numeric: tabular-nums;
|
|
196
|
+
}
|
|
197
|
+
.pretui-changetable-caption {
|
|
198
|
+
position: absolute;
|
|
199
|
+
width: 1px;
|
|
200
|
+
height: 1px;
|
|
201
|
+
overflow: hidden;
|
|
202
|
+
clip-path: inset(50%);
|
|
203
|
+
white-space: nowrap;
|
|
204
|
+
}
|
|
205
|
+
/* table headers are the one place tracked caps stay: sans, caption
|
|
206
|
+
size, 0.04em */
|
|
207
|
+
thead th {
|
|
208
|
+
padding: 0 var(--boxel-sp-xs) var(--boxel-sp-4xs) 0;
|
|
209
|
+
font-size: var(--boxel-caption-font-size);
|
|
210
|
+
line-height: var(--boxel-caption-line-height);
|
|
211
|
+
font-weight: 600;
|
|
212
|
+
letter-spacing: 0.04em;
|
|
213
|
+
text-align: start;
|
|
214
|
+
text-transform: uppercase;
|
|
215
|
+
color: var(--subtle-foreground);
|
|
216
|
+
box-shadow: inset 0 -1px 0 var(--border);
|
|
217
|
+
}
|
|
218
|
+
tbody th,
|
|
219
|
+
tbody td {
|
|
220
|
+
padding: var(--boxel-sp-4xs) var(--boxel-sp-xs) var(--boxel-sp-4xs) 0;
|
|
221
|
+
text-align: start;
|
|
222
|
+
vertical-align: baseline;
|
|
223
|
+
box-shadow: inset 0 -1px 0 var(--border);
|
|
224
|
+
}
|
|
225
|
+
.pretui-changetable-pick {
|
|
226
|
+
width: 1.25rem;
|
|
227
|
+
padding-inline-end: var(--boxel-sp-xs);
|
|
228
|
+
}
|
|
229
|
+
.pretui-changetable-pick input {
|
|
230
|
+
accent-color: var(--primary);
|
|
231
|
+
}
|
|
232
|
+
tbody th {
|
|
233
|
+
font-weight: 600;
|
|
234
|
+
color: var(--foreground);
|
|
235
|
+
white-space: nowrap;
|
|
236
|
+
}
|
|
237
|
+
tbody td {
|
|
238
|
+
color: var(--pretui-toolrow-settled-ink, var(--foreground));
|
|
239
|
+
}
|
|
240
|
+
tbody tr:last-child th,
|
|
241
|
+
tbody tr:last-child td {
|
|
242
|
+
box-shadow: none;
|
|
243
|
+
}
|
|
244
|
+
tbody tr:focus-visible {
|
|
245
|
+
outline: 2px solid var(--ring);
|
|
246
|
+
outline-offset: -2px;
|
|
247
|
+
}
|
|
248
|
+
tr[data-skipped] th,
|
|
249
|
+
tr[data-skipped] td {
|
|
250
|
+
color: var(--muted-foreground);
|
|
251
|
+
}
|
|
252
|
+
tr[data-skipped] td {
|
|
253
|
+
text-decoration: line-through;
|
|
254
|
+
}
|
|
255
|
+
.pretui-changetable-skipped {
|
|
256
|
+
display: block;
|
|
257
|
+
font-size: var(--boxel-caption-font-size);
|
|
258
|
+
line-height: var(--boxel-caption-line-height);
|
|
259
|
+
text-decoration: none;
|
|
260
|
+
color: var(--attention-ink);
|
|
261
|
+
}
|
|
262
|
+
/* 1.5rem tall, the smallest target a pointer is asked to hit */
|
|
263
|
+
.pretui-changetable-more {
|
|
264
|
+
min-height: 1.5rem;
|
|
265
|
+
padding: 0;
|
|
266
|
+
border: 0;
|
|
267
|
+
background-color: transparent;
|
|
268
|
+
font-family: inherit;
|
|
269
|
+
font-size: var(--boxel-caption-font-size);
|
|
270
|
+
line-height: var(--boxel-caption-line-height);
|
|
271
|
+
font-variant-numeric: tabular-nums;
|
|
272
|
+
color: var(--muted-foreground);
|
|
273
|
+
cursor: pointer;
|
|
274
|
+
}
|
|
275
|
+
.pretui-changetable-more:hover {
|
|
276
|
+
color: var(--primary-ink);
|
|
277
|
+
}
|
|
278
|
+
.pretui-changetable-more:focus-visible {
|
|
279
|
+
outline: 2px solid var(--ring);
|
|
280
|
+
outline-offset: 1px;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
</style>
|
|
284
|
+
</template>
|
|
285
|
+
}
|