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AtByb,EAAK7Z,EAAOyX,kBAAU,IAAAoC,OAAA,EAAjBA,EAAmBpS,QAEnG,OAAO,EAKX,IAAIiS,EAA0B1Z,EAAOyX,WAAWqC,KAAK9Z,EAAOyX,WAAWhQ,OAAS,GAChF,EAAG,CACoC,IAAAsS,EAAnC,GAAIL,IAAU1b,EAAUG,UAEpB,OAAOH,EAAUI,eAAiC,QAAtB2b,EAAKL,EAAMM,mBAAW,IAAAD,OAAA,EAAjBA,EAAmBtS,OAE5D,OAAUiS,EAAQA,EAAMO,WAExB,OAAO,CACX","sources":["webpack://element-web/./src/components/views/rooms/wysiwyg_composer/ComposerContext.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/hooks/useSelection.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/components/Editor.tsx","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/hooks/useIsExpanded.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/utils/autocomplete.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/list-bulleted.js","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/code.js","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/indent-decrease.js","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/indent-increase.js","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/list-numbered.js","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@vector-im+compound-design-tokens@10.2.1_@types+react@19.2.14_react@19.2.7/node_modules/@vector-im/compound-design-tokens/assets/web/icons/underline.js","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/components/LinkModal.tsx","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/hooks/useInputEventProcessor.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/utils/event.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer.tsx","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/hooks/useContainsCommand.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/hooks/useIsFocused.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/hooks/useSetCursorPosition.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/hooks/utils.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/utils/editing.ts","webpack://element-web/./src/components/views/rooms/wysiwyg_composer/utils/selection.ts"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { createContext, useContext } from \"react\";\nimport { type IEventRelation } from \"matrix-js-sdk/src/matrix\";\n\nimport { type SubSelection } from \"./types\";\nimport type EditorStateTransfer from \"../../../../utils/EditorStateTransfer\";\n\nexport function getDefaultContextValue(defaultValue?: Partial<ComposerContextState>): { selection: SubSelection } {\n return {\n selection: { anchorNode: null, anchorOffset: 0, focusNode: null, focusOffset: 0, isForward: true },\n ...defaultValue,\n };\n}\n\nexport interface ComposerContextState {\n selection: SubSelection;\n editorStateTransfer?: EditorStateTransfer;\n eventRelation?: IEventRelation;\n}\n\nexport const ComposerContext = createContext<ComposerContextState>(getDefaultContextValue());\nComposerContext.displayName = \"ComposerContext\";\n\nexport function useComposerContext(): ComposerContextState {\n return useContext(ComposerContext);\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { useCallback, useEffect } from \"react\";\n\nimport useFocus from \"../../../../../hooks/useFocus\";\nimport { useComposerContext, type ComposerContextState } from \"../ComposerContext\";\n\nfunction setSelectionContext(composerContext: ComposerContextState): void {\n const selection = document.getSelection();\n\n if (selection) {\n const range = selection.getRangeAt(0);\n const isForward = range.startContainer === selection.anchorNode && range.startOffset === selection.anchorOffset;\n\n composerContext.selection = {\n anchorNode: selection.anchorNode,\n anchorOffset: selection.anchorOffset,\n focusNode: selection.focusNode,\n focusOffset: selection.focusOffset,\n isForward,\n };\n }\n}\n\nexport function useSelection(): ReturnType<typeof useFocus>[1] & {\n onInput(this: void): void;\n} {\n const composerContext = useComposerContext();\n const [isFocused, focusProps] = useFocus();\n\n useEffect(() => {\n function onSelectionChange(): void {\n setSelectionContext(composerContext);\n }\n\n if (isFocused) {\n document.addEventListener(\"selectionchange\", onSelectionChange);\n }\n\n return () => document.removeEventListener(\"selectionchange\", onSelectionChange);\n }, [isFocused, composerContext]);\n\n const onInput = useCallback(() => {\n setSelectionContext(composerContext);\n }, [composerContext]);\n\n return { ...focusProps, onInput };\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classNames from \"classnames\";\nimport React, { type CSSProperties, memo, type RefObject, type ReactNode } from \"react\";\n\nimport { useIsExpanded } from \"../hooks/useIsExpanded\";\nimport { useSelection } from \"../hooks/useSelection\";\n\nconst HEIGHT_BREAKING_POINT = 24;\n\ninterface EditorProps {\n disabled: boolean;\n placeholder?: string;\n leftComponent?: ReactNode;\n rightComponent?: ReactNode;\n ref?: RefObject<HTMLDivElement | null>;\n}\n\nexport const Editor = memo(function Editor({ disabled, placeholder, leftComponent, rightComponent, ref }: EditorProps) {\n const isExpanded = useIsExpanded(ref, HEIGHT_BREAKING_POINT);\n const { onFocus, onBlur, onInput } = useSelection();\n\n return (\n <div data-testid=\"WysiwygComposerEditor\" className=\"mx_WysiwygComposer_Editor\" data-is-expanded={isExpanded}>\n {leftComponent}\n <div className=\"mx_WysiwygComposer_Editor_container\">\n <div\n className={classNames(\"mx_WysiwygComposer_Editor_content\", {\n mx_WysiwygComposer_Editor_content_placeholder: Boolean(placeholder),\n })}\n style={{ \"--placeholder\": `\"${placeholder}\"` } as CSSProperties}\n ref={ref}\n contentEditable={!disabled}\n role=\"textbox\"\n aria-multiline=\"true\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n dir=\"auto\"\n aria-disabled={disabled}\n onFocus={onFocus}\n onBlur={onBlur}\n onInput={onInput}\n />\n </div>\n {rightComponent}\n </div>\n );\n});\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type RefObject, useEffect, useState } from \"react\";\n\nexport function useIsExpanded(ref: RefObject<HTMLElement | null> | undefined, breakingPoint: number): boolean {\n const [isExpanded, setIsExpanded] = useState(false);\n useEffect(() => {\n if (ref?.current) {\n const editor = ref.current;\n const resizeObserver = new ResizeObserver((entries) => {\n requestAnimationFrame(() => {\n const height = entries[0]?.contentBoxSize?.[0].blockSize;\n setIsExpanded(height >= breakingPoint);\n });\n });\n\n resizeObserver.observe(editor);\n return () => resizeObserver.unobserve(editor);\n }\n }, [ref, breakingPoint]);\n\n return isExpanded;\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type AllowedMentionAttributes, type MappedSuggestion } from \"@vector-im/matrix-wysiwyg\";\nimport { type MatrixClient, type Room } from \"matrix-js-sdk/src/matrix\";\n\nimport { type ICompletion } from \"../../../../../autocomplete/Autocompleter\";\nimport * as Avatar from \"../../../../../Avatar\";\n\n/**\n * Builds the query for the `<Autocomplete />` component from the rust suggestion. This\n * will change as we implement handling / commands.\n *\n * @param suggestion - represents if the rust model is tracking a potential mention\n * @returns an empty string if we can not generate a query, otherwise a query beginning\n * with @ for a user query, # for a room or space query\n */\nexport function buildQuery(suggestion: MappedSuggestion | null): string {\n if (!suggestion || !suggestion.keyChar) {\n // if we have an empty key character, we do not build a query\n return \"\";\n }\n\n return `${suggestion.keyChar}${suggestion.text}`;\n}\n\n/**\n * Find the room from the completion by looking it up using the client from the context\n * we are currently in\n *\n * @param completion - the completion from the autocomplete\n * @param client - the current client we are using\n * @returns a Room if one is found, null otherwise\n */\nexport function getRoomFromCompletion(completion: ICompletion, client: MatrixClient): Room | null {\n const roomId = completion.completionId;\n const aliasFromCompletion = completion.completion;\n\n let roomToReturn: Room | null | undefined;\n\n // Not quite sure if the logic here makes sense - specifically calling .getRoom with an alias\n // that doesn't start with #, but keeping the logic the same as in PartCreator.roomPill for now\n if (roomId) {\n roomToReturn = client.getRoom(roomId);\n } else if (!aliasFromCompletion.startsWith(\"#\")) {\n roomToReturn = client.getRoom(aliasFromCompletion);\n } else {\n roomToReturn = client.getRooms().find((r) => {\n return r.getCanonicalAlias() === aliasFromCompletion || r.getAltAliases().includes(aliasFromCompletion);\n });\n }\n\n return roomToReturn ?? null;\n}\n\n/**\n * Given an autocomplete suggestion, determine the text to display in the pill\n *\n * @param completion - the item selected from the autocomplete\n * @param client - the MatrixClient is required for us to look up the correct room mention text\n * @returns the text to display in the mention\n */\nexport function getMentionDisplayText(completion: ICompletion, client: MatrixClient): string {\n if (completion.type === \"user\" || completion.type === \"at-room\") {\n return completion.completion;\n } else if (completion.type === \"room\") {\n // try and get the room and use it's name, if not available, fall back to\n // completion.completion\n return getRoomFromCompletion(completion, client)?.name || completion.completion;\n }\n return \"\";\n}\n\nfunction getCSSProperties({\n url,\n initialLetter,\n id = \"\",\n}: {\n url: string;\n initialLetter?: string;\n id: string;\n}): string {\n const cssProperties = [`--avatar-background: url(${url})`, `--avatar-letter: '${initialLetter}'`];\n\n const textColor = Avatar.getAvatarTextColor(id);\n if (textColor) {\n cssProperties.push(textColor);\n }\n\n return cssProperties.join(\"; \");\n}\n\n/**\n * For a given completion, the attributes will change depending on the completion type\n *\n * @param completion - the item selected from the autocomplete\n * @param client - the MatrixClient is required for us to look up the correct room mention text\n * @param room - the room the composer is currently in\n * @returns an object of attributes containing HTMLAnchor attributes or data-* attributes\n */\nexport function getMentionAttributes(\n completion: ICompletion,\n client: MatrixClient,\n room: Room,\n): AllowedMentionAttributes {\n // To ensure that we always have something set in the --avatar-letter CSS variable\n // as otherwise alignment varies depending on whether the content is empty or not.\n // Use a zero width space so that it counts as content, but does not display anything.\n const defaultLetterContent = \"\\u200b\";\n const attributes: AllowedMentionAttributes = new Map();\n\n if (completion.type === \"user\") {\n // logic as used in UserPillPart.setAvatar in parts.ts\n const mentionedMember = room.getMember(completion.completionId || \"\");\n\n if (!mentionedMember) return attributes;\n\n const name = mentionedMember.name || mentionedMember.userId;\n const defaultAvatarUrl = Avatar.defaultAvatarUrlForString(mentionedMember.userId);\n const avatarUrl = Avatar.avatarUrlForMember(mentionedMember, 16, 16, \"crop\");\n let initialLetter = defaultLetterContent;\n if (avatarUrl === defaultAvatarUrl) {\n initialLetter = Avatar.getInitialLetter(name) ?? defaultLetterContent;\n }\n\n attributes.set(\"data-mention-type\", completion.type);\n attributes.set(\n \"style\",\n getCSSProperties({\n url: avatarUrl,\n initialLetter,\n id: mentionedMember.userId,\n }),\n );\n } else if (completion.type === \"room\") {\n // logic as used in RoomPillPart.setAvatar in parts.ts\n const mentionedRoom = getRoomFromCompletion(completion, client);\n const aliasFromCompletion = completion.completion;\n\n let initialLetter = defaultLetterContent;\n let avatarUrl = Avatar.avatarUrlForRoom(mentionedRoom ?? null, 16, 16, \"crop\");\n if (!avatarUrl) {\n initialLetter = Avatar.getInitialLetter(mentionedRoom?.name || aliasFromCompletion) ?? defaultLetterContent;\n avatarUrl = Avatar.defaultAvatarUrlForString(mentionedRoom?.roomId ?? aliasFromCompletion);\n }\n\n attributes.set(\"data-mention-type\", completion.type);\n attributes.set(\n \"style\",\n getCSSProperties({\n url: avatarUrl,\n initialLetter,\n id: mentionedRoom?.roomId ?? aliasFromCompletion,\n }),\n );\n } else if (completion.type === \"at-room\") {\n // logic as used in RoomPillPart.setAvatar in parts.ts, but now we know the current room\n // from the arguments passed\n let initialLetter = defaultLetterContent;\n let avatarUrl = Avatar.avatarUrlForRoom(room, 16, 16, \"crop\");\n\n if (!avatarUrl) {\n initialLetter = Avatar.getInitialLetter(room.name) ?? defaultLetterContent;\n avatarUrl = Avatar.defaultAvatarUrlForString(room.roomId);\n }\n\n attributes.set(\"data-mention-type\", completion.type);\n attributes.set(\n \"style\",\n getCSSProperties({\n url: avatarUrl,\n initialLetter,\n id: room.roomId,\n }),\n );\n }\n\n return attributes;\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type JSX, type Ref, type FunctionComponent } from \"react\";\nimport { type FormattingFunctions, type MappedSuggestion } from \"@vector-im/matrix-wysiwyg\";\n\nimport Autocomplete from \"../../Autocomplete\";\nimport { type ICompletion } from \"../../../../../autocomplete/Autocompleter\";\nimport { useMatrixClientContext } from \"../../../../../contexts/MatrixClientContext\";\nimport { getMentionDisplayText, getMentionAttributes, buildQuery } from \"../utils/autocomplete\";\nimport { useScopedRoomContext } from \"../../../../../contexts/ScopedRoomContext.tsx\";\n\ninterface WysiwygAutocompleteProps {\n /**\n * The suggestion output from the rust model is used to build the query that is\n * passed to the `<Autocomplete />` component\n */\n suggestion: MappedSuggestion | null;\n\n /**\n * This handler will be called with the href and display text for a mention on clicking\n * a mention in the autocomplete list or pressing enter on a selected item\n */\n handleMention: FormattingFunctions[\"mention\"];\n\n /**\n * This handler will be called with the display text for a command on clicking\n * a command in the autocomplete list or pressing enter on a selected item\n */\n handleCommand: FormattingFunctions[\"command\"];\n\n /**\n * Handler purely for the at-room mentions special case\n */\n handleAtRoomMention: FormattingFunctions[\"mentionAtRoom\"];\n\n /**\n * This handler will be called with the emoji character on clicking\n * an emoji in the autocomplete list or pressing enter on a selected item\n */\n handleEmoji: FormattingFunctions[\"emoji\"];\n\n ref?: Ref<Autocomplete>;\n}\n\n/**\n * Given the current suggestion from the rust model and a handler function, this component\n * will display the legacy `<Autocomplete />` component (as used in the BasicMessageComposer)\n * and call the handler function with the required arguments when a mention is selected\n *\n * @param props.ref - the ref will be attached to the rendered `<Autocomplete />` component\n */\nconst WysiwygAutocomplete = ({\n suggestion,\n handleMention,\n handleCommand,\n handleAtRoomMention,\n handleEmoji,\n ref,\n}: WysiwygAutocompleteProps): JSX.Element | null => {\n const { room } = useScopedRoomContext(\"room\");\n const client = useMatrixClientContext();\n\n function handleConfirm(completion: ICompletion): void {\n if (client === undefined || room === undefined) {\n return;\n }\n\n switch (completion.type) {\n case \"command\": {\n // TODO determine if utils in SlashCommands.tsx are required.\n // Trim the completion as some include trailing spaces, but we always insert a\n // trailing space in the rust model anyway\n handleCommand(completion.completion.trim());\n return;\n }\n case \"at-room\": {\n handleAtRoomMention(getMentionAttributes(completion, client, room));\n return;\n }\n case \"room\":\n case \"user\": {\n if (typeof completion.href === \"string\") {\n handleMention(\n completion.href,\n getMentionDisplayText(completion, client),\n getMentionAttributes(completion, client, room),\n );\n }\n return;\n }\n // TODO - handle \"community\" type\n case \"community\": {\n return; // no-op until we decide how to handle community in the wysiwyg composer\n }\n default:\n {\n // similar to the cider editor we handle emoji and other plain text replacement in the default case\n handleEmoji(completion.completion);\n }\n return;\n }\n }\n\n if (!room) return null;\n\n const autoCompleteQuery = buildQuery(suggestion);\n\n // TODO - determine if we show all of the /command suggestions, there are some options in the\n // list which don't seem to make sense in this context, specifically /html and /plain\n return (\n <div className=\"mx_WysiwygComposer_AutoCompleteWrapper\" data-testid=\"autocomplete-wrapper\">\n <Autocomplete\n ref={ref}\n query={autoCompleteQuery}\n onConfirm={handleConfirm}\n selection={{ start: 0, end: 0 }}\n room={room}\n />\n </div>\n );\n};\n\n(WysiwygAutocomplete as FunctionComponent).displayName = \"WysiwygAutocomplete\";\n\nexport { WysiwygAutocomplete };\n","import { forwardRef } from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction ListBulletedIcon(props, ref) {\n return /*#__PURE__*/_jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"1em\",\n height: \"1em\",\n fill: \"currentColor\",\n viewBox: \"0 0 24 24\",\n ref: ref,\n ...props,\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M4.5 7.5q-.618 0-1.06-.44A1.44 1.44 0 0 1 3 6q0-.618.44-1.06.442-.44 1.06-.44t1.06.44Q6 5.383 6 6t-.44 1.06q-.44.44-1.06.44m4.788 11.213Q9.575 19 10 19h10q.424 0 .712-.288A.97.97 0 0 0 21 18a.97.97 0 0 0-.288-.712A.97.97 0 0 0 20 17H10a.97.97 0 0 0-.713.288A.97.97 0 0 0 9 18q0 .424.287.712m.001-5.999Q9.575 13 10 13h10q.424 0 .712-.287A.97.97 0 0 0 21 12a.97.97 0 0 0-.288-.713A.97.97 0 0 0 20 11H10a.97.97 0 0 0-.713.287A.97.97 0 0 0 9 12q0 .424.287.713m.001-6Q9.575 7 10 7h10q.424 0 .712-.287A.97.97 0 0 0 21 6a.97.97 0 0 0-.288-.713A.97.97 0 0 0 20 5H10a.97.97 0 0 0-.713.287A.97.97 0 0 0 9 6q0 .424.287.713M3.44 19.06q.442.44 1.06.44t1.06-.44Q6 18.62 6 18t-.44-1.06a1.45 1.45 0 0 0-1.06-.44q-.618 0-1.06.44Q3 17.38 3 18t.44 1.06M4.5 13.5q-.618 0-1.06-.44A1.45 1.45 0 0 1 3 12q0-.619.44-1.06.442-.44 1.06-.44t1.06.44Q6 11.383 6 12t-.44 1.06q-.44.44-1.06.44\"\n })\n });\n}\n;\nListBulletedIcon.displayName = \"ListBulletedIcon\";\nexport default forwardRef(ListBulletedIcon);","import { forwardRef } from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction CodeIcon(props, ref) {\n return /*#__PURE__*/_jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"1em\",\n height: \"1em\",\n fill: \"currentColor\",\n viewBox: \"0 0 24 24\",\n ref: ref,\n ...props,\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"m8.825 12 1.475-1.475q.3-.3.3-.7t-.3-.7-.713-.3-.712.3L6.7 11.3q-.15.15-.213.325a1.1 1.1 0 0 0-.062.375q0 .2.063.375a.9.9 0 0 0 .212.325l2.175 2.175q.3.3.713.3.412 0 .712-.3t.3-.7-.3-.7zm6.35 0L13.7 13.475q-.3.3-.3.7t.3.7.713.3.712-.3L17.3 12.7q.15-.15.212-.325.063-.175.063-.375t-.062-.375a.9.9 0 0 0-.213-.325l-2.175-2.175a1 1 0 0 0-1.425 0q-.3.3-.3.7t.3.7zM5 21q-.824 0-1.412-.587A1.93 1.93 0 0 1 3 19V5q0-.824.587-1.412A1.93 1.93 0 0 1 5 3h14q.824 0 1.413.587Q21 4.176 21 5v14q0 .824-.587 1.413A1.93 1.93 0 0 1 19 21zm0-2h14V5H5z\"\n })\n });\n}\n;\nCodeIcon.displayName = \"CodeIcon\";\nexport default forwardRef(CodeIcon);","import { forwardRef } from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction IndentDecreaseIcon(props, ref) {\n return /*#__PURE__*/_jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"1em\",\n height: \"1em\",\n fill: \"currentColor\",\n viewBox: \"0 0 24 24\",\n ref: ref,\n ...props,\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M3.288 18.713Q3.575 19 4 19h16q.424 0 .712-.288A.97.97 0 0 0 21 18a.97.97 0 0 0-.288-.712A.97.97 0 0 0 20 17H4a.97.97 0 0 0-.712.288A.97.97 0 0 0 3 18q0 .424.288.712m8-3.999Q11.575 15 12 15h8q.424 0 .712-.287A.97.97 0 0 0 21 14a.97.97 0 0 0-.288-.713A.97.97 0 0 0 20 13h-8a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 14q0 .424.287.713m.001-4Q11.575 11 12 11h8q.424 0 .712-.287A.97.97 0 0 0 21 10a.97.97 0 0 0-.288-.713A.97.97 0 0 0 20 9h-8a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 10q0 .424.287.713m.001-4Q11.575 7 12 7h8q.424 0 .712-.287A.97.97 0 0 0 21 6a.97.97 0 0 0-.288-.713A.97.97 0 0 0 20 5h-8a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 6q0 .424.287.713M6.15 13.15l-2.8-2.8a.48.48 0 0 1 0-.7l2.8-2.8q.25-.25.55-.125T7 7.2v5.6q0 .35-.3.475t-.55-.125\"\n })\n });\n}\n;\nIndentDecreaseIcon.displayName = \"IndentDecreaseIcon\";\nexport default forwardRef(IndentDecreaseIcon);","import { forwardRef } from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction IndentIncreaseIcon(props, ref) {\n return /*#__PURE__*/_jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"1em\",\n height: \"1em\",\n fill: \"currentColor\",\n viewBox: \"0 0 24 24\",\n ref: ref,\n ...props,\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M4 19a.97.97 0 0 1-.712-.288A.97.97 0 0 1 3 18q0-.424.288-.712A.97.97 0 0 1 4 17h16q.424 0 .712.288.288.287.288.712 0 .424-.288.712A.97.97 0 0 1 20 19zm8-4a.97.97 0 0 1-.713-.287A.97.97 0 0 1 11 14q0-.424.287-.713A.97.97 0 0 1 12 13h8q.424 0 .712.287.288.288.288.713 0 .424-.288.713A.97.97 0 0 1 20 15zm0-4a.97.97 0 0 1-.713-.287A.97.97 0 0 1 11 10q0-.424.287-.713A.97.97 0 0 1 12 9h8q.424 0 .712.287Q21 9.576 21 10t-.288.713A.97.97 0 0 1 20 11zm0-4a.97.97 0 0 1-.713-.287A.97.97 0 0 1 11 6q0-.424.287-.713A.97.97 0 0 1 12 5h8q.424 0 .712.287Q21 5.576 21 6t-.288.713A.97.97 0 0 1 20 7zm-8.15 6.15q-.25.25-.55.125T3 12.8V7.2q0-.35.3-.475t.55.125l2.8 2.8a.48.48 0 0 1 0 .7z\"\n })\n });\n}\n;\nIndentIncreaseIcon.displayName = \"IndentIncreaseIcon\";\nexport default forwardRef(IndentIncreaseIcon);","import { forwardRef } from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction ListNumberedIcon(props, ref) {\n return /*#__PURE__*/_jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"1em\",\n height: \"1em\",\n fill: \"currentColor\",\n viewBox: \"0 0 24 24\",\n ref: ref,\n ...props,\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M9 6a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H10a1 1 0 0 1-1-1m0 6a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H10a1 1 0 0 1-1-1m0 6a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H10a1 1 0 0 1-1-1M5.604 5.089A.75.75 0 0 1 6 5.75v4.5a.75.75 0 0 1-1.5 0V7.151l-.334.223a.75.75 0 0 1-.832-1.248l1.5-1a.75.75 0 0 1 .77-.037M5 13a2 2 0 0 0-1.139.321 1.85 1.85 0 0 0-.626.719 2.3 2.3 0 0 0-.234.921v.023l-.001.01v.005l.75.001H3a.75.75 0 0 0 1.5.01V15l.01-.072a.8.8 0 0 1 .067-.218.35.35 0 0 1 .116-.14c.04-.027.126-.07.307-.07s.267.043.307.07a.35.35 0 0 1 .116.14.8.8 0 0 1 .076.29v.008a.53.53 0 0 1-.14.352l-2.161 2.351a.75.75 0 0 0-.198.523v.016c0 .414.336.75.75.75h2.5a.75.75 0 0 0 0-1.5h-.82l1.034-1.124C6.809 16 7 15.51 7 15h-.75H7v-.039l-.004-.068a2.3 2.3 0 0 0-.231-.853 1.85 1.85 0 0 0-.626-.719A2 2 0 0 0 5 13m-.5 2.003V15v.01z\"\n })\n });\n}\n;\nListNumberedIcon.displayName = \"ListNumberedIcon\";\nexport default forwardRef(ListNumberedIcon);","import { forwardRef } from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnderlineIcon(props, ref) {\n return /*#__PURE__*/_jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"1em\",\n height: \"1em\",\n fill: \"currentColor\",\n viewBox: \"0 0 24 24\",\n ref: ref,\n ...props,\n children: /*#__PURE__*/_jsx(\"path\", {\n d: \"M6 21a.97.97 0 0 1-.713-.288A.97.97 0 0 1 5 20q0-.424.287-.712A.97.97 0 0 1 6 19h12q.424 0 .712.288.288.287.288.712 0 .424-.288.712A.97.97 0 0 1 18 21zm6-4q-2.525 0-3.925-1.575t-1.4-4.175V4.275q0-.525.388-.9A1.27 1.27 0 0 1 7.975 3q.525 0 .9.375t.375.9V11.4q0 1.4.7 2.275t2.05.875 2.05-.875.7-2.275V4.275q0-.525.387-.9A1.27 1.27 0 0 1 16.05 3q.525 0 .9.375t.375.9v6.975q0 2.6-1.4 4.175T12 17\"\n })\n });\n}\n;\nUnderlineIcon.displayName = \"UnderlineIcon\";\nexport default forwardRef(UnderlineIcon);","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type FormattingFunctions } from \"@vector-im/matrix-wysiwyg\";\nimport React, { type ChangeEvent, useState } from \"react\";\n\nimport { _t } from \"../../../../../languageHandler\";\nimport Modal from \"../../../../../Modal\";\nimport Field from \"../../../elements/Field\";\nimport { type ComposerContextState } from \"../ComposerContext\";\nimport { isSelectionEmpty, setSelection } from \"../utils/selection\";\nimport BaseDialog from \"../../../dialogs/BaseDialog\";\nimport DialogButtons from \"../../../elements/DialogButtons\";\n\nexport function openLinkModal(\n composer: FormattingFunctions,\n composerContext: ComposerContextState,\n isEditing: boolean,\n): void {\n Modal.createDialog(\n LinkModal,\n {\n composerContext,\n composer,\n isTextEnabled: isSelectionEmpty(),\n isEditing,\n },\n \"mx_CompoundDialog\",\n false,\n true,\n );\n}\n\nfunction isEmpty(text: string): boolean {\n return text.length < 1;\n}\n\ninterface LinkModalProps {\n composer: FormattingFunctions;\n isTextEnabled: boolean;\n onFinished: () => void;\n composerContext: ComposerContextState;\n isEditing: boolean;\n}\n\nexport const LinkModal: React.FC<LinkModalProps> = ({\n composer,\n isTextEnabled,\n onFinished,\n composerContext,\n isEditing,\n}) => {\n const [hasLinkChanged, setHasLinkChanged] = useState(false);\n const [fields, setFields] = useState({ text: \"\", link: isEditing ? composer.getLink() : \"\" });\n const hasText = !isEditing && isTextEnabled;\n const isSaveDisabled = !hasLinkChanged || (hasText && isEmpty(fields.text)) || isEmpty(fields.link);\n\n return (\n <BaseDialog\n className=\"mx_LinkModal\"\n title={isEditing ? _t(\"composer|link_modal|title_edit\") : _t(\"composer|link_modal|title_create\")}\n hasCancel={true}\n onFinished={onFinished}\n >\n <form\n className=\"mx_LinkModal_content\"\n onSubmit={async (evt) => {\n evt.preventDefault();\n evt.stopPropagation();\n\n onFinished();\n\n // When submitting is done when pressing enter when the link field has the focus,\n // The link field is getting back the focus (due to react-focus-lock)\n // So we are waiting that the focus stuff is done to play with the composer selection\n await new Promise((resolve) => setTimeout(resolve, 0));\n\n await setSelection(composerContext.selection);\n composer.link(fields.link, isTextEnabled ? fields.text : undefined);\n }}\n >\n {hasText && (\n <Field\n required={true}\n autoFocus={true}\n label={_t(\"composer|link_modal|text_field_label\")}\n value={fields.text}\n className=\"mx_LinkModal_Field\"\n placeholder=\"\"\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n setFields((fields) => ({ ...fields, text: e.target.value }))\n }\n />\n )}\n <Field\n required={true}\n autoFocus={!hasText}\n label={_t(\"composer|link_modal|link_field_label\")}\n value={fields.link}\n className=\"mx_LinkModal_Field\"\n placeholder=\"\"\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n setFields((fields) => ({ ...fields, link: e.target.value }));\n setHasLinkChanged(true);\n }}\n />\n\n <div className=\"mx_LinkModal_buttons\">\n {isEditing && (\n <button\n type=\"button\"\n className=\"danger\"\n onClick={() => {\n composer.removeLinks();\n onFinished();\n }}\n >\n {_t(\"action|remove\")}\n </button>\n )}\n <DialogButtons\n primaryButton={_t(\"action|save\")}\n primaryDisabled={isSaveDisabled}\n primaryIsSubmit={true}\n onCancel={onFinished}\n />\n </div>\n </form>\n </BaseDialog>\n );\n};\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type JSX, type MouseEventHandler, type ReactNode } from \"react\";\nimport { type FormattingFunctions, type AllActionStates, type ActionState } from \"@vector-im/matrix-wysiwyg\";\nimport classNames from \"classnames\";\nimport BoldIcon from \"@vector-im/compound-design-tokens/assets/web/icons/bold\";\nimport BulletedListIcon from \"@vector-im/compound-design-tokens/assets/web/icons/list-bulleted\";\nimport CodeBlockIcon from \"@vector-im/compound-design-tokens/assets/web/icons/code\";\nimport UnIndentIcon from \"@vector-im/compound-design-tokens/assets/web/icons/indent-decrease\";\nimport IndentIcon from \"@vector-im/compound-design-tokens/assets/web/icons/indent-increase\";\nimport InlineCodeIcon from \"@vector-im/compound-design-tokens/assets/web/icons/inline-code\";\nimport ItalicIcon from \"@vector-im/compound-design-tokens/assets/web/icons/italic\";\nimport NumberedListIcon from \"@vector-im/compound-design-tokens/assets/web/icons/list-numbered\";\nimport QuoteIcon from \"@vector-im/compound-design-tokens/assets/web/icons/quote\";\nimport StrikeThroughIcon from \"@vector-im/compound-design-tokens/assets/web/icons/strikethrough\";\nimport UnderlineIcon from \"@vector-im/compound-design-tokens/assets/web/icons/underline\";\nimport LinkIcon from \"@vector-im/compound-design-tokens/assets/web/icons/link\";\n\nimport { _t } from \"../../../../../languageHandler\";\nimport AccessibleButton, { type ButtonEvent } from \"../../../elements/AccessibleButton\";\nimport { openLinkModal } from \"./LinkModal\";\nimport { useComposerContext } from \"../ComposerContext\";\nimport { KeyboardShortcut } from \"../../../settings/KeyboardShortcut\";\nimport { type KeyCombo } from \"../../../../../KeyBindingsManager\";\n\ninterface ButtonProps {\n icon: ReactNode;\n actionState: ActionState;\n onClick: MouseEventHandler<HTMLButtonElement>;\n label: string;\n keyCombo?: KeyCombo;\n}\n\nfunction Button({ label, keyCombo, onClick, actionState, icon }: ButtonProps): JSX.Element {\n return (\n <AccessibleButton\n element=\"button\"\n onClick={onClick as (e: ButtonEvent) => void}\n aria-label={label}\n disabled={actionState === \"disabled\"}\n className={classNames(\"mx_FormattingButtons_Button\", {\n mx_FormattingButtons_active: actionState === \"reversed\",\n mx_FormattingButtons_Button_hover: actionState === \"enabled\",\n mx_FormattingButtons_disabled: actionState === \"disabled\",\n })}\n title={actionState === \"disabled\" ? undefined : label}\n caption={\n keyCombo && (\n <KeyboardShortcut value={keyCombo} className=\"mx_FormattingButtons_Tooltip_KeyboardShortcut\" />\n )\n }\n placement=\"top\"\n >\n {icon}\n </AccessibleButton>\n );\n}\n\ninterface FormattingButtonsProps {\n composer: FormattingFunctions;\n actionStates: AllActionStates;\n /**\n * Whether all buttons should be disabled\n */\n disabled?: boolean;\n}\n\nexport function FormattingButtons({ composer, actionStates, disabled }: FormattingButtonsProps): JSX.Element {\n const composerContext = useComposerContext();\n const isInList = actionStates.unorderedList === \"reversed\" || actionStates.orderedList === \"reversed\";\n return (\n <div className=\"mx_FormattingButtons\">\n <Button\n actionState={disabled ? \"disabled\" : actionStates.bold}\n label={_t(\"composer|format_bold\")}\n keyCombo={{ ctrlOrCmdKey: true, key: \"b\" }}\n onClick={() => composer.bold()}\n icon={<BoldIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n <Button\n actionState={disabled ? \"disabled\" : actionStates.italic}\n label={_t(\"composer|format_italic\")}\n keyCombo={{ ctrlOrCmdKey: true, key: \"i\" }}\n onClick={() => composer.italic()}\n icon={<ItalicIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n <Button\n actionState={disabled ? \"disabled\" : actionStates.underline}\n label={_t(\"composer|format_underline\")}\n keyCombo={{ ctrlOrCmdKey: true, key: \"u\" }}\n onClick={() => composer.underline()}\n icon={<UnderlineIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n <Button\n actionState={disabled ? \"disabled\" : actionStates.strikeThrough}\n label={_t(\"composer|format_strikethrough\")}\n onClick={() => composer.strikeThrough()}\n icon={<StrikeThroughIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n <Button\n actionState={disabled ? \"disabled\" : actionStates.unorderedList}\n label={_t(\"composer|format_unordered_list\")}\n onClick={() => composer.unorderedList()}\n icon={<BulletedListIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n <Button\n actionState={disabled ? \"disabled\" : actionStates.orderedList}\n label={_t(\"composer|format_ordered_list\")}\n onClick={() => composer.orderedList()}\n icon={<NumberedListIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n {isInList && (\n <Button\n actionState={disabled ? \"disabled\" : actionStates.indent}\n label={_t(\"composer|format_increase_indent\")}\n onClick={() => composer.indent()}\n icon={<IndentIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n )}\n {isInList && (\n <Button\n actionState={disabled ? \"disabled\" : actionStates.unindent}\n label={_t(\"composer|format_decrease_indent\")}\n onClick={() => composer.unindent()}\n icon={<UnIndentIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n )}\n <Button\n actionState={disabled ? \"disabled\" : actionStates.quote}\n label={_t(\"action|quote\")}\n onClick={() => composer.quote()}\n icon={<QuoteIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n <Button\n actionState={disabled ? \"disabled\" : actionStates.inlineCode}\n label={_t(\"composer|format_inline_code\")}\n keyCombo={{ ctrlOrCmdKey: true, key: \"e\" }}\n onClick={() => composer.inlineCode()}\n icon={<InlineCodeIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n <Button\n actionState={disabled ? \"disabled\" : actionStates.codeBlock}\n label={_t(\"composer|format_code_block\")}\n onClick={() => composer.codeBlock()}\n icon={<CodeBlockIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n <Button\n actionState={disabled ? \"disabled\" : actionStates.link}\n label={_t(\"composer|format_link\")}\n onClick={() => openLinkModal(composer, composerContext, actionStates.link === \"reversed\")}\n icon={<LinkIcon className=\"mx_FormattingButtons_Icon\" />}\n />\n </div>\n );\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type Wysiwyg, type WysiwygEvent } from \"@vector-im/matrix-wysiwyg\";\nimport { useCallback } from \"react\";\nimport { type MatrixClient } from \"matrix-js-sdk/src/matrix\";\n\nimport { useSettingValue } from \"../../../../../hooks/useSettings\";\nimport { getKeyBindingsManager } from \"../../../../../KeyBindingsManager\";\nimport { KeyBindingAction } from \"../../../../../accessibility/KeyboardShortcuts\";\nimport { findEditableEvent } from \"../../../../../utils/EventUtils\";\nimport dis from \"../../../../../dispatcher/dispatcher\";\nimport { Action } from \"../../../../../dispatcher/actions\";\nimport { type IRoomState } from \"../../../../structures/RoomView\";\nimport { type ComposerContextState, useComposerContext } from \"../ComposerContext\";\nimport type EditorStateTransfer from \"../../../../../utils/EditorStateTransfer\";\nimport { useMatrixClientContext } from \"../../../../../contexts/MatrixClientContext\";\nimport { isCaretAtEnd, isCaretAtStart } from \"../utils/selection\";\nimport { getEventsFromEditorStateTransfer, getEventsFromRoom } from \"../utils/event\";\nimport { endEditing } from \"../utils/editing\";\nimport type Autocomplete from \"../../Autocomplete\";\nimport { handleClipboardEvent, handleEventWithAutocomplete, isEventToHandleAsClipboardEvent } from \"./utils\";\nimport { useScopedRoomContext } from \"../../../../../contexts/ScopedRoomContext.tsx\";\nimport { useRoomUploadViewModel } from \"../../../../../viewmodels/room/RoomUploadViewModel.tsx\";\n\nexport function useInputEventProcessor(\n onSend: () => void,\n autocompleteRef: React.RefObject<Autocomplete | null>,\n initialContent?: string,\n): (event: WysiwygEvent, composer: Wysiwyg, editor: HTMLElement) => WysiwygEvent | null {\n const roomUploadVm = useRoomUploadViewModel();\n const roomContext = useScopedRoomContext(\"liveTimeline\", \"room\", \"replyToEvent\", \"timelineRenderingType\");\n const composerContext = useComposerContext();\n const mxClient = useMatrixClientContext();\n const isCtrlEnterToSend = useSettingValue(\"MessageComposerInput.ctrlEnterToSend\");\n\n return useCallback(\n (event: WysiwygEvent, composer: Wysiwyg, editor: HTMLElement) => {\n const send = (): void => {\n event.stopPropagation?.();\n event.preventDefault?.();\n // do not send the message if we have the autocomplete open, regardless of settings\n if (autocompleteRef?.current && !autocompleteRef.current.state.hide) {\n return;\n }\n onSend();\n };\n\n if (isEventToHandleAsClipboardEvent(event)) {\n const data = event instanceof ClipboardEvent ? event.clipboardData : event.dataTransfer;\n const handled = handleClipboardEvent(event, data, roomUploadVm);\n return handled ? null : event;\n }\n\n const isKeyboardEvent = event instanceof KeyboardEvent;\n if (isKeyboardEvent) {\n return handleKeyboardEvent(\n event,\n send,\n initialContent,\n composer,\n editor,\n roomContext,\n composerContext,\n mxClient,\n autocompleteRef,\n );\n } else {\n return handleInputEvent(event, send, isCtrlEnterToSend);\n }\n },\n [\n isCtrlEnterToSend,\n onSend,\n initialContent,\n roomUploadVm,\n roomContext,\n composerContext,\n mxClient,\n autocompleteRef,\n ],\n );\n}\n\ntype Send = () => void;\n\nfunction handleKeyboardEvent(\n event: KeyboardEvent,\n send: Send,\n initialContent: string | undefined,\n composer: Wysiwyg,\n editor: HTMLElement,\n roomContext: Pick<IRoomState, \"liveTimeline\" | \"timelineRenderingType\" | \"room\">,\n composerContext: ComposerContextState,\n mxClient: MatrixClient | undefined,\n autocompleteRef: React.RefObject<Autocomplete | null>,\n): KeyboardEvent | null {\n const { editorStateTransfer } = composerContext;\n const isEditing = Boolean(editorStateTransfer);\n const isEditorModified = isEditing ? initialContent !== composer.content() : composer.content().length !== 0;\n const action = getKeyBindingsManager().getMessageComposerAction(event);\n\n // we need autocomplete to take priority when it is open for using enter to select\n const isHandledByAutocomplete = handleEventWithAutocomplete(autocompleteRef, event);\n if (isHandledByAutocomplete) {\n return event;\n }\n\n // taking the client from context gives us an client | undefined type, narrow it down\n if (mxClient === undefined) {\n return null;\n }\n\n switch (action) {\n case KeyBindingAction.SendMessage:\n send();\n return null;\n case KeyBindingAction.EditPrevMessage: {\n // Or if the caret is not at the beginning of the editor\n // Or the editor is modified\n if (!isCaretAtStart(editor) || isEditorModified) {\n break;\n }\n\n const isDispatched = dispatchEditEvent(\n event,\n false,\n editorStateTransfer,\n composerContext,\n roomContext,\n mxClient,\n );\n\n if (isDispatched) {\n return null;\n }\n\n break;\n }\n case KeyBindingAction.EditNextMessage: {\n // If not in edition\n // Or if the caret is not at the end of the editor\n // Or the editor is modified\n if (!editorStateTransfer || !isCaretAtEnd(editor) || isEditorModified) {\n break;\n }\n\n const isDispatched = dispatchEditEvent(\n event,\n true,\n editorStateTransfer,\n composerContext,\n roomContext,\n mxClient,\n );\n if (!isDispatched) {\n endEditing(roomContext);\n event.preventDefault();\n event.stopPropagation();\n }\n\n return null;\n }\n }\n\n return event;\n}\n\nfunction dispatchEditEvent(\n event: KeyboardEvent,\n isForward: boolean,\n editorStateTransfer: EditorStateTransfer | undefined,\n composerContext: ComposerContextState,\n roomContext: Pick<IRoomState, \"liveTimeline\" | \"timelineRenderingType\" | \"room\">,\n mxClient: MatrixClient,\n): boolean {\n const foundEvents = editorStateTransfer\n ? getEventsFromEditorStateTransfer(editorStateTransfer, roomContext, mxClient)\n : getEventsFromRoom(composerContext, roomContext);\n if (!foundEvents) {\n return false;\n }\n\n const newEvent = findEditableEvent({\n events: foundEvents,\n isForward,\n fromEventId: editorStateTransfer?.getEvent().getId(),\n matrixClient: mxClient,\n });\n if (newEvent) {\n dis.dispatch({\n action: Action.EditEvent,\n event: newEvent,\n timelineRenderingType: roomContext.timelineRenderingType,\n });\n event.stopPropagation();\n event.preventDefault();\n return true;\n }\n return false;\n}\n\ntype InputEvent = Exclude<WysiwygEvent, KeyboardEvent | ClipboardEvent>;\n\nfunction handleInputEvent(event: InputEvent, send: Send, isCtrlEnterToSend: boolean): InputEvent | null {\n switch (event.inputType) {\n case \"insertParagraph\":\n if (!isCtrlEnterToSend) {\n send();\n return null;\n }\n break;\n case \"sendMessage\":\n if (isCtrlEnterToSend) {\n send();\n return null;\n }\n break;\n }\n\n return event;\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type MatrixClient, type MatrixEvent, THREAD_RELATION_TYPE } from \"matrix-js-sdk/src/matrix\";\n\nimport type EditorStateTransfer from \"../../../../../utils/EditorStateTransfer\";\nimport { type IRoomState } from \"../../../../structures/RoomView\";\nimport { type ComposerContextState } from \"../ComposerContext\";\n\n// From EditMessageComposer private get events(): MatrixEvent[]\nexport function getEventsFromEditorStateTransfer(\n editorStateTransfer: EditorStateTransfer,\n roomContext: Pick<IRoomState, \"liveTimeline\">,\n mxClient: MatrixClient,\n): MatrixEvent[] | undefined {\n const liveTimelineEvents = roomContext.liveTimeline?.getEvents();\n if (!liveTimelineEvents) {\n return;\n }\n\n const roomId = editorStateTransfer.getEvent().getRoomId();\n if (!roomId) {\n return;\n }\n\n const room = mxClient.getRoom(roomId);\n if (!room) {\n return;\n }\n\n const pendingEvents = room.getPendingEvents();\n const isInThread = Boolean(editorStateTransfer.getEvent().getThread());\n return liveTimelineEvents.concat(isInThread ? [] : pendingEvents);\n}\n\n// From SendMessageComposer private onKeyDown = (event: KeyboardEvent): void\nexport function getEventsFromRoom(\n composerContext: ComposerContextState,\n roomContext: Pick<IRoomState, \"liveTimeline\" | \"room\">,\n): MatrixEvent[] | undefined {\n const isReplyingToThread = composerContext.eventRelation?.key === THREAD_RELATION_TYPE.name;\n return roomContext.liveTimeline\n ?.getEvents()\n .concat(isReplyingToThread ? [] : roomContext.room?.getPendingEvents() || []);\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { memo, type RefObject, type ReactNode, useEffect, useMemo, useRef } from \"react\";\nimport { type IEventRelation } from \"matrix-js-sdk/src/matrix\";\nimport { EMOTICON_TO_EMOJI } from \"@matrix-org/emojibase-bindings\";\nimport { useWysiwyg, type FormattingFunctions } from \"@vector-im/matrix-wysiwyg\";\nimport classNames from \"classnames\";\n\nimport type Autocomplete from \"../../Autocomplete\";\nimport { WysiwygAutocomplete } from \"./WysiwygAutocomplete\";\nimport { FormattingButtons } from \"./FormattingButtons\";\nimport { Editor } from \"./Editor\";\nimport { useInputEventProcessor } from \"../hooks/useInputEventProcessor\";\nimport { useSetCursorPosition } from \"../hooks/useSetCursorPosition\";\nimport { useIsFocused } from \"../hooks/useIsFocused\";\nimport defaultDispatcher from \"../../../../../dispatcher/dispatcher\";\nimport { Action } from \"../../../../../dispatcher/actions\";\nimport { parsePermalink } from \"../../../../../utils/permalinks/Permalinks\";\nimport { isNotNull } from \"../../../../../Typeguards\";\nimport { useSettingValue } from \"../../../../../hooks/useSettings\";\nimport { useScopedRoomContext } from \"../../../../../contexts/ScopedRoomContext.tsx\";\nimport { useContainsCommand } from \"../hooks/useContainsCommand.ts\";\n\ninterface WysiwygComposerProps {\n disabled?: boolean;\n onChange: (content: string) => void;\n onSend: () => void;\n placeholder?: string;\n initialContent?: string;\n className?: string;\n leftComponent?: ReactNode;\n rightComponent?: ReactNode;\n children?: (ref: RefObject<HTMLDivElement | null>, wysiwyg: FormattingFunctions) => ReactNode;\n eventRelation?: IEventRelation;\n}\n\nfunction getEmojiSuggestions(enabled: boolean): Map<string, string> {\n const emojiSuggestions = new Map(Array.from(EMOTICON_TO_EMOJI, ([key, value]) => [key, value.unicode]));\n return enabled ? emojiSuggestions : new Map();\n}\n\nexport const WysiwygComposer = memo(function WysiwygComposer({\n disabled = false,\n onChange,\n onSend,\n placeholder,\n initialContent,\n className,\n leftComponent,\n rightComponent,\n children,\n eventRelation,\n}: WysiwygComposerProps) {\n const { room } = useScopedRoomContext(\"room\");\n const autocompleteRef = useRef<Autocomplete | null>(null);\n\n const inputEventProcessor = useInputEventProcessor(onSend, autocompleteRef, initialContent);\n\n const isAutoReplaceEmojiEnabled = useSettingValue(\"MessageComposerInput.autoReplaceEmoji\");\n const emojiSuggestions = useMemo(() => getEmojiSuggestions(isAutoReplaceEmojiEnabled), [isAutoReplaceEmojiEnabled]);\n\n const { ref, isWysiwygReady, content, actionStates, wysiwyg, suggestion, messageContent } = useWysiwyg({\n initialContent,\n inputEventProcessor,\n emojiSuggestions,\n });\n\n const { isFocused, onFocus } = useIsFocused();\n\n const isReady = isWysiwygReady && !disabled;\n const computedPlaceholder = (!content && placeholder) || undefined;\n\n useSetCursorPosition(!isReady, ref);\n\n useEffect(() => {\n if (!disabled && isNotNull(messageContent)) {\n onChange(messageContent);\n }\n }, [onChange, messageContent, disabled]);\n\n // Disable formatting buttons if the message content contains a slash command\n const disableFormatting = useContainsCommand(content, room);\n\n useEffect(() => {\n function handleClick(e: Event): void {\n e.preventDefault();\n if (\n e.target &&\n e.target instanceof HTMLAnchorElement &&\n e.target.getAttribute(\"data-mention-type\") === \"user\"\n ) {\n const parsedLink = parsePermalink(e.target.href);\n if (room && parsedLink?.userId)\n defaultDispatcher.dispatch({\n action: Action.ViewUser,\n member: room.getMember(parsedLink.userId),\n });\n }\n }\n\n const mentions: NodeList | undefined = ref.current?.querySelectorAll(\"a[data-mention-type]\");\n if (mentions) {\n mentions.forEach((mention) => mention.addEventListener(\"click\", handleClick));\n }\n\n return () => {\n if (mentions) mentions.forEach((mention) => mention.removeEventListener(\"click\", handleClick));\n };\n }, [ref, room, content]);\n\n return (\n <div\n data-testid=\"WysiwygComposer\"\n className={classNames(className, { [`${className}-focused`]: isFocused })}\n onFocus={onFocus}\n onBlur={onFocus}\n >\n <WysiwygAutocomplete\n ref={autocompleteRef}\n suggestion={suggestion}\n handleMention={wysiwyg.mention}\n handleAtRoomMention={wysiwyg.mentionAtRoom}\n handleCommand={wysiwyg.command}\n handleEmoji={wysiwyg.emoji}\n />\n <FormattingButtons composer={wysiwyg} actionStates={actionStates} disabled={disableFormatting} />\n <Editor\n ref={ref}\n disabled={!isReady}\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n placeholder={computedPlaceholder}\n />\n {children?.(ref, wysiwyg)}\n </div>\n );\n});\n","/*\nCopyright 2025 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type Room } from \"matrix-js-sdk/src/matrix\";\nimport { useEffect, useState, useRef } from \"react\";\n\nimport CommandProvider from \"../../../../../autocomplete/CommandProvider\";\n\n/**\n * A hook which determines if the given content contains a slash command.\n * @returns true if the content contains a slash command, false otherwise.\n * @param content The content to check for commands.\n * @param room The current room.\n */\nexport function useContainsCommand(content: string | null, room: Room | undefined): boolean {\n const [contentContainsCommands, setContentContainsCommands] = useState(false);\n const providerRef = useRef<CommandProvider | null>(null);\n const currentRoomIdRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (!room || !content) {\n setContentContainsCommands(false);\n return;\n }\n\n // Create or reuse CommandProvider for the current room\n if (!providerRef.current || currentRoomIdRef.current !== room.roomId) {\n providerRef.current = new CommandProvider(room);\n currentRoomIdRef.current = room.roomId;\n }\n\n const provider = providerRef.current;\n provider\n .getCompletions(content, { start: 0, end: 0 })\n .then((results) => {\n if (results.length > 0) {\n setContentContainsCommands(true);\n } else {\n setContentContainsCommands(false);\n }\n })\n .catch(() => {\n // If there's an error getting completions, assume no commands\n setContentContainsCommands(false);\n });\n }, [content, room]);\n\n return contentContainsCommands;\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type FocusEvent, useCallback, useEffect, useRef, useState } from \"react\";\n\nexport function useIsFocused(): {\n isFocused: boolean;\n onFocus(this: void, event: FocusEvent<HTMLElement>): void;\n} {\n const [isFocused, setIsFocused] = useState(false);\n const timeoutIDRef = useRef<number>(undefined);\n\n useEffect(() => () => clearTimeout(timeoutIDRef.current), [timeoutIDRef]);\n const onFocus = useCallback(\n (event: FocusEvent<HTMLElement>) => {\n clearTimeout(timeoutIDRef.current);\n if (event.type === \"focus\") {\n setIsFocused(true);\n } else {\n // To avoid a blink when we switch mode between plain text and rich text mode\n // We delay the unfocused action\n timeoutIDRef.current = window.setTimeout(() => setIsFocused(false), 100);\n }\n },\n [setIsFocused, timeoutIDRef],\n );\n\n return { isFocused, onFocus };\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type RefObject, useEffect } from \"react\";\n\nimport { setCursorPositionAtTheEnd } from \"./utils\";\n\nexport function useSetCursorPosition(disabled: boolean, ref: RefObject<HTMLDivElement | null>): void {\n useEffect(() => {\n if (ref.current && !disabled) {\n setCursorPositionAtTheEnd(ref.current);\n }\n }, [ref, disabled]);\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type RefObject } from \"react\";\nimport { type WysiwygEvent } from \"@vector-im/matrix-wysiwyg\";\n\nimport { type TimelineRenderingType } from \"../../../../../contexts/RoomContext\";\nimport { type IRoomState } from \"../../../../structures/RoomView\";\nimport type Autocomplete from \"../../Autocomplete\";\nimport { getKeyBindingsManager } from \"../../../../../KeyBindingsManager\";\nimport { KeyBindingAction } from \"../../../../../accessibility/KeyboardShortcuts\";\nimport { getBlobSafeMimeType } from \"../../../../../utils/blobs\";\nimport { isNotNull } from \"../../../../../Typeguards\";\nimport type { RoomUploadViewModel } from \"../../../../../viewmodels/room/RoomUploadViewModel\";\n\nexport function focusComposer(\n composerElement: RefObject<HTMLElement | null>,\n renderingType: TimelineRenderingType,\n roomContext: Pick<IRoomState, \"timelineRenderingType\">,\n timeoutId: RefObject<number | null>,\n): void {\n if (renderingType === roomContext.timelineRenderingType) {\n // Immediately set the focus, so if you start typing it\n // will appear in the composer\n composerElement.current?.focus();\n // If we call focus immediate, the focus _is_ in the right\n // place, but the cursor is invisible, presumably because\n // some other event is still processing.\n // The following line ensures that the cursor is actually\n // visible in composer.\n if (timeoutId.current) {\n clearTimeout(timeoutId.current);\n }\n timeoutId.current = window.setTimeout(() => composerElement.current?.focus(), 200);\n }\n}\n\nexport function setCursorPositionAtTheEnd(element: HTMLElement): void {\n const range = document.createRange();\n range.selectNodeContents(element);\n range.collapse(false);\n const selection = document.getSelection()!;\n selection.removeAllRanges();\n selection.addRange(range);\n\n element.focus();\n}\n\n/**\n * When the autocomplete modal is open we need to be able to properly\n * handle events that are dispatched. This allows the user to move the selection\n * in the autocomplete and select using enter.\n *\n * @param autocompleteRef - a ref to the autocomplete of interest\n * @param event - the keyboard event that has been dispatched\n * @returns boolean - whether or not the autocomplete has handled the event\n */\nexport function handleEventWithAutocomplete(\n autocompleteRef: RefObject<Autocomplete | null>,\n // we get a React Keyboard event from plain text composer, a Keyboard Event from the rich text composer\n event: KeyboardEvent | React.KeyboardEvent<HTMLDivElement>,\n): boolean {\n const autocompleteIsOpen = autocompleteRef?.current && !autocompleteRef.current.state.hide;\n\n if (!autocompleteRef.current || !autocompleteIsOpen) {\n return false;\n }\n\n let handled = false;\n const autocompleteAction = getKeyBindingsManager().getAutocompleteAction(event);\n const component = autocompleteRef.current;\n\n if (component && component.countCompletions() > 0) {\n switch (autocompleteAction) {\n case KeyBindingAction.ForceCompleteAutocomplete:\n case KeyBindingAction.CompleteAutocomplete:\n autocompleteRef.current.onConfirmCompletion();\n handled = true;\n break;\n case KeyBindingAction.PrevSelectionInAutocomplete:\n autocompleteRef.current.moveSelection(-1);\n handled = true;\n break;\n case KeyBindingAction.NextSelectionInAutocomplete:\n autocompleteRef.current.moveSelection(1);\n handled = true;\n break;\n case KeyBindingAction.CancelAutocomplete:\n autocompleteRef.current.onEscape(event);\n handled = true;\n break;\n default:\n break; // don't return anything, allow event to pass through\n }\n }\n\n if (handled) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n return handled;\n}\n\n/**\n * Takes an event and handles image pasting. Returns a boolean to indicate if it has handled\n * the event or not. Must accept either clipboard or input events in order to prevent issue:\n * https://github.com/vector-im/element-web/issues/25327\n *\n * @param event - event to process\n * @param data - data from the event to process\n * @param roomContext - room in which the event occurs\n * @param mxClient - current matrix client\n * @param eventRelation - used to send the event to the correct place eg timeline vs thread\n * @returns - boolean to show if the event was handled or not\n */\nexport function handleClipboardEvent(\n event: ClipboardEvent | InputEvent,\n data: DataTransfer | null,\n vm: RoomUploadViewModel,\n): boolean {\n function handleError(error: unknown): void {\n if (error instanceof Error) {\n console.log(error.message);\n } else if (typeof error === \"string\") {\n console.log(error);\n }\n }\n\n if (event.type !== \"paste\" || data === null) {\n return false;\n }\n\n // Prioritize text on the clipboard over files if RTF is present as Office on macOS puts a bitmap\n // in the clipboard as well as the content being copied. Modern versions of Office seem to not do this anymore.\n // We check text/rtf instead of text/plain as when copy+pasting a file from Finder or Gnome Image Viewer\n // it puts the filename in as text/plain which we want to ignore.\n if (data.files.length && !data.types.includes(\"text/rtf\")) {\n vm.initiateViaDataTransfer(data).catch(handleError);\n return true;\n }\n\n // Safari `Insert from iPhone or iPad`\n // data.getData(\"text/html\") returns a string like: <img src=\"blob:https://...\">\n if (data.types.includes(\"text/html\")) {\n const imgElementStr = data.getData(\"text/html\");\n const parser = new DOMParser();\n const imgDoc = parser.parseFromString(imgElementStr, \"text/html\");\n\n if (\n imgDoc.getElementsByTagName(\"img\").length !== 1 ||\n !imgDoc.querySelector(\"img\")?.src.startsWith(\"blob:\") ||\n imgDoc.childNodes.length !== 1\n ) {\n handleError(\"Failed to handle pasted content as Safari inserted content\");\n return false;\n }\n const imgSrc = imgDoc.querySelector(\"img\")!.src;\n\n fetch(imgSrc)\n .then((response) => {\n response\n .blob()\n .then((imgBlob) => {\n const type = imgBlob.type;\n const safetype = getBlobSafeMimeType(type);\n const ext = type.split(\"/\")[1];\n const parts = response.url.split(\"/\");\n const filename = parts[parts.length - 1];\n const file = new File([imgBlob], filename + \".\" + ext, { type: safetype });\n return vm.initiateViaInputFiles([file]);\n })\n .catch(handleError);\n })\n .catch(handleError);\n return true;\n }\n\n return false;\n}\n\n/**\n * Util to determine if an input event or clipboard event must be handled as a clipboard event.\n * Due to https://github.com/vector-im/element-web/issues/25327, certain paste events\n * must be listenened for with an onBeforeInput handler and so will be caught as input events.\n *\n * @param event - the event to test, can be a WysiwygEvent if it comes from the rich text editor, or\n * input or clipboard events if from the plain text editor\n * @returns - true if event should be handled as a clipboard event\n */\nexport function isEventToHandleAsClipboardEvent(\n event: WysiwygEvent | InputEvent | ClipboardEvent,\n): event is InputEvent | ClipboardEvent {\n const isInputEventForClipboard =\n event instanceof InputEvent && event.inputType === \"insertFromPaste\" && isNotNull(event.dataTransfer);\n const isClipboardEvent = event instanceof ClipboardEvent;\n\n return isClipboardEvent || isInputEventForClipboard;\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { EventStatus, type MatrixClient } from \"matrix-js-sdk/src/matrix\";\n\nimport { type IRoomState } from \"../../../../structures/RoomView\";\nimport dis from \"../../../../../dispatcher/dispatcher\";\nimport { Action } from \"../../../../../dispatcher/actions\";\nimport type EditorStateTransfer from \"../../../../../utils/EditorStateTransfer\";\n\nexport function endEditing(roomContext: Pick<IRoomState, \"timelineRenderingType\">): void {\n // todo local storage\n // localStorage.removeItem(this.editorRoomKey);\n // localStorage.removeItem(this.editorStateKey);\n\n // close the event editing and focus composer\n dis.dispatch({\n action: Action.EditEvent,\n event: null,\n timelineRenderingType: roomContext.timelineRenderingType,\n });\n dis.dispatch({\n action: Action.FocusSendMessageComposer,\n context: roomContext.timelineRenderingType,\n });\n}\n\nexport function cancelPreviousPendingEdit(mxClient: MatrixClient, editorStateTransfer: EditorStateTransfer): void {\n const originalEvent = editorStateTransfer.getEvent();\n const previousEdit = originalEvent.replacingEvent();\n if (previousEdit && (previousEdit.status === EventStatus.QUEUED || previousEdit.status === EventStatus.NOT_SENT)) {\n mxClient.cancelPendingEvent(previousEdit);\n }\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { type SubSelection } from \"../types\";\n\nexport function setSelection(selection: SubSelection): Promise<void> {\n if (selection.anchorNode && selection.focusNode) {\n const range = new Range();\n\n if (selection.isForward) {\n range.setStart(selection.anchorNode, selection.anchorOffset);\n range.setEnd(selection.focusNode, selection.focusOffset);\n } else {\n range.setStart(selection.focusNode, selection.focusOffset);\n range.setEnd(selection.anchorNode, selection.anchorOffset);\n }\n document.getSelection()?.removeAllRanges();\n document.getSelection()?.addRange(range);\n }\n\n // Waiting for the next loop to ensure that the selection is effective\n return new Promise((resolve) => setTimeout(resolve, 0));\n}\n\nexport function isSelectionEmpty(): boolean {\n const selection = document.getSelection();\n return Boolean(selection?.isCollapsed);\n}\n\nexport function isCaretAtStart(editor: HTMLElement): boolean {\n const selection = document.getSelection();\n\n // No selection or the caret is not at the beginning of the selected element\n if (!selection) {\n return false;\n }\n\n // When we are pressing keyboard up in an empty main composer, the selection is on the editor with an anchorOffset at O or 1 (yes, this is strange)\n const isOnFirstElement = selection.anchorNode === editor && selection.anchorOffset <= 1;\n if (isOnFirstElement) {\n return true;\n }\n\n // In case of nested html elements (list, code blocks), we are going through all the first child\n let child = editor.firstChild;\n do {\n if (child === selection.anchorNode) {\n return selection.anchorOffset === 0;\n }\n } while ((child = child?.firstChild || null));\n\n return false;\n}\n\nexport function isCaretAtEnd(editor: HTMLElement): boolean {\n const selection = document.getSelection();\n\n if (!selection) {\n return false;\n }\n\n // When we are cycling across all the timeline message with the keyboard\n // The caret is on the last text element but focusNode and anchorNode refers to the editor div\n // In this case, the focusOffset & anchorOffset match the index + 1 of the selected text\n const isOnLastElement = selection.focusNode === editor && selection.focusOffset === editor.childNodes?.length;\n if (isOnLastElement) {\n return true;\n }\n\n // In case of nested html elements (list, code blocks), we are going through all the last child\n // The last child of the editor is always a <br> tag, we skip it\n let child: ChildNode | null = editor.childNodes.item(editor.childNodes.length - 2);\n do {\n if (child === selection.focusNode) {\n // Checking that the cursor is at end of the selected text\n return selection.focusOffset === child.textContent?.length;\n }\n } while ((child = child.lastChild));\n\n return false;\n}\n"],"names":["getDefaultContextValue","defaultValue","_objectSpread","selection","anchorNode","anchorOffset","focusNode","focusOffset","isForward","ComposerContext","createContext","useComposerContext","useContext","displayName","setSelectionContext","composerContext","document","getSelection","range","getRangeAt","startContainer","startOffset","Editor","memo","disabled","placeholder","leftComponent","rightComponent","ref","isExpanded","breakingPoint","setIsExpanded","useState","useEffect","current","editor","resizeObserver","ResizeObserver","entries","requestAnimationFrame","_entries$","height","contentBoxSize","blockSize","observe","unobserve","useIsExpanded","onFocus","onBlur","onInput","isFocused","focusProps","useFocus","onSelectionChange","addEventListener","removeEventListener","useCallback","useSelection","React","className","classNames","mx_WysiwygComposer_Editor_content_placeholder","Boolean","style","contentEditable","role","dir","getRoomFromCompletion","completion","client","roomId","completionId","aliasFromCompletion","roomToReturn","getRoom","startsWith","getRooms","find","r","getCanonicalAlias","getAltAliases","includes","getCSSProperties","url","initialLetter","id","cssProperties","textColor","Avatar","push","join","getMentionAttributes","room","defaultLetterContent","attributes","Map","type","mentionedMember","getMember","name","userId","defaultAvatarUrl","avatarUrl","_Avatar$getInitialLet","set","_mentionedRoom$roomId2","mentionedRoom","_Avatar$getInitialLet2","_mentionedRoom$roomId","_Avatar$getInitialLet3","WysiwygAutocomplete","suggestion","handleMention","handleCommand","handleAtRoomMention","handleEmoji","useScopedRoomContext","useMatrixClientContext","autoCompleteQuery","keyChar","text","buildQuery","Autocomplete","query","onConfirm","undefined","trim","href","_getRoomFromCompletio","getMentionDisplayText","start","end","ListBulletedIcon","props","jsx_runtime","jsx","xmlns","width","fill","viewBox","children","d","list_bulleted","react","forwardRef","CodeIcon","code","IndentDecreaseIcon","indent_decrease","IndentIncreaseIcon","indent_increase","ListNumberedIcon","list_numbered","UnderlineIcon","underline","isEmpty","length","LinkModal","composer","isTextEnabled","onFinished","isEditing","hasLinkChanged","setHasLinkChanged","fields","setFields","link","getLink","hasText","isSaveDisabled","BaseDialog","title","_t","hasCancel","onSubmit","async","evt","preventDefault","stopPropagation","Promise","resolve","setTimeout","setSelection","Field","required","autoFocus","label","value","onChange","e","target","onClick","removeLinks","DialogButtons","primaryButton","primaryDisabled","primaryIsSubmit","onCancel","Button","keyCombo","actionState","icon","AccessibleButton","element","mx_FormattingButtons_active","mx_FormattingButtons_Button_hover","mx_FormattingButtons_disabled","caption","KeyboardShortcut","placement","FormattingButtons","actionStates","isInList","unorderedList","orderedList","bold","ctrlOrCmdKey","key","BoldIcon","italic","ItalicIcon","strikeThrough","StrikeThroughIcon","BulletedListIcon","NumberedListIcon","indent","IndentIcon","unindent","UnIndentIcon","quote","QuoteIcon","inlineCode","InlineCodeIcon","codeBlock","CodeBlockIcon","Modal","createDialog","isSelectionEmpty","openLinkModal","LinkIcon","useInputEventProcessor","onSend","autocompleteRef","initialContent","roomUploadVm","useRoomUploadViewModel","roomContext","mxClient","isCtrlEnterToSend","useSettingValue","event","send","_event$stopPropagatio","_event$preventDefault","call","state","hide","isEventToHandleAsClipboardEvent","data","ClipboardEvent","clipboardData","dataTransfer","handleClipboardEvent","KeyboardEvent","editorStateTransfer","isEditorModified","content","action","getKeyBindingsManager","getMessageComposerAction","isHandledByAutocomplete","handleEventWithAutocomplete","KeyBindingAction","SendMessage","EditPrevMessage","isCaretAtStart","dispatchEditEvent","EditNextMessage","isCaretAtEnd","endEditing","handleKeyboardEvent","inputType","handleInputEvent","foundEvents","_roomContext$liveTime","liveTimelineEvents","liveTimeline","getEvents","getEvent","getRoomId","pendingEvents","getPendingEvents","isInThread","getThread","concat","getEventsFromEditorStateTransfer","_composerContext$even","_roomContext$liveTime2","_roomContext$room","isReplyingToThread","eventRelation","THREAD_RELATION_TYPE","getEventsFromRoom","newEvent","findEditableEvent","events","fromEventId","getId","matrixClient","dis","dispatch","Action","EditEvent","timelineRenderingType","WysiwygComposer","useRef","inputEventProcessor","isAutoReplaceEmojiEnabled","emojiSuggestions","useMemo","enabled","Array","from","EMOTICON_TO_EMOJI","unicode","getEmojiSuggestions","isWysiwygReady","wysiwyg","messageContent","useWysiwyg","useIsFocused","isReady","computedPlaceholder","useSetCursorPosition","isNotNull","disableFormatting","contentContainsCommands","setContentContainsCommands","providerRef","currentRoomIdRef","CommandProvider","getCompletions","then","results","catch","useContainsCommand","_ref$current","handleClick","HTMLAnchorElement","getAttribute","parsedLink","parsePermalink","defaultDispatcher","ViewUser","member","mentions","querySelectorAll","forEach","mention","mentionAtRoom","command","emoji","setIsFocused","timeoutIDRef","clearTimeout","window","setCursorPositionAtTheEnd","focusComposer","composerElement","renderingType","timeoutId","_composerElement$curr","focus","_composerElement$curr2","createRange","selectNodeContents","collapse","removeAllRanges","addRange","autocompleteIsOpen","handled","autocompleteAction","getAutocompleteAction","component","countCompletions","ForceCompleteAutocomplete","CompleteAutocomplete","onConfirmCompletion","PrevSelectionInAutocomplete","moveSelection","NextSelectionInAutocomplete","CancelAutocomplete","onEscape","vm","handleError","error","Error","console","log","message","files","types","initiateViaDataTransfer","_imgDoc$querySelector","imgElementStr","getData","imgDoc","DOMParser","parseFromString","getElementsByTagName","querySelector","src","childNodes","imgSrc","fetch","response","blob","imgBlob","safetype","getBlobSafeMimeType","ext","split","parts","filename","file","File","initiateViaInputFiles","isInputEventForClipboard","InputEvent","FocusSendMessageComposer","context","cancelPreviousPendingEdit","previousEdit","replacingEvent","status","EventStatus","QUEUED","NOT_SENT","cancelPendingEvent","_document$getSelectio","_document$getSelectio2","Range","setStart","setEnd","isCollapsed","child","firstChild","_child","_editor$childNodes","item","_child$textContent","textContent","lastChild"],"sourceRoot":""}