@tarviks/lexical-rich-editor 1.3.0 → 1.3.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/dist/index.css +107 -18
- package/dist/index.css.map +1 -1
- package/dist/index.js +712 -646
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +564 -498
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { mergeRegister, $wrapNodeInElement, $insertNodeToNearestRoot, $getNearestNodeOfType, $findMatchingParent as $findMatchingParent$1, calculateZoomLevel } from '@lexical/utils';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React10 from 'react';
|
|
3
|
+
import React10__default, { forwardRef, useState, useCallback, useRef, useEffect, useMemo, useImperativeHandle, Suspense } from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
6
6
|
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
7
7
|
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection';
|
|
8
8
|
import { createCommand, DecoratorNode, COMMAND_PRIORITY_HIGH, TextNode, ElementNode, SELECTION_CHANGE_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, $getSelection, $isRangeSelection, $findMatchingParent, COMMAND_PRIORITY_LOW, KEY_DOWN_COMMAND, $getNodeByKey, $createRangeSelection, $setSelection, $createParagraphNode, $insertNodes, $isRootOrShadowRoot, COMMAND_PRIORITY_EDITOR, PASTE_COMMAND, DRAGSTART_COMMAND, DRAGOVER_COMMAND, DROP_COMMAND, $getRoot, $createTextNode, $isTextNode, $isElementNode, FORMAT_ELEMENT_COMMAND, CLICK_COMMAND, $isNodeSelection, $applyNodeReplacement, FORMAT_TEXT_COMMAND, $isDecoratorNode, $getNearestNodeFromDOMNode, COMMAND_PRIORITY_CRITICAL, REDO_COMMAND, UNDO_COMMAND, getDOMSelection, KEY_ESCAPE_COMMAND, isHTMLElement, getDOMSelectionFromTarget, $isLineBreakNode, SKIP_SELECTION_FOCUS_TAG, createEditor, KEY_ENTER_COMMAND } from 'lexical';
|
|
9
9
|
import { mergeStyleSets, Stack, css, useTheme, Callout, TextField } from '@fluentui/react';
|
|
10
|
-
import { makeStyles, FluentProvider, webLightTheme, Menu, MenuTrigger, MenuPopover, MenuList, MenuGroup, MenuGroupHeader, MenuItem, MenuDivider, Dropdown, Option, Button, ToolbarDivider, MenuItemRadio,
|
|
10
|
+
import { makeStyles, FluentProvider, webLightTheme, Menu, MenuTrigger, MenuPopover, MenuList, MenuGroup, MenuGroupHeader, MenuItem, MenuDivider, Dropdown, Option, Button, ToolbarDivider, MenuItemRadio, Field, Input, MessageBar, MessageBarBody } from '@fluentui/react-components';
|
|
11
11
|
import { CodeHighlightNode, CodeNode, $isCodeHighlightNode } from '@lexical/code';
|
|
12
12
|
import { LinkNode, AutoLinkNode, $isLinkNode, $isAutoLinkNode, TOGGLE_LINK_COMMAND, $createLinkNode } from '@lexical/link';
|
|
13
13
|
import { ListNode, ListItemNode, $isListNode, REMOVE_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, $removeList, $insertList, $isListItemNode } from '@lexical/list';
|
|
@@ -642,7 +642,7 @@ function parseDimFromStyleOrAttr(img3) {
|
|
|
642
642
|
var ImageComponent2, isGoogleDocCheckboxImg, $convertImageElement, ImageNode, $createImageNode, $isImageNode;
|
|
643
643
|
var init_ImageNode = __esm({
|
|
644
644
|
"src/Nodes/ImageNode.tsx"() {
|
|
645
|
-
ImageComponent2 =
|
|
645
|
+
ImageComponent2 = React10.lazy(() => Promise.resolve().then(() => (init_ImageComponent(), ImageComponent_exports)));
|
|
646
646
|
isGoogleDocCheckboxImg = (img3) => {
|
|
647
647
|
return img3.parentElement != null && img3.parentElement.tagName === "LI" && img3.previousSibling === null && img3.getAttribute("aria-roledescription") === "checkbox";
|
|
648
648
|
};
|
|
@@ -1061,7 +1061,7 @@ var init_InlineImageComponent = __esm({
|
|
|
1061
1061
|
var InlineImageComponent2, $convertInlineImageElement, InlineImageNode, $createInlineImageNode, $isInlineImageNode;
|
|
1062
1062
|
var init_InlineImageNode = __esm({
|
|
1063
1063
|
"src/Nodes/InlineImageNode.tsx"() {
|
|
1064
|
-
InlineImageComponent2 =
|
|
1064
|
+
InlineImageComponent2 = React10.lazy(() => Promise.resolve().then(() => (init_InlineImageComponent(), InlineImageComponent_exports)));
|
|
1065
1065
|
$convertInlineImageElement = (domNode) => {
|
|
1066
1066
|
if (isHTMLElement(domNode) && domNode.nodeName === "IMG") {
|
|
1067
1067
|
const { alt: altText, src, width, height } = domNode;
|
|
@@ -1702,7 +1702,7 @@ function VideoResizer({
|
|
|
1702
1702
|
onResizeStart,
|
|
1703
1703
|
onResizeEnd
|
|
1704
1704
|
}) {
|
|
1705
|
-
const resizeState =
|
|
1705
|
+
const resizeState = React10.useRef(null);
|
|
1706
1706
|
const startResize = (e, dir) => {
|
|
1707
1707
|
e.preventDefault();
|
|
1708
1708
|
e.stopPropagation();
|
|
@@ -1829,15 +1829,15 @@ function YouTubeComponent({
|
|
|
1829
1829
|
height,
|
|
1830
1830
|
editor
|
|
1831
1831
|
}) {
|
|
1832
|
-
const wrapperRef =
|
|
1833
|
-
const containerRef =
|
|
1834
|
-
const iframeRef =
|
|
1835
|
-
const isResizingRef =
|
|
1832
|
+
const wrapperRef = React10.useRef(null);
|
|
1833
|
+
const containerRef = React10.useRef(null);
|
|
1834
|
+
const iframeRef = React10.useRef(null);
|
|
1835
|
+
const isResizingRef = React10.useRef(false);
|
|
1836
1836
|
const [isNodeSelected, setNodeSelected, clearNodeSelection] = useLexicalNodeSelection(nodeKey);
|
|
1837
|
-
const [isHovered, setIsHovered] =
|
|
1838
|
-
const [isResizing, setIsResizing] =
|
|
1839
|
-
const [isPlaying, setIsPlaying] =
|
|
1840
|
-
|
|
1837
|
+
const [isHovered, setIsHovered] = React10.useState(false);
|
|
1838
|
+
const [isResizing, setIsResizing] = React10.useState(false);
|
|
1839
|
+
const [isPlaying, setIsPlaying] = React10.useState(false);
|
|
1840
|
+
React10.useEffect(() => {
|
|
1841
1841
|
return mergeRegister(
|
|
1842
1842
|
editor.registerCommand(
|
|
1843
1843
|
FORMAT_ELEMENT_COMMAND,
|
|
@@ -2226,13 +2226,13 @@ function AutocompletePlugin({
|
|
|
2226
2226
|
prefixWindow = 300
|
|
2227
2227
|
}) {
|
|
2228
2228
|
const [editor] = useLexicalComposerContext();
|
|
2229
|
-
const ghostKeyRef =
|
|
2230
|
-
const idleTimerRef =
|
|
2231
|
-
const inflightRef =
|
|
2232
|
-
const reqCounterRef =
|
|
2233
|
-
const lastTriggerRef =
|
|
2234
|
-
const lastShownCtxRef =
|
|
2235
|
-
const clearGhost =
|
|
2229
|
+
const ghostKeyRef = React10.useRef(null);
|
|
2230
|
+
const idleTimerRef = React10.useRef(null);
|
|
2231
|
+
const inflightRef = React10.useRef(null);
|
|
2232
|
+
const reqCounterRef = React10.useRef(0);
|
|
2233
|
+
const lastTriggerRef = React10.useRef("");
|
|
2234
|
+
const lastShownCtxRef = React10.useRef("");
|
|
2235
|
+
const clearGhost = React10.useCallback(() => {
|
|
2236
2236
|
editor.update(
|
|
2237
2237
|
() => {
|
|
2238
2238
|
const key = ghostKeyRef.current;
|
|
@@ -2244,7 +2244,7 @@ function AutocompletePlugin({
|
|
|
2244
2244
|
{ tag: "autocomplete-ghost" }
|
|
2245
2245
|
);
|
|
2246
2246
|
}, [editor]);
|
|
2247
|
-
const upsertGhost =
|
|
2247
|
+
const upsertGhost = React10.useCallback(
|
|
2248
2248
|
(text, insertAtCharOffset) => {
|
|
2249
2249
|
editor.update(
|
|
2250
2250
|
() => {
|
|
@@ -2308,12 +2308,12 @@ function AutocompletePlugin({
|
|
|
2308
2308
|
},
|
|
2309
2309
|
[editor]
|
|
2310
2310
|
);
|
|
2311
|
-
const cancelInflight =
|
|
2311
|
+
const cancelInflight = React10.useCallback(() => {
|
|
2312
2312
|
if (!inflightRef.current) return;
|
|
2313
2313
|
inflightRef.current.dismiss();
|
|
2314
2314
|
inflightRef.current = null;
|
|
2315
2315
|
}, []);
|
|
2316
|
-
const resetIdleTimer =
|
|
2316
|
+
const resetIdleTimer = React10.useCallback(
|
|
2317
2317
|
(callback) => {
|
|
2318
2318
|
if (idleTimerRef.current) {
|
|
2319
2319
|
clearTimeout(idleTimerRef.current);
|
|
@@ -2328,7 +2328,7 @@ function AutocompletePlugin({
|
|
|
2328
2328
|
},
|
|
2329
2329
|
[idleMs, cancelInflight, clearGhost]
|
|
2330
2330
|
);
|
|
2331
|
-
const fireQuery =
|
|
2331
|
+
const fireQuery = React10.useCallback(() => {
|
|
2332
2332
|
if (!useQuery || isReadOnly) return;
|
|
2333
2333
|
let context = "";
|
|
2334
2334
|
let prefix = "";
|
|
@@ -2400,7 +2400,7 @@ function AutocompletePlugin({
|
|
|
2400
2400
|
upsertGhost,
|
|
2401
2401
|
onSuggestionShown
|
|
2402
2402
|
]);
|
|
2403
|
-
|
|
2403
|
+
React10.useEffect(() => {
|
|
2404
2404
|
if (!useQuery || isReadOnly) return;
|
|
2405
2405
|
return editor.registerUpdateListener(({ tags }) => {
|
|
2406
2406
|
if (tags.has("history-merge") || tags.has("collaboration")) return;
|
|
@@ -2409,7 +2409,7 @@ function AutocompletePlugin({
|
|
|
2409
2409
|
resetIdleTimer(fireQuery);
|
|
2410
2410
|
});
|
|
2411
2411
|
}, [editor, useQuery, isReadOnly, resetIdleTimer, fireQuery]);
|
|
2412
|
-
|
|
2412
|
+
React10.useEffect(() => {
|
|
2413
2413
|
if (!useQuery || isReadOnly) return;
|
|
2414
2414
|
return editor.registerCommand(
|
|
2415
2415
|
SELECTION_CHANGE_COMMAND,
|
|
@@ -2433,7 +2433,7 @@ function AutocompletePlugin({
|
|
|
2433
2433
|
COMMAND_PRIORITY_LOW
|
|
2434
2434
|
);
|
|
2435
2435
|
}, [editor, useQuery, isReadOnly, resetIdleTimer, fireQuery]);
|
|
2436
|
-
|
|
2436
|
+
React10.useEffect(() => {
|
|
2437
2437
|
return editor.registerCommand(
|
|
2438
2438
|
KEY_DOWN_COMMAND,
|
|
2439
2439
|
(e) => {
|
|
@@ -2474,7 +2474,7 @@ function AutocompletePlugin({
|
|
|
2474
2474
|
COMMAND_PRIORITY_HIGH
|
|
2475
2475
|
);
|
|
2476
2476
|
}, [editor, clearGhost, onSuggestionAccept, prefixWindow]);
|
|
2477
|
-
|
|
2477
|
+
React10.useEffect(() => {
|
|
2478
2478
|
return () => {
|
|
2479
2479
|
cancelInflight();
|
|
2480
2480
|
if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
|
|
@@ -3130,28 +3130,44 @@ var getSelectedNode2 = (selection) => {
|
|
|
3130
3130
|
};
|
|
3131
3131
|
var VERTICAL_GAP = 10;
|
|
3132
3132
|
var HORIZONTAL_OFFSET = 5;
|
|
3133
|
-
var
|
|
3134
|
-
|
|
3135
|
-
|
|
3133
|
+
var VIEWPORT_MARGIN = 8;
|
|
3134
|
+
function useFloatingPortalContainer2(editor) {
|
|
3135
|
+
const [container, setContainer] = useState(null);
|
|
3136
|
+
useEffect(() => {
|
|
3137
|
+
const root = editor.getRootElement();
|
|
3138
|
+
if (!root) return;
|
|
3139
|
+
const panelOrLayer = root.closest(".ms-Panel-main") || root.closest(".ms-Panel") || root.closest(".ms-Layer") || document.body;
|
|
3140
|
+
const host = document.createElement("div");
|
|
3141
|
+
host.className = "lexical-floating-ui-host";
|
|
3142
|
+
panelOrLayer.appendChild(host);
|
|
3143
|
+
setContainer(host);
|
|
3144
|
+
return () => {
|
|
3145
|
+
host.remove();
|
|
3146
|
+
setContainer(null);
|
|
3147
|
+
};
|
|
3148
|
+
}, [editor]);
|
|
3149
|
+
return container;
|
|
3150
|
+
}
|
|
3151
|
+
var setFloatingElemPositionForLinkEditor = (targetRect, floatingElem, topBoundary = VIEWPORT_MARGIN, verticalGap = VERTICAL_GAP, horizontalOffset = HORIZONTAL_OFFSET) => {
|
|
3152
|
+
if (targetRect === null) {
|
|
3136
3153
|
floatingElem.style.opacity = "0";
|
|
3137
3154
|
floatingElem.style.transform = "translate(-10000px, -10000px)";
|
|
3138
3155
|
return;
|
|
3139
3156
|
}
|
|
3140
3157
|
const floatingElemRect = floatingElem.getBoundingClientRect();
|
|
3141
|
-
|
|
3142
|
-
const editorScrollerRect = scrollerElem.getBoundingClientRect();
|
|
3143
|
-
let top = targetRect.top - verticalGap;
|
|
3158
|
+
let top = targetRect.bottom + verticalGap;
|
|
3144
3159
|
let left = targetRect.left - horizontalOffset;
|
|
3145
|
-
if (top
|
|
3146
|
-
top
|
|
3160
|
+
if (top + floatingElemRect.height > window.innerHeight - VIEWPORT_MARGIN) {
|
|
3161
|
+
top = targetRect.top - floatingElemRect.height - verticalGap;
|
|
3147
3162
|
}
|
|
3148
|
-
if (
|
|
3149
|
-
|
|
3163
|
+
if (top < topBoundary) {
|
|
3164
|
+
top = topBoundary;
|
|
3150
3165
|
}
|
|
3151
|
-
|
|
3152
|
-
left -= anchorElementRect.left;
|
|
3166
|
+
left = Math.max(VIEWPORT_MARGIN, Math.min(left, window.innerWidth - floatingElemRect.width - VIEWPORT_MARGIN));
|
|
3153
3167
|
floatingElem.style.opacity = "1";
|
|
3154
|
-
floatingElem.style.transform =
|
|
3168
|
+
floatingElem.style.transform = "none";
|
|
3169
|
+
floatingElem.style.top = `${top}px`;
|
|
3170
|
+
floatingElem.style.left = `${left}px`;
|
|
3155
3171
|
};
|
|
3156
3172
|
var SUPPORTED_URL_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
3157
3173
|
"http:",
|
|
@@ -3174,7 +3190,7 @@ var sanitizeUrl = (url) => {
|
|
|
3174
3190
|
var preventDefault = (event) => {
|
|
3175
3191
|
event.preventDefault();
|
|
3176
3192
|
};
|
|
3177
|
-
var FloatingLinkEditor = ({ editor, isLink, setIsLink,
|
|
3193
|
+
var FloatingLinkEditor = ({ editor, isLink, setIsLink, isLinkEditMode, setIsLinkEditMode }) => {
|
|
3178
3194
|
const [editedLinkUrl, setEditedLinkUrl] = useState("https://");
|
|
3179
3195
|
const [lastSelection, setLastSelection] = useState(null);
|
|
3180
3196
|
const [linkUrl, setLinkUrl] = useState("");
|
|
@@ -3206,38 +3222,37 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, anchorElem, isLinkEditMod
|
|
|
3206
3222
|
if (isLink && selection !== null && nativeSelection !== null && rootElement !== null && rootElement.contains(nativeSelection.anchorNode) && editor.isEditable()) {
|
|
3207
3223
|
const domRect = nativeSelection.focusNode?.parentElement?.getBoundingClientRect();
|
|
3208
3224
|
if (domRect) {
|
|
3209
|
-
|
|
3210
|
-
|
|
3225
|
+
const toolbarEl = rootElement.closest(".lexical-rich-editor-root")?.querySelector(".editor-toolbar-root");
|
|
3226
|
+
const topBoundary = toolbarEl ? toolbarEl.getBoundingClientRect().bottom + 8 : 8;
|
|
3227
|
+
setFloatingElemPositionForLinkEditor(domRect, editorElem, topBoundary);
|
|
3211
3228
|
}
|
|
3212
3229
|
setLastSelection(selection);
|
|
3213
|
-
} else if (!activeElement || activeElement.className !== "
|
|
3230
|
+
} else if (!activeElement || activeElement.className !== "aoLinkInput") {
|
|
3214
3231
|
if (rootElement !== null) {
|
|
3215
|
-
setFloatingElemPositionForLinkEditor(null, editorElem
|
|
3232
|
+
setFloatingElemPositionForLinkEditor(null, editorElem);
|
|
3216
3233
|
}
|
|
3217
3234
|
setLastSelection(null);
|
|
3218
3235
|
setIsLinkEditMode(false);
|
|
3219
3236
|
setLinkUrl("");
|
|
3220
3237
|
}
|
|
3221
3238
|
return true;
|
|
3222
|
-
}, [
|
|
3239
|
+
}, [editor, setIsLinkEditMode, isLinkEditMode, isLink, linkUrl]);
|
|
3223
3240
|
useEffect(() => {
|
|
3224
|
-
const scrollerElem = anchorElem.parentElement;
|
|
3225
3241
|
const update = () => {
|
|
3226
3242
|
editor.getEditorState().read(() => {
|
|
3227
3243
|
$updateLinkEditor();
|
|
3228
3244
|
});
|
|
3229
3245
|
};
|
|
3246
|
+
const root = editor.getRootElement();
|
|
3230
3247
|
window.addEventListener("resize", update);
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
}
|
|
3248
|
+
window.addEventListener("scroll", update, true);
|
|
3249
|
+
root?.addEventListener("scroll", update, { passive: true });
|
|
3234
3250
|
return () => {
|
|
3235
3251
|
window.removeEventListener("resize", update);
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
}
|
|
3252
|
+
window.removeEventListener("scroll", update, true);
|
|
3253
|
+
root?.removeEventListener("scroll", update);
|
|
3239
3254
|
};
|
|
3240
|
-
}, [
|
|
3255
|
+
}, [editor, $updateLinkEditor]);
|
|
3241
3256
|
useEffect(() => {
|
|
3242
3257
|
return mergeRegister(
|
|
3243
3258
|
editor.registerUpdateListener(({ editorState }) => {
|
|
@@ -3311,12 +3326,12 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, anchorElem, isLinkEditMod
|
|
|
3311
3326
|
setIsLinkEditMode(false);
|
|
3312
3327
|
}
|
|
3313
3328
|
};
|
|
3314
|
-
return /* @__PURE__ */ jsx("div", { ref: editorRef, className: "
|
|
3329
|
+
return /* @__PURE__ */ jsx("div", { ref: editorRef, className: "aoLinkEditor", children: !isLink ? null : isLinkEditMode ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3315
3330
|
/* @__PURE__ */ jsx(
|
|
3316
3331
|
"input",
|
|
3317
3332
|
{
|
|
3318
3333
|
ref: inputRef,
|
|
3319
|
-
className: "
|
|
3334
|
+
className: "aoLinkInput",
|
|
3320
3335
|
value: editedLinkUrl,
|
|
3321
3336
|
onChange: (event) => {
|
|
3322
3337
|
setEditedLinkUrl(event.target.value);
|
|
@@ -3326,11 +3341,11 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, anchorElem, isLinkEditMod
|
|
|
3326
3341
|
}
|
|
3327
3342
|
}
|
|
3328
3343
|
),
|
|
3329
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
3344
|
+
/* @__PURE__ */ jsxs("div", { className: "aoLinkInputActions", children: [
|
|
3330
3345
|
/* @__PURE__ */ jsx(
|
|
3331
3346
|
"div",
|
|
3332
3347
|
{
|
|
3333
|
-
className: "
|
|
3348
|
+
className: "aoLinkCancel",
|
|
3334
3349
|
role: "button",
|
|
3335
3350
|
tabIndex: 0,
|
|
3336
3351
|
title: "Cancel",
|
|
@@ -3345,7 +3360,7 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, anchorElem, isLinkEditMod
|
|
|
3345
3360
|
/* @__PURE__ */ jsx(
|
|
3346
3361
|
"div",
|
|
3347
3362
|
{
|
|
3348
|
-
className: "
|
|
3363
|
+
className: "aoLinkConfirm",
|
|
3349
3364
|
role: "button",
|
|
3350
3365
|
tabIndex: 0,
|
|
3351
3366
|
title: "Confirm",
|
|
@@ -3356,7 +3371,7 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, anchorElem, isLinkEditMod
|
|
|
3356
3371
|
}
|
|
3357
3372
|
)
|
|
3358
3373
|
] })
|
|
3359
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "
|
|
3374
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "aoLinkView", children: [
|
|
3360
3375
|
/* @__PURE__ */ jsx(
|
|
3361
3376
|
"a",
|
|
3362
3377
|
{
|
|
@@ -3369,7 +3384,7 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, anchorElem, isLinkEditMod
|
|
|
3369
3384
|
/* @__PURE__ */ jsx(
|
|
3370
3385
|
"div",
|
|
3371
3386
|
{
|
|
3372
|
-
className: "
|
|
3387
|
+
className: "aoLinkEdit",
|
|
3373
3388
|
role: "button",
|
|
3374
3389
|
tabIndex: 0,
|
|
3375
3390
|
title: "Edit link",
|
|
@@ -3386,7 +3401,7 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, anchorElem, isLinkEditMod
|
|
|
3386
3401
|
/* @__PURE__ */ jsx(
|
|
3387
3402
|
"div",
|
|
3388
3403
|
{
|
|
3389
|
-
className: "
|
|
3404
|
+
className: "aoLinkTrash",
|
|
3390
3405
|
role: "button",
|
|
3391
3406
|
tabIndex: 0,
|
|
3392
3407
|
title: "Remove link",
|
|
@@ -3403,6 +3418,7 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, anchorElem, isLinkEditMod
|
|
|
3403
3418
|
var useFloatingLinkEditorToolbar = (editor, anchorElem, isLinkEditMode, setIsLinkEditMode) => {
|
|
3404
3419
|
const [activeEditor, setActiveEditor] = useState(editor);
|
|
3405
3420
|
const [isLink, setIsLink] = useState(false);
|
|
3421
|
+
const portalContainer = useFloatingPortalContainer2(editor);
|
|
3406
3422
|
useEffect(() => {
|
|
3407
3423
|
function $updateToolbar() {
|
|
3408
3424
|
const selection = $getSelection();
|
|
@@ -3450,7 +3466,7 @@ var useFloatingLinkEditorToolbar = (editor, anchorElem, isLinkEditMode, setIsLin
|
|
|
3450
3466
|
)
|
|
3451
3467
|
);
|
|
3452
3468
|
}, [editor]);
|
|
3453
|
-
if (!anchorElem || !(anchorElem instanceof HTMLElement)) {
|
|
3469
|
+
if (!anchorElem || !(anchorElem instanceof HTMLElement) || !portalContainer) {
|
|
3454
3470
|
return null;
|
|
3455
3471
|
}
|
|
3456
3472
|
return createPortal(
|
|
@@ -3460,12 +3476,11 @@ var useFloatingLinkEditorToolbar = (editor, anchorElem, isLinkEditMode, setIsLin
|
|
|
3460
3476
|
isLink,
|
|
3461
3477
|
editor: activeEditor,
|
|
3462
3478
|
setIsLink,
|
|
3463
|
-
anchorElem,
|
|
3464
3479
|
isLinkEditMode,
|
|
3465
3480
|
setIsLinkEditMode
|
|
3466
3481
|
}
|
|
3467
3482
|
),
|
|
3468
|
-
|
|
3483
|
+
portalContainer
|
|
3469
3484
|
);
|
|
3470
3485
|
};
|
|
3471
3486
|
var FloatingLinkEditorPlugin = ({ anchorElem, isLinkEditMode, setIsLinkEditMode }) => {
|
|
@@ -3478,6 +3493,61 @@ var FloatingLinkEditorPlugin = ({ anchorElem, isLinkEditMode, setIsLinkEditMode
|
|
|
3478
3493
|
setIsLinkEditMode
|
|
3479
3494
|
);
|
|
3480
3495
|
};
|
|
3496
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React10.useLayoutEffect : React10.useEffect;
|
|
3497
|
+
var AoModal = ({
|
|
3498
|
+
isOpen,
|
|
3499
|
+
onDismiss,
|
|
3500
|
+
title,
|
|
3501
|
+
maxWidth = 280,
|
|
3502
|
+
// Default to a smaller, compact size
|
|
3503
|
+
actions,
|
|
3504
|
+
children
|
|
3505
|
+
}) => {
|
|
3506
|
+
const [hostElement, setHostElement] = React10.useState(null);
|
|
3507
|
+
const mountRef = React10.useRef(null);
|
|
3508
|
+
useIsomorphicLayoutEffect(() => {
|
|
3509
|
+
if (isOpen && mountRef.current) {
|
|
3510
|
+
const root = mountRef.current.closest(".lexical-rich-editor-root");
|
|
3511
|
+
if (root) {
|
|
3512
|
+
setHostElement(root);
|
|
3513
|
+
} else {
|
|
3514
|
+
setHostElement(mountRef.current.parentElement);
|
|
3515
|
+
}
|
|
3516
|
+
}
|
|
3517
|
+
}, [isOpen]);
|
|
3518
|
+
if (!isOpen) return null;
|
|
3519
|
+
const modalContent = /* @__PURE__ */ jsx("div", { className: "aoModalBackdrop", onClick: onDismiss, children: /* @__PURE__ */ jsxs(
|
|
3520
|
+
FluentProvider,
|
|
3521
|
+
{
|
|
3522
|
+
theme: webLightTheme,
|
|
3523
|
+
className: "aoModalWrapper aoModalContainer",
|
|
3524
|
+
style: { maxWidth, width: "90vw" },
|
|
3525
|
+
onClick: (e) => e.stopPropagation(),
|
|
3526
|
+
children: [
|
|
3527
|
+
/* @__PURE__ */ jsxs("div", { className: "aoModalHeader", children: [
|
|
3528
|
+
/* @__PURE__ */ jsx("h2", { className: "aoModalTitle", children: title }),
|
|
3529
|
+
/* @__PURE__ */ jsx(
|
|
3530
|
+
"button",
|
|
3531
|
+
{
|
|
3532
|
+
className: "aoModalCloseButton",
|
|
3533
|
+
"aria-label": "Close popup",
|
|
3534
|
+
onClick: onDismiss,
|
|
3535
|
+
children: "\u2715"
|
|
3536
|
+
}
|
|
3537
|
+
)
|
|
3538
|
+
] }),
|
|
3539
|
+
/* @__PURE__ */ jsx("div", { className: "aoModalBody", children }),
|
|
3540
|
+
actions && /* @__PURE__ */ jsx("div", { className: "aoModalActions", children: actions })
|
|
3541
|
+
]
|
|
3542
|
+
}
|
|
3543
|
+
) });
|
|
3544
|
+
if (hostElement) {
|
|
3545
|
+
return createPortal(modalContent, hostElement);
|
|
3546
|
+
}
|
|
3547
|
+
return /* @__PURE__ */ jsx("div", { ref: mountRef, style: { display: "none" } });
|
|
3548
|
+
};
|
|
3549
|
+
|
|
3550
|
+
// src/Plugins/ImagePlugin.tsx
|
|
3481
3551
|
init_ImageNode();
|
|
3482
3552
|
var INSERT_IMAGE_COMMAND = createCommand("INSERT_IMAGE_COMMAND");
|
|
3483
3553
|
var readClipboardImageAsDataURL = async (event) => {
|
|
@@ -3611,108 +3681,105 @@ var InsertImageDialog = ({
|
|
|
3611
3681
|
};
|
|
3612
3682
|
reader.readAsDataURL(file);
|
|
3613
3683
|
};
|
|
3614
|
-
return /* @__PURE__ */ jsxs(
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3684
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3685
|
+
/* @__PURE__ */ jsx(
|
|
3686
|
+
Button,
|
|
3687
|
+
{
|
|
3688
|
+
size: "small",
|
|
3689
|
+
title: "Add Image",
|
|
3690
|
+
disabled,
|
|
3691
|
+
icon: /* @__PURE__ */ jsx(ImageAddRegular, { style: { color: iconColor } }),
|
|
3692
|
+
style: {
|
|
3693
|
+
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
3694
|
+
border: "none",
|
|
3695
|
+
margin: 2,
|
|
3696
|
+
opacity: disabled ? 0.55 : 1,
|
|
3697
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
3698
|
+
},
|
|
3699
|
+
onClick: () => {
|
|
3700
|
+
if (disabled) return;
|
|
3701
|
+
setIsOpen((prev) => !prev);
|
|
3702
|
+
setSrc("");
|
|
3703
|
+
setAltText("");
|
|
3704
|
+
setFileName("");
|
|
3705
|
+
}
|
|
3620
3706
|
},
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
},
|
|
3659
|
-
children: [
|
|
3707
|
+
"upload-image"
|
|
3708
|
+
),
|
|
3709
|
+
/* @__PURE__ */ jsx(
|
|
3710
|
+
AoModal,
|
|
3711
|
+
{
|
|
3712
|
+
isOpen: disabled ? false : isOpen,
|
|
3713
|
+
onDismiss: () => !disabled && setIsOpen(false),
|
|
3714
|
+
title: "Insert image",
|
|
3715
|
+
maxWidth: 340,
|
|
3716
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3717
|
+
/* @__PURE__ */ jsx(Button, { size: "small", disabled: isDisabled, onClick: () => onClick({ altText, src }), children: "Add" }),
|
|
3718
|
+
/* @__PURE__ */ jsx(Button, { size: "small", disabled, onClick: () => setIsOpen(false), children: "Cancel" })
|
|
3719
|
+
] }),
|
|
3720
|
+
children: /* @__PURE__ */ jsxs(Stack, { tokens: { childrenGap: 8 }, children: [
|
|
3721
|
+
/* @__PURE__ */ jsx(Field, { label: "Upload", size: "small", children: /* @__PURE__ */ jsxs(
|
|
3722
|
+
"label",
|
|
3723
|
+
{
|
|
3724
|
+
style: {
|
|
3725
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
3726
|
+
display: "flex",
|
|
3727
|
+
alignItems: "center",
|
|
3728
|
+
gap: 8,
|
|
3729
|
+
opacity: disabled ? 0.75 : 1
|
|
3730
|
+
},
|
|
3731
|
+
children: [
|
|
3732
|
+
/* @__PURE__ */ jsx(
|
|
3733
|
+
"input",
|
|
3734
|
+
{
|
|
3735
|
+
type: "file",
|
|
3736
|
+
accept: "image/*",
|
|
3737
|
+
style: { display: "none" },
|
|
3738
|
+
disabled,
|
|
3739
|
+
onChange: loadImage
|
|
3740
|
+
},
|
|
3741
|
+
"inline-image-upload"
|
|
3742
|
+
),
|
|
3743
|
+
/* @__PURE__ */ jsxs(Stack, { horizontal: true, children: [
|
|
3660
3744
|
/* @__PURE__ */ jsx(
|
|
3661
|
-
|
|
3745
|
+
AttachFilled,
|
|
3662
3746
|
{
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
onChange: loadImage
|
|
3668
|
-
},
|
|
3669
|
-
"inline-image-upload"
|
|
3670
|
-
),
|
|
3671
|
-
/* @__PURE__ */ jsxs(Stack, { horizontal: true, children: [
|
|
3672
|
-
/* @__PURE__ */ jsx(
|
|
3673
|
-
AttachFilled,
|
|
3674
|
-
{
|
|
3675
|
-
style: {
|
|
3676
|
-
fontSize: "16px",
|
|
3677
|
-
color: disabled ? "var(--colorNeutralForegroundDisabled, #A6A6A6)" : "#808080",
|
|
3678
|
-
marginTop: 2
|
|
3679
|
-
}
|
|
3747
|
+
style: {
|
|
3748
|
+
fontSize: "16px",
|
|
3749
|
+
color: disabled ? "var(--colorNeutralForegroundDisabled, #A6A6A6)" : "#808080",
|
|
3750
|
+
marginTop: 2
|
|
3680
3751
|
}
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
] }) })
|
|
3713
|
-
]
|
|
3714
|
-
}
|
|
3715
|
-
);
|
|
3752
|
+
}
|
|
3753
|
+
),
|
|
3754
|
+
!fileName && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: "#808080" }, children: "Upload File" })
|
|
3755
|
+
] }),
|
|
3756
|
+
fileName && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: "#808080" }, children: fileName })
|
|
3757
|
+
]
|
|
3758
|
+
}
|
|
3759
|
+
) }),
|
|
3760
|
+
fileSizeError && /* @__PURE__ */ jsx(MessageBar, { intent: "error", style: { marginTop: 4 }, children: /* @__PURE__ */ jsx(MessageBarBody, { children: fileSizeError }) }),
|
|
3761
|
+
/* @__PURE__ */ jsx(Field, { label: "Alt Text", size: "small", children: /* @__PURE__ */ jsx(
|
|
3762
|
+
Input,
|
|
3763
|
+
{
|
|
3764
|
+
placeholder: "Alt text",
|
|
3765
|
+
appearance: "underline",
|
|
3766
|
+
disabled,
|
|
3767
|
+
onChange: (_, d) => setAltText(d.value),
|
|
3768
|
+
value: altText
|
|
3769
|
+
}
|
|
3770
|
+
) }),
|
|
3771
|
+
selectedValue === "URL" && /* @__PURE__ */ jsx(
|
|
3772
|
+
InsertImageByURL,
|
|
3773
|
+
{
|
|
3774
|
+
disabled,
|
|
3775
|
+
setIsOpen: (open) => setIsOpen(open),
|
|
3776
|
+
onClick: (payload) => onClick(payload)
|
|
3777
|
+
}
|
|
3778
|
+
)
|
|
3779
|
+
] })
|
|
3780
|
+
}
|
|
3781
|
+
)
|
|
3782
|
+
] });
|
|
3716
3783
|
};
|
|
3717
3784
|
var ImagesPlugin = ({ captionsEnabled }) => {
|
|
3718
3785
|
const [editor] = useLexicalComposerContext();
|
|
@@ -3962,135 +4029,132 @@ var InsertInlineImageDialog = ({
|
|
|
3962
4029
|
setFileName("");
|
|
3963
4030
|
setFileSizeError(null);
|
|
3964
4031
|
};
|
|
3965
|
-
return /* @__PURE__ */ jsxs(
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
4032
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4033
|
+
/* @__PURE__ */ jsx(
|
|
4034
|
+
Button,
|
|
4035
|
+
{
|
|
4036
|
+
size: "small",
|
|
4037
|
+
title: "Add Inline Image",
|
|
4038
|
+
disabled,
|
|
4039
|
+
icon: /* @__PURE__ */ jsx(ImageEditRegular, { style: { color: iconColor } }),
|
|
4040
|
+
style: {
|
|
4041
|
+
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
4042
|
+
border: "none",
|
|
4043
|
+
margin: 2,
|
|
4044
|
+
opacity: disabled ? 0.55 : 1,
|
|
4045
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
4046
|
+
},
|
|
4047
|
+
onClick: () => {
|
|
4048
|
+
if (disabled) return;
|
|
4049
|
+
setIsOpen((prev) => !prev);
|
|
4050
|
+
setAltText("");
|
|
4051
|
+
setSrc("");
|
|
4052
|
+
setFileName("");
|
|
4053
|
+
}
|
|
3971
4054
|
},
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
4055
|
+
"upload-inline-image"
|
|
4056
|
+
),
|
|
4057
|
+
/* @__PURE__ */ jsx(
|
|
4058
|
+
AoModal,
|
|
4059
|
+
{
|
|
4060
|
+
isOpen: disabled ? false : isOpen,
|
|
4061
|
+
onDismiss: () => !disabled && setIsOpen(false),
|
|
4062
|
+
title: "Insert inline image",
|
|
4063
|
+
maxWidth: 360,
|
|
4064
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4065
|
+
/* @__PURE__ */ jsx(
|
|
4066
|
+
Button,
|
|
4067
|
+
{
|
|
4068
|
+
size: "small",
|
|
4069
|
+
disabled: isDisabled,
|
|
4070
|
+
onClick: handleOnClick,
|
|
4071
|
+
children: "Add"
|
|
3986
4072
|
},
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4073
|
+
"file-inline-upload-btn"
|
|
4074
|
+
),
|
|
4075
|
+
/* @__PURE__ */ jsx(
|
|
4076
|
+
Button,
|
|
4077
|
+
{
|
|
4078
|
+
size: "small",
|
|
4079
|
+
disabled,
|
|
4080
|
+
onClick: () => setIsOpen(false),
|
|
4081
|
+
children: "Cancel"
|
|
4082
|
+
},
|
|
4083
|
+
"file-inline-upload-cancel"
|
|
4084
|
+
)
|
|
4085
|
+
] }),
|
|
4086
|
+
children: /* @__PURE__ */ jsxs(Stack, { tokens: { childrenGap: 8 }, children: [
|
|
4087
|
+
/* @__PURE__ */ jsx(Field, { label: "Upload", size: "small", children: /* @__PURE__ */ jsxs(
|
|
4088
|
+
"label",
|
|
4089
|
+
{
|
|
4090
|
+
style: {
|
|
4091
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
4092
|
+
display: "flex",
|
|
4093
|
+
alignItems: "center",
|
|
4094
|
+
gap: 8,
|
|
4095
|
+
opacity: disabled ? 0.75 : 1
|
|
4096
|
+
},
|
|
4097
|
+
children: [
|
|
4098
|
+
/* @__PURE__ */ jsx(
|
|
4099
|
+
"input",
|
|
4100
|
+
{
|
|
4101
|
+
type: "file",
|
|
4102
|
+
accept: "image/*",
|
|
4103
|
+
style: { display: "none" },
|
|
4104
|
+
disabled,
|
|
4105
|
+
onChange: loadImage
|
|
4106
|
+
},
|
|
4107
|
+
"inline-image-upload"
|
|
4108
|
+
),
|
|
4109
|
+
/* @__PURE__ */ jsxs(Stack, { horizontal: true, children: [
|
|
4011
4110
|
/* @__PURE__ */ jsx(
|
|
4012
|
-
|
|
4111
|
+
AttachFilled,
|
|
4013
4112
|
{
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
onChange: loadImage
|
|
4019
|
-
},
|
|
4020
|
-
"inline-image-upload"
|
|
4021
|
-
),
|
|
4022
|
-
/* @__PURE__ */ jsxs(Stack, { horizontal: true, children: [
|
|
4023
|
-
/* @__PURE__ */ jsx(
|
|
4024
|
-
AttachFilled,
|
|
4025
|
-
{
|
|
4026
|
-
style: {
|
|
4027
|
-
fontSize: "16px",
|
|
4028
|
-
color: disabled ? "var(--colorNeutralForegroundDisabled, #A6A6A6)" : "#808080",
|
|
4029
|
-
marginTop: 2
|
|
4030
|
-
}
|
|
4113
|
+
style: {
|
|
4114
|
+
fontSize: "16px",
|
|
4115
|
+
color: disabled ? "var(--colorNeutralForegroundDisabled, #A6A6A6)" : "#808080",
|
|
4116
|
+
marginTop: 2
|
|
4031
4117
|
}
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
size: "small",
|
|
4073
|
-
disabled: isDisabled,
|
|
4074
|
-
onClick: handleOnClick,
|
|
4075
|
-
children: "Add"
|
|
4076
|
-
},
|
|
4077
|
-
"file-inline-upload-btn"
|
|
4078
|
-
),
|
|
4079
|
-
/* @__PURE__ */ jsx(
|
|
4080
|
-
Button,
|
|
4081
|
-
{
|
|
4082
|
-
size: "small",
|
|
4083
|
-
disabled,
|
|
4084
|
-
onClick: () => setIsOpen(false),
|
|
4085
|
-
children: "Cancel"
|
|
4086
|
-
},
|
|
4087
|
-
"file-inline-upload-cancel"
|
|
4088
|
-
)
|
|
4089
|
-
] })
|
|
4090
|
-
] }) })
|
|
4091
|
-
]
|
|
4092
|
-
}
|
|
4093
|
-
);
|
|
4118
|
+
}
|
|
4119
|
+
),
|
|
4120
|
+
!fileName && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: "#808080" }, children: "Upload File" })
|
|
4121
|
+
] }),
|
|
4122
|
+
fileName && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: "#808080" }, children: fileName })
|
|
4123
|
+
]
|
|
4124
|
+
}
|
|
4125
|
+
) }),
|
|
4126
|
+
/* @__PURE__ */ jsx(Field, { label: "Position", size: "small", children: /* @__PURE__ */ jsxs(
|
|
4127
|
+
Dropdown,
|
|
4128
|
+
{
|
|
4129
|
+
className: styles.alignDropdown,
|
|
4130
|
+
disabled,
|
|
4131
|
+
value: position === "full" ? "Full" : position === "right" ? "Right" : "Left",
|
|
4132
|
+
selectedOptions: [position ?? "left"],
|
|
4133
|
+
listbox: { style: { width: "120px" } },
|
|
4134
|
+
root: { style: { borderBottom: "1px solid black" } },
|
|
4135
|
+
onOptionSelect: (_, data) => setPosition(data.optionValue),
|
|
4136
|
+
children: [
|
|
4137
|
+
/* @__PURE__ */ jsx(Option, { value: "left", children: "Left" }, "left"),
|
|
4138
|
+
/* @__PURE__ */ jsx(Option, { value: "right", children: "Right" }, "right"),
|
|
4139
|
+
/* @__PURE__ */ jsx(Option, { value: "full", children: "Full" }, "full")
|
|
4140
|
+
]
|
|
4141
|
+
}
|
|
4142
|
+
) }),
|
|
4143
|
+
fileSizeError && /* @__PURE__ */ jsx(MessageBar, { intent: "error", style: { marginTop: 4 }, children: /* @__PURE__ */ jsx(MessageBarBody, { children: fileSizeError }) }),
|
|
4144
|
+
/* @__PURE__ */ jsx(Field, { label: "Alt Text", size: "small", children: /* @__PURE__ */ jsx(
|
|
4145
|
+
Input,
|
|
4146
|
+
{
|
|
4147
|
+
placeholder: "Alt text",
|
|
4148
|
+
appearance: "underline",
|
|
4149
|
+
disabled,
|
|
4150
|
+
value: altText,
|
|
4151
|
+
onChange: (_, d) => setAltText(d.value)
|
|
4152
|
+
}
|
|
4153
|
+
) })
|
|
4154
|
+
] })
|
|
4155
|
+
}
|
|
4156
|
+
)
|
|
4157
|
+
] });
|
|
4094
4158
|
};
|
|
4095
4159
|
var InlineImagePlugin = () => {
|
|
4096
4160
|
const [editor] = useLexicalComposerContext();
|
|
@@ -4353,8 +4417,8 @@ function RefApiPlugin({
|
|
|
4353
4417
|
focusedRef
|
|
4354
4418
|
}) {
|
|
4355
4419
|
const [editor] = useLexicalComposerContext();
|
|
4356
|
-
const cleanBaselineRef =
|
|
4357
|
-
|
|
4420
|
+
const cleanBaselineRef = React10__default.useRef(null);
|
|
4421
|
+
React10__default.useEffect(() => {
|
|
4358
4422
|
const capture = () => {
|
|
4359
4423
|
if (cleanBaselineRef.current === null) {
|
|
4360
4424
|
cleanBaselineRef.current = getUserContentSignature(editor);
|
|
@@ -4568,28 +4632,28 @@ function SpellPopover({
|
|
|
4568
4632
|
onImprove,
|
|
4569
4633
|
onAcceptGrammar
|
|
4570
4634
|
}) {
|
|
4571
|
-
const ref =
|
|
4635
|
+
const ref = React10.useRef(null);
|
|
4572
4636
|
const type = state.issue.type ?? "spelling";
|
|
4573
|
-
const [pos, setPos] =
|
|
4574
|
-
|
|
4637
|
+
const [pos, setPos] = React10.useState({ left: state.x, top: state.y });
|
|
4638
|
+
React10.useEffect(() => {
|
|
4575
4639
|
if (!ref.current) return;
|
|
4576
4640
|
const { offsetHeight: h, offsetWidth: w } = ref.current;
|
|
4577
4641
|
const top = state.y + h > window.innerHeight - 8 ? state.y - h - 32 : state.y;
|
|
4578
4642
|
setPos({ left: Math.min(state.x, window.innerWidth - w - 8), top });
|
|
4579
4643
|
}, [state.x, state.y]);
|
|
4580
|
-
|
|
4644
|
+
React10.useEffect(() => {
|
|
4581
4645
|
const h = (e) => {
|
|
4582
4646
|
if (ref.current && !ref.current.contains(e.target)) onClose();
|
|
4583
4647
|
};
|
|
4584
4648
|
document.addEventListener("mousedown", h, true);
|
|
4585
4649
|
return () => document.removeEventListener("mousedown", h, true);
|
|
4586
4650
|
}, [onClose]);
|
|
4587
|
-
|
|
4651
|
+
React10.useEffect(() => {
|
|
4588
4652
|
const h = () => onClose();
|
|
4589
4653
|
window.addEventListener("scroll", h, { capture: true, passive: true });
|
|
4590
4654
|
return () => window.removeEventListener("scroll", h, true);
|
|
4591
4655
|
}, [onClose]);
|
|
4592
|
-
|
|
4656
|
+
React10.useEffect(() => {
|
|
4593
4657
|
const h = (e) => {
|
|
4594
4658
|
if (e.key === "Escape") onClose();
|
|
4595
4659
|
};
|
|
@@ -4706,17 +4770,17 @@ function SpellCheckPlugin({
|
|
|
4706
4770
|
enabled = true
|
|
4707
4771
|
}) {
|
|
4708
4772
|
const [editor] = useLexicalComposerContext();
|
|
4709
|
-
const timerRef =
|
|
4710
|
-
const dismissRef =
|
|
4711
|
-
const reqIdRef =
|
|
4712
|
-
const lastTextRef =
|
|
4713
|
-
const applyingRef =
|
|
4714
|
-
const grammarCorrectionRef =
|
|
4715
|
-
const [popover, setPopover] =
|
|
4716
|
-
|
|
4773
|
+
const timerRef = React10.useRef(null);
|
|
4774
|
+
const dismissRef = React10.useRef(null);
|
|
4775
|
+
const reqIdRef = React10.useRef(0);
|
|
4776
|
+
const lastTextRef = React10.useRef("");
|
|
4777
|
+
const applyingRef = React10.useRef(false);
|
|
4778
|
+
const grammarCorrectionRef = React10.useRef(void 0);
|
|
4779
|
+
const [popover, setPopover] = React10.useState(null);
|
|
4780
|
+
React10.useEffect(() => {
|
|
4717
4781
|
injectCSS();
|
|
4718
4782
|
}, []);
|
|
4719
|
-
const clearErrors =
|
|
4783
|
+
const clearErrors = React10.useCallback(() => {
|
|
4720
4784
|
setPopover(null);
|
|
4721
4785
|
grammarCorrectionRef.current = void 0;
|
|
4722
4786
|
applyingRef.current = true;
|
|
@@ -4732,7 +4796,7 @@ function SpellCheckPlugin({
|
|
|
4732
4796
|
}
|
|
4733
4797
|
);
|
|
4734
4798
|
}, [editor]);
|
|
4735
|
-
const applyIssues =
|
|
4799
|
+
const applyIssues = React10.useCallback(
|
|
4736
4800
|
(issues, improvedText, trimOffset = 0) => {
|
|
4737
4801
|
let savedCharOffset = -1;
|
|
4738
4802
|
editor.getEditorState().read(() => {
|
|
@@ -4875,7 +4939,7 @@ function SpellCheckPlugin({
|
|
|
4875
4939
|
},
|
|
4876
4940
|
[editor]
|
|
4877
4941
|
);
|
|
4878
|
-
|
|
4942
|
+
React10.useEffect(() => {
|
|
4879
4943
|
let currentRoot = null;
|
|
4880
4944
|
const onClick = (e) => {
|
|
4881
4945
|
const span = e.target.closest("[data-spell-offset]");
|
|
@@ -4919,7 +4983,7 @@ function SpellCheckPlugin({
|
|
|
4919
4983
|
if (currentRoot) currentRoot.removeEventListener("click", onClick);
|
|
4920
4984
|
};
|
|
4921
4985
|
}, [editor]);
|
|
4922
|
-
const handleAccept =
|
|
4986
|
+
const handleAccept = React10.useCallback(
|
|
4923
4987
|
(replacement, nodeKey) => {
|
|
4924
4988
|
let original = "";
|
|
4925
4989
|
editor.getEditorState().read(() => {
|
|
@@ -4945,7 +5009,7 @@ function SpellCheckPlugin({
|
|
|
4945
5009
|
},
|
|
4946
5010
|
[editor, onSpellCheckAccept, popover]
|
|
4947
5011
|
);
|
|
4948
|
-
const handleDismiss =
|
|
5012
|
+
const handleDismiss = React10.useCallback(
|
|
4949
5013
|
(nodeKey) => {
|
|
4950
5014
|
editor.update(
|
|
4951
5015
|
() => {
|
|
@@ -4959,7 +5023,7 @@ function SpellCheckPlugin({
|
|
|
4959
5023
|
},
|
|
4960
5024
|
[editor]
|
|
4961
5025
|
);
|
|
4962
|
-
const handleImprove =
|
|
5026
|
+
const handleImprove = React10.useCallback(
|
|
4963
5027
|
(text) => {
|
|
4964
5028
|
const original = lastTextRef.current;
|
|
4965
5029
|
applyingRef.current = true;
|
|
@@ -4979,7 +5043,7 @@ function SpellCheckPlugin({
|
|
|
4979
5043
|
},
|
|
4980
5044
|
[editor, onSpellCheckAccept]
|
|
4981
5045
|
);
|
|
4982
|
-
const handleAcceptGrammar =
|
|
5046
|
+
const handleAcceptGrammar = React10.useCallback(
|
|
4983
5047
|
(corrected) => {
|
|
4984
5048
|
const original = lastTextRef.current;
|
|
4985
5049
|
applyingRef.current = true;
|
|
@@ -4999,7 +5063,7 @@ function SpellCheckPlugin({
|
|
|
4999
5063
|
},
|
|
5000
5064
|
[editor, onSpellCheckAccept]
|
|
5001
5065
|
);
|
|
5002
|
-
|
|
5066
|
+
React10.useEffect(() => {
|
|
5003
5067
|
if (!enabled || !useSpellCheck) return;
|
|
5004
5068
|
return editor.registerUpdateListener(({ tags }) => {
|
|
5005
5069
|
if (applyingRef.current) return;
|
|
@@ -5037,13 +5101,13 @@ function SpellCheckPlugin({
|
|
|
5037
5101
|
}, idleMs);
|
|
5038
5102
|
});
|
|
5039
5103
|
}, [editor, useSpellCheck, enabled, idleMs, applyIssues, clearErrors]);
|
|
5040
|
-
|
|
5104
|
+
React10.useEffect(() => {
|
|
5041
5105
|
if (!enabled) {
|
|
5042
5106
|
clearErrors();
|
|
5043
5107
|
lastTextRef.current = "";
|
|
5044
5108
|
}
|
|
5045
5109
|
}, [enabled, clearErrors]);
|
|
5046
|
-
|
|
5110
|
+
React10.useEffect(
|
|
5047
5111
|
() => () => {
|
|
5048
5112
|
dismissRef.current?.();
|
|
5049
5113
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
@@ -5064,13 +5128,13 @@ function SpellCheckPlugin({
|
|
|
5064
5128
|
}
|
|
5065
5129
|
function TableActionMenuPlugin({ disabled = false }) {
|
|
5066
5130
|
const [editor] = useLexicalComposerContext();
|
|
5067
|
-
const [isInTable, setIsInTable] =
|
|
5068
|
-
const [anchorRect, setAnchorRect] =
|
|
5069
|
-
const [contentRight, setContentRight] =
|
|
5070
|
-
const [open, setOpen] =
|
|
5071
|
-
const openRef =
|
|
5072
|
-
const savedAnchorRef =
|
|
5073
|
-
const measureContentRight =
|
|
5131
|
+
const [isInTable, setIsInTable] = React10.useState(false);
|
|
5132
|
+
const [anchorRect, setAnchorRect] = React10.useState(null);
|
|
5133
|
+
const [contentRight, setContentRight] = React10.useState(null);
|
|
5134
|
+
const [open, setOpen] = React10.useState(false);
|
|
5135
|
+
const openRef = React10.useRef(false);
|
|
5136
|
+
const savedAnchorRef = React10.useRef(null);
|
|
5137
|
+
const measureContentRight = React10.useCallback((cellDom) => {
|
|
5074
5138
|
try {
|
|
5075
5139
|
const range = document.createRange();
|
|
5076
5140
|
range.selectNodeContents(cellDom);
|
|
@@ -5080,7 +5144,7 @@ function TableActionMenuPlugin({ disabled = false }) {
|
|
|
5080
5144
|
return null;
|
|
5081
5145
|
}
|
|
5082
5146
|
}, []);
|
|
5083
|
-
const updateFromSelection =
|
|
5147
|
+
const updateFromSelection = React10.useCallback(() => {
|
|
5084
5148
|
if (openRef.current) return;
|
|
5085
5149
|
const root = editor.getRootElement();
|
|
5086
5150
|
if (!root) return;
|
|
@@ -5131,7 +5195,7 @@ function TableActionMenuPlugin({ disabled = false }) {
|
|
|
5131
5195
|
}
|
|
5132
5196
|
});
|
|
5133
5197
|
}, [editor, measureContentRight]);
|
|
5134
|
-
|
|
5198
|
+
React10.useEffect(() => {
|
|
5135
5199
|
return mergeRegister(
|
|
5136
5200
|
editor.registerCommand(
|
|
5137
5201
|
SELECTION_CHANGE_COMMAND,
|
|
@@ -5146,7 +5210,7 @@ function TableActionMenuPlugin({ disabled = false }) {
|
|
|
5146
5210
|
})
|
|
5147
5211
|
);
|
|
5148
5212
|
}, [editor, updateFromSelection]);
|
|
5149
|
-
|
|
5213
|
+
React10.useEffect(() => {
|
|
5150
5214
|
return editor.registerCommand(
|
|
5151
5215
|
KEY_DOWN_COMMAND,
|
|
5152
5216
|
(event) => {
|
|
@@ -5188,7 +5252,7 @@ function TableActionMenuPlugin({ disabled = false }) {
|
|
|
5188
5252
|
);
|
|
5189
5253
|
}, [editor, disabled]);
|
|
5190
5254
|
const canShow = isInTable && !!anchorRect && !disabled;
|
|
5191
|
-
const handleStyle =
|
|
5255
|
+
const handleStyle = React10.useMemo(() => {
|
|
5192
5256
|
if (!anchorRect) return void 0;
|
|
5193
5257
|
const top = Math.max(8, anchorRect.top + 6);
|
|
5194
5258
|
const clampedCellRight = Math.min(anchorRect.right, window.innerWidth - 8);
|
|
@@ -5203,7 +5267,7 @@ function TableActionMenuPlugin({ disabled = false }) {
|
|
|
5203
5267
|
const dangerStyle = {
|
|
5204
5268
|
color: "var(--colorPaletteRedForeground1)"
|
|
5205
5269
|
};
|
|
5206
|
-
const run =
|
|
5270
|
+
const run = React10.useCallback(
|
|
5207
5271
|
(fn) => {
|
|
5208
5272
|
if (disabled) return;
|
|
5209
5273
|
openRef.current = false;
|
|
@@ -5764,22 +5828,22 @@ var hsvToRgb = (h, s, v) => {
|
|
|
5764
5828
|
};
|
|
5765
5829
|
};
|
|
5766
5830
|
var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange }) => {
|
|
5767
|
-
const [open, setOpen] =
|
|
5768
|
-
const btnRef =
|
|
5769
|
-
const setOpenAndNotify =
|
|
5831
|
+
const [open, setOpen] = React10.useState(false);
|
|
5832
|
+
const btnRef = React10.useRef(null);
|
|
5833
|
+
const setOpenAndNotify = React10.useCallback(
|
|
5770
5834
|
(next) => {
|
|
5771
5835
|
setOpen(next);
|
|
5772
5836
|
onOpenChange?.(next);
|
|
5773
5837
|
},
|
|
5774
5838
|
[onOpenChange]
|
|
5775
5839
|
);
|
|
5776
|
-
const handleDismiss =
|
|
5777
|
-
const preventDismissOnEvent =
|
|
5840
|
+
const handleDismiss = React10.useCallback(() => setOpenAndNotify(false), [setOpenAndNotify]);
|
|
5841
|
+
const preventDismissOnEvent = React10.useCallback(
|
|
5778
5842
|
(ev) => ev.type !== "click",
|
|
5779
5843
|
[]
|
|
5780
5844
|
);
|
|
5781
|
-
const [, forceReposition] =
|
|
5782
|
-
|
|
5845
|
+
const [, forceReposition] = React10.useState(0);
|
|
5846
|
+
React10.useEffect(() => {
|
|
5783
5847
|
if (!open) return;
|
|
5784
5848
|
let rafId = null;
|
|
5785
5849
|
const reposition = () => {
|
|
@@ -5797,15 +5861,15 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5797
5861
|
window.removeEventListener("resize", reposition);
|
|
5798
5862
|
};
|
|
5799
5863
|
}, [open]);
|
|
5800
|
-
const appliedHex =
|
|
5801
|
-
const [hex, setHexState] =
|
|
5802
|
-
const [hexText, setHexText] =
|
|
5803
|
-
const { r, g, b } =
|
|
5804
|
-
const hsv =
|
|
5805
|
-
const [h, setH] =
|
|
5806
|
-
const [s, setS] =
|
|
5807
|
-
const [v, setV] =
|
|
5808
|
-
const commit =
|
|
5864
|
+
const appliedHex = React10.useMemo(() => normalizeHex(value || "#000000"), [value]);
|
|
5865
|
+
const [hex, setHexState] = React10.useState(appliedHex);
|
|
5866
|
+
const [hexText, setHexText] = React10.useState(appliedHex);
|
|
5867
|
+
const { r, g, b } = React10.useMemo(() => hexToRgb(hex), [hex]);
|
|
5868
|
+
const hsv = React10.useMemo(() => rgbToHsv(r, g, b), [r, g, b]);
|
|
5869
|
+
const [h, setH] = React10.useState(hsv.h);
|
|
5870
|
+
const [s, setS] = React10.useState(hsv.s);
|
|
5871
|
+
const [v, setV] = React10.useState(hsv.v);
|
|
5872
|
+
const commit = React10.useCallback(
|
|
5809
5873
|
(nextHex) => {
|
|
5810
5874
|
const rgb = hexToRgb(nextHex);
|
|
5811
5875
|
const next = rgbToHsv(rgb.r, rgb.g, rgb.b);
|
|
@@ -5818,7 +5882,7 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5818
5882
|
},
|
|
5819
5883
|
[onChange]
|
|
5820
5884
|
);
|
|
5821
|
-
const commitFromHsv =
|
|
5885
|
+
const commitFromHsv = React10.useCallback(
|
|
5822
5886
|
(hh, ss, vv) => {
|
|
5823
5887
|
const rgb = hsvToRgb(hh, ss, vv);
|
|
5824
5888
|
const nextHex = rgbToHex(rgb.r, rgb.g, rgb.b);
|
|
@@ -5831,8 +5895,8 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5831
5895
|
},
|
|
5832
5896
|
[onChange]
|
|
5833
5897
|
);
|
|
5834
|
-
const wasOpenRef =
|
|
5835
|
-
|
|
5898
|
+
const wasOpenRef = React10.useRef(open);
|
|
5899
|
+
React10.useEffect(() => {
|
|
5836
5900
|
const justOpened = open && !wasOpenRef.current;
|
|
5837
5901
|
wasOpenRef.current = open;
|
|
5838
5902
|
if (!justOpened) return;
|
|
@@ -5844,8 +5908,8 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5844
5908
|
setS(next.s);
|
|
5845
5909
|
setV(next.v);
|
|
5846
5910
|
}, [appliedHex, open]);
|
|
5847
|
-
const svRef =
|
|
5848
|
-
const svPointFromEvent =
|
|
5911
|
+
const svRef = React10.useRef(null);
|
|
5912
|
+
const svPointFromEvent = React10.useCallback((clientX, clientY) => {
|
|
5849
5913
|
if (!svRef.current) return null;
|
|
5850
5914
|
const rect = svRef.current.getBoundingClientRect();
|
|
5851
5915
|
const x = clamp3(clientX - rect.left, 0, rect.width);
|
|
@@ -5854,9 +5918,9 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5854
5918
|
const vv = rect.height === 0 ? 0 : 1 - y / rect.height;
|
|
5855
5919
|
return { ss, vv };
|
|
5856
5920
|
}, []);
|
|
5857
|
-
const hRef =
|
|
5921
|
+
const hRef = React10.useRef(h);
|
|
5858
5922
|
hRef.current = h;
|
|
5859
|
-
const handleSVPointerDown =
|
|
5923
|
+
const handleSVPointerDown = React10.useCallback(
|
|
5860
5924
|
(e) => {
|
|
5861
5925
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
5862
5926
|
const pt = svPointFromEvent(e.clientX, e.clientY);
|
|
@@ -5864,7 +5928,7 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5864
5928
|
},
|
|
5865
5929
|
[svPointFromEvent, commitFromHsv]
|
|
5866
5930
|
);
|
|
5867
|
-
const handleSVPointerMove =
|
|
5931
|
+
const handleSVPointerMove = React10.useCallback(
|
|
5868
5932
|
(e) => {
|
|
5869
5933
|
if (e.buttons !== 1) return;
|
|
5870
5934
|
const pt = svPointFromEvent(e.clientX, e.clientY);
|
|
@@ -5872,18 +5936,18 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5872
5936
|
},
|
|
5873
5937
|
[svPointFromEvent, commitFromHsv]
|
|
5874
5938
|
);
|
|
5875
|
-
const hueRef =
|
|
5876
|
-
const sRef =
|
|
5939
|
+
const hueRef = React10.useRef(null);
|
|
5940
|
+
const sRef = React10.useRef(s);
|
|
5877
5941
|
sRef.current = s;
|
|
5878
|
-
const vRef =
|
|
5942
|
+
const vRef = React10.useRef(v);
|
|
5879
5943
|
vRef.current = v;
|
|
5880
|
-
const huePointFromEvent =
|
|
5944
|
+
const huePointFromEvent = React10.useCallback((clientX) => {
|
|
5881
5945
|
if (!hueRef.current) return null;
|
|
5882
5946
|
const rect = hueRef.current.getBoundingClientRect();
|
|
5883
5947
|
const x = clamp3(clientX - rect.left, 0, rect.width);
|
|
5884
5948
|
return rect.width === 0 ? 0 : x / rect.width * 360;
|
|
5885
5949
|
}, []);
|
|
5886
|
-
const handleHuePointerDown =
|
|
5950
|
+
const handleHuePointerDown = React10.useCallback(
|
|
5887
5951
|
(e) => {
|
|
5888
5952
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
5889
5953
|
const hh = huePointFromEvent(e.clientX);
|
|
@@ -5891,7 +5955,7 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5891
5955
|
},
|
|
5892
5956
|
[huePointFromEvent, commitFromHsv]
|
|
5893
5957
|
);
|
|
5894
|
-
const handleHuePointerMove =
|
|
5958
|
+
const handleHuePointerMove = React10.useCallback(
|
|
5895
5959
|
(e) => {
|
|
5896
5960
|
if (e.buttons !== 1) return;
|
|
5897
5961
|
const hh = huePointFromEvent(e.clientX);
|
|
@@ -5899,7 +5963,7 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5899
5963
|
},
|
|
5900
5964
|
[huePointFromEvent, commitFromHsv]
|
|
5901
5965
|
);
|
|
5902
|
-
const handleHexChange =
|
|
5966
|
+
const handleHexChange = React10.useCallback(
|
|
5903
5967
|
(_, val) => {
|
|
5904
5968
|
const next = val ?? "";
|
|
5905
5969
|
setHexText(next);
|
|
@@ -5907,12 +5971,12 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
5907
5971
|
},
|
|
5908
5972
|
[commit]
|
|
5909
5973
|
);
|
|
5910
|
-
const handleHexBlur =
|
|
5974
|
+
const handleHexBlur = React10.useCallback(() => {
|
|
5911
5975
|
commit(normalizeHex(hexText));
|
|
5912
5976
|
}, [hexText, commit]);
|
|
5913
|
-
const svThumb =
|
|
5914
|
-
const hueThumb =
|
|
5915
|
-
const hueColor =
|
|
5977
|
+
const svThumb = React10.useMemo(() => ({ left: `${s * 100}%`, top: `${(1 - v) * 100}%` }), [s, v]);
|
|
5978
|
+
const hueThumb = React10.useMemo(() => ({ left: `${h / 360 * 100}%` }), [h]);
|
|
5979
|
+
const hueColor = React10.useMemo(() => {
|
|
5916
5980
|
const { r: r2, g: g2, b: b2 } = hsvToRgb(h, 1, 1);
|
|
5917
5981
|
return rgbToHex(r2, g2, b2);
|
|
5918
5982
|
}, [h]);
|
|
@@ -6158,8 +6222,8 @@ var ColorPickerControl = ({ value, title, disabled, onChange, icon, onOpenChange
|
|
|
6158
6222
|
};
|
|
6159
6223
|
var ColorPickerPlugin = ({ disabled }) => {
|
|
6160
6224
|
const [editor] = useLexicalComposerContext();
|
|
6161
|
-
const [{ color, bgColor }, setColors] =
|
|
6162
|
-
const lastRangeSelectionRef =
|
|
6225
|
+
const [{ color, bgColor }, setColors] = React10__default.useState({ color: "#000000", bgColor: "#ffffff" });
|
|
6226
|
+
const lastRangeSelectionRef = React10__default.useRef(null);
|
|
6163
6227
|
const updateToolbar = () => {
|
|
6164
6228
|
const selection = $getSelection();
|
|
6165
6229
|
if ($isRangeSelection(selection)) {
|
|
@@ -6169,7 +6233,7 @@ var ColorPickerPlugin = ({ disabled }) => {
|
|
|
6169
6233
|
setColors({ color: c, bgColor: bg });
|
|
6170
6234
|
}
|
|
6171
6235
|
};
|
|
6172
|
-
|
|
6236
|
+
React10__default.useEffect(() => {
|
|
6173
6237
|
return mergeRegister(
|
|
6174
6238
|
editor.registerUpdateListener(({ editorState }) => {
|
|
6175
6239
|
editorState.read(() => updateToolbar());
|
|
@@ -6184,7 +6248,7 @@ var ColorPickerPlugin = ({ disabled }) => {
|
|
|
6184
6248
|
)
|
|
6185
6249
|
);
|
|
6186
6250
|
}, [editor]);
|
|
6187
|
-
const wasEditorActiveRef =
|
|
6251
|
+
const wasEditorActiveRef = React10__default.useRef(false);
|
|
6188
6252
|
const handleOpenChange = (open) => {
|
|
6189
6253
|
if (open) {
|
|
6190
6254
|
const root = editor.getRootElement();
|
|
@@ -6402,9 +6466,9 @@ var useStyles3 = makeStyles({
|
|
|
6402
6466
|
var FontSizePlugin = ({ disabled }) => {
|
|
6403
6467
|
const [editor] = useLexicalComposerContext();
|
|
6404
6468
|
const styles = useStyles3();
|
|
6405
|
-
const [fontSize2, setFontSize] =
|
|
6469
|
+
const [fontSize2, setFontSize] = React10.useState(String(DEFAULT_FONT_SIZE));
|
|
6406
6470
|
const fg = disabled ? "var(--colorNeutralForegroundDisabled, #A6A6A6)" : "#333333";
|
|
6407
|
-
|
|
6471
|
+
React10.useEffect(() => {
|
|
6408
6472
|
const readFontSize = () => {
|
|
6409
6473
|
const selection = $getSelection();
|
|
6410
6474
|
if ($isRangeSelection(selection)) {
|
|
@@ -6591,79 +6655,76 @@ var TableItemPlugin = ({ disabled }) => {
|
|
|
6591
6655
|
setColumns("");
|
|
6592
6656
|
setIsOpen(false);
|
|
6593
6657
|
};
|
|
6594
|
-
return /* @__PURE__ */ jsxs(
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6658
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6659
|
+
/* @__PURE__ */ jsx(
|
|
6660
|
+
Button,
|
|
6661
|
+
{
|
|
6662
|
+
size: "small",
|
|
6663
|
+
title: "Add table",
|
|
6664
|
+
disabled,
|
|
6665
|
+
icon: /* @__PURE__ */ jsx(TableAddRegular, { style: { color: iconColor } }),
|
|
6666
|
+
style: {
|
|
6667
|
+
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
6668
|
+
border: "none",
|
|
6669
|
+
margin: 2,
|
|
6670
|
+
opacity: disabled ? 0.55 : 1,
|
|
6671
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
6672
|
+
},
|
|
6673
|
+
onClick: () => {
|
|
6674
|
+
if (disabled) return;
|
|
6675
|
+
setIsOpen((prev) => !prev);
|
|
6676
|
+
setRows("");
|
|
6677
|
+
setColumns("");
|
|
6678
|
+
}
|
|
6600
6679
|
},
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
setRows("");
|
|
6620
|
-
setColumns("");
|
|
6680
|
+
"insert-table-nodes"
|
|
6681
|
+
),
|
|
6682
|
+
/* @__PURE__ */ jsx(
|
|
6683
|
+
AoModal,
|
|
6684
|
+
{
|
|
6685
|
+
isOpen: disabled ? false : isOpen,
|
|
6686
|
+
onDismiss: () => !disabled && setIsOpen(false),
|
|
6687
|
+
title: "Insert table",
|
|
6688
|
+
maxWidth: 300,
|
|
6689
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6690
|
+
/* @__PURE__ */ jsx(
|
|
6691
|
+
Button,
|
|
6692
|
+
{
|
|
6693
|
+
size: "small",
|
|
6694
|
+
appearance: "primary",
|
|
6695
|
+
disabled: disabled || !rows || !columns,
|
|
6696
|
+
onClick: onAddTable,
|
|
6697
|
+
children: "Add"
|
|
6621
6698
|
}
|
|
6622
|
-
|
|
6623
|
-
"
|
|
6624
|
-
|
|
6625
|
-
/* @__PURE__ */
|
|
6626
|
-
/* @__PURE__ */ jsx(
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
/* @__PURE__ */ jsx(
|
|
6652
|
-
Button,
|
|
6653
|
-
{
|
|
6654
|
-
size: "small",
|
|
6655
|
-
appearance: "primary",
|
|
6656
|
-
disabled: disabled || !rows || !columns,
|
|
6657
|
-
onClick: onAddTable,
|
|
6658
|
-
children: "Add"
|
|
6659
|
-
}
|
|
6660
|
-
),
|
|
6661
|
-
/* @__PURE__ */ jsx(Button, { size: "small", disabled, onClick: () => setIsOpen(false), children: "Cancel" })
|
|
6662
|
-
] })
|
|
6663
|
-
] }) })
|
|
6664
|
-
]
|
|
6665
|
-
}
|
|
6666
|
-
);
|
|
6699
|
+
),
|
|
6700
|
+
/* @__PURE__ */ jsx(Button, { size: "small", disabled, onClick: () => setIsOpen(false), children: "Cancel" })
|
|
6701
|
+
] }),
|
|
6702
|
+
children: /* @__PURE__ */ jsxs(Stack, { tokens: { childrenGap: 8 }, children: [
|
|
6703
|
+
/* @__PURE__ */ jsx(Field, { label: "Rows", size: "small", children: /* @__PURE__ */ jsx(
|
|
6704
|
+
Input,
|
|
6705
|
+
{
|
|
6706
|
+
autoFocus: !disabled,
|
|
6707
|
+
value: rows,
|
|
6708
|
+
placeholder: "Rows",
|
|
6709
|
+
appearance: "underline",
|
|
6710
|
+
disabled,
|
|
6711
|
+
onChange: (_, v) => setRows(v.value)
|
|
6712
|
+
}
|
|
6713
|
+
) }),
|
|
6714
|
+
/* @__PURE__ */ jsx(Field, { label: "Columns", size: "small", children: /* @__PURE__ */ jsx(
|
|
6715
|
+
Input,
|
|
6716
|
+
{
|
|
6717
|
+
value: columns,
|
|
6718
|
+
placeholder: "Columns",
|
|
6719
|
+
appearance: "underline",
|
|
6720
|
+
disabled,
|
|
6721
|
+
onChange: (_, v) => setColumns(v.value)
|
|
6722
|
+
}
|
|
6723
|
+
) })
|
|
6724
|
+
] })
|
|
6725
|
+
}
|
|
6726
|
+
)
|
|
6727
|
+
] });
|
|
6667
6728
|
};
|
|
6668
6729
|
var YoutubeUploadPlugin = ({ disabled }) => {
|
|
6669
6730
|
const [url, setURL] = useState("");
|
|
@@ -6683,57 +6744,54 @@ var YoutubeUploadPlugin = ({ disabled }) => {
|
|
|
6683
6744
|
setURL("");
|
|
6684
6745
|
setIsOpen(false);
|
|
6685
6746
|
};
|
|
6686
|
-
return /* @__PURE__ */ jsxs(
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6747
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6748
|
+
/* @__PURE__ */ jsx(
|
|
6749
|
+
Button,
|
|
6750
|
+
{
|
|
6751
|
+
title: "Add youtube URL",
|
|
6752
|
+
size: "small",
|
|
6753
|
+
disabled,
|
|
6754
|
+
icon: /* @__PURE__ */ jsx(VideoClipRegular, { style: { color: iconColor } }),
|
|
6755
|
+
style: {
|
|
6756
|
+
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
6757
|
+
border: "none",
|
|
6758
|
+
margin: 2,
|
|
6759
|
+
opacity: disabled ? 0.55 : 1,
|
|
6760
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
6761
|
+
},
|
|
6762
|
+
onClick: () => {
|
|
6763
|
+
if (disabled) return;
|
|
6764
|
+
setIsOpen((prev) => !prev);
|
|
6765
|
+
setURL("");
|
|
6766
|
+
}
|
|
6692
6767
|
},
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6768
|
+
"upload-video"
|
|
6769
|
+
),
|
|
6770
|
+
/* @__PURE__ */ jsx(
|
|
6771
|
+
AoModal,
|
|
6772
|
+
{
|
|
6773
|
+
isOpen: disabled ? false : isOpen,
|
|
6774
|
+
onDismiss: () => !disabled && setIsOpen(false),
|
|
6775
|
+
title: "Embed YouTube video",
|
|
6776
|
+
maxWidth: 320,
|
|
6777
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6778
|
+
/* @__PURE__ */ jsx(Button, { size: "small", disabled: disabled || !url, onClick: onHandleEmbeded, children: "Add" }),
|
|
6779
|
+
/* @__PURE__ */ jsx(Button, { size: "small", disabled, onClick: () => setIsOpen(false), children: "Cancel" })
|
|
6780
|
+
] }),
|
|
6781
|
+
children: /* @__PURE__ */ jsx(Stack, { tokens: { childrenGap: 8 }, children: /* @__PURE__ */ jsx(Field, { label: "URL", size: "small", children: /* @__PURE__ */ jsx(
|
|
6782
|
+
Input,
|
|
6696
6783
|
{
|
|
6697
|
-
|
|
6698
|
-
size: "small",
|
|
6784
|
+
autoFocus: !disabled,
|
|
6699
6785
|
disabled,
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
if (disabled) return;
|
|
6710
|
-
setIsOpen((prev) => !prev);
|
|
6711
|
-
setURL("");
|
|
6712
|
-
}
|
|
6713
|
-
},
|
|
6714
|
-
"upload-video"
|
|
6715
|
-
) }),
|
|
6716
|
-
/* @__PURE__ */ jsx(DialogSurface, { style: { maxWidth: 320 }, children: /* @__PURE__ */ jsxs(DialogBody, { children: [
|
|
6717
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: "Embed YouTube video" }),
|
|
6718
|
-
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(Stack, { tokens: { childrenGap: 8 }, children: /* @__PURE__ */ jsx(Field, { label: "URL", size: "small", children: /* @__PURE__ */ jsx(
|
|
6719
|
-
Input,
|
|
6720
|
-
{
|
|
6721
|
-
autoFocus: !disabled,
|
|
6722
|
-
disabled,
|
|
6723
|
-
value: url,
|
|
6724
|
-
appearance: "underline",
|
|
6725
|
-
placeholder: "Add Youtube video URL",
|
|
6726
|
-
onChange: (_, v) => setURL(v.value)
|
|
6727
|
-
}
|
|
6728
|
-
) }) }) }),
|
|
6729
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
6730
|
-
/* @__PURE__ */ jsx(Button, { size: "small", disabled: disabled || !url, onClick: onHandleEmbeded, children: "Add" }),
|
|
6731
|
-
/* @__PURE__ */ jsx(Button, { size: "small", disabled, onClick: () => setIsOpen(false), children: "Cancel" })
|
|
6732
|
-
] })
|
|
6733
|
-
] }) })
|
|
6734
|
-
]
|
|
6735
|
-
}
|
|
6736
|
-
);
|
|
6786
|
+
value: url,
|
|
6787
|
+
appearance: "underline",
|
|
6788
|
+
placeholder: "Add Youtube video URL",
|
|
6789
|
+
onChange: (_, v) => setURL(v.value)
|
|
6790
|
+
}
|
|
6791
|
+
) }) })
|
|
6792
|
+
}
|
|
6793
|
+
)
|
|
6794
|
+
] });
|
|
6737
6795
|
};
|
|
6738
6796
|
var TextAlphaListLtrFilled = ({ style }) => /* @__PURE__ */ jsxs("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", style, children: [
|
|
6739
6797
|
/* @__PURE__ */ jsx("path", { d: "M8.75 4a.75.75 0 1 0 0 1.5h7.5a.75.75 0 0 0 0-1.5h-7.5Z" }),
|
|
@@ -6815,8 +6873,9 @@ var ToolBarPlugins = (props) => {
|
|
|
6815
6873
|
const [isLowercase, setIsLowercase] = useState(false);
|
|
6816
6874
|
const [isCapitalize, setIsCapitalize] = useState(false);
|
|
6817
6875
|
const [alignment, setAlignment] = useState("left");
|
|
6876
|
+
const [hasTextSelection, setHasTextSelection] = useState(false);
|
|
6818
6877
|
const [decoratorOpen, setDecoratorOpen] = useState(false);
|
|
6819
|
-
const decoratorSelectingRef =
|
|
6878
|
+
const decoratorSelectingRef = React10__default.useRef(false);
|
|
6820
6879
|
const presetGroups = props.customToolbar ?? getToolbarGroupsByLevel(props.level);
|
|
6821
6880
|
const pluginGroups = useMemo(() => sanitizePluginGroups(presetGroups), [presetGroups]);
|
|
6822
6881
|
const updateToolbarPlugins = () => {
|
|
@@ -6833,8 +6892,10 @@ var ToolBarPlugins = (props) => {
|
|
|
6833
6892
|
setIsLowercase(false);
|
|
6834
6893
|
setIsCapitalize(false);
|
|
6835
6894
|
setSelectNodeType("paragraph");
|
|
6895
|
+
setHasTextSelection(false);
|
|
6836
6896
|
return;
|
|
6837
6897
|
}
|
|
6898
|
+
setHasTextSelection(!selection.isCollapsed());
|
|
6838
6899
|
setIsBold(selection.hasFormat("bold"));
|
|
6839
6900
|
setIsItalic(selection.hasFormat("italic"));
|
|
6840
6901
|
setIsUnderline(selection.hasFormat("underline"));
|
|
@@ -6886,7 +6947,7 @@ var ToolBarPlugins = (props) => {
|
|
|
6886
6947
|
}
|
|
6887
6948
|
});
|
|
6888
6949
|
};
|
|
6889
|
-
|
|
6950
|
+
React10__default.useEffect(() => {
|
|
6890
6951
|
return mergeRegister(
|
|
6891
6952
|
editor.registerEditableListener((editable) => {
|
|
6892
6953
|
setIsEditable(editable);
|
|
@@ -7090,7 +7151,7 @@ var ToolBarPlugins = (props) => {
|
|
|
7090
7151
|
return /* @__PURE__ */ jsx(
|
|
7091
7152
|
InsertLinkPlugin,
|
|
7092
7153
|
{
|
|
7093
|
-
disabled: !isEditable || props.readOnly,
|
|
7154
|
+
disabled: !isEditable || props.readOnly || !hasTextSelection,
|
|
7094
7155
|
setIsLinkEditMode: props.setIsLinkEditMode
|
|
7095
7156
|
},
|
|
7096
7157
|
key
|
|
@@ -7760,7 +7821,7 @@ var ToolBarPlugins = (props) => {
|
|
|
7760
7821
|
padding: "0px",
|
|
7761
7822
|
minHeight: 36
|
|
7762
7823
|
},
|
|
7763
|
-
children: pluginGroups.map((group, groupIndex) => /* @__PURE__ */ jsx(
|
|
7824
|
+
children: pluginGroups.map((group, groupIndex) => /* @__PURE__ */ jsx(React10__default.Fragment, { children: group.map((token, tokenIndex) => {
|
|
7764
7825
|
try {
|
|
7765
7826
|
return renderToken(token, groupIndex, tokenIndex);
|
|
7766
7827
|
} catch {
|
|
@@ -8087,12 +8148,12 @@ function EditorReadyPlugin({ onReady }) {
|
|
|
8087
8148
|
var ContentEditorComponent = forwardRef(
|
|
8088
8149
|
(props, ref) => {
|
|
8089
8150
|
const isReadOnly = !!props.readOnly;
|
|
8090
|
-
const resolvedSpellCheck =
|
|
8151
|
+
const resolvedSpellCheck = React10__default.useMemo(
|
|
8091
8152
|
() => props.spellCheckFn ? _makeSpellCheckFn(props.spellCheckFn) : props.useSpellCheck,
|
|
8092
8153
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8093
8154
|
[props.spellCheckFn, props.useSpellCheck]
|
|
8094
8155
|
);
|
|
8095
|
-
const resolvedQuery =
|
|
8156
|
+
const resolvedQuery = React10__default.useMemo(
|
|
8096
8157
|
() => props.suggestFn ? _makeQueryFn(props.suggestFn) : props.useQuery,
|
|
8097
8158
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8098
8159
|
[props.suggestFn, props.useQuery]
|
|
@@ -8120,7 +8181,7 @@ var ContentEditorComponent = forwardRef(
|
|
|
8120
8181
|
const onAnchorRef = (elem) => {
|
|
8121
8182
|
if (elem) setFloatingAnchorElem(elem);
|
|
8122
8183
|
};
|
|
8123
|
-
const initialConfig =
|
|
8184
|
+
const initialConfig = React10__default.useMemo(() => {
|
|
8124
8185
|
const config = {
|
|
8125
8186
|
namespace: props.namespace ?? "",
|
|
8126
8187
|
theme,
|
|
@@ -8156,8 +8217,13 @@ var ContentEditorComponent = forwardRef(
|
|
|
8156
8217
|
color: "var(--colorNeutralForeground3, grey)",
|
|
8157
8218
|
position: "absolute",
|
|
8158
8219
|
top: props.level !== "none" /* None */ ? "17px" : "27px",
|
|
8159
|
-
left:
|
|
8160
|
-
right:
|
|
8220
|
+
left: 0,
|
|
8221
|
+
right: 0,
|
|
8222
|
+
maxWidth: pageCanvas.widthPx,
|
|
8223
|
+
marginLeft: pageCanvas.widthPx !== void 0 ? "auto" : void 0,
|
|
8224
|
+
marginRight: pageCanvas.widthPx !== void 0 ? "auto" : void 0,
|
|
8225
|
+
paddingLeft: pageCanvas.paddingPx,
|
|
8226
|
+
paddingRight: pageCanvas.paddingPx,
|
|
8161
8227
|
fontSize: "14px",
|
|
8162
8228
|
pointerEvents: "none",
|
|
8163
8229
|
userSelect: "none"
|
|
@@ -8205,7 +8271,7 @@ var ContentEditorComponent = forwardRef(
|
|
|
8205
8271
|
previousOverLimitRef.current = isOverLimit;
|
|
8206
8272
|
}
|
|
8207
8273
|
}, [isOverLimit, wordCount, props.wordLimit, props.onWordLimitExceeded]);
|
|
8208
|
-
const validationErrors =
|
|
8274
|
+
const validationErrors = React10__default.useMemo(() => {
|
|
8209
8275
|
const errors = [];
|
|
8210
8276
|
const custom = props.validationMessages ?? {};
|
|
8211
8277
|
const { words, chars, images, links, tables } = metrics;
|
|
@@ -8274,7 +8340,7 @@ var ContentEditorComponent = forwardRef(
|
|
|
8274
8340
|
const trimmedErrorMessage = props.errorMessage?.trim() || "";
|
|
8275
8341
|
const hasValidationError = validationErrors.length > 0 || !!trimmedErrorMessage;
|
|
8276
8342
|
return /* @__PURE__ */ jsx(FluentProvider, { theme: webLightTheme, style: { height: "100%" }, children: /* @__PURE__ */ jsxs(LexicalComposer, { initialConfig, children: [
|
|
8277
|
-
/* @__PURE__ */ jsx("div", { ref: containerRef, className: "lexical-rich-editor-root", style: { height: "100%" }, children: /* @__PURE__ */ jsxs(
|
|
8343
|
+
/* @__PURE__ */ jsx("div", { ref: containerRef, className: "lexical-rich-editor-root", style: { height: "100%", position: "relative" }, children: /* @__PURE__ */ jsxs(
|
|
8278
8344
|
Stack,
|
|
8279
8345
|
{
|
|
8280
8346
|
style: {
|