@tarviks/lexical-rich-editor 1.3.4 → 1.3.6
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 +0 -172
- package/dist/index.css.map +1 -1
- package/dist/index.js +464 -495
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +466 -497
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ 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, Field, Input, MessageBar, MessageBarBody } from '@fluentui/react-components';
|
|
10
|
+
import { makeStyles, FluentProvider, webLightTheme, Menu, MenuTrigger, MenuPopover, MenuList, MenuGroup, MenuGroupHeader, MenuItem, MenuDivider, Dropdown, Option, Button, ToolbarDivider, MenuItemRadio, Field, Input, MessageBar, MessageBarBody, Popover, PopoverSurface, PopoverTrigger } 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';
|
|
@@ -24,7 +24,7 @@ import { TablePlugin } from '@lexical/react/LexicalTablePlugin';
|
|
|
24
24
|
import { HeadingNode, QuoteNode, $isHeadingNode, $createQuoteNode, $createHeadingNode } from '@lexical/rich-text';
|
|
25
25
|
import { TableNode, TableRowNode, TableCellNode, $isTableSelection, $isTableNode, $isTableCellNode, $insertTableColumnAtSelection, $insertTableRowAtSelection, $deleteTableRowAtSelection, $deleteTableColumnAtSelection, getDOMCellFromTarget, getTableObserverFromTableElement, $getTableNodeFromLexicalNodeOrThrow, $getTableRowIndexFromTableCellNode, $isTableRowNode, $getTableColumnIndexFromTableCellNode, $createTableNodeWithDimensions } from '@lexical/table';
|
|
26
26
|
import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode';
|
|
27
|
-
import { ChevronDown12Regular, ArrowUpRegular, RowTripleRegular, ArrowDownRegular, ArrowLeftRegular, ColumnTripleRegular, ArrowRightRegular, DeleteRegular, TextCaseUppercaseFilled, TextCaseLowercaseFilled, TextCaseTitleFilled, TextStrikethroughFilled, TextSubscriptFilled, TextSuperscriptFilled, HighlightAccentFilled, TextBulletListLtrFilled, TextNumberListLtrFilled, DocumentPageBreakRegular, CommentQuoteRegular, TextUnderlineFilled, TextItalicFilled, TextBold24Regular, DocumentRegular, TextAlignLeftFilled, TextAlignCenterFilled, TextAlignRightFilled, TextAlignJustifyFilled, VideoClipRegular,
|
|
27
|
+
import { ChevronDown12Regular, ArrowUpRegular, RowTripleRegular, ArrowDownRegular, ArrowLeftRegular, ColumnTripleRegular, ArrowRightRegular, DeleteRegular, TextCaseUppercaseFilled, TextCaseLowercaseFilled, TextCaseTitleFilled, TextStrikethroughFilled, TextSubscriptFilled, TextSuperscriptFilled, HighlightAccentFilled, TextBulletListLtrFilled, TextNumberListLtrFilled, DocumentPageBreakRegular, CommentQuoteRegular, TextUnderlineFilled, TextItalicFilled, TextBold24Regular, DocumentRegular, TextAlignLeftFilled, TextAlignCenterFilled, TextAlignRightFilled, TextAlignJustifyFilled, VideoClipRegular, AttachFilled, ImageEditRegular, ImageAddRegular, TableAddRegular, LinkAddRegular, TextColorRegular, PaintBucket16Filled, DismissRegular, CheckmarkRegular, EditRegular, CodeFilled, LinkFilled, Dismiss16Regular } from '@fluentui/react-icons';
|
|
28
28
|
import { $setBlocksType, $patchStyleText, $isAtNodeEnd, $getSelectionStyleValueForProperty } from '@lexical/selection';
|
|
29
29
|
import { createPortal } from 'react-dom';
|
|
30
30
|
import { $generateNodesFromDOM, $generateHtmlFromNodes } from '@lexical/html';
|
|
@@ -3143,33 +3143,6 @@ var getSelectedNode2 = (selection) => {
|
|
|
3143
3143
|
return $isAtNodeEnd(anchor) ? anchorNode : focusNode;
|
|
3144
3144
|
}
|
|
3145
3145
|
};
|
|
3146
|
-
var VERTICAL_GAP = 10;
|
|
3147
|
-
var HORIZONTAL_OFFSET = 5;
|
|
3148
|
-
var VIEWPORT_MARGIN = 8;
|
|
3149
|
-
var setFloatingElemPositionForLinkEditor = (targetRect, floatingElem, topBoundary = VIEWPORT_MARGIN, verticalGap = VERTICAL_GAP, horizontalOffset = HORIZONTAL_OFFSET) => {
|
|
3150
|
-
if (targetRect === null) {
|
|
3151
|
-
floatingElem.style.opacity = "0";
|
|
3152
|
-
floatingElem.style.transform = "translate(-10000px, -10000px)";
|
|
3153
|
-
return;
|
|
3154
|
-
}
|
|
3155
|
-
const floatingElemRect = floatingElem.getBoundingClientRect();
|
|
3156
|
-
let top = targetRect.bottom + verticalGap;
|
|
3157
|
-
let left = targetRect.left - horizontalOffset;
|
|
3158
|
-
if (top + floatingElemRect.height > window.innerHeight - VIEWPORT_MARGIN) {
|
|
3159
|
-
top = targetRect.top - floatingElemRect.height - verticalGap;
|
|
3160
|
-
}
|
|
3161
|
-
if (top < topBoundary) {
|
|
3162
|
-
top = topBoundary;
|
|
3163
|
-
}
|
|
3164
|
-
left = Math.max(VIEWPORT_MARGIN, Math.min(left, window.innerWidth - floatingElemRect.width - VIEWPORT_MARGIN));
|
|
3165
|
-
const origin = getFixedPositionOrigin(floatingElem);
|
|
3166
|
-
top -= origin.top;
|
|
3167
|
-
left -= origin.left;
|
|
3168
|
-
floatingElem.style.opacity = "1";
|
|
3169
|
-
floatingElem.style.transform = "none";
|
|
3170
|
-
floatingElem.style.top = `${top}px`;
|
|
3171
|
-
floatingElem.style.left = `${left}px`;
|
|
3172
|
-
};
|
|
3173
3146
|
var SUPPORTED_URL_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
3174
3147
|
"http:",
|
|
3175
3148
|
"https:",
|
|
@@ -3195,7 +3168,7 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, isLinkEditMode, setIsLink
|
|
|
3195
3168
|
const [editedLinkUrl, setEditedLinkUrl] = useState("https://");
|
|
3196
3169
|
const [lastSelection, setLastSelection] = useState(null);
|
|
3197
3170
|
const [linkUrl, setLinkUrl] = useState("");
|
|
3198
|
-
const
|
|
3171
|
+
const [target, setTarget] = useState(null);
|
|
3199
3172
|
const inputRef = useRef(null);
|
|
3200
3173
|
const $updateLinkEditor = useCallback(() => {
|
|
3201
3174
|
const selection = $getSelection();
|
|
@@ -3213,25 +3186,17 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, isLinkEditMode, setIsLink
|
|
|
3213
3186
|
setEditedLinkUrl(linkUrl);
|
|
3214
3187
|
}
|
|
3215
3188
|
}
|
|
3216
|
-
const editorElem = editorRef.current;
|
|
3217
3189
|
const nativeSelection = getDOMSelection(editor._window);
|
|
3218
3190
|
const activeElement = document.activeElement;
|
|
3219
|
-
if (editorElem === null) {
|
|
3220
|
-
return;
|
|
3221
|
-
}
|
|
3222
3191
|
const rootElement = editor.getRootElement();
|
|
3223
3192
|
if (isLink && selection !== null && nativeSelection !== null && rootElement !== null && rootElement.contains(nativeSelection.anchorNode) && editor.isEditable()) {
|
|
3224
3193
|
const domRect = nativeSelection.focusNode?.parentElement?.getBoundingClientRect();
|
|
3225
3194
|
if (domRect) {
|
|
3226
|
-
|
|
3227
|
-
const topBoundary = toolbarEl ? toolbarEl.getBoundingClientRect().bottom + 8 : 8;
|
|
3228
|
-
setFloatingElemPositionForLinkEditor(domRect, editorElem, topBoundary);
|
|
3195
|
+
setTarget({ getBoundingClientRect: () => domRect });
|
|
3229
3196
|
}
|
|
3230
3197
|
setLastSelection(selection);
|
|
3231
|
-
} else if (!activeElement || activeElement
|
|
3232
|
-
|
|
3233
|
-
setFloatingElemPositionForLinkEditor(null, editorElem);
|
|
3234
|
-
}
|
|
3198
|
+
} else if (!(activeElement instanceof HTMLInputElement) || activeElement !== inputRef.current) {
|
|
3199
|
+
setTarget(null);
|
|
3235
3200
|
setLastSelection(null);
|
|
3236
3201
|
setIsLinkEditMode(false);
|
|
3237
3202
|
setLinkUrl("");
|
|
@@ -3327,99 +3292,119 @@ var FloatingLinkEditor = ({ editor, isLink, setIsLink, isLinkEditMode, setIsLink
|
|
|
3327
3292
|
setIsLinkEditMode(false);
|
|
3328
3293
|
}
|
|
3329
3294
|
};
|
|
3330
|
-
return /* @__PURE__ */ jsx(
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3295
|
+
return /* @__PURE__ */ jsx(
|
|
3296
|
+
Popover,
|
|
3297
|
+
{
|
|
3298
|
+
open: isLink && !!target,
|
|
3299
|
+
onOpenChange: (_, data) => {
|
|
3300
|
+
if (!data.open) setIsLink(false);
|
|
3301
|
+
},
|
|
3302
|
+
positioning: { target: target ?? void 0, position: "below", align: "start" },
|
|
3303
|
+
unstable_disableAutoFocus: true,
|
|
3304
|
+
children: /* @__PURE__ */ jsx(PopoverSurface, { style: { display: "flex", alignItems: "center", gap: 6, padding: 8, maxWidth: 360 }, children: isLinkEditMode ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3305
|
+
/* @__PURE__ */ jsx(
|
|
3306
|
+
"input",
|
|
3307
|
+
{
|
|
3308
|
+
ref: inputRef,
|
|
3309
|
+
value: editedLinkUrl,
|
|
3310
|
+
style: {
|
|
3311
|
+
flex: 1,
|
|
3312
|
+
minWidth: 180,
|
|
3313
|
+
border: "none",
|
|
3314
|
+
outline: "none",
|
|
3315
|
+
background: "#f1f1f1",
|
|
3316
|
+
borderRadius: 15,
|
|
3317
|
+
padding: "8px 12px",
|
|
3318
|
+
fontSize: 14
|
|
3319
|
+
},
|
|
3320
|
+
onChange: (event) => {
|
|
3321
|
+
setEditedLinkUrl(event.target.value);
|
|
3322
|
+
},
|
|
3323
|
+
onKeyDown: (event) => {
|
|
3324
|
+
monitorInputInteraction(event);
|
|
3325
|
+
}
|
|
3326
|
+
}
|
|
3327
|
+
),
|
|
3328
|
+
/* @__PURE__ */ jsx(
|
|
3329
|
+
Button,
|
|
3330
|
+
{
|
|
3331
|
+
appearance: "subtle",
|
|
3332
|
+
size: "small",
|
|
3333
|
+
icon: /* @__PURE__ */ jsx(DismissRegular, { fontSize: 16 }),
|
|
3334
|
+
title: "Cancel",
|
|
3335
|
+
"aria-label": "Cancel",
|
|
3336
|
+
onMouseDown: preventDefault,
|
|
3337
|
+
onClick: () => {
|
|
3338
|
+
setIsLinkEditMode(false);
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
),
|
|
3342
|
+
/* @__PURE__ */ jsx(
|
|
3343
|
+
Button,
|
|
3344
|
+
{
|
|
3345
|
+
appearance: "primary",
|
|
3346
|
+
size: "small",
|
|
3347
|
+
icon: /* @__PURE__ */ jsx(CheckmarkRegular, { fontSize: 16 }),
|
|
3348
|
+
title: "Confirm",
|
|
3349
|
+
"aria-label": "Confirm",
|
|
3350
|
+
onMouseDown: preventDefault,
|
|
3351
|
+
onClick: handleLinkSubmission
|
|
3352
|
+
}
|
|
3353
|
+
)
|
|
3354
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3355
|
+
/* @__PURE__ */ jsx(
|
|
3356
|
+
"a",
|
|
3357
|
+
{
|
|
3358
|
+
href: sanitizeUrl(linkUrl),
|
|
3359
|
+
target: "_blank",
|
|
3360
|
+
rel: "noopener noreferrer",
|
|
3361
|
+
style: {
|
|
3362
|
+
padding: "0 8px",
|
|
3363
|
+
overflow: "hidden",
|
|
3364
|
+
textOverflow: "ellipsis",
|
|
3365
|
+
whiteSpace: "nowrap",
|
|
3366
|
+
maxWidth: 260
|
|
3367
|
+
},
|
|
3368
|
+
children: linkUrl
|
|
3369
|
+
}
|
|
3370
|
+
),
|
|
3371
|
+
/* @__PURE__ */ jsx(
|
|
3372
|
+
Button,
|
|
3373
|
+
{
|
|
3374
|
+
appearance: "subtle",
|
|
3375
|
+
size: "small",
|
|
3376
|
+
icon: /* @__PURE__ */ jsx(EditRegular, { fontSize: 16 }),
|
|
3377
|
+
title: "Edit link",
|
|
3378
|
+
"aria-label": "Edit link",
|
|
3379
|
+
onMouseDown: preventDefault,
|
|
3380
|
+
onClick: (event) => {
|
|
3381
|
+
event.preventDefault();
|
|
3382
|
+
setEditedLinkUrl(linkUrl);
|
|
3383
|
+
setIsLinkEditMode(true);
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
),
|
|
3387
|
+
/* @__PURE__ */ jsx(
|
|
3388
|
+
Button,
|
|
3389
|
+
{
|
|
3390
|
+
appearance: "subtle",
|
|
3391
|
+
size: "small",
|
|
3392
|
+
icon: /* @__PURE__ */ jsx(DeleteRegular, { fontSize: 16 }),
|
|
3393
|
+
title: "Remove link",
|
|
3394
|
+
"aria-label": "Remove link",
|
|
3395
|
+
onMouseDown: preventDefault,
|
|
3396
|
+
onClick: () => {
|
|
3397
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
|
|
3398
|
+
}
|
|
3399
|
+
}
|
|
3400
|
+
)
|
|
3401
|
+
] }) })
|
|
3402
|
+
}
|
|
3403
|
+
);
|
|
3418
3404
|
};
|
|
3419
|
-
var useFloatingLinkEditorToolbar = (editor,
|
|
3405
|
+
var useFloatingLinkEditorToolbar = (editor, isLinkEditMode, setIsLinkEditMode) => {
|
|
3420
3406
|
const [activeEditor, setActiveEditor] = useState(editor);
|
|
3421
3407
|
const [isLink, setIsLink] = useState(false);
|
|
3422
|
-
const portalContainer = useFloatingPortalContainer(editor);
|
|
3423
3408
|
useEffect(() => {
|
|
3424
3409
|
function $updateToolbar() {
|
|
3425
3410
|
const selection = $getSelection();
|
|
@@ -3467,72 +3452,62 @@ var useFloatingLinkEditorToolbar = (editor, anchorElem, isLinkEditMode, setIsLin
|
|
|
3467
3452
|
)
|
|
3468
3453
|
);
|
|
3469
3454
|
}, [editor]);
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
setIsLink,
|
|
3480
|
-
isLinkEditMode,
|
|
3481
|
-
setIsLinkEditMode
|
|
3482
|
-
}
|
|
3483
|
-
),
|
|
3484
|
-
portalContainer
|
|
3455
|
+
return /* @__PURE__ */ jsx(
|
|
3456
|
+
FloatingLinkEditor,
|
|
3457
|
+
{
|
|
3458
|
+
isLink,
|
|
3459
|
+
editor: activeEditor,
|
|
3460
|
+
setIsLink,
|
|
3461
|
+
isLinkEditMode,
|
|
3462
|
+
setIsLinkEditMode
|
|
3463
|
+
}
|
|
3485
3464
|
);
|
|
3486
3465
|
};
|
|
3487
|
-
var FloatingLinkEditorPlugin = ({
|
|
3466
|
+
var FloatingLinkEditorPlugin = ({ isLinkEditMode, setIsLinkEditMode }) => {
|
|
3488
3467
|
const [editor] = useLexicalComposerContext();
|
|
3489
|
-
const validAnchorElem = anchorElem && anchorElem instanceof HTMLElement ? anchorElem : document.body;
|
|
3490
3468
|
return useFloatingLinkEditorToolbar(
|
|
3491
3469
|
editor,
|
|
3492
|
-
validAnchorElem,
|
|
3493
3470
|
isLinkEditMode,
|
|
3494
3471
|
setIsLinkEditMode
|
|
3495
3472
|
);
|
|
3496
3473
|
};
|
|
3497
3474
|
var AoModal = ({
|
|
3498
3475
|
isOpen,
|
|
3499
|
-
|
|
3476
|
+
onOpenChange,
|
|
3477
|
+
trigger,
|
|
3500
3478
|
title,
|
|
3501
3479
|
maxWidth = 280,
|
|
3502
|
-
// Default to a smaller, compact size
|
|
3503
3480
|
actions,
|
|
3504
3481
|
children
|
|
3505
3482
|
}) => {
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
if (!isOpen) return null;
|
|
3509
|
-
const modalContent = /* @__PURE__ */ jsx("div", { className: "aoModalBackdrop", onClick: onDismiss, children: /* @__PURE__ */ jsxs(
|
|
3510
|
-
FluentProvider,
|
|
3483
|
+
return /* @__PURE__ */ jsxs(
|
|
3484
|
+
Popover,
|
|
3511
3485
|
{
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
onClick: (e) => e.stopPropagation(),
|
|
3486
|
+
open: isOpen,
|
|
3487
|
+
onOpenChange: (_, data) => onOpenChange(data.open),
|
|
3488
|
+
positioning: { position: "below", align: "start" },
|
|
3516
3489
|
children: [
|
|
3517
|
-
/* @__PURE__ */
|
|
3518
|
-
|
|
3519
|
-
/* @__PURE__ */
|
|
3520
|
-
"
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3490
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { disableButtonEnhancement: true, children: trigger }),
|
|
3491
|
+
/* @__PURE__ */ jsxs(PopoverSurface, { style: { minWidth: 240, maxWidth, width: "90vw" }, children: [
|
|
3492
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 8 }, children: [
|
|
3493
|
+
/* @__PURE__ */ jsx("h2", { style: { fontSize: 16, fontWeight: 600, margin: 0 }, children: title }),
|
|
3494
|
+
/* @__PURE__ */ jsx(
|
|
3495
|
+
Button,
|
|
3496
|
+
{
|
|
3497
|
+
appearance: "subtle",
|
|
3498
|
+
size: "small",
|
|
3499
|
+
icon: /* @__PURE__ */ jsx(DismissRegular, {}),
|
|
3500
|
+
"aria-label": "Close popup",
|
|
3501
|
+
onClick: () => onOpenChange(false)
|
|
3502
|
+
}
|
|
3503
|
+
)
|
|
3504
|
+
] }),
|
|
3505
|
+
/* @__PURE__ */ jsx("div", { children }),
|
|
3506
|
+
actions && /* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 12 }, children: actions })
|
|
3507
|
+
] })
|
|
3531
3508
|
]
|
|
3532
3509
|
}
|
|
3533
|
-
)
|
|
3534
|
-
if (!hostElement) return null;
|
|
3535
|
-
return createPortal(modalContent, hostElement);
|
|
3510
|
+
);
|
|
3536
3511
|
};
|
|
3537
3512
|
|
|
3538
3513
|
// src/Plugins/ImagePlugin.tsx
|
|
@@ -3669,105 +3644,104 @@ var InsertImageDialog = ({
|
|
|
3669
3644
|
};
|
|
3670
3645
|
reader.readAsDataURL(file);
|
|
3671
3646
|
};
|
|
3672
|
-
return /* @__PURE__ */
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
style: {
|
|
3681
|
-
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
3682
|
-
border: "none",
|
|
3683
|
-
margin: 2,
|
|
3684
|
-
opacity: disabled ? 0.55 : 1,
|
|
3685
|
-
cursor: disabled ? "not-allowed" : "pointer"
|
|
3686
|
-
},
|
|
3687
|
-
onClick: () => {
|
|
3688
|
-
if (disabled) return;
|
|
3689
|
-
setIsOpen((prev) => !prev);
|
|
3647
|
+
return /* @__PURE__ */ jsx(
|
|
3648
|
+
AoModal,
|
|
3649
|
+
{
|
|
3650
|
+
isOpen: disabled ? false : isOpen,
|
|
3651
|
+
onOpenChange: (open) => {
|
|
3652
|
+
if (disabled) return;
|
|
3653
|
+
setIsOpen(open);
|
|
3654
|
+
if (open) {
|
|
3690
3655
|
setSrc("");
|
|
3691
3656
|
setAltText("");
|
|
3692
3657
|
setFileName("");
|
|
3693
3658
|
}
|
|
3694
3659
|
},
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3660
|
+
trigger: /* @__PURE__ */ jsx(
|
|
3661
|
+
Button,
|
|
3662
|
+
{
|
|
3663
|
+
size: "small",
|
|
3664
|
+
title: "Add Image",
|
|
3665
|
+
disabled,
|
|
3666
|
+
icon: /* @__PURE__ */ jsx(ImageAddRegular, { style: { color: iconColor } }),
|
|
3667
|
+
style: {
|
|
3668
|
+
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
3669
|
+
border: "none",
|
|
3670
|
+
margin: 2,
|
|
3671
|
+
opacity: disabled ? 0.55 : 1,
|
|
3672
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
3673
|
+
}
|
|
3674
|
+
},
|
|
3675
|
+
"upload-image"
|
|
3676
|
+
),
|
|
3677
|
+
title: "Insert image",
|
|
3678
|
+
maxWidth: 340,
|
|
3679
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3680
|
+
/* @__PURE__ */ jsx(Button, { size: "small", disabled: isDisabled, onClick: () => onClick({ altText, src }), children: "Add" }),
|
|
3681
|
+
/* @__PURE__ */ jsx(Button, { size: "small", disabled, onClick: () => setIsOpen(false), children: "Cancel" })
|
|
3682
|
+
] }),
|
|
3683
|
+
children: /* @__PURE__ */ jsxs(Stack, { tokens: { childrenGap: 8 }, children: [
|
|
3684
|
+
/* @__PURE__ */ jsx(Field, { label: "Upload", size: "small", children: /* @__PURE__ */ jsxs(
|
|
3685
|
+
"label",
|
|
3686
|
+
{
|
|
3687
|
+
style: {
|
|
3688
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
3689
|
+
display: "flex",
|
|
3690
|
+
alignItems: "center",
|
|
3691
|
+
gap: 8,
|
|
3692
|
+
opacity: disabled ? 0.75 : 1
|
|
3693
|
+
},
|
|
3694
|
+
children: [
|
|
3695
|
+
/* @__PURE__ */ jsx(
|
|
3696
|
+
"input",
|
|
3697
|
+
{
|
|
3698
|
+
type: "file",
|
|
3699
|
+
accept: "image/*",
|
|
3700
|
+
style: { display: "none" },
|
|
3701
|
+
disabled,
|
|
3702
|
+
onChange: loadImage
|
|
3703
|
+
},
|
|
3704
|
+
"inline-image-upload"
|
|
3705
|
+
),
|
|
3706
|
+
/* @__PURE__ */ jsxs(Stack, { horizontal: true, children: [
|
|
3720
3707
|
/* @__PURE__ */ jsx(
|
|
3721
|
-
|
|
3708
|
+
AttachFilled,
|
|
3722
3709
|
{
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
onChange: loadImage
|
|
3728
|
-
},
|
|
3729
|
-
"inline-image-upload"
|
|
3730
|
-
),
|
|
3731
|
-
/* @__PURE__ */ jsxs(Stack, { horizontal: true, children: [
|
|
3732
|
-
/* @__PURE__ */ jsx(
|
|
3733
|
-
AttachFilled,
|
|
3734
|
-
{
|
|
3735
|
-
style: {
|
|
3736
|
-
fontSize: "16px",
|
|
3737
|
-
color: disabled ? "var(--colorNeutralForegroundDisabled, #A6A6A6)" : "#808080",
|
|
3738
|
-
marginTop: 2
|
|
3739
|
-
}
|
|
3710
|
+
style: {
|
|
3711
|
+
fontSize: "16px",
|
|
3712
|
+
color: disabled ? "var(--colorNeutralForegroundDisabled, #A6A6A6)" : "#808080",
|
|
3713
|
+
marginTop: 2
|
|
3740
3714
|
}
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
}
|
|
3769
|
-
|
|
3770
|
-
|
|
3715
|
+
}
|
|
3716
|
+
),
|
|
3717
|
+
!fileName && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: "#808080" }, children: "Upload File" })
|
|
3718
|
+
] }),
|
|
3719
|
+
fileName && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: "#808080" }, children: fileName })
|
|
3720
|
+
]
|
|
3721
|
+
}
|
|
3722
|
+
) }),
|
|
3723
|
+
fileSizeError && /* @__PURE__ */ jsx(MessageBar, { intent: "error", style: { marginTop: 4 }, children: /* @__PURE__ */ jsx(MessageBarBody, { children: fileSizeError }) }),
|
|
3724
|
+
/* @__PURE__ */ jsx(Field, { label: "Alt Text", size: "small", children: /* @__PURE__ */ jsx(
|
|
3725
|
+
Input,
|
|
3726
|
+
{
|
|
3727
|
+
placeholder: "Alt text",
|
|
3728
|
+
appearance: "underline",
|
|
3729
|
+
disabled,
|
|
3730
|
+
onChange: (_, d) => setAltText(d.value),
|
|
3731
|
+
value: altText
|
|
3732
|
+
}
|
|
3733
|
+
) }),
|
|
3734
|
+
selectedValue === "URL" && /* @__PURE__ */ jsx(
|
|
3735
|
+
InsertImageByURL,
|
|
3736
|
+
{
|
|
3737
|
+
disabled,
|
|
3738
|
+
setIsOpen: (open) => setIsOpen(open),
|
|
3739
|
+
onClick: (payload) => onClick(payload)
|
|
3740
|
+
}
|
|
3741
|
+
)
|
|
3742
|
+
] })
|
|
3743
|
+
}
|
|
3744
|
+
);
|
|
3771
3745
|
};
|
|
3772
3746
|
var ImagesPlugin = ({ captionsEnabled }) => {
|
|
3773
3747
|
const [editor] = useLexicalComposerContext();
|
|
@@ -4017,132 +3991,131 @@ var InsertInlineImageDialog = ({
|
|
|
4017
3991
|
setFileName("");
|
|
4018
3992
|
setFileSizeError(null);
|
|
4019
3993
|
};
|
|
4020
|
-
return /* @__PURE__ */
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
style: {
|
|
4029
|
-
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
4030
|
-
border: "none",
|
|
4031
|
-
margin: 2,
|
|
4032
|
-
opacity: disabled ? 0.55 : 1,
|
|
4033
|
-
cursor: disabled ? "not-allowed" : "pointer"
|
|
4034
|
-
},
|
|
4035
|
-
onClick: () => {
|
|
4036
|
-
if (disabled) return;
|
|
4037
|
-
setIsOpen((prev) => !prev);
|
|
3994
|
+
return /* @__PURE__ */ jsx(
|
|
3995
|
+
AoModal,
|
|
3996
|
+
{
|
|
3997
|
+
isOpen: disabled ? false : isOpen,
|
|
3998
|
+
onOpenChange: (open) => {
|
|
3999
|
+
if (disabled) return;
|
|
4000
|
+
setIsOpen(open);
|
|
4001
|
+
if (open) {
|
|
4038
4002
|
setAltText("");
|
|
4039
4003
|
setSrc("");
|
|
4040
4004
|
setFileName("");
|
|
4041
4005
|
}
|
|
4042
4006
|
},
|
|
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
|
-
|
|
4007
|
+
trigger: /* @__PURE__ */ jsx(
|
|
4008
|
+
Button,
|
|
4009
|
+
{
|
|
4010
|
+
size: "small",
|
|
4011
|
+
title: "Add Inline Image",
|
|
4012
|
+
disabled,
|
|
4013
|
+
icon: /* @__PURE__ */ jsx(ImageEditRegular, { style: { color: iconColor } }),
|
|
4014
|
+
style: {
|
|
4015
|
+
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
4016
|
+
border: "none",
|
|
4017
|
+
margin: 2,
|
|
4018
|
+
opacity: disabled ? 0.55 : 1,
|
|
4019
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
4020
|
+
}
|
|
4021
|
+
},
|
|
4022
|
+
"upload-inline-image"
|
|
4023
|
+
),
|
|
4024
|
+
title: "Insert inline image",
|
|
4025
|
+
maxWidth: 360,
|
|
4026
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4027
|
+
/* @__PURE__ */ jsx(
|
|
4028
|
+
Button,
|
|
4029
|
+
{
|
|
4030
|
+
size: "small",
|
|
4031
|
+
disabled: isDisabled,
|
|
4032
|
+
onClick: handleOnClick,
|
|
4033
|
+
children: "Add"
|
|
4034
|
+
},
|
|
4035
|
+
"file-inline-upload-btn"
|
|
4036
|
+
),
|
|
4037
|
+
/* @__PURE__ */ jsx(
|
|
4038
|
+
Button,
|
|
4039
|
+
{
|
|
4040
|
+
size: "small",
|
|
4041
|
+
disabled,
|
|
4042
|
+
onClick: () => setIsOpen(false),
|
|
4043
|
+
children: "Cancel"
|
|
4044
|
+
},
|
|
4045
|
+
"file-inline-upload-cancel"
|
|
4046
|
+
)
|
|
4047
|
+
] }),
|
|
4048
|
+
children: /* @__PURE__ */ jsxs(Stack, { tokens: { childrenGap: 8 }, children: [
|
|
4049
|
+
/* @__PURE__ */ jsx(Field, { label: "Upload", size: "small", children: /* @__PURE__ */ jsxs(
|
|
4050
|
+
"label",
|
|
4051
|
+
{
|
|
4052
|
+
style: {
|
|
4053
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
4054
|
+
display: "flex",
|
|
4055
|
+
alignItems: "center",
|
|
4056
|
+
gap: 8,
|
|
4057
|
+
opacity: disabled ? 0.75 : 1
|
|
4070
4058
|
},
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
},
|
|
4085
|
-
children: [
|
|
4059
|
+
children: [
|
|
4060
|
+
/* @__PURE__ */ jsx(
|
|
4061
|
+
"input",
|
|
4062
|
+
{
|
|
4063
|
+
type: "file",
|
|
4064
|
+
accept: "image/*",
|
|
4065
|
+
style: { display: "none" },
|
|
4066
|
+
disabled,
|
|
4067
|
+
onChange: loadImage
|
|
4068
|
+
},
|
|
4069
|
+
"inline-image-upload"
|
|
4070
|
+
),
|
|
4071
|
+
/* @__PURE__ */ jsxs(Stack, { horizontal: true, children: [
|
|
4086
4072
|
/* @__PURE__ */ jsx(
|
|
4087
|
-
|
|
4073
|
+
AttachFilled,
|
|
4088
4074
|
{
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
onChange: loadImage
|
|
4094
|
-
},
|
|
4095
|
-
"inline-image-upload"
|
|
4096
|
-
),
|
|
4097
|
-
/* @__PURE__ */ jsxs(Stack, { horizontal: true, children: [
|
|
4098
|
-
/* @__PURE__ */ jsx(
|
|
4099
|
-
AttachFilled,
|
|
4100
|
-
{
|
|
4101
|
-
style: {
|
|
4102
|
-
fontSize: "16px",
|
|
4103
|
-
color: disabled ? "var(--colorNeutralForegroundDisabled, #A6A6A6)" : "#808080",
|
|
4104
|
-
marginTop: 2
|
|
4105
|
-
}
|
|
4075
|
+
style: {
|
|
4076
|
+
fontSize: "16px",
|
|
4077
|
+
color: disabled ? "var(--colorNeutralForegroundDisabled, #A6A6A6)" : "#808080",
|
|
4078
|
+
marginTop: 2
|
|
4106
4079
|
}
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
}
|
|
4144
|
-
|
|
4145
|
-
|
|
4080
|
+
}
|
|
4081
|
+
),
|
|
4082
|
+
!fileName && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: "#808080" }, children: "Upload File" })
|
|
4083
|
+
] }),
|
|
4084
|
+
fileName && /* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: "#808080" }, children: fileName })
|
|
4085
|
+
]
|
|
4086
|
+
}
|
|
4087
|
+
) }),
|
|
4088
|
+
/* @__PURE__ */ jsx(Field, { label: "Position", size: "small", children: /* @__PURE__ */ jsxs(
|
|
4089
|
+
Dropdown,
|
|
4090
|
+
{
|
|
4091
|
+
className: styles.alignDropdown,
|
|
4092
|
+
disabled,
|
|
4093
|
+
value: position === "full" ? "Full" : position === "right" ? "Right" : "Left",
|
|
4094
|
+
selectedOptions: [position ?? "left"],
|
|
4095
|
+
listbox: { style: { width: "120px" } },
|
|
4096
|
+
root: { style: { borderBottom: "1px solid black" } },
|
|
4097
|
+
onOptionSelect: (_, data) => setPosition(data.optionValue),
|
|
4098
|
+
children: [
|
|
4099
|
+
/* @__PURE__ */ jsx(Option, { value: "left", children: "Left" }, "left"),
|
|
4100
|
+
/* @__PURE__ */ jsx(Option, { value: "right", children: "Right" }, "right"),
|
|
4101
|
+
/* @__PURE__ */ jsx(Option, { value: "full", children: "Full" }, "full")
|
|
4102
|
+
]
|
|
4103
|
+
}
|
|
4104
|
+
) }),
|
|
4105
|
+
fileSizeError && /* @__PURE__ */ jsx(MessageBar, { intent: "error", style: { marginTop: 4 }, children: /* @__PURE__ */ jsx(MessageBarBody, { children: fileSizeError }) }),
|
|
4106
|
+
/* @__PURE__ */ jsx(Field, { label: "Alt Text", size: "small", children: /* @__PURE__ */ jsx(
|
|
4107
|
+
Input,
|
|
4108
|
+
{
|
|
4109
|
+
placeholder: "Alt text",
|
|
4110
|
+
appearance: "underline",
|
|
4111
|
+
disabled,
|
|
4112
|
+
value: altText,
|
|
4113
|
+
onChange: (_, d) => setAltText(d.value)
|
|
4114
|
+
}
|
|
4115
|
+
) })
|
|
4116
|
+
] })
|
|
4117
|
+
}
|
|
4118
|
+
);
|
|
4146
4119
|
};
|
|
4147
4120
|
var InlineImagePlugin = () => {
|
|
4148
4121
|
const [editor] = useLexicalComposerContext();
|
|
@@ -6643,76 +6616,75 @@ var TableItemPlugin = ({ disabled }) => {
|
|
|
6643
6616
|
setColumns("");
|
|
6644
6617
|
setIsOpen(false);
|
|
6645
6618
|
};
|
|
6646
|
-
return /* @__PURE__ */
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
style: {
|
|
6655
|
-
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
6656
|
-
border: "none",
|
|
6657
|
-
margin: 2,
|
|
6658
|
-
opacity: disabled ? 0.55 : 1,
|
|
6659
|
-
cursor: disabled ? "not-allowed" : "pointer"
|
|
6660
|
-
},
|
|
6661
|
-
onClick: () => {
|
|
6662
|
-
if (disabled) return;
|
|
6663
|
-
setIsOpen((prev) => !prev);
|
|
6619
|
+
return /* @__PURE__ */ jsx(
|
|
6620
|
+
AoModal,
|
|
6621
|
+
{
|
|
6622
|
+
isOpen: disabled ? false : isOpen,
|
|
6623
|
+
onOpenChange: (open) => {
|
|
6624
|
+
if (disabled) return;
|
|
6625
|
+
setIsOpen(open);
|
|
6626
|
+
if (open) {
|
|
6664
6627
|
setRows("");
|
|
6665
6628
|
setColumns("");
|
|
6666
6629
|
}
|
|
6667
6630
|
},
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6631
|
+
trigger: /* @__PURE__ */ jsx(
|
|
6632
|
+
Button,
|
|
6633
|
+
{
|
|
6634
|
+
size: "small",
|
|
6635
|
+
title: "Add table",
|
|
6636
|
+
disabled,
|
|
6637
|
+
icon: /* @__PURE__ */ jsx(TableAddRegular, { style: { color: iconColor } }),
|
|
6638
|
+
style: {
|
|
6639
|
+
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
6640
|
+
border: "none",
|
|
6641
|
+
margin: 2,
|
|
6642
|
+
opacity: disabled ? 0.55 : 1,
|
|
6643
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
6644
|
+
}
|
|
6645
|
+
},
|
|
6646
|
+
"insert-table-nodes"
|
|
6647
|
+
),
|
|
6648
|
+
title: "Insert table",
|
|
6649
|
+
maxWidth: 300,
|
|
6650
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
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
|
+
children: /* @__PURE__ */ jsxs(Stack, { tokens: { childrenGap: 8 }, children: [
|
|
6664
|
+
/* @__PURE__ */ jsx(Field, { label: "Rows", size: "small", children: /* @__PURE__ */ jsx(
|
|
6665
|
+
Input,
|
|
6666
|
+
{
|
|
6667
|
+
autoFocus: !disabled,
|
|
6668
|
+
value: rows,
|
|
6669
|
+
placeholder: "Rows",
|
|
6670
|
+
appearance: "underline",
|
|
6671
|
+
disabled,
|
|
6672
|
+
onChange: (_, v) => setRows(v.value)
|
|
6673
|
+
}
|
|
6674
|
+
) }),
|
|
6675
|
+
/* @__PURE__ */ jsx(Field, { label: "Columns", size: "small", children: /* @__PURE__ */ jsx(
|
|
6676
|
+
Input,
|
|
6677
|
+
{
|
|
6678
|
+
value: columns,
|
|
6679
|
+
placeholder: "Columns",
|
|
6680
|
+
appearance: "underline",
|
|
6681
|
+
disabled,
|
|
6682
|
+
onChange: (_, v) => setColumns(v.value)
|
|
6683
|
+
}
|
|
6684
|
+
) })
|
|
6685
|
+
] })
|
|
6686
|
+
}
|
|
6687
|
+
);
|
|
6716
6688
|
};
|
|
6717
6689
|
var YoutubeUploadPlugin = ({ disabled }) => {
|
|
6718
6690
|
const [url, setURL] = useState("");
|
|
@@ -6732,54 +6704,51 @@ var YoutubeUploadPlugin = ({ disabled }) => {
|
|
|
6732
6704
|
setURL("");
|
|
6733
6705
|
setIsOpen(false);
|
|
6734
6706
|
};
|
|
6735
|
-
return /* @__PURE__ */
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
style: {
|
|
6744
|
-
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
6745
|
-
border: "none",
|
|
6746
|
-
margin: 2,
|
|
6747
|
-
opacity: disabled ? 0.55 : 1,
|
|
6748
|
-
cursor: disabled ? "not-allowed" : "pointer"
|
|
6749
|
-
},
|
|
6750
|
-
onClick: () => {
|
|
6751
|
-
if (disabled) return;
|
|
6752
|
-
setIsOpen((prev) => !prev);
|
|
6753
|
-
setURL("");
|
|
6754
|
-
}
|
|
6707
|
+
return /* @__PURE__ */ jsx(
|
|
6708
|
+
AoModal,
|
|
6709
|
+
{
|
|
6710
|
+
isOpen: disabled ? false : isOpen,
|
|
6711
|
+
onOpenChange: (open) => {
|
|
6712
|
+
if (disabled) return;
|
|
6713
|
+
setIsOpen(open);
|
|
6714
|
+
if (open) setURL("");
|
|
6755
6715
|
},
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
children: /* @__PURE__ */ jsx(Stack, { tokens: { childrenGap: 8 }, children: /* @__PURE__ */ jsx(Field, { label: "URL", size: "small", children: /* @__PURE__ */ jsx(
|
|
6770
|
-
Input,
|
|
6771
|
-
{
|
|
6772
|
-
autoFocus: !disabled,
|
|
6773
|
-
disabled,
|
|
6774
|
-
value: url,
|
|
6775
|
-
appearance: "underline",
|
|
6776
|
-
placeholder: "Add Youtube video URL",
|
|
6777
|
-
onChange: (_, v) => setURL(v.value)
|
|
6716
|
+
trigger: /* @__PURE__ */ jsx(
|
|
6717
|
+
Button,
|
|
6718
|
+
{
|
|
6719
|
+
title: "Add youtube URL",
|
|
6720
|
+
size: "small",
|
|
6721
|
+
disabled,
|
|
6722
|
+
icon: /* @__PURE__ */ jsx(VideoClipRegular, { style: { color: iconColor } }),
|
|
6723
|
+
style: {
|
|
6724
|
+
background: isOpen && !disabled ? "#ebebeb" : "none",
|
|
6725
|
+
border: "none",
|
|
6726
|
+
margin: 2,
|
|
6727
|
+
opacity: disabled ? 0.55 : 1,
|
|
6728
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
6778
6729
|
}
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6730
|
+
},
|
|
6731
|
+
"upload-video"
|
|
6732
|
+
),
|
|
6733
|
+
title: "Embed YouTube video",
|
|
6734
|
+
maxWidth: 320,
|
|
6735
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6736
|
+
/* @__PURE__ */ jsx(Button, { size: "small", disabled: disabled || !url, onClick: onHandleEmbeded, children: "Add" }),
|
|
6737
|
+
/* @__PURE__ */ jsx(Button, { size: "small", disabled, onClick: () => setIsOpen(false), children: "Cancel" })
|
|
6738
|
+
] }),
|
|
6739
|
+
children: /* @__PURE__ */ jsx(Stack, { tokens: { childrenGap: 8 }, children: /* @__PURE__ */ jsx(Field, { label: "URL", size: "small", children: /* @__PURE__ */ jsx(
|
|
6740
|
+
Input,
|
|
6741
|
+
{
|
|
6742
|
+
autoFocus: !disabled,
|
|
6743
|
+
disabled,
|
|
6744
|
+
value: url,
|
|
6745
|
+
appearance: "underline",
|
|
6746
|
+
placeholder: "Add Youtube video URL",
|
|
6747
|
+
onChange: (_, v) => setURL(v.value)
|
|
6748
|
+
}
|
|
6749
|
+
) }) })
|
|
6750
|
+
}
|
|
6751
|
+
);
|
|
6783
6752
|
};
|
|
6784
6753
|
var TextAlphaListLtrFilled = ({ style }) => /* @__PURE__ */ jsxs("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", style, children: [
|
|
6785
6754
|
/* @__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" }),
|