Skip to content

Commit

Permalink
chore(lexical-playground): make directory clear (facebook#2674)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciNyan authored Jul 21, 2022
1 parent 0469c4f commit 740450c
Show file tree
Hide file tree
Showing 39 changed files with 63 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import {
import * as React from 'react';
import {useCallback, useEffect, useState} from 'react';

import useModal from '../hooks/useModal';
import Button from '../ui/Button';
import {PLAYGROUND_TRANSFORMERS} from './MarkdownTransformers';
import useModal from '../../hooks/useModal';
import Button from '../../ui/Button';
import {PLAYGROUND_TRANSFORMERS} from '../MarkdownTransformers';
import {
SPEECH_TO_TEXT_COMMAND,
SUPPORT_SPEECH_RECOGNITION,
} from './SpeechToTextPlugin';
} from '../SpeechToTextPlugin';

export default function ActionsPlugin({
isRichText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import {
} from 'lexical';
import {useCallback, useEffect} from 'react';

import {useSharedAutocompleteContext} from '../context/SharedAutocompleteContext';
import {useSharedAutocompleteContext} from '../../context/SharedAutocompleteContext';
import {
$createAutocompleteNode,
AutocompleteNode,
} from '../nodes/AutocompleteNode';
import {addSwipeRightListener} from '../utils/swipe';
} from '../../nodes/AutocompleteNode';
import {addSwipeRightListener} from '../../utils/swipe';

type SearchPromise = {
dismiss: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
*/

import './CodeActionMenuPlugin.css';
import './index.css';

import {$isCodeNode, CodeNode, getLanguageFriendlyName} from '@lexical/code';
import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
} from 'lexical';
import type {Doc} from 'yjs';

import './CommentPlugin.css';
import './index.css';

import {
$createMarkNode,
Expand Down Expand Up @@ -59,12 +59,12 @@ import {
createThread,
Thread,
useCommentStore,
} from '../commenting';
import useModal from '../hooks/useModal';
import CommentEditorTheme from '../themes/CommentEditorTheme';
import Button from '../ui/Button';
import ContentEditable from '../ui/ContentEditable.jsx';
import Placeholder from '../ui/Placeholder.jsx';
} from '../../commenting';
import useModal from '../../hooks/useModal';
import CommentEditorTheme from '../../themes/CommentEditorTheme';
import Button from '../../ui/Button';
import ContentEditable from '../../ui/ContentEditable.jsx';
import Placeholder from '../../ui/Placeholder.jsx';

export const INSERT_INLINE_COMMAND: LexicalCommand<void> = createCommand();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ import {useCallback, useMemo, useState} from 'react';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

import useModal from '../hooks/useModal';
import catTypingGif from '../images/cat-typing.gif';
import {INSERT_EXCALIDRAW_COMMAND} from './ExcalidrawPlugin';
import {INSERT_IMAGE_COMMAND} from './ImagesPlugin';
import useModal from '../../hooks/useModal';
import catTypingGif from '../../images/cat-typing.gif';
import {INSERT_EXCALIDRAW_COMMAND} from '../ExcalidrawPlugin';
import {INSERT_IMAGE_COMMAND} from '../ImagesPlugin';
import {
InsertEquationDialog,
InsertImageDialog,
InsertPollDialog,
InsertTableDialog,
InsertTweetDialog,
} from './ToolbarPlugin';
} from '../ToolbarPlugin';

class ComponentPickerOption extends TypeaheadOption {
// What shows up in the editor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
import {TextNode} from 'lexical';
import {useEffect} from 'react';

import {$createEmojiNode, EmojiNode} from '../nodes/EmojiNode';
import {$createEmojiNode, EmojiNode} from '../../nodes/EmojiNode';

const emojis: Map<string, [string, string]> = new Map([
[':)', ['emoji happysmile', '🙂']],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from 'lexical';
import {useEffect} from 'react';

import {$createEquationNode, EquationNode} from '../nodes/EquationNode';
import {$createEquationNode, EquationNode} from '../../nodes/EquationNode';

type CommandPayload = {
equation: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import {
} from 'lexical';
import {useEffect} from 'react';

import {$createExcalidrawNode, ExcalidrawNode} from '../nodes/ExcalidrawNode';
import {
$createExcalidrawNode,
ExcalidrawNode,
} from '../../nodes/ExcalidrawNode';

export const INSERT_EXCALIDRAW_COMMAND: LexicalCommand<void> = createCommand();
export default function ExcalidrawPlugin(): JSX.Element | null {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
$isImageNode,
ImageNode,
ImagePayload,
} from '../nodes/ImageNode';
} from '../../nodes/ImageNode';

export type InsertImagePayload = Readonly<ImagePayload>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
import {useLexicalTextEntity} from '@lexical/react/useLexicalTextEntity';
import {useCallback, useEffect} from 'react';

import {$createKeywordNode, KeywordNode} from '../nodes/KeywordNode';
import {$createKeywordNode, KeywordNode} from '../../nodes/KeywordNode';

const KEYWORDS_REGEX =
/(^|$|[^A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺ-------ॿ---------------------------------------ൿ---------------က------------------------------------------------------ᶿ------------------------------------------------ꀀ--------------------------------------------------------------])(congrats|congratulations|gratuluju|gratuluji|gratulujeme|blahopřeju|blahopřeji|blahopřejeme|Til lykke|Tillykke|Glückwunsch|Gratuliere|felicitaciones|enhorabuena|paljon onnea|onnittelut|Félicitations|gratula|gratulálok|gratulálunk|congratulazioni|complimenti|||||gratulerer|Gefeliciteerd|gratulacje|Parabéns|parabéns|felicitações|felicitări|мои поздравления|поздравляем|поздравляю|gratulujem|blahoželám|||tebrikler|tebrik ederim||||||baie geluk|veels geluk|ি|Čestitam|Čestitke|Čestitamo|Συγχαρητήρια|Μπράβο|િ|badhai||ि|Честитам|Свака част|hongera|||ి|ി|Chúc mng|מזל טוב|mazel tov|mazal tov)(^|$|[^A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺ-------ॿ---------------------------------------ൿ---------------က------------------------------------------------------ᶿ------------------------------------------------ꀀ--------------------------------------------------------------])/i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import {MarkdownShortcutPlugin} from '@lexical/react/LexicalMarkdownShortcutPlugin';
import * as React from 'react';

import {PLAYGROUND_TRANSFORMERS} from './MarkdownTransformers';
import {PLAYGROUND_TRANSFORMERS} from '../MarkdownTransformers';

export default function MarkdownPlugin(): JSX.Element {
return <MarkdownShortcutPlugin transformers={PLAYGROUND_TRANSFORMERS} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ import {
$isTextNode,
} from 'lexical';

import {$createEquationNode, $isEquationNode} from '../nodes/EquationNode';
import {$createImageNode, $isImageNode} from '../nodes/ImageNode';
import {$createTweetNode, $isTweetNode} from '../nodes/TweetNode';
import {$createEquationNode, $isEquationNode} from '../../nodes/EquationNode';
import {$createImageNode, $isImageNode} from '../../nodes/ImageNode';
import {$createTweetNode, $isTweetNode} from '../../nodes/TweetNode';

export const HR: ElementTransformer = {
export: (node: LexicalNode) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {useCallback, useEffect, useMemo, useState} from 'react';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

import {$createMentionNode} from '../nodes/MentionNode';
import {$createMentionNode} from '../../nodes/MentionNode';

const PUNCTUATION =
'\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from 'lexical';
import {useEffect} from 'react';

import {$createPollNode, PollNode} from '../nodes/PollNode';
import {$createPollNode, PollNode} from '../../nodes/PollNode';

export const INSERT_POLL_COMMAND: LexicalCommand<string> = createCommand();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from 'lexical';
import {useEffect, useRef, useState} from 'react';

import useReport from '../hooks/useReport';
import useReport from '../../hooks/useReport';

export const SPEECH_TO_TEXT_COMMAND: LexicalCommand<boolean> = createCommand();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
import {useEffect} from 'react';

import {StickyNode} from '../nodes/StickyNode';
import {StickyNode} from '../../nodes/StickyNode';

export default function StickyPlugin(): JSX.Element | null {
const [editor] = useLexicalComposerContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import type {Cell} from '@lexical/table';
import type {LexicalEditor} from 'lexical';

import './TableCellResizer.css';
import './index.css';

import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import type {HeadingTagType} from '@lexical/rich-text';
import type {NodeKey} from 'lexical';

import '../ui/TableOfContentsStyle.css';
import './index.css';

import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
import LexicalTableOfContents__EXPERIMENTAL from '@lexical/react/LexicalTableOfContents__EXPERIMENTAL';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {useCallback, useEffect, useRef, useState} from 'react';
import * as React from 'react';
import {createPortal} from 'react-dom';

import {INSERT_INLINE_COMMAND} from './CommentPlugin';
import {INSERT_INLINE_COMMAND} from '../CommentPlugin';

function setPopupPosition(
editor: HTMLElement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
*
*/

import type {InsertImagePayload} from './ImagesPlugin';
import type {InsertImagePayload} from '../ImagesPlugin';
import type {
GridSelection,
LexicalEditor,
NodeSelection,
RangeSelection,
} from 'lexical';

import './ToolbarPlugin.css';
import './index.css';

import {
$createCodeNode,
Expand Down Expand Up @@ -82,25 +82,25 @@ import {ChangeEvent, useCallback, useEffect, useRef, useState} from 'react';
import {createPortal} from 'react-dom';
import {IS_APPLE} from 'shared/environment';

import useModal from '../hooks/useModal';
import catTypingGif from '../images/cat-typing.gif';
import yellowFlowerImage from '../images/yellow-flower.jpg';
import {$createStickyNode} from '../nodes/StickyNode';
import {$isTweetNode} from '../nodes/TweetNode';
import {$isYouTubeNode} from '../nodes/YouTubeNode';
import Button from '../ui/Button';
import ColorPicker from '../ui/ColorPicker';
import DropDown, {DropDownItem} from '../ui/DropDown';
import FileInput from '../ui/FileInput.jsx';
import KatexEquationAlterer from '../ui/KatexEquationAlterer';
import LinkPreview from '../ui/LinkPreview';
import TextInput from '../ui/TextInput';
import {INSERT_EQUATION_COMMAND} from './EquationsPlugin';
import {INSERT_EXCALIDRAW_COMMAND} from './ExcalidrawPlugin';
import {INSERT_IMAGE_COMMAND} from './ImagesPlugin';
import {INSERT_POLL_COMMAND} from './PollPlugin';
import {INSERT_TWEET_COMMAND} from './TwitterPlugin';
import {INSERT_YOUTUBE_COMMAND} from './YouTubePlugin';
import useModal from '../../hooks/useModal';
import catTypingGif from '../../images/cat-typing.gif';
import yellowFlowerImage from '../../images/yellow-flower.jpg';
import {$createStickyNode} from '../../nodes/StickyNode';
import {$isTweetNode} from '../../nodes/TweetNode';
import {$isYouTubeNode} from '../../nodes/YouTubeNode';
import Button from '../../ui/Button';
import ColorPicker from '../../ui/ColorPicker';
import DropDown, {DropDownItem} from '../../ui/DropDown';
import FileInput from '../../ui/FileInput.jsx';
import KatexEquationAlterer from '../../ui/KatexEquationAlterer';
import LinkPreview from '../../ui/LinkPreview';
import TextInput from '../../ui/TextInput';
import {INSERT_EQUATION_COMMAND} from '../EquationsPlugin';
import {INSERT_EXCALIDRAW_COMMAND} from '../ExcalidrawPlugin';
import {INSERT_IMAGE_COMMAND} from '../ImagesPlugin';
import {INSERT_POLL_COMMAND} from '../PollPlugin';
import {INSERT_TWEET_COMMAND} from '../TwitterPlugin';
import {INSERT_YOUTUBE_COMMAND} from '../YouTubePlugin';

const blockTypeToBlockName = {
bullet: 'Bulleted List',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {$insertBlockNode} from '@lexical/utils';
import {COMMAND_PRIORITY_EDITOR, createCommand, LexicalCommand} from 'lexical';
import {useEffect} from 'react';

import {$createTweetNode, TweetNode} from '../nodes/TweetNode';
import {$createTweetNode, TweetNode} from '../../nodes/TweetNode';

export const INSERT_TWEET_COMMAND: LexicalCommand<string> = createCommand();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import {useEffect} from 'react';

import useReport from '../hooks/useReport';
import useReport from '../../hooks/useReport';

const validInputTypes = new Set([
'insertText',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {$insertBlockNode} from '@lexical/utils';
import {COMMAND_PRIORITY_EDITOR, createCommand, LexicalCommand} from 'lexical';
import {useEffect} from 'react';

import {$createYouTubeNode, YouTubeNode} from '../nodes/YouTubeNode';
import {$createYouTubeNode, YouTubeNode} from '../../nodes/YouTubeNode';

export const INSERT_YOUTUBE_COMMAND: LexicalCommand<string> = createCommand();

Expand Down

0 comments on commit 740450c

Please sign in to comment.