diff --git a/src/appservice/bot/ListCommand.tsx b/src/appservice/bot/ListCommand.tsx index 536f4a30..ca8c7d7d 100644 --- a/src/appservice/bot/ListCommand.tsx +++ b/src/appservice/bot/ListCommand.tsx @@ -8,7 +8,7 @@ import { BaseFunction, defineInterfaceCommand } from '../../commands/interface-m import { findPresentationType, parameters } from '../../commands/interface-manager/ParameterParsing'; import { AppserviceBaseExecutor } from './AppserviceCommandHandler'; import { tickCrossRenderer } from '../../commands/interface-manager/MatrixHelpRenderer'; -import { JSXFactory } from '../../commands/interface-manager/JSXFactory'; +import { DeadDocumentJSX } from '../../commands/interface-manager/JSXFactory'; import { renderMatrixAndSend } from '../../commands/interface-manager/DeadDocumentMatrix'; import { ActionError, ActionResult, isError, Ok, UserID } from 'matrix-protection-suite'; import { MatrixSendClient } from 'matrix-protection-suite-for-matrix-bot-sdk'; diff --git a/src/capabilities/CommonRenderers.tsx b/src/capabilities/CommonRenderers.tsx index c6d98767..107d6cb9 100644 --- a/src/capabilities/CommonRenderers.tsx +++ b/src/capabilities/CommonRenderers.tsx @@ -10,7 +10,7 @@ import { ActionError, ActionException, ActionResult, DescriptionMeta, MatrixRoomReference, ResultForUsersInRoom, RoomSetResult, StringRoomID, StringUserID, isOk } from "matrix-protection-suite"; import { DocumentNode } from "../commands/interface-manager/DeadDocument"; -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; import { renderMentionPill, renderRoomPill } from "../commands/interface-manager/MatrixHelpRenderer"; export function renderElaborationTrail(error: ActionError): DocumentNode { diff --git a/src/capabilities/DraupnirRendererMessageCollector.tsx b/src/capabilities/DraupnirRendererMessageCollector.tsx index 30c4d8c6..79b42bdd 100644 --- a/src/capabilities/DraupnirRendererMessageCollector.tsx +++ b/src/capabilities/DraupnirRendererMessageCollector.tsx @@ -7,7 +7,7 @@ import { RendererMessage, RendererMessageCollector } from "./RendererMessageColl import { DescriptionMeta, StringRoomID, Task } from "matrix-protection-suite"; import { DocumentNode } from "../commands/interface-manager/DeadDocument"; import { renderMatrixAndSend } from "../commands/interface-manager/DeadDocumentMatrix"; -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; export class DraupnirRendererMessageCollector implements RendererMessageCollector { constructor( diff --git a/src/capabilities/ServerACLConsequencesRenderer.tsx b/src/capabilities/ServerACLConsequencesRenderer.tsx index 7a2ff2d0..f0965495 100644 --- a/src/capabilities/ServerACLConsequencesRenderer.tsx +++ b/src/capabilities/ServerACLConsequencesRenderer.tsx @@ -11,7 +11,7 @@ import { ActionResult, Capability, DescriptionMeta, Ok, Permalinks, PolicyListRevision, RoomSetResult, ServerACLConsequencesContext, ServerConsequences, StringRoomID, describeCapabilityContextGlue, describeCapabilityRenderer, isError } from "matrix-protection-suite"; import { RendererMessageCollector } from "./RendererMessageCollector"; import { renderFailedSingularConsequence, renderRoomSetResult } from "./CommonRenderers"; -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; import { Draupnir } from "../Draupnir"; class StandardServerConsequencesRenderer implements ServerConsequences { diff --git a/src/capabilities/StandardEventConsequencesRenderer.tsx b/src/capabilities/StandardEventConsequencesRenderer.tsx index f305c855..a9aaf10c 100644 --- a/src/capabilities/StandardEventConsequencesRenderer.tsx +++ b/src/capabilities/StandardEventConsequencesRenderer.tsx @@ -11,7 +11,7 @@ import { ActionResult, Capability, DescriptionMeta, EventConsequences, Permalinks, RoomEventRedacter, StringEventID, StringRoomID, describeCapabilityContextGlue, describeCapabilityRenderer, isError } from "matrix-protection-suite"; import { RendererMessageCollector } from "./RendererMessageCollector"; import { renderFailedSingularConsequence } from "./CommonRenderers"; -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; import { Draupnir } from "../Draupnir"; class StandardEventConsequencesRenderer implements EventConsequences { diff --git a/src/capabilities/StandardUserConsequencesRenderer.tsx b/src/capabilities/StandardUserConsequencesRenderer.tsx index c65faf6d..38267256 100644 --- a/src/capabilities/StandardUserConsequencesRenderer.tsx +++ b/src/capabilities/StandardUserConsequencesRenderer.tsx @@ -8,7 +8,7 @@ // https://github.com/matrix-org/mjolnir // -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; import { ActionResult, Capability, DescriptionMeta, MatrixRoomReference, Ok, Permalinks, PolicyListRevision, ResultForUsersInRoom, ResultForUsersInSet, RoomSetResult, StandardUserConsequencesContext, StringRoomID, StringUserID, UserConsequences, describeCapabilityContextGlue, describeCapabilityRenderer, isError } from "matrix-protection-suite"; import { RendererMessageCollector } from "./RendererMessageCollector"; import { renderFailedSingularConsequence, renderOutcome, renderResultForUsersInRoom, renderRoomSetResult } from "./CommonRenderers"; diff --git a/src/commands/Help.tsx b/src/commands/Help.tsx index d17a08ce..f266e7a6 100644 --- a/src/commands/Help.tsx +++ b/src/commands/Help.tsx @@ -28,7 +28,7 @@ limitations under the License. import { DocumentNode } from "./interface-manager/DeadDocument"; import { CommandTable, defineInterfaceCommand, findCommandTable, findTableCommand } from "./interface-manager/InterfaceCommand"; import { renderCommandSummary } from "./interface-manager/MatrixHelpRenderer"; -import { JSXFactory } from "./interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "./interface-manager/JSXFactory"; import { findPresentationType, parameters, RestDescription } from "./interface-manager/ParameterParsing"; import { defineMatrixInterfaceAdaptor } from "./interface-manager/MatrixInterfaceAdaptor"; import { renderMatrixAndSend } from "./interface-manager/DeadDocumentMatrix"; diff --git a/src/commands/KickCommand.tsx b/src/commands/KickCommand.tsx index da9c2a57..38472c7c 100644 --- a/src/commands/KickCommand.tsx +++ b/src/commands/KickCommand.tsx @@ -31,7 +31,7 @@ import { ActionError, ActionResult, MatrixRoomReference, Ok, StringRoomID, Strin import { KeywordsDescription, ParsedKeywords, findPresentationType, parameters } from "./interface-manager/ParameterParsing"; import { resolveRoomReferenceSafe } from "matrix-protection-suite-for-matrix-bot-sdk"; import { DocumentNode } from "./interface-manager/DeadDocument"; -import { JSXFactory } from "./interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "./interface-manager/JSXFactory"; import { defineInterfaceCommand, findTableCommand } from "./interface-manager/InterfaceCommand"; import { defineMatrixInterfaceAdaptor } from "./interface-manager/MatrixInterfaceAdaptor"; import { renderMatrixAndSend } from "./interface-manager/DeadDocumentMatrix"; diff --git a/src/commands/ProtectionsCommands.tsx b/src/commands/ProtectionsCommands.tsx index 494bcd4a..67d7fe9c 100644 --- a/src/commands/ProtectionsCommands.tsx +++ b/src/commands/ProtectionsCommands.tsx @@ -33,7 +33,7 @@ import { defineMatrixInterfaceAdaptor } from "./interface-manager/MatrixInterfac import { tickCrossRenderer } from "./interface-manager/MatrixHelpRenderer"; import { Draupnir } from "../Draupnir"; import { MatrixSendClient } from "matrix-protection-suite-for-matrix-bot-sdk"; -import { JSXFactory } from "./interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "./interface-manager/JSXFactory"; import { DocumentNode } from "./interface-manager/DeadDocument"; import { renderMatrixAndSend } from "./interface-manager/DeadDocumentMatrix"; diff --git a/src/commands/ResolveAlias.tsx b/src/commands/ResolveAlias.tsx index d7189fbc..0a680c76 100644 --- a/src/commands/ResolveAlias.tsx +++ b/src/commands/ResolveAlias.tsx @@ -33,7 +33,7 @@ import { ParsedKeywords, findPresentationType, parameters } from "./interface-ma import { defineMatrixInterfaceAdaptor } from "./interface-manager/MatrixInterfaceAdaptor"; import { renderRoomPill, tickCrossRenderer } from "./interface-manager/MatrixHelpRenderer"; import { renderMatrixAndSend } from "./interface-manager/DeadDocumentMatrix"; -import { JSXFactory } from "./interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "./interface-manager/JSXFactory"; async function resolveAliasCommand( this: DraupnirContext, diff --git a/src/commands/Rooms.tsx b/src/commands/Rooms.tsx index ca032ab9..3ce89d4d 100644 --- a/src/commands/Rooms.tsx +++ b/src/commands/Rooms.tsx @@ -31,7 +31,7 @@ import { DraupnirContext } from "./CommandHandler"; import { defineMatrixInterfaceAdaptor } from "./interface-manager/MatrixInterfaceAdaptor"; import { tickCrossRenderer } from "./interface-manager/MatrixHelpRenderer"; import { DocumentNode } from "./interface-manager/DeadDocument"; -import { JSXFactory } from "./interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "./interface-manager/JSXFactory"; import { renderMatrixAndSend } from "./interface-manager/DeadDocumentMatrix"; import { ActionException, ActionExceptionKind, ActionResult, MatrixRoomID, MatrixRoomReference, Ok, isError } from "matrix-protection-suite"; import { resolveRoomReferenceSafe } from "matrix-protection-suite-for-matrix-bot-sdk"; diff --git a/src/commands/Rules.tsx b/src/commands/Rules.tsx index 154948df..f5c99632 100644 --- a/src/commands/Rules.tsx +++ b/src/commands/Rules.tsx @@ -29,7 +29,7 @@ import { MatrixSendClient } from "matrix-protection-suite-for-matrix-bot-sdk"; import { DraupnirContext } from "./CommandHandler"; import { renderMatrixAndSend } from "./interface-manager/DeadDocumentMatrix"; import { defineInterfaceCommand, findTableCommand } from "./interface-manager/InterfaceCommand"; -import { JSXFactory } from "./interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "./interface-manager/JSXFactory"; import { tickCrossRenderer } from "./interface-manager/MatrixHelpRenderer"; import { defineMatrixInterfaceAdaptor, MatrixContext, MatrixInterfaceAdaptor } from "./interface-manager/MatrixInterfaceAdaptor"; import { findPresentationType, parameters, union } from "./interface-manager/ParameterParsing"; diff --git a/src/commands/StatusCommand.tsx b/src/commands/StatusCommand.tsx index 14fdc9c5..172171dc 100644 --- a/src/commands/StatusCommand.tsx +++ b/src/commands/StatusCommand.tsx @@ -30,7 +30,7 @@ import { defineInterfaceCommand, findTableCommand } from "./interface-manager/In import { parameters } from "./interface-manager/ParameterParsing"; import { DraupnirContext } from "./CommandHandler"; import { defineMatrixInterfaceAdaptor } from "./interface-manager/MatrixInterfaceAdaptor"; -import { JSXFactory } from "./interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "./interface-manager/JSXFactory"; import { tickCrossRenderer } from "./interface-manager/MatrixHelpRenderer"; import { renderMatrixAndSend } from "./interface-manager/DeadDocumentMatrix"; import { ActionResult, Ok, PolicyRoomRevision, PolicyRoomWatchProfile, PolicyRuleType, isError } from "matrix-protection-suite"; diff --git a/src/commands/interface-manager/JSXFactory.ts b/src/commands/interface-manager/JSXFactory.ts index f78da173..1647aa79 100644 --- a/src/commands/interface-manager/JSXFactory.ts +++ b/src/commands/interface-manager/JSXFactory.ts @@ -7,36 +7,6 @@ import { DocumentNode, LeafNode, makeDocumentNode, makeLeafNode, NodeTag, TextNo import { DeadDocumentPresentationMirror } from "./DeadDocumentPresentation"; type JSXChild = DocumentNode|LeafNode|string|number|JSXChild[]; - -export function JSXFactory(tag: NodeTag, properties: unknown, ...rawChildren: (DocumentNode|LeafNode|string)[]) { - const node = makeDocumentNode(tag); - if (properties) { - for (const [key, value] of Object.entries(properties)) { - node.attributeMap.set(key, value); - } - } - const ensureChild = (rawChild: JSXChild) => { - if (typeof rawChild === 'string') { - makeLeafNode(NodeTag.TextNode, node, rawChild); - } else if (typeof rawChild === 'number') { - makeLeafNode(NodeTag.TextNode, node, (rawChild as number).toString()); - } else if (Array.isArray(rawChild)) { - rawChild.forEach(ensureChild); - // Then it's a DocumentNode|LeafNode - } else if (typeof rawChild.leafNode === 'boolean') { - if (rawChild.tag === NodeTag.Fragment) { - (rawChild as DocumentNode).getChildren().forEach(node.addChild, node); - } else { - node.addChild(rawChild); - } - } else { - node.addChild(DeadDocumentPresentationMirror.present(rawChild)); - } - } - rawChildren.forEach(ensureChild); - return node; -} - // TODO: For `children?` to work without allowing people to accidentally use // `{undefined}` then we need to enable: // https://www.typescriptlang.org/tsconfig/#exactOptionalPropertyTypes @@ -47,12 +17,35 @@ export function JSXFactory(tag: NodeTag, properties: unknown, ...rawChildren: (D type NodeProperties = { children?: JSXChild[]|JSXChild }; type LeafNodeProperties = { children?: never[] }; -/** - * Has to be global for some reason or VSCodium explodes. - * https://www.typescriptlang.org/docs/handbook/declaration-merging.html - * https://www.typescriptlang.org/tsconfig#jsxFactory - */ -declare global { +export namespace DeadDocumentJSX { + export function JSXFactory(tag: NodeTag, properties: unknown, ...rawChildren: (DocumentNode|LeafNode|string)[]) { + const node = makeDocumentNode(tag); + if (properties) { + for (const [key, value] of Object.entries(properties)) { + node.attributeMap.set(key, value); + } + } + const ensureChild = (rawChild: JSXChild) => { + if (typeof rawChild === 'string') { + makeLeafNode(NodeTag.TextNode, node, rawChild); + } else if (typeof rawChild === 'number') { + makeLeafNode(NodeTag.TextNode, node, (rawChild as number).toString()); + } else if (Array.isArray(rawChild)) { + rawChild.forEach(ensureChild); + // Then it's a DocumentNode|LeafNode + } else if (typeof rawChild.leafNode === 'boolean') { + if (rawChild.tag === NodeTag.Fragment) { + (rawChild as DocumentNode).getChildren().forEach(node.addChild, node); + } else { + node.addChild(rawChild); + } + } else { + node.addChild(DeadDocumentPresentationMirror.present(rawChild)); + } + } + rawChildren.forEach(ensureChild); + return node; + } export namespace JSX { export interface IntrinsicElements { a: NodeProperties & { href?: string, name?: string, target?: string }, diff --git a/src/commands/interface-manager/MatrixHelpRenderer.tsx b/src/commands/interface-manager/MatrixHelpRenderer.tsx index 05c0a91e..7364f4d7 100644 --- a/src/commands/interface-manager/MatrixHelpRenderer.tsx +++ b/src/commands/interface-manager/MatrixHelpRenderer.tsx @@ -5,7 +5,7 @@ import { BaseFunction, CommandTable, InterfaceCommand } from "./InterfaceCommand"; import { MatrixContext, MatrixInterfaceAdaptor, RendererSignature } from "./MatrixInterfaceAdaptor"; import { ArgumentParseError, ParameterDescription, RestDescription } from "./ParameterParsing"; -import { JSXFactory } from "./JSXFactory"; +import { DeadDocumentJSX } from "./JSXFactory"; import { DocumentNode } from "./DeadDocument"; import { renderMatrixAndSend } from "./DeadDocumentMatrix"; import { LogService } from "matrix-bot-sdk"; diff --git a/src/commands/interface-manager/MatrixPresentations.tsx b/src/commands/interface-manager/MatrixPresentations.tsx index 59b500d3..44eb667d 100644 --- a/src/commands/interface-manager/MatrixPresentations.tsx +++ b/src/commands/interface-manager/MatrixPresentations.tsx @@ -6,7 +6,7 @@ import { ReadItem } from "./CommandReader"; import { findPresentationType, makePresentationType, simpleTypeValidator } from "./ParameterParsing"; import { definePresentationRenderer } from "./DeadDocumentPresentation"; -import { JSXFactory } from "./JSXFactory"; +import { DeadDocumentJSX } from "./JSXFactory"; import { DocumentNode } from "./DeadDocument"; import { MatrixEventViaAlias, MatrixEventViaRoomID, MatrixRoomAlias, MatrixRoomID, MatrixRoomReference, UserID } from "matrix-protection-suite"; diff --git a/src/commands/interface-manager/MatrixPromptForAccept.tsx b/src/commands/interface-manager/MatrixPromptForAccept.tsx index bba7c8e0..c2b95741 100644 --- a/src/commands/interface-manager/MatrixPromptForAccept.tsx +++ b/src/commands/interface-manager/MatrixPromptForAccept.tsx @@ -6,7 +6,7 @@ import { ClientPlatform, Logger, RoomEvent, StringRoomID, Task, Value, isError } from "matrix-protection-suite"; import { renderMatrixAndSend } from "./DeadDocumentMatrix"; import { BaseFunction, CommandTable, InterfaceCommand } from "./InterfaceCommand"; -import { JSXFactory } from "./JSXFactory"; +import { DeadDocumentJSX } from "./JSXFactory"; import { MatrixContext, findMatrixInterfaceAdaptor } from "./MatrixInterfaceAdaptor"; import { ArgumentStream, ParameterDescription } from "./ParameterParsing"; import { MatrixSendClient } from "matrix-protection-suite-for-matrix-bot-sdk"; diff --git a/src/models/RoomUpdateError.tsx b/src/models/RoomUpdateError.tsx index e525ee85..6649e40f 100644 --- a/src/models/RoomUpdateError.tsx +++ b/src/models/RoomUpdateError.tsx @@ -27,7 +27,7 @@ limitations under the License. import { DocumentNode } from "../commands/interface-manager/DeadDocument"; import { renderMatrixAndSend } from "../commands/interface-manager/DeadDocumentMatrix"; -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; import { ActionException, ActionExceptionKind, ActionResult, Ok, RoomUpdateError, StringRoomID } from "matrix-protection-suite"; import { MatrixSendClient } from "matrix-protection-suite-for-matrix-bot-sdk"; diff --git a/src/protections/BanPropagation.tsx b/src/protections/BanPropagation.tsx index 2aca6ec3..83e09c2e 100644 --- a/src/protections/BanPropagation.tsx +++ b/src/protections/BanPropagation.tsx @@ -28,7 +28,7 @@ limitations under the License. * a Mjolnir PR that was originally created by Gergő Fándly https://github.com/matrix-org/mjolnir/pull/223 */ -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; import { renderMatrixAndSend } from "../commands/interface-manager/DeadDocumentMatrix"; import { renderMentionPill, renderRoomPill } from "../commands/interface-manager/MatrixHelpRenderer"; import { ListMatches, renderListRules } from "../commands/Rules"; diff --git a/src/protections/MissingProtectionPermissions.tsx b/src/protections/MissingProtectionPermissions.tsx index 6e26ecf4..34e3e619 100644 --- a/src/protections/MissingProtectionPermissions.tsx +++ b/src/protections/MissingProtectionPermissions.tsx @@ -5,7 +5,7 @@ import { HandleMissingProtectionPermissions, MatrixRoomReference, ProtectionPermissionsChange, StringRoomID, Task } from "matrix-protection-suite"; import { renderMatrixAndSend } from "../commands/interface-manager/DeadDocumentMatrix"; import { MatrixSendClient } from "matrix-protection-suite-for-matrix-bot-sdk"; -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; import { DocumentNode } from "../commands/interface-manager/DeadDocument"; import { renderRoomPill } from "../commands/interface-manager/MatrixHelpRenderer"; diff --git a/src/protections/PolicyChangeNotification.tsx b/src/protections/PolicyChangeNotification.tsx index 773e0d20..9821324d 100644 --- a/src/protections/PolicyChangeNotification.tsx +++ b/src/protections/PolicyChangeNotification.tsx @@ -12,7 +12,7 @@ import { AbstractProtection, ActionResult, Logger, MatrixRoomReference, Ok, Poli import { DraupnirProtection } from "./Protection"; import { Draupnir } from "../Draupnir"; import { DocumentNode } from "../commands/interface-manager/DeadDocument"; -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; import { renderMentionPill, renderRoomPill } from "../commands/interface-manager/MatrixHelpRenderer"; import { renderMatrixAndSend } from "../commands/interface-manager/DeadDocumentMatrix"; diff --git a/src/protections/ProtectedRoomsSetRenderers.tsx b/src/protections/ProtectedRoomsSetRenderers.tsx index bb6e78f2..752c0bae 100644 --- a/src/protections/ProtectedRoomsSetRenderers.tsx +++ b/src/protections/ProtectedRoomsSetRenderers.tsx @@ -11,7 +11,7 @@ import { ActionError, ProtectionDescription, StringRoomID } from "matrix-protection-suite"; import { MatrixSendClient } from "matrix-protection-suite-for-matrix-bot-sdk"; import { renderMatrixAndSend } from "../commands/interface-manager/DeadDocumentMatrix"; -import { JSXFactory } from "../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../commands/interface-manager/JSXFactory"; export async function renderProtectionFailedToStart( client: MatrixSendClient, diff --git a/src/protections/invitation/JoinRoomsOnInviteProtection.tsx b/src/protections/invitation/JoinRoomsOnInviteProtection.tsx index aede53bd..ff674ad1 100644 --- a/src/protections/invitation/JoinRoomsOnInviteProtection.tsx +++ b/src/protections/invitation/JoinRoomsOnInviteProtection.tsx @@ -14,7 +14,7 @@ import { DraupnirProtection } from "../Protection"; import { isInvitationForUser, isSenderJoinedInRevision } from "./inviteCore"; import { renderMatrixAndSend } from "../../commands/interface-manager/DeadDocumentMatrix"; import { DocumentNode } from "../../commands/interface-manager/DeadDocument"; -import { JSXFactory } from "../../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../../commands/interface-manager/JSXFactory"; import { renderMentionPill, renderRoomPill } from "../../commands/interface-manager/MatrixHelpRenderer"; import { renderFailedSingularConsequence } from "../../capabilities/CommonRenderers"; import { ProtectroomsOnInvite } from "./ProtectRoomsOnInvite"; diff --git a/src/protections/invitation/ProtectRoomsOnInvite.tsx b/src/protections/invitation/ProtectRoomsOnInvite.tsx index 1cd0c6bd..72f6186e 100644 --- a/src/protections/invitation/ProtectRoomsOnInvite.tsx +++ b/src/protections/invitation/ProtectRoomsOnInvite.tsx @@ -11,7 +11,7 @@ import { Logger, MatrixRoomID, MembershipEvent, Ok, Permalink, ProtectedRoomsSet, RoomEvent, Task, Value, isError } from "matrix-protection-suite"; import { DocumentNode } from "../../commands/interface-manager/DeadDocument"; import { renderActionResultToEvent, renderMentionPill, renderRoomPill } from "../../commands/interface-manager/MatrixHelpRenderer"; -import { JSXFactory } from "../../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../../commands/interface-manager/JSXFactory"; import { renderMatrixAndSend } from "../../commands/interface-manager/DeadDocumentMatrix"; import { StaticDecode, Type } from "@sinclair/typebox"; import { Draupnir } from "../../Draupnir"; diff --git a/src/protections/invitation/WatchRoomsOnInvite.tsx b/src/protections/invitation/WatchRoomsOnInvite.tsx index 2fbbd3c8..6736d23f 100644 --- a/src/protections/invitation/WatchRoomsOnInvite.tsx +++ b/src/protections/invitation/WatchRoomsOnInvite.tsx @@ -11,7 +11,7 @@ import { ALL_RULE_TYPES, Logger, MJOLNIR_SHORTCODE_EVENT_TYPE, MatrixRoomID, MembershipEvent, Ok, Permalink, ProtectedRoomsSet, RoomEvent, RoomStateRevision, Task, Value, isError } from "matrix-protection-suite"; import { Draupnir } from "../../Draupnir"; import { DocumentNode } from "../../commands/interface-manager/DeadDocument"; -import { JSXFactory } from "../../commands/interface-manager/JSXFactory"; +import { DeadDocumentJSX } from "../../commands/interface-manager/JSXFactory"; import { renderActionResultToEvent, renderMentionPill, renderRoomPill } from "../../commands/interface-manager/MatrixHelpRenderer"; import { renderMatrixAndSend } from "../../commands/interface-manager/DeadDocumentMatrix"; import { StaticDecode, Type } from "@sinclair/typebox"; diff --git a/tsconfig.json b/tsconfig.json index 5e425e6e..c95edf1a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,7 @@ "mocha" ], "jsx": "react", - "jsxFactory": "JSXFactory" + "jsxFactory": "DeadDocumentJSX.JSXFactory" }, "include": [ "./src/**/*"