@remit/ui 0.0.121 → 0.0.123
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 +1 -1
- package/src/components/app-shell-slotted.tsx +5 -1
- package/src/components/compose-body.language.test.ts +236 -0
- package/src/components/compose-body.stories.tsx +26 -0
- package/src/components/compose-form-shell.render.test.ts +59 -0
- package/src/components/compose-form-shell.tsx +36 -10
- package/src/components/email-frame-css.ts +110 -29
- package/src/components/isolated-email-frame.render.test.ts +174 -36
- package/src/components/isolated-email-frame.stories.tsx +518 -33
- package/src/components/isolated-email-frame.tsx +58 -135
- package/src/components/message-body-view.stories.tsx +200 -2
- package/src/components/message-body-view.tsx +82 -33
- package/src/components/mobile-reading-pane.tsx +2 -1
- package/src/components/reading-pane.stories.tsx +138 -3
- package/src/components/reading-pane.tsx +35 -26
- package/src/components/resizable.tsx +42 -0
- package/src/components/selection-wizard.render.test.ts +42 -1
- package/src/components/selection-wizard.tsx +50 -29
- package/src/components/slide-panel.tsx +7 -3
- package/src/index.ts +8 -1
- package/src/lib/compose-language.test.ts +17 -0
- package/src/lib/compose-language.ts +17 -6
- package/src/lib/detect-compose-language.test.ts +18 -0
- package/src/lib/email-layout-clamp.test.ts +30 -0
- package/src/lib/email-layout-clamp.ts +17 -0
- package/src/lib/email-sanitizer.test.ts +153 -0
- package/src/lib/email-sanitizer.ts +165 -0
- package/src/lib/keymap.test.ts +16 -0
- package/src/lib/keymap.ts +16 -4
- package/src/lib/wizard-steps.test.ts +11 -0
- package/src/lib/wizard-steps.ts +21 -0
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
backExits,
|
|
10
10
|
clauseSentence,
|
|
11
11
|
clauseWords,
|
|
12
|
+
crossAccountMatchReason,
|
|
12
13
|
ESCALATED_MATCH_HINT,
|
|
13
14
|
ESCALATED_REVIEW_WARNING,
|
|
14
15
|
escalatedMatchLabel,
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
type MatchMode,
|
|
17
18
|
matchDoorHint,
|
|
18
19
|
matchDoorLabel,
|
|
20
|
+
matchDoorsFor,
|
|
19
21
|
matchPhrase,
|
|
20
22
|
matchSummary,
|
|
21
23
|
type RunState,
|
|
@@ -683,6 +685,15 @@ describe("sample and door vocabulary", () => {
|
|
|
683
685
|
assert.match(ESCALATED_REVIEW_WARNING, /by the time it runs/);
|
|
684
686
|
});
|
|
685
687
|
|
|
688
|
+
it("withholds the widened doors where there is no single account", () => {
|
|
689
|
+
assert.deepEqual(
|
|
690
|
+
[...matchDoorsFor("acc-personal")],
|
|
691
|
+
["selected", "similar", "properties"],
|
|
692
|
+
);
|
|
693
|
+
assert.deepEqual([...matchDoorsFor(undefined)], ["selected"]);
|
|
694
|
+
assert.match(crossAccountMatchReason, /within one account/);
|
|
695
|
+
});
|
|
696
|
+
|
|
686
697
|
it("names each door and what it does", () => {
|
|
687
698
|
assert.equal(matchDoorLabel("selected", 3), "These 3 messages");
|
|
688
699
|
assert.equal(matchDoorLabel("similar", 3), "Similar to these 3");
|
package/src/lib/wizard-steps.ts
CHANGED
|
@@ -223,6 +223,27 @@ export const crossAccountRuleReason =
|
|
|
223
223
|
export const crossAccountDestinationReason =
|
|
224
224
|
"A destination only works within one account — clear the selection, or pick messages from a single account.";
|
|
225
225
|
|
|
226
|
+
/**
|
|
227
|
+
* The same restriction on the step that asks what the action applies to (#523).
|
|
228
|
+
* Both widened doors are resolved by a preview one account answers, so a
|
|
229
|
+
* selection with no single account has nothing to count them against. The ticked
|
|
230
|
+
* rows are their own match and are unaffected.
|
|
231
|
+
*/
|
|
232
|
+
export const crossAccountMatchReason =
|
|
233
|
+
"Matching beyond the messages you picked only works within one account — clear the selection, or pick messages from a single account.";
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The doors the match step offers. Withholding the two widened ones is what
|
|
237
|
+
* keeps a selection spanning accounts off a review that waits on a count nobody
|
|
238
|
+
* can take; the step says why in `crossAccountMatchReason`.
|
|
239
|
+
*/
|
|
240
|
+
export const matchDoorsFor = (
|
|
241
|
+
accountId: string | undefined,
|
|
242
|
+
): readonly MatchDoor[] =>
|
|
243
|
+
accountId === undefined
|
|
244
|
+
? ["selected"]
|
|
245
|
+
: ["selected", "similar", "properties"];
|
|
246
|
+
|
|
226
247
|
/**
|
|
227
248
|
* The match reached nothing, so committing it would report a bulk action that
|
|
228
249
|
* touched no mail. Reachable both from a predicate that matches nothing and from
|