Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions packages/gazzodown/.babelrc.json

This file was deleted.

82 changes: 2 additions & 80 deletions packages/gazzodown/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,82 +1,4 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"@rocket.chat/eslint-config/original",
"@rocket.chat/eslint-config/react",
"prettier",
"plugin:anti-trojan-source/recommended",
"plugin:react/jsx-runtime",
"plugin:storybook/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react", "react-hooks", "prettier"],
"rules": {
"import/named": "error",
"import/order": [
"error",
{
"newlines-between": "always",
"groups": ["builtin", "external", "internal", ["parent", "sibling", "index"]],
"alphabetize": {
"order": "asc"
}
}
],
"jsx-quotes": ["error", "prefer-single"],
"new-cap": ["error"],
"prefer-arrow-callback": ["error", { "allowNamedFunctions": true }],
"prettier/prettier": 2,
"react/display-name": "error",
"react/jsx-uses-vars": "error",
"react/jsx-no-undef": "error",
"react/jsx-fragments": ["error", "syntax"],
"react/no-multi-comp": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".ts", ".tsx"]
}
},
"react": {
"version": "detect"
}
},
"ignorePatterns": ["dist", "!.storybook"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/no-extra-parens": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/prefer-optional-chain": "warn",
"func-call-spacing": "off",
"indent": "off",
"no-extra-parens": "off",
"no-spaced-func": "off",
"no-undef": "off",
"no-unused-vars": "off",
"no-useless-constructor": "off",
"no-use-before-define": "off"
}
},
{
"files": ["*.stories.tsx"],
"rules": {
"react/no-multi-comp": "off"
}
}
]
"extends": ["@rocket.chat/eslint-config", "@rocket.chat/eslint-config/react", "plugin:storybook/recommended"],
"ignorePatterns": ["dist", "storybook-static", "!.storybook"]
}
2 changes: 0 additions & 2 deletions packages/gazzodown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"react-stately": "~3.17.0"
},
"devDependencies": {
"@babel/core": "~7.28.5",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/emitter": "~0.31.25",
Expand Down Expand Up @@ -60,7 +59,6 @@
"@types/react-dom": "~18.3.7",
"@typescript-eslint/eslint-plugin": "~5.60.1",
"@typescript-eslint/parser": "~5.60.1",
"babel-loader": "~10.0.0",
"eslint": "~8.45.0",
"eslint-plugin-anti-trojan-source": "~1.1.2",
"eslint-plugin-react": "~7.37.5",
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/Markup.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { css } from '@rocket.chat/css-in-js';
import { Box, MessageBody, MessageContainer } from '@rocket.chat/fuselage';
import colors from '@rocket.chat/fuselage-tokens/colors.json';
import { Options, parse } from '@rocket.chat/message-parser';
import type { Options } from '@rocket.chat/message-parser';
import { parse } from '@rocket.chat/message-parser';
import type { Meta, StoryFn } from '@storybook/react';
import outdent from 'outdent';
import { Suspense } from 'react';
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/Markup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import { lazy, memo, ReactElement } from 'react';
import type { ReactElement } from 'react';
import { lazy, memo } from 'react';

import HeadingBlock from './blocks/HeadingBlock';
import OrderedListBlock from './blocks/OrderedListBlock';
Expand Down
5 changes: 3 additions & 2 deletions packages/gazzodown/src/MarkupInteractionContext.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { MessageMention } from '@rocket.chat/core-typings';
import type * as MessageParser from '@rocket.chat/message-parser';
import { createContext, FormEvent, UIEvent } from 'react';
import { AriaButtonProps } from 'react-aria';
import type { FormEvent, UIEvent } from 'react';
import { createContext } from 'react';
import type { AriaButtonProps } from 'react-aria';

export type UserMention = MessageMention;
export type ChannelMention = MessageMention;
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/PreviewMarkup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import { memo, ReactElement } from 'react';
import type { ReactElement } from 'react';
import { memo } from 'react';

import PreviewCodeBlock from './code/PreviewCodeBlock';
import PreviewInlineElements from './elements/PreviewInlineElements';
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/blocks/TaskListBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CheckBox } from '@rocket.chat/fuselage';
import type * as MessageParser from '@rocket.chat/message-parser';
import { ReactElement, useContext } from 'react';
import type { ReactElement } from 'react';
import { useContext } from 'react';

import { MarkupInteractionContext } from '../MarkupInteractionContext';
import InlineElements from '../elements/InlineElements';
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/code/CodeBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import hljs from 'highlight.js';
import { Fragment, ReactElement, useContext, useLayoutEffect, useMemo, useRef } from 'react';
import type { ReactElement } from 'react';
import { Fragment, useContext, useLayoutEffect, useMemo, useRef } from 'react';

import { MarkupInteractionContext } from '../MarkupInteractionContext';

Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/code/PreviewCodeBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import { ReactElement, useMemo } from 'react';
import type { ReactElement } from 'react';
import { useMemo } from 'react';

