@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
|
@@ -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
|
|
8
|
+
import type { JSX } from "react";
|
|
9
|
+
import "./ColorPicker.css";
|
|
10
10
|
interface ColorPickerProps {
|
|
11
11
|
color: string;
|
|
12
12
|
onChange?: (value: string, skipHistoryStack: boolean, skipRefocus: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../src/ui/ColorPicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../src/ui/ColorPicker.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,mBAAmB,CAAC;AAW3B,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,OAAO,EACzB,WAAW,EAAE,OAAO,KACjB,IAAI,CAAC;CACX;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,UAE9C;AAuBD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAK,EACL,QAAQ,GACT,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC,OAAO,CAiH1C;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AA2FD,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAuB3C"}
|
package/build/ui/ColorPicker.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { calculateZoomLevel } from
|
|
4
|
-
import { useMemo, useRef, useState } from
|
|
5
|
-
import { isKeyboardInput } from
|
|
6
|
-
import TextInput from
|
|
3
|
+
import "./ColorPicker.css";
|
|
4
|
+
import { calculateZoomLevel } from "@lexical/utils";
|
|
5
|
+
import { useMemo, useRef, useState } from "react";
|
|
6
|
+
import { isKeyboardInput } from "../utils/focusUtils";
|
|
7
|
+
import TextInput from "./TextInput";
|
|
7
8
|
let skipAddingToHistoryStack = false;
|
|
8
9
|
export function parseAllowedColor(input) {
|
|
9
|
-
return /^rgb\(\d+, \d+, \d+\)$/.test(input) ? input :
|
|
10
|
+
return /^rgb\(\d+, \d+, \d+\)$/.test(input) ? input : "";
|
|
10
11
|
}
|
|
11
12
|
const basicColors = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
"#d0021b",
|
|
14
|
+
"#f5a623",
|
|
15
|
+
"#f8e71c",
|
|
16
|
+
"#8b572a",
|
|
17
|
+
"#7ed321",
|
|
18
|
+
"#417505",
|
|
19
|
+
"#bd10e0",
|
|
20
|
+
"#9013fe",
|
|
21
|
+
"#4a90e2",
|
|
22
|
+
"#50e3c2",
|
|
23
|
+
"#b8e986",
|
|
24
|
+
"#000000",
|
|
25
|
+
"#4a4a4a",
|
|
26
|
+
"#9b9b9b",
|
|
27
|
+
"#ffffff",
|
|
27
28
|
];
|
|
28
29
|
const WIDTH = 214;
|
|
29
30
|
const HEIGHT = 150;
|
|
30
31
|
export default function ColorPicker({ color, onChange, }) {
|
|
31
|
-
const [selfColor, setSelfColor] = useState(transformColor(
|
|
32
|
-
const [inputColor, setInputColor] = useState(transformColor(
|
|
32
|
+
const [selfColor, setSelfColor] = useState(transformColor("hex", color));
|
|
33
|
+
const [inputColor, setInputColor] = useState(transformColor("hex", color).hex);
|
|
33
34
|
const innerDivRef = useRef(null);
|
|
34
35
|
const saturationPosition = useMemo(() => ({
|
|
35
36
|
x: (selfColor.hsv.s / 100) * WIDTH,
|
|
@@ -47,32 +48,32 @@ export default function ColorPicker({ color, onChange, }) {
|
|
|
47
48
|
const onSetHex = (hex) => {
|
|
48
49
|
setInputColor(hex);
|
|
49
50
|
if (/^#[0-9A-Fa-f]{6}$/i.test(hex)) {
|
|
50
|
-
const newColor = transformColor(
|
|
51
|
+
const newColor = transformColor("hex", hex);
|
|
51
52
|
setSelfColor(newColor);
|
|
52
53
|
emitOnChange(newColor.hex);
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
56
|
const onMoveSaturation = ({ x, y }) => {
|
|
56
57
|
const newHsv = Object.assign(Object.assign({}, selfColor.hsv), { s: (x / WIDTH) * 100, v: 100 - (y / HEIGHT) * 100 });
|
|
57
|
-
const newColor = transformColor(
|
|
58
|
+
const newColor = transformColor("hsv", newHsv);
|
|
58
59
|
setSelfColor(newColor);
|
|
59
60
|
setInputColor(newColor.hex);
|
|
60
61
|
emitOnChange(newColor.hex);
|
|
61
62
|
};
|
|
62
63
|
const onMoveHue = ({ x }) => {
|
|
63
64
|
const newHsv = Object.assign(Object.assign({}, selfColor.hsv), { h: (x / WIDTH) * 360 });
|
|
64
|
-
const newColor = transformColor(
|
|
65
|
+
const newColor = transformColor("hsv", newHsv);
|
|
65
66
|
setSelfColor(newColor);
|
|
66
67
|
setInputColor(newColor.hex);
|
|
67
68
|
emitOnChange(newColor.hex);
|
|
68
69
|
};
|
|
69
70
|
const onBasicColorClick = (e, basicColor) => {
|
|
70
|
-
const newColor = transformColor(
|
|
71
|
+
const newColor = transformColor("hex", basicColor);
|
|
71
72
|
setSelfColor(newColor);
|
|
72
73
|
setInputColor(newColor.hex);
|
|
73
74
|
emitOnChange(newColor.hex, isKeyboardInput(e));
|
|
74
75
|
};
|
|
75
|
-
return (_jsxs("div", { className: "color-picker-wrapper", style: { width: WIDTH }, ref: innerDivRef, children: [_jsx(TextInput, { label: "Hex", onChange: onSetHex, value: inputColor }), _jsx("div", { className: "color-picker-basic-color", children: basicColors.map((basicColor) => (_jsx("button", { className: basicColor === selfColor.hex ?
|
|
76
|
+
return (_jsxs("div", { className: "color-picker-wrapper", style: { width: WIDTH }, ref: innerDivRef, children: [_jsx(TextInput, { label: "Hex", onChange: onSetHex, value: inputColor }), _jsx("div", { className: "color-picker-basic-color", children: basicColors.map((basicColor) => (_jsx("button", { className: basicColor === selfColor.hex ? " active" : "", style: { backgroundColor: basicColor }, onClick: (e) => onBasicColorClick(e, basicColor) }, basicColor))) }), _jsx(MoveWrapper, { className: "color-picker-saturation", style: { backgroundColor: `hsl(${selfColor.hsv.h}, 100%, 50%)` }, onChange: onMoveSaturation, children: _jsx("div", { className: "color-picker-saturation_cursor", style: {
|
|
76
77
|
backgroundColor: selfColor.hex,
|
|
77
78
|
left: saturationPosition.x,
|
|
78
79
|
top: saturationPosition.y,
|
|
@@ -81,7 +82,7 @@ export default function ColorPicker({ color, onChange, }) {
|
|
|
81
82
|
left: huePosition.x,
|
|
82
83
|
} }) }), _jsx("div", { className: "color-picker-color", style: { backgroundColor: selfColor.hex } })] }));
|
|
83
84
|
}
|
|
84
|
-
function MoveWrapper({ className, style, onChange, children }) {
|
|
85
|
+
function MoveWrapper({ className, style, onChange, children, }) {
|
|
85
86
|
const divRef = useRef(null);
|
|
86
87
|
const draggedRef = useRef(false);
|
|
87
88
|
const move = (e) => {
|
|
@@ -108,13 +109,13 @@ function MoveWrapper({ className, style, onChange, children }) {
|
|
|
108
109
|
if (draggedRef.current) {
|
|
109
110
|
skipAddingToHistoryStack = false;
|
|
110
111
|
}
|
|
111
|
-
document.removeEventListener(
|
|
112
|
-
document.removeEventListener(
|
|
112
|
+
document.removeEventListener("mousemove", onMouseMove, false);
|
|
113
|
+
document.removeEventListener("mouseup", onMouseUp, false);
|
|
113
114
|
move(_e);
|
|
114
115
|
draggedRef.current = false;
|
|
115
116
|
};
|
|
116
|
-
document.addEventListener(
|
|
117
|
-
document.addEventListener(
|
|
117
|
+
document.addEventListener("mousemove", onMouseMove, false);
|
|
118
|
+
document.addEventListener("mouseup", onMouseUp, false);
|
|
118
119
|
};
|
|
119
120
|
return (_jsx("div", { ref: divRef, className: className, style: style, onMouseDown: onMouseDown, children: children }));
|
|
120
121
|
}
|
|
@@ -122,29 +123,29 @@ function clamp(value, max, min) {
|
|
|
122
123
|
return value > max ? max : value < min ? min : value;
|
|
123
124
|
}
|
|
124
125
|
export function toHex(value) {
|
|
125
|
-
if (!value.startsWith(
|
|
126
|
-
const ctx = document.createElement(
|
|
126
|
+
if (!value.startsWith("#")) {
|
|
127
|
+
const ctx = document.createElement("canvas").getContext("2d");
|
|
127
128
|
if (!ctx) {
|
|
128
|
-
throw new Error(
|
|
129
|
+
throw new Error("2d context not supported or canvas already initialized");
|
|
129
130
|
}
|
|
130
131
|
ctx.fillStyle = value;
|
|
131
132
|
return ctx.fillStyle;
|
|
132
133
|
}
|
|
133
134
|
else if (value.length === 4 || value.length === 5) {
|
|
134
135
|
value = value
|
|
135
|
-
.split(
|
|
136
|
-
.map((v, i) => (i ? v + v :
|
|
137
|
-
.join(
|
|
136
|
+
.split("")
|
|
137
|
+
.map((v, i) => (i ? v + v : "#"))
|
|
138
|
+
.join("");
|
|
138
139
|
return value;
|
|
139
140
|
}
|
|
140
141
|
else if (value.length === 7 || value.length === 9) {
|
|
141
142
|
return value;
|
|
142
143
|
}
|
|
143
|
-
return
|
|
144
|
+
return "#000000";
|
|
144
145
|
}
|
|
145
146
|
function hex2rgb(hex) {
|
|
146
147
|
const rbgArr = (hex
|
|
147
|
-
.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) =>
|
|
148
|
+
.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => "#" + r + r + g + g + b + b)
|
|
148
149
|
.substring(1)
|
|
149
150
|
.match(/.{2}/g) || []).map((x) => parseInt(x, 16));
|
|
150
151
|
return {
|
|
@@ -185,25 +186,25 @@ function hsv2rgb({ h, s, v }) {
|
|
|
185
186
|
return { b, g, r };
|
|
186
187
|
}
|
|
187
188
|
function rgb2hex({ b, g, r }) {
|
|
188
|
-
return
|
|
189
|
+
return "#" + [r, g, b].map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
189
190
|
}
|
|
190
191
|
function transformColor(format, color) {
|
|
191
|
-
let hex = toHex(
|
|
192
|
+
let hex = toHex("#121212");
|
|
192
193
|
let rgb = hex2rgb(hex);
|
|
193
194
|
let hsv = rgb2hsv(rgb);
|
|
194
|
-
if (format ===
|
|
195
|
+
if (format === "hex") {
|
|
195
196
|
const value = color;
|
|
196
197
|
hex = toHex(value);
|
|
197
198
|
rgb = hex2rgb(hex);
|
|
198
199
|
hsv = rgb2hsv(rgb);
|
|
199
200
|
}
|
|
200
|
-
else if (format ===
|
|
201
|
+
else if (format === "rgb") {
|
|
201
202
|
const value = color;
|
|
202
203
|
rgb = value;
|
|
203
204
|
hex = rgb2hex(rgb);
|
|
204
205
|
hsv = rgb2hsv(rgb);
|
|
205
206
|
}
|
|
206
|
-
else if (format ===
|
|
207
|
+
else if (format === "hsv") {
|
|
207
208
|
const value = color;
|
|
208
209
|
hsv = value;
|
|
209
210
|
rgb = hsv2rgb(hsv);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../src/ui/DropDown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../src/ui/DropDown.tsx"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,SAAS,EAMV,MAAM,OAAO,CAAC;AAaf,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,2CA4BA;AA0FD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,QAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACpB,WAAW,GACZ,EAAE;IACD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,GAAG,CAAC,OAAO,CAmHd"}
|
package/build/ui/DropDown.js
CHANGED
|
@@ -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 { ReactNode } from
|
|
8
|
+
import type { JSX } from "react";
|
|
9
|
+
import "./FlashMessage.css";
|
|
10
|
+
import { ReactNode } from "react";
|
|
11
11
|
export interface FlashMessageProps {
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlashMessage.d.ts","sourceRoot":"","sources":["../../src/ui/FlashMessage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlashMessage.d.ts","sourceRoot":"","sources":["../../src/ui/FlashMessage.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,GACT,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CASjC"}
|
package/build/ui/FlashMessage.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { createPortal } from
|
|
3
|
+
import "./FlashMessage.css";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
4
5
|
export default function FlashMessage({ children, }) {
|
|
5
6
|
return createPortal(_jsx("div", { className: "FlashMessage__overlay", role: "dialog", children: _jsx("p", { className: "FlashMessage__alert", role: "alert", children: children }) }), document.body);
|
|
6
7
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import type { LexicalEditor } from
|
|
9
|
-
import type { JSX } from
|
|
8
|
+
import type { LexicalEditor } from "lexical";
|
|
9
|
+
import type { JSX } from "react";
|
|
10
10
|
export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }: {
|
|
11
11
|
editor: LexicalEditor;
|
|
12
12
|
buttonRef: {
|
|
@@ -16,7 +16,7 @@ export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, im
|
|
|
16
16
|
current: null | HTMLElement;
|
|
17
17
|
};
|
|
18
18
|
maxWidth?: number;
|
|
19
|
-
onResizeEnd: (width:
|
|
19
|
+
onResizeEnd: (width: "inherit" | number, height: "inherit" | number) => void;
|
|
20
20
|
onResizeStart: () => void;
|
|
21
21
|
setShowCaption: (show: boolean) => void;
|
|
22
22
|
showCaption: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageResizer.d.ts","sourceRoot":"","sources":["../../src/ui/ImageResizer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageResizer.d.ts","sourceRoot":"","sources":["../../src/ui/ImageResizer.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAiBjC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,aAAa,EACb,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,WAAW,EACX,cAAc,EACd,eAAe,GAChB,EAAE;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE;QAAE,OAAO,EAAE,IAAI,GAAG,iBAAiB,CAAA;KAAE,CAAC;IACjD,QAAQ,EAAE;QAAE,OAAO,EAAE,IAAI,GAAG,WAAW,CAAA;KAAE,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7E,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,GAAG,CAAC,OAAO,CA+Qd"}
|
package/build/ui/ImageResizer.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { calculateZoomLevel } from
|
|
3
|
-
import { useRef } from
|
|
3
|
+
import { calculateZoomLevel } from "@lexical/utils";
|
|
4
|
+
import { useRef } from "react";
|
|
4
5
|
function clamp(value, min, max) {
|
|
5
6
|
return Math.min(Math.max(value, min), max);
|
|
6
7
|
}
|
|
@@ -13,8 +14,8 @@ const Direction = {
|
|
|
13
14
|
export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }) {
|
|
14
15
|
const controlWrapperRef = useRef(null);
|
|
15
16
|
const userSelect = useRef({
|
|
16
|
-
priority:
|
|
17
|
-
value:
|
|
17
|
+
priority: "",
|
|
18
|
+
value: "default",
|
|
18
19
|
});
|
|
19
20
|
const positioningRef = useRef({
|
|
20
21
|
currentHeight: 0,
|
|
@@ -44,24 +45,24 @@ export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, im
|
|
|
44
45
|
const ns = direction === Direction.north || direction === Direction.south;
|
|
45
46
|
const nwse = (direction & Direction.north && direction & Direction.west) ||
|
|
46
47
|
(direction & Direction.south && direction & Direction.east);
|
|
47
|
-
const cursorDir = ew ?
|
|
48
|
+
const cursorDir = ew ? "ew" : ns ? "ns" : nwse ? "nwse" : "nesw";
|
|
48
49
|
if (editorRootElement !== null) {
|
|
49
|
-
editorRootElement.style.setProperty(
|
|
50
|
+
editorRootElement.style.setProperty("cursor", `${cursorDir}-resize`, "important");
|
|
50
51
|
}
|
|
51
52
|
if (document.body !== null) {
|
|
52
|
-
document.body.style.setProperty(
|
|
53
|
-
userSelect.current.value = document.body.style.getPropertyValue(
|
|
54
|
-
userSelect.current.priority = document.body.style.getPropertyPriority(
|
|
55
|
-
document.body.style.setProperty(
|
|
53
|
+
document.body.style.setProperty("cursor", `${cursorDir}-resize`, "important");
|
|
54
|
+
userSelect.current.value = document.body.style.getPropertyValue("-webkit-user-select");
|
|
55
|
+
userSelect.current.priority = document.body.style.getPropertyPriority("-webkit-user-select");
|
|
56
|
+
document.body.style.setProperty("-webkit-user-select", `none`, "important");
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
59
|
const setEndCursor = () => {
|
|
59
60
|
if (editorRootElement !== null) {
|
|
60
|
-
editorRootElement.style.setProperty(
|
|
61
|
+
editorRootElement.style.setProperty("cursor", "text");
|
|
61
62
|
}
|
|
62
63
|
if (document.body !== null) {
|
|
63
|
-
document.body.style.setProperty(
|
|
64
|
-
document.body.style.setProperty(
|
|
64
|
+
document.body.style.setProperty("cursor", "default");
|
|
65
|
+
document.body.style.setProperty("-webkit-user-select", userSelect.current.value, userSelect.current.priority);
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
const handlePointerDown = (event, direction) => {
|
|
@@ -86,11 +87,11 @@ export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, im
|
|
|
86
87
|
positioning.direction = direction;
|
|
87
88
|
setStartCursor(direction);
|
|
88
89
|
onResizeStart();
|
|
89
|
-
controlWrapper.classList.add(
|
|
90
|
+
controlWrapper.classList.add("image-control-wrapper--resizing");
|
|
90
91
|
image.style.height = `${height}px`;
|
|
91
92
|
image.style.width = `${width}px`;
|
|
92
|
-
document.addEventListener(
|
|
93
|
-
document.addEventListener(
|
|
93
|
+
document.addEventListener("pointermove", handlePointerMove);
|
|
94
|
+
document.addEventListener("pointerup", handlePointerUp);
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
97
|
const handlePointerMove = (event) => {
|
|
@@ -142,11 +143,11 @@ export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, im
|
|
|
142
143
|
positioning.currentWidth = 0;
|
|
143
144
|
positioning.currentHeight = 0;
|
|
144
145
|
positioning.isResizing = false;
|
|
145
|
-
controlWrapper.classList.remove(
|
|
146
|
+
controlWrapper.classList.remove("image-control-wrapper--resizing");
|
|
146
147
|
setEndCursor();
|
|
147
148
|
onResizeEnd(width, height);
|
|
148
|
-
document.removeEventListener(
|
|
149
|
-
document.removeEventListener(
|
|
149
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
150
|
+
document.removeEventListener("pointerup", handlePointerUp);
|
|
150
151
|
}
|
|
151
152
|
};
|
|
152
153
|
return (_jsxs("div", { ref: controlWrapperRef, children: [!showCaption && captionsEnabled && (_jsx("button", { className: "image-caption-button", ref: buttonRef, onClick: () => {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
.KatexEquationAlterer_centerRow {
|
|
29
29
|
display: flex;
|
|
30
|
-
flex-direction:
|
|
30
|
+
flex-direction: "row";
|
|
31
31
|
margin-top: 10px;
|
|
32
32
|
margin-bottom: 10px;
|
|
33
33
|
justify-content: center;
|
|
@@ -38,4 +38,6 @@
|
|
|
38
38
|
width: 100%;
|
|
39
39
|
resize: none;
|
|
40
40
|
padding: 7px;
|
|
41
|
+
border: 1px solid;
|
|
42
|
+
border-color: black;
|
|
41
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KatexEquationAlterer.d.ts","sourceRoot":"","sources":["../../src/ui/KatexEquationAlterer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KatexEquationAlterer.d.ts","sourceRoot":"","sources":["../../src/ui/KatexEquationAlterer.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,4BAA4B,CAAC;AASpC,KAAK,KAAK,GAAG;IACX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,SAAS,EACT,eAAoB,GACrB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAyDrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KatexRenderer.d.ts","sourceRoot":"","sources":["../../src/ui/KatexRenderer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KatexRenderer.d.ts","sourceRoot":"","sources":["../../src/ui/KatexRenderer.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,QAAQ,EACR,MAAM,EACN,aAAa,GACd,EAAE,QAAQ,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC,GAAG,GAAG,CAAC,OAAO,CA2Cf"}
|
package/build/ui/Modal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/ui/Modal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/ui/Modal.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AA4ErD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,OAAO,EACP,QAAQ,EACR,KAAK,EACL,mBAA2B,GAC5B,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,GAAG,CAAC,OAAO,CAWd"}
|
package/build/ui/Modal.js
CHANGED
package/build/ui/Switch.d.ts
CHANGED
|
@@ -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 * as React from
|
|
8
|
+
import type { JSX } from "react";
|
|
9
|
+
import * as React from "react";
|
|
10
10
|
export default function Switch({ checked, onClick, text, id, }: Readonly<{
|
|
11
11
|
checked: boolean;
|
|
12
12
|
id?: string;
|
package/build/ui/Switch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/ui/Switch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/ui/Switch.tsx"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,IAAI,EACJ,EAAE,GACH,EAAE,QAAQ,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,GAAG,GAAG,CAAC,OAAO,CAef"}
|
package/build/ui/Switch.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from
|
|
3
|
+
import { useMemo } from "react";
|
|
3
4
|
export default function Switch({ checked, onClick, text, id, }) {
|
|
4
|
-
const buttonId = useMemo(() =>
|
|
5
|
+
const buttonId = useMemo(() => "id_" + Math.floor(Math.random() * 10000), []);
|
|
5
6
|
return (_jsxs("div", { className: "switch", id: id, children: [_jsx("label", { htmlFor: buttonId, children: text }), _jsx("button", { role: "switch", "aria-checked": checked, id: buttonId, onClick: onClick, children: _jsx("span", {}) })] }));
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/ui/TextInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/ui/TextInput.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAE/C,KAAK,KAAK,GAAG,QAAQ,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,sBAAsB,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,KAAK,EACL,KAAK,EACL,QAAQ,EACR,WAAgB,EAChB,cAAc,EAAE,UAAU,EAC1B,IAAa,GACd,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAgBrB"}
|
package/build/ui/TextInput.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
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 { ElementFormatType, NodeKey } from "lexical";
|
|
9
|
+
import type { JSX } from "react";
|
|
10
|
+
import { ReactNode } from "react";
|
|
11
|
+
type Props = Readonly<{
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
format?: ElementFormatType | null;
|
|
14
|
+
nodeKey: NodeKey;
|
|
15
|
+
className: Readonly<{
|
|
16
|
+
base: string;
|
|
17
|
+
focus: string;
|
|
18
|
+
}>;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function ServerBlockWithAlignableContents({ children, format, nodeKey, className, }: Props): JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=ServerBlockWithAlignableContents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerBlockWithAlignableContents.d.ts","sourceRoot":"","sources":["../../src/utils/ServerBlockWithAlignableContents.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,KAAK,KAAK,GAAG,QAAQ,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,QAAQ,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,GACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAWrB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function ServerBlockWithAlignableContents({ children, format, nodeKey, className, }) {
|
|
3
|
+
return (_jsx("div", { className: [className.base].filter(Boolean).join(" "), style: {
|
|
4
|
+
textAlign: format ? format : undefined,
|
|
5
|
+
}, children: children }));
|
|
6
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusUtils.d.ts","sourceRoot":"","sources":["../../src/utils/focusUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"focusUtils.d.ts","sourceRoot":"","sources":["../../src/utils/focusUtils.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,eAAO,MAAM,4BAA4B,GACvC,cAAc,WAAW,KACxB,WAAW,GAAG,IAShB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,cAAc,WAAW,KACxB,WAAW,GAAG,IAIhB,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,OAAO,UAAU,GAAG,YAAY,GAAG,KAAK,CAAC,UAAU,KAClD,OAMF,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
/**
|
|
2
3
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
4
|
*
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
*
|
|
7
8
|
*/
|
|
8
9
|
export const findFirstFocusableDescendant = (startElement) => {
|
|
9
|
-
const focusableSelector =
|
|
10
|
+
const focusableSelector = "button, a[href], input, select, textarea, details, summary [tabindex], [contenteditable]";
|
|
10
11
|
const focusableDescendants = startElement.querySelector(focusableSelector);
|
|
11
12
|
return focusableDescendants;
|
|
12
13
|
};
|
|
@@ -16,8 +17,8 @@ export const focusNearestDescendant = (startElement) => {
|
|
|
16
17
|
return el;
|
|
17
18
|
};
|
|
18
19
|
export const isKeyboardInput = (event) => {
|
|
19
|
-
if (
|
|
20
|
-
return event.pointerId === -1 && event.pointerType ===
|
|
20
|
+
if ("pointerId" in event && "pointerType" in event) {
|
|
21
|
+
return event.pointerId === -1 && event.pointerType === "";
|
|
21
22
|
}
|
|
22
23
|
return (event === null || event === void 0 ? void 0 : event.detail) === 0;
|
|
23
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDOMRangeRect.d.ts","sourceRoot":"","sources":["../../src/utils/getDOMRangeRect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDOMRangeRect.d.ts","sourceRoot":"","sources":["../../src/utils/getDOMRangeRect.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,eAAe,EAAE,SAAS,EAC1B,WAAW,EAAE,WAAW,GACvB,OAAO,CAgBT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setFloatingElemPosition.d.ts","sourceRoot":"","sources":["../../src/utils/setFloatingElemPosition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setFloatingElemPosition.d.ts","sourceRoot":"","sources":["../../src/utils/setFloatingElemPosition.ts"],"names":[],"mappings":"AAYA,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,OAAO,GAAG,IAAI,EAC1B,YAAY,EAAE,WAAW,EACzB,UAAU,EAAE,WAAW,EACvB,MAAM,GAAE,OAAe,EACvB,WAAW,GAAE,MAAqB,EAClC,gBAAgB,GAAE,MAA0B,GAC3C,IAAI,CAwDN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
/**
|
|
2
3
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
4
|
*
|
|
@@ -10,8 +11,8 @@ const HORIZONTAL_OFFSET = 5;
|
|
|
10
11
|
export function setFloatingElemPosition(targetRect, floatingElem, anchorElem, isLink = false, verticalGap = VERTICAL_GAP, horizontalOffset = HORIZONTAL_OFFSET) {
|
|
11
12
|
const scrollerElem = anchorElem.parentElement;
|
|
12
13
|
if (targetRect === null || !scrollerElem) {
|
|
13
|
-
floatingElem.style.opacity =
|
|
14
|
-
floatingElem.style.transform =
|
|
14
|
+
floatingElem.style.opacity = "0";
|
|
15
|
+
floatingElem.style.transform = "translate(-10000px, -10000px)";
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
const floatingElemRect = floatingElem.getBoundingClientRect();
|
|
@@ -29,7 +30,7 @@ export function setFloatingElemPosition(targetRect, floatingElem, anchorElem, is
|
|
|
29
30
|
? textNode
|
|
30
31
|
: textNode.parentElement;
|
|
31
32
|
const textAlign = window.getComputedStyle(textElement).textAlign;
|
|
32
|
-
if (textAlign ===
|
|
33
|
+
if (textAlign === "right" || textAlign === "end") {
|
|
33
34
|
// For end-aligned text, position the toolbar relative to the text end
|
|
34
35
|
left = targetRect.right - floatingElemRect.width + horizontalOffset;
|
|
35
36
|
}
|
|
@@ -50,6 +51,6 @@ export function setFloatingElemPosition(targetRect, floatingElem, anchorElem, is
|
|
|
50
51
|
}
|
|
51
52
|
top -= anchorElementRect.top;
|
|
52
53
|
left -= anchorElementRect.left;
|
|
53
|
-
floatingElem.style.opacity =
|
|
54
|
+
floatingElem.style.opacity = "1";
|
|
54
55
|
floatingElem.style.transform = `translate(${left}px, ${top}px)`;
|
|
55
56
|
}
|
package/build/utils/swipe.d.ts
CHANGED
|
@@ -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
1
|
export declare function addSwipeLeftListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
|
|
9
2
|
export declare function addSwipeRightListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
|
|
10
3
|
export declare function addSwipeUpListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swipe.d.ts","sourceRoot":"","sources":["../../src/utils/swipe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"swipe.d.ts","sourceRoot":"","sources":["../../src/utils/swipe.ts"],"names":[],"mappings":"AAkFA,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SAvDmB,IAAI,CA+DnE;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SAnEmB,IAAI,CA2EnE;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SA/EmB,IAAI,CAuFnE;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SA3FmB,IAAI,CAmGnE"}
|