Use globalThis and React.JSX in the browser code. [skip build]
This commit is contained in:
@@ -24,7 +24,7 @@ export function AngleSelector({
|
||||
onChange,
|
||||
size = 80,
|
||||
disabled = false,
|
||||
}: AngleSelectorProps): JSX.Element {
|
||||
}: AngleSelectorProps): React.JSX.Element {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ import {
|
||||
import { MessageLayout, MessageSpacing } from '../../../state/settings';
|
||||
import { useMatrixClient } from '../../../hooks/useMatrixClient';
|
||||
import { useEmojiUsage } from '../../../hooks/useEmojiUsage';
|
||||
import { emojis } from '../../../plugins/emoji';
|
||||
import { IEmoji, emojis } from '../../../plugins/emoji';
|
||||
import * as css from './styles.css';
|
||||
import { EventReaders } from '../../../components/event-readers';
|
||||
import { TextViewer } from '../../../components/text-viewer';
|
||||
|
||||
@@ -184,7 +184,7 @@ export const renderMatrixMention = (
|
||||
};
|
||||
|
||||
export const factoryRenderLinkifyWithMention = (
|
||||
mentionRender: (href: string) => JSX.Element | undefined,
|
||||
mentionRender: (href: string) => React.JSX.Element | undefined,
|
||||
): OptFn<(ir: IntermediateRepresentation) => any> => {
|
||||
const render: OptFn<(ir: IntermediateRepresentation) => any> = ({
|
||||
tagName,
|
||||
@@ -205,7 +205,7 @@ export const factoryRenderLinkifyWithMention = (
|
||||
return render;
|
||||
};
|
||||
|
||||
export const scaleSystemEmoji = (text: string): (string | JSX.Element)[] =>
|
||||
export const scaleSystemEmoji = (text: string): (string | React.JSX.Element)[] =>
|
||||
findAndReplace(
|
||||
text,
|
||||
EMOJI_REG_G,
|
||||
@@ -231,8 +231,8 @@ export const makeHighlightRegex = (highlights: string[]): RegExp | undefined =>
|
||||
|
||||
export const highlightText = (
|
||||
regex: RegExp,
|
||||
data: (string | JSX.Element)[],
|
||||
): (string | JSX.Element)[] =>
|
||||
data: (string | React.JSX.Element)[],
|
||||
): (string | React.JSX.Element)[] =>
|
||||
data.flatMap((text) => {
|
||||
if (typeof text !== 'string') return text;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user