type PreviewCodeBlockProps = {
language?: string;
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/colors/ColorElement.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { memo, ReactElement } from 'react';
import type { ReactElement } from 'react';
import { memo } from 'react';

type ColorElementProps = {
r: number;
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/colors/PreviewColorElement.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { memo, ReactElement } from 'react';
import type { ReactElement } from 'react';
import { memo } from 'react';

const toHexByte = (value: number): string => value.toString(16).padStart(2, '0');

Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/elements/ImageElement.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import { ReactElement, useMemo } from 'react';
import type { ReactElement } from 'react';
import { useMemo } from 'react';

const flattenMarkup = (
markup:
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/elements/InlineElements.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import { lazy, ReactElement } from 'react';
import type { ReactElement } from 'react';
import { lazy } from 'react';

import BoldSpan from './BoldSpan';
import ImageElement from './ImageElement';
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/elements/LinkSpan.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import { getBaseURI, isExternal } from '@rocket.chat/ui-client';
import { ReactElement, useMemo } from 'react';
import type { ReactElement } from 'react';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';

import BoldSpan from './BoldSpan';
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/elements/PlainSpan.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Fragment, memo, ReactElement, useContext, useMemo } from 'react';
import type { ReactElement } from 'react';
import { Fragment, memo, useContext, useMemo } from 'react';
import { useTranslation } from 'react-i18next';

import { MarkupInteractionContext } from '../MarkupInteractionContext';
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/elements/PreviewInlineElements.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import { Fragment, ReactElement } from 'react';
import type { ReactElement } from 'react';
import { Fragment } from 'react';

import BoldSpan from './BoldSpan';
import ItalicSpan from './ItalicSpan';
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/emoji/Emoji.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import { ReactElement, useMemo, useContext, memo } from 'react';
import type { ReactElement } from 'react';
import { useMemo, useContext, memo } from 'react';

import { MarkupInteractionContext } from '../MarkupInteractionContext';
import EmojiRenderer from './EmojiRenderer';
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/emoji/EmojiElement.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as MessageParser from '@rocket.chat/message-parser';
import { ReactElement, memo } from 'react';
import type { ReactElement } from 'react';
import { memo } from 'react';

import Emoji from './Emoji';

Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/emoji/EmojiRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MessageEmoji, ThreadMessageEmoji } from '@rocket.chat/fuselage';
import type * as MessageParser from '@rocket.chat/message-parser';
import DOMPurify from 'dompurify';
import { ReactElement, useMemo, useContext, memo } from 'react';
import type { ReactElement } from 'react';
import { useMemo, useContext, memo } from 'react';

import { MarkupInteractionContext } from '../MarkupInteractionContext';

Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/katex/KatexBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import katex from 'katex';
import { ReactElement, useMemo } from 'react';
import type { ReactElement } from 'react';
import { useMemo } from 'react';

import 'katex/dist/katex.css';

Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/katex/KatexElement.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import katex from 'katex';
import { ReactElement, useMemo } from 'react';
import type { ReactElement } from 'react';
import { useMemo } from 'react';

import 'katex/dist/katex.css';

Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/katex/KatexErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import colors from '@rocket.chat/fuselage-tokens/colors.json';
import styled from '@rocket.chat/styled';
import { PropsWithChildren, ReactElement, useState } from 'react';
import type { PropsWithChildren, ReactElement } from 'react';
import { useState } from 'react';
import { ErrorBoundary } from 'react-error-boundary';

type KatexErrorBoundaryProps = PropsWithChildren<{ code: string }>;
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/mentions/ChannelMentionElement.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Message } from '@rocket.chat/fuselage';
import { useButtonPattern } from '@rocket.chat/fuselage-hooks';
import { memo, ReactElement, useContext, useMemo } from 'react';
import type { ReactElement } from 'react';
import { memo, useContext, useMemo } from 'react';
import { useTranslation } from 'react-i18next';

import { MarkupInteractionContext } from '../MarkupInteractionContext';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { memo, ReactElement } from 'react';
import type { ReactElement } from 'react';
import { memo } from 'react';

type PreviewChannelMentionElementProps = {
mention: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { memo, ReactElement } from 'react';
import type { ReactElement } from 'react';
import { memo } from 'react';

type PreviewUserMentionElementProps = {
mention: string;
Expand Down
3 changes: 2 additions & 1 deletion packages/gazzodown/src/mentions/UserMentionElement.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Message } from '@rocket.chat/fuselage';
import { useButtonPattern } from '@rocket.chat/fuselage-hooks';
import { memo, ReactElement, useContext, useMemo } from 'react';
import type { ReactElement } from 'react';
import { memo, useContext, useMemo } from 'react';
import { useTranslation } from 'react-i18next';

import { MarkupInteractionContext } from '../MarkupInteractionContext';
Expand Down
3 changes: 1 addition & 2 deletions packages/gazzodown/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "@rocket.chat/tsconfig/client.json",
"compilerOptions": {
"rootDirs": ["./src", "./"],
"outDir": "./dist"
"rootDirs": ["./src", "./"]
},
"include": ["./src/**/*", "./jest.config.ts", "./.storybook/**/*"]
}
4 changes: 1 addition & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8713,7 +8713,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@rocket.chat/gazzodown@workspace:packages/gazzodown"
dependencies:
"@babel/core": "npm:~7.28.5"
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/css-in-js": "npm:~0.31.25"
"@rocket.chat/emitter": "npm:~0.31.25"
Expand Down Expand Up @@ -8745,7 +8744,6 @@ __metadata:
"@types/react-dom": "npm:~18.3.7"
"@typescript-eslint/eslint-plugin": "npm:~5.60.1"
"@typescript-eslint/parser": "npm:~5.60.1"
babel-loader: "npm:~10.0.0"
date-fns: "npm:~4.1.0"
dompurify: "npm:~3.2.7"
eslint: "npm:~8.45.0"
Expand Down Expand Up @@ -10676,7 +10674,7 @@ __metadata:
peerDependencies:
"@rocket.chat/layout": "*"
"@rocket.chat/tools": 0.2.3
"@rocket.chat/ui-contexts": 25.0.0
"@rocket.chat/ui-contexts": 25.0.1
"@tanstack/react-query": "*"
react: "*"
react-hook-form: "*"
Expand Down
Loading