ct-rich-text-editor 1.3.21 → 1.3.23
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 +233 -233
- package/dist/App.d.ts +3 -2
- package/dist/Provider/EditorProvider.d.ts +27 -26
- package/dist/Provider/LexicalProvider.d.ts +6 -5
- package/dist/api/ai/index.d.ts +31 -31
- package/dist/api/auth.d.ts +108 -108
- package/dist/api/config/axios.d.ts +2 -1
- package/dist/api/config/endpoints.d.ts +18 -18
- package/dist/api/featureSuggestion.d.ts +23 -23
- package/dist/api/transcript/index.d.ts +1 -1
- package/dist/assets/style.css +5211 -5194
- package/dist/{babel-d3085146.js → babel-d155920e.js} +3278 -3551
- package/dist/babel-d155920e.js.map +1 -0
- package/dist/components/AiPlugin/index.d.ts +6 -6
- package/dist/components/AlignMenu/AlignMenu.d.ts +9 -8
- package/dist/components/AlignMenu/AlignMenuDrop.d.ts +3 -2
- package/dist/components/AlignMenu/index.d.ts +1 -1
- package/dist/components/AutoExpandingDemo.d.ts +6 -5
- package/dist/components/BlockFormatMenu/BlockFormatMenu.d.ts +3 -2
- package/dist/components/BlockFormatMenu/constants.d.ts +14 -14
- package/dist/components/BlockFormatMenu/index.d.ts +1 -1
- package/dist/components/ChartEditDialog.d.ts +9 -8
- package/dist/components/ChartInsertDialog.d.ts +8 -7
- package/dist/components/CodeActionMenuPlugin/components/CopyButton/index.d.ts +7 -6
- package/dist/components/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +9 -8
- package/dist/components/CodeActionMenuPlugin/index.d.ts +5 -4
- package/dist/components/CodeActionMenuPlugin/utils.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +3 -2
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/CommentSidebar/CommentSidebar.d.ts +8 -7
- package/dist/components/CommentSidebar/index.d.ts +1 -1
- package/dist/components/CommentToggle/CommentToggle.d.ts +8 -7
- package/dist/components/CommentToggle/index.d.ts +1 -1
- package/dist/components/CommentView/CommentView.d.ts +9 -8
- package/dist/components/CommentView/index.d.ts +1 -1
- package/dist/components/ConfigurableEditorWithAuth.d.ts +13 -12
- package/dist/components/DatePicker/DatePickerWidget.d.ts +7 -6
- package/dist/components/EmojiPickerWidget/EmojiPickerWidget.d.ts +3 -2
- package/dist/components/EmojiPickerWidget/index.d.ts +1 -1
- package/dist/components/FeatureSuggestionDialog/index.d.ts +6 -6
- package/dist/components/FileUpload/InsertFileDialog.d.ts +7 -7
- package/dist/components/FileUpload/InsertFileUploadedDialogBody.d.ts +5 -4
- package/dist/components/FileView/index.d.ts +9 -8
- package/dist/components/FontFamilySelect/FontFamilyMenu.d.ts +7 -6
- package/dist/components/FontSizePicker/FontSizeControl.d.ts +3 -2
- package/dist/components/FormatTextMenu/FormatTextMenu.d.ts +3 -2
- package/dist/components/FormatTextMenu/FormatTextMenuDrop.d.ts +3 -2
- package/dist/components/FormatTextMenu/index.d.ts +1 -1
- package/dist/components/HighlightColorPicker/HighlightColorPicker.d.ts +7 -6
- package/dist/components/HtmlViewDisplay.d.ts +3 -2
- package/dist/components/ImageComparisonDialog/index.d.ts +11 -10
- package/dist/components/ImageGenerationDialog/ImageGenerationManager.d.ts +11 -10
- package/dist/components/ImageGenerationDialog/index.d.ts +11 -10
- package/dist/components/ImageInsertTest.d.ts +3 -2
- package/dist/components/ImageView/ImageDialog/ImageUploadDialogBody.d.ts +9 -8
- package/dist/components/ImageView/ImageDialog/index.d.ts +6 -5
- package/dist/components/ImageView/ImageResizer.d.ts +16 -15
- package/dist/components/ImageView/index.d.ts +16 -15
- package/dist/components/InsertMenu/InsertMenu.d.ts +9 -8
- package/dist/components/InsertMenu/InsertMenuDrop.d.ts +9 -8
- package/dist/components/InsertMenu/index.d.ts +1 -1
- package/dist/components/LanguageSelectorDialog/index.d.ts +8 -7
- package/dist/components/NotePanelMenu/NotePanelMenu.d.ts +6 -5
- package/dist/components/NotePanelMenu/index.d.ts +1 -1
- package/dist/components/NotePanelView/NotePanelView.d.ts +9 -8
- package/dist/components/NotePanelView/index.d.ts +1 -1
- package/dist/components/Placeholder/Placeholder.d.ts +3 -2
- package/dist/components/Placeholder/index.d.ts +1 -1
- package/dist/components/Placeholder/styles.d.ts +1 -1
- package/dist/components/ScopedEditor.d.ts +8 -8
- package/dist/components/SignatureCaption/index.d.ts +6 -5
- package/dist/components/TableColorPicker/index.d.ts +8 -7
- package/dist/components/TableModal/TableModal.d.ts +10 -9
- package/dist/components/TextEnhanceDialog/index.d.ts +10 -9
- package/dist/components/ToneAdjustDialog/index.d.ts +8 -7
- package/dist/components/Toolbar/Toolbar.d.ts +3 -2
- package/dist/components/Toolbar/index.d.ts +1 -1
- package/dist/components/Toolbar/styles.d.ts +6 -6
- package/dist/components/ui/avatar.d.ts +6 -6
- package/dist/components/ui/badge.d.ts +9 -8
- package/dist/components/ui/button.d.ts +11 -10
- package/dist/components/ui/calendar.d.ts +8 -7
- package/dist/components/ui/card.d.ts +8 -8
- package/dist/components/ui/checkbox.d.ts +4 -4
- package/dist/components/ui/dialog.d.ts +19 -19
- package/dist/components/ui/dropdown-menu.d.ts +27 -27
- package/dist/components/ui/input.d.ts +3 -3
- package/dist/components/ui/label.d.ts +4 -4
- package/dist/components/ui/popover.d.ts +7 -7
- package/dist/components/ui/select.d.ts +13 -13
- package/dist/components/ui/separator.d.ts +4 -4
- package/dist/components/ui/sheet.d.ts +24 -24
- package/dist/components/ui/skeleton.d.ts +3 -3
- package/dist/components/ui/tabs.d.ts +7 -7
- package/dist/components/ui/textarea.d.ts +3 -3
- package/dist/components/ui/tooltip.d.ts +7 -7
- package/dist/constants.d.ts +22 -21
- package/dist/context/CommentContext.d.ts +43 -42
- package/dist/context/HtmlViewContext.d.ts +17 -16
- package/dist/context/ToolbarContext.d.ts +56 -55
- package/dist/editorConfig.d.ts +48 -48
- package/dist/{estree-164983f6.js → estree-b1fff53b.js} +1778 -1763
- package/dist/estree-b1fff53b.js.map +1 -0
- package/dist/hooks/useAutoExpandingHeight.d.ts +15 -15
- package/dist/hooks/useBlockFormat.d.ts +17 -16
- package/dist/hooks/useColorPicker.d.ts +6 -6
- package/dist/hooks/useCustomCommands.d.ts +3 -2
- package/dist/hooks/useDebounce.d.ts +1 -1
- package/dist/hooks/useEditorToolbar.d.ts +10 -9
- package/dist/hooks/useInsertMenu.d.ts +9 -9
- package/dist/hooks/useModal.d.ts +5 -5
- package/dist/hooks/useS3Uploader.d.ts +11 -11
- package/dist/hooks/useVoiceToText.d.ts +15 -15
- package/dist/{html-5586dbf6.js → html-f95ee5dc.js} +656 -701
- package/dist/html-f95ee5dc.js.map +1 -0
- package/dist/{html2pdf.bundle-0b180070.js → html2pdf.bundle-026397bd.js} +2 -2
- package/dist/html2pdf.bundle-026397bd.js.map +1 -0
- package/dist/{html2pdf.bundle.min-08b31c1f.js → html2pdf.bundle.min-49ff1939.js} +2 -2
- package/dist/html2pdf.bundle.min-49ff1939.js.map +1 -0
- package/dist/{index-68135c09.js → index-b8db2529.js} +2 -2
- package/dist/index-b8db2529.js.map +1 -0
- package/dist/{index-6360d552.js → index-b9ad2974.js} +469 -825
- package/dist/index-b9ad2974.js.map +1 -0
- package/dist/{index-8bcb5b47.js → index-cea164e5.js} +4 -4
- package/dist/index-cea164e5.js.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/lib/utils.d.ts +2 -1
- package/dist/main.d.ts +1 -0
- package/dist/{markdown-d513479b.js → markdown-1d9e6c3f.js} +1789 -1836
- package/dist/markdown-1d9e6c3f.js.map +1 -0
- package/dist/nodes/ChartNode.d.ts +41 -40
- package/dist/nodes/CommentNode.d.ts +34 -33
- package/dist/nodes/CommentedTextNode.d.ts +29 -28
- package/dist/nodes/EmbedNode.d.ts +26 -25
- package/dist/nodes/FileNode.d.ts +32 -31
- package/dist/nodes/ImageNode.d.ts +59 -58
- package/dist/nodes/MentionNode.d.ts +75 -74
- package/dist/nodes/NotePanelNode.d.ts +31 -30
- package/dist/pages/ConfigurableEditor/ConfigurableEditor.d.ts +25 -24
- package/dist/pages/ConfigurableEditor/index.d.ts +2 -2
- package/dist/pages/NotFound.d.ts +2 -2
- package/dist/pages/RichTextEditor.d.ts +6 -6
- package/dist/pages/TextareaEditor.d.ts +6 -6
- package/dist/pages/styles.d.ts +5 -5
- package/dist/plugins/AIChatPlugin.d.ts +11 -10
- package/dist/plugins/AndroidKeyboardFixPlugin.d.ts +16 -16
- package/dist/plugins/AutocompletePlugin.d.ts +22 -22
- package/dist/plugins/CodeBlockNormalizerPlugin.d.ts +8 -8
- package/dist/plugins/CodeBlockSelectAllPlugin.d.ts +8 -8
- package/dist/plugins/CodeHighlightPlugin.d.ts +3 -2
- package/dist/plugins/CombinedAutocompletGrammarPlugin.d.ts +21 -20
- package/dist/plugins/CommentBubblePlugin.d.ts +3 -2
- package/dist/plugins/CommentPlugin.d.ts +7 -6
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +29 -28
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRulePlugin.d.ts +3 -3
- package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +7 -6
- package/dist/plugins/CustomHorizontalRulePlugin/index.d.ts +3 -3
- package/dist/plugins/DragDropPastePlugin/index.d.ts +8 -8
- package/dist/plugins/EmbedPreviewPlugin/FloatingEmbedMenuPlugin.d.ts +4 -3
- package/dist/plugins/EmbedPreviewPlugin/index.d.ts +6 -5
- package/dist/plugins/FilePlugin.d.ts +8 -7
- package/dist/plugins/FloatingEnhanceButton/index.d.ts +4 -3
- package/dist/plugins/FloatingLinkEditorPlugin/index.d.ts +6 -5
- package/dist/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +26 -25
- package/dist/plugins/GrammarCheckPlugin.d.ts +2 -1
- package/dist/plugins/HtmlCodeViewPlugin/index.d.ts +2 -2
- package/dist/plugins/HtmlImportPlugin.d.ts +5 -5
- package/dist/plugins/HtmlSyncPlugin.d.ts +3 -3
- package/dist/plugins/ImagePlugin.d.ts +7 -6
- package/dist/plugins/LinkPlugin/index.d.ts +6 -5
- package/dist/plugins/LinkPreviewPlugin/index.d.ts +2 -2
- package/dist/plugins/LocalStoragePlugin.d.ts +7 -6
- package/dist/plugins/MentionsPlugin/index.d.ts +7 -6
- package/dist/plugins/NotePanelPlugin.d.ts +7 -6
- package/dist/plugins/RichTextPastePlugin/index.d.ts +15 -15
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasDialog.d.ts +6 -5
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasPlugin.d.ts +9 -9
- package/dist/plugins/SignatureCanvasPlugin/index.d.ts +2 -2
- package/dist/plugins/SlashCommandPlugin/index.d.ts +2 -2
- package/dist/plugins/TableActionMenuPlugin/index.d.ts +6 -5
- package/dist/plugins/TableCellResizer/index.d.ts +2 -1
- package/dist/plugins/TableHoverActionsPlugin/index.d.ts +4 -4
- package/dist/plugins/TablePlugin.d.ts +3 -2
- package/dist/plugins/Tableimageautoresizeplugin.d.ts +1 -1
- package/dist/plugins/TextEnhancePlugin.d.ts +6 -6
- package/dist/plugins/TreeViewPlugin.d.ts +3 -2
- package/dist/plugins/UsageTrackingPlugin.d.ts +15 -15
- package/dist/plugins/VoiceTranscriptPlugin.d.ts +21 -21
- package/dist/plugins/WordCountPlugin.d.ts +3 -2
- package/dist/{postcss-f084f74d.js → postcss-c2592f3f.js} +1357 -1378
- package/dist/postcss-c2592f3f.js.map +1 -0
- package/dist/standalone-bcc7f37a.js +2649 -0
- package/dist/standalone-bcc7f37a.js.map +1 -0
- package/dist/styles/PlaygroundEditorTheme.d.ts +3 -2
- package/dist/types.d.ts +148 -147
- package/dist/typescript-48c10f50.js +13601 -0
- package/dist/typescript-48c10f50.js.map +1 -0
- package/dist/ui/ColorPicker.d.ts +14 -13
- package/dist/ui/Icons.d.ts +47 -47
- package/dist/ui/TextInput.d.ts +11 -10
- package/dist/utils/dateFormats.d.ts +33 -33
- package/dist/utils/debounce.d.ts +6 -5
- package/dist/utils/editorStyleConverter.d.ts +17 -16
- package/dist/utils/export.d.ts +2 -1
- package/dist/utils/getDOMRangeRect.d.ts +13 -13
- package/dist/utils/getSelectedNode.d.ts +3 -2
- package/dist/utils/helper.d.ts +3 -3
- package/dist/utils/index.d.ts +4 -3
- package/dist/utils/invarient.d.ts +1 -1
- package/dist/utils/setFloatingElemPosition.d.ts +8 -8
- package/dist/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -1
- package/dist/utils/url.d.ts +9 -9
- package/package.json +127 -127
- package/dist/babel-d3085146.js.map +0 -1
- package/dist/estree-164983f6.js.map +0 -1
- package/dist/html-5586dbf6.js.map +0 -1
- package/dist/html2pdf.bundle-0b180070.js.map +0 -1
- package/dist/html2pdf.bundle.min-08b31c1f.js.map +0 -1
- package/dist/index-6360d552.js.map +0 -1
- package/dist/index-68135c09.js.map +0 -1
- package/dist/index-8bcb5b47.js.map +0 -1
- package/dist/markdown-d513479b.js.map +0 -1
- package/dist/postcss-f084f74d.js.map +0 -1
- package/dist/standalone-5a8c6b7e.js +0 -2518
- package/dist/standalone-5a8c6b7e.js.map +0 -1
- package/dist/typescript-b1005db4.js +0 -13705
- package/dist/typescript-b1005db4.js.map +0 -1
|
@@ -15,7 +15,7 @@ import { useLexicalNodeSelection } from "@lexical/react/useLexicalNodeSelection"
|
|
|
15
15
|
import { calculateZoomLevel, mergeRegister } from "@lexical/utils";
|
|
16
16
|
import { RootNode, TextNode, LineBreakNode, ParagraphNode, $getSelection, $isNodeSelection, $setSelection, $isRangeSelection, SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_LOW, CLICK_COMMAND, DRAGSTART_COMMAND, KEY_DELETE_COMMAND, KEY_BACKSPACE_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, createCommand, $getNodeByKey } from "lexical";
|
|
17
17
|
import { useRef, useState, useCallback, useEffect, Suspense } from "react";
|
|
18
|
-
import { L as LocalStoragePlugin, i as initialConfig, b as Dialog, d as DialogContent, e as DialogHeader, f as DialogTitle, h as DialogDescription, j as DialogFooter, B as Button, k as $isImageNode, S as Sparkles, E as ExternalLink, T as Trash2, t as toast, A as AiJsonResponse } from "./index-
|
|
18
|
+
import { L as LocalStoragePlugin, i as initialConfig, b as Dialog, d as DialogContent, e as DialogHeader, f as DialogTitle, h as DialogDescription, j as DialogFooter, B as Button, k as $isImageNode, S as Sparkles, E as ExternalLink, T as Trash2, t as toast, A as AiJsonResponse } from "./index-b9ad2974.js";
|
|
19
19
|
import "axios";
|
|
20
20
|
import "@emotion/styled";
|
|
21
21
|
import "@lexical/html";
|
|
@@ -862,7 +862,7 @@ function ImageComponent({
|
|
|
862
862
|
}
|
|
863
863
|
),
|
|
864
864
|
isSelected && $isNodeSelection(selection) && !isLoadError && /* @__PURE__ */ jsxs("div", { className: "cteditor-absolute cteditor-top-2 cteditor-right-2 cteditor-flex cteditor-gap-2", style: { zIndex: 10 }, children: [
|
|
865
|
-
/* @__PURE__ */ jsx(
|
|
865
|
+
originalPrompt && /* @__PURE__ */ jsx(
|
|
866
866
|
"button",
|
|
867
867
|
{
|
|
868
868
|
onClick: (e) => {
|
|
@@ -902,7 +902,7 @@ function ImageComponent({
|
|
|
902
902
|
}
|
|
903
903
|
)
|
|
904
904
|
] }),
|
|
905
|
-
showRefineInput && isSelected && !isLoadError && /* @__PURE__ */ jsx(
|
|
905
|
+
showRefineInput && isSelected && !isLoadError && originalPrompt && /* @__PURE__ */ jsx(
|
|
906
906
|
"div",
|
|
907
907
|
{
|
|
908
908
|
className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-xl cteditor-border cteditor-border-border cteditor-p-3",
|
|
@@ -1040,4 +1040,4 @@ export {
|
|
|
1040
1040
|
RIGHT_CLICK_IMAGE_COMMAND,
|
|
1041
1041
|
ImageComponent as default
|
|
1042
1042
|
};
|
|
1043
|
-
//# sourceMappingURL=index-
|
|
1043
|
+
//# sourceMappingURL=index-cea164e5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-cea164e5.js","sources":["../src/components/SignatureCaption/index.tsx","../src/components/ImageView/ImageResizer.tsx","../src/components/ImageComparisonDialog/index.tsx","../src/components/ImageView/index.tsx"],"sourcesContent":["/**\r\n * SignatureCaption Component\r\n * A premium styled caption component specifically for signatures\r\n */\r\n\r\nimport \"./signature-caption.css\";\r\n\r\nimport { CodeNode } from \"@lexical/code\";\r\nimport { LinkNode } from \"@lexical/link\";\r\nimport { ContentEditable } from \"@lexical/react/LexicalContentEditable\";\r\nimport { LexicalErrorBoundary } from \"@lexical/react/LexicalErrorBoundary\";\r\nimport { HistoryPlugin } from \"@lexical/react/LexicalHistoryPlugin\";\r\nimport { LexicalNestedComposer } from \"@lexical/react/LexicalNestedComposer\";\r\nimport { OnChangePlugin } from \"@lexical/react/LexicalOnChangePlugin\";\r\nimport { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\r\nimport type { LexicalEditor } from \"lexical\";\r\nimport { LineBreakNode, ParagraphNode, RootNode, TextNode } from \"lexical\";\r\nimport { initialConfig } from \"src/constants\";\r\nimport LocalStoragePlugin from \"src/plugins/LocalStoragePlugin\";\r\n\r\ninterface SignatureCaptionProps {\r\n caption: LexicalEditor;\r\n}\r\n\r\nexport default function SignatureCaption({\r\n caption,\r\n}: SignatureCaptionProps): JSX.Element {\r\n return (\r\n <div className=\"signature-caption-container\">\r\n <LexicalNestedComposer\r\n initialEditor={caption}\r\n initialNodes={[\r\n RootNode,\r\n TextNode,\r\n LineBreakNode,\r\n ParagraphNode,\r\n LinkNode,\r\n CodeNode,\r\n ]}\r\n >\r\n <RichTextPlugin\r\n contentEditable={\r\n <ContentEditable\r\n aria-placeholder=\"Enter signature name...\"\r\n placeholder={\r\n <div style={{\r\n position: 'absolute',\r\n top: '4px',\r\n left: '8px',\r\n right: '8px',\r\n textAlign: 'center',\r\n pointerEvents: 'none',\r\n color: 'hsla(var(--cteditorf47ac10b-foreground) / 0.4)',\r\n fontStyle: 'italic'\r\n }}>\r\n Enter signature name...\r\n </div>\r\n }\r\n className=\"signature-caption-editable\"\r\n />\r\n }\r\n ErrorBoundary={LexicalErrorBoundary}\r\n />\r\n\r\n <OnChangePlugin onChange={() => {\r\n // Placeholder for future change handling\r\n }} />\r\n <HistoryPlugin />\r\n <LocalStoragePlugin namespace={initialConfig.namespace} />\r\n </LexicalNestedComposer>\r\n </div>\r\n );\r\n}\r\n","/**\r\n * Copyright (c) Meta Platforms, Inc. and affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n *\r\n */\r\n\r\nimport \"./image-caption-styles.css\";\r\n\r\nimport { calculateZoomLevel } from \"@lexical/utils\";\r\nimport type { LexicalEditor } from \"lexical\";\r\nimport * as React from \"react\";\r\nimport { useRef } from \"react\";\r\n\r\nfunction clamp(value: number, min: number, max: number) {\r\n return Math.min(Math.max(value, min), max);\r\n}\r\n\r\nconst Direction = {\r\n east: 1 << 0,\r\n north: 1 << 3,\r\n south: 1 << 1,\r\n west: 1 << 2,\r\n};\r\n\r\nexport default function ImageResizer({\r\n onResizeStart,\r\n onResizeEnd,\r\n buttonRef,\r\n imageRef,\r\n maxWidth,\r\n editor,\r\n showCaption,\r\n setShowCaption,\r\n captionsEnabled,\r\n}: {\r\n editor: LexicalEditor;\r\n buttonRef: { current: null | HTMLButtonElement };\r\n imageRef: { current: null | HTMLElement };\r\n maxWidth?: number;\r\n onResizeEnd: (width: \"inherit\" | number, height: \"inherit\" | number) => void;\r\n onResizeStart: () => void;\r\n setShowCaption: (show: boolean) => void;\r\n showCaption: boolean;\r\n captionsEnabled: boolean;\r\n}): JSX.Element {\r\n const controlWrapperRef = useRef<HTMLDivElement>(null);\r\n const userSelect = useRef({\r\n priority: \"\",\r\n value: \"default\",\r\n });\r\n const positioningRef = useRef<{\r\n currentHeight: \"inherit\" | number;\r\n currentWidth: \"inherit\" | number;\r\n direction: number;\r\n isResizing: boolean;\r\n ratio: number;\r\n startHeight: number;\r\n startWidth: number;\r\n startX: number;\r\n startY: number;\r\n }>({\r\n currentHeight: 0,\r\n currentWidth: 0,\r\n direction: 0,\r\n isResizing: false,\r\n ratio: 0,\r\n startHeight: 0,\r\n startWidth: 0,\r\n startX: 0,\r\n startY: 0,\r\n });\r\n const editorRootElement = editor.getRootElement();\r\n\r\n // Allow enlarging up to the editor container width (ignore any fixed maxWidth cap)\r\n const maxWidthContainer =\r\n editorRootElement !== null\r\n ? editorRootElement.getBoundingClientRect().width - 20\r\n : 100;\r\n const maxHeightContainer =\r\n editorRootElement !== null\r\n ? editorRootElement.getBoundingClientRect().height - 20\r\n : 100;\r\n\r\n const minWidth = 100;\r\n const minHeight = 100;\r\n\r\n /**\r\n * Sets the cursor style to indicate the resizing direction.\r\n * This function updates the cursor for the editor and document body\r\n * based on the resizing direction.\r\n */\r\n const setStartCursor = (direction: number) => {\r\n // Determine if the resizing is happening horizontally (east or west)\r\n const ew = direction === Direction.east || direction === Direction.west;\r\n // Determine if the resizing is happening vertically (north or south)\r\n const ns = direction === Direction.north || direction === Direction.south;\r\n // Determine if the resizing is diagonal (north-west, south-east, etc.)\r\n const nwse =\r\n (direction & Direction.north && direction & Direction.west) ||\r\n (direction & Direction.south && direction & Direction.east);\r\n\r\n // Set the appropriate cursor style based on the detected direction\r\n const cursorDir = ew ? \"ew\" : ns ? \"ns\" : nwse ? \"nwse\" : \"nesw\";\r\n\r\n // Apply the cursor style to the editor root element if it exists\r\n if (editorRootElement !== null) {\r\n editorRootElement.style.setProperty(\r\n \"cursor\",\r\n `${cursorDir}-resize`,\r\n \"important\"\r\n );\r\n }\r\n\r\n // Apply the cursor style to the document body\r\n if (document.body !== null) {\r\n document.body.style.setProperty(\r\n \"cursor\",\r\n `${cursorDir}-resize`,\r\n \"important\"\r\n );\r\n\r\n // Store the current user selection settings before modifying them\r\n userSelect.current.value = document.body.style.getPropertyValue(\r\n \"-webkit-user-select\"\r\n );\r\n userSelect.current.priority = document.body.style.getPropertyPriority(\r\n \"-webkit-user-select\"\r\n );\r\n\r\n // Disable text selection during resizing to prevent unwanted text selection\r\n document.body.style.setProperty(\r\n \"-webkit-user-select\",\r\n `none`,\r\n \"important\"\r\n );\r\n }\r\n };\r\n\r\n /**\r\n * Resets the cursor style when resizing ends.\r\n */\r\n\r\n const setEndCursor = () => {\r\n if (editorRootElement !== null) {\r\n editorRootElement.style.setProperty(\"cursor\", \"text\");\r\n }\r\n if (document.body !== null) {\r\n document.body.style.setProperty(\"cursor\", \"default\");\r\n document.body.style.setProperty(\r\n \"-webkit-user-select\",\r\n userSelect.current.value,\r\n userSelect.current.priority\r\n );\r\n }\r\n };\r\n\r\n /**\r\n * Handles pointer down event when resizing starts.\r\n */\r\n const handlePointerDown = (\r\n event: React.PointerEvent<HTMLDivElement>,\r\n direction: number\r\n ) => {\r\n if (!editor.isEditable()) {\r\n return;\r\n }\r\n const image = imageRef.current;\r\n const controlWrapper = controlWrapperRef.current;\r\n\r\n // Ensure both the image and control wrapper exist before proceeding\r\n if (image !== null && controlWrapper !== null) {\r\n event.preventDefault();\r\n\r\n // Get the image's current width and height from its bounding rectangle\r\n const { width, height } = image.getBoundingClientRect();\r\n // Calculate the zoom level to adjust calculations accordingly\r\n const zoom = calculateZoomLevel(image);\r\n // Retrieve the positioning reference object to store resize state\r\n const positioning = positioningRef.current;\r\n\r\n // Store the initial dimensions of the image\r\n positioning.startWidth = width;\r\n positioning.startHeight = height;\r\n // Store the aspect ratio to maintain proportions when resizing\r\n positioning.ratio = width / height;\r\n // Set the current width and height values for tracking changes\r\n positioning.currentWidth = width;\r\n positioning.currentHeight = height;\r\n // Store the initial pointer position, adjusted for zoom level\r\n positioning.startX = event.clientX / zoom;\r\n positioning.startY = event.clientY / zoom;\r\n // Mark the resizing state as active\r\n positioning.isResizing = true;\r\n // Store the resize direction (north, south, east, west, or combinations)\r\n positioning.direction = direction;\r\n\r\n // Set the cursor style to indicate resizing in the correct direction\r\n setStartCursor(direction);\r\n onResizeStart();\r\n\r\n controlWrapper.classList.add(\"image-control-wrapper--resizing\");\r\n image.style.height = `${height}px`;\r\n image.style.width = `${width}px`;\r\n document.addEventListener(\"pointermove\", handlePointerMove);\r\n document.addEventListener(\"pointerup\", handlePointerUp);\r\n }\r\n };\r\n\r\n /**\r\n * Handles pointer move event when resizing the image dynamically.\r\n */\r\n const handlePointerMove = (event: PointerEvent) => {\r\n const image = imageRef.current;\r\n const positioning = positioningRef.current;\r\n\r\n // Check if the resize direction includes horizontal movement (east or west)\r\n const isHorizontal =\r\n positioning.direction & (Direction.east | Direction.west);\r\n // Check if the resize direction includes vertical movement (north or south)\r\n const isVertical =\r\n positioning.direction & (Direction.south | Direction.north);\r\n\r\n if (image !== null && positioning.isResizing) {\r\n // Get the zoom level of the image to ensure accurate calculations\r\n const zoom = calculateZoomLevel(image);\r\n\r\n if (isHorizontal && isVertical) {\r\n // Calculate the difference in X position relative to the starting point\r\n let diff = Math.floor(positioning.startX - event.clientX / zoom);\r\n // Reverse the difference if resizing from the east to ensure correct calculations\r\n diff = positioning.direction & Direction.east ? -diff : diff;\r\n\r\n // Calculate the new width, ensuring it stays within allowed min and max limits\r\n const width = clamp(\r\n positioning.startWidth + diff,\r\n minWidth,\r\n maxWidthContainer\r\n );\r\n // Maintain the aspect ratio by adjusting height proportionally\r\n const height = width / positioning.ratio;\r\n // Apply the new width and height to the image\r\n image.style.width = `${width}px`;\r\n image.style.height = `${height}px`;\r\n // Update stored dimensions for ongoing tracking\r\n positioning.currentHeight = height;\r\n positioning.currentWidth = width;\r\n } else if (isVertical) {\r\n // Calculate the difference in Y position relative to the starting point\r\n let diff = Math.floor(positioning.startY - event.clientY / zoom);\r\n // Reverse the difference if resizing from the south to maintain correct direction\r\n diff = positioning.direction & Direction.south ? -diff : diff;\r\n\r\n // Calculate the new height, ensuring it stays within allowed min and max limits\r\n const height = clamp(\r\n positioning.startHeight + diff,\r\n minHeight,\r\n maxHeightContainer\r\n );\r\n\r\n // Apply the new height to the image\r\n image.style.height = `${height}px`;\r\n // Update stored height for ongoing tracking\r\n positioning.currentHeight = height;\r\n } else {\r\n // Calculate the difference in X position relative to the starting point\r\n let diff = Math.floor(positioning.startX - event.clientX / zoom);\r\n // Reverse the difference if resizing from the east to maintain correct direction\r\n diff = positioning.direction & Direction.east ? -diff : diff;\r\n\r\n // Calculate the new width, ensuring it stays within allowed min and max limits\r\n const width = clamp(\r\n positioning.startWidth + diff,\r\n minWidth,\r\n maxWidthContainer\r\n );\r\n\r\n // Apply the new width to the image\r\n image.style.width = `${width}px`;\r\n // Update stored width for ongoing tracking\r\n positioning.currentWidth = width;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Handles the pointer up event when resizing ends.\r\n */\r\n const handlePointerUp = () => {\r\n const image = imageRef.current;\r\n const positioning = positioningRef.current;\r\n const controlWrapper = controlWrapperRef.current;\r\n\r\n // Ensure the image, control wrapper exist, and resizing is active before proceeding\r\n if (image !== null && controlWrapper !== null && positioning.isResizing) {\r\n // Capture the final width and height of the resized image\r\n const width = positioning.currentWidth;\r\n const height = positioning.currentHeight;\r\n\r\n // Reset positioning values after resizing is complete\r\n positioning.startWidth = 0;\r\n positioning.startHeight = 0;\r\n positioning.ratio = 0;\r\n positioning.startX = 0;\r\n positioning.startY = 0;\r\n positioning.currentWidth = 0;\r\n positioning.currentHeight = 0;\r\n positioning.isResizing = false; // Mark resizing as finished\r\n\r\n // Remove the resizing class from the control wrapper\r\n controlWrapper.classList.remove(\"image-control-wrapper--resizing\");\r\n\r\n // Restore default cursor appearance\r\n setEndCursor();\r\n // Trigger the resize end callback with the final dimensions\r\n onResizeEnd(width, height);\r\n\r\n // Remove event listeners for pointer movement and release to stop tracking\r\n document.removeEventListener(\"pointermove\", handlePointerMove);\r\n document.removeEventListener(\"pointerup\", handlePointerUp);\r\n }\r\n };\r\n\r\n return (\r\n <div ref={controlWrapperRef}>\r\n {!showCaption && captionsEnabled && (\r\n <button\r\n className=\"image-caption-button\"\r\n ref={buttonRef}\r\n onClick={() => {\r\n setShowCaption(!showCaption);\r\n }}\r\n >\r\n Add Caption\r\n </button>\r\n )}\r\n <div\r\n className=\"image-resizer image-resizer-n\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.north);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-ne\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.north | Direction.east);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-e\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.east);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-se\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.south | Direction.east);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-s\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.south);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-sw\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.south | Direction.west);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-w\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.west);\r\n }}\r\n />\r\n <div\r\n className=\"image-resizer image-resizer-nw\"\r\n onPointerDown={(event) => {\r\n handlePointerDown(event, Direction.north | Direction.west);\r\n }}\r\n />\r\n </div>\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { Button } from \"../ui/button\";\r\nimport {\r\n Dialog,\r\n DialogContent,\r\n DialogDescription,\r\n DialogFooter,\r\n DialogHeader,\r\n DialogTitle,\r\n} from \"../ui/dialog\";\r\n\r\ninterface ImageComparisonDialogProps {\r\n open: boolean;\r\n onOpenChange: (open: boolean) => void;\r\n oldImageUrl: string;\r\n newImageUrl: string;\r\n onReplace: () => void;\r\n onCancel: () => void;\r\n}\r\n\r\nexport const ImageComparisonDialog: React.FC<ImageComparisonDialogProps> = ({\r\n open,\r\n onOpenChange,\r\n oldImageUrl,\r\n newImageUrl,\r\n onReplace,\r\n onCancel,\r\n}) => {\r\n return (\r\n <Dialog open={open} onOpenChange={onOpenChange}>\r\n <DialogContent className=\"sm:max-w-[800px] max-h-[90vh] overflow-y-auto\">\r\n <DialogHeader>\r\n <DialogTitle className=\"flex items-center gap-2 text-xl\">\r\n <span className=\"text-2xl\">🔄</span>\r\n Compare Images\r\n </DialogTitle>\r\n <DialogDescription className=\"text-sm pt-1\">\r\n Choose whether to replace the original image with the refined version.\r\n </DialogDescription>\r\n </DialogHeader>\r\n\r\n <div className=\"space-y-4 py-4\">\r\n <div className=\"grid grid-cols-2 gap-4\">\r\n\r\n {/* New Image */}\r\n <div className=\"space-y-2\">\r\n <div className=\"flex items-center justify-between\">\r\n <span className=\"text-sm font-semibold text-gray-700 dark:text-gray-300\">\r\n Refined Image\r\n </span>\r\n <span className=\"text-xs px-2 py-1 rounded-full bg-blue-100 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400\">\r\n New\r\n </span>\r\n </div>\r\n <div className=\"relative aspect-square rounded-lg overflow-hidden bg-gray-100 dark:bg-gray-800 border-2 border-blue-500 dark:border-blue-600\">\r\n <img\r\n src={newImageUrl}\r\n alt=\"Refined\"\r\n className=\"w-full h-full object-contain\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Info */}\r\n <div className=\"p-3 rounded-lg bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800\">\r\n <p className=\"text-sm text-blue-800 dark:text-blue-200\">\r\n <span className=\"font-semibold\">Note:</span> Clicking \"Replace\" will update the image in your document.\r\n This action cannot be undone.\r\n </p>\r\n </div>\r\n </div>\r\n\r\n <DialogFooter className=\"gap-2\">\r\n <Button\r\n variant=\"outline\"\r\n onClick={onCancel}\r\n >\r\n Keep Original\r\n </Button>\r\n <Button\r\n onClick={onReplace}\r\n className=\"bg-blue-500 hover:bg-blue-600 text-white\"\r\n >\r\n <span className=\"mr-2\">✓</span>\r\n Replace Image\r\n </Button>\r\n </DialogFooter>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n};\r\n\r\n","/**\r\n * Copyright (c) Meta Platforms, Inc. and affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n *\r\n */\r\n\r\nimport \"./image-caption-styles.css\";\r\n\r\nimport { CodeNode } from \"@lexical/code\";\r\nimport { LinkNode } from \"@lexical/link\";\r\nimport { AutoFocusPlugin } from \"@lexical/react/LexicalAutoFocusPlugin\";\r\nimport { useCollaborationContext } from \"@lexical/react/LexicalCollaborationContext\";\r\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\r\nimport { ContentEditable } from \"@lexical/react/LexicalContentEditable\";\r\nimport { LexicalErrorBoundary } from \"@lexical/react/LexicalErrorBoundary\";\r\nimport { HistoryPlugin } from \"@lexical/react/LexicalHistoryPlugin\";\r\nimport { LexicalNestedComposer } from \"@lexical/react/LexicalNestedComposer\";\r\nimport { OnChangePlugin } from \"@lexical/react/LexicalOnChangePlugin\";\r\n// import './ImageNode.css';\r\nimport { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\r\nimport { useLexicalEditable } from \"@lexical/react/useLexicalEditable\";\r\nimport { useLexicalNodeSelection } from \"@lexical/react/useLexicalNodeSelection\";\r\nimport { mergeRegister } from \"@lexical/utils\";\r\nimport type {\r\n BaseSelection,\r\n LexicalCommand,\r\n LexicalEditor,\r\n NodeKey,\r\n} from \"lexical\";\r\nimport {\r\n $getNodeByKey,\r\n $getSelection,\r\n $isNodeSelection,\r\n $isRangeSelection,\r\n $setSelection,\r\n CLICK_COMMAND,\r\n COMMAND_PRIORITY_LOW,\r\n createCommand,\r\n DRAGSTART_COMMAND,\r\n KEY_BACKSPACE_COMMAND,\r\n KEY_DELETE_COMMAND,\r\n KEY_ENTER_COMMAND,\r\n KEY_ESCAPE_COMMAND,\r\n LineBreakNode,\r\n ParagraphNode,\r\n RootNode,\r\n SELECTION_CHANGE_COMMAND,\r\n TextNode,\r\n} from \"lexical\";\r\nimport { ExternalLink, Trash2, Sparkles } from \"lucide-react\";\r\nimport * as React from \"react\";\r\nimport { Suspense, useCallback, useEffect, useRef, useState } from \"react\";\r\n// import brokenImage from '../images/image-broken.svg';\r\nimport { toast } from \"sonner\";\r\nimport { initialConfig } from \"src/constants\";\r\nimport { $isImageNode, ImagePosition } from \"src/nodes/ImageNode\";\r\nimport LocalStoragePlugin from \"src/plugins/LocalStoragePlugin\";\r\n\r\nimport SignatureCaption from \"../SignatureCaption\";\r\nimport ImageResizer from \"./ImageResizer\";\r\nimport { AiJsonResponse } from \"../../api/ai\";\r\nimport { ImageComparisonDialog } from \"../ImageComparisonDialog\";\r\n\r\nconst imageCache = new Set();\r\n\r\nexport const RIGHT_CLICK_IMAGE_COMMAND: LexicalCommand<MouseEvent> =\r\n createCommand(\"RIGHT_CLICK_IMAGE_COMMAND\");\r\n\r\nfunction useSuspenseImage(src: string) {\r\n if (!imageCache.has(src)) {\r\n throw new Promise((resolve) => {\r\n const img = new Image();\r\n img.src = src;\r\n img.onload = () => {\r\n imageCache.add(src);\r\n resolve(null);\r\n };\r\n img.onerror = () => {\r\n imageCache.add(src);\r\n };\r\n });\r\n }\r\n}\r\n\r\nfunction LazyImage({\r\n altText,\r\n className,\r\n imageRef,\r\n src,\r\n width,\r\n height,\r\n maxWidth,\r\n onError,\r\n}: {\r\n altText: string;\r\n className: string | null;\r\n height: \"inherit\" | number;\r\n imageRef: { current: null | HTMLImageElement };\r\n maxWidth: number;\r\n src: string;\r\n width: \"inherit\" | number;\r\n onError: () => void;\r\n}): JSX.Element {\r\n useSuspenseImage(src);\r\n const hasExplicitSize = typeof width === 'number' && typeof height === 'number';\r\n const computedWidth = typeof width === 'number' ? width : 'auto';\r\n const computedHeight = typeof height === 'number' ? height : 'auto';\r\n\r\n return (\r\n <img\r\n className={className || undefined}\r\n src={src}\r\n alt={altText}\r\n ref={imageRef}\r\n style={\r\n hasExplicitSize\r\n ? {\r\n // User has set a numeric size or original dimensions are provided\r\n width: computedWidth,\r\n height: computedHeight,\r\n maxWidth: '100%',\r\n }\r\n : {\r\n // No dimensions specified - use original image size\r\n maxWidth: '100%',\r\n height: 'auto',\r\n }\r\n }\r\n onError={onError}\r\n draggable=\"false\"\r\n />\r\n );\r\n}\r\n\r\n// if the image is broken ; we are showing this component\r\nfunction BrokenImage(): JSX.Element {\r\n return (\r\n <img\r\n src={\"\"} //TODO: NEED TO ADD BROKEN IMAGE\r\n style={{\r\n height: 200,\r\n opacity: 0.2,\r\n width: 200,\r\n }}\r\n draggable=\"false\"\r\n />\r\n );\r\n}\r\n\r\nexport default function ImageComponent({\r\n src,\r\n altText,\r\n nodeKey,\r\n width,\r\n height,\r\n maxWidth,\r\n resizable,\r\n showCaption,\r\n caption,\r\n captionsEnabled,\r\n originalPrompt,\r\n position = \"none\",\r\n}: {\r\n altText: string;\r\n caption: LexicalEditor;\r\n height: \"inherit\" | number;\r\n maxWidth: number;\r\n nodeKey: NodeKey;\r\n resizable: boolean;\r\n showCaption: boolean;\r\n src: string;\r\n width: \"inherit\" | number;\r\n captionsEnabled: boolean;\r\n originalPrompt?: string;\r\n position?: ImagePosition;\r\n}): JSX.Element {\r\n const imageRef = useRef<null | HTMLImageElement>(null);\r\n const buttonRef = useRef<HTMLButtonElement | null>(null);\r\n const [isSelected, setSelected, clearSelection] =\r\n useLexicalNodeSelection(nodeKey);\r\n const [isResizing, setIsResizing] = useState<boolean>(false);\r\n const { isCollabActive } = useCollaborationContext();\r\n const [editor] = useLexicalComposerContext();\r\n const [selection, setSelection] = useState<BaseSelection | null>(null);\r\n const activeEditorRef = useRef<LexicalEditor | null>(null);\r\n const [isLoadError, setIsLoadError] = useState<boolean>(false);\r\n const isEditable = useLexicalEditable();\r\n const [showRefineInput, setShowRefineInput] = useState<boolean>(false);\r\n const [refinementPrompt, setRefinementPrompt] = useState<string>(\"\");\r\n const [isRefining, setIsRefining] = useState<boolean>(false);\r\n const [showComparisonDialog, setShowComparisonDialog] = useState<boolean>(false);\r\n const [newImageUrl, setNewImageUrl] = useState<string>(\"\");\r\n const [newCombinedPrompt, setNewCombinedPrompt] = useState<string>(\"\");\r\n\r\n /**\r\n * Deletes the image node when the delete key is pressed.\r\n */\r\n const $onDelete = useCallback(\r\n (payload: KeyboardEvent) => {\r\n const deleteSelection = $getSelection();\r\n if (isSelected && $isNodeSelection(deleteSelection)) {\r\n const event: KeyboardEvent = payload;\r\n event.preventDefault();\r\n editor.update(() => {\r\n deleteSelection.getNodes().forEach((node) => {\r\n if ($isImageNode(node)) {\r\n node.remove();\r\n }\r\n });\r\n });\r\n }\r\n return false;\r\n },\r\n [editor, isSelected]\r\n );\r\n\r\n /**\r\n * Handles enter key to move focus into the caption editor.\r\n */\r\n const $onEnter = useCallback(\r\n (event: KeyboardEvent) => {\r\n const latestSelection = $getSelection();\r\n const buttonElem = buttonRef.current;\r\n if (\r\n isSelected &&\r\n $isNodeSelection(latestSelection) &&\r\n latestSelection.getNodes().length === 1\r\n ) {\r\n if (showCaption) {\r\n // Move focus into nested editor\r\n $setSelection(null);\r\n event.preventDefault();\r\n caption.focus();\r\n return true;\r\n } else if (\r\n buttonElem !== null &&\r\n buttonElem !== document.activeElement\r\n ) {\r\n event.preventDefault();\r\n buttonElem.focus();\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n [caption, isSelected, showCaption]\r\n );\r\n\r\n /**\r\n * Handles escape key to reset selection.\r\n */\r\n const $onEscape = useCallback(\r\n (event: KeyboardEvent) => {\r\n if (\r\n activeEditorRef.current === caption ||\r\n buttonRef.current === event.target\r\n ) {\r\n $setSelection(null);\r\n editor.update(() => {\r\n setSelected(true);\r\n const parentRootElement = editor.getRootElement();\r\n if (parentRootElement !== null) {\r\n parentRootElement.focus();\r\n }\r\n });\r\n return true;\r\n }\r\n return false;\r\n },\r\n [caption, editor, setSelected]\r\n );\r\n\r\n const onClick = useCallback(\r\n (payload: MouseEvent) => {\r\n const event = payload;\r\n\r\n if (isResizing) {\r\n return true;\r\n }\r\n if (event.target === imageRef.current) {\r\n if (event.shiftKey) {\r\n setSelected(!isSelected);\r\n } else {\r\n clearSelection();\r\n setSelected(true);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n [isResizing, isSelected, setSelected, clearSelection]\r\n );\r\n\r\n const onRightClick = useCallback(\r\n (event: MouseEvent): void => {\r\n editor.getEditorState().read(() => {\r\n const latestSelection = $getSelection();\r\n const domElement = event.target as HTMLElement;\r\n if (\r\n domElement.tagName === \"IMG\" &&\r\n $isRangeSelection(latestSelection) &&\r\n latestSelection.getNodes().length === 1\r\n ) {\r\n editor.dispatchCommand(\r\n RIGHT_CLICK_IMAGE_COMMAND,\r\n event as MouseEvent\r\n );\r\n }\r\n });\r\n },\r\n [editor]\r\n );\r\n\r\n useEffect(() => {\r\n let isMounted = true;\r\n const rootElement = editor.getRootElement();\r\n const unregister = mergeRegister(\r\n editor.registerUpdateListener(({ editorState }) => {\r\n if (isMounted) {\r\n setSelection(editorState.read(() => $getSelection()));\r\n }\r\n }),\r\n editor.registerCommand(\r\n SELECTION_CHANGE_COMMAND,\r\n (_, activeEditor) => {\r\n activeEditorRef.current = activeEditor;\r\n return false;\r\n },\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand<MouseEvent>(\r\n CLICK_COMMAND,\r\n onClick,\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand<MouseEvent>(\r\n RIGHT_CLICK_IMAGE_COMMAND,\r\n onClick,\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand(\r\n DRAGSTART_COMMAND,\r\n (event) => {\r\n if (event.target === imageRef.current) {\r\n // Temporary workaround for FF to behave like other browsers.\r\n // Ideally, this handles drag & drop too (and all browsers).\r\n event.preventDefault();\r\n return true;\r\n }\r\n return false;\r\n },\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand(\r\n KEY_DELETE_COMMAND,\r\n $onDelete,\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand(\r\n KEY_BACKSPACE_COMMAND,\r\n $onDelete,\r\n COMMAND_PRIORITY_LOW\r\n ),\r\n editor.registerCommand(KEY_ENTER_COMMAND, $onEnter, COMMAND_PRIORITY_LOW),\r\n editor.registerCommand(\r\n KEY_ESCAPE_COMMAND,\r\n $onEscape,\r\n COMMAND_PRIORITY_LOW\r\n )\r\n );\r\n\r\n rootElement?.addEventListener(\"contextmenu\", onRightClick);\r\n\r\n return () => {\r\n isMounted = false;\r\n unregister();\r\n rootElement?.removeEventListener(\"contextmenu\", onRightClick);\r\n };\r\n }, [\r\n clearSelection,\r\n editor,\r\n isResizing,\r\n isSelected,\r\n nodeKey,\r\n $onDelete,\r\n $onEnter,\r\n $onEscape,\r\n onClick,\r\n onRightClick,\r\n setSelected,\r\n ]);\r\n\r\n const setShowCaption = () => {\r\n editor.update(() => {\r\n const node = $getNodeByKey(nodeKey);\r\n if ($isImageNode(node)) {\r\n node.setShowCaption(true);\r\n }\r\n });\r\n };\r\n\r\n const onResizeEnd = (\r\n nextWidth: \"inherit\" | number,\r\n nextHeight: \"inherit\" | number\r\n ) => {\r\n // Delay hiding the resize bars for click case\r\n setTimeout(() => {\r\n setIsResizing(false);\r\n }, 200);\r\n\r\n editor.update(() => {\r\n const node = $getNodeByKey(nodeKey);\r\n if ($isImageNode(node)) {\r\n node.setWidthAndHeight(nextWidth, nextHeight);\r\n }\r\n });\r\n };\r\n\r\n const onResizeStart = () => {\r\n setIsResizing(true);\r\n };\r\n\r\n const handleOpenInNewTab = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n // Check if it's a data URL (base64)\r\n if (src.startsWith('data:')) {\r\n // For data URLs, we need to open them in a new tab with the image displayed\r\n const newWindow = window.open('', '_blank');\r\n if (newWindow) {\r\n newWindow.document.write(`\r\n <!DOCTYPE html>\r\n <html>\r\n <head>\r\n <title>${altText || 'Image'}</title>\r\n <style>\r\n body {\r\n margin: 0;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n min-height: 100vh;\r\n background-color: #1a1a1a;\r\n }\r\n img {\r\n max-width: 100%;\r\n max-height: 100vh;\r\n object-fit: contain;\r\n }\r\n </style>\r\n </head>\r\n <body>\r\n <img src=\"${src}\" alt=\"${altText || 'Image'}\" />\r\n </body>\r\n </html>\r\n `);\r\n newWindow.document.close();\r\n }\r\n } else {\r\n // For regular URLs, just open them directly\r\n window.open(src, '_blank');\r\n }\r\n };\r\n\r\n const handleDeleteImage = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n editor.update(() => {\r\n const node = $getNodeByKey(nodeKey);\r\n if ($isImageNode(node)) {\r\n node.remove();\r\n }\r\n });\r\n };\r\n\r\n const handleRefineClick = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n setShowRefineInput(!showRefineInput);\r\n };\r\n\r\n const handleRefineImage = async () => {\r\n if (!refinementPrompt.trim() || isRefining) return;\r\n\r\n setIsRefining(true);\r\n \r\n // Show loading toast\r\n const loadingToast = toast.loading(\"Refining image...\", {\r\n description: \"This may take 10-30 seconds. Please wait.\",\r\n });\r\n \r\n try {\r\n // Intelligently combine original prompt with refinement\r\n let combinedPrompt = refinementPrompt.trim();\r\n \r\n // Check if we have an original prompt\r\n if (originalPrompt && originalPrompt.trim()) {\r\n const original = originalPrompt.trim();\r\n const refinement = refinementPrompt.trim();\r\n \r\n // Remove common \"add\" prefixes from refinement\r\n const cleanedRefinement = refinement\r\n .replace(/^(add|also add|include|with|and)\\s+(some|a|an)\\s+/gi, '')\r\n .replace(/^(add|also add|include|with|and)\\s+/gi, '')\r\n .trim();\r\n \r\n // Simple and clear combination - just list both elements\r\n // This is the most reliable format for DALL-E\r\n combinedPrompt = `${original} with ${cleanedRefinement}`;\r\n } else {\r\n // No original prompt (image was created before this feature)\r\n // Try to use altText or just use the refinement as-is\r\n if (altText && altText !== \"Generated image\" && altText.trim()) {\r\n // Use altText as the original description\r\n const cleanedRefinement = refinementPrompt.trim()\r\n .replace(/^(add|also add|include|with|and)\\s+(some|a|an)\\s+/gi, '')\r\n .replace(/^(add|also add|include|with|and)\\s+/gi, '')\r\n .trim();\r\n combinedPrompt = `${altText} with ${cleanedRefinement}`;\r\n }\r\n // else: Just use the refinement prompt as-is\r\n }\r\n\r\n // Generate refined image with combined prompt\r\n const response = await AiJsonResponse({ content: `Generate Image: ${combinedPrompt}` });\r\n const htmlString = response?.data;\r\n\r\n if (!htmlString) {\r\n throw new Error(\"Failed to generate image - empty response\");\r\n }\r\n\r\n // Extract image URL from HTML response\r\n const parser = new DOMParser();\r\n const dom = parser.parseFromString(htmlString, \"text/html\");\r\n const imgElement = dom.querySelector(\"img\");\r\n\r\n if (!imgElement || !imgElement.src) {\r\n throw new Error(`No image found in response`);\r\n }\r\n\r\n const generatedImageUrl = imgElement.src;\r\n\r\n // Dismiss loading toast and show success\r\n toast.dismiss(loadingToast);\r\n toast.success(\"Image refined successfully!\", {\r\n description: \"Compare the images and choose which to keep.\",\r\n });\r\n\r\n // Store new image URL, combined prompt, and show comparison dialog\r\n setNewImageUrl(generatedImageUrl);\r\n setNewCombinedPrompt(combinedPrompt);\r\n setShowComparisonDialog(true);\r\n\r\n // Clear refinement input and close it\r\n setRefinementPrompt(\"\");\r\n setShowRefineInput(false);\r\n } catch (error) {\r\n // Dismiss loading toast and show error\r\n toast.dismiss(loadingToast);\r\n toast.error(\"Failed to refine image\", {\r\n description: error instanceof Error ? error.message : 'Unknown error. Please try again.',\r\n });\r\n } finally {\r\n setIsRefining(false);\r\n }\r\n };\r\n\r\n const handleReplaceImage = () => {\r\n // Update the image node with new URL and updated prompt\r\n editor.update(() => {\r\n const node = $getNodeByKey(nodeKey);\r\n if ($isImageNode(node)) {\r\n // Use setter methods which properly call getWritable()\r\n node.setSrc(newImageUrl);\r\n node.setOriginalPrompt(newCombinedPrompt);\r\n \r\n // Force Lexical to re-render the DecoratorNode by triggering selection change\r\n const currentSelection = $getSelection();\r\n if (currentSelection) {\r\n $setSelection(currentSelection.clone());\r\n }\r\n }\r\n });\r\n\r\n // Close dialog and reset\r\n setShowComparisonDialog(false);\r\n setNewImageUrl(\"\");\r\n setNewCombinedPrompt(\"\");\r\n \r\n // Show success toast\r\n toast.success(\"Image replaced successfully!\", {\r\n description: \"The image has been updated with the refined version.\",\r\n });\r\n };\r\n\r\n const handleCancelReplace = () => {\r\n // Just close dialog and reset\r\n setShowComparisonDialog(false);\r\n setNewImageUrl(\"\");\r\n setNewCombinedPrompt(\"\");\r\n };\r\n\r\n const draggable = isSelected && $isNodeSelection(selection) && !isResizing;\r\n const isFocused = (isSelected || isResizing) && isEditable;\r\n\r\n // Get position-based styles for float layouts\r\n // Note: Float styles are now applied at the ImageNode.createDOM level for proper text wrapping\r\n // This component only needs basic positioning\r\n const getPositionStyles = (): React.CSSProperties => {\r\n // For floated images, use simpler styles since float is on parent span\r\n if (position === \"left\" || position === \"right\") {\r\n return {\r\n position: 'relative',\r\n display: 'block',\r\n width: '100%', // Fill the floated container\r\n };\r\n }\r\n if (position === \"full\") {\r\n return {\r\n position: 'relative',\r\n display: 'block',\r\n width: '100%',\r\n };\r\n }\r\n // Default: inline-block for regular images\r\n return {\r\n position: 'relative',\r\n display: 'inline-block',\r\n };\r\n };\r\n\r\n return (\r\n <Suspense fallback={null}>\r\n <>\r\n <div draggable={draggable} style={getPositionStyles()}>\r\n {isLoadError ? (\r\n <BrokenImage />\r\n ) : (\r\n <LazyImage\r\n className={\r\n isFocused\r\n ? `focused ${$isNodeSelection(selection) ? \"draggable\" : \"\"}`\r\n : null\r\n }\r\n src={src}\r\n altText={altText}\r\n imageRef={imageRef}\r\n width={width}\r\n height={height}\r\n maxWidth={maxWidth}\r\n onError={() => setIsLoadError(true)}\r\n />\r\n )}\r\n {/* Action Buttons - Refine (AI images only), Open in New Tab and Delete */}\r\n {isSelected && $isNodeSelection(selection) && !isLoadError && (\r\n <div className=\"cteditor-absolute cteditor-top-2 cteditor-right-2 cteditor-flex cteditor-gap-2\" style={{ zIndex: 10 }}>\r\n {/* Only show Refine button for AI-generated images (those with originalPrompt) */}\r\n {originalPrompt && (\r\n <button\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n handleRefineClick(e);\r\n }}\r\n className=\"cteditor-p-2 cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border\"\r\n aria-label=\"Refine image\"\r\n title=\"Refine image\"\r\n >\r\n <Sparkles className=\"cteditor-w-4 cteditor-h-4 cteditor-text-foreground\" />\r\n </button>\r\n )}\r\n <button\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n handleOpenInNewTab(e);\r\n }}\r\n className=\"cteditor-p-2 cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border\"\r\n aria-label=\"Open image in new tab\"\r\n title=\"Open in new tab\"\r\n >\r\n <ExternalLink className=\"cteditor-w-4 cteditor-h-4 cteditor-text-foreground\" />\r\n </button>\r\n <button\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n handleDeleteImage(e);\r\n }}\r\n className=\"cteditor-p-2 cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border\"\r\n aria-label=\"Delete image\"\r\n title=\"Delete image\"\r\n >\r\n <Trash2 className=\"cteditor-w-4 cteditor-h-4 cteditor-text-foreground\" />\r\n </button>\r\n </div>\r\n )}\r\n {/* Refine Input - Only for AI-generated images */}\r\n {showRefineInput && isSelected && !isLoadError && originalPrompt && (\r\n <div \r\n className=\"cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-xl cteditor-border cteditor-border-border cteditor-p-3\" \r\n style={{ zIndex: 10 }}\r\n onClick={(e) => e.stopPropagation()}\r\n onKeyDown={(e) => e.stopPropagation()}\r\n onKeyUp={(e) => e.stopPropagation()}\r\n >\r\n <div className=\"cteditor-flex cteditor-flex-col cteditor-gap-2\">\r\n <label className=\"cteditor-text-xs cteditor-font-medium cteditor-text-foreground\">\r\n What else do you want in this scene?\r\n </label>\r\n <input\r\n type=\"text\"\r\n value={refinementPrompt}\r\n onChange={(e) => setRefinementPrompt(e.target.value)}\r\n onKeyDown={(e) => {\r\n // Stop propagation to prevent editor commands from firing\r\n e.stopPropagation();\r\n \r\n if (e.key === 'Enter' && refinementPrompt.trim() && !isRefining) {\r\n handleRefineImage();\r\n }\r\n if (e.key === 'Escape') {\r\n setShowRefineInput(false);\r\n setRefinementPrompt(\"\");\r\n }\r\n }}\r\n onKeyUp={(e) => {\r\n // Also stop propagation on keyup\r\n e.stopPropagation();\r\n }}\r\n onClick={(e) => {\r\n // Prevent click from bubbling to image selection\r\n e.stopPropagation();\r\n }}\r\n placeholder=\"e.g., flying birds, golden sunset, stormy clouds...\"\r\n className=\"cteditor-w-full cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-border cteditor-border-border cteditor-rounded-md cteditor-bg-background cteditor-text-foreground focus:cteditor-outline-none focus:cteditor-ring-2 focus:cteditor-ring-blue-500\"\r\n disabled={isRefining}\r\n autoFocus\r\n />\r\n <div className=\"cteditor-flex cteditor-gap-2\">\r\n <button\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n handleRefineImage();\r\n }}\r\n disabled={isRefining || !refinementPrompt.trim()}\r\n className=\"cteditor-flex-1 cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-blue-500 cteditor-text-white hover:cteditor-bg-blue-600 disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors\"\r\n >\r\n {isRefining ? (\r\n <span className=\"cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-2\">\r\n <span className=\"cteditor-inline-block cteditor-w-4 cteditor-h-4 cteditor-border-2 cteditor-border-white cteditor-border-t-transparent cteditor-rounded-full cteditor-animate-spin\"></span>\r\n Refining...\r\n </span>\r\n ) : (\r\n \"Refine Image\"\r\n )}\r\n </button>\r\n <button\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n setShowRefineInput(false);\r\n setRefinementPrompt(\"\");\r\n }}\r\n disabled={isRefining}\r\n className=\"cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-background cteditor-border cteditor-border-border cteditor-text-foreground hover:cteditor-bg-accent disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors\"\r\n >\r\n Cancel\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n\r\n {showCaption && (\r\n altText.startsWith(\"Signature by\") ? (\r\n <SignatureCaption caption={caption} />\r\n ) : (\r\n <div className=\"image-caption-container\">\r\n <LexicalNestedComposer\r\n initialEditor={caption}\r\n initialNodes={[\r\n RootNode,\r\n TextNode,\r\n LineBreakNode,\r\n ParagraphNode,\r\n LinkNode,\r\n CodeNode,\r\n ]}\r\n >\r\n <AutoFocusPlugin />\r\n\r\n <RichTextPlugin\r\n contentEditable={\r\n <ContentEditable\r\n aria-placeholder=\"Enter a caption...\"\r\n placeholder={() => <span className=\"cteditor-text-xs\">Enter a caption...</span>}\r\n className=\"ImageNode__contentEditable\"\r\n />\r\n }\r\n ErrorBoundary={LexicalErrorBoundary}\r\n />\r\n\r\n <OnChangePlugin onChange={() => {}} />\r\n <HistoryPlugin />\r\n <LocalStoragePlugin namespace={initialConfig.namespace} />\r\n </LexicalNestedComposer>\r\n </div>\r\n )\r\n )}\r\n {resizable && $isNodeSelection(selection) && isFocused && (\r\n <ImageResizer\r\n showCaption={showCaption}\r\n setShowCaption={setShowCaption}\r\n editor={editor}\r\n buttonRef={buttonRef}\r\n imageRef={imageRef}\r\n maxWidth={maxWidth}\r\n onResizeStart={onResizeStart}\r\n onResizeEnd={onResizeEnd}\r\n captionsEnabled={!isLoadError && captionsEnabled}\r\n />\r\n )}\r\n\r\n {/* Image Comparison Dialog */}\r\n <ImageComparisonDialog\r\n open={showComparisonDialog}\r\n onOpenChange={setShowComparisonDialog}\r\n oldImageUrl={src}\r\n newImageUrl={newImageUrl}\r\n onReplace={handleReplaceImage}\r\n onCancel={handleCancelReplace}\r\n />\r\n </>\r\n </Suspense>\r\n );\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAwB,iBAAiB;AAAA,EACvC;AACF,GAAuC;AAEnC,SAAA,oBAAC,OAAI,EAAA,WAAU,+BACb,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAe;AAAA,MACf,cAAc;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEA,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,iBACE;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,oBAAiB;AAAA,gBACjB,aACG,oBAAA,OAAA,EAAI,OAAO;AAAA,kBACV,UAAU;AAAA,kBACV,KAAK;AAAA,kBACL,MAAM;AAAA,kBACN,OAAO;AAAA,kBACP,WAAW;AAAA,kBACX,eAAe;AAAA,kBACf,OAAO;AAAA,kBACP,WAAW;AAAA,gBAAA,GACV,UAEH,2BAAA;AAAA,gBAEF,WAAU;AAAA,cAAA;AAAA,YACZ;AAAA,YAEF,eAAe;AAAA,UAAA;AAAA,QACjB;AAAA,QAEA,oBAAC,gBAAe,EAAA,UAAU,MAAM;AAAA,QAAA,GAE7B;AAAA,4BACF,eAAc,EAAA;AAAA,QACd,oBAAA,oBAAA,EAAmB,WAAW,cAAc,UAAW,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAE5D,EAAA,CAAA;AAEJ;ACzDA,SAAS,MAAM,OAAe,KAAa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A;AAAA,MAAA;AAAA,IAE5D,EAAA,CAAA;AAAA,IAGH,aAAa,iBAAiB,SAAS,KAAK,aAC3C;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,iBAAiB,CAAC,eAAe;AAAA,MAAA;AAAA,IACnC;AAAA,IAIF;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAM;AAAA,QACN,cAAc;AAAA,QACd,aAAa;AAAA,QACb;AAAA,QACA,WAAW;AAAA,QACX,UAAU;AAAA,MAAA;AAAA,IACZ;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { HtmlViewProvider, useHtmlView } from './context/HtmlViewContext';
|
|
2
|
-
export { EditorProvider, useEditor } from './Provider/EditorProvider';
|
|
3
|
-
export { default as ConfigurableEditorWithAuth } from './components/ConfigurableEditorWithAuth';
|
|
4
|
-
export { default as ConfigurableEditor } from './pages/ConfigurableEditor/ConfigurableEditor';
|
|
5
|
-
export { verifyApiKey } from './api/auth';
|
|
6
|
-
export type { EditorConfigTypes } from './types';
|
|
7
|
-
export type { CurrentUser } from './Provider/EditorProvider';
|
|
8
|
-
export { editorConfig as defaultEditorConfig } from './editorConfig';
|
|
1
|
+
export { HtmlViewProvider, useHtmlView } from './context/HtmlViewContext';
|
|
2
|
+
export { EditorProvider, useEditor } from './Provider/EditorProvider';
|
|
3
|
+
export { default as ConfigurableEditorWithAuth } from './components/ConfigurableEditorWithAuth';
|
|
4
|
+
export { default as ConfigurableEditor } from './pages/ConfigurableEditor/ConfigurableEditor';
|
|
5
|
+
export { verifyApiKey } from './api/auth';
|
|
6
|
+
export type { EditorConfigTypes } from './types';
|
|
7
|
+
export type { CurrentUser } from './Provider/EditorProvider';
|
|
8
|
+
export { editorConfig as defaultEditorConfig } from './editorConfig';
|
package/dist/index.js
CHANGED
package/dist/lib/utils.d.ts
CHANGED
package/dist/main.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|