Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'refs/heads/develop' into florianduros/tooltip/context-menu
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	yarn.lock
  • Loading branch information
florianduros committed May 15, 2024
2 parents 981de85 + 580bc87 commit 8c9205a
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 42 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@sentry/browser": "^7.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@vector-im/compound-design-tokens": "^1.2.0",
"@vector-im/compound-web": "^4.3.0",
"@vector-im/compound-web": "^4.3.1",
"@zxcvbn-ts/core": "^3.0.4",
"@zxcvbn-ts/language-common": "^3.0.4",
"@zxcvbn-ts/language-en": "^3.0.2",
Expand Down
7 changes: 7 additions & 0 deletions res/css/structures/_SpacePanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -472,3 +472,10 @@ limitations under the License.
.mx_SpacePanel_sharePublicSpace {
margin: 0;
}

.mx_SpacePanel_Tooltip_KeyboardShortcut {
kbd {
font-family: inherit;
text-transform: capitalize;
}
}
1 change: 1 addition & 0 deletions src/accessibility/KeyboardShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export const KEY_ICON: Record<string, string> = {
if (IS_MAC) {
KEY_ICON[Key.META] = "⌘";
KEY_ICON[Key.ALT] = "⌥";
KEY_ICON[Key.SHIFT] = "⇧";
}

export const CATEGORIES: Record<CategoryName, ICategory> = {
Expand Down
14 changes: 5 additions & 9 deletions src/components/views/spaces/SpacePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,16 @@ import QuickSettingsButton from "./QuickSettingsButton";
import { useSettingValue } from "../../../hooks/useSettings";
import UserMenu from "../../structures/UserMenu";
import IndicatorScrollbar from "../../structures/IndicatorScrollbar";
import { IS_MAC, Key } from "../../../Keyboard";
import { useDispatcher } from "../../../hooks/useDispatcher";
import defaultDispatcher from "../../../dispatcher/dispatcher";
import { ActionPayload } from "../../../dispatcher/payloads";
import { Action } from "../../../dispatcher/actions";
import { NotificationState } from "../../../stores/notifications/NotificationState";
import { ALTERNATE_KEY_NAME } from "../../../accessibility/KeyboardShortcuts";
import { shouldShowComponent } from "../../../customisations/helpers/UIComponents";
import { UIComponent } from "../../../settings/UIFeature";
import { ThreadsActivityCentre } from "./threads-activity-centre/";
import AccessibleButton from "../elements/AccessibleButton";
import { KeyboardShortcut } from "../settings/KeyboardShortcut";

const useSpaces = (): [Room[], MetaSpace[], Room[], SpaceKey] => {
const invites = useEventEmitterState<Room[]>(SpaceStore.instance, UPDATE_INVITED_SPACES, () => {
Expand Down Expand Up @@ -393,14 +392,11 @@ const SpacePanel: React.FC = () => {
className={classNames("mx_SpacePanel_toggleCollapse", { expanded: !isPanelCollapsed })}
onClick={() => setPanelCollapsed(!isPanelCollapsed)}
title={isPanelCollapsed ? _t("action|expand") : _t("action|collapse")}
// TODO should use a kbd element for accessibility https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd
caption={
IS_MAC
? "⌘ + ⇧ + D"
: _t(ALTERNATE_KEY_NAME[Key.CONTROL]) +
" + " +
_t(ALTERNATE_KEY_NAME[Key.SHIFT]) +
" + D"
<KeyboardShortcut
value={{ ctrlOrCmdKey: true, shiftKey: true, key: "d" }}
className="mx_SpacePanel_Tooltip_KeyboardShortcut"
/>
}
/>
</UserMenu>
Expand Down
2 changes: 1 addition & 1 deletion src/editor/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function formatRange(range: Range, action: Formatting): void {
toggleInlineFormat(range, "**");
break;
case Formatting.Italics:
toggleInlineFormat(range, "_");
toggleInlineFormat(range, "*");
break;
case Formatting.Strikethrough:
toggleInlineFormat(range, "<del>", "</del>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ exports[`AppTile for a pinned widget should render 1`] = `
<img
alt=""
class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round"
height="20px"
loading="lazy"
Expand Down Expand Up @@ -202,7 +201,6 @@ exports[`AppTile for a pinned widget should render permission request 1`] = `
<img
alt=""
class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round"
height="20px"
loading="lazy"
Expand Down Expand Up @@ -355,7 +353,6 @@ exports[`AppTile preserves non-persisted widget on container move 1`] = `
<img
alt=""
class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round"
height="20px"
loading="lazy"
Expand Down
2 changes: 1 addition & 1 deletion test/components/views/messages/TextualBody-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe("<TextualBody />", () => {
const { container } = getComponent({ mxEvent: ev });
const content = container.querySelector(".mx_EventTile_body");
expect(content.innerHTML).toMatchInlineSnapshot(
`"Chat with <span><bdi><a class="mx_Pill mx_UserPill mx_UserPill_me" href="https://matrix.to/#/@user:example.com"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Member</span></a></bdi></span>"`,
`"Chat with <span><bdi><a class="mx_Pill mx_UserPill mx_UserPill_me" href="https://matrix.to/#/@user:example.com"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Member</span></a></bdi></span>"`,
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ exports[`<TextualBody /> renders formatted m.text correctly pills appear for an
<img
alt=""
class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round"
height="16px"
loading="lazy"
Expand Down Expand Up @@ -113,7 +112,6 @@ exports[`<TextualBody /> renders formatted m.text correctly pills appear for eve
<img
alt=""
class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round"
height="16px"
loading="lazy"
Expand Down Expand Up @@ -163,7 +161,6 @@ exports[`<TextualBody /> renders formatted m.text correctly pills appear for roo
<img
alt=""
class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round"
height="16px"
loading="lazy"
Expand Down Expand Up @@ -272,7 +269,6 @@ exports[`<TextualBody /> renders formatted m.text correctly pills get injected c
<img
alt=""
class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round"
height="16px"
loading="lazy"
Expand All @@ -292,9 +288,9 @@ exports[`<TextualBody /> renders formatted m.text correctly pills get injected c
</span>
`;

exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to a message in the same room with the label »Message from Member« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room1:example.com/%event_id%"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message from Member</span></a></bdi></span>"`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to a message in the same room with the label »Message from Member« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room1:example.com/%event_id%"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message from Member</span></a></bdi></span>"`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an event in another room with the label »Message in Room 2« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room2:example.com/%event_id%"><span aria-label="Avatar" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/room.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message in Room 2</span></a></bdi></span>"`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an event in another room with the label »Message in Room 2« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room2:example.com/%event_id%"><span aria-label="Avatar" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/room.png" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message in Room 2</span></a></bdi></span>"`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an unknown message in the same room with the label »Message« 1`] = `
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ exports[`PeopleRoomSettingsTab with requests to join renders requests fully 1`]
<img
alt=""
class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round"
height="42px"
loading="lazy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ exports[`<AddExistingToSpaceDialog /> looks as expected 1`] = `
<img
alt=""
class="_image_mcap2_50"
crossorigin="anonymous"
data-type="square"
height="40px"
loading="lazy"
Expand Down
8 changes: 4 additions & 4 deletions test/editor/operations-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe("editor/operations: formatting operations", () => {
expect(range.parts[0].text).toBe("world");
expect(model.serializeParts()).toEqual([{ text: "hello world!", type: "plain" }]);
formatRange(range, Formatting.Italics);
expect(model.serializeParts()).toEqual([{ text: "hello _world_!", type: "plain" }]);
expect(model.serializeParts()).toEqual([{ text: "hello *world*!", type: "plain" }]);
});

describe("escape backticks", () => {
Expand Down Expand Up @@ -204,9 +204,9 @@ describe("editor/operations: formatting operations", () => {
]);
formatRange(range, Formatting.Italics);
expect(model.serializeParts()).toEqual([
{ text: "hello _there ", type: "plain" },
{ text: "hello *there ", type: "plain" },
{ text: "@room", type: "at-room-pill" },
{ text: ", how are you_ doing?", type: "plain" },
{ text: ", how are you* doing?", type: "plain" },
]);
});

Expand Down Expand Up @@ -377,7 +377,7 @@ describe("editor/operations: formatting operations", () => {

// We expect formatting to still happen in the first line as the caret should not jump down
expect(model.serializeParts()).toEqual([
{ text: "hello _hello!_", type: "plain" },
{ text: "hello *hello!*", type: "plain" },
SERIALIZED_NEWLINE,
{ text: "world", type: "plain" },
]);
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2458,17 +2458,17 @@
pretty-format "^27.0.2"

"@testing-library/jest-dom@^6.0.0":
version "6.4.2"
resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.4.2.tgz#38949f6b63722900e2d75ba3c6d9bf8cffb3300e"
integrity sha512-CzqH0AFymEMG48CpzXFriYYkOjk6ZGPCLMhW9e9jg3KMCn5OfJecF8GtGW7yGfR/IgCe3SX8BSwjdzI6BBbZLw==
version "6.4.5"
resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.4.5.tgz#badb40296477149136dabef32b572ddd3b56adf1"
integrity sha512-AguB9yvTXmCnySBP1lWjfNNUwpbElsaQ567lt2VdGqAdHtpieLgjmcVyv1q7PMIvLbgpDdkWV5Ydv3FEejyp2A==
dependencies:
"@adobe/css-tools" "^4.3.2"
"@babel/runtime" "^7.9.2"
aria-query "^5.0.0"
chalk "^3.0.0"
css.escape "^1.5.1"
dom-accessibility-api "^0.6.3"
lodash "^4.17.15"
lodash "^4.17.21"
redent "^3.0.0"

"@testing-library/react-hooks@^8.0.1":
Expand Down Expand Up @@ -2733,9 +2733,9 @@
integrity sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==

"@types/lodash@^4.14.168":
version "4.17.0"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.0.tgz#d774355e41f372d5350a4d0714abb48194a489c3"
integrity sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==
version "4.17.1"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.1.tgz#0fabfcf2f2127ef73b119d98452bd317c4a17eb8"
integrity sha512-X+2qazGS3jxLAIz5JDXDzglAF3KpijdhFxlf/V1+hEsOUc+HnWi81L/uv/EvGuV90WY+7mPGFCUDGfQC3Gj95Q==

"@types/mapbox__point-geometry@*", "@types/mapbox__point-geometry@^0.1.2":
version "0.1.4"
Expand Down Expand Up @@ -2782,9 +2782,9 @@
undici-types "~5.26.4"

"@types/node@18":
version "18.19.31"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.31.tgz#b7d4a00f7cb826b60a543cebdbda5d189aaecdcd"
integrity sha512-ArgCD39YpyyrtFKIqMDvjz79jto5fcI/SVUs2HwB+f0dAzq68yqOdyaSivLiLugSziTpNXLQrVb7RZFmdZzbhA==
version "18.19.33"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.33.tgz#98cd286a1b8a5e11aa06623210240bcc28e95c48"
integrity sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==
dependencies:
undici-types "~5.26.4"

Expand Down Expand Up @@ -3097,10 +3097,10 @@
dependencies:
svg2vectordrawable "^2.9.1"

"@vector-im/compound-web@^4.3.0":
version "4.3.0"
resolved "https://registry.yarnpkg.com/@vector-im/compound-web/-/compound-web-4.3.0.tgz#7725dec55f738aa0ccaf3c790b57b36955b90d6a"
integrity sha512-AH8TdmkteR5VL4HgHq+p3H1NngOUJhkhiHr+hb9H0dB35vWNPhs5R3edyzFZhWMWWsJ2E8jhiXf/NqdGh/k4jg==
"@vector-im/compound-web@^4.3.1":
version "4.3.1"
resolved "https://registry.yarnpkg.com/@vector-im/compound-web/-/compound-web-4.3.1.tgz#4570adeccdfcac6919256c5e399d592510bdb15d"
integrity sha512-/Sw27GI0jCg6A7E+93SWFyF3pEwLyLzExB3lIVPTY0mMTx50+rZloRuhuqftUlIscWSlmAUex8Lo4WK8WKPFPA==
dependencies:
"@floating-ui/react" "^0.26.9"
"@floating-ui/react-dom" "^2.0.8"
Expand Down Expand Up @@ -6945,7 +6945,7 @@ lodash.truncate@^4.4.2:
resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193"
integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==

lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21:
lodash@^4.17.20, lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down

0 comments on commit 8c9205a

Please sign in to comment.