From a0cb9470cc4228610706488389159f387d056a6b Mon Sep 17 00:00:00 2001 From: David Langley Date: Mon, 7 Oct 2024 15:56:34 +0100 Subject: [PATCH] Update to @vector-im/matrix-wysiwyg (#125) --- package.json | 2 +- .../DynamicImportWysiwygComposer.tsx | 4 ++-- .../components/FormattingButtons.tsx | 2 +- .../wysiwyg_composer/components/LinkModal.tsx | 2 +- .../components/WysiwygAutocomplete.tsx | 2 +- .../components/WysiwygComposer.tsx | 2 +- .../hooks/useInputEventProcessor.ts | 2 +- .../hooks/usePlainTextListeners.ts | 2 +- .../rooms/wysiwyg_composer/hooks/useSuggestion.ts | 2 +- .../views/rooms/wysiwyg_composer/hooks/utils.ts | 2 +- .../rooms/wysiwyg_composer/utils/autocomplete.ts | 2 +- .../wysiwyg_composer/utils/createMessageContent.ts | 2 +- .../components/FormattingButtons-test.tsx | 2 +- .../wysiwyg_composer/components/LinkModal-test.tsx | 2 +- yarn.lock | 14 +++++++------- 15 files changed, 22 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index f658bf04b6..49d0f1ffb3 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "@babel/runtime": "^7.12.5", "@matrix-org/analytics-events": "^0.26.0", "@matrix-org/emojibase-bindings": "^1.1.2", - "@matrix-org/matrix-wysiwyg": "2.37.9", + "@vector-im/matrix-wysiwyg": "2.37.13", "@matrix-org/react-sdk-module-api": "^2.4.0", "@matrix-org/spec": "^1.7.0", "@sentry/browser": "^8.0.0", diff --git a/src/components/views/rooms/wysiwyg_composer/DynamicImportWysiwygComposer.tsx b/src/components/views/rooms/wysiwyg_composer/DynamicImportWysiwygComposer.tsx index 5eba213579..46210949f5 100644 --- a/src/components/views/rooms/wysiwyg_composer/DynamicImportWysiwygComposer.tsx +++ b/src/components/views/rooms/wysiwyg_composer/DynamicImportWysiwygComposer.tsx @@ -10,7 +10,7 @@ import React, { ComponentProps, lazy, Suspense } from "react"; import { ISendEventResponse } from "matrix-js-sdk/src/matrix"; // we need to import the types for TS, but do not import the sendMessage -// function to avoid importing from "@matrix-org/matrix-wysiwyg" +// function to avoid importing from "@vector-im/matrix-wysiwyg" import { SendMessageParams } from "./utils/message"; import { retry } from "../../../../utils/promise"; @@ -55,7 +55,7 @@ export const dynamicImportConversionFunctions = async (): Promise<{ */ plainToRich(plain: string, inMessageFormat: boolean): Promise; }> => { - const { richToPlain, plainToRich } = await retry(() => import("@matrix-org/matrix-wysiwyg"), RETRY_COUNT); + const { richToPlain, plainToRich } = await retry(() => import("@vector-im/matrix-wysiwyg"), RETRY_COUNT); return { richToPlain, plainToRich }; }; diff --git a/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx b/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx index 619037a89f..f02f1a4c6b 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { MouseEventHandler, ReactNode } from "react"; -import { FormattingFunctions, AllActionStates, ActionState } from "@matrix-org/matrix-wysiwyg"; +import { FormattingFunctions, AllActionStates, ActionState } from "@vector-im/matrix-wysiwyg"; import classNames from "classnames"; import BoldIcon from "@vector-im/compound-design-tokens/assets/web/icons/bold"; import BulletedListIcon from "@vector-im/compound-design-tokens/assets/web/icons/list-bulleted"; diff --git a/src/components/views/rooms/wysiwyg_composer/components/LinkModal.tsx b/src/components/views/rooms/wysiwyg_composer/components/LinkModal.tsx index 3d77982497..3b5bfb7ad4 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/LinkModal.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/LinkModal.tsx @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only Please see LICENSE files in the repository root for full details. */ -import { FormattingFunctions } from "@matrix-org/matrix-wysiwyg"; +import { FormattingFunctions } from "@vector-im/matrix-wysiwyg"; import React, { ChangeEvent, useState } from "react"; import { _t } from "../../../../../languageHandler"; diff --git a/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx b/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx index a617e23db1..e7ff5f169a 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { ForwardedRef, forwardRef, FunctionComponent } from "react"; -import { FormattingFunctions, MappedSuggestion } from "@matrix-org/matrix-wysiwyg"; +import { FormattingFunctions, MappedSuggestion } from "@vector-im/matrix-wysiwyg"; import { logger } from "matrix-js-sdk/src/logger"; import { useRoomContext } from "../../../../../contexts/RoomContext"; diff --git a/src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer.tsx b/src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer.tsx index 34e8b18022..5b6361a58e 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React, { memo, MutableRefObject, ReactNode, useEffect, useMemo, useRef } from "react"; import { IEventRelation } from "matrix-js-sdk/src/matrix"; import { EMOTICON_TO_EMOJI } from "@matrix-org/emojibase-bindings"; -import { useWysiwyg, FormattingFunctions } from "@matrix-org/matrix-wysiwyg"; +import { useWysiwyg, FormattingFunctions } from "@vector-im/matrix-wysiwyg"; import classNames from "classnames"; import Autocomplete from "../../Autocomplete"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useInputEventProcessor.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useInputEventProcessor.ts index 4a8ecee921..8eac63eb36 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useInputEventProcessor.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useInputEventProcessor.ts @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only Please see LICENSE files in the repository root for full details. */ -import { Wysiwyg, WysiwygEvent } from "@matrix-org/matrix-wysiwyg"; +import { Wysiwyg, WysiwygEvent } from "@vector-im/matrix-wysiwyg"; import { useCallback } from "react"; import { IEventRelation, MatrixClient } from "matrix-js-sdk/src/matrix"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts index 89e0964147..742d24fe34 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { KeyboardEvent, RefObject, SyntheticEvent, useCallback, useRef, useState } from "react"; -import { AllowedMentionAttributes, MappedSuggestion } from "@matrix-org/matrix-wysiwyg"; +import { AllowedMentionAttributes, MappedSuggestion } from "@vector-im/matrix-wysiwyg"; import { IEventRelation } from "matrix-js-sdk/src/matrix"; import { useSettingValue } from "../../../../../hooks/useSettings"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts index 9b728c1018..7fdd630f10 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { EMOTICON_TO_EMOJI } from "@matrix-org/emojibase-bindings"; -import { AllowedMentionAttributes, MappedSuggestion } from "@matrix-org/matrix-wysiwyg"; +import { AllowedMentionAttributes, MappedSuggestion } from "@vector-im/matrix-wysiwyg"; import { SyntheticEvent, useState, SetStateAction } from "react"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/utils.ts b/src/components/views/rooms/wysiwyg_composer/hooks/utils.ts index 9210ef041f..39317ea88c 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/utils.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/utils.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { MutableRefObject, RefObject } from "react"; import { IEventRelation, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { WysiwygEvent } from "@matrix-org/matrix-wysiwyg"; +import { WysiwygEvent } from "@vector-im/matrix-wysiwyg"; import { TimelineRenderingType } from "../../../../../contexts/RoomContext"; import { IRoomState } from "../../../../structures/RoomView"; diff --git a/src/components/views/rooms/wysiwyg_composer/utils/autocomplete.ts b/src/components/views/rooms/wysiwyg_composer/utils/autocomplete.ts index ef85fed055..d97b07adee 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/autocomplete.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/autocomplete.ts @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only Please see LICENSE files in the repository root for full details. */ -import { AllowedMentionAttributes, MappedSuggestion } from "@matrix-org/matrix-wysiwyg"; +import { AllowedMentionAttributes, MappedSuggestion } from "@vector-im/matrix-wysiwyg"; import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { ICompletion } from "../../../../../autocomplete/Autocompleter"; diff --git a/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts b/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts index 43a4f38ff8..9787da9e3c 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only Please see LICENSE files in the repository root for full details. */ -import { richToPlain, plainToRich } from "@matrix-org/matrix-wysiwyg"; +import { richToPlain, plainToRich } from "@vector-im/matrix-wysiwyg"; import { IContent, IEventRelation, MatrixEvent, MsgType } from "matrix-js-sdk/src/matrix"; import { ReplacementEvent, RoomMessageEventContent, RoomMessageTextEventContent } from "matrix-js-sdk/src/types"; diff --git a/test/components/views/rooms/wysiwyg_composer/components/FormattingButtons-test.tsx b/test/components/views/rooms/wysiwyg_composer/components/FormattingButtons-test.tsx index 67d98f7fc2..854069f7b0 100644 --- a/test/components/views/rooms/wysiwyg_composer/components/FormattingButtons-test.tsx +++ b/test/components/views/rooms/wysiwyg_composer/components/FormattingButtons-test.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { cleanup, render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { ActionState, ActionTypes, AllActionStates, FormattingFunctions } from "@matrix-org/matrix-wysiwyg"; +import { ActionState, ActionTypes, AllActionStates, FormattingFunctions } from "@vector-im/matrix-wysiwyg"; import { FormattingButtons } from "../../../../../../src/components/views/rooms/wysiwyg_composer/components/FormattingButtons"; import * as LinkModal from "../../../../../../src/components/views/rooms/wysiwyg_composer/components/LinkModal"; diff --git a/test/components/views/rooms/wysiwyg_composer/components/LinkModal-test.tsx b/test/components/views/rooms/wysiwyg_composer/components/LinkModal-test.tsx index b9b2904c41..6ee8256797 100644 --- a/test/components/views/rooms/wysiwyg_composer/components/LinkModal-test.tsx +++ b/test/components/views/rooms/wysiwyg_composer/components/LinkModal-test.tsx @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only Please see LICENSE files in the repository root for full details. */ -import { FormattingFunctions } from "@matrix-org/matrix-wysiwyg"; +import { FormattingFunctions } from "@vector-im/matrix-wysiwyg"; import { render, screen, waitFor } from "@testing-library/react"; import React from "react"; import userEvent from "@testing-library/user-event"; diff --git a/yarn.lock b/yarn.lock index ee422b6f28..5c995a2538 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1911,13 +1911,6 @@ resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-7.0.0.tgz#8d6abdb9ded8656cc9e2a7909913a34bf3fc9b3a" integrity sha512-MOencXiW/gI5MuTtCNsuojjwT5DXCrjMqv9xOslJC9h2tPdLFFFMGr58dY5Lis4DRd9MRWcgrGowUIHOqieWTA== -"@matrix-org/matrix-wysiwyg@2.37.9": - version "2.37.9" - resolved "https://registry.yarnpkg.com/@matrix-org/matrix-wysiwyg/-/matrix-wysiwyg-2.37.9.tgz#4d5667df3c74e11fd01c4b5be920caff72bf2f48" - integrity sha512-Jn2ug6ySX5es5/SV5BVgSBhVPS7GXggwZ/GGWmnJvhnp/IArit4kgUAsNRhQeKebuVvNphwQykCGwyBOn2PLBA== - dependencies: - eslint-plugin-unicorn "^54.0.0" - "@matrix-org/olm@3.2.15": version "3.2.15" resolved "https://registry.yarnpkg.com/@matrix-org/olm/-/olm-3.2.15.tgz#55f3c1b70a21bbee3f9195cecd6846b1083451ec" @@ -3101,6 +3094,13 @@ ts-xor "^1.3.0" vaul "^0.7.0" +"@vector-im/matrix-wysiwyg@2.37.13": + version "2.37.13" + resolved "https://registry.yarnpkg.com/@vector-im/matrix-wysiwyg/-/matrix-wysiwyg-2.37.13.tgz#7b64e7652a196e811c0470dcbff8d36e2229cd46" + integrity sha512-3ilnJBJSzeTfAQXNJJ29EAqa14exrkca3acTPssdoh3WhTKwXyQ0xU8sS50d6gqlAP/Nahw1y2k+PzajXo1SsQ== + dependencies: + eslint-plugin-unicorn "^54.0.0" + "@zxcvbn-ts/core@^3.0.4": version "3.0.4" resolved "https://registry.yarnpkg.com/@zxcvbn-ts/core/-/core-3.0.4.tgz#c5bde72235eb6c273cec78b672bb47c0d7045cad"