@scottjgilbert/lexical-blog-editor 0.1.4 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -67
- package/build/Editor.d.ts +8 -3
- package/build/Editor.d.ts.map +1 -1
- package/build/Editor.js +13 -8
- package/build/EditorExport.d.ts +4 -0
- package/build/EditorExport.d.ts.map +1 -0
- package/build/EditorExport.js +13 -0
- package/build/appSettings.d.ts +1 -1
- package/build/appSettings.js +1 -1
- package/build/buildHTMLConfig.d.ts +1 -1
- package/build/buildHTMLConfig.d.ts.map +1 -1
- package/build/buildHTMLConfig.js +35 -11
- package/build/context/FlashMessageContext.d.ts +2 -2
- package/build/context/FlashMessageContext.d.ts.map +1 -1
- package/build/context/FlashMessageContext.js +4 -3
- package/build/context/SharedHistoryContext.d.ts +3 -3
- package/build/context/SharedHistoryContext.d.ts.map +1 -1
- package/build/context/SharedHistoryContext.js +3 -2
- package/build/context/ToolbarContext.d.ts +1 -0
- package/build/context/ToolbarContext.d.ts.map +1 -1
- package/build/context/ToolbarContext.js +2 -0
- package/build/hooks/useModal.d.ts.map +1 -1
- package/build/hooks/useModal.js +1 -0
- package/build/hooks/useReport.d.ts +0 -7
- package/build/hooks/useReport.d.ts.map +1 -1
- package/build/hooks/useReport.js +1 -0
- package/build/index.css +283 -246
- package/build/index.d.ts +3 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/nodes/CodeNode/CodeHighlightNode.d.ts +35 -0
- package/build/nodes/CodeNode/CodeHighlightNode.d.ts.map +1 -0
- package/build/nodes/CodeNode/CodeHighlightNode.js +88 -0
- package/build/nodes/CodeNode/CodeHighlighterShiki.d.ts +22 -0
- package/build/nodes/CodeNode/CodeHighlighterShiki.d.ts.map +1 -0
- package/build/nodes/CodeNode/CodeHighlighterShiki.js +644 -0
- package/build/nodes/CodeNode/CodeNode.d.ts +48 -0
- package/build/nodes/CodeNode/CodeNode.d.ts.map +1 -0
- package/build/nodes/CodeNode/CodeNode.js +367 -0
- package/build/nodes/CodeNode/FacadeShiki.d.ts +18 -0
- package/build/nodes/CodeNode/FacadeShiki.d.ts.map +1 -0
- package/build/nodes/CodeNode/FacadeShiki.js +159 -0
- package/build/nodes/CodeNode/FlatStructureUtils.d.ts +21 -0
- package/build/nodes/CodeNode/FlatStructureUtils.d.ts.map +1 -0
- package/build/nodes/CodeNode/FlatStructureUtils.js +85 -0
- package/build/nodes/CodeNode/invariant.d.ts +2 -0
- package/build/nodes/CodeNode/invariant.d.ts.map +1 -0
- package/build/nodes/CodeNode/invariant.js +6 -0
- package/build/nodes/DateTimeNode/DateTimeComponent.d.ts.map +1 -1
- package/build/nodes/DateTimeNode/DateTimeComponent.js +1 -0
- package/build/nodes/DateTimeNode/DateTimeNode.css +21 -0
- package/build/nodes/FigmaNode/FigmaNode.d.ts.map +1 -0
- package/build/nodes/FigmaNode/ServerFigmaNode.d.ts +21 -0
- package/build/nodes/FigmaNode/ServerFigmaNode.d.ts.map +1 -0
- package/build/nodes/FigmaNode/ServerFigmaNode.js +48 -0
- package/build/nodes/ImageComponent.d.ts.map +1 -1
- package/build/nodes/ImageComponent.js +1 -2
- package/build/nodes/ImageNode.d.ts +7 -7
- package/build/nodes/ImageNode.d.ts.map +1 -1
- package/build/nodes/ImageNode.js +30 -30
- package/build/nodes/LayoutContainerNode.d.ts +2 -2
- package/build/nodes/LayoutContainerNode.d.ts.map +1 -1
- package/build/nodes/LayoutContainerNode.js +10 -10
- package/build/nodes/PlaygroundNodes/PlaygroundNodes.d.ts.map +1 -0
- package/build/nodes/{PlaygroundNodes.js → PlaygroundNodes/PlaygroundNodes.js} +19 -21
- package/build/nodes/PlaygroundNodes/ServerPlaygroundNodes.d.ts +11 -0
- package/build/nodes/PlaygroundNodes/ServerPlaygroundNodes.d.ts.map +1 -0
- package/build/nodes/PlaygroundNodes/ServerPlaygroundNodes.js +65 -0
- package/build/nodes/TweetNode/ServerTweetNode.d.ts +20 -0
- package/build/nodes/TweetNode/ServerTweetNode.d.ts.map +1 -0
- package/build/nodes/TweetNode/ServerTweetNode.js +59 -0
- package/build/nodes/TweetNode/TweetNode.d.ts.map +1 -0
- package/build/nodes/YouTubeNode/ServerYouTubeNode.d.ts +21 -0
- package/build/nodes/YouTubeNode/ServerYouTubeNode.d.ts.map +1 -0
- package/build/nodes/YouTubeNode/ServerYouTubeNode.js +67 -0
- package/build/nodes/YouTubeNode/YouTubeNode.d.ts.map +1 -0
- package/build/plugins/ActionsPlugin/index.d.ts +0 -7
- package/build/plugins/ActionsPlugin/index.d.ts.map +1 -1
- package/build/plugins/ActionsPlugin/index.js +2 -1
- package/build/plugins/AutoEmbedPlugin/index.d.ts +2 -9
- package/build/plugins/AutoEmbedPlugin/index.d.ts.map +1 -1
- package/build/plugins/AutoEmbedPlugin/index.js +30 -29
- package/build/plugins/AutoLinkPlugin/index.d.ts +1 -1
- package/build/plugins/AutoLinkPlugin/index.d.ts.map +1 -1
- package/build/plugins/AutoLinkPlugin/index.js +3 -2
- package/build/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +1 -1
- package/build/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts.map +1 -1
- package/build/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +7 -6
- package/build/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +2 -2
- package/build/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts.map +1 -1
- package/build/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +25 -24
- package/build/plugins/CodeActionMenuPlugin/index.d.ts +2 -9
- package/build/plugins/CodeActionMenuPlugin/index.d.ts.map +1 -1
- package/build/plugins/CodeActionMenuPlugin/index.js +22 -20
- package/build/plugins/CodeActionMenuPlugin/utils.d.ts.map +1 -1
- package/build/plugins/CodeActionMenuPlugin/utils.js +3 -2
- package/build/plugins/CodeHighlightPrismPlugin/index.d.ts +1 -1
- package/build/plugins/CodeHighlightPrismPlugin/index.d.ts.map +1 -1
- package/build/plugins/CodeHighlightPrismPlugin/index.js +4 -10
- package/build/plugins/CodeHighlightShikiPlugin/index.d.ts +1 -1
- package/build/plugins/CodeHighlightShikiPlugin/index.d.ts.map +1 -1
- package/build/plugins/CodeHighlightShikiPlugin/index.js +3 -3
- package/build/plugins/CollapsiblePlugin/Collapsible.css +17 -1
- package/build/plugins/CollapsiblePlugin/index.d.ts +1 -1
- package/build/plugins/CollapsiblePlugin/index.d.ts.map +1 -1
- package/build/plugins/CollapsiblePlugin/index.js +11 -10
- package/build/plugins/ComponentPickerPlugin/index.d.ts.map +1 -1
- package/build/plugins/ComponentPickerPlugin/index.js +3 -8
- package/build/plugins/ContextMenuPlugin/index.d.ts +1 -1
- package/build/plugins/ContextMenuPlugin/index.d.ts.map +1 -1
- package/build/plugins/ContextMenuPlugin/index.js +15 -14
- package/build/plugins/DateTimePlugin/index.d.ts +2 -2
- package/build/plugins/DateTimePlugin/index.d.ts.map +1 -1
- package/build/plugins/DateTimePlugin/index.js +8 -14
- package/build/plugins/DragDropPastePlugin/index.d.ts +0 -7
- package/build/plugins/DragDropPastePlugin/index.d.ts.map +1 -1
- package/build/plugins/DragDropPastePlugin/index.js +12 -11
- package/build/plugins/DraggableBlockPlugin/index.css +6 -0
- package/build/plugins/DraggableBlockPlugin/index.d.ts +2 -2
- package/build/plugins/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/build/plugins/DraggableBlockPlugin/index.js +23 -22
- package/build/plugins/EmojiPickerPlugin/index.d.ts +0 -7
- package/build/plugins/EmojiPickerPlugin/index.d.ts.map +1 -1
- package/build/plugins/EmojiPickerPlugin/index.js +1 -0
- package/build/plugins/EmojisPlugin/index.d.ts +1 -8
- package/build/plugins/EmojisPlugin/index.d.ts.map +1 -1
- package/build/plugins/EmojisPlugin/index.js +10 -16
- package/build/plugins/EquationsPlugin/index.d.ts +3 -3
- package/build/plugins/EquationsPlugin/index.d.ts.map +1 -1
- package/build/plugins/EquationsPlugin/index.js +14 -10
- package/build/plugins/FigmaPlugin/index.d.ts +2 -2
- package/build/plugins/FigmaPlugin/index.d.ts.map +1 -1
- package/build/plugins/FigmaPlugin/index.js +8 -14
- package/build/plugins/FloatingLinkEditorPlugin/index.css +11 -0
- package/build/plugins/FloatingLinkEditorPlugin/index.d.ts +3 -3
- package/build/plugins/FloatingLinkEditorPlugin/index.d.ts.map +1 -1
- package/build/plugins/FloatingLinkEditorPlugin/index.js +28 -27
- package/build/plugins/FloatingTextFormatToolbarPlugin/index.css +15 -0
- package/build/plugins/FloatingTextFormatToolbarPlugin/index.d.ts.map +1 -1
- package/build/plugins/FloatingTextFormatToolbarPlugin/index.js +2 -1
- package/build/plugins/ImagesPlugin/index.d.ts +3 -3
- package/build/plugins/ImagesPlugin/index.d.ts.map +1 -1
- package/build/plugins/ImagesPlugin/index.js +38 -37
- package/build/plugins/KeywordsPlugin/index.d.ts +1 -8
- package/build/plugins/KeywordsPlugin/index.d.ts.map +1 -1
- package/build/plugins/KeywordsPlugin/index.js +6 -12
- package/build/plugins/LayoutPlugin/InsertLayoutDialog.d.ts +2 -2
- package/build/plugins/LayoutPlugin/InsertLayoutDialog.d.ts.map +1 -1
- package/build/plugins/LayoutPlugin/InsertLayoutDialog.js +10 -9
- package/build/plugins/LayoutPlugin/LayoutPlugin.d.ts +1 -1
- package/build/plugins/LayoutPlugin/LayoutPlugin.d.ts.map +1 -1
- package/build/plugins/LayoutPlugin/LayoutPlugin.js +8 -14
- package/build/plugins/LinkPlugin/index.d.ts.map +1 -1
- package/build/plugins/LinkPlugin/index.js +1 -0
- package/build/plugins/MarkdownShortcutPlugin/index.d.ts.map +1 -1
- package/build/plugins/MarkdownShortcutPlugin/index.js +1 -0
- package/build/plugins/MarkdownTransformers/index.d.ts +1 -1
- package/build/plugins/MarkdownTransformers/index.d.ts.map +1 -1
- package/build/plugins/MarkdownTransformers/index.js +25 -25
- package/build/plugins/PasteLogPlugin/index.d.ts.map +1 -1
- package/build/plugins/PasteLogPlugin/index.js +1 -0
- package/build/plugins/ShortcutsPlugin/index.d.ts +0 -7
- package/build/plugins/ShortcutsPlugin/index.d.ts.map +1 -1
- package/build/plugins/ShortcutsPlugin/index.js +1 -0
- package/build/plugins/SpeechToTextPlugin/index.d.ts +2 -2
- package/build/plugins/SpeechToTextPlugin/index.d.ts.map +1 -1
- package/build/plugins/SpeechToTextPlugin/index.js +7 -11
- package/build/plugins/TabFocusPlugin/index.d.ts +0 -7
- package/build/plugins/TabFocusPlugin/index.d.ts.map +1 -1
- package/build/plugins/TabFocusPlugin/index.js +6 -5
- package/build/plugins/TableActionMenuPlugin/index.d.ts +1 -8
- package/build/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
- package/build/plugins/TableActionMenuPlugin/index.js +41 -40
- package/build/plugins/TableCellResizer/index.d.ts +2 -2
- package/build/plugins/TableCellResizer/index.d.ts.map +1 -1
- package/build/plugins/TableCellResizer/index.js +43 -42
- package/build/plugins/TableHoverActionsPlugin/index.d.ts +1 -8
- package/build/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
- package/build/plugins/TableHoverActionsPlugin/index.js +19 -18
- package/build/plugins/TableHoverActionsV2Plugin/index.d.ts.map +1 -1
- package/build/plugins/TableHoverActionsV2Plugin/index.js +1 -0
- package/build/plugins/TablePlugin.d.ts +2 -2
- package/build/plugins/TablePlugin.d.ts.map +1 -1
- package/build/plugins/TablePlugin.js +11 -10
- package/build/plugins/TableScrollShadowPlugin/index.d.ts +0 -7
- package/build/plugins/TableScrollShadowPlugin/index.d.ts.map +1 -1
- package/build/plugins/TableScrollShadowPlugin/index.js +9 -8
- package/build/plugins/TestRecorderPlugin/index.d.ts +1 -8
- package/build/plugins/TestRecorderPlugin/index.d.ts.map +1 -1
- package/build/plugins/TestRecorderPlugin/index.js +45 -44
- package/build/plugins/ToolbarPlugin/fontSize.d.ts +2 -2
- package/build/plugins/ToolbarPlugin/fontSize.d.ts.map +1 -1
- package/build/plugins/ToolbarPlugin/fontSize.js +19 -18
- package/build/plugins/ToolbarPlugin/index.d.ts.map +1 -1
- package/build/plugins/ToolbarPlugin/index.js +68 -60
- package/build/plugins/ToolbarPlugin/languages.d.ts +14 -0
- package/build/plugins/ToolbarPlugin/languages.d.ts.map +1 -0
- package/build/plugins/ToolbarPlugin/languages.js +185 -0
- package/build/plugins/ToolbarPlugin/utils.d.ts +2 -2
- package/build/plugins/ToolbarPlugin/utils.js +21 -21
- package/build/plugins/TwitterPlugin/index.d.ts +2 -2
- package/build/plugins/TwitterPlugin/index.d.ts.map +1 -1
- package/build/plugins/TwitterPlugin/index.js +8 -14
- package/build/plugins/YouTubePlugin/index.d.ts +2 -2
- package/build/plugins/YouTubePlugin/index.d.ts.map +1 -1
- package/build/plugins/YouTubePlugin/index.js +8 -14
- package/build/themes/PlaygroundEditorTheme.css +301 -33
- package/build/themes/ViewerTheme.css +899 -0
- package/build/{plugins/MentionsPlugin/index.d.ts → themes/ViewerTheme.d.ts} +5 -3
- package/build/themes/ViewerTheme.d.ts.map +1 -0
- package/build/themes/ViewerTheme.js +124 -0
- package/build/themes/ViewerThemeComplete.css +1043 -0
- package/build/ui/ColorPicker.d.ts +2 -2
- package/build/ui/ColorPicker.d.ts.map +1 -1
- package/build/ui/ColorPicker.js +47 -46
- package/build/ui/DropDown.d.ts.map +1 -1
- package/build/ui/DropDown.js +1 -0
- package/build/ui/FlashMessage.d.ts +3 -3
- package/build/ui/FlashMessage.d.ts.map +1 -1
- package/build/ui/FlashMessage.js +3 -2
- package/build/ui/ImageResizer.d.ts +3 -3
- package/build/ui/ImageResizer.d.ts.map +1 -1
- package/build/ui/ImageResizer.js +20 -19
- package/build/ui/KatexEquationAlterer.css +3 -1
- package/build/ui/KatexEquationAlterer.d.ts.map +1 -1
- package/build/ui/KatexEquationAlterer.js +1 -0
- package/build/ui/KatexRenderer.d.ts.map +1 -1
- package/build/ui/KatexRenderer.js +1 -0
- package/build/ui/Modal.d.ts.map +1 -1
- package/build/ui/Modal.js +1 -0
- package/build/ui/Switch.d.ts +2 -2
- package/build/ui/Switch.d.ts.map +1 -1
- package/build/ui/Switch.js +3 -2
- package/build/ui/TextInput.d.ts.map +1 -1
- package/build/ui/TextInput.js +1 -0
- package/build/utils/ServerBlockWithAlignableContents.d.ts +22 -0
- package/build/utils/ServerBlockWithAlignableContents.d.ts.map +1 -0
- package/build/utils/ServerBlockWithAlignableContents.js +6 -0
- package/build/utils/focusUtils.d.ts.map +1 -1
- package/build/utils/focusUtils.js +4 -3
- package/build/utils/getDOMRangeRect.d.ts.map +1 -1
- package/build/utils/getDOMRangeRect.js +1 -0
- package/build/utils/setFloatingElemPosition.d.ts.map +1 -1
- package/build/utils/setFloatingElemPosition.js +5 -4
- package/build/utils/swipe.d.ts +0 -7
- package/build/utils/swipe.d.ts.map +1 -1
- package/build/utils/swipe.js +5 -11
- package/build/viewer/Viewer.d.ts +18 -0
- package/build/viewer/Viewer.d.ts.map +1 -0
- package/build/viewer/Viewer.js +105 -0
- package/build/viewer/client.d.ts +18 -0
- package/build/viewer/client.d.ts.map +1 -0
- package/build/viewer/client.js +97 -0
- package/build/viewer/index.d.ts +4 -0
- package/build/viewer/index.d.ts.map +1 -0
- package/build/viewer/index.js +2 -0
- package/package.json +58 -36
- package/build/collaboration.d.ts +0 -12
- package/build/collaboration.d.ts.map +0 -1
- package/build/collaboration.js +0 -32
- package/build/nodes/FigmaNode.d.ts.map +0 -1
- package/build/nodes/PageBreakNode/index.css +0 -64
- package/build/nodes/PageBreakNode/index.d.ts +0 -25
- package/build/nodes/PageBreakNode/index.d.ts.map +0 -1
- package/build/nodes/PageBreakNode/index.js +0 -83
- package/build/nodes/PlaygroundNodes.d.ts.map +0 -1
- package/build/nodes/PollComponent.d.ts +0 -17
- package/build/nodes/PollComponent.d.ts.map +0 -1
- package/build/nodes/PollComponent.js +0 -85
- package/build/nodes/PollNode.css +0 -165
- package/build/nodes/PollNode.d.ts +0 -51
- package/build/nodes/PollNode.d.ts.map +0 -1
- package/build/nodes/PollNode.js +0 -153
- package/build/nodes/StickyComponent.d.ts +0 -18
- package/build/nodes/StickyComponent.d.ts.map +0 -1
- package/build/nodes/StickyComponent.js +0 -155
- package/build/nodes/StickyNode.css +0 -37
- package/build/nodes/StickyNode.d.ts +0 -39
- package/build/nodes/StickyNode.d.ts.map +0 -1
- package/build/nodes/StickyNode.js +0 -66
- package/build/nodes/TweetNode.d.ts.map +0 -1
- package/build/nodes/YouTubeNode.d.ts.map +0 -1
- package/build/plugins/DocsPlugin/index.d.ts +0 -10
- package/build/plugins/DocsPlugin/index.d.ts.map +0 -1
- package/build/plugins/DocsPlugin/index.js +0 -4
- package/build/plugins/MaxLengthPlugin/index.d.ts +0 -11
- package/build/plugins/MaxLengthPlugin/index.d.ts.map +0 -1
- package/build/plugins/MaxLengthPlugin/index.js +0 -44
- package/build/plugins/MentionsPlugin/index.d.ts.map +0 -1
- package/build/plugins/MentionsPlugin/index.js +0 -562
- package/build/plugins/PageBreakPlugin/index.d.ts +0 -12
- package/build/plugins/PageBreakPlugin/index.d.ts.map +0 -1
- package/build/plugins/PageBreakPlugin/index.js +0 -34
- package/build/plugins/StickyPlugin/index.d.ts +0 -10
- package/build/plugins/StickyPlugin/index.d.ts.map +0 -1
- package/build/plugins/StickyPlugin/index.js +0 -19
- package/build/plugins/TreeViewPlugin/index.d.ts +0 -10
- package/build/plugins/TreeViewPlugin/index.d.ts.map +0 -1
- package/build/plugins/TreeViewPlugin/index.js +0 -7
- package/build/plugins/TypingPerfPlugin/index.d.ts +0 -10
- package/build/plugins/TypingPerfPlugin/index.d.ts.map +0 -1
- package/build/plugins/TypingPerfPlugin/index.js +0 -100
- package/build/plugins/VersionsPlugin/index.css +0 -57
- package/build/plugins/VersionsPlugin/index.d.ts +0 -14
- package/build/plugins/VersionsPlugin/index.d.ts.map +0 -1
- package/build/plugins/VersionsPlugin/index.js +0 -147
- /package/build/nodes/{FigmaNode.d.ts → FigmaNode/FigmaNode.d.ts} +0 -0
- /package/build/nodes/{FigmaNode.js → FigmaNode/FigmaNode.js} +0 -0
- /package/build/nodes/{PlaygroundNodes.d.ts → PlaygroundNodes/PlaygroundNodes.d.ts} +0 -0
- /package/build/nodes/{TweetNode.d.ts → TweetNode/TweetNode.d.ts} +0 -0
- /package/build/nodes/{TweetNode.js → TweetNode/TweetNode.js} +0 -0
- /package/build/nodes/{YouTubeNode.d.ts → YouTubeNode/YouTubeNode.d.ts} +0 -0
- /package/build/nodes/{YouTubeNode.js → YouTubeNode/YouTubeNode.js} +0 -0
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
1
|
export default function EmojiPickerPlugin(): import("react/jsx-runtime").JSX.Element;
|
|
9
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EmojiPickerPlugin/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EmojiPickerPlugin/index.tsx"],"names":[],"mappings":"AA4FA,MAAM,CAAC,OAAO,UAAU,iBAAiB,4CA4GxC"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
import type { JSX } from 'react';
|
|
1
|
+
import type { JSX } from "react";
|
|
9
2
|
export default function EmojisPlugin(): JSX.Element | null;
|
|
10
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EmojisPlugin/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EmojisPlugin/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA8DjC,MAAM,CAAC,OAAO,UAAU,YAAY,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAIzD"}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
9
|
-
import { TextNode } from 'lexical';
|
|
10
|
-
import { useEffect } from 'react';
|
|
11
|
-
import { $createEmojiNode, EmojiNode } from '../../nodes/EmojiNode';
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
3
|
+
import { TextNode } from "lexical";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { $createEmojiNode, EmojiNode } from "../../nodes/EmojiNode";
|
|
12
6
|
const emojis = new Map([
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
7
|
+
[":)", ["emoji happysmile", "🙂"]],
|
|
8
|
+
[":D", ["emoji veryhappysmile", "😀"]],
|
|
9
|
+
[":(", ["emoji unhappysmile", "🙁"]],
|
|
10
|
+
["<3", ["emoji heart", "❤"]],
|
|
17
11
|
]);
|
|
18
12
|
function $findAndTransformEmoji(node) {
|
|
19
13
|
const text = node.getTextContent();
|
|
@@ -47,7 +41,7 @@ function $textNodeTransform(node) {
|
|
|
47
41
|
function useEmojis(editor) {
|
|
48
42
|
useEffect(() => {
|
|
49
43
|
if (!editor.hasNodes([EmojiNode])) {
|
|
50
|
-
throw new Error(
|
|
44
|
+
throw new Error("EmojisPlugin: EmojiNode not registered on editor");
|
|
51
45
|
}
|
|
52
46
|
return editor.registerNodeTransform(TextNode, $textNodeTransform);
|
|
53
47
|
}, [editor]);
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import type { JSX } from
|
|
9
|
-
import
|
|
10
|
-
import { LexicalCommand, LexicalEditor } from
|
|
8
|
+
import type { JSX } from "react";
|
|
9
|
+
import "katex/dist/katex.css";
|
|
10
|
+
import { LexicalCommand, LexicalEditor } from "lexical";
|
|
11
11
|
type CommandPayload = {
|
|
12
12
|
equation: string;
|
|
13
13
|
inline: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EquationsPlugin/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EquationsPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,sBAAsB,CAAC;AAI9B,OAAO,EAML,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AAMjB,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,cAAc,CACzB,CAAC;AAE3C,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,OAAO,GACR,EAAE;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAad;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CA4B5D"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useLexicalComposerContext } from
|
|
4
|
-
import { $wrapNodeInElement } from
|
|
5
|
-
import { $createParagraphNode, $insertNodes, $isRootOrShadowRoot, COMMAND_PRIORITY_EDITOR, createCommand, } from
|
|
6
|
-
import { useCallback, useEffect } from
|
|
7
|
-
import { $createEquationNode, EquationNode } from
|
|
8
|
-
import KatexEquationAlterer from
|
|
9
|
-
export const INSERT_EQUATION_COMMAND = createCommand(
|
|
3
|
+
import "katex/dist/katex.css";
|
|
4
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
5
|
+
import { $wrapNodeInElement } from "@lexical/utils";
|
|
6
|
+
import { $createParagraphNode, $insertNodes, $isRootOrShadowRoot, COMMAND_PRIORITY_EDITOR, createCommand, } from "lexical";
|
|
7
|
+
import { useCallback, useEffect } from "react";
|
|
8
|
+
import { $createEquationNode, EquationNode } from "../../nodes/EquationNode";
|
|
9
|
+
import KatexEquationAlterer from "../../ui/KatexEquationAlterer";
|
|
10
|
+
export const INSERT_EQUATION_COMMAND = createCommand("INSERT_EQUATION_COMMAND");
|
|
10
11
|
export function InsertEquationDialog({ activeEditor, onClose, }) {
|
|
11
12
|
const onEquationConfirm = useCallback((equation, inline) => {
|
|
12
|
-
activeEditor.dispatchCommand(INSERT_EQUATION_COMMAND, {
|
|
13
|
+
activeEditor.dispatchCommand(INSERT_EQUATION_COMMAND, {
|
|
14
|
+
equation,
|
|
15
|
+
inline,
|
|
16
|
+
});
|
|
13
17
|
onClose();
|
|
14
18
|
}, [activeEditor, onClose]);
|
|
15
19
|
return _jsx(KatexEquationAlterer, { onConfirm: onEquationConfirm });
|
|
@@ -18,7 +22,7 @@ export default function EquationsPlugin() {
|
|
|
18
22
|
const [editor] = useLexicalComposerContext();
|
|
19
23
|
useEffect(() => {
|
|
20
24
|
if (!editor.hasNodes([EquationNode])) {
|
|
21
|
-
throw new Error(
|
|
25
|
+
throw new Error("EquationsPlugins: EquationsNode not registered on editor");
|
|
22
26
|
}
|
|
23
27
|
return editor.registerCommand(INSERT_EQUATION_COMMAND, (payload) => {
|
|
24
28
|
const { equation, inline } = payload;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import type { JSX } from
|
|
9
|
-
import { LexicalCommand } from
|
|
8
|
+
import type { JSX } from "react";
|
|
9
|
+
import { LexicalCommand } from "lexical";
|
|
10
10
|
export declare const INSERT_FIGMA_COMMAND: LexicalCommand<string>;
|
|
11
11
|
export default function FigmaPlugin(): JSX.Element | null;
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FigmaPlugin/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FigmaPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,OAAO,EAGL,cAAc,EACf,MAAM,SAAS,CAAC;AAKjB,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,MAAM,CAEvD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAoBxD"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
9
|
-
import { $insertNodeToNearestRoot } from '@lexical/utils';
|
|
10
|
-
import { COMMAND_PRIORITY_EDITOR, createCommand } from 'lexical';
|
|
11
|
-
import { useEffect } from 'react';
|
|
12
|
-
import { $createFigmaNode, FigmaNode } from '../../nodes/FigmaNode';
|
|
13
|
-
export const INSERT_FIGMA_COMMAND = createCommand('INSERT_FIGMA_COMMAND');
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
3
|
+
import { $insertNodeToNearestRoot } from "@lexical/utils";
|
|
4
|
+
import { COMMAND_PRIORITY_EDITOR, createCommand, } from "lexical";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import { $createFigmaNode, FigmaNode } from "../../nodes/FigmaNode/FigmaNode";
|
|
7
|
+
export const INSERT_FIGMA_COMMAND = createCommand("INSERT_FIGMA_COMMAND");
|
|
14
8
|
export default function FigmaPlugin() {
|
|
15
9
|
const [editor] = useLexicalComposerContext();
|
|
16
10
|
useEffect(() => {
|
|
17
11
|
if (!editor.hasNodes([FigmaNode])) {
|
|
18
|
-
throw new Error(
|
|
12
|
+
throw new Error("FigmaPlugin: FigmaNode not registered on editor");
|
|
19
13
|
}
|
|
20
14
|
return editor.registerCommand(INSERT_FIGMA_COMMAND, (payload) => {
|
|
21
15
|
const figmaNode = $createFigmaNode(payload);
|
|
@@ -39,3 +39,14 @@
|
|
|
39
39
|
width: 20px;
|
|
40
40
|
vertical-align: -0.25em;
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
@media (prefers-color-scheme: dark) {
|
|
44
|
+
.link-editor {
|
|
45
|
+
background-color: #2b2b2b;
|
|
46
|
+
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.7);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.link-editor .button.hovered {
|
|
50
|
+
background-color: #3a3a3a;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import type { JSX } from
|
|
9
|
-
import
|
|
10
|
-
import { Dispatch } from
|
|
8
|
+
import type { JSX } from "react";
|
|
9
|
+
import "./index.css";
|
|
10
|
+
import { Dispatch } from "react";
|
|
11
11
|
export default function FloatingLinkEditorPlugin({ anchorElem, isLinkEditMode, setIsLinkEditMode, }: {
|
|
12
12
|
anchorElem?: HTMLElement;
|
|
13
13
|
isLinkEditMode: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FloatingLinkEditorPlugin/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FloatingLinkEditorPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAyBrB,OAAO,EAAE,QAAQ,EAA4C,MAAM,OAAO,CAAC;AAka3E,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,UAA0B,EAC1B,cAAc,EACd,iBAAiB,GAClB,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACtC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAQrB"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { $createLinkNode, $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND, } from
|
|
4
|
-
import { useLexicalComposerContext } from
|
|
5
|
-
import { $findMatchingParent, mergeRegister } from
|
|
6
|
-
import { $getSelection, $isLineBreakNode, $isNodeSelection, $isRangeSelection, CLICK_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, getDOMSelection, KEY_ESCAPE_COMMAND, SELECTION_CHANGE_COMMAND, } from
|
|
7
|
-
import { useCallback, useEffect, useRef, useState } from
|
|
8
|
-
import { createPortal } from
|
|
9
|
-
import { getSelectedNode } from
|
|
10
|
-
import { setFloatingElemPositionForLinkEditor } from
|
|
11
|
-
import { sanitizeUrl } from
|
|
3
|
+
import "./index.css";
|
|
4
|
+
import { $createLinkNode, $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND, } from "@lexical/link";
|
|
5
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
6
|
+
import { $findMatchingParent, mergeRegister } from "@lexical/utils";
|
|
7
|
+
import { $getSelection, $isLineBreakNode, $isNodeSelection, $isRangeSelection, CLICK_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, getDOMSelection, KEY_ESCAPE_COMMAND, SELECTION_CHANGE_COMMAND, } from "lexical";
|
|
8
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
|
+
import { createPortal } from "react-dom";
|
|
10
|
+
import { getSelectedNode } from "../../utils/getSelectedNode";
|
|
11
|
+
import { setFloatingElemPositionForLinkEditor } from "../../utils/setFloatingElemPositionForLinkEditor";
|
|
12
|
+
import { sanitizeUrl } from "../../utils/url";
|
|
12
13
|
function preventDefault(event) {
|
|
13
14
|
event.preventDefault();
|
|
14
15
|
}
|
|
15
16
|
function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditMode, setIsLinkEditMode, }) {
|
|
16
17
|
const editorRef = useRef(null);
|
|
17
18
|
const inputRef = useRef(null);
|
|
18
|
-
const [linkUrl, setLinkUrl] = useState(
|
|
19
|
-
const [editedLinkUrl, setEditedLinkUrl] = useState(
|
|
19
|
+
const [linkUrl, setLinkUrl] = useState("");
|
|
20
|
+
const [editedLinkUrl, setEditedLinkUrl] = useState("https://");
|
|
20
21
|
const [lastSelection, setLastSelection] = useState(null);
|
|
21
22
|
const $updateLinkEditor = useCallback(() => {
|
|
22
23
|
var _a, _b;
|
|
@@ -31,7 +32,7 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
|
|
|
31
32
|
setLinkUrl(node.getURL());
|
|
32
33
|
}
|
|
33
34
|
else {
|
|
34
|
-
setLinkUrl(
|
|
35
|
+
setLinkUrl("");
|
|
35
36
|
}
|
|
36
37
|
if (isLinkEditMode) {
|
|
37
38
|
setEditedLinkUrl(linkUrl);
|
|
@@ -49,7 +50,7 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
|
|
|
49
50
|
setLinkUrl(node.getURL());
|
|
50
51
|
}
|
|
51
52
|
else {
|
|
52
|
-
setLinkUrl(
|
|
53
|
+
setLinkUrl("");
|
|
53
54
|
}
|
|
54
55
|
if (isLinkEditMode) {
|
|
55
56
|
setEditedLinkUrl(linkUrl);
|
|
@@ -85,13 +86,13 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
|
|
|
85
86
|
}
|
|
86
87
|
setLastSelection(selection);
|
|
87
88
|
}
|
|
88
|
-
else if (!activeElement || activeElement.className !==
|
|
89
|
+
else if (!activeElement || activeElement.className !== "link-input") {
|
|
89
90
|
if (rootElement !== null) {
|
|
90
91
|
setFloatingElemPositionForLinkEditor(null, editorElem, anchorElem);
|
|
91
92
|
}
|
|
92
93
|
setLastSelection(null);
|
|
93
94
|
setIsLinkEditMode(false);
|
|
94
|
-
setLinkUrl(
|
|
95
|
+
setLinkUrl("");
|
|
95
96
|
}
|
|
96
97
|
return true;
|
|
97
98
|
}, [anchorElem, editor, setIsLinkEditMode, isLinkEditMode, linkUrl]);
|
|
@@ -102,14 +103,14 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
|
|
|
102
103
|
$updateLinkEditor();
|
|
103
104
|
});
|
|
104
105
|
};
|
|
105
|
-
window.addEventListener(
|
|
106
|
+
window.addEventListener("resize", update);
|
|
106
107
|
if (scrollerElem) {
|
|
107
|
-
scrollerElem.addEventListener(
|
|
108
|
+
scrollerElem.addEventListener("scroll", update);
|
|
108
109
|
}
|
|
109
110
|
return () => {
|
|
110
|
-
window.removeEventListener(
|
|
111
|
+
window.removeEventListener("resize", update);
|
|
111
112
|
if (scrollerElem) {
|
|
112
|
-
scrollerElem.removeEventListener(
|
|
113
|
+
scrollerElem.removeEventListener("scroll", update);
|
|
113
114
|
}
|
|
114
115
|
};
|
|
115
116
|
}, [anchorElem.parentElement, editor, $updateLinkEditor]);
|
|
@@ -150,16 +151,16 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
|
|
|
150
151
|
setIsLinkEditMode(false);
|
|
151
152
|
}
|
|
152
153
|
};
|
|
153
|
-
editorElement.addEventListener(
|
|
154
|
+
editorElement.addEventListener("focusout", handleBlur);
|
|
154
155
|
return () => {
|
|
155
|
-
editorElement.removeEventListener(
|
|
156
|
+
editorElement.removeEventListener("focusout", handleBlur);
|
|
156
157
|
};
|
|
157
158
|
}, [editorRef, setIsLink, setIsLinkEditMode, isLink]);
|
|
158
159
|
const monitorInputInteraction = (event) => {
|
|
159
|
-
if (event.key ===
|
|
160
|
+
if (event.key === "Enter") {
|
|
160
161
|
handleLinkSubmission(event);
|
|
161
162
|
}
|
|
162
|
-
else if (event.key ===
|
|
163
|
+
else if (event.key === "Escape") {
|
|
163
164
|
event.preventDefault();
|
|
164
165
|
setIsLinkEditMode(false);
|
|
165
166
|
}
|
|
@@ -167,7 +168,7 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
|
|
|
167
168
|
const handleLinkSubmission = (event) => {
|
|
168
169
|
event.preventDefault();
|
|
169
170
|
if (lastSelection !== null) {
|
|
170
|
-
if (linkUrl !==
|
|
171
|
+
if (linkUrl !== "") {
|
|
171
172
|
editor.update(() => {
|
|
172
173
|
editor.dispatchCommand(TOGGLE_LINK_COMMAND, sanitizeUrl(editedLinkUrl));
|
|
173
174
|
const selection = $getSelection();
|
|
@@ -184,7 +185,7 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
|
|
|
184
185
|
}
|
|
185
186
|
});
|
|
186
187
|
}
|
|
187
|
-
setEditedLinkUrl(
|
|
188
|
+
setEditedLinkUrl("https://");
|
|
188
189
|
setIsLinkEditMode(false);
|
|
189
190
|
}
|
|
190
191
|
};
|
|
@@ -266,7 +267,7 @@ function useFloatingLinkEditorToolbar(editor, anchorElem, isLinkEditMode, setIsL
|
|
|
266
267
|
const node = getSelectedNode(selection);
|
|
267
268
|
const linkNode = $findMatchingParent(node, $isLinkNode);
|
|
268
269
|
if ($isLinkNode(linkNode) && (payload.metaKey || payload.ctrlKey)) {
|
|
269
|
-
window.open(linkNode.getURL(),
|
|
270
|
+
window.open(linkNode.getURL(), "_blank");
|
|
270
271
|
return true;
|
|
271
272
|
}
|
|
272
273
|
}
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
padding: 8px;
|
|
32
32
|
cursor: pointer;
|
|
33
33
|
vertical-align: middle;
|
|
34
|
+
align-items: center;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
.floating-text-format-popup button.popup-item:disabled {
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
vertical-align: middle;
|
|
77
78
|
-webkit-appearance: none;
|
|
78
79
|
-moz-appearance: none;
|
|
80
|
+
appearance: none;
|
|
79
81
|
width: 70px;
|
|
80
82
|
font-size: 14px;
|
|
81
83
|
color: #777;
|
|
@@ -139,3 +141,16 @@
|
|
|
139
141
|
display: none;
|
|
140
142
|
}
|
|
141
143
|
}
|
|
144
|
+
|
|
145
|
+
@media (prefers-color-scheme: dark) {
|
|
146
|
+
.floating-text-format-popup {
|
|
147
|
+
background: #2a2a2a;
|
|
148
|
+
box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
|
|
149
|
+
}
|
|
150
|
+
.floating-text-format-popup button.popup-item:hover:not([disabled]) {
|
|
151
|
+
background-color: #3a3a3a;
|
|
152
|
+
}
|
|
153
|
+
.floating-text-format-popup .divider {
|
|
154
|
+
background-color: #3a3a3a;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FloatingTextFormatToolbarPlugin/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FloatingTextFormatToolbarPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAiBrB,OAAO,EAAE,QAAQ,EAA4C,MAAM,OAAO,CAAC;AA+Z3E,MAAM,CAAC,OAAO,UAAU,+BAA+B,CAAC,EACtD,UAA0B,EAC1B,iBAAiB,GAClB,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACtC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAGrB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import "./index.css";
|
|
3
|
-
import { $isCodeHighlightNode } from "
|
|
4
|
+
import { $isCodeHighlightNode } from "../../nodes/CodeNode/CodeHighlightNode";
|
|
4
5
|
import { $isLinkNode, TOGGLE_LINK_COMMAND } from "@lexical/link";
|
|
5
6
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
6
7
|
import { mergeRegister } from "@lexical/utils";
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import type { JSX } from
|
|
9
|
-
import { LexicalCommand, LexicalEditor } from
|
|
10
|
-
import { ImagePayload } from
|
|
8
|
+
import type { JSX } from "react";
|
|
9
|
+
import { LexicalCommand, LexicalEditor } from "lexical";
|
|
10
|
+
import { ImagePayload } from "../../nodes/ImageNode";
|
|
11
11
|
export type InsertImagePayload = Readonly<ImagePayload>;
|
|
12
12
|
export declare const INSERT_IMAGE_COMMAND: LexicalCommand<InsertImagePayload>;
|
|
13
13
|
export declare function InsertImageUriDialogBody({ onClick, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/ImagesPlugin/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/ImagesPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAcjC,OAAO,EAiBL,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AAKjB,OAAO,EAIL,YAAY,EACb,MAAM,uBAAuB,CAAC;AAM/B,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,kBAAkB,CAC7B,CAAC;AAExC,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,GACR,EAAE;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,2CAiCA;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,GACR,EAAE;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,2CA6CA;AAED,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,OAAO,GACR,EAAE;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CA6Dd;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,eAAe,GAChB,EAAE;IACD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA+CrB;AAuGD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,SAAS;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,IAAI,CAAC;KACpB;CACF"}
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND, } from
|
|
3
|
-
import { useLexicalComposerContext } from
|
|
4
|
-
import { $findMatchingParent, $wrapNodeInElement, mergeRegister, } from
|
|
5
|
-
import { $createParagraphNode, $createRangeSelection, $getSelection, $insertNodes, $isNodeSelection, $isRootOrShadowRoot, $setSelection, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, createCommand, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, getDOMSelectionFromTarget, isHTMLElement, } from
|
|
6
|
-
import { useEffect, useRef, useState } from
|
|
7
|
-
import landscapeImage from
|
|
8
|
-
import yellowFlowerImage from
|
|
9
|
-
import { $createImageNode, $isImageNode, ImageNode, } from
|
|
10
|
-
import Button from
|
|
11
|
-
import { DialogActions, DialogButtonsList } from
|
|
12
|
-
import FileInput from
|
|
13
|
-
import TextInput from
|
|
14
|
-
export const INSERT_IMAGE_COMMAND = createCommand(
|
|
3
|
+
import { $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND, } from "@lexical/link";
|
|
4
|
+
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
5
|
+
import { $findMatchingParent, $wrapNodeInElement, mergeRegister, } from "@lexical/utils";
|
|
6
|
+
import { $createParagraphNode, $createRangeSelection, $getSelection, $insertNodes, $isNodeSelection, $isRootOrShadowRoot, $setSelection, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, createCommand, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, getDOMSelectionFromTarget, isHTMLElement, } from "lexical";
|
|
7
|
+
import { useEffect, useRef, useState } from "react";
|
|
8
|
+
import landscapeImage from "../../images/landscape.jpg";
|
|
9
|
+
import yellowFlowerImage from "../../images/yellow-flower.jpg";
|
|
10
|
+
import { $createImageNode, $isImageNode, ImageNode, } from "../../nodes/ImageNode";
|
|
11
|
+
import Button from "../../ui/Button";
|
|
12
|
+
import { DialogActions, DialogButtonsList } from "../../ui/Dialog";
|
|
13
|
+
import FileInput from "../../ui/FileInput";
|
|
14
|
+
import TextInput from "../../ui/TextInput";
|
|
15
|
+
export const INSERT_IMAGE_COMMAND = createCommand("INSERT_IMAGE_COMMAND");
|
|
15
16
|
export function InsertImageUriDialogBody({ onClick, }) {
|
|
16
|
-
const [src, setSrc] = useState(
|
|
17
|
-
const [altText, setAltText] = useState(
|
|
18
|
-
const isDisabled = src ===
|
|
17
|
+
const [src, setSrc] = useState("");
|
|
18
|
+
const [altText, setAltText] = useState("");
|
|
19
|
+
const isDisabled = src === "";
|
|
19
20
|
return (_jsxs(_Fragment, { children: [_jsx(TextInput, { label: "Image URL", placeholder: "i.e. https://source.unsplash.com/random", onChange: setSrc, value: src, "data-test-id": "image-modal-url-input" }), _jsx(TextInput, { label: "Alt Text", placeholder: "Random unsplash image", onChange: setAltText, value: altText, "data-test-id": "image-modal-alt-text-input" }), _jsx(DialogActions, { children: _jsx(Button, { "data-test-id": "image-modal-confirm-btn", disabled: isDisabled, onClick: () => onClick({ altText, src }), children: "Confirm" }) })] }));
|
|
20
21
|
}
|
|
21
22
|
export function InsertImageUploadedDialogBody({ onClick, }) {
|
|
22
|
-
const [src, setSrc] = useState(
|
|
23
|
-
const [altText, setAltText] = useState(
|
|
24
|
-
const isDisabled = src ===
|
|
23
|
+
const [src, setSrc] = useState("");
|
|
24
|
+
const [altText, setAltText] = useState("");
|
|
25
|
+
const isDisabled = src === "";
|
|
25
26
|
const loadImage = (files) => {
|
|
26
27
|
const reader = new FileReader();
|
|
27
28
|
reader.onload = function () {
|
|
28
|
-
if (typeof reader.result ===
|
|
29
|
+
if (typeof reader.result === "string") {
|
|
29
30
|
setSrc(reader.result);
|
|
30
31
|
}
|
|
31
|
-
return
|
|
32
|
+
return "";
|
|
32
33
|
};
|
|
33
34
|
if (files !== null) {
|
|
34
35
|
reader.readAsDataURL(files[0]);
|
|
@@ -44,9 +45,9 @@ export function InsertImageDialog({ activeEditor, onClose, }) {
|
|
|
44
45
|
const handler = (e) => {
|
|
45
46
|
hasModifier.current = e.altKey;
|
|
46
47
|
};
|
|
47
|
-
document.addEventListener(
|
|
48
|
+
document.addEventListener("keydown", handler);
|
|
48
49
|
return () => {
|
|
49
|
-
document.removeEventListener(
|
|
50
|
+
document.removeEventListener("keydown", handler);
|
|
50
51
|
};
|
|
51
52
|
}, [activeEditor]);
|
|
52
53
|
const onClick = (payload) => {
|
|
@@ -55,19 +56,19 @@ export function InsertImageDialog({ activeEditor, onClose, }) {
|
|
|
55
56
|
};
|
|
56
57
|
return (_jsxs(_Fragment, { children: [!mode && (_jsxs(DialogButtonsList, { children: [_jsx(Button, { "data-test-id": "image-modal-option-sample", onClick: () => onClick(hasModifier.current
|
|
57
58
|
? {
|
|
58
|
-
altText:
|
|
59
|
+
altText: "Daylight fir trees forest glacier green high ice landscape",
|
|
59
60
|
src: landscapeImage,
|
|
60
61
|
}
|
|
61
62
|
: {
|
|
62
|
-
altText:
|
|
63
|
+
altText: "Yellow flower in tilt shift lens",
|
|
63
64
|
src: yellowFlowerImage,
|
|
64
|
-
}), children: "Sample" }), _jsx(Button, { "data-test-id": "image-modal-option-url", onClick: () => setMode(
|
|
65
|
+
}), children: "Sample" }), _jsx(Button, { "data-test-id": "image-modal-option-url", onClick: () => setMode("url"), children: "URL" }), _jsx(Button, { "data-test-id": "image-modal-option-file", onClick: () => setMode("file"), children: "File" })] })), mode === "url" && _jsx(InsertImageUriDialogBody, { onClick: onClick }), mode === "file" && _jsx(InsertImageUploadedDialogBody, { onClick: onClick })] }));
|
|
65
66
|
}
|
|
66
67
|
export default function ImagesPlugin({ captionsEnabled, }) {
|
|
67
68
|
const [editor] = useLexicalComposerContext();
|
|
68
69
|
useEffect(() => {
|
|
69
70
|
if (!editor.hasNodes([ImageNode])) {
|
|
70
|
-
throw new Error(
|
|
71
|
+
throw new Error("ImagesPlugin: ImageNode not registered on editor");
|
|
71
72
|
}
|
|
72
73
|
return mergeRegister(editor.registerCommand(INSERT_IMAGE_COMMAND, (payload) => {
|
|
73
74
|
const imageNode = $createImageNode(payload);
|
|
@@ -86,10 +87,10 @@ export default function ImagesPlugin({ captionsEnabled, }) {
|
|
|
86
87
|
}, [captionsEnabled, editor]);
|
|
87
88
|
return null;
|
|
88
89
|
}
|
|
89
|
-
const TRANSPARENT_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
|
90
|
-
const img = document.createElement('img');
|
|
91
|
-
img.src = TRANSPARENT_IMAGE;
|
|
92
90
|
function $onDragStart(event) {
|
|
91
|
+
const TRANSPARENT_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
92
|
+
const img = document.createElement("img");
|
|
93
|
+
img.src = TRANSPARENT_IMAGE;
|
|
93
94
|
const node = $getImageNodeInSelection();
|
|
94
95
|
if (!node) {
|
|
95
96
|
return false;
|
|
@@ -98,9 +99,9 @@ function $onDragStart(event) {
|
|
|
98
99
|
if (!dataTransfer) {
|
|
99
100
|
return false;
|
|
100
101
|
}
|
|
101
|
-
dataTransfer.setData(
|
|
102
|
+
dataTransfer.setData("text/plain", "_");
|
|
102
103
|
dataTransfer.setDragImage(img, 0, 0);
|
|
103
|
-
dataTransfer.setData(
|
|
104
|
+
dataTransfer.setData("application/x-lexical-drag", JSON.stringify({
|
|
104
105
|
data: {
|
|
105
106
|
altText: node.__altText,
|
|
106
107
|
caption: node.__caption,
|
|
@@ -111,7 +112,7 @@ function $onDragStart(event) {
|
|
|
111
112
|
src: node.__src,
|
|
112
113
|
width: node.__width,
|
|
113
114
|
},
|
|
114
|
-
type:
|
|
115
|
+
type: "image",
|
|
115
116
|
}));
|
|
116
117
|
return true;
|
|
117
118
|
}
|
|
@@ -162,12 +163,12 @@ function $getImageNodeInSelection() {
|
|
|
162
163
|
}
|
|
163
164
|
function getDragImageData(event) {
|
|
164
165
|
var _a;
|
|
165
|
-
const dragData = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData(
|
|
166
|
+
const dragData = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData("application/x-lexical-drag");
|
|
166
167
|
if (!dragData) {
|
|
167
168
|
return null;
|
|
168
169
|
}
|
|
169
170
|
const { type, data } = JSON.parse(dragData);
|
|
170
|
-
if (type !==
|
|
171
|
+
if (type !== "image") {
|
|
171
172
|
return null;
|
|
172
173
|
}
|
|
173
174
|
return data;
|
|
@@ -175,9 +176,9 @@ function getDragImageData(event) {
|
|
|
175
176
|
function canDropImage(event) {
|
|
176
177
|
const target = event.target;
|
|
177
178
|
return !!(isHTMLElement(target) &&
|
|
178
|
-
!target.closest(
|
|
179
|
+
!target.closest("code, span.editor-image") &&
|
|
179
180
|
isHTMLElement(target.parentElement) &&
|
|
180
|
-
target.parentElement.closest(
|
|
181
|
+
target.parentElement.closest("div.ContentEditable__root"));
|
|
181
182
|
}
|
|
182
183
|
function getDragSelection(event) {
|
|
183
184
|
let range;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
import type { JSX } from 'react';
|
|
1
|
+
import type { JSX } from "react";
|
|
9
2
|
export default function KeywordsPlugin(): JSX.Element | null;
|
|
10
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/KeywordsPlugin/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/KeywordsPlugin/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAWjC,MAAM,CAAC,OAAO,UAAU,cAAc,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAoC3D"}
|