@rufous/ui 0.3.53 → 0.3.54
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/main.cjs +165 -45
- package/dist/main.css +132 -0
- package/dist/main.d.cts +37 -1
- package/dist/main.d.ts +37 -1
- package/dist/main.js +488 -375
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -9489,8 +9489,114 @@ var Alert = React172.forwardRef(
|
|
|
9489
9489
|
);
|
|
9490
9490
|
Alert.displayName = "Alert";
|
|
9491
9491
|
|
|
9492
|
-
// lib/
|
|
9492
|
+
// lib/Timeline/Timeline.tsx
|
|
9493
9493
|
import * as React173 from "react";
|
|
9494
|
+
var TimelineContext = React173.createContext({ position: "right" });
|
|
9495
|
+
var TimelineItemContext = React173.createContext({
|
|
9496
|
+
effectivePosition: "right"
|
|
9497
|
+
});
|
|
9498
|
+
var Timeline = React173.forwardRef(
|
|
9499
|
+
({ position = "right", sx, className, children, ...rest }, ref) => {
|
|
9500
|
+
const sxClass = useSx(sx);
|
|
9501
|
+
const classes = [
|
|
9502
|
+
"rf-timeline",
|
|
9503
|
+
`rf-timeline--${position}`,
|
|
9504
|
+
sxClass,
|
|
9505
|
+
className
|
|
9506
|
+
].filter(Boolean).join(" ");
|
|
9507
|
+
const indexed = React173.Children.map(children, (child, idx) => {
|
|
9508
|
+
if (!React173.isValidElement(child)) return child;
|
|
9509
|
+
return React173.cloneElement(child, {
|
|
9510
|
+
"data-rf-timeline-index": idx
|
|
9511
|
+
});
|
|
9512
|
+
});
|
|
9513
|
+
return /* @__PURE__ */ React173.createElement(TimelineContext.Provider, { value: { position } }, /* @__PURE__ */ React173.createElement("ul", { ref, className: classes, ...rest }, indexed));
|
|
9514
|
+
}
|
|
9515
|
+
);
|
|
9516
|
+
Timeline.displayName = "Timeline";
|
|
9517
|
+
var TimelineItem = React173.forwardRef(
|
|
9518
|
+
(props, ref) => {
|
|
9519
|
+
const {
|
|
9520
|
+
position: positionProp,
|
|
9521
|
+
sx,
|
|
9522
|
+
className,
|
|
9523
|
+
children,
|
|
9524
|
+
...rest
|
|
9525
|
+
} = props;
|
|
9526
|
+
const { position: parentPosition } = React173.useContext(TimelineContext);
|
|
9527
|
+
const idx = rest["data-rf-timeline-index"];
|
|
9528
|
+
let effectivePosition;
|
|
9529
|
+
if (positionProp) {
|
|
9530
|
+
effectivePosition = positionProp;
|
|
9531
|
+
} else if (parentPosition === "right") {
|
|
9532
|
+
effectivePosition = "right";
|
|
9533
|
+
} else if (parentPosition === "left") {
|
|
9534
|
+
effectivePosition = "left";
|
|
9535
|
+
} else if (parentPosition === "alternate") {
|
|
9536
|
+
effectivePosition = (idx ?? 0) % 2 === 0 ? "right" : "left";
|
|
9537
|
+
} else {
|
|
9538
|
+
effectivePosition = (idx ?? 0) % 2 === 0 ? "left" : "right";
|
|
9539
|
+
}
|
|
9540
|
+
let hasOpposite = false;
|
|
9541
|
+
React173.Children.forEach(children, (child) => {
|
|
9542
|
+
if (React173.isValidElement(child) && child.type?.displayName === "TimelineOppositeContent") {
|
|
9543
|
+
hasOpposite = true;
|
|
9544
|
+
}
|
|
9545
|
+
});
|
|
9546
|
+
const sxClass = useSx(sx);
|
|
9547
|
+
const classes = [
|
|
9548
|
+
"rf-timeline-item",
|
|
9549
|
+
`rf-timeline-item--${effectivePosition}`,
|
|
9550
|
+
hasOpposite ? "rf-timeline-item--has-opposite" : "rf-timeline-item--no-opposite",
|
|
9551
|
+
sxClass,
|
|
9552
|
+
className
|
|
9553
|
+
].filter(Boolean).join(" ");
|
|
9554
|
+
return /* @__PURE__ */ React173.createElement(TimelineItemContext.Provider, { value: { effectivePosition } }, /* @__PURE__ */ React173.createElement("li", { ref, className: classes, ...rest }, children));
|
|
9555
|
+
}
|
|
9556
|
+
);
|
|
9557
|
+
TimelineItem.displayName = "TimelineItem";
|
|
9558
|
+
var TimelineSeparator = React173.forwardRef(({ sx, className, children, ...rest }, ref) => {
|
|
9559
|
+
const sxClass = useSx(sx);
|
|
9560
|
+
const classes = ["rf-timeline-separator", sxClass, className].filter(Boolean).join(" ");
|
|
9561
|
+
return /* @__PURE__ */ React173.createElement("div", { ref, className: classes, ...rest }, children);
|
|
9562
|
+
});
|
|
9563
|
+
TimelineSeparator.displayName = "TimelineSeparator";
|
|
9564
|
+
var TimelineDot = React173.forwardRef(
|
|
9565
|
+
({ color = "grey", variant = "filled", sx, className, children, ...rest }, ref) => {
|
|
9566
|
+
const sxClass = useSx(sx);
|
|
9567
|
+
const classes = [
|
|
9568
|
+
"rf-timeline-dot",
|
|
9569
|
+
`rf-timeline-dot--${variant}`,
|
|
9570
|
+
`rf-timeline-dot--${color}`,
|
|
9571
|
+
children ? "rf-timeline-dot--has-content" : "",
|
|
9572
|
+
sxClass,
|
|
9573
|
+
className
|
|
9574
|
+
].filter(Boolean).join(" ");
|
|
9575
|
+
return /* @__PURE__ */ React173.createElement("span", { ref, className: classes, ...rest }, children);
|
|
9576
|
+
}
|
|
9577
|
+
);
|
|
9578
|
+
TimelineDot.displayName = "TimelineDot";
|
|
9579
|
+
var TimelineConnector = React173.forwardRef(({ sx, className, ...rest }, ref) => {
|
|
9580
|
+
const sxClass = useSx(sx);
|
|
9581
|
+
const classes = ["rf-timeline-connector", sxClass, className].filter(Boolean).join(" ");
|
|
9582
|
+
return /* @__PURE__ */ React173.createElement("span", { ref, className: classes, ...rest });
|
|
9583
|
+
});
|
|
9584
|
+
TimelineConnector.displayName = "TimelineConnector";
|
|
9585
|
+
var TimelineContent = React173.forwardRef(({ sx, className, children, ...rest }, ref) => {
|
|
9586
|
+
const sxClass = useSx(sx);
|
|
9587
|
+
const classes = ["rf-timeline-content", sxClass, className].filter(Boolean).join(" ");
|
|
9588
|
+
return /* @__PURE__ */ React173.createElement("div", { ref, className: classes, ...rest }, children);
|
|
9589
|
+
});
|
|
9590
|
+
TimelineContent.displayName = "TimelineContent";
|
|
9591
|
+
var TimelineOppositeContent = React173.forwardRef(({ sx, className, children, ...rest }, ref) => {
|
|
9592
|
+
const sxClass = useSx(sx);
|
|
9593
|
+
const classes = ["rf-timeline-opposite-content", sxClass, className].filter(Boolean).join(" ");
|
|
9594
|
+
return /* @__PURE__ */ React173.createElement("div", { ref, className: classes, ...rest }, children);
|
|
9595
|
+
});
|
|
9596
|
+
TimelineOppositeContent.displayName = "TimelineOppositeContent";
|
|
9597
|
+
|
|
9598
|
+
// lib/ClickAwayListener/ClickAwayListener.tsx
|
|
9599
|
+
import * as React174 from "react";
|
|
9494
9600
|
function mapEventPropToEvent(eventProp) {
|
|
9495
9601
|
return eventProp.substring(2).toLowerCase();
|
|
9496
9602
|
}
|
|
@@ -9508,7 +9614,7 @@ function setRef(ref, value) {
|
|
|
9508
9614
|
}
|
|
9509
9615
|
}
|
|
9510
9616
|
function useForkRef(refA, refB) {
|
|
9511
|
-
return
|
|
9617
|
+
return React174.useMemo(() => {
|
|
9512
9618
|
if (refA == null && refB == null) {
|
|
9513
9619
|
return null;
|
|
9514
9620
|
}
|
|
@@ -9519,14 +9625,14 @@ function useForkRef(refA, refB) {
|
|
|
9519
9625
|
}, [refA, refB]);
|
|
9520
9626
|
}
|
|
9521
9627
|
function useEventCallback(fn) {
|
|
9522
|
-
const ref =
|
|
9523
|
-
|
|
9628
|
+
const ref = React174.useRef(fn);
|
|
9629
|
+
React174.useEffect(() => {
|
|
9524
9630
|
ref.current = fn;
|
|
9525
9631
|
});
|
|
9526
|
-
return
|
|
9632
|
+
return React174.useCallback((...args) => ref.current(...args), []);
|
|
9527
9633
|
}
|
|
9528
9634
|
function getReactElementRef(element) {
|
|
9529
|
-
const major = parseInt(
|
|
9635
|
+
const major = parseInt(React174.version, 10);
|
|
9530
9636
|
if (major >= 19) {
|
|
9531
9637
|
return element.props?.ref ?? null;
|
|
9532
9638
|
}
|
|
@@ -9540,11 +9646,11 @@ function ClickAwayListener(props) {
|
|
|
9540
9646
|
onClickAway,
|
|
9541
9647
|
touchEvent = "onTouchEnd"
|
|
9542
9648
|
} = props;
|
|
9543
|
-
const movedRef =
|
|
9544
|
-
const nodeRef =
|
|
9545
|
-
const activatedRef =
|
|
9546
|
-
const syntheticEventRef =
|
|
9547
|
-
|
|
9649
|
+
const movedRef = React174.useRef(false);
|
|
9650
|
+
const nodeRef = React174.useRef(null);
|
|
9651
|
+
const activatedRef = React174.useRef(false);
|
|
9652
|
+
const syntheticEventRef = React174.useRef(false);
|
|
9653
|
+
React174.useEffect(() => {
|
|
9548
9654
|
const id = setTimeout(() => {
|
|
9549
9655
|
activatedRef.current = true;
|
|
9550
9656
|
}, 0);
|
|
@@ -9593,7 +9699,7 @@ function ClickAwayListener(props) {
|
|
|
9593
9699
|
if (touchEvent !== false) {
|
|
9594
9700
|
childrenProps[touchEvent] = createHandleSynthetic(touchEvent);
|
|
9595
9701
|
}
|
|
9596
|
-
|
|
9702
|
+
React174.useEffect(() => {
|
|
9597
9703
|
if (touchEvent === false) {
|
|
9598
9704
|
return void 0;
|
|
9599
9705
|
}
|
|
@@ -9612,7 +9718,7 @@ function ClickAwayListener(props) {
|
|
|
9612
9718
|
if (mouseEvent !== false) {
|
|
9613
9719
|
childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);
|
|
9614
9720
|
}
|
|
9615
|
-
|
|
9721
|
+
React174.useEffect(() => {
|
|
9616
9722
|
if (mouseEvent === false) {
|
|
9617
9723
|
return void 0;
|
|
9618
9724
|
}
|
|
@@ -9623,11 +9729,11 @@ function ClickAwayListener(props) {
|
|
|
9623
9729
|
doc.removeEventListener(mappedMouseEvent, handleClickAway);
|
|
9624
9730
|
};
|
|
9625
9731
|
}, [handleClickAway, mouseEvent]);
|
|
9626
|
-
return
|
|
9732
|
+
return React174.cloneElement(children, childrenProps);
|
|
9627
9733
|
}
|
|
9628
9734
|
|
|
9629
9735
|
// lib/Link/Link.tsx
|
|
9630
|
-
import
|
|
9736
|
+
import React175 from "react";
|
|
9631
9737
|
var KNOWN_COLORS = ["primary", "secondary", "textPrimary", "textSecondary", "inherit"];
|
|
9632
9738
|
var Link = ({
|
|
9633
9739
|
href,
|
|
@@ -9658,7 +9764,7 @@ var Link = ({
|
|
|
9658
9764
|
};
|
|
9659
9765
|
const Tag = component || "a";
|
|
9660
9766
|
const computedRel = rel ?? (target === "_blank" ? "noopener noreferrer" : void 0);
|
|
9661
|
-
return /* @__PURE__ */
|
|
9767
|
+
return /* @__PURE__ */ React175.createElement(
|
|
9662
9768
|
Tag,
|
|
9663
9769
|
{
|
|
9664
9770
|
href,
|
|
@@ -9675,7 +9781,7 @@ var Link = ({
|
|
|
9675
9781
|
Link.displayName = "Link";
|
|
9676
9782
|
|
|
9677
9783
|
// lib/Popper/Popper.tsx
|
|
9678
|
-
import
|
|
9784
|
+
import React176, {
|
|
9679
9785
|
useEffect as useEffect17,
|
|
9680
9786
|
useLayoutEffect as useLayoutEffect2,
|
|
9681
9787
|
useRef as useRef20,
|
|
@@ -9811,7 +9917,7 @@ var Popper = ({
|
|
|
9811
9917
|
const content = typeof children === "function" ? children(
|
|
9812
9918
|
{ placement, TransitionProps: transitionProps }
|
|
9813
9919
|
) : children;
|
|
9814
|
-
const popper = /* @__PURE__ */
|
|
9920
|
+
const popper = /* @__PURE__ */ React176.createElement(
|
|
9815
9921
|
"div",
|
|
9816
9922
|
{
|
|
9817
9923
|
ref: popperRef,
|
|
@@ -9822,14 +9928,14 @@ var Popper = ({
|
|
|
9822
9928
|
content
|
|
9823
9929
|
);
|
|
9824
9930
|
if (disablePortal) {
|
|
9825
|
-
return /* @__PURE__ */
|
|
9931
|
+
return /* @__PURE__ */ React176.createElement(React176.Fragment, null, popper);
|
|
9826
9932
|
}
|
|
9827
9933
|
return ReactDOM9.createPortal(popper, document.body);
|
|
9828
9934
|
};
|
|
9829
9935
|
Popper.displayName = "Popper";
|
|
9830
9936
|
|
|
9831
9937
|
// lib/Popover/Popover.tsx
|
|
9832
|
-
import
|
|
9938
|
+
import React177, {
|
|
9833
9939
|
useEffect as useEffect18,
|
|
9834
9940
|
useLayoutEffect as useLayoutEffect3,
|
|
9835
9941
|
useRef as useRef21,
|
|
@@ -9913,14 +10019,14 @@ var Popover = ({
|
|
|
9913
10019
|
paperSxClass
|
|
9914
10020
|
].filter(Boolean).join(" ");
|
|
9915
10021
|
const rootClasses = ["rf-popover-root", sxClass, className].filter(Boolean).join(" ");
|
|
9916
|
-
const content = /* @__PURE__ */
|
|
10022
|
+
const content = /* @__PURE__ */ React177.createElement(React177.Fragment, null, /* @__PURE__ */ React177.createElement(
|
|
9917
10023
|
"div",
|
|
9918
10024
|
{
|
|
9919
10025
|
className: "rf-popover-backdrop",
|
|
9920
10026
|
onClick: onClose,
|
|
9921
10027
|
"aria-hidden": "true"
|
|
9922
10028
|
}
|
|
9923
|
-
), /* @__PURE__ */
|
|
10029
|
+
), /* @__PURE__ */ React177.createElement(
|
|
9924
10030
|
"div",
|
|
9925
10031
|
{
|
|
9926
10032
|
ref: paperRef,
|
|
@@ -9936,18 +10042,18 @@ var Popover = ({
|
|
|
9936
10042
|
children
|
|
9937
10043
|
));
|
|
9938
10044
|
if (disablePortal) {
|
|
9939
|
-
return /* @__PURE__ */
|
|
10045
|
+
return /* @__PURE__ */ React177.createElement("div", { className: `${rootClasses} rf-popover-inline`, style }, content);
|
|
9940
10046
|
}
|
|
9941
10047
|
return ReactDOM10.createPortal(
|
|
9942
|
-
/* @__PURE__ */
|
|
10048
|
+
/* @__PURE__ */ React177.createElement("div", { className: rootClasses, style }, content),
|
|
9943
10049
|
document.body
|
|
9944
10050
|
);
|
|
9945
10051
|
};
|
|
9946
10052
|
Popover.displayName = "Popover";
|
|
9947
10053
|
|
|
9948
10054
|
// lib/Transitions/Transitions.tsx
|
|
9949
|
-
import
|
|
9950
|
-
cloneElement as
|
|
10055
|
+
import React178, {
|
|
10056
|
+
cloneElement as cloneElement6,
|
|
9951
10057
|
useEffect as useEffect19,
|
|
9952
10058
|
useRef as useRef22,
|
|
9953
10059
|
useState as useState24
|
|
@@ -10006,7 +10112,7 @@ var Fade = ({
|
|
|
10006
10112
|
const enterMs = getTimeout(timeout, "enter");
|
|
10007
10113
|
const exitMs = getTimeout(timeout, "exit");
|
|
10008
10114
|
const dur = state === "entering" || state === "entered" ? enterMs : exitMs;
|
|
10009
|
-
return
|
|
10115
|
+
return cloneElement6(children, {
|
|
10010
10116
|
className: [
|
|
10011
10117
|
children.props.className,
|
|
10012
10118
|
"rf-fade",
|
|
@@ -10051,7 +10157,7 @@ var Slide = ({
|
|
|
10051
10157
|
const enterMs = getTimeout(timeout, "enter");
|
|
10052
10158
|
const exitMs = getTimeout(timeout, "exit");
|
|
10053
10159
|
const dur = state === "entering" || state === "entered" ? enterMs : exitMs;
|
|
10054
|
-
return
|
|
10160
|
+
return cloneElement6(children, {
|
|
10055
10161
|
className: [
|
|
10056
10162
|
children.props.className,
|
|
10057
10163
|
"rf-slide",
|
|
@@ -10080,7 +10186,7 @@ var Grow = ({
|
|
|
10080
10186
|
const enterMs = getTimeout(timeout, "enter");
|
|
10081
10187
|
const exitMs = getTimeout(timeout, "exit");
|
|
10082
10188
|
const dur = state === "entering" || state === "entered" ? enterMs : exitMs;
|
|
10083
|
-
return
|
|
10189
|
+
return cloneElement6(children, {
|
|
10084
10190
|
className: [
|
|
10085
10191
|
children.props.className,
|
|
10086
10192
|
"rf-grow",
|
|
@@ -10129,7 +10235,7 @@ var Collapse = ({
|
|
|
10129
10235
|
const exitMs = getTimeout(timeout, "exit");
|
|
10130
10236
|
const dur = state === "entering" || state === "entered" ? enterMs : exitMs;
|
|
10131
10237
|
const containerStyle = orientation === "vertical" ? { height: size === "auto" ? "auto" : typeof size === "number" ? `${size}px` : size } : { width: size === "auto" ? "auto" : typeof size === "number" ? `${size}px` : size };
|
|
10132
|
-
return /* @__PURE__ */
|
|
10238
|
+
return /* @__PURE__ */ React178.createElement(
|
|
10133
10239
|
"div",
|
|
10134
10240
|
{
|
|
10135
10241
|
className: [
|
|
@@ -10142,7 +10248,7 @@ var Collapse = ({
|
|
|
10142
10248
|
...containerStyle
|
|
10143
10249
|
}
|
|
10144
10250
|
},
|
|
10145
|
-
/* @__PURE__ */
|
|
10251
|
+
/* @__PURE__ */ React178.createElement(
|
|
10146
10252
|
"div",
|
|
10147
10253
|
{
|
|
10148
10254
|
ref: innerRef,
|
|
@@ -10168,7 +10274,7 @@ var Zoom = ({
|
|
|
10168
10274
|
const enterMs = getTimeout(timeout, "enter");
|
|
10169
10275
|
const exitMs = getTimeout(timeout, "exit");
|
|
10170
10276
|
const dur = state === "entering" || state === "entered" ? enterMs : exitMs;
|
|
10171
|
-
return
|
|
10277
|
+
return cloneElement6(children, {
|
|
10172
10278
|
className: [
|
|
10173
10279
|
children.props.className,
|
|
10174
10280
|
"rf-zoom",
|
|
@@ -10183,7 +10289,7 @@ var Zoom = ({
|
|
|
10183
10289
|
Zoom.displayName = "Zoom";
|
|
10184
10290
|
|
|
10185
10291
|
// lib/ImageField/ImageField.tsx
|
|
10186
|
-
import
|
|
10292
|
+
import React179, { useRef as useRef23, useState as useState25, useCallback as useCallback10 } from "react";
|
|
10187
10293
|
function getSizeStyle2(size) {
|
|
10188
10294
|
if (size === "small") return { className: "rf-image-field--small" };
|
|
10189
10295
|
if (size === "large") return { className: "rf-image-field--large" };
|
|
@@ -10195,7 +10301,7 @@ function getSizeStyle2(size) {
|
|
|
10195
10301
|
}
|
|
10196
10302
|
return { className: "rf-image-field--medium" };
|
|
10197
10303
|
}
|
|
10198
|
-
var ImageField =
|
|
10304
|
+
var ImageField = React179.forwardRef(
|
|
10199
10305
|
({
|
|
10200
10306
|
src,
|
|
10201
10307
|
alt = "",
|
|
@@ -10247,7 +10353,7 @@ var ImageField = React178.forwardRef(
|
|
|
10247
10353
|
className
|
|
10248
10354
|
].filter(Boolean).join(" ");
|
|
10249
10355
|
const iconSize = typeof size === "number" ? Math.max(size * 0.25, 16) : size === "small" ? 16 : size === "large" ? 28 : 22;
|
|
10250
|
-
return /* @__PURE__ */
|
|
10356
|
+
return /* @__PURE__ */ React179.createElement(
|
|
10251
10357
|
"div",
|
|
10252
10358
|
{
|
|
10253
10359
|
ref,
|
|
@@ -10259,14 +10365,14 @@ var ImageField = React178.forwardRef(
|
|
|
10259
10365
|
onClick: handleClick,
|
|
10260
10366
|
onKeyDown: handleKeyDown
|
|
10261
10367
|
},
|
|
10262
|
-
displaySrc ? /* @__PURE__ */
|
|
10368
|
+
displaySrc ? /* @__PURE__ */ React179.createElement(
|
|
10263
10369
|
"img",
|
|
10264
10370
|
{
|
|
10265
10371
|
src: displaySrc,
|
|
10266
10372
|
alt,
|
|
10267
10373
|
className: "rf-image-field__img"
|
|
10268
10374
|
}
|
|
10269
|
-
) : /* @__PURE__ */
|
|
10375
|
+
) : /* @__PURE__ */ React179.createElement("div", { className: "rf-image-field__placeholder" }, /* @__PURE__ */ React179.createElement(
|
|
10270
10376
|
cameraIcon_default,
|
|
10271
10377
|
{
|
|
10272
10378
|
width: iconSize,
|
|
@@ -10274,8 +10380,8 @@ var ImageField = React178.forwardRef(
|
|
|
10274
10380
|
color: "var(--text-secondary)"
|
|
10275
10381
|
}
|
|
10276
10382
|
)),
|
|
10277
|
-
/* @__PURE__ */
|
|
10278
|
-
/* @__PURE__ */
|
|
10383
|
+
/* @__PURE__ */ React179.createElement("div", { className: "rf-image-field__overlay" }, /* @__PURE__ */ React179.createElement(cameraIcon_default, { width: iconSize, height: iconSize, color: "#ffffff" }), overlayText && /* @__PURE__ */ React179.createElement("span", { className: "rf-image-field__overlay-text" }, overlayText)),
|
|
10384
|
+
/* @__PURE__ */ React179.createElement(
|
|
10279
10385
|
"input",
|
|
10280
10386
|
{
|
|
10281
10387
|
ref: inputRef,
|
|
@@ -10292,12 +10398,12 @@ var ImageField = React178.forwardRef(
|
|
|
10292
10398
|
ImageField.displayName = "ImageField";
|
|
10293
10399
|
|
|
10294
10400
|
// lib/PhoneField/PhoneField.tsx
|
|
10295
|
-
import
|
|
10401
|
+
import React180, {
|
|
10296
10402
|
useState as useState26,
|
|
10297
10403
|
useRef as useRef24,
|
|
10298
10404
|
useEffect as useEffect20,
|
|
10299
10405
|
useCallback as useCallback11,
|
|
10300
|
-
forwardRef as
|
|
10406
|
+
forwardRef as forwardRef19
|
|
10301
10407
|
} from "react";
|
|
10302
10408
|
import { Country as Country2 } from "country-state-city";
|
|
10303
10409
|
import { computePosition as computePosition2, flip, offset, shift, size as floatingSize } from "@floating-ui/dom";
|
|
@@ -10325,7 +10431,7 @@ function detectCountryFromValue(countries, digits) {
|
|
|
10325
10431
|
}
|
|
10326
10432
|
return null;
|
|
10327
10433
|
}
|
|
10328
|
-
var PhoneField =
|
|
10434
|
+
var PhoneField = forwardRef19(function PhoneField2(props, ref) {
|
|
10329
10435
|
const {
|
|
10330
10436
|
value = "",
|
|
10331
10437
|
onChange,
|
|
@@ -10352,7 +10458,7 @@ var PhoneField = forwardRef18(function PhoneField2(props, ref) {
|
|
|
10352
10458
|
const listRef = useRef24(null);
|
|
10353
10459
|
const popupRef = useRef24(null);
|
|
10354
10460
|
const inputId = useRef24(`rf-phone-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
10355
|
-
const countries =
|
|
10461
|
+
const countries = React180.useMemo(() => {
|
|
10356
10462
|
const all = getAllCountries();
|
|
10357
10463
|
if (onlyCountries && onlyCountries.length > 0) {
|
|
10358
10464
|
return all.filter((c) => onlyCountries.includes(c.isoCode.toLowerCase()));
|
|
@@ -10518,7 +10624,7 @@ var PhoneField = forwardRef18(function PhoneField2(props, ref) {
|
|
|
10518
10624
|
sxClass,
|
|
10519
10625
|
className
|
|
10520
10626
|
].filter(Boolean).join(" ");
|
|
10521
|
-
return /* @__PURE__ */
|
|
10627
|
+
return /* @__PURE__ */ React180.createElement(
|
|
10522
10628
|
"div",
|
|
10523
10629
|
{
|
|
10524
10630
|
ref: (node) => {
|
|
@@ -10529,7 +10635,7 @@ var PhoneField = forwardRef18(function PhoneField2(props, ref) {
|
|
|
10529
10635
|
className: rootClasses,
|
|
10530
10636
|
style
|
|
10531
10637
|
},
|
|
10532
|
-
/* @__PURE__ */
|
|
10638
|
+
/* @__PURE__ */ React180.createElement("div", { className: "rf-text-field__wrapper" }, /* @__PURE__ */ React180.createElement(
|
|
10533
10639
|
"div",
|
|
10534
10640
|
{
|
|
10535
10641
|
className: `rf-phone-field__country-selector ${disabled || !countryCodeEditable ? "rf-phone-field__country-selector--disabled" : ""}`,
|
|
@@ -10541,9 +10647,9 @@ var PhoneField = forwardRef18(function PhoneField2(props, ref) {
|
|
|
10541
10647
|
"aria-expanded": open,
|
|
10542
10648
|
"aria-label": "Select country code"
|
|
10543
10649
|
},
|
|
10544
|
-
/* @__PURE__ */
|
|
10545
|
-
/* @__PURE__ */
|
|
10546
|
-
), /* @__PURE__ */
|
|
10650
|
+
/* @__PURE__ */ React180.createElement("span", { className: "rf-phone-field__flag" }, selectedCountry?.flag),
|
|
10651
|
+
/* @__PURE__ */ React180.createElement("span", { className: "rf-phone-field__dial-code" }, "+", dialCode)
|
|
10652
|
+
), /* @__PURE__ */ React180.createElement(
|
|
10547
10653
|
"input",
|
|
10548
10654
|
{
|
|
10549
10655
|
ref: inputRef,
|
|
@@ -10558,20 +10664,20 @@ var PhoneField = forwardRef18(function PhoneField2(props, ref) {
|
|
|
10558
10664
|
maxLength: 15,
|
|
10559
10665
|
...inputProps
|
|
10560
10666
|
}
|
|
10561
|
-
), hasLabel && /* @__PURE__ */
|
|
10562
|
-
helperText && /* @__PURE__ */
|
|
10563
|
-
open && !disabled && /* @__PURE__ */
|
|
10667
|
+
), hasLabel && /* @__PURE__ */ React180.createElement("label", { htmlFor: inputId, className: "rf-text-field__label" }, label, required && /* @__PURE__ */ React180.createElement("span", { className: "rf-text-field__asterisk" }, " *")), variant === "outlined" && /* @__PURE__ */ React180.createElement("fieldset", { className: "rf-text-field__notch" }, hasLabel ? /* @__PURE__ */ React180.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ React180.createElement("span", null, label, required ? " *" : "")) : /* @__PURE__ */ React180.createElement("legend", { className: "rf-text-field__legend--empty" }))),
|
|
10668
|
+
helperText && /* @__PURE__ */ React180.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText),
|
|
10669
|
+
open && !disabled && /* @__PURE__ */ React180.createElement(
|
|
10564
10670
|
"div",
|
|
10565
10671
|
{
|
|
10566
10672
|
ref: popupRef,
|
|
10567
10673
|
className: "rf-select__popup rf-phone-field__popup",
|
|
10568
10674
|
role: "presentation"
|
|
10569
10675
|
},
|
|
10570
|
-
search && /* @__PURE__ */
|
|
10571
|
-
/* @__PURE__ */
|
|
10676
|
+
search && /* @__PURE__ */ React180.createElement("div", { className: "rf-phone-field__search-indicator" }, "Search: ", search),
|
|
10677
|
+
/* @__PURE__ */ React180.createElement("ul", { ref: listRef, className: "rf-select__listbox", role: "listbox" }, filteredCountries.map((country, idx) => {
|
|
10572
10678
|
const isActive = selectedCountry?.isoCode === country.isoCode;
|
|
10573
10679
|
const focused = focusedIdx === idx;
|
|
10574
|
-
return /* @__PURE__ */
|
|
10680
|
+
return /* @__PURE__ */ React180.createElement(
|
|
10575
10681
|
"li",
|
|
10576
10682
|
{
|
|
10577
10683
|
key: country.isoCode,
|
|
@@ -10588,18 +10694,18 @@ var PhoneField = forwardRef18(function PhoneField2(props, ref) {
|
|
|
10588
10694
|
onMouseDown: (e) => e.preventDefault(),
|
|
10589
10695
|
onClick: () => selectCountry(country)
|
|
10590
10696
|
},
|
|
10591
|
-
/* @__PURE__ */
|
|
10592
|
-
/* @__PURE__ */
|
|
10593
|
-
/* @__PURE__ */
|
|
10697
|
+
/* @__PURE__ */ React180.createElement("span", { className: "rf-phone-field__option-flag" }, country.flag),
|
|
10698
|
+
/* @__PURE__ */ React180.createElement("span", { className: "rf-select__option-label", title: country.name }, country.name),
|
|
10699
|
+
/* @__PURE__ */ React180.createElement("span", { className: "rf-phone-field__option-code" }, "+", country.phonecode)
|
|
10594
10700
|
);
|
|
10595
|
-
}), filteredCountries.length === 0 && /* @__PURE__ */
|
|
10701
|
+
}), filteredCountries.length === 0 && /* @__PURE__ */ React180.createElement("li", { className: "rf-phone-field__no-results" }, "No countries found"))
|
|
10596
10702
|
)
|
|
10597
10703
|
);
|
|
10598
10704
|
});
|
|
10599
10705
|
PhoneField.displayName = "PhoneField";
|
|
10600
10706
|
|
|
10601
10707
|
// lib/TreeSelect/TreeSelect.tsx
|
|
10602
|
-
import
|
|
10708
|
+
import React181, {
|
|
10603
10709
|
useState as useState27,
|
|
10604
10710
|
useRef as useRef25,
|
|
10605
10711
|
useEffect as useEffect21,
|
|
@@ -10687,14 +10793,14 @@ function TreeNodeItem({
|
|
|
10687
10793
|
const hasChildren = !!node.children?.length;
|
|
10688
10794
|
const isExpanded = isFiltering || expanded.has(nid);
|
|
10689
10795
|
const state = allowChildSelection ? getNodeState(node, selected) : selected.has(nid) ? "checked" : "unchecked";
|
|
10690
|
-
return /* @__PURE__ */
|
|
10796
|
+
return /* @__PURE__ */ React181.createElement("div", { className: "rf-tsn" }, /* @__PURE__ */ React181.createElement(
|
|
10691
10797
|
"div",
|
|
10692
10798
|
{
|
|
10693
10799
|
className: `rf-tsn__row${state !== "unchecked" ? " rf-tsn__row--active" : ""}`,
|
|
10694
10800
|
style: { paddingLeft: 8 + depth * 20 },
|
|
10695
10801
|
onClick: () => onSelect(node)
|
|
10696
10802
|
},
|
|
10697
|
-
hasChildren ? /* @__PURE__ */
|
|
10803
|
+
hasChildren ? /* @__PURE__ */ React181.createElement(
|
|
10698
10804
|
"button",
|
|
10699
10805
|
{
|
|
10700
10806
|
type: "button",
|
|
@@ -10704,11 +10810,11 @@ function TreeNodeItem({
|
|
|
10704
10810
|
onToggleExpand(nid);
|
|
10705
10811
|
}
|
|
10706
10812
|
},
|
|
10707
|
-
isExpanded ? /* @__PURE__ */
|
|
10708
|
-
) : /* @__PURE__ */
|
|
10709
|
-
/* @__PURE__ */
|
|
10710
|
-
/* @__PURE__ */
|
|
10711
|
-
), hasChildren && isExpanded && /* @__PURE__ */
|
|
10813
|
+
isExpanded ? /* @__PURE__ */ React181.createElement(ChevronDown, { size: 14 }) : /* @__PURE__ */ React181.createElement(ChevronRight, { size: 14 })
|
|
10814
|
+
) : /* @__PURE__ */ React181.createElement("span", { className: "rf-tsn__expand-ph" }),
|
|
10815
|
+
/* @__PURE__ */ React181.createElement("span", { className: "rf-tsn__label" }, node.label),
|
|
10816
|
+
/* @__PURE__ */ React181.createElement("span", { className: "rf-tsn__check", "aria-hidden": "true" }, state === "partial" ? /* @__PURE__ */ React181.createElement(Minus, { size: 13, strokeWidth: 2.5 }) : /* @__PURE__ */ React181.createElement(Check, { size: 13, strokeWidth: 2.5 }))
|
|
10817
|
+
), hasChildren && isExpanded && /* @__PURE__ */ React181.createElement("div", null, node.children.map((child) => /* @__PURE__ */ React181.createElement(
|
|
10712
10818
|
TreeNodeItem,
|
|
10713
10819
|
{
|
|
10714
10820
|
key: child.id,
|
|
@@ -10920,7 +11026,7 @@ function TreeSelect({
|
|
|
10920
11026
|
sxClass,
|
|
10921
11027
|
className
|
|
10922
11028
|
].filter(Boolean).join(" ");
|
|
10923
|
-
return /* @__PURE__ */
|
|
11029
|
+
return /* @__PURE__ */ React181.createElement("div", { className: rootClasses, style }, /* @__PURE__ */ React181.createElement(
|
|
10924
11030
|
"div",
|
|
10925
11031
|
{
|
|
10926
11032
|
ref: triggerRef,
|
|
@@ -10932,7 +11038,7 @@ function TreeSelect({
|
|
|
10932
11038
|
onBlur: handleTriggerBlur,
|
|
10933
11039
|
onKeyDown: handleKeyDown
|
|
10934
11040
|
},
|
|
10935
|
-
isMultiple ? /* @__PURE__ */
|
|
11041
|
+
isMultiple ? /* @__PURE__ */ React181.createElement("div", { className: "rf-ts__chips" }, tagNodes.length > 0 ? tagNodes.map((node) => /* @__PURE__ */ React181.createElement("span", { key: node.id, className: "rf-ts__chip" }, node.label, !disabled && /* @__PURE__ */ React181.createElement(
|
|
10936
11042
|
"button",
|
|
10937
11043
|
{
|
|
10938
11044
|
type: "button",
|
|
@@ -10940,9 +11046,9 @@ function TreeSelect({
|
|
|
10940
11046
|
onClick: (e) => handleRemoveTag(e, node),
|
|
10941
11047
|
tabIndex: -1
|
|
10942
11048
|
},
|
|
10943
|
-
/* @__PURE__ */
|
|
10944
|
-
))) : isFloating || !label ? /* @__PURE__ */
|
|
10945
|
-
/* @__PURE__ */
|
|
11049
|
+
/* @__PURE__ */ React181.createElement(X, { size: 10 })
|
|
11050
|
+
))) : isFloating || !label ? /* @__PURE__ */ React181.createElement("span", { className: "rf-ts__placeholder" }, placeholder) : null) : /* @__PURE__ */ React181.createElement("div", { className: `rf-ts__display${!hasValue ? " rf-ts__display--placeholder" : ""}` }, hasValue ? tagNodes[0]?.label : isFloating || !label ? placeholder : "\xA0"),
|
|
11051
|
+
/* @__PURE__ */ React181.createElement("div", { className: "rf-autocomplete__endgroup" }, !disabled && clearable && hasValue && /* @__PURE__ */ React181.createElement(
|
|
10946
11052
|
"button",
|
|
10947
11053
|
{
|
|
10948
11054
|
type: "button",
|
|
@@ -10950,8 +11056,8 @@ function TreeSelect({
|
|
|
10950
11056
|
onClick: handleClear,
|
|
10951
11057
|
tabIndex: -1
|
|
10952
11058
|
},
|
|
10953
|
-
/* @__PURE__ */
|
|
10954
|
-
), !disabled && /* @__PURE__ */
|
|
11059
|
+
/* @__PURE__ */ React181.createElement(X, { size: 16 })
|
|
11060
|
+
), !disabled && /* @__PURE__ */ React181.createElement(
|
|
10955
11061
|
"button",
|
|
10956
11062
|
{
|
|
10957
11063
|
type: "button",
|
|
@@ -10962,21 +11068,21 @@ function TreeSelect({
|
|
|
10962
11068
|
},
|
|
10963
11069
|
tabIndex: -1
|
|
10964
11070
|
},
|
|
10965
|
-
/* @__PURE__ */
|
|
11071
|
+
/* @__PURE__ */ React181.createElement(ChevronDown, { size: 18 })
|
|
10966
11072
|
)),
|
|
10967
|
-
label && /* @__PURE__ */
|
|
10968
|
-
variant === "outlined" && /* @__PURE__ */
|
|
10969
|
-
variant === "filled" && /* @__PURE__ */
|
|
10970
|
-
variant === "standard" && /* @__PURE__ */
|
|
10971
|
-
), helperText && /* @__PURE__ */
|
|
10972
|
-
/* @__PURE__ */
|
|
11073
|
+
label && /* @__PURE__ */ React181.createElement("label", { className: "rf-text-field__label" }, label, required && /* @__PURE__ */ React181.createElement("span", { className: "rf-text-field__asterisk" }, " *")),
|
|
11074
|
+
variant === "outlined" && /* @__PURE__ */ React181.createElement("fieldset", { "aria-hidden": true, className: "rf-text-field__notch" }, /* @__PURE__ */ React181.createElement("legend", { className: "rf-text-field__legend" }, label && /* @__PURE__ */ React181.createElement("span", null, label, required ? " *" : ""))),
|
|
11075
|
+
variant === "filled" && /* @__PURE__ */ React181.createElement(React181.Fragment, null, /* @__PURE__ */ React181.createElement("div", { className: "rf-text-field__filled-bg" }), /* @__PURE__ */ React181.createElement("div", { className: "rf-text-field__underline" })),
|
|
11076
|
+
variant === "standard" && /* @__PURE__ */ React181.createElement("div", { className: "rf-text-field__underline" })
|
|
11077
|
+
), helperText && /* @__PURE__ */ React181.createElement("p", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText), open && ReactDOM11.createPortal(
|
|
11078
|
+
/* @__PURE__ */ React181.createElement(
|
|
10973
11079
|
"div",
|
|
10974
11080
|
{
|
|
10975
11081
|
ref: dropdownRef,
|
|
10976
11082
|
className: "rf-tree-select__popup",
|
|
10977
11083
|
style: dropdownStyle
|
|
10978
11084
|
},
|
|
10979
|
-
filter && /* @__PURE__ */
|
|
11085
|
+
filter && /* @__PURE__ */ React181.createElement("div", { className: "rf-tree-select__filter" }, /* @__PURE__ */ React181.createElement(Search, { size: 14, className: "rf-tree-select__filter-icon" }), /* @__PURE__ */ React181.createElement(
|
|
10980
11086
|
"input",
|
|
10981
11087
|
{
|
|
10982
11088
|
ref: filterInputRef,
|
|
@@ -10985,7 +11091,7 @@ function TreeSelect({
|
|
|
10985
11091
|
value: filterQuery,
|
|
10986
11092
|
onChange: (e) => setFilterQuery(e.target.value)
|
|
10987
11093
|
}
|
|
10988
|
-
), filterQuery && /* @__PURE__ */
|
|
11094
|
+
), filterQuery && /* @__PURE__ */ React181.createElement(
|
|
10989
11095
|
"button",
|
|
10990
11096
|
{
|
|
10991
11097
|
type: "button",
|
|
@@ -10993,9 +11099,9 @@ function TreeSelect({
|
|
|
10993
11099
|
onClick: () => setFilterQuery(""),
|
|
10994
11100
|
tabIndex: -1
|
|
10995
11101
|
},
|
|
10996
|
-
/* @__PURE__ */
|
|
11102
|
+
/* @__PURE__ */ React181.createElement(X, { size: 12 })
|
|
10997
11103
|
)),
|
|
10998
|
-
/* @__PURE__ */
|
|
11104
|
+
/* @__PURE__ */ React181.createElement("div", { className: "rf-tree-select__tree" }, filteredTree.length === 0 ? /* @__PURE__ */ React181.createElement("div", { className: "rf-tree-select__empty" }, "No results found") : filteredTree.map((node) => /* @__PURE__ */ React181.createElement(
|
|
10999
11105
|
TreeNodeItem,
|
|
11000
11106
|
{
|
|
11001
11107
|
key: node.id,
|
|
@@ -11016,7 +11122,7 @@ function TreeSelect({
|
|
|
11016
11122
|
}
|
|
11017
11123
|
|
|
11018
11124
|
// lib/UserSelectionField/UserSelectionField.tsx
|
|
11019
|
-
import
|
|
11125
|
+
import React182 from "react";
|
|
11020
11126
|
function getOptionId(opt) {
|
|
11021
11127
|
return opt.id ?? opt._id;
|
|
11022
11128
|
}
|
|
@@ -11030,7 +11136,7 @@ function matchesSearch(opt, query) {
|
|
|
11030
11136
|
}
|
|
11031
11137
|
function UserAvatar({ user }) {
|
|
11032
11138
|
const initials = (user.userFirstName?.[0] ?? "").toUpperCase() + (user.userLastName?.[0] ?? "").toUpperCase();
|
|
11033
|
-
return /* @__PURE__ */
|
|
11139
|
+
return /* @__PURE__ */ React182.createElement("span", { style: {
|
|
11034
11140
|
width: 28,
|
|
11035
11141
|
height: 28,
|
|
11036
11142
|
borderRadius: "50%",
|
|
@@ -11078,7 +11184,7 @@ function UserSelectionField({
|
|
|
11078
11184
|
onSearchChange(inputValue);
|
|
11079
11185
|
}
|
|
11080
11186
|
};
|
|
11081
|
-
return /* @__PURE__ */
|
|
11187
|
+
return /* @__PURE__ */ React182.createElement(
|
|
11082
11188
|
Autocomplete,
|
|
11083
11189
|
{
|
|
11084
11190
|
options,
|
|
@@ -11088,13 +11194,13 @@ function UserSelectionField({
|
|
|
11088
11194
|
multiple,
|
|
11089
11195
|
limitTags,
|
|
11090
11196
|
loading,
|
|
11091
|
-
loadingText: /* @__PURE__ */
|
|
11197
|
+
loadingText: /* @__PURE__ */ React182.createElement("span", { style: { display: "flex", alignItems: "center", gap: 8, padding: "4px 0" } }, /* @__PURE__ */ React182.createElement("span", { style: { fontSize: "0.875rem", color: "var(--text-secondary)" } }, "Loading\u2026")),
|
|
11092
11198
|
getOptionLabel: getLabel,
|
|
11093
11199
|
isOptionEqualToValue: (opt, val) => getOptionId(opt) === getOptionId(val),
|
|
11094
11200
|
filterOptions: filterOptionsProp ? (opts, inputValue) => filterOptionsProp(opts, inputValue) : (opts, inputValue) => inputValue ? opts.filter((opt) => matchesSearch(opt, inputValue)) : opts,
|
|
11095
11201
|
renderOption: (props, option) => {
|
|
11096
11202
|
const { key, ...rest } = props;
|
|
11097
|
-
return /* @__PURE__ */
|
|
11203
|
+
return /* @__PURE__ */ React182.createElement("li", { key, ...rest, style: { padding: "6px 12px", listStyle: "none" } }, /* @__PURE__ */ React182.createElement("span", { style: { display: "flex", alignItems: "center", gap: 10 } }, /* @__PURE__ */ React182.createElement(UserAvatar, { user: option }), /* @__PURE__ */ React182.createElement("span", { style: { display: "flex", flexDirection: "column", minWidth: 0 } }, /* @__PURE__ */ React182.createElement("span", { style: { fontSize: "0.85rem", color: "var(--text-color)", lineHeight: 1.3 } }, option.userFirstName, " ", option.userLastName), /* @__PURE__ */ React182.createElement("span", { style: { fontSize: "0.75rem", color: "var(--text-secondary)", lineHeight: 1.3 } }, option.emailId))));
|
|
11098
11204
|
},
|
|
11099
11205
|
label,
|
|
11100
11206
|
placeholder: label,
|
|
@@ -11113,8 +11219,8 @@ function UserSelectionField({
|
|
|
11113
11219
|
}
|
|
11114
11220
|
|
|
11115
11221
|
// lib/SmartSelect/SmartSelect.tsx
|
|
11116
|
-
import
|
|
11117
|
-
var CheckIcon3 = () => /* @__PURE__ */
|
|
11222
|
+
import React183, { useCallback as useCallback13, useEffect as useEffect22, useMemo as useMemo4, useRef as useRef26, useState as useState28 } from "react";
|
|
11223
|
+
var CheckIcon3 = () => /* @__PURE__ */ React183.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React183.createElement("polyline", { points: "20 6 9 17 4 12" }));
|
|
11118
11224
|
function flattenTree(options, getChildren, depth = 0) {
|
|
11119
11225
|
return options.flatMap((opt) => [
|
|
11120
11226
|
{ option: opt, depth },
|
|
@@ -11374,7 +11480,7 @@ function SmartSelect({
|
|
|
11374
11480
|
const depth = depthMap.get(getValue(option)) ?? 0;
|
|
11375
11481
|
const subLabel = getOptionSubLabel?.(option);
|
|
11376
11482
|
const isSelected = selectedKeys.has(getValue(option));
|
|
11377
|
-
return /* @__PURE__ */
|
|
11483
|
+
return /* @__PURE__ */ React183.createElement(
|
|
11378
11484
|
"li",
|
|
11379
11485
|
{
|
|
11380
11486
|
key,
|
|
@@ -11391,16 +11497,16 @@ function SmartSelect({
|
|
|
11391
11497
|
alignItems: subLabel ? "flex-start" : void 0
|
|
11392
11498
|
}
|
|
11393
11499
|
},
|
|
11394
|
-
/* @__PURE__ */
|
|
11500
|
+
/* @__PURE__ */ React183.createElement(
|
|
11395
11501
|
"span",
|
|
11396
11502
|
{
|
|
11397
11503
|
className: "rf-select__option-label",
|
|
11398
11504
|
style: subLabel ? { display: "flex", flexDirection: "column", whiteSpace: "normal" } : void 0
|
|
11399
11505
|
},
|
|
11400
|
-
/* @__PURE__ */
|
|
11401
|
-
subLabel && /* @__PURE__ */
|
|
11506
|
+
/* @__PURE__ */ React183.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: 1.3 } }, getOptionLabel(option)),
|
|
11507
|
+
subLabel && /* @__PURE__ */ React183.createElement("span", { style: { fontSize: "0.75rem", color: "var(--text-secondary)", lineHeight: 1.3, marginTop: 1 } }, subLabel)
|
|
11402
11508
|
),
|
|
11403
|
-
/* @__PURE__ */
|
|
11509
|
+
/* @__PURE__ */ React183.createElement("span", { className: "rf-select__option-check", "aria-hidden": "true" }, /* @__PURE__ */ React183.createElement(CheckIcon3, null))
|
|
11404
11510
|
);
|
|
11405
11511
|
}, [depthMap, getValue, getOptionLabel, getOptionSubLabel, selectedKeys]);
|
|
11406
11512
|
const computedFilterOptions = useCallback13((opts, inputVal) => {
|
|
@@ -11443,7 +11549,7 @@ function SmartSelect({
|
|
|
11443
11549
|
(opt) => getOptionLabel(opt).toLowerCase().includes(q) || (getOptionSubLabel?.(opt) ?? "").toLowerCase().includes(q)
|
|
11444
11550
|
).slice(0, searchThreshold);
|
|
11445
11551
|
}, [filterOptionsProp, multiple, selectedKeys, getValue, getOptionLabel, getOptionSubLabel, value, searchThreshold, strictSelection, strictValidation]);
|
|
11446
|
-
return /* @__PURE__ */
|
|
11552
|
+
return /* @__PURE__ */ React183.createElement(
|
|
11447
11553
|
Autocomplete,
|
|
11448
11554
|
{
|
|
11449
11555
|
options: displayOptions,
|
|
@@ -11454,7 +11560,7 @@ function SmartSelect({
|
|
|
11454
11560
|
multiple,
|
|
11455
11561
|
limitTags,
|
|
11456
11562
|
loading,
|
|
11457
|
-
loadingText: loadingText ?? /* @__PURE__ */
|
|
11563
|
+
loadingText: loadingText ?? /* @__PURE__ */ React183.createElement("span", { style: { fontSize: "0.875rem", color: "var(--text-secondary)" } }, "Loading\u2026"),
|
|
11458
11564
|
getOptionLabel,
|
|
11459
11565
|
isOptionEqualToValue: (opt, val) => {
|
|
11460
11566
|
try {
|
|
@@ -11482,7 +11588,7 @@ function SmartSelect({
|
|
|
11482
11588
|
}
|
|
11483
11589
|
|
|
11484
11590
|
// lib/RufousTextEditor/RufousTextEditor.tsx
|
|
11485
|
-
import
|
|
11591
|
+
import React194, { useMemo as useMemo6, useCallback as useCallback18, useState as useState38, useRef as useRef34, useEffect as useEffect31 } from "react";
|
|
11486
11592
|
import { createPortal as createPortal8 } from "react-dom";
|
|
11487
11593
|
import { useEditor, EditorContent, EditorContext, FloatingMenu, BubbleMenu } from "@tiptap/react";
|
|
11488
11594
|
import StarterKit from "@tiptap/starter-kit";
|
|
@@ -11508,8 +11614,8 @@ import { ReactRenderer } from "@tiptap/react";
|
|
|
11508
11614
|
import tippy from "tippy.js";
|
|
11509
11615
|
|
|
11510
11616
|
// lib/RufousTextEditor/MentionList.tsx
|
|
11511
|
-
import
|
|
11512
|
-
var MentionList =
|
|
11617
|
+
import React184, { forwardRef as forwardRef20, useEffect as useEffect23, useImperativeHandle, useState as useState29 } from "react";
|
|
11618
|
+
var MentionList = forwardRef20((props, ref) => {
|
|
11513
11619
|
const [selectedIndex, setSelectedIndex] = useState29(0);
|
|
11514
11620
|
const selectItem = (index) => {
|
|
11515
11621
|
const item = props.items[index];
|
|
@@ -11536,17 +11642,17 @@ var MentionList = forwardRef19((props, ref) => {
|
|
|
11536
11642
|
}
|
|
11537
11643
|
}));
|
|
11538
11644
|
if (!props.items.length) {
|
|
11539
|
-
return /* @__PURE__ */
|
|
11645
|
+
return /* @__PURE__ */ React184.createElement("div", { className: "rf-rte-mention-dropdown" }, /* @__PURE__ */ React184.createElement("div", { className: "rf-rte-mention-item rf-rte-mention-no-result" }, "No results"));
|
|
11540
11646
|
}
|
|
11541
|
-
return /* @__PURE__ */
|
|
11647
|
+
return /* @__PURE__ */ React184.createElement("div", { className: "rf-rte-mention-dropdown" }, props.items.map((item, index) => /* @__PURE__ */ React184.createElement(
|
|
11542
11648
|
"button",
|
|
11543
11649
|
{
|
|
11544
11650
|
className: `rf-rte-mention-item ${index === selectedIndex ? "is-selected" : ""}`,
|
|
11545
11651
|
key: item.id,
|
|
11546
11652
|
onClick: () => selectItem(index)
|
|
11547
11653
|
},
|
|
11548
|
-
/* @__PURE__ */
|
|
11549
|
-
/* @__PURE__ */
|
|
11654
|
+
/* @__PURE__ */ React184.createElement("span", { className: "rf-rte-mention-avatar" }, item.avatar || item.name.charAt(0).toUpperCase()),
|
|
11655
|
+
/* @__PURE__ */ React184.createElement("span", { className: "rf-rte-mention-name" }, item.name)
|
|
11550
11656
|
)));
|
|
11551
11657
|
});
|
|
11552
11658
|
MentionList.displayName = "MentionList";
|
|
@@ -11604,12 +11710,12 @@ function createMentionSuggestion(users) {
|
|
|
11604
11710
|
}
|
|
11605
11711
|
|
|
11606
11712
|
// lib/RufousTextEditor/Toolbar.tsx
|
|
11607
|
-
import
|
|
11713
|
+
import React190, { useState as useState34, useRef as useRef30, useEffect as useEffect27, useCallback as useCallback17 } from "react";
|
|
11608
11714
|
import { createPortal as createPortal4 } from "react-dom";
|
|
11609
11715
|
|
|
11610
11716
|
// lib/RufousTextEditor/TextToSpeech.tsx
|
|
11611
|
-
import
|
|
11612
|
-
var TextToSpeech =
|
|
11717
|
+
import React185, { useState as useState30, useEffect as useEffect24, useRef as useRef27, useCallback as useCallback14, forwardRef as forwardRef21, useImperativeHandle as useImperativeHandle2 } from "react";
|
|
11718
|
+
var TextToSpeech = forwardRef21(({ editor, onTextToSpeech }, ref) => {
|
|
11613
11719
|
const [speaking, setSpeaking] = useState30(false);
|
|
11614
11720
|
const [paused, setPaused] = useState30(false);
|
|
11615
11721
|
const [voices, setVoices] = useState30([]);
|
|
@@ -11713,7 +11819,7 @@ var TextToSpeech = forwardRef20(({ editor, onTextToSpeech }, ref) => {
|
|
|
11713
11819
|
setPaused(false);
|
|
11714
11820
|
}, []);
|
|
11715
11821
|
useImperativeHandle2(ref, () => ({ stop: handleStop }), [handleStop]);
|
|
11716
|
-
return /* @__PURE__ */
|
|
11822
|
+
return /* @__PURE__ */ React185.createElement("div", { className: "tts-wrapper", ref: panelRef }, /* @__PURE__ */ React185.createElement(Tooltip, { title: "Text to Speech", placement: "top" }, /* @__PURE__ */ React185.createElement(
|
|
11717
11823
|
"button",
|
|
11718
11824
|
{
|
|
11719
11825
|
className: `toolbar-btn ${speaking ? "is-active" : ""}`,
|
|
@@ -11726,15 +11832,15 @@ var TextToSpeech = forwardRef20(({ editor, onTextToSpeech }, ref) => {
|
|
|
11726
11832
|
}
|
|
11727
11833
|
},
|
|
11728
11834
|
speaking ? "\u23F9" : "\u{1F50A}"
|
|
11729
|
-
)), showPanel && !speaking && /* @__PURE__ */
|
|
11835
|
+
)), showPanel && !speaking && /* @__PURE__ */ React185.createElement("div", { className: "tts-panel" }, /* @__PURE__ */ React185.createElement("div", { className: "tts-panel-header" }, "Text to Speech"), /* @__PURE__ */ React185.createElement("label", { className: "tts-label" }, "Voice"), /* @__PURE__ */ React185.createElement(
|
|
11730
11836
|
"select",
|
|
11731
11837
|
{
|
|
11732
11838
|
className: "tts-select",
|
|
11733
11839
|
value: selectedVoice,
|
|
11734
11840
|
onChange: (e) => setSelectedVoice(e.target.value)
|
|
11735
11841
|
},
|
|
11736
|
-
voices.map((v) => /* @__PURE__ */
|
|
11737
|
-
), /* @__PURE__ */
|
|
11842
|
+
voices.map((v) => /* @__PURE__ */ React185.createElement("option", { key: v.name, value: v.name }, v.name, " (", v.lang, ")"))
|
|
11843
|
+
), /* @__PURE__ */ React185.createElement("label", { className: "tts-label" }, "Speed: ", rate, "x"), /* @__PURE__ */ React185.createElement(
|
|
11738
11844
|
"input",
|
|
11739
11845
|
{
|
|
11740
11846
|
type: "range",
|
|
@@ -11745,16 +11851,16 @@ var TextToSpeech = forwardRef20(({ editor, onTextToSpeech }, ref) => {
|
|
|
11745
11851
|
value: rate,
|
|
11746
11852
|
onChange: (e) => setRate(Number(e.target.value))
|
|
11747
11853
|
}
|
|
11748
|
-
), /* @__PURE__ */
|
|
11854
|
+
), /* @__PURE__ */ React185.createElement("div", { className: "tts-info" }, editor && !editor.state.selection.empty ? "Will read selected text" : "Will read all editor text"), /* @__PURE__ */ React185.createElement("button", { className: "tts-speak-btn", onClick: () => {
|
|
11749
11855
|
handleSpeak();
|
|
11750
11856
|
setShowPanel(false);
|
|
11751
|
-
} }, "\u25B6 Speak")), speaking && /* @__PURE__ */
|
|
11857
|
+
} }, "\u25B6 Speak")), speaking && /* @__PURE__ */ React185.createElement("div", { className: "tts-controls" }, paused ? /* @__PURE__ */ React185.createElement(Tooltip, { title: "Resume", placement: "top" }, /* @__PURE__ */ React185.createElement("button", { className: "toolbar-btn", onClick: handleResume }, "\u25B6")) : /* @__PURE__ */ React185.createElement(Tooltip, { title: "Pause", placement: "top" }, /* @__PURE__ */ React185.createElement("button", { className: "toolbar-btn", onClick: handlePause }, "\u275A\u275A")), /* @__PURE__ */ React185.createElement(Tooltip, { title: "Stop", placement: "top" }, /* @__PURE__ */ React185.createElement("button", { className: "toolbar-btn", onClick: handleStop }, "\u25A0"))));
|
|
11752
11858
|
});
|
|
11753
11859
|
var TextToSpeech_default = TextToSpeech;
|
|
11754
11860
|
|
|
11755
11861
|
// lib/RufousTextEditor/SpeechToText.tsx
|
|
11756
|
-
import
|
|
11757
|
-
var SpeechToText =
|
|
11862
|
+
import React186, { useState as useState31, useRef as useRef28, useCallback as useCallback15, useEffect as useEffect25, forwardRef as forwardRef22, useImperativeHandle as useImperativeHandle3 } from "react";
|
|
11863
|
+
var SpeechToText = forwardRef22(({ editor, onSpeechToText }, ref) => {
|
|
11758
11864
|
const [listening, setListening] = useState31(false);
|
|
11759
11865
|
const [showPanel, setShowPanel] = useState31(false);
|
|
11760
11866
|
const [language, setLanguage] = useState31("en-US");
|
|
@@ -11867,7 +11973,7 @@ var SpeechToText = forwardRef21(({ editor, onSpeechToText }, ref) => {
|
|
|
11867
11973
|
}, []);
|
|
11868
11974
|
useImperativeHandle3(ref, () => ({ stop: stopListening }), [stopListening]);
|
|
11869
11975
|
if (!supported) {
|
|
11870
|
-
return /* @__PURE__ */
|
|
11976
|
+
return /* @__PURE__ */ React186.createElement(Tooltip, { title: "Speech recognition not supported in this browser", placement: "top" }, /* @__PURE__ */ React186.createElement("button", { className: "toolbar-btn", disabled: true }, "\u{1F3A4}"));
|
|
11871
11977
|
}
|
|
11872
11978
|
const LANGUAGES2 = [
|
|
11873
11979
|
{ code: "en-US", label: "English (US)" },
|
|
@@ -11889,7 +11995,7 @@ var SpeechToText = forwardRef21(({ editor, onSpeechToText }, ref) => {
|
|
|
11889
11995
|
{ code: "kn-IN", label: "Kannada" },
|
|
11890
11996
|
{ code: "ml-IN", label: "Malayalam" }
|
|
11891
11997
|
];
|
|
11892
|
-
return /* @__PURE__ */
|
|
11998
|
+
return /* @__PURE__ */ React186.createElement("div", { className: "stt-wrapper", ref: panelRef }, /* @__PURE__ */ React186.createElement(Tooltip, { title: listening ? "Stop recording" : "Speech to Text", placement: "top" }, /* @__PURE__ */ React186.createElement(
|
|
11893
11999
|
"button",
|
|
11894
12000
|
{
|
|
11895
12001
|
className: `toolbar-btn ${listening ? "is-active stt-recording" : ""}`,
|
|
@@ -11902,20 +12008,20 @@ var SpeechToText = forwardRef21(({ editor, onSpeechToText }, ref) => {
|
|
|
11902
12008
|
}
|
|
11903
12009
|
},
|
|
11904
12010
|
"\u{1F3A4}"
|
|
11905
|
-
)), showPanel && !listening && /* @__PURE__ */
|
|
12011
|
+
)), showPanel && !listening && /* @__PURE__ */ React186.createElement("div", { className: "stt-panel" }, /* @__PURE__ */ React186.createElement("div", { className: "stt-panel-header" }, "Speech to Text"), /* @__PURE__ */ React186.createElement("label", { className: "stt-label" }, "Language"), /* @__PURE__ */ React186.createElement(
|
|
11906
12012
|
"select",
|
|
11907
12013
|
{
|
|
11908
12014
|
className: "stt-select",
|
|
11909
12015
|
value: language,
|
|
11910
12016
|
onChange: (e) => setLanguage(e.target.value)
|
|
11911
12017
|
},
|
|
11912
|
-
LANGUAGES2.map((l) => /* @__PURE__ */
|
|
11913
|
-
), /* @__PURE__ */
|
|
12018
|
+
LANGUAGES2.map((l) => /* @__PURE__ */ React186.createElement("option", { key: l.code, value: l.code }, l.label))
|
|
12019
|
+
), /* @__PURE__ */ React186.createElement("div", { className: "stt-info" }, "Speak into your microphone and the text will be typed into the editor."), /* @__PURE__ */ React186.createElement("button", { className: "stt-start-btn", onClick: startListening }, "\u{1F3A4} Start Listening")), listening && interim && /* @__PURE__ */ React186.createElement("div", { className: "stt-interim" }, interim));
|
|
11914
12020
|
});
|
|
11915
12021
|
var SpeechToText_default = SpeechToText;
|
|
11916
12022
|
|
|
11917
12023
|
// lib/RufousTextEditor/AICommands.tsx
|
|
11918
|
-
import
|
|
12024
|
+
import React187, { useState as useState32, useRef as useRef29, useEffect as useEffect26, useCallback as useCallback16 } from "react";
|
|
11919
12025
|
import { createPortal as createPortal2 } from "react-dom";
|
|
11920
12026
|
var AI_COMMANDS = [
|
|
11921
12027
|
{ id: "improve", label: "Improve writing", prompt: "Improve the following text to make it clearer, more engaging, and well-structured. Return only the improved text, no explanations." },
|
|
@@ -12056,15 +12162,15 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
12056
12162
|
setPreviousResults([]);
|
|
12057
12163
|
}, []);
|
|
12058
12164
|
if (!editor) return null;
|
|
12059
|
-
return /* @__PURE__ */
|
|
12165
|
+
return /* @__PURE__ */ React187.createElement(React187.Fragment, null, /* @__PURE__ */ React187.createElement("div", { className: "ai-commands-wrapper", ref: panelRef }, /* @__PURE__ */ React187.createElement(Tooltip, { title: "AI Commands", placement: "top" }, /* @__PURE__ */ React187.createElement(
|
|
12060
12166
|
"button",
|
|
12061
12167
|
{
|
|
12062
12168
|
className: `toolbar-btn ${open ? "is-active" : ""}`,
|
|
12063
12169
|
onClick: () => setOpen(!open)
|
|
12064
12170
|
},
|
|
12065
|
-
/* @__PURE__ */
|
|
12066
|
-
/* @__PURE__ */
|
|
12067
|
-
)), open && /* @__PURE__ */
|
|
12171
|
+
/* @__PURE__ */ React187.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", stroke: "none" }, /* @__PURE__ */ React187.createElement("path", { d: "M9 2l1.5 3L14 6.5 10.5 8 9 11 7.5 8 4 6.5 7.5 5zM18 10l1 2 2 1-2 1-1 2-1-2-2-1 2-1zM5 17l1.5 3L10 21.5 6.5 23 5 26 3.5 23 0 21.5 3.5 20z" })),
|
|
12172
|
+
/* @__PURE__ */ React187.createElement("span", { className: "dropdown-arrow" }, "\u25BE")
|
|
12173
|
+
)), open && /* @__PURE__ */ React187.createElement("div", { className: "ai-commands-panel" }, /* @__PURE__ */ React187.createElement("div", { className: "ai-commands-header" }, "AI Commands"), /* @__PURE__ */ React187.createElement("div", { className: "ai-commands-list" }, AI_COMMANDS.map((cmd) => /* @__PURE__ */ React187.createElement(
|
|
12068
12174
|
"button",
|
|
12069
12175
|
{
|
|
12070
12176
|
key: cmd.id,
|
|
@@ -12072,8 +12178,8 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
12072
12178
|
onClick: () => handleCommandSelect(cmd)
|
|
12073
12179
|
},
|
|
12074
12180
|
cmd.label
|
|
12075
|
-
))), /* @__PURE__ */
|
|
12076
|
-
/* @__PURE__ */
|
|
12181
|
+
))), /* @__PURE__ */ React187.createElement("div", { className: "ai-commands-hint" }, editor.state.selection.empty ? "Will apply to all text" : "Will apply to selected text"))), showModal && createPortal2(
|
|
12182
|
+
/* @__PURE__ */ React187.createElement("div", { className: "ai-modal-overlay", onMouseDown: handleCancel }, /* @__PURE__ */ React187.createElement("div", { className: "ai-modal", onMouseDown: (e) => e.stopPropagation() }, /* @__PURE__ */ React187.createElement("div", { className: "ai-modal-header" }, /* @__PURE__ */ React187.createElement("span", { className: "ai-modal-title" }, "AI Assistant"), /* @__PURE__ */ React187.createElement("button", { className: "ai-modal-close", onClick: handleCancel }, "\xD7")), /* @__PURE__ */ React187.createElement("div", { className: "ai-modal-prompt-section" }, /* @__PURE__ */ React187.createElement("label", { className: "ai-modal-label" }, "Prompt"), /* @__PURE__ */ React187.createElement("div", { className: "ai-modal-prompt-row" }, /* @__PURE__ */ React187.createElement(
|
|
12077
12183
|
"textarea",
|
|
12078
12184
|
{
|
|
12079
12185
|
className: "ai-modal-prompt",
|
|
@@ -12081,15 +12187,15 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
12081
12187
|
onChange: (e) => setPromptText(e.target.value),
|
|
12082
12188
|
rows: 3
|
|
12083
12189
|
}
|
|
12084
|
-
), /* @__PURE__ */
|
|
12190
|
+
), /* @__PURE__ */ React187.createElement(Tooltip, { title: "Run with custom prompt", placement: "top" }, /* @__PURE__ */ React187.createElement(
|
|
12085
12191
|
"button",
|
|
12086
12192
|
{
|
|
12087
12193
|
className: "ai-modal-robot-btn",
|
|
12088
12194
|
onClick: () => fetchAIResult(promptText, originalText),
|
|
12089
12195
|
disabled: loading
|
|
12090
12196
|
},
|
|
12091
|
-
/* @__PURE__ */
|
|
12092
|
-
)))), /* @__PURE__ */
|
|
12197
|
+
/* @__PURE__ */ React187.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React187.createElement("rect", { x: "3", y: "11", width: "18", height: "10", rx: "2" }), /* @__PURE__ */ React187.createElement("circle", { cx: "9", cy: "16", r: "1" }), /* @__PURE__ */ React187.createElement("circle", { cx: "15", cy: "16", r: "1" }), /* @__PURE__ */ React187.createElement("path", { d: "M12 2v4" }), /* @__PURE__ */ React187.createElement("path", { d: "M8 7h8" }))
|
|
12198
|
+
)))), /* @__PURE__ */ React187.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ React187.createElement(
|
|
12093
12199
|
"button",
|
|
12094
12200
|
{
|
|
12095
12201
|
className: "ai-modal-action-btn ai-modal-insert-btn",
|
|
@@ -12097,7 +12203,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
12097
12203
|
disabled: loading || !resultText
|
|
12098
12204
|
},
|
|
12099
12205
|
"Insert"
|
|
12100
|
-
), /* @__PURE__ */
|
|
12206
|
+
), /* @__PURE__ */ React187.createElement(
|
|
12101
12207
|
"button",
|
|
12102
12208
|
{
|
|
12103
12209
|
className: "ai-modal-action-btn ai-modal-insert-after-btn ms-2",
|
|
@@ -12105,22 +12211,22 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
12105
12211
|
disabled: loading || !resultText
|
|
12106
12212
|
},
|
|
12107
12213
|
"Insert After"
|
|
12108
|
-
), /* @__PURE__ */
|
|
12214
|
+
), /* @__PURE__ */ React187.createElement(Tooltip, { title: "Generate another response", placement: "top" }, /* @__PURE__ */ React187.createElement(
|
|
12109
12215
|
"button",
|
|
12110
12216
|
{
|
|
12111
12217
|
className: "ai-modal-action-btn ai-modal-refresh-btn",
|
|
12112
12218
|
onClick: handleRefresh,
|
|
12113
12219
|
disabled: loading
|
|
12114
12220
|
},
|
|
12115
|
-
/* @__PURE__ */
|
|
12116
|
-
))), /* @__PURE__ */
|
|
12221
|
+
/* @__PURE__ */ React187.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React187.createElement("path", { d: "M21 2v6h-6" }), /* @__PURE__ */ React187.createElement("path", { d: "M3 12a9 9 0 0 1 15-6.7L21 8" }), /* @__PURE__ */ React187.createElement("path", { d: "M3 22v-6h6" }), /* @__PURE__ */ React187.createElement("path", { d: "M21 12a9 9 0 0 1-15 6.7L3 16" }))
|
|
12222
|
+
))), /* @__PURE__ */ React187.createElement("div", { className: "ai-modal-result-section" }, loading ? /* @__PURE__ */ React187.createElement("div", { className: "ai-modal-loading" }, /* @__PURE__ */ React187.createElement("span", { className: "ai-spinner" }), /* @__PURE__ */ React187.createElement("span", null, "Generating response...")) : /* @__PURE__ */ React187.createElement("div", { className: "ai-modal-result" }, resultText)), /* @__PURE__ */ React187.createElement("div", { className: "ai-modal-footer" }, /* @__PURE__ */ React187.createElement("button", { className: "ai-modal-cancel-btn", onClick: handleCancel }, "CANCEL")))),
|
|
12117
12223
|
document.body
|
|
12118
12224
|
));
|
|
12119
12225
|
};
|
|
12120
12226
|
var AICommands_default = AICommands;
|
|
12121
12227
|
|
|
12122
12228
|
// lib/RufousTextEditor/TranslateModal.tsx
|
|
12123
|
-
import
|
|
12229
|
+
import React188, { useState as useState33, useMemo as useMemo5 } from "react";
|
|
12124
12230
|
import { createPortal as createPortal3 } from "react-dom";
|
|
12125
12231
|
var LANGUAGES = [
|
|
12126
12232
|
{ code: "af", name: "Afrikaans" },
|
|
@@ -12313,7 +12419,7 @@ var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarg
|
|
|
12313
12419
|
}
|
|
12314
12420
|
};
|
|
12315
12421
|
return createPortal3(
|
|
12316
|
-
/* @__PURE__ */
|
|
12422
|
+
/* @__PURE__ */ React188.createElement("div", { className: "modal-overlay", onClick: onClose }, /* @__PURE__ */ React188.createElement("div", { className: "modal-content translate-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React188.createElement("div", { className: "modal-header" }, /* @__PURE__ */ React188.createElement("h3", null, "Translate options"), /* @__PURE__ */ React188.createElement("button", { className: "modal-close", onClick: onClose }, "\xD7")), /* @__PURE__ */ React188.createElement("div", { className: "modal-body" }, /* @__PURE__ */ React188.createElement("div", { className: "translate-columns" }, /* @__PURE__ */ React188.createElement("div", { className: "translate-col" }, /* @__PURE__ */ React188.createElement("div", { className: "translate-filter" }, /* @__PURE__ */ React188.createElement(
|
|
12317
12423
|
"input",
|
|
12318
12424
|
{
|
|
12319
12425
|
type: "text",
|
|
@@ -12322,16 +12428,16 @@ var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarg
|
|
|
12322
12428
|
onChange: (e) => setSourceFilter(e.target.value),
|
|
12323
12429
|
className: "translate-filter-input"
|
|
12324
12430
|
}
|
|
12325
|
-
)), /* @__PURE__ */
|
|
12431
|
+
)), /* @__PURE__ */ React188.createElement("div", { className: "translate-list" }, filteredSource.map((lang) => /* @__PURE__ */ React188.createElement(
|
|
12326
12432
|
"button",
|
|
12327
12433
|
{
|
|
12328
12434
|
key: lang.code,
|
|
12329
12435
|
className: `translate-item ${sourceLang === lang.code ? "active" : ""}`,
|
|
12330
12436
|
onClick: () => setSourceLang(lang.code)
|
|
12331
12437
|
},
|
|
12332
|
-
/* @__PURE__ */
|
|
12333
|
-
/* @__PURE__ */
|
|
12334
|
-
)))), /* @__PURE__ */
|
|
12438
|
+
/* @__PURE__ */ React188.createElement("span", { className: "translate-code" }, lang.code),
|
|
12439
|
+
/* @__PURE__ */ React188.createElement("span", { className: "translate-name" }, lang.name)
|
|
12440
|
+
)))), /* @__PURE__ */ React188.createElement("div", { className: "translate-swap" }, /* @__PURE__ */ React188.createElement(Tooltip, { title: "Swap languages", placement: "top" }, /* @__PURE__ */ React188.createElement("button", { className: "translate-swap-btn", onClick: handleSwap }, "\u21C4"))), /* @__PURE__ */ React188.createElement("div", { className: "translate-col" }, /* @__PURE__ */ React188.createElement("div", { className: "translate-filter" }, /* @__PURE__ */ React188.createElement(
|
|
12335
12441
|
"input",
|
|
12336
12442
|
{
|
|
12337
12443
|
type: "text",
|
|
@@ -12340,16 +12446,16 @@ var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarg
|
|
|
12340
12446
|
onChange: (e) => setTargetFilter(e.target.value),
|
|
12341
12447
|
className: "translate-filter-input"
|
|
12342
12448
|
}
|
|
12343
|
-
)), /* @__PURE__ */
|
|
12449
|
+
)), /* @__PURE__ */ React188.createElement("div", { className: "translate-list" }, filteredTarget.map((lang) => /* @__PURE__ */ React188.createElement(
|
|
12344
12450
|
"button",
|
|
12345
12451
|
{
|
|
12346
12452
|
key: lang.code,
|
|
12347
12453
|
className: `translate-item ${targetLang === lang.code ? "active" : ""}`,
|
|
12348
12454
|
onClick: () => setTargetLang(lang.code)
|
|
12349
12455
|
},
|
|
12350
|
-
/* @__PURE__ */
|
|
12351
|
-
/* @__PURE__ */
|
|
12352
|
-
))))), error && /* @__PURE__ */
|
|
12456
|
+
/* @__PURE__ */ React188.createElement("span", { className: "translate-code" }, lang.code),
|
|
12457
|
+
/* @__PURE__ */ React188.createElement("span", { className: "translate-name" }, lang.name)
|
|
12458
|
+
))))), error && /* @__PURE__ */ React188.createElement("div", { className: "translate-error" }, error)), /* @__PURE__ */ React188.createElement("div", { className: "modal-footer" }, /* @__PURE__ */ React188.createElement("div", { className: "modal-footer-left" }, /* @__PURE__ */ React188.createElement("button", { className: "modal-btn-cancel", onClick: onClose }, "Cancel")), /* @__PURE__ */ React188.createElement("button", { className: "modal-btn-apply", onClick: handleSave, disabled: translating }, translating ? "Translating..." : "Save")))),
|
|
12353
12459
|
document.body
|
|
12354
12460
|
);
|
|
12355
12461
|
};
|
|
@@ -13000,38 +13106,38 @@ var CustomTaskItem = TaskItem.extend({
|
|
|
13000
13106
|
});
|
|
13001
13107
|
|
|
13002
13108
|
// lib/RufousTextEditor/icons.tsx
|
|
13003
|
-
import * as
|
|
13109
|
+
import * as React189 from "react";
|
|
13004
13110
|
var s = { width: 20, height: 20, viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" };
|
|
13005
|
-
var IconUndo = () => /* @__PURE__ */
|
|
13006
|
-
var IconRedo = () => /* @__PURE__ */
|
|
13007
|
-
var IconBold = () => /* @__PURE__ */
|
|
13008
|
-
var IconItalic = () => /* @__PURE__ */
|
|
13009
|
-
var IconLink = () => /* @__PURE__ */
|
|
13010
|
-
var IconStrike = () => /* @__PURE__ */
|
|
13011
|
-
var IconHeading = () => /* @__PURE__ */
|
|
13012
|
-
var IconFontSize = () => /* @__PURE__ */
|
|
13013
|
-
var IconColor = () => /* @__PURE__ */
|
|
13014
|
-
var IconFont = () => /* @__PURE__ */
|
|
13015
|
-
var IconLineHeight = () => /* @__PURE__ */
|
|
13016
|
-
var IconBulletList = () => /* @__PURE__ */
|
|
13017
|
-
var IconOrderedList = () => /* @__PURE__ */
|
|
13018
|
-
var IconAlignLeft = () => /* @__PURE__ */
|
|
13019
|
-
var IconAlignCenter = () => /* @__PURE__ */
|
|
13020
|
-
var IconAlignRight = () => /* @__PURE__ */
|
|
13021
|
-
var IconAlignJustify = () => /* @__PURE__ */
|
|
13022
|
-
var IconIndentIncrease = () => /* @__PURE__ */
|
|
13023
|
-
var IconIndentDecrease = () => /* @__PURE__ */
|
|
13024
|
-
var IconTable = () => /* @__PURE__ */
|
|
13025
|
-
var IconImage = () => /* @__PURE__ */
|
|
13026
|
-
var IconVideo = () => /* @__PURE__ */
|
|
13027
|
-
var IconCut = () => /* @__PURE__ */
|
|
13028
|
-
var IconCopy = () => /* @__PURE__ */
|
|
13029
|
-
var IconCode = () => /* @__PURE__ */
|
|
13030
|
-
var IconFullscreen = () => /* @__PURE__ */
|
|
13031
|
-
var IconTranslate = () => /* @__PURE__ */
|
|
13032
|
-
var IconTaskList = () => /* @__PURE__ */
|
|
13033
|
-
var IconCheck = () => /* @__PURE__ */
|
|
13034
|
-
var IconPaste = () => /* @__PURE__ */
|
|
13111
|
+
var IconUndo = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M12.5 8C9.85 8 7.45 9 5.6 10.6L2 7v9h9l-3.62-3.62C8.93 11.01 10.63 10.2 12.5 10.2c3.03 0 5.6 1.93 6.55 4.63l2.15-.72C19.93 10.68 16.5 8 12.5 8z" }));
|
|
13112
|
+
var IconRedo = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M18.4 10.6C16.55 9 14.15 8 11.5 8c-4 0-7.43 2.68-8.7 6.11l2.15.72c.95-2.7 3.52-4.63 6.55-4.63 1.87 0 3.57.81 5.12 2.18L13 16h9V7l-3.6 3.6z" }));
|
|
13113
|
+
var IconBold = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z" }));
|
|
13114
|
+
var IconItalic = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z" }));
|
|
13115
|
+
var IconLink = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z" }));
|
|
13116
|
+
var IconStrike = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M7.24 11h2.01c-.13-.42-.2-.88-.2-1.37 0-.89.32-1.58.96-2.08.64-.49 1.46-.74 2.47-.74.99 0 1.81.24 2.46.71.64.47.97 1.1.97 1.88h2.04c0-1.27-.55-2.33-1.64-3.18C15.21 5.37 13.83 4.95 12.2 4.95c-1.69 0-3.09.43-4.2 1.3C6.9 7.1 6.35 8.23 6.35 9.63c0 .47.06.92.18 1.37H3v2h18v-2H7.24zM12.2 17.05c-1.03 0-1.89-.28-2.56-.84-.67-.56-1-1.27-1-2.13h-2.1c0 1.36.58 2.5 1.75 3.44 1.16.93 2.56 1.4 4.19 1.4 1.69 0 3.09-.43 4.2-1.3 1.1-.86 1.65-1.99 1.65-3.38h-2.1c0 .85-.33 1.56-1 2.13-.66.56-1.52.84-2.56.84l-.47-.16z" }));
|
|
13117
|
+
var IconHeading = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M5 4v3h5.5v12h3V7H19V4z" }));
|
|
13118
|
+
var IconFontSize = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M9 4v3h5v12h2V7h5V4H9zm-6 8h3v7h2v-7h3v-2H3v2z" }));
|
|
13119
|
+
var IconColor = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M11 2L5.5 16h2.25l1.12-3h6.25l1.12 3h2.25L13 2h-2zm-1.38 9L12 4.67 14.38 11H9.62z" }), /* @__PURE__ */ React189.createElement("path", { d: "M3 20h18v3H3z", opacity: "0.8" }));
|
|
13120
|
+
var IconFont = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M9.93 13.5h4.14L12 7.98 9.93 13.5zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-4.05 16.5l-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13h-2.09z" }));
|
|
13121
|
+
var IconLineHeight = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M6 7h2.5L5 3.5 1.5 7H4v10H1.5L5 20.5 8.5 17H6V7zm16-3h-8v2h8V4zm0 4h-8v2h8V8zm0 4h-8v2h8v-2zm0 4h-8v2h8v-2z" }));
|
|
13122
|
+
var IconBulletList = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z" }));
|
|
13123
|
+
var IconOrderedList = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z" }));
|
|
13124
|
+
var IconAlignLeft = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zM3 21h18v-2H3v2zM3 3v2h18V3H3z" }));
|
|
13125
|
+
var IconAlignCenter = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z" }));
|
|
13126
|
+
var IconAlignRight = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z" }));
|
|
13127
|
+
var IconAlignJustify = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zM3 3v2h18V3H3z" }));
|
|
13128
|
+
var IconIndentIncrease = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z" }));
|
|
13129
|
+
var IconIndentDecrease = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M11 17h10v-2H11v2zm-8-5l4 4V8l-4 4zm0 9h18v-2H3v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z" }));
|
|
13130
|
+
var IconTable = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M20 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 19V5h4v14H5zm6 0V5h4v14h-4zm6 0V5h3v14h-3z", fillRule: "evenodd" }));
|
|
13131
|
+
var IconImage = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z" }));
|
|
13132
|
+
var IconVideo = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M4 6.47L5.76 10H20v8H4V6.47M22 4h-4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4z" }));
|
|
13133
|
+
var IconCut = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1L9.64 7.64zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zM19 3l-6 6 2 2 7-7V3h-3z" }));
|
|
13134
|
+
var IconCopy = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" }));
|
|
13135
|
+
var IconCode = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z" }));
|
|
13136
|
+
var IconFullscreen = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }));
|
|
13137
|
+
var IconTranslate = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M12.87 15.07l-2.54-2.51.03-.03A17.52 17.52 0 0014.07 6H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2.02c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z" }));
|
|
13138
|
+
var IconTaskList = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M22 8c0-.55-.45-1-1-1h-7c-.55 0-1 .45-1 1s.45 1 1 1h7c.55 0 1-.45 1-1zm0 8c0-.55-.45-1-1-1h-7c-.55 0-1 .45-1 1s.45 1 1 1h7c.55 0 1-.45 1-1zM5.54 11L2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 11zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41L5.54 19z" }));
|
|
13139
|
+
var IconCheck = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }));
|
|
13140
|
+
var IconPaste = () => /* @__PURE__ */ React189.createElement("svg", { ...s }, /* @__PURE__ */ React189.createElement("path", { d: "M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z" }));
|
|
13035
13141
|
|
|
13036
13142
|
// lib/RufousTextEditor/Toolbar.tsx
|
|
13037
13143
|
var COLOR_PALETTE = [
|
|
@@ -13213,16 +13319,16 @@ var Dropdown = ({ trigger, children, className = "", keepOpen = false }) => {
|
|
|
13213
13319
|
};
|
|
13214
13320
|
position();
|
|
13215
13321
|
}, [open]);
|
|
13216
|
-
return /* @__PURE__ */
|
|
13322
|
+
return /* @__PURE__ */ React190.createElement("div", { className: `dropdown ${className}`, ref }, /* @__PURE__ */ React190.createElement(Tooltip, { title: trigger.title || "", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13217
13323
|
"button",
|
|
13218
13324
|
{
|
|
13219
13325
|
className: `toolbar-btn ${trigger.className || ""}`,
|
|
13220
13326
|
onClick: () => setOpen(!open)
|
|
13221
13327
|
},
|
|
13222
13328
|
trigger.label,
|
|
13223
|
-
/* @__PURE__ */
|
|
13329
|
+
/* @__PURE__ */ React190.createElement("span", { className: "dropdown-arrow" }, "\u25BE")
|
|
13224
13330
|
)), open && createPortal4(
|
|
13225
|
-
/* @__PURE__ */
|
|
13331
|
+
/* @__PURE__ */ React190.createElement("div", { className: "rf-rte-wrapper rf-rte-dropdown-portal" }, /* @__PURE__ */ React190.createElement("div", { ref: menuRef, className: "dropdown-menu dropdown-menu-fixed", onClick: keepOpen ? void 0 : () => setOpen(false) }, typeof children === "function" ? children(() => setOpen(false)) : children)),
|
|
13226
13332
|
document.body
|
|
13227
13333
|
));
|
|
13228
13334
|
};
|
|
@@ -13260,14 +13366,14 @@ var InsertPanel = ({ editor, onClose, mode = "video" }) => {
|
|
|
13260
13366
|
}
|
|
13261
13367
|
onClose();
|
|
13262
13368
|
};
|
|
13263
|
-
return /* @__PURE__ */
|
|
13369
|
+
return /* @__PURE__ */ React190.createElement("div", { className: "insert-panel", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React190.createElement("div", { className: "insert-panel-tabs" }, /* @__PURE__ */ React190.createElement(
|
|
13264
13370
|
"button",
|
|
13265
13371
|
{
|
|
13266
13372
|
className: `insert-tab ${activeTab === "link" ? "active" : ""}`,
|
|
13267
13373
|
onClick: () => setActiveTab("link")
|
|
13268
13374
|
},
|
|
13269
13375
|
"\u{1F517} Link"
|
|
13270
|
-
), /* @__PURE__ */
|
|
13376
|
+
), /* @__PURE__ */ React190.createElement(
|
|
13271
13377
|
"button",
|
|
13272
13378
|
{
|
|
13273
13379
|
className: `insert-tab ${activeTab === "code" ? "active" : ""}`,
|
|
@@ -13275,7 +13381,7 @@ var InsertPanel = ({ editor, onClose, mode = "video" }) => {
|
|
|
13275
13381
|
},
|
|
13276
13382
|
"</>",
|
|
13277
13383
|
" Code"
|
|
13278
|
-
)), /* @__PURE__ */
|
|
13384
|
+
)), /* @__PURE__ */ React190.createElement("label", { className: "insert-panel-label" }, activeTab === "link" ? "URL" : "Embed Code"), activeTab === "link" ? /* @__PURE__ */ React190.createElement(
|
|
13279
13385
|
"input",
|
|
13280
13386
|
{
|
|
13281
13387
|
type: "text",
|
|
@@ -13286,7 +13392,7 @@ var InsertPanel = ({ editor, onClose, mode = "video" }) => {
|
|
|
13286
13392
|
onKeyDown: (e) => e.key === "Enter" && handleInsert(),
|
|
13287
13393
|
autoFocus: true
|
|
13288
13394
|
}
|
|
13289
|
-
) : /* @__PURE__ */
|
|
13395
|
+
) : /* @__PURE__ */ React190.createElement(
|
|
13290
13396
|
"textarea",
|
|
13291
13397
|
{
|
|
13292
13398
|
className: "insert-panel-textarea",
|
|
@@ -13295,7 +13401,7 @@ var InsertPanel = ({ editor, onClose, mode = "video" }) => {
|
|
|
13295
13401
|
onChange: (e) => setUrl(e.target.value),
|
|
13296
13402
|
rows: 3
|
|
13297
13403
|
}
|
|
13298
|
-
), /* @__PURE__ */
|
|
13404
|
+
), /* @__PURE__ */ React190.createElement("button", { className: "insert-panel-btn", onClick: handleInsert }, "Insert"));
|
|
13299
13405
|
};
|
|
13300
13406
|
var ImagePanel = ({ editor, onClose, onImageUpload }) => {
|
|
13301
13407
|
const [activeTab, setActiveTab] = useState34("upload");
|
|
@@ -13339,21 +13445,21 @@ var ImagePanel = ({ editor, onClose, onImageUpload }) => {
|
|
|
13339
13445
|
editor.chain().focus().setImage({ src: url }).run();
|
|
13340
13446
|
onClose();
|
|
13341
13447
|
};
|
|
13342
|
-
return /* @__PURE__ */
|
|
13448
|
+
return /* @__PURE__ */ React190.createElement("div", { className: "insert-panel", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React190.createElement("div", { className: "insert-panel-tabs" }, /* @__PURE__ */ React190.createElement(
|
|
13343
13449
|
"button",
|
|
13344
13450
|
{
|
|
13345
13451
|
className: `insert-tab ${activeTab === "upload" ? "active" : ""}`,
|
|
13346
13452
|
onClick: () => setActiveTab("upload")
|
|
13347
13453
|
},
|
|
13348
13454
|
"\u2B06 Upload"
|
|
13349
|
-
), /* @__PURE__ */
|
|
13455
|
+
), /* @__PURE__ */ React190.createElement(
|
|
13350
13456
|
"button",
|
|
13351
13457
|
{
|
|
13352
13458
|
className: `insert-tab ${activeTab === "url" ? "active" : ""}`,
|
|
13353
13459
|
onClick: () => setActiveTab("url")
|
|
13354
13460
|
},
|
|
13355
13461
|
"\u{1F517} URL"
|
|
13356
|
-
)), activeTab === "upload" ? /* @__PURE__ */
|
|
13462
|
+
)), activeTab === "upload" ? /* @__PURE__ */ React190.createElement(React190.Fragment, null, /* @__PURE__ */ React190.createElement(
|
|
13357
13463
|
"div",
|
|
13358
13464
|
{
|
|
13359
13465
|
className: `drop-zone ${isDragging ? "dragging" : ""}`,
|
|
@@ -13365,9 +13471,9 @@ var ImagePanel = ({ editor, onClose, onImageUpload }) => {
|
|
|
13365
13471
|
onDrop: handleDrop,
|
|
13366
13472
|
onClick: () => fileInputRef.current?.click()
|
|
13367
13473
|
},
|
|
13368
|
-
/* @__PURE__ */
|
|
13369
|
-
/* @__PURE__ */
|
|
13370
|
-
), /* @__PURE__ */
|
|
13474
|
+
/* @__PURE__ */ React190.createElement("span", { className: "drop-zone-text-bold" }, "Drop image"),
|
|
13475
|
+
/* @__PURE__ */ React190.createElement("span", { className: "drop-zone-text-sub" }, "or click")
|
|
13476
|
+
), /* @__PURE__ */ React190.createElement(
|
|
13371
13477
|
"input",
|
|
13372
13478
|
{
|
|
13373
13479
|
ref: fileInputRef,
|
|
@@ -13376,7 +13482,7 @@ var ImagePanel = ({ editor, onClose, onImageUpload }) => {
|
|
|
13376
13482
|
style: { display: "none" },
|
|
13377
13483
|
onChange: handleFileSelect
|
|
13378
13484
|
}
|
|
13379
|
-
)) : /* @__PURE__ */
|
|
13485
|
+
)) : /* @__PURE__ */ React190.createElement(React190.Fragment, null, /* @__PURE__ */ React190.createElement("label", { className: "insert-panel-label" }, "URL"), /* @__PURE__ */ React190.createElement(
|
|
13380
13486
|
"input",
|
|
13381
13487
|
{
|
|
13382
13488
|
type: "text",
|
|
@@ -13387,7 +13493,7 @@ var ImagePanel = ({ editor, onClose, onImageUpload }) => {
|
|
|
13387
13493
|
onKeyDown: (e) => e.key === "Enter" && handleUrlInsert(),
|
|
13388
13494
|
autoFocus: true
|
|
13389
13495
|
}
|
|
13390
|
-
), /* @__PURE__ */
|
|
13496
|
+
), /* @__PURE__ */ React190.createElement("button", { className: "insert-panel-btn", onClick: handleUrlInsert }, "Insert")));
|
|
13391
13497
|
};
|
|
13392
13498
|
var MAX_GRID = 10;
|
|
13393
13499
|
var TableGridSelector = ({ editor, onClose }) => {
|
|
@@ -13398,7 +13504,7 @@ var TableGridSelector = ({ editor, onClose }) => {
|
|
|
13398
13504
|
editor.chain().focus().insertTable({ rows: hoverRow, cols: hoverCol, withHeaderRow: true }).run();
|
|
13399
13505
|
onClose();
|
|
13400
13506
|
};
|
|
13401
|
-
return /* @__PURE__ */
|
|
13507
|
+
return /* @__PURE__ */ React190.createElement("div", { className: "table-grid-panel", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React190.createElement(
|
|
13402
13508
|
"div",
|
|
13403
13509
|
{
|
|
13404
13510
|
className: "table-grid",
|
|
@@ -13407,7 +13513,7 @@ var TableGridSelector = ({ editor, onClose }) => {
|
|
|
13407
13513
|
setHoverCol(0);
|
|
13408
13514
|
}
|
|
13409
13515
|
},
|
|
13410
|
-
Array.from({ length: MAX_GRID }, (_, r) => /* @__PURE__ */
|
|
13516
|
+
Array.from({ length: MAX_GRID }, (_, r) => /* @__PURE__ */ React190.createElement("div", { key: r, className: "table-grid-row" }, Array.from({ length: MAX_GRID }, (_2, c) => /* @__PURE__ */ React190.createElement(
|
|
13411
13517
|
"div",
|
|
13412
13518
|
{
|
|
13413
13519
|
key: c,
|
|
@@ -13419,7 +13525,7 @@ var TableGridSelector = ({ editor, onClose }) => {
|
|
|
13419
13525
|
onClick: handleInsert
|
|
13420
13526
|
}
|
|
13421
13527
|
))))
|
|
13422
|
-
), /* @__PURE__ */
|
|
13528
|
+
), /* @__PURE__ */ React190.createElement("div", { className: "table-grid-footer" }, /* @__PURE__ */ React190.createElement("span", { className: "table-grid-size" }, hoverRow > 0 && hoverCol > 0 ? `${hoverRow}\xD7${hoverCol}` : "Select size"), /* @__PURE__ */ React190.createElement(
|
|
13423
13529
|
"button",
|
|
13424
13530
|
{
|
|
13425
13531
|
className: "table-grid-submit",
|
|
@@ -13453,28 +13559,28 @@ var ColorPickerPanel = ({ editor, onClose }) => {
|
|
|
13453
13559
|
}
|
|
13454
13560
|
onClose();
|
|
13455
13561
|
};
|
|
13456
|
-
return /* @__PURE__ */
|
|
13562
|
+
return /* @__PURE__ */ React190.createElement("div", { className: "color-picker-panel", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React190.createElement("div", { className: "color-picker-tabs" }, /* @__PURE__ */ React190.createElement(
|
|
13457
13563
|
"button",
|
|
13458
13564
|
{
|
|
13459
13565
|
className: `color-picker-tab ${tab === "background" ? "active" : ""}`,
|
|
13460
13566
|
onClick: () => setTab("background")
|
|
13461
13567
|
},
|
|
13462
13568
|
"Background"
|
|
13463
|
-
), /* @__PURE__ */
|
|
13569
|
+
), /* @__PURE__ */ React190.createElement(
|
|
13464
13570
|
"button",
|
|
13465
13571
|
{
|
|
13466
13572
|
className: `color-picker-tab ${tab === "text" ? "active" : ""}`,
|
|
13467
13573
|
onClick: () => setTab("text")
|
|
13468
13574
|
},
|
|
13469
13575
|
"Text"
|
|
13470
|
-
)), /* @__PURE__ */
|
|
13576
|
+
)), /* @__PURE__ */ React190.createElement("div", { className: "color-picker-grid" }, COLOR_PALETTE.map((color, i) => /* @__PURE__ */ React190.createElement(Tooltip, { key: i, title: color, placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13471
13577
|
"button",
|
|
13472
13578
|
{
|
|
13473
13579
|
className: `color-picker-swatch ${color === "#ffffff" ? "white-swatch" : ""}${activeColor && activeColor.toLowerCase() === color.toLowerCase() ? " swatch-active" : ""}`,
|
|
13474
13580
|
style: { background: color },
|
|
13475
13581
|
onClick: () => applyColor(color)
|
|
13476
13582
|
}
|
|
13477
|
-
)))), /* @__PURE__ */
|
|
13583
|
+
)))), /* @__PURE__ */ React190.createElement("div", { className: "color-picker-footer" }, /* @__PURE__ */ React190.createElement("div", { className: "color-picker-preview", style: { background: activeColor || "#000" } }), /* @__PURE__ */ React190.createElement(Tooltip, { title: "Remove color", placement: "top" }, /* @__PURE__ */ React190.createElement("button", { className: "color-picker-remove", onClick: removeColor }, "\u2713"))));
|
|
13478
13584
|
};
|
|
13479
13585
|
var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTextToSpeech, onClose, onImageUpload, visibleButtons, isFullscreen, onToggleFullscreen }) => {
|
|
13480
13586
|
const [, setEditorState] = useState34(0);
|
|
@@ -13555,32 +13661,32 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13555
13661
|
setTimeout(() => setTranslateStatus(""), 2e3);
|
|
13556
13662
|
}, [editor, translateSource, translateTarget, onTranslate]);
|
|
13557
13663
|
if (!editor) return null;
|
|
13558
|
-
return /* @__PURE__ */
|
|
13664
|
+
return /* @__PURE__ */ React190.createElement("div", { className: "toolbar" }, /* @__PURE__ */ React190.createElement("div", { className: `toolbar-row ${onClose ? "with-close" : ""}` }, (show("undo") || show("redo")) && /* @__PURE__ */ React190.createElement("div", { className: "toolbar-group" }, show("undo") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Undo (Ctrl+Z)", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13559
13665
|
"button",
|
|
13560
13666
|
{
|
|
13561
13667
|
className: "toolbar-btn",
|
|
13562
13668
|
onClick: () => editor.chain().focus().undo().run(),
|
|
13563
13669
|
disabled: !editor.can().undo()
|
|
13564
13670
|
},
|
|
13565
|
-
/* @__PURE__ */
|
|
13566
|
-
)), show("redo") && /* @__PURE__ */
|
|
13671
|
+
/* @__PURE__ */ React190.createElement(IconUndo, null)
|
|
13672
|
+
)), show("redo") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Redo (Ctrl+Y)", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13567
13673
|
"button",
|
|
13568
13674
|
{
|
|
13569
13675
|
className: "toolbar-btn",
|
|
13570
13676
|
onClick: () => editor.chain().focus().redo().run(),
|
|
13571
13677
|
disabled: !editor.can().redo()
|
|
13572
13678
|
},
|
|
13573
|
-
/* @__PURE__ */
|
|
13574
|
-
))), show("ai") && /* @__PURE__ */
|
|
13679
|
+
/* @__PURE__ */ React190.createElement(IconRedo, null)
|
|
13680
|
+
))), show("ai") && /* @__PURE__ */ React190.createElement("div", { className: "toolbar-group" }, /* @__PURE__ */ React190.createElement(AICommands_default, { editor, onAICommand })), /* @__PURE__ */ React190.createElement("div", { className: "toolbar-group" }, show("paragraph") && /* @__PURE__ */ React190.createElement(
|
|
13575
13681
|
Dropdown,
|
|
13576
13682
|
{
|
|
13577
13683
|
trigger: {
|
|
13578
|
-
label: /* @__PURE__ */
|
|
13684
|
+
label: /* @__PURE__ */ React190.createElement(IconHeading, null),
|
|
13579
13685
|
title: "Block type",
|
|
13580
13686
|
className: editor.isActive("heading") ? "is-active" : ""
|
|
13581
13687
|
}
|
|
13582
13688
|
},
|
|
13583
|
-
/* @__PURE__ */
|
|
13689
|
+
/* @__PURE__ */ React190.createElement(
|
|
13584
13690
|
"button",
|
|
13585
13691
|
{
|
|
13586
13692
|
className: `dropdown-item ${!editor.isActive("heading") && !editor.isActive("blockquote") && !editor.isActive("codeBlock") ? "is-active" : ""}`,
|
|
@@ -13588,7 +13694,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13588
13694
|
},
|
|
13589
13695
|
"\xB6 Paragraph"
|
|
13590
13696
|
),
|
|
13591
|
-
/* @__PURE__ */
|
|
13697
|
+
/* @__PURE__ */ React190.createElement(
|
|
13592
13698
|
"button",
|
|
13593
13699
|
{
|
|
13594
13700
|
className: `dropdown-item heading-1 ${editor.isActive("heading", { level: 1 }) ? "is-active" : ""}`,
|
|
@@ -13596,7 +13702,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13596
13702
|
},
|
|
13597
13703
|
"Heading 1"
|
|
13598
13704
|
),
|
|
13599
|
-
/* @__PURE__ */
|
|
13705
|
+
/* @__PURE__ */ React190.createElement(
|
|
13600
13706
|
"button",
|
|
13601
13707
|
{
|
|
13602
13708
|
className: `dropdown-item heading-2 ${editor.isActive("heading", { level: 2 }) ? "is-active" : ""}`,
|
|
@@ -13604,7 +13710,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13604
13710
|
},
|
|
13605
13711
|
"Heading 2"
|
|
13606
13712
|
),
|
|
13607
|
-
/* @__PURE__ */
|
|
13713
|
+
/* @__PURE__ */ React190.createElement(
|
|
13608
13714
|
"button",
|
|
13609
13715
|
{
|
|
13610
13716
|
className: `dropdown-item heading-3 ${editor.isActive("heading", { level: 3 }) ? "is-active" : ""}`,
|
|
@@ -13612,7 +13718,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13612
13718
|
},
|
|
13613
13719
|
"Heading 3"
|
|
13614
13720
|
),
|
|
13615
|
-
/* @__PURE__ */
|
|
13721
|
+
/* @__PURE__ */ React190.createElement(
|
|
13616
13722
|
"button",
|
|
13617
13723
|
{
|
|
13618
13724
|
className: `dropdown-item heading-4 ${editor.isActive("heading", { level: 4 }) ? "is-active" : ""}`,
|
|
@@ -13620,7 +13726,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13620
13726
|
},
|
|
13621
13727
|
"Heading 4"
|
|
13622
13728
|
),
|
|
13623
|
-
/* @__PURE__ */
|
|
13729
|
+
/* @__PURE__ */ React190.createElement(
|
|
13624
13730
|
"button",
|
|
13625
13731
|
{
|
|
13626
13732
|
className: `dropdown-item ${editor.isActive("blockquote") ? "is-active" : ""}`,
|
|
@@ -13628,7 +13734,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13628
13734
|
},
|
|
13629
13735
|
"\u275E Blockquote"
|
|
13630
13736
|
),
|
|
13631
|
-
/* @__PURE__ */
|
|
13737
|
+
/* @__PURE__ */ React190.createElement(
|
|
13632
13738
|
"button",
|
|
13633
13739
|
{
|
|
13634
13740
|
className: `dropdown-item ${editor.isActive("codeBlock") ? "is-active" : ""}`,
|
|
@@ -13637,19 +13743,19 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13637
13743
|
"{ }",
|
|
13638
13744
|
" Code Block"
|
|
13639
13745
|
),
|
|
13640
|
-
/* @__PURE__ */
|
|
13641
|
-
), show("fontsize") && /* @__PURE__ */
|
|
13746
|
+
/* @__PURE__ */ React190.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().setHorizontalRule().run() }, "\u2014 Horizontal Rule")
|
|
13747
|
+
), show("fontsize") && /* @__PURE__ */ React190.createElement(
|
|
13642
13748
|
Dropdown,
|
|
13643
13749
|
{
|
|
13644
13750
|
trigger: {
|
|
13645
|
-
label: /* @__PURE__ */
|
|
13751
|
+
label: /* @__PURE__ */ React190.createElement(IconFontSize, null),
|
|
13646
13752
|
title: "Font size"
|
|
13647
13753
|
}
|
|
13648
13754
|
},
|
|
13649
13755
|
[8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 42, 48, 56, 64, 72, 80, 96].map((size) => {
|
|
13650
13756
|
const sizeStr = `${size}px`;
|
|
13651
13757
|
const isActive = editor.getAttributes("textStyle").fontSize === sizeStr;
|
|
13652
|
-
return /* @__PURE__ */
|
|
13758
|
+
return /* @__PURE__ */ React190.createElement(
|
|
13653
13759
|
"button",
|
|
13654
13760
|
{
|
|
13655
13761
|
key: size,
|
|
@@ -13665,17 +13771,17 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13665
13771
|
sizeStr
|
|
13666
13772
|
);
|
|
13667
13773
|
})
|
|
13668
|
-
), show("font") && /* @__PURE__ */
|
|
13774
|
+
), show("font") && /* @__PURE__ */ React190.createElement(
|
|
13669
13775
|
Dropdown,
|
|
13670
13776
|
{
|
|
13671
13777
|
trigger: {
|
|
13672
|
-
label: /* @__PURE__ */
|
|
13778
|
+
label: /* @__PURE__ */ React190.createElement(IconFont, null),
|
|
13673
13779
|
title: "Font family"
|
|
13674
13780
|
}
|
|
13675
13781
|
},
|
|
13676
13782
|
FONT_FAMILIES.map((font) => {
|
|
13677
13783
|
const isActive = editor.getAttributes("textStyle").fontFamily === font;
|
|
13678
|
-
return /* @__PURE__ */
|
|
13784
|
+
return /* @__PURE__ */ React190.createElement(
|
|
13679
13785
|
"button",
|
|
13680
13786
|
{
|
|
13681
13787
|
key: font,
|
|
@@ -13692,40 +13798,40 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13692
13798
|
font
|
|
13693
13799
|
);
|
|
13694
13800
|
})
|
|
13695
|
-
), show("color") && /* @__PURE__ */
|
|
13801
|
+
), show("color") && /* @__PURE__ */ React190.createElement(
|
|
13696
13802
|
Dropdown,
|
|
13697
13803
|
{
|
|
13698
13804
|
trigger: {
|
|
13699
|
-
label: /* @__PURE__ */
|
|
13805
|
+
label: /* @__PURE__ */ React190.createElement("span", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React190.createElement(IconColor, null)),
|
|
13700
13806
|
title: "Colors"
|
|
13701
13807
|
},
|
|
13702
13808
|
keepOpen: true
|
|
13703
13809
|
},
|
|
13704
|
-
(close) => /* @__PURE__ */
|
|
13705
|
-
), show("bold") && /* @__PURE__ */
|
|
13810
|
+
(close) => /* @__PURE__ */ React190.createElement(ColorPickerPanel, { editor, onClose: close })
|
|
13811
|
+
), show("bold") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Bold (Ctrl+B)", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13706
13812
|
"button",
|
|
13707
13813
|
{
|
|
13708
13814
|
className: `toolbar-btn ${editor.isActive("bold") ? "is-active" : ""}`,
|
|
13709
13815
|
onClick: () => editor.chain().focus().toggleBold().run()
|
|
13710
13816
|
},
|
|
13711
|
-
/* @__PURE__ */
|
|
13712
|
-
)), show("italic") && /* @__PURE__ */
|
|
13817
|
+
/* @__PURE__ */ React190.createElement(IconBold, null)
|
|
13818
|
+
)), show("italic") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Italic (Ctrl+I)", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13713
13819
|
"button",
|
|
13714
13820
|
{
|
|
13715
13821
|
className: `toolbar-btn ${editor.isActive("italic") ? "is-active" : ""}`,
|
|
13716
13822
|
onClick: () => editor.chain().focus().toggleItalic().run()
|
|
13717
13823
|
},
|
|
13718
|
-
/* @__PURE__ */
|
|
13719
|
-
)), show("strike") && /* @__PURE__ */
|
|
13824
|
+
/* @__PURE__ */ React190.createElement(IconItalic, null)
|
|
13825
|
+
)), show("strike") && /* @__PURE__ */ React190.createElement(
|
|
13720
13826
|
Dropdown,
|
|
13721
13827
|
{
|
|
13722
|
-
trigger: { label: /* @__PURE__ */
|
|
13828
|
+
trigger: { label: /* @__PURE__ */ React190.createElement(IconStrike, null), title: "Text decoration", className: editor.isActive("strike") ? "is-active" : "" }
|
|
13723
13829
|
},
|
|
13724
|
-
/* @__PURE__ */
|
|
13725
|
-
/* @__PURE__ */
|
|
13726
|
-
/* @__PURE__ */
|
|
13727
|
-
/* @__PURE__ */
|
|
13728
|
-
/* @__PURE__ */
|
|
13830
|
+
/* @__PURE__ */ React190.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleStrike().run() }, /* @__PURE__ */ React190.createElement("s", null, "Strikethrough")),
|
|
13831
|
+
/* @__PURE__ */ React190.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleUnderline().run() }, /* @__PURE__ */ React190.createElement("u", null, "Underline")),
|
|
13832
|
+
/* @__PURE__ */ React190.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleSuperscript().run() }, "X", /* @__PURE__ */ React190.createElement("sup", null, "2"), " Superscript"),
|
|
13833
|
+
/* @__PURE__ */ React190.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleSubscript().run() }, "X", /* @__PURE__ */ React190.createElement("sub", null, "2"), " Subscript"),
|
|
13834
|
+
/* @__PURE__ */ React190.createElement("button", { className: "dropdown-item", onMouseDown: (e) => {
|
|
13729
13835
|
e.preventDefault();
|
|
13730
13836
|
const chain = editor.chain().focus();
|
|
13731
13837
|
if (!editor.state.selection.empty) {
|
|
@@ -13741,25 +13847,25 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13741
13847
|
c.run();
|
|
13742
13848
|
}
|
|
13743
13849
|
} }, "\u2715 Clear formatting")
|
|
13744
|
-
), show("link") && /* @__PURE__ */
|
|
13850
|
+
), show("link") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Insert Link", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13745
13851
|
"button",
|
|
13746
13852
|
{
|
|
13747
13853
|
className: `toolbar-btn ${editor.isActive("link") ? "is-active" : ""}`,
|
|
13748
13854
|
onClick: setLink
|
|
13749
13855
|
},
|
|
13750
|
-
/* @__PURE__ */
|
|
13751
|
-
)), show("lineheight") && /* @__PURE__ */
|
|
13856
|
+
/* @__PURE__ */ React190.createElement(IconLink, null)
|
|
13857
|
+
)), show("lineheight") && /* @__PURE__ */ React190.createElement(
|
|
13752
13858
|
Dropdown,
|
|
13753
13859
|
{
|
|
13754
13860
|
trigger: {
|
|
13755
|
-
label: /* @__PURE__ */
|
|
13861
|
+
label: /* @__PURE__ */ React190.createElement(IconLineHeight, null),
|
|
13756
13862
|
title: "Line height"
|
|
13757
13863
|
}
|
|
13758
13864
|
},
|
|
13759
13865
|
["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "2.0", "2.5", "3.0"].map((lh) => {
|
|
13760
13866
|
const currentLH = editor.getAttributes("paragraph").lineHeight || editor.getAttributes("heading").lineHeight;
|
|
13761
13867
|
const isActive = currentLH === lh;
|
|
13762
|
-
return /* @__PURE__ */
|
|
13868
|
+
return /* @__PURE__ */ React190.createElement(
|
|
13763
13869
|
"button",
|
|
13764
13870
|
{
|
|
13765
13871
|
key: lh,
|
|
@@ -13775,19 +13881,19 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13775
13881
|
lh
|
|
13776
13882
|
);
|
|
13777
13883
|
})
|
|
13778
|
-
)), (show("ul") || show("ol")) && /* @__PURE__ */
|
|
13884
|
+
)), (show("ul") || show("ol")) && /* @__PURE__ */ React190.createElement("div", { className: "toolbar-group" }, show("ul") && /* @__PURE__ */ React190.createElement("div", { className: "list-split-btn" }, /* @__PURE__ */ React190.createElement(Tooltip, { title: editor.isActive("bulletList") ? "Disable Bullet List" : "Enable Bullet List", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13779
13885
|
"button",
|
|
13780
13886
|
{
|
|
13781
13887
|
className: `toolbar-btn ${editor.isActive("bulletList") ? "is-active" : ""}`,
|
|
13782
13888
|
onClick: () => editor.chain().focus().toggleBulletList().run()
|
|
13783
13889
|
},
|
|
13784
|
-
/* @__PURE__ */
|
|
13785
|
-
)), /* @__PURE__ */
|
|
13890
|
+
/* @__PURE__ */ React190.createElement(IconBulletList, null)
|
|
13891
|
+
)), /* @__PURE__ */ React190.createElement(Dropdown, { trigger: { label: "", title: "List style", className: "list-arrow-btn" }, keepOpen: true }, [
|
|
13786
13892
|
{ label: "Default", style: null, icon: "\u2022" },
|
|
13787
13893
|
{ label: "Circle", style: "circle", icon: "\u25CB" },
|
|
13788
13894
|
{ label: "Dot", style: "disc", icon: "\u2219" },
|
|
13789
13895
|
{ label: "Square", style: "square", icon: "\u25A0" }
|
|
13790
|
-
].map((item) => /* @__PURE__ */
|
|
13896
|
+
].map((item) => /* @__PURE__ */ React190.createElement(
|
|
13791
13897
|
"button",
|
|
13792
13898
|
{
|
|
13793
13899
|
key: item.label,
|
|
@@ -13812,24 +13918,24 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13812
13918
|
}).run();
|
|
13813
13919
|
}
|
|
13814
13920
|
},
|
|
13815
|
-
/* @__PURE__ */
|
|
13921
|
+
/* @__PURE__ */ React190.createElement("span", { className: "bullet-style-icon" }, item.icon),
|
|
13816
13922
|
" ",
|
|
13817
13923
|
item.label
|
|
13818
|
-
)))), show("ol") && /* @__PURE__ */
|
|
13924
|
+
)))), show("ol") && /* @__PURE__ */ React190.createElement("div", { className: "list-split-btn" }, /* @__PURE__ */ React190.createElement(Tooltip, { title: editor.isActive("orderedList") ? "Disable Ordered List" : "Enable Ordered List", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13819
13925
|
"button",
|
|
13820
13926
|
{
|
|
13821
13927
|
className: `toolbar-btn ${editor.isActive("orderedList") ? "is-active" : ""}`,
|
|
13822
13928
|
onClick: () => editor.chain().focus().toggleOrderedList().run()
|
|
13823
13929
|
},
|
|
13824
|
-
/* @__PURE__ */
|
|
13825
|
-
)), /* @__PURE__ */
|
|
13930
|
+
/* @__PURE__ */ React190.createElement(IconOrderedList, null)
|
|
13931
|
+
)), /* @__PURE__ */ React190.createElement(Dropdown, { trigger: { label: "", title: "List style", className: "list-arrow-btn" }, keepOpen: true }, [
|
|
13826
13932
|
{ label: "Default", style: "decimal", icon: "1." },
|
|
13827
13933
|
{ label: "Lower Alpha", style: "lower-alpha", icon: "a." },
|
|
13828
13934
|
{ label: "Lower Greek", style: "lower-greek", icon: "\u03B1." },
|
|
13829
13935
|
{ label: "Lower Roman", style: "lower-roman", icon: "i." },
|
|
13830
13936
|
{ label: "Upper Alpha", style: "upper-alpha", icon: "A." },
|
|
13831
13937
|
{ label: "Upper Roman", style: "upper-roman", icon: "I." }
|
|
13832
|
-
].map((item) => /* @__PURE__ */
|
|
13938
|
+
].map((item) => /* @__PURE__ */ React190.createElement(
|
|
13833
13939
|
"button",
|
|
13834
13940
|
{
|
|
13835
13941
|
key: item.label,
|
|
@@ -13854,24 +13960,24 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13854
13960
|
}).run();
|
|
13855
13961
|
}
|
|
13856
13962
|
},
|
|
13857
|
-
/* @__PURE__ */
|
|
13963
|
+
/* @__PURE__ */ React190.createElement("span", { className: "bullet-style-icon" }, item.icon),
|
|
13858
13964
|
" ",
|
|
13859
13965
|
item.label
|
|
13860
|
-
))))), (show("align") || show("indent") || show("outdent")) && /* @__PURE__ */
|
|
13966
|
+
))))), (show("align") || show("indent") || show("outdent")) && /* @__PURE__ */ React190.createElement("div", { className: "toolbar-group" }, show("align") && /* @__PURE__ */ React190.createElement(
|
|
13861
13967
|
Dropdown,
|
|
13862
13968
|
{
|
|
13863
13969
|
trigger: {
|
|
13864
|
-
label: /* @__PURE__ */
|
|
13970
|
+
label: /* @__PURE__ */ React190.createElement(IconAlignLeft, null),
|
|
13865
13971
|
title: "Align",
|
|
13866
13972
|
className: editor.isActive({ textAlign: "center" }) || editor.isActive({ textAlign: "right" }) || editor.isActive({ textAlign: "justify" }) ? "is-active" : ""
|
|
13867
13973
|
}
|
|
13868
13974
|
},
|
|
13869
13975
|
[
|
|
13870
|
-
{ label: "Align Left", value: "left", icon: /* @__PURE__ */
|
|
13871
|
-
{ label: "Align Center", value: "center", icon: /* @__PURE__ */
|
|
13872
|
-
{ label: "Align Right", value: "right", icon: /* @__PURE__ */
|
|
13873
|
-
{ label: "Align Justify", value: "justify", icon: /* @__PURE__ */
|
|
13874
|
-
].map((item) => /* @__PURE__ */
|
|
13976
|
+
{ label: "Align Left", value: "left", icon: /* @__PURE__ */ React190.createElement(IconAlignLeft, null) },
|
|
13977
|
+
{ label: "Align Center", value: "center", icon: /* @__PURE__ */ React190.createElement(IconAlignCenter, null) },
|
|
13978
|
+
{ label: "Align Right", value: "right", icon: /* @__PURE__ */ React190.createElement(IconAlignRight, null) },
|
|
13979
|
+
{ label: "Align Justify", value: "justify", icon: /* @__PURE__ */ React190.createElement(IconAlignJustify, null) }
|
|
13980
|
+
].map((item) => /* @__PURE__ */ React190.createElement(
|
|
13875
13981
|
"button",
|
|
13876
13982
|
{
|
|
13877
13983
|
key: item.value,
|
|
@@ -13882,7 +13988,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13882
13988
|
" ",
|
|
13883
13989
|
item.label
|
|
13884
13990
|
))
|
|
13885
|
-
), show("indent") && /* @__PURE__ */
|
|
13991
|
+
), show("indent") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Increase Indent", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13886
13992
|
"button",
|
|
13887
13993
|
{
|
|
13888
13994
|
className: "toolbar-btn",
|
|
@@ -13901,8 +14007,8 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13901
14007
|
}).run();
|
|
13902
14008
|
}
|
|
13903
14009
|
},
|
|
13904
|
-
/* @__PURE__ */
|
|
13905
|
-
)), show("outdent") && /* @__PURE__ */
|
|
14010
|
+
/* @__PURE__ */ React190.createElement(IconIndentIncrease, null)
|
|
14011
|
+
)), show("outdent") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Decrease Indent", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13906
14012
|
"button",
|
|
13907
14013
|
{
|
|
13908
14014
|
className: "toolbar-btn",
|
|
@@ -13921,29 +14027,29 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13921
14027
|
}).run();
|
|
13922
14028
|
}
|
|
13923
14029
|
},
|
|
13924
|
-
/* @__PURE__ */
|
|
13925
|
-
))), show("table") && /* @__PURE__ */
|
|
14030
|
+
/* @__PURE__ */ React190.createElement(IconIndentDecrease, null)
|
|
14031
|
+
))), show("table") && /* @__PURE__ */ React190.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React190.createElement(IconTable, null), title: "Insert Table" }, keepOpen: true }, (close) => /* @__PURE__ */ React190.createElement(TableGridSelector, { editor, onClose: close })), show("image") && /* @__PURE__ */ React190.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React190.createElement(IconImage, null), title: "Insert Image" }, keepOpen: true }, (close) => /* @__PURE__ */ React190.createElement(ImagePanel, { editor, onClose: close, onImageUpload })), show("video") && /* @__PURE__ */ React190.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React190.createElement(IconVideo, null), title: "Insert Video" }, keepOpen: true }, (close) => /* @__PURE__ */ React190.createElement(InsertPanel, { editor, onClose: close, mode: "video" })), show("cut") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Cut (Ctrl+X)", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13926
14032
|
"button",
|
|
13927
14033
|
{
|
|
13928
14034
|
className: "toolbar-btn",
|
|
13929
14035
|
onClick: () => document.execCommand("cut")
|
|
13930
14036
|
},
|
|
13931
|
-
/* @__PURE__ */
|
|
13932
|
-
)), show("copy") && /* @__PURE__ */
|
|
14037
|
+
/* @__PURE__ */ React190.createElement(IconCut, null)
|
|
14038
|
+
)), show("copy") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Copy selected text", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13933
14039
|
"button",
|
|
13934
14040
|
{
|
|
13935
14041
|
className: "toolbar-btn",
|
|
13936
14042
|
onClick: handleCopy
|
|
13937
14043
|
},
|
|
13938
|
-
copySuccess ? /* @__PURE__ */
|
|
13939
|
-
)), show("paste") && /* @__PURE__ */
|
|
14044
|
+
copySuccess ? /* @__PURE__ */ React190.createElement(IconCheck, null) : /* @__PURE__ */ React190.createElement(IconCopy, null)
|
|
14045
|
+
)), show("paste") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Paste (Ctrl+V)", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13940
14046
|
"button",
|
|
13941
14047
|
{
|
|
13942
14048
|
className: "toolbar-btn",
|
|
13943
14049
|
onClick: handlePaste
|
|
13944
14050
|
},
|
|
13945
|
-
/* @__PURE__ */
|
|
13946
|
-
)), show("specialchars") && /* @__PURE__ */
|
|
14051
|
+
/* @__PURE__ */ React190.createElement(IconPaste, null)
|
|
14052
|
+
)), show("specialchars") && /* @__PURE__ */ React190.createElement(Dropdown, { trigger: { label: "\u03A9", title: "Special characters", className: "special-characters-btn" } }, /* @__PURE__ */ React190.createElement("div", { className: "char-grid" }, SPECIAL_CHARS.map((char) => /* @__PURE__ */ React190.createElement(
|
|
13947
14053
|
"button",
|
|
13948
14054
|
{
|
|
13949
14055
|
key: char,
|
|
@@ -13951,12 +14057,12 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13951
14057
|
onClick: () => insertSpecialChar(char)
|
|
13952
14058
|
},
|
|
13953
14059
|
char
|
|
13954
|
-
)))), show("code") && /* @__PURE__ */
|
|
14060
|
+
)))), show("code") && /* @__PURE__ */ React190.createElement(
|
|
13955
14061
|
Dropdown,
|
|
13956
14062
|
{
|
|
13957
|
-
trigger: { label: /* @__PURE__ */
|
|
14063
|
+
trigger: { label: /* @__PURE__ */ React190.createElement(IconCode, null), title: "Code", className: editor.isActive("code") || editor.isActive("codeBlock") ? "is-active" : "" }
|
|
13958
14064
|
},
|
|
13959
|
-
/* @__PURE__ */
|
|
14065
|
+
/* @__PURE__ */ React190.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
13960
14066
|
if (editor.isActive("codeBlock")) {
|
|
13961
14067
|
const text = (() => {
|
|
13962
14068
|
const { $from } = editor.state.selection;
|
|
@@ -13974,22 +14080,22 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13974
14080
|
editor.chain().focus().toggleCode().run();
|
|
13975
14081
|
}
|
|
13976
14082
|
} }, "</>", " Inline Code"),
|
|
13977
|
-
/* @__PURE__ */
|
|
13978
|
-
), show("fullscreen") && /* @__PURE__ */
|
|
14083
|
+
/* @__PURE__ */ React190.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleCodeBlock().run() }, "{ }", " Code Block")
|
|
14084
|
+
), show("fullscreen") && /* @__PURE__ */ React190.createElement(Tooltip, { title: "Toggle Fullscreen", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13979
14085
|
"button",
|
|
13980
14086
|
{
|
|
13981
14087
|
className: `toolbar-btn ${isFullscreen ? "is-active" : ""}`,
|
|
13982
14088
|
onClick: onToggleFullscreen
|
|
13983
14089
|
},
|
|
13984
|
-
/* @__PURE__ */
|
|
13985
|
-
)), show("tts") && /* @__PURE__ */
|
|
14090
|
+
/* @__PURE__ */ React190.createElement(IconFullscreen, null)
|
|
14091
|
+
)), show("tts") && /* @__PURE__ */ React190.createElement(TextToSpeech_default, { ref: ttsRef, editor, onTextToSpeech }), show("stt") && /* @__PURE__ */ React190.createElement(SpeechToText_default, { ref: sttRef, editor, onSpeechToText }), show("translate") && /* @__PURE__ */ React190.createElement("div", { className: "translate-split-btn" }, /* @__PURE__ */ React190.createElement(Tooltip, { title: "Translate selected text", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13986
14092
|
"button",
|
|
13987
14093
|
{
|
|
13988
14094
|
className: "toolbar-btn",
|
|
13989
14095
|
onClick: handleQuickTranslate
|
|
13990
14096
|
},
|
|
13991
|
-
/* @__PURE__ */
|
|
13992
|
-
)), /* @__PURE__ */
|
|
14097
|
+
/* @__PURE__ */ React190.createElement(IconTranslate, null)
|
|
14098
|
+
)), /* @__PURE__ */ React190.createElement(Dropdown, { trigger: { label: "", title: "Translate options", className: "translate-arrow-btn" } }, /* @__PURE__ */ React190.createElement("button", { className: "dropdown-item", onClick: () => setShowTranslateModal(true) }, "Options")), translateStatus && /* @__PURE__ */ React190.createElement("span", { className: `translate-toast-popup ${translateStatus === "Please select the text" || translateStatus === "Translation failed" ? "error" : ""}` }, translateStatus)), show("todo") && /* @__PURE__ */ React190.createElement("div", { className: "todo-split-btn" }, /* @__PURE__ */ React190.createElement(Tooltip, { title: todoEnabled ? "Disable Task List" : "Enable Task List", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
13993
14099
|
"button",
|
|
13994
14100
|
{
|
|
13995
14101
|
className: `toolbar-btn ${todoEnabled ? "is-active" : ""}`,
|
|
@@ -14032,11 +14138,11 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
14032
14138
|
}
|
|
14033
14139
|
}
|
|
14034
14140
|
},
|
|
14035
|
-
/* @__PURE__ */
|
|
14036
|
-
)), /* @__PURE__ */
|
|
14141
|
+
/* @__PURE__ */ React190.createElement(IconTaskList, null)
|
|
14142
|
+
)), /* @__PURE__ */ React190.createElement(Dropdown, { trigger: { label: "", title: "Task status", className: "todo-arrow-btn" }, keepOpen: true }, ["todo", "working", "blocked", "resolved"].map((status) => {
|
|
14037
14143
|
const images = { todo: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/todo-blank.svg", working: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/working.svg", blocked: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/blocked.svg", resolved: "https://storage.googleapis.com/rufous-com-bucket-1/static/images/closed.svg" };
|
|
14038
14144
|
const labels = { todo: "Todo", working: "Working", blocked: "Blocked", resolved: "Resolved" };
|
|
14039
|
-
return /* @__PURE__ */
|
|
14145
|
+
return /* @__PURE__ */ React190.createElement("button", { key: status, className: "dropdown-item task-status-item", onClick: () => {
|
|
14040
14146
|
const { state } = editor;
|
|
14041
14147
|
const { schema } = state;
|
|
14042
14148
|
const taskItemType = schema.nodes.taskItem;
|
|
@@ -14069,8 +14175,8 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
14069
14175
|
}
|
|
14070
14176
|
return true;
|
|
14071
14177
|
}).run();
|
|
14072
|
-
} }, /* @__PURE__ */
|
|
14073
|
-
})))), onClose && /* @__PURE__ */
|
|
14178
|
+
} }, /* @__PURE__ */ React190.createElement("span", { className: `task-icon task-${status}` }, /* @__PURE__ */ React190.createElement("img", { src: images[status], alt: status })), " ", labels[status]);
|
|
14179
|
+
})))), onClose && /* @__PURE__ */ React190.createElement("div", { className: "toolbar-row-right" }, /* @__PURE__ */ React190.createElement(Tooltip, { title: "Close", placement: "top" }, /* @__PURE__ */ React190.createElement(
|
|
14074
14180
|
"button",
|
|
14075
14181
|
{
|
|
14076
14182
|
className: "toolbar-btn btn-cross",
|
|
@@ -14086,8 +14192,8 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
14086
14192
|
onClose();
|
|
14087
14193
|
}
|
|
14088
14194
|
},
|
|
14089
|
-
/* @__PURE__ */
|
|
14090
|
-
))), showTranslateModal && /* @__PURE__ */
|
|
14195
|
+
/* @__PURE__ */ React190.createElement(closeIcon_default, { color: "#a81c08" })
|
|
14196
|
+
))), showTranslateModal && /* @__PURE__ */ React190.createElement(
|
|
14091
14197
|
TranslateModal_default,
|
|
14092
14198
|
{
|
|
14093
14199
|
editor,
|
|
@@ -14105,7 +14211,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
14105
14211
|
var Toolbar_default = Toolbar;
|
|
14106
14212
|
|
|
14107
14213
|
// lib/RufousTextEditor/ImageToolbar.tsx
|
|
14108
|
-
import
|
|
14214
|
+
import React191, { useState as useState35, useEffect as useEffect28, useRef as useRef31 } from "react";
|
|
14109
14215
|
import { createPortal as createPortal5 } from "react-dom";
|
|
14110
14216
|
var ALIGNMENTS = [
|
|
14111
14217
|
{ value: "left", label: "Left", icon: "\u2630" },
|
|
@@ -14163,7 +14269,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
14163
14269
|
editor.chain().focus().deleteSelection().run();
|
|
14164
14270
|
onClose();
|
|
14165
14271
|
};
|
|
14166
|
-
return /* @__PURE__ */
|
|
14272
|
+
return /* @__PURE__ */ React191.createElement("div", { className: "modal-overlay", onClick: onClose }, /* @__PURE__ */ React191.createElement("div", { className: "modal-content", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React191.createElement("div", { className: "modal-header" }, /* @__PURE__ */ React191.createElement("h3", null, "Image properties"), /* @__PURE__ */ React191.createElement("button", { className: "modal-close", onClick: onClose }, "\xD7")), /* @__PURE__ */ React191.createElement("div", { className: "modal-body" }, /* @__PURE__ */ React191.createElement("div", { className: "modal-layout" }, /* @__PURE__ */ React191.createElement("div", { className: "modal-preview-col" }, src && /* @__PURE__ */ React191.createElement("div", { className: "modal-preview" }, /* @__PURE__ */ React191.createElement("img", { src, alt: alt || "Preview" })), /* @__PURE__ */ React191.createElement("div", { className: "modal-dimensions" }, /* @__PURE__ */ React191.createElement(
|
|
14167
14273
|
"input",
|
|
14168
14274
|
{
|
|
14169
14275
|
type: "number",
|
|
@@ -14171,14 +14277,14 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
14171
14277
|
value: width,
|
|
14172
14278
|
onChange: (e) => handleWidthChange(e.target.value)
|
|
14173
14279
|
}
|
|
14174
|
-
), /* @__PURE__ */
|
|
14280
|
+
), /* @__PURE__ */ React191.createElement(Tooltip, { title: lockRatio ? "Unlock aspect ratio" : "Lock aspect ratio", placement: "top" }, /* @__PURE__ */ React191.createElement(
|
|
14175
14281
|
"button",
|
|
14176
14282
|
{
|
|
14177
14283
|
className: `lock-btn ${lockRatio ? "locked" : ""}`,
|
|
14178
14284
|
onClick: () => setLockRatio(!lockRatio)
|
|
14179
14285
|
},
|
|
14180
14286
|
lockRatio ? "\u{1F512}" : "\u{1F513}"
|
|
14181
|
-
)), /* @__PURE__ */
|
|
14287
|
+
)), /* @__PURE__ */ React191.createElement(
|
|
14182
14288
|
"input",
|
|
14183
14289
|
{
|
|
14184
14290
|
type: "number",
|
|
@@ -14186,21 +14292,21 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
14186
14292
|
value: height,
|
|
14187
14293
|
onChange: (e) => handleHeightChange(e.target.value)
|
|
14188
14294
|
}
|
|
14189
|
-
))), /* @__PURE__ */
|
|
14295
|
+
))), /* @__PURE__ */ React191.createElement("div", { className: "modal-fields-col" }, /* @__PURE__ */ React191.createElement("div", { className: "modal-tabs" }, /* @__PURE__ */ React191.createElement(
|
|
14190
14296
|
"button",
|
|
14191
14297
|
{
|
|
14192
14298
|
className: `modal-tab ${activeTab === "image" ? "active" : ""}`,
|
|
14193
14299
|
onClick: () => setActiveTab("image")
|
|
14194
14300
|
},
|
|
14195
14301
|
"Image"
|
|
14196
|
-
), /* @__PURE__ */
|
|
14302
|
+
), /* @__PURE__ */ React191.createElement(
|
|
14197
14303
|
"button",
|
|
14198
14304
|
{
|
|
14199
14305
|
className: `modal-tab ${activeTab === "advanced" ? "active" : ""}`,
|
|
14200
14306
|
onClick: () => setActiveTab("advanced")
|
|
14201
14307
|
},
|
|
14202
14308
|
"Advanced"
|
|
14203
|
-
)), activeTab === "image" ? /* @__PURE__ */
|
|
14309
|
+
)), activeTab === "image" ? /* @__PURE__ */ React191.createElement(React191.Fragment, null, /* @__PURE__ */ React191.createElement("label", { className: "modal-label" }, "Src"), /* @__PURE__ */ React191.createElement(
|
|
14204
14310
|
"input",
|
|
14205
14311
|
{
|
|
14206
14312
|
type: "text",
|
|
@@ -14208,7 +14314,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
14208
14314
|
value: src,
|
|
14209
14315
|
onChange: (e) => setSrc(e.target.value)
|
|
14210
14316
|
}
|
|
14211
|
-
), /* @__PURE__ */
|
|
14317
|
+
), /* @__PURE__ */ React191.createElement("label", { className: "modal-label" }, "Title"), /* @__PURE__ */ React191.createElement(
|
|
14212
14318
|
"input",
|
|
14213
14319
|
{
|
|
14214
14320
|
type: "text",
|
|
@@ -14216,7 +14322,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
14216
14322
|
value: title,
|
|
14217
14323
|
onChange: (e) => setTitle(e.target.value)
|
|
14218
14324
|
}
|
|
14219
|
-
), /* @__PURE__ */
|
|
14325
|
+
), /* @__PURE__ */ React191.createElement("label", { className: "modal-label" }, "Alternative"), /* @__PURE__ */ React191.createElement(
|
|
14220
14326
|
"input",
|
|
14221
14327
|
{
|
|
14222
14328
|
type: "text",
|
|
@@ -14224,7 +14330,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
14224
14330
|
value: alt,
|
|
14225
14331
|
onChange: (e) => setAlt(e.target.value)
|
|
14226
14332
|
}
|
|
14227
|
-
), /* @__PURE__ */
|
|
14333
|
+
), /* @__PURE__ */ React191.createElement("label", { className: "modal-label" }, "Link"), /* @__PURE__ */ React191.createElement(
|
|
14228
14334
|
"input",
|
|
14229
14335
|
{
|
|
14230
14336
|
type: "text",
|
|
@@ -14232,14 +14338,14 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
14232
14338
|
value: link,
|
|
14233
14339
|
onChange: (e) => setLink(e.target.value)
|
|
14234
14340
|
}
|
|
14235
|
-
), /* @__PURE__ */
|
|
14341
|
+
), /* @__PURE__ */ React191.createElement("label", { className: "modal-checkbox" }, /* @__PURE__ */ React191.createElement(
|
|
14236
14342
|
"input",
|
|
14237
14343
|
{
|
|
14238
14344
|
type: "checkbox",
|
|
14239
14345
|
checked: openInNewTab,
|
|
14240
14346
|
onChange: (e) => setOpenInNewTab(e.target.checked)
|
|
14241
14347
|
}
|
|
14242
|
-
), "Open link in new tab")) : /* @__PURE__ */
|
|
14348
|
+
), "Open link in new tab")) : /* @__PURE__ */ React191.createElement(React191.Fragment, null, /* @__PURE__ */ React191.createElement("label", { className: "modal-label" }, "CSS Class"), /* @__PURE__ */ React191.createElement("input", { type: "text", className: "modal-input", placeholder: "e.g. rounded shadow" }), /* @__PURE__ */ React191.createElement("label", { className: "modal-label" }, "Inline Style"), /* @__PURE__ */ React191.createElement("input", { type: "text", className: "modal-input", placeholder: "e.g. border: 1px solid #ccc" }))))), /* @__PURE__ */ React191.createElement("div", { className: "modal-footer" }, /* @__PURE__ */ React191.createElement("div", { className: "modal-footer-left" }, /* @__PURE__ */ React191.createElement("button", { className: "modal-btn-cancel", onClick: onClose }, "Cancel"), /* @__PURE__ */ React191.createElement("button", { className: "modal-btn-delete", onClick: handleDelete }, "Delete")), /* @__PURE__ */ React191.createElement("button", { className: "modal-btn-apply", onClick: handleApply }, "Apply"))));
|
|
14243
14349
|
};
|
|
14244
14350
|
var ImageToolbar = ({ editor }) => {
|
|
14245
14351
|
const [showModal, setShowModal] = useState35(false);
|
|
@@ -14278,7 +14384,7 @@ var ImageToolbar = ({ editor }) => {
|
|
|
14278
14384
|
const node = editor?.state.selection.node;
|
|
14279
14385
|
const isImage = node && node.type.name === "image";
|
|
14280
14386
|
if (!editor || !isImage || !pos) return showModal ? createPortal5(
|
|
14281
|
-
/* @__PURE__ */
|
|
14387
|
+
/* @__PURE__ */ React191.createElement(ImagePropertiesModal, { editor, node, onClose: () => setShowModal(false) }),
|
|
14282
14388
|
document.body
|
|
14283
14389
|
) : null;
|
|
14284
14390
|
const handleDelete = () => {
|
|
@@ -14355,7 +14461,7 @@ var ImageToolbar = ({ editor }) => {
|
|
|
14355
14461
|
setShowVAlign(false);
|
|
14356
14462
|
};
|
|
14357
14463
|
return createPortal5(
|
|
14358
|
-
/* @__PURE__ */
|
|
14464
|
+
/* @__PURE__ */ React191.createElement(React191.Fragment, null, /* @__PURE__ */ React191.createElement(
|
|
14359
14465
|
"div",
|
|
14360
14466
|
{
|
|
14361
14467
|
className: "image-toolbar",
|
|
@@ -14363,14 +14469,14 @@ var ImageToolbar = ({ editor }) => {
|
|
|
14363
14469
|
style: { position: "absolute", top: pos.top, left: pos.left, zIndex: 1e3 },
|
|
14364
14470
|
onMouseDown: (e) => e.preventDefault()
|
|
14365
14471
|
},
|
|
14366
|
-
/* @__PURE__ */
|
|
14367
|
-
/* @__PURE__ */
|
|
14368
|
-
/* @__PURE__ */
|
|
14369
|
-
/* @__PURE__ */
|
|
14472
|
+
/* @__PURE__ */ React191.createElement(Tooltip, { title: "Delete", placement: "top" }, /* @__PURE__ */ React191.createElement("button", { className: "img-tool-btn", onClick: handleDelete }, "\u{1F5D1}")),
|
|
14473
|
+
/* @__PURE__ */ React191.createElement(Tooltip, { title: "Edit properties", placement: "top" }, /* @__PURE__ */ React191.createElement("button", { className: "img-tool-btn", onClick: () => setShowModal(true) }, "\u270E")),
|
|
14474
|
+
/* @__PURE__ */ React191.createElement("div", { className: "img-tool-copy-wrapper" }, /* @__PURE__ */ React191.createElement(Tooltip, { title: "Copy image", placement: "top" }, /* @__PURE__ */ React191.createElement("button", { className: "img-tool-btn", onClick: handleCopy }, copyStatus ? "\u2713" : "\u{1F4CB}")), copyStatus && /* @__PURE__ */ React191.createElement("span", { className: "img-copy-toast" }, copyStatus)),
|
|
14475
|
+
/* @__PURE__ */ React191.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React191.createElement(Tooltip, { title: "Horizontal alignment", placement: "top" }, /* @__PURE__ */ React191.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
14370
14476
|
setShowAlign(!showAlign);
|
|
14371
14477
|
setShowVAlign(false);
|
|
14372
|
-
} }, "\u2630 ", /* @__PURE__ */
|
|
14373
|
-
), showModal && /* @__PURE__ */
|
|
14478
|
+
} }, "\u2630 ", /* @__PURE__ */ React191.createElement("span", { className: "dropdown-arrow" }, "\u25BE"))), showAlign && /* @__PURE__ */ React191.createElement("div", { className: "img-tool-menu" }, ALIGNMENTS.map((a) => /* @__PURE__ */ React191.createElement("button", { key: a.value, className: "dropdown-item", onClick: () => setAlignmentVal(a.value) }, a.icon, " ", a.label))))
|
|
14479
|
+
), showModal && /* @__PURE__ */ React191.createElement(
|
|
14374
14480
|
ImagePropertiesModal,
|
|
14375
14481
|
{
|
|
14376
14482
|
editor,
|
|
@@ -14384,7 +14490,7 @@ var ImageToolbar = ({ editor }) => {
|
|
|
14384
14490
|
var ImageToolbar_default = ImageToolbar;
|
|
14385
14491
|
|
|
14386
14492
|
// lib/RufousTextEditor/VideoToolbar.tsx
|
|
14387
|
-
import
|
|
14493
|
+
import React192, { useState as useState36, useEffect as useEffect29, useRef as useRef32 } from "react";
|
|
14388
14494
|
import { createPortal as createPortal6 } from "react-dom";
|
|
14389
14495
|
var ALIGNMENTS2 = [
|
|
14390
14496
|
{ value: "left", label: "Left", icon: "\u2630" },
|
|
@@ -14429,7 +14535,7 @@ var VideoPropertiesModal = ({ editor, node, nodeType, onClose }) => {
|
|
|
14429
14535
|
onClose();
|
|
14430
14536
|
};
|
|
14431
14537
|
const isYoutube = nodeType === "youtube";
|
|
14432
|
-
return /* @__PURE__ */
|
|
14538
|
+
return /* @__PURE__ */ React192.createElement("div", { className: "modal-overlay", onClick: onClose }, /* @__PURE__ */ React192.createElement("div", { className: "modal-content", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React192.createElement("div", { className: "modal-header" }, /* @__PURE__ */ React192.createElement("h3", null, "Video properties"), /* @__PURE__ */ React192.createElement("button", { className: "modal-close", onClick: onClose }, "\xD7")), /* @__PURE__ */ React192.createElement("div", { className: "modal-body" }, /* @__PURE__ */ React192.createElement("div", { className: "modal-layout" }, /* @__PURE__ */ React192.createElement("div", { className: "modal-preview-col" }, src && /* @__PURE__ */ React192.createElement("div", { className: "modal-preview", style: { background: "#000" } }, isYoutube ? /* @__PURE__ */ React192.createElement(
|
|
14433
14539
|
"iframe",
|
|
14434
14540
|
{
|
|
14435
14541
|
src,
|
|
@@ -14437,14 +14543,14 @@ var VideoPropertiesModal = ({ editor, node, nodeType, onClose }) => {
|
|
|
14437
14543
|
style: { width: "100%", aspectRatio: "16/9", border: "none", display: "block" },
|
|
14438
14544
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
14439
14545
|
}
|
|
14440
|
-
) : /* @__PURE__ */
|
|
14546
|
+
) : /* @__PURE__ */ React192.createElement(
|
|
14441
14547
|
"video",
|
|
14442
14548
|
{
|
|
14443
14549
|
src,
|
|
14444
14550
|
controls: true,
|
|
14445
14551
|
style: { width: "100%", aspectRatio: "16/9", display: "block" }
|
|
14446
14552
|
}
|
|
14447
|
-
)), /* @__PURE__ */
|
|
14553
|
+
)), /* @__PURE__ */ React192.createElement("div", { className: "modal-dimensions" }, /* @__PURE__ */ React192.createElement(
|
|
14448
14554
|
"input",
|
|
14449
14555
|
{
|
|
14450
14556
|
type: "number",
|
|
@@ -14452,14 +14558,14 @@ var VideoPropertiesModal = ({ editor, node, nodeType, onClose }) => {
|
|
|
14452
14558
|
value: width,
|
|
14453
14559
|
onChange: (e) => handleWidthChange(e.target.value)
|
|
14454
14560
|
}
|
|
14455
|
-
), /* @__PURE__ */
|
|
14561
|
+
), /* @__PURE__ */ React192.createElement(Tooltip, { title: lockRatio ? "Unlock aspect ratio" : "Lock aspect ratio", placement: "top" }, /* @__PURE__ */ React192.createElement(
|
|
14456
14562
|
"button",
|
|
14457
14563
|
{
|
|
14458
14564
|
className: `lock-btn ${lockRatio ? "locked" : ""}`,
|
|
14459
14565
|
onClick: () => setLockRatio(!lockRatio)
|
|
14460
14566
|
},
|
|
14461
14567
|
lockRatio ? "\u{1F512}" : "\u{1F513}"
|
|
14462
|
-
)), /* @__PURE__ */
|
|
14568
|
+
)), /* @__PURE__ */ React192.createElement(
|
|
14463
14569
|
"input",
|
|
14464
14570
|
{
|
|
14465
14571
|
type: "number",
|
|
@@ -14467,7 +14573,7 @@ var VideoPropertiesModal = ({ editor, node, nodeType, onClose }) => {
|
|
|
14467
14573
|
value: height,
|
|
14468
14574
|
onChange: (e) => handleHeightChange(e.target.value)
|
|
14469
14575
|
}
|
|
14470
|
-
))), /* @__PURE__ */
|
|
14576
|
+
))), /* @__PURE__ */ React192.createElement("div", { className: "modal-fields-col" }, /* @__PURE__ */ React192.createElement("label", { className: "modal-label" }, "Video URL"), /* @__PURE__ */ React192.createElement(
|
|
14471
14577
|
"input",
|
|
14472
14578
|
{
|
|
14473
14579
|
type: "text",
|
|
@@ -14475,7 +14581,7 @@ var VideoPropertiesModal = ({ editor, node, nodeType, onClose }) => {
|
|
|
14475
14581
|
value: src,
|
|
14476
14582
|
onChange: (e) => setSrc(e.target.value)
|
|
14477
14583
|
}
|
|
14478
|
-
), /* @__PURE__ */
|
|
14584
|
+
), /* @__PURE__ */ React192.createElement("label", { className: "modal-label" }, "Width"), /* @__PURE__ */ React192.createElement(
|
|
14479
14585
|
"input",
|
|
14480
14586
|
{
|
|
14481
14587
|
type: "number",
|
|
@@ -14483,7 +14589,7 @@ var VideoPropertiesModal = ({ editor, node, nodeType, onClose }) => {
|
|
|
14483
14589
|
value: width,
|
|
14484
14590
|
onChange: (e) => handleWidthChange(e.target.value)
|
|
14485
14591
|
}
|
|
14486
|
-
), /* @__PURE__ */
|
|
14592
|
+
), /* @__PURE__ */ React192.createElement("label", { className: "modal-label" }, "Height"), /* @__PURE__ */ React192.createElement(
|
|
14487
14593
|
"input",
|
|
14488
14594
|
{
|
|
14489
14595
|
type: "number",
|
|
@@ -14491,7 +14597,7 @@ var VideoPropertiesModal = ({ editor, node, nodeType, onClose }) => {
|
|
|
14491
14597
|
value: height,
|
|
14492
14598
|
onChange: (e) => handleHeightChange(e.target.value)
|
|
14493
14599
|
}
|
|
14494
|
-
)))), /* @__PURE__ */
|
|
14600
|
+
)))), /* @__PURE__ */ React192.createElement("div", { className: "modal-footer" }, /* @__PURE__ */ React192.createElement("div", { className: "modal-footer-left" }, /* @__PURE__ */ React192.createElement("button", { className: "modal-btn-cancel", onClick: onClose }, "Cancel"), /* @__PURE__ */ React192.createElement("button", { className: "modal-btn-delete", onClick: handleDelete }, "Delete")), /* @__PURE__ */ React192.createElement("button", { className: "modal-btn-apply", onClick: handleApply }, "Apply"))));
|
|
14495
14601
|
};
|
|
14496
14602
|
var VideoToolbar = ({ editor }) => {
|
|
14497
14603
|
const [showModal, setShowModal] = useState36(false);
|
|
@@ -14531,7 +14637,7 @@ var VideoToolbar = ({ editor }) => {
|
|
|
14531
14637
|
const isVideo = node && VIDEO_TYPES.includes(node.type.name);
|
|
14532
14638
|
const nodeType = node?.type.name;
|
|
14533
14639
|
if (!editor || !isVideo || !pos) return showModal ? createPortal6(
|
|
14534
|
-
/* @__PURE__ */
|
|
14640
|
+
/* @__PURE__ */ React192.createElement(VideoPropertiesModal, { editor, node, nodeType, onClose: () => setShowModal(false) }),
|
|
14535
14641
|
document.body
|
|
14536
14642
|
) : null;
|
|
14537
14643
|
const handleDelete = () => {
|
|
@@ -14578,7 +14684,7 @@ var VideoToolbar = ({ editor }) => {
|
|
|
14578
14684
|
);
|
|
14579
14685
|
};
|
|
14580
14686
|
return createPortal6(
|
|
14581
|
-
/* @__PURE__ */
|
|
14687
|
+
/* @__PURE__ */ React192.createElement(React192.Fragment, null, /* @__PURE__ */ React192.createElement(
|
|
14582
14688
|
"div",
|
|
14583
14689
|
{
|
|
14584
14690
|
className: "image-toolbar",
|
|
@@ -14586,30 +14692,30 @@ var VideoToolbar = ({ editor }) => {
|
|
|
14586
14692
|
style: { position: "absolute", top: pos.top, left: pos.left, zIndex: 1e3 },
|
|
14587
14693
|
onMouseDown: (e) => e.preventDefault()
|
|
14588
14694
|
},
|
|
14589
|
-
/* @__PURE__ */
|
|
14590
|
-
/* @__PURE__ */
|
|
14591
|
-
/* @__PURE__ */
|
|
14592
|
-
/* @__PURE__ */
|
|
14695
|
+
/* @__PURE__ */ React192.createElement(Tooltip, { title: "Delete", placement: "top" }, /* @__PURE__ */ React192.createElement("button", { className: "img-tool-btn", onClick: handleDelete }, "\u{1F5D1}")),
|
|
14696
|
+
/* @__PURE__ */ React192.createElement(Tooltip, { title: "Edit properties", placement: "top" }, /* @__PURE__ */ React192.createElement("button", { className: "img-tool-btn", onClick: () => setShowModal(true) }, "\u270E")),
|
|
14697
|
+
/* @__PURE__ */ React192.createElement("div", { className: "img-tool-copy-wrapper" }, /* @__PURE__ */ React192.createElement(Tooltip, { title: "Copy URL", placement: "top" }, /* @__PURE__ */ React192.createElement("button", { className: "img-tool-btn", onClick: handleCopy }, copyStatus ? "\u2713" : "\u{1F4CB}")), copyStatus && /* @__PURE__ */ React192.createElement("span", { className: "img-copy-toast" }, copyStatus)),
|
|
14698
|
+
/* @__PURE__ */ React192.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React192.createElement(Tooltip, { title: "Size presets", placement: "top" }, /* @__PURE__ */ React192.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
14593
14699
|
setShowSize(!showSize);
|
|
14594
14700
|
setShowAlign(false);
|
|
14595
|
-
} }, /* @__PURE__ */
|
|
14701
|
+
} }, /* @__PURE__ */ React192.createElement("span", { style: { fontSize: "11px" } }, node.attrs.width || 640, "x", node.attrs.height || 360), /* @__PURE__ */ React192.createElement("span", { className: "dropdown-arrow" }, "\u25BE"))), showSize && /* @__PURE__ */ React192.createElement("div", { className: "img-tool-menu" }, /* @__PURE__ */ React192.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
14596
14702
|
handleResize("small");
|
|
14597
14703
|
setShowSize(false);
|
|
14598
|
-
} }, "Small (320x180)"), /* @__PURE__ */
|
|
14704
|
+
} }, "Small (320x180)"), /* @__PURE__ */ React192.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
14599
14705
|
handleResize("medium");
|
|
14600
14706
|
setShowSize(false);
|
|
14601
|
-
} }, "Medium (480x270)"), /* @__PURE__ */
|
|
14707
|
+
} }, "Medium (480x270)"), /* @__PURE__ */ React192.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
14602
14708
|
handleResize("large");
|
|
14603
14709
|
setShowSize(false);
|
|
14604
|
-
} }, "Large (640x360)"), /* @__PURE__ */
|
|
14710
|
+
} }, "Large (640x360)"), /* @__PURE__ */ React192.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
14605
14711
|
handleResize("full");
|
|
14606
14712
|
setShowSize(false);
|
|
14607
14713
|
} }, "Full (854x480)"))),
|
|
14608
|
-
/* @__PURE__ */
|
|
14714
|
+
/* @__PURE__ */ React192.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React192.createElement(Tooltip, { title: "Horizontal alignment", placement: "top" }, /* @__PURE__ */ React192.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
14609
14715
|
setShowAlign(!showAlign);
|
|
14610
14716
|
setShowSize(false);
|
|
14611
|
-
} }, "\u2630 ", /* @__PURE__ */
|
|
14612
|
-
), showModal && /* @__PURE__ */
|
|
14717
|
+
} }, "\u2630 ", /* @__PURE__ */ React192.createElement("span", { className: "dropdown-arrow" }, "\u25BE"))), showAlign && /* @__PURE__ */ React192.createElement("div", { className: "img-tool-menu" }, ALIGNMENTS2.map((a) => /* @__PURE__ */ React192.createElement("button", { key: a.value, className: "dropdown-item", onClick: () => setAlignmentVal(a.value) }, a.icon, " ", a.label))))
|
|
14718
|
+
), showModal && /* @__PURE__ */ React192.createElement(
|
|
14613
14719
|
VideoPropertiesModal,
|
|
14614
14720
|
{
|
|
14615
14721
|
editor,
|
|
@@ -14624,18 +14730,18 @@ var VideoToolbar = ({ editor }) => {
|
|
|
14624
14730
|
var VideoToolbar_default = VideoToolbar;
|
|
14625
14731
|
|
|
14626
14732
|
// lib/RufousTextEditor/TableToolbar.tsx
|
|
14627
|
-
import
|
|
14733
|
+
import React193, { useState as useState37, useEffect as useEffect30, useRef as useRef33 } from "react";
|
|
14628
14734
|
import { createPortal as createPortal7 } from "react-dom";
|
|
14629
|
-
var IconAddRowBefore = () => /* @__PURE__ */
|
|
14630
|
-
var IconAddRowAfter = () => /* @__PURE__ */
|
|
14631
|
-
var IconAddColBefore = () => /* @__PURE__ */
|
|
14632
|
-
var IconAddColAfter = () => /* @__PURE__ */
|
|
14633
|
-
var IconDeleteRow = () => /* @__PURE__ */
|
|
14634
|
-
var IconDeleteCol = () => /* @__PURE__ */
|
|
14635
|
-
var IconDeleteTable = () => /* @__PURE__ */
|
|
14636
|
-
var IconMergeCells = () => /* @__PURE__ */
|
|
14637
|
-
var IconSplitCell = () => /* @__PURE__ */
|
|
14638
|
-
var IconToggleHeader = () => /* @__PURE__ */
|
|
14735
|
+
var IconAddRowBefore = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-1 8H5V5h14v6zm0 8H5v-6h14v6z" }), /* @__PURE__ */ React193.createElement("path", { d: "M9 6h2v1.5h1.5v2H11V11H9V9.5H7.5v-2H9z" }));
|
|
14736
|
+
var IconAddRowAfter = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-1 8H5V5h14v6zm0 8H5v-6h14v6z" }), /* @__PURE__ */ React193.createElement("path", { d: "M9 14h2v1.5h1.5v2H11V19H9v-1.5H7.5v-2H9z" }));
|
|
14737
|
+
var IconAddColBefore = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-9 16H5V5h6v14zm8 0h-6V5h6v14z" }), /* @__PURE__ */ React193.createElement("path", { d: "M6 10h1.5v2H6v1.5H4v-2h1.5V10H4V8h2z", transform: "translate(2,1)" }));
|
|
14738
|
+
var IconAddColAfter = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-9 16H5V5h6v14zm8 0h-6V5h6v14z" }), /* @__PURE__ */ React193.createElement("path", { d: "M15 9h2v1.5h1.5v2H17V14h-2v-1.5h-1.5v-2H15z" }));
|
|
14739
|
+
var IconDeleteRow = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-1 8H5V5h14v6zm0 8H5v-6h14v6z" }), /* @__PURE__ */ React193.createElement("path", { d: "M8 14.5h8v2H8z" }));
|
|
14740
|
+
var IconDeleteCol = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-9 16H5V5h6v14zm8 0h-6V5h6v14z" }), /* @__PURE__ */ React193.createElement("path", { d: "M14 9.5v6h2v-6z" }));
|
|
14741
|
+
var IconDeleteTable = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zm-1 16H5V5h14v14z" }), /* @__PURE__ */ React193.createElement("path", { d: "M9.17 10l-1.41 1.41L10.59 14l-2.83 2.83 1.41 1.41L12 15.41l2.83 2.83 1.41-1.41L13.41 14l2.83-2.83-1.41-1.41L12 12.59z" }));
|
|
14742
|
+
var IconMergeCells = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M3 3h18v18H3V3zm2 2v5h6V5H5zm8 0v5h6V5h-6zM5 13v6h14v-6H5z" }), /* @__PURE__ */ React193.createElement("path", { d: "M8 15h8v2H8z" }));
|
|
14743
|
+
var IconSplitCell = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M3 3h18v18H3V3zm2 2v5h6V5H5zm8 0v5h6V5h-6zM5 13v6h6v-6H5zm8 0v6h6v-6h-6z" }));
|
|
14744
|
+
var IconToggleHeader = () => /* @__PURE__ */ React193.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React193.createElement("path", { d: "M3 3h18v18H3V3zm2 2v4h14V5H5zm0 6v8h14v-8H5z" }), /* @__PURE__ */ React193.createElement("rect", { x: "5", y: "5", width: "14", height: "4", opacity: "0.4" }));
|
|
14639
14745
|
var TableToolbar = ({ editor }) => {
|
|
14640
14746
|
const [pos, setPos] = useState37(null);
|
|
14641
14747
|
const toolbarRef = useRef33(null);
|
|
@@ -14683,7 +14789,7 @@ var TableToolbar = ({ editor }) => {
|
|
|
14683
14789
|
const canSplit = editor.can().splitCell();
|
|
14684
14790
|
const prevent = (e) => e.preventDefault();
|
|
14685
14791
|
return createPortal7(
|
|
14686
|
-
/* @__PURE__ */
|
|
14792
|
+
/* @__PURE__ */ React193.createElement(
|
|
14687
14793
|
"div",
|
|
14688
14794
|
{
|
|
14689
14795
|
ref: toolbarRef,
|
|
@@ -14691,19 +14797,19 @@ var TableToolbar = ({ editor }) => {
|
|
|
14691
14797
|
style: { top: pos.top, left: pos.left },
|
|
14692
14798
|
onMouseDown: prevent
|
|
14693
14799
|
},
|
|
14694
|
-
/* @__PURE__ */
|
|
14695
|
-
/* @__PURE__ */
|
|
14696
|
-
/* @__PURE__ */
|
|
14697
|
-
/* @__PURE__ */
|
|
14698
|
-
/* @__PURE__ */
|
|
14699
|
-
/* @__PURE__ */
|
|
14700
|
-
/* @__PURE__ */
|
|
14701
|
-
/* @__PURE__ */
|
|
14702
|
-
/* @__PURE__ */
|
|
14703
|
-
/* @__PURE__ */
|
|
14704
|
-
/* @__PURE__ */
|
|
14705
|
-
/* @__PURE__ */
|
|
14706
|
-
/* @__PURE__ */
|
|
14800
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Insert row above", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().addRowBefore().run() }, /* @__PURE__ */ React193.createElement(IconAddRowBefore, null))),
|
|
14801
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Insert row below", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().addRowAfter().run() }, /* @__PURE__ */ React193.createElement(IconAddRowAfter, null))),
|
|
14802
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Delete row", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: "rf-table-toolbar-btn rf-table-toolbar-btn-danger", onClick: () => editor.chain().focus().deleteRow().run() }, /* @__PURE__ */ React193.createElement(IconDeleteRow, null))),
|
|
14803
|
+
/* @__PURE__ */ React193.createElement("span", { className: "rf-table-toolbar-sep" }),
|
|
14804
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Insert column left", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().addColumnBefore().run() }, /* @__PURE__ */ React193.createElement(IconAddColBefore, null))),
|
|
14805
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Insert column right", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().addColumnAfter().run() }, /* @__PURE__ */ React193.createElement(IconAddColAfter, null))),
|
|
14806
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Delete column", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: "rf-table-toolbar-btn rf-table-toolbar-btn-danger", onClick: () => editor.chain().focus().deleteColumn().run() }, /* @__PURE__ */ React193.createElement(IconDeleteCol, null))),
|
|
14807
|
+
/* @__PURE__ */ React193.createElement("span", { className: "rf-table-toolbar-sep" }),
|
|
14808
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Merge cells", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().mergeCells().run(), disabled: !canMerge }, /* @__PURE__ */ React193.createElement(IconMergeCells, null))),
|
|
14809
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Split cell", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: "rf-table-toolbar-btn", onClick: () => editor.chain().focus().splitCell().run(), disabled: !canSplit }, /* @__PURE__ */ React193.createElement(IconSplitCell, null))),
|
|
14810
|
+
/* @__PURE__ */ React193.createElement("span", { className: "rf-table-toolbar-sep" }),
|
|
14811
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Toggle header row", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: `rf-table-toolbar-btn ${editor.isActive("tableHeader") ? "active" : ""}`, onClick: () => editor.chain().focus().toggleHeaderRow().run() }, /* @__PURE__ */ React193.createElement(IconToggleHeader, null))),
|
|
14812
|
+
/* @__PURE__ */ React193.createElement(Tooltip, { title: "Delete table", placement: "top" }, /* @__PURE__ */ React193.createElement("button", { className: "rf-table-toolbar-btn rf-table-toolbar-btn-danger", onClick: () => editor.chain().focus().deleteTable().run() }, /* @__PURE__ */ React193.createElement(IconDeleteTable, null)))
|
|
14707
14813
|
),
|
|
14708
14814
|
document.body
|
|
14709
14815
|
);
|
|
@@ -15150,7 +15256,7 @@ var RufousTextEditor = ({
|
|
|
15150
15256
|
const providerValue = useMemo6(() => ({ editor }), [editor]);
|
|
15151
15257
|
const [isFullscreen, setIsFullscreen] = useState38(false);
|
|
15152
15258
|
const toggleFullscreen = useCallback18(() => setIsFullscreen((prev) => !prev), []);
|
|
15153
|
-
const wrapperJsx = /* @__PURE__ */
|
|
15259
|
+
const wrapperJsx = /* @__PURE__ */ React194.createElement(
|
|
15154
15260
|
"div",
|
|
15155
15261
|
{
|
|
15156
15262
|
ref: wrapperRef,
|
|
@@ -15161,7 +15267,7 @@ var RufousTextEditor = ({
|
|
|
15161
15267
|
...height ? { height: typeof height === "number" ? `${height}px` : height } : {}
|
|
15162
15268
|
}
|
|
15163
15269
|
},
|
|
15164
|
-
/* @__PURE__ */
|
|
15270
|
+
/* @__PURE__ */ React194.createElement(EditorContext.Provider, { value: providerValue }, /* @__PURE__ */ React194.createElement(
|
|
15165
15271
|
Toolbar_default,
|
|
15166
15272
|
{
|
|
15167
15273
|
editor,
|
|
@@ -15176,7 +15282,7 @@ var RufousTextEditor = ({
|
|
|
15176
15282
|
isFullscreen,
|
|
15177
15283
|
onToggleFullscreen: toggleFullscreen
|
|
15178
15284
|
}
|
|
15179
|
-
), /* @__PURE__ */
|
|
15285
|
+
), /* @__PURE__ */ React194.createElement(EditorContent, { editor, className: "editor-content-wrapper" }), /* @__PURE__ */ React194.createElement(ImageToolbar_default, { editor }), /* @__PURE__ */ React194.createElement(VideoToolbar_default, { editor }), /* @__PURE__ */ React194.createElement(TableToolbar_default, { editor }), editor && /* @__PURE__ */ React194.createElement(
|
|
15180
15286
|
BubbleMenu,
|
|
15181
15287
|
{
|
|
15182
15288
|
editor,
|
|
@@ -15194,31 +15300,31 @@ var RufousTextEditor = ({
|
|
|
15194
15300
|
}
|
|
15195
15301
|
}
|
|
15196
15302
|
},
|
|
15197
|
-
/* @__PURE__ */
|
|
15303
|
+
/* @__PURE__ */ React194.createElement(
|
|
15198
15304
|
"button",
|
|
15199
15305
|
{
|
|
15200
15306
|
onClick: () => editor?.chain().focus().toggleBold().run(),
|
|
15201
15307
|
className: editor?.isActive("bold") ? "is-active" : ""
|
|
15202
15308
|
},
|
|
15203
|
-
/* @__PURE__ */
|
|
15309
|
+
/* @__PURE__ */ React194.createElement("strong", null, "B")
|
|
15204
15310
|
),
|
|
15205
|
-
/* @__PURE__ */
|
|
15311
|
+
/* @__PURE__ */ React194.createElement(
|
|
15206
15312
|
"button",
|
|
15207
15313
|
{
|
|
15208
15314
|
onClick: () => editor?.chain().focus().toggleItalic().run(),
|
|
15209
15315
|
className: editor?.isActive("italic") ? "is-active" : ""
|
|
15210
15316
|
},
|
|
15211
|
-
/* @__PURE__ */
|
|
15317
|
+
/* @__PURE__ */ React194.createElement("em", null, "I")
|
|
15212
15318
|
),
|
|
15213
|
-
/* @__PURE__ */
|
|
15319
|
+
/* @__PURE__ */ React194.createElement(
|
|
15214
15320
|
"button",
|
|
15215
15321
|
{
|
|
15216
15322
|
onClick: () => editor?.chain().focus().toggleStrike().run(),
|
|
15217
15323
|
className: editor?.isActive("strike") ? "is-active" : ""
|
|
15218
15324
|
},
|
|
15219
|
-
/* @__PURE__ */
|
|
15325
|
+
/* @__PURE__ */ React194.createElement("s", null, "S")
|
|
15220
15326
|
),
|
|
15221
|
-
/* @__PURE__ */
|
|
15327
|
+
/* @__PURE__ */ React194.createElement(
|
|
15222
15328
|
"button",
|
|
15223
15329
|
{
|
|
15224
15330
|
onClick: () => editor?.chain().focus().toggleCode().run(),
|
|
@@ -15226,7 +15332,7 @@ var RufousTextEditor = ({
|
|
|
15226
15332
|
},
|
|
15227
15333
|
"</>"
|
|
15228
15334
|
),
|
|
15229
|
-
/* @__PURE__ */
|
|
15335
|
+
/* @__PURE__ */ React194.createElement(
|
|
15230
15336
|
"button",
|
|
15231
15337
|
{
|
|
15232
15338
|
onClick: setLink,
|
|
@@ -15234,7 +15340,7 @@ var RufousTextEditor = ({
|
|
|
15234
15340
|
},
|
|
15235
15341
|
"\u{1F517}"
|
|
15236
15342
|
)
|
|
15237
|
-
), editor && /* @__PURE__ */
|
|
15343
|
+
), editor && /* @__PURE__ */ React194.createElement(
|
|
15238
15344
|
FloatingMenu,
|
|
15239
15345
|
{
|
|
15240
15346
|
editor,
|
|
@@ -15249,7 +15355,7 @@ var RufousTextEditor = ({
|
|
|
15249
15355
|
}
|
|
15250
15356
|
}
|
|
15251
15357
|
},
|
|
15252
|
-
/* @__PURE__ */
|
|
15358
|
+
/* @__PURE__ */ React194.createElement(
|
|
15253
15359
|
"button",
|
|
15254
15360
|
{
|
|
15255
15361
|
onClick: () => editor?.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
@@ -15257,7 +15363,7 @@ var RufousTextEditor = ({
|
|
|
15257
15363
|
},
|
|
15258
15364
|
"H1"
|
|
15259
15365
|
),
|
|
15260
|
-
/* @__PURE__ */
|
|
15366
|
+
/* @__PURE__ */ React194.createElement(
|
|
15261
15367
|
"button",
|
|
15262
15368
|
{
|
|
15263
15369
|
onClick: () => editor?.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
@@ -15265,7 +15371,7 @@ var RufousTextEditor = ({
|
|
|
15265
15371
|
},
|
|
15266
15372
|
"H2"
|
|
15267
15373
|
),
|
|
15268
|
-
/* @__PURE__ */
|
|
15374
|
+
/* @__PURE__ */ React194.createElement(
|
|
15269
15375
|
"button",
|
|
15270
15376
|
{
|
|
15271
15377
|
onClick: () => editor?.chain().focus().toggleBulletList().run(),
|
|
@@ -15273,7 +15379,7 @@ var RufousTextEditor = ({
|
|
|
15273
15379
|
},
|
|
15274
15380
|
"\u2022 List"
|
|
15275
15381
|
),
|
|
15276
|
-
/* @__PURE__ */
|
|
15382
|
+
/* @__PURE__ */ React194.createElement(
|
|
15277
15383
|
"button",
|
|
15278
15384
|
{
|
|
15279
15385
|
onClick: () => editor?.chain().focus().toggleOrderedList().run(),
|
|
@@ -15281,7 +15387,7 @@ var RufousTextEditor = ({
|
|
|
15281
15387
|
},
|
|
15282
15388
|
"1. List"
|
|
15283
15389
|
),
|
|
15284
|
-
/* @__PURE__ */
|
|
15390
|
+
/* @__PURE__ */ React194.createElement(
|
|
15285
15391
|
"button",
|
|
15286
15392
|
{
|
|
15287
15393
|
onClick: () => editor?.chain().focus().toggleBlockquote().run(),
|
|
@@ -15289,8 +15395,8 @@ var RufousTextEditor = ({
|
|
|
15289
15395
|
},
|
|
15290
15396
|
"\u201C Quote"
|
|
15291
15397
|
)
|
|
15292
|
-
), /* @__PURE__ */
|
|
15293
|
-
/* @__PURE__ */
|
|
15398
|
+
), /* @__PURE__ */ React194.createElement("div", { className: "status-bar" }, /* @__PURE__ */ React194.createElement("div", { className: "status-bar-left" }, onSaveProp && /* @__PURE__ */ React194.createElement("button", { onClick: handleSave, className: "status-btn save-btn" }, "Save"), onExportProp && /* @__PURE__ */ React194.createElement("button", { onClick: handleExport, className: "status-btn export-btn" }, "Export")), /* @__PURE__ */ React194.createElement("div", { className: "status-bar-right" }, saveStatus && /* @__PURE__ */ React194.createElement("span", { className: "save-status" }, saveStatus), editor && /* @__PURE__ */ React194.createElement(React194.Fragment, null, /* @__PURE__ */ React194.createElement("span", { className: "word-count" }, "CHARS: ", editor.storage.characterCount?.characters?.() ?? editor.getText().length), /* @__PURE__ */ React194.createElement("span", { className: "word-count" }, "WORDS: ", editor.storage.characterCount?.words?.() ?? editor.getText().split(/\s+/).filter(Boolean).length)))), linkModalOpen && createPortal8(
|
|
15399
|
+
/* @__PURE__ */ React194.createElement("div", { className: "link-modal-overlay", onClick: handleLinkCancel }, /* @__PURE__ */ React194.createElement("div", { className: "link-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React194.createElement("div", { className: "link-modal-body" }, /* @__PURE__ */ React194.createElement("div", { className: "link-modal-field" }, /* @__PURE__ */ React194.createElement("label", { className: "link-modal-label" }, "URL"), /* @__PURE__ */ React194.createElement(
|
|
15294
15400
|
"input",
|
|
15295
15401
|
{
|
|
15296
15402
|
type: "url",
|
|
@@ -15303,7 +15409,7 @@ var RufousTextEditor = ({
|
|
|
15303
15409
|
placeholder: "https://example.com",
|
|
15304
15410
|
autoFocus: true
|
|
15305
15411
|
}
|
|
15306
|
-
)), /* @__PURE__ */
|
|
15412
|
+
)), /* @__PURE__ */ React194.createElement("div", { className: "link-modal-field" }, /* @__PURE__ */ React194.createElement("label", { className: "link-modal-label" }, "Text"), /* @__PURE__ */ React194.createElement(
|
|
15307
15413
|
"input",
|
|
15308
15414
|
{
|
|
15309
15415
|
type: "text",
|
|
@@ -15315,24 +15421,24 @@ var RufousTextEditor = ({
|
|
|
15315
15421
|
},
|
|
15316
15422
|
placeholder: "Link text"
|
|
15317
15423
|
}
|
|
15318
|
-
)), /* @__PURE__ */
|
|
15424
|
+
)), /* @__PURE__ */ React194.createElement("div", { className: "link-modal-checkboxes" }, /* @__PURE__ */ React194.createElement("label", { className: "link-modal-checkbox" }, /* @__PURE__ */ React194.createElement(
|
|
15319
15425
|
"input",
|
|
15320
15426
|
{
|
|
15321
15427
|
type: "checkbox",
|
|
15322
15428
|
checked: linkNewTab,
|
|
15323
15429
|
onChange: (e) => setLinkNewTab(e.target.checked)
|
|
15324
15430
|
}
|
|
15325
|
-
), "Open in new tab"), /* @__PURE__ */
|
|
15431
|
+
), "Open in new tab"), /* @__PURE__ */ React194.createElement("label", { className: "link-modal-checkbox" }, /* @__PURE__ */ React194.createElement(
|
|
15326
15432
|
"input",
|
|
15327
15433
|
{
|
|
15328
15434
|
type: "checkbox",
|
|
15329
15435
|
checked: linkNoFollow,
|
|
15330
15436
|
onChange: (e) => setLinkNoFollow(e.target.checked)
|
|
15331
15437
|
}
|
|
15332
|
-
), "No follow"))), /* @__PURE__ */
|
|
15438
|
+
), "No follow"))), /* @__PURE__ */ React194.createElement("div", { className: "link-modal-footer" }, /* @__PURE__ */ React194.createElement("button", { className: "link-modal-btn-unlink", onClick: handleLinkRemove }, "Unlink"), /* @__PURE__ */ React194.createElement("button", { className: "link-modal-btn-apply", onClick: handleLinkSubmit }, "Update")))),
|
|
15333
15439
|
document.body
|
|
15334
15440
|
)),
|
|
15335
|
-
helperText && /* @__PURE__ */
|
|
15441
|
+
helperText && /* @__PURE__ */ React194.createElement("div", { className: `rf-rte-helper-text ${error ? "rf-rte-helper-error" : ""}` }, helperText)
|
|
15336
15442
|
);
|
|
15337
15443
|
return isFullscreen ? createPortal8(wrapperJsx, document.body) : wrapperJsx;
|
|
15338
15444
|
};
|
|
@@ -15343,7 +15449,7 @@ var RufousTextContent = ({ content, className, style, sx }) => {
|
|
|
15343
15449
|
transformedContent = transformLegacyTodos(transformedContent);
|
|
15344
15450
|
} catch {
|
|
15345
15451
|
}
|
|
15346
|
-
return /* @__PURE__ */
|
|
15452
|
+
return /* @__PURE__ */ React194.createElement(
|
|
15347
15453
|
"div",
|
|
15348
15454
|
{
|
|
15349
15455
|
className: `rf-rte-content ${sxClass} ${className || ""}`,
|
|
@@ -15733,6 +15839,13 @@ export {
|
|
|
15733
15839
|
TextField,
|
|
15734
15840
|
textFieldsIcon_default as TextFieldsIcon,
|
|
15735
15841
|
tickIcon_default as TickIcon,
|
|
15842
|
+
Timeline,
|
|
15843
|
+
TimelineConnector,
|
|
15844
|
+
TimelineContent,
|
|
15845
|
+
TimelineDot,
|
|
15846
|
+
TimelineItem,
|
|
15847
|
+
TimelineOppositeContent,
|
|
15848
|
+
TimelineSeparator,
|
|
15736
15849
|
timerIcon_default as TimerIcon,
|
|
15737
15850
|
ToggleButton,
|
|
15738
15851
|
ToggleButtonGroup,
|