@rufous/ui 0.1.87 → 0.1.88
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 +736 -434
- package/dist/main.css +154 -2
- package/dist/main.d.cts +51 -5
- package/dist/main.d.ts +51 -5
- package/dist/main.js +719 -412
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -4080,23 +4080,23 @@ function DataGrid({
|
|
|
4080
4080
|
}, [resolvedColumns]);
|
|
4081
4081
|
const getLeftOffset = (col, idx) => {
|
|
4082
4082
|
if (col.pinned !== "left") return void 0;
|
|
4083
|
-
let
|
|
4083
|
+
let offset2 = 0;
|
|
4084
4084
|
for (let i = 0; i < idx; i++) {
|
|
4085
4085
|
if (visibleColumns[i].pinned === "left") {
|
|
4086
|
-
|
|
4086
|
+
offset2 += columnWidths[String(visibleColumns[i].field)] || 200;
|
|
4087
4087
|
}
|
|
4088
4088
|
}
|
|
4089
|
-
return
|
|
4089
|
+
return offset2;
|
|
4090
4090
|
};
|
|
4091
4091
|
const getRightOffset = (col, idx) => {
|
|
4092
4092
|
if (col.pinned !== "right") return void 0;
|
|
4093
|
-
let
|
|
4093
|
+
let offset2 = 0;
|
|
4094
4094
|
for (let i = visibleColumns.length - 1; i > idx; i--) {
|
|
4095
4095
|
if (visibleColumns[i].pinned === "right") {
|
|
4096
|
-
|
|
4096
|
+
offset2 += columnWidths[String(visibleColumns[i].field)] || 200;
|
|
4097
4097
|
}
|
|
4098
4098
|
}
|
|
4099
|
-
return
|
|
4099
|
+
return offset2;
|
|
4100
4100
|
};
|
|
4101
4101
|
const hasActiveFilters = advancedFilters.some((f) => f.value);
|
|
4102
4102
|
return /* @__PURE__ */ React74.createElement("div", { className: ["dg-root", sxClass, className].filter(Boolean).join(" ") }, /* @__PURE__ */ React74.createElement("div", { className: "dg-header" }, /* @__PURE__ */ React74.createElement("div", { className: "dg-header-info" }, /* @__PURE__ */ React74.createElement("h2", null, title), /* @__PURE__ */ React74.createElement("p", null, filteredData.length, " total records")), /* @__PURE__ */ React74.createElement("div", { className: "dg-header-actions" }, /* @__PURE__ */ React74.createElement("div", { className: "dg-search-wrap" }, /* @__PURE__ */ React74.createElement(Search, { size: 15 }), /* @__PURE__ */ React74.createElement(
|
|
@@ -5345,10 +5345,10 @@ var Radio = React79.forwardRef(function Radio2(props, ref) {
|
|
|
5345
5345
|
const isDisabled = disabledProp !== void 0 ? disabledProp : ctx.disabled ?? false;
|
|
5346
5346
|
const size = sizeProp ?? ctx.size ?? "medium";
|
|
5347
5347
|
const name = nameProp ?? ctx.name;
|
|
5348
|
-
const handleChange = () => {
|
|
5348
|
+
const handleChange = (e) => {
|
|
5349
5349
|
if (!isDisabled) {
|
|
5350
|
-
onChangeProp?.(value);
|
|
5351
|
-
ctx.onChange?.(value);
|
|
5350
|
+
onChangeProp?.(e, value);
|
|
5351
|
+
ctx.onChange?.(e, value);
|
|
5352
5352
|
}
|
|
5353
5353
|
};
|
|
5354
5354
|
const rootClasses = [
|
|
@@ -7446,7 +7446,7 @@ var Menu = ({
|
|
|
7446
7446
|
}, [open]);
|
|
7447
7447
|
useEffect13(() => {
|
|
7448
7448
|
if (!open || !anchorEl || !paperRef.current) return;
|
|
7449
|
-
const
|
|
7449
|
+
const computePosition3 = () => {
|
|
7450
7450
|
if (!anchorEl || !paperRef.current) return;
|
|
7451
7451
|
const anchorRect = anchorEl.getBoundingClientRect();
|
|
7452
7452
|
const menuRect = paperRef.current.getBoundingClientRect();
|
|
@@ -7455,20 +7455,20 @@ var Menu = ({
|
|
|
7455
7455
|
anchorOrigin.vertical,
|
|
7456
7456
|
anchorOrigin.horizontal
|
|
7457
7457
|
);
|
|
7458
|
-
const
|
|
7458
|
+
const offset2 = getTransformOffset(
|
|
7459
7459
|
menuRect,
|
|
7460
7460
|
transformOrigin.vertical,
|
|
7461
7461
|
transformOrigin.horizontal
|
|
7462
7462
|
);
|
|
7463
|
-
let left = anchor.x -
|
|
7464
|
-
let top = anchor.y -
|
|
7463
|
+
let left = anchor.x - offset2.dx;
|
|
7464
|
+
let top = anchor.y - offset2.dy;
|
|
7465
7465
|
const vw = window.innerWidth;
|
|
7466
7466
|
const vh = window.innerHeight;
|
|
7467
7467
|
left = Math.max(8, Math.min(left, vw - menuRect.width - 8));
|
|
7468
7468
|
top = Math.max(8, Math.min(top, vh - menuRect.height - 8));
|
|
7469
7469
|
setMenuStyle({ left, top });
|
|
7470
7470
|
};
|
|
7471
|
-
requestAnimationFrame(
|
|
7471
|
+
requestAnimationFrame(computePosition3);
|
|
7472
7472
|
}, [open, mounted, anchorEl, anchorOrigin, transformOrigin]);
|
|
7473
7473
|
useEffect13(() => {
|
|
7474
7474
|
if (!open) return;
|
|
@@ -7787,8 +7787,8 @@ import React102, {
|
|
|
7787
7787
|
useState as useState21
|
|
7788
7788
|
} from "react";
|
|
7789
7789
|
import ReactDOM5 from "react-dom";
|
|
7790
|
-
function computePopperPosition(anchorRect, popperRect, placement,
|
|
7791
|
-
const [skid, dist] =
|
|
7790
|
+
function computePopperPosition(anchorRect, popperRect, placement, offset2 = [0, 8]) {
|
|
7791
|
+
const [skid, dist] = offset2;
|
|
7792
7792
|
let top = 0;
|
|
7793
7793
|
let left = 0;
|
|
7794
7794
|
switch (placement) {
|
|
@@ -7886,14 +7886,14 @@ var Popper = ({
|
|
|
7886
7886
|
}
|
|
7887
7887
|
}, [open, keepMounted]);
|
|
7888
7888
|
const offsetModifier = modifiers.find((m) => m.name === "offset");
|
|
7889
|
-
const
|
|
7889
|
+
const offset2 = offsetModifier?.options?.offset ?? [0, 8];
|
|
7890
7890
|
useLayoutEffect2(() => {
|
|
7891
7891
|
if (!open || !anchorEl || !popperRef.current) return;
|
|
7892
7892
|
const compute = () => {
|
|
7893
7893
|
if (!anchorEl || !popperRef.current) return;
|
|
7894
7894
|
const anchorRect = anchorEl.getBoundingClientRect();
|
|
7895
7895
|
const popperRect = popperRef.current.getBoundingClientRect();
|
|
7896
|
-
const pos = computePopperPosition(anchorRect, popperRect, placement,
|
|
7896
|
+
const pos = computePopperPosition(anchorRect, popperRect, placement, offset2);
|
|
7897
7897
|
setPosStyle(pos);
|
|
7898
7898
|
};
|
|
7899
7899
|
requestAnimationFrame(compute);
|
|
@@ -7903,7 +7903,7 @@ var Popper = ({
|
|
|
7903
7903
|
window.removeEventListener("scroll", compute, true);
|
|
7904
7904
|
window.removeEventListener("resize", compute);
|
|
7905
7905
|
};
|
|
7906
|
-
}, [open, anchorEl, placement,
|
|
7906
|
+
}, [open, anchorEl, placement, offset2]);
|
|
7907
7907
|
if (!mounted) return null;
|
|
7908
7908
|
const classes = [
|
|
7909
7909
|
"rf-popper",
|
|
@@ -7985,9 +7985,9 @@ var Popover = ({
|
|
|
7985
7985
|
const anchorRect = anchorEl.getBoundingClientRect();
|
|
7986
7986
|
const paperRect = paperRef.current.getBoundingClientRect();
|
|
7987
7987
|
const anchor = getPoint(anchorRect, anchorOrigin.vertical, anchorOrigin.horizontal);
|
|
7988
|
-
const
|
|
7989
|
-
let left = anchor.x -
|
|
7990
|
-
let top = anchor.y -
|
|
7988
|
+
const offset2 = getTransform(paperRect, transformOrigin.vertical, transformOrigin.horizontal);
|
|
7989
|
+
let left = anchor.x - offset2.dx;
|
|
7990
|
+
let top = anchor.y - offset2.dy;
|
|
7991
7991
|
const vw = window.innerWidth;
|
|
7992
7992
|
const vh = window.innerHeight;
|
|
7993
7993
|
left = Math.max(8, Math.min(left, vw - paperRect.width - 8));
|
|
@@ -8334,8 +8334,7 @@ var ImageField = React105.forwardRef(
|
|
|
8334
8334
|
if (!file) return;
|
|
8335
8335
|
const objectUrl = URL.createObjectURL(file);
|
|
8336
8336
|
setPreview(objectUrl);
|
|
8337
|
-
onChange?.(file);
|
|
8338
|
-
e.target.value = "";
|
|
8337
|
+
onChange?.(e, file);
|
|
8339
8338
|
},
|
|
8340
8339
|
[onChange]
|
|
8341
8340
|
);
|
|
@@ -8392,8 +8391,315 @@ var ImageField = React105.forwardRef(
|
|
|
8392
8391
|
);
|
|
8393
8392
|
ImageField.displayName = "ImageField";
|
|
8394
8393
|
|
|
8394
|
+
// lib/PhoneField/PhoneField.tsx
|
|
8395
|
+
import React106, {
|
|
8396
|
+
useState as useState25,
|
|
8397
|
+
useRef as useRef23,
|
|
8398
|
+
useEffect as useEffect19,
|
|
8399
|
+
useCallback as useCallback8,
|
|
8400
|
+
forwardRef as forwardRef10
|
|
8401
|
+
} from "react";
|
|
8402
|
+
import { Country as Country2 } from "country-state-city";
|
|
8403
|
+
import { computePosition as computePosition2, flip, offset, shift, size as floatingSize } from "@floating-ui/dom";
|
|
8404
|
+
function getAllCountries() {
|
|
8405
|
+
return Country2.getAllCountries().map((c) => ({
|
|
8406
|
+
isoCode: c.isoCode,
|
|
8407
|
+
name: c.name,
|
|
8408
|
+
phonecode: c.phonecode.replace("+", ""),
|
|
8409
|
+
flag: c.flag
|
|
8410
|
+
}));
|
|
8411
|
+
}
|
|
8412
|
+
function findCountryByIso(countries, iso) {
|
|
8413
|
+
return countries.find((c) => c.isoCode.toLowerCase() === iso.toLowerCase());
|
|
8414
|
+
}
|
|
8415
|
+
function sanitizeValue(val) {
|
|
8416
|
+
return val.replace(/^\+/, "").replace(/[^0-9]/g, "");
|
|
8417
|
+
}
|
|
8418
|
+
function detectCountryFromValue(countries, digits) {
|
|
8419
|
+
if (!digits) return null;
|
|
8420
|
+
const sorted = [...countries].sort((a, b) => b.phonecode.length - a.phonecode.length);
|
|
8421
|
+
for (const c of sorted) {
|
|
8422
|
+
if (digits.startsWith(c.phonecode)) {
|
|
8423
|
+
return { country: c, phoneNumber: digits.slice(c.phonecode.length) };
|
|
8424
|
+
}
|
|
8425
|
+
}
|
|
8426
|
+
return null;
|
|
8427
|
+
}
|
|
8428
|
+
var PhoneField = forwardRef10(function PhoneField2(props, ref) {
|
|
8429
|
+
const {
|
|
8430
|
+
value = "",
|
|
8431
|
+
onChange,
|
|
8432
|
+
label,
|
|
8433
|
+
variant = "outlined",
|
|
8434
|
+
size = "medium",
|
|
8435
|
+
error = false,
|
|
8436
|
+
helperText,
|
|
8437
|
+
fullWidth = false,
|
|
8438
|
+
disabled = false,
|
|
8439
|
+
required = false,
|
|
8440
|
+
defaultCountry = "us",
|
|
8441
|
+
onlyCountries,
|
|
8442
|
+
countryCodeEditable = true,
|
|
8443
|
+
inputProps,
|
|
8444
|
+
margin = "none",
|
|
8445
|
+
className = "",
|
|
8446
|
+
style,
|
|
8447
|
+
sx
|
|
8448
|
+
} = props;
|
|
8449
|
+
const sxClass = useSx(sx);
|
|
8450
|
+
const containerRef = useRef23(null);
|
|
8451
|
+
const inputRef = useRef23(null);
|
|
8452
|
+
const listRef = useRef23(null);
|
|
8453
|
+
const popupRef = useRef23(null);
|
|
8454
|
+
const inputId = useRef23(`rf-phone-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
8455
|
+
const countries = React106.useMemo(() => {
|
|
8456
|
+
const all = getAllCountries();
|
|
8457
|
+
if (onlyCountries && onlyCountries.length > 0) {
|
|
8458
|
+
return all.filter((c) => onlyCountries.includes(c.isoCode.toLowerCase()));
|
|
8459
|
+
}
|
|
8460
|
+
return all;
|
|
8461
|
+
}, [onlyCountries]);
|
|
8462
|
+
const [selectedCountry, setSelectedCountry] = useState25(() => {
|
|
8463
|
+
const digits2 = sanitizeValue(value);
|
|
8464
|
+
if (digits2) {
|
|
8465
|
+
const detected = detectCountryFromValue(countries, digits2);
|
|
8466
|
+
if (detected) return detected.country;
|
|
8467
|
+
}
|
|
8468
|
+
return findCountryByIso(countries, defaultCountry) || countries[0];
|
|
8469
|
+
});
|
|
8470
|
+
const [open, setOpen] = useState25(false);
|
|
8471
|
+
const [focusedIdx, setFocusedIdx] = useState25(-1);
|
|
8472
|
+
const [search, setSearch] = useState25("");
|
|
8473
|
+
const prevValueRef = useRef23(value);
|
|
8474
|
+
useEffect19(() => {
|
|
8475
|
+
if (value === prevValueRef.current) return;
|
|
8476
|
+
prevValueRef.current = value;
|
|
8477
|
+
const digits2 = sanitizeValue(value);
|
|
8478
|
+
if (!digits2) return;
|
|
8479
|
+
const detected = detectCountryFromValue(countries, digits2);
|
|
8480
|
+
if (detected && detected.country.isoCode !== selectedCountry?.isoCode) {
|
|
8481
|
+
setSelectedCountry(detected.country);
|
|
8482
|
+
}
|
|
8483
|
+
}, [value, countries, selectedCountry?.isoCode]);
|
|
8484
|
+
const dialCode = selectedCountry?.phonecode || "";
|
|
8485
|
+
const digits = sanitizeValue(value);
|
|
8486
|
+
const phoneNumber = digits.startsWith(dialCode) ? digits.slice(dialCode.length) : digits;
|
|
8487
|
+
const openDropdown = useCallback8(() => {
|
|
8488
|
+
if (disabled) return;
|
|
8489
|
+
setOpen(true);
|
|
8490
|
+
setFocusedIdx(-1);
|
|
8491
|
+
setSearch("");
|
|
8492
|
+
}, [disabled]);
|
|
8493
|
+
const closeDropdown = useCallback8(() => {
|
|
8494
|
+
setOpen(false);
|
|
8495
|
+
setFocusedIdx(-1);
|
|
8496
|
+
setSearch("");
|
|
8497
|
+
}, []);
|
|
8498
|
+
useEffect19(() => {
|
|
8499
|
+
if (!open) return;
|
|
8500
|
+
const handler = (e) => {
|
|
8501
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
8502
|
+
closeDropdown();
|
|
8503
|
+
}
|
|
8504
|
+
};
|
|
8505
|
+
document.addEventListener("mousedown", handler);
|
|
8506
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
8507
|
+
}, [open, closeDropdown]);
|
|
8508
|
+
useEffect19(() => {
|
|
8509
|
+
if (!open || !containerRef.current || !popupRef.current) return;
|
|
8510
|
+
const reference = containerRef.current;
|
|
8511
|
+
const floating = popupRef.current;
|
|
8512
|
+
const updatePosition = () => {
|
|
8513
|
+
computePosition2(reference, floating, {
|
|
8514
|
+
placement: "bottom-start",
|
|
8515
|
+
middleware: [
|
|
8516
|
+
offset(4),
|
|
8517
|
+
flip({ padding: 8 }),
|
|
8518
|
+
shift({ padding: 8 }),
|
|
8519
|
+
floatingSize({
|
|
8520
|
+
apply({ availableHeight, elements }) {
|
|
8521
|
+
Object.assign(elements.floating.style, {
|
|
8522
|
+
maxHeight: `${Math.min(280, availableHeight - 8)}px`
|
|
8523
|
+
});
|
|
8524
|
+
},
|
|
8525
|
+
padding: 8
|
|
8526
|
+
})
|
|
8527
|
+
]
|
|
8528
|
+
}).then(({ x, y, placement }) => {
|
|
8529
|
+
Object.assign(floating.style, {
|
|
8530
|
+
left: `${x}px`,
|
|
8531
|
+
top: `${y}px`
|
|
8532
|
+
});
|
|
8533
|
+
floating.dataset.placement = placement;
|
|
8534
|
+
});
|
|
8535
|
+
};
|
|
8536
|
+
updatePosition();
|
|
8537
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
8538
|
+
window.addEventListener("resize", updatePosition);
|
|
8539
|
+
return () => {
|
|
8540
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
8541
|
+
window.removeEventListener("resize", updatePosition);
|
|
8542
|
+
};
|
|
8543
|
+
}, [open]);
|
|
8544
|
+
const selectCountry = useCallback8((country) => {
|
|
8545
|
+
setSelectedCountry(country);
|
|
8546
|
+
closeDropdown();
|
|
8547
|
+
const newValue = "+" + country.phonecode + phoneNumber;
|
|
8548
|
+
onChange?.(newValue, {
|
|
8549
|
+
dialCode: "+" + country.phonecode,
|
|
8550
|
+
countryCode: country.isoCode.toLowerCase(),
|
|
8551
|
+
name: country.name
|
|
8552
|
+
});
|
|
8553
|
+
inputRef.current?.focus();
|
|
8554
|
+
}, [closeDropdown, phoneNumber, onChange]);
|
|
8555
|
+
const handleInputChange = (e) => {
|
|
8556
|
+
const raw = e.target.value.replace(/[^0-9]/g, "");
|
|
8557
|
+
const newValue = "+" + dialCode + raw;
|
|
8558
|
+
onChange?.(newValue, {
|
|
8559
|
+
dialCode: "+" + selectedCountry.phonecode,
|
|
8560
|
+
countryCode: selectedCountry.isoCode.toLowerCase(),
|
|
8561
|
+
name: selectedCountry.name
|
|
8562
|
+
});
|
|
8563
|
+
};
|
|
8564
|
+
const filteredCountries = search ? countries.filter(
|
|
8565
|
+
(c) => c.name.toLowerCase().includes(search.toLowerCase()) || c.phonecode.includes(search) || c.isoCode.toLowerCase().includes(search.toLowerCase())
|
|
8566
|
+
) : countries;
|
|
8567
|
+
const handleDropdownKeyDown = (e) => {
|
|
8568
|
+
if (e.key === "ArrowDown") {
|
|
8569
|
+
e.preventDefault();
|
|
8570
|
+
setFocusedIdx((i) => {
|
|
8571
|
+
const next = Math.min(i + 1, filteredCountries.length - 1);
|
|
8572
|
+
scrollOptionIntoView(next);
|
|
8573
|
+
return next;
|
|
8574
|
+
});
|
|
8575
|
+
} else if (e.key === "ArrowUp") {
|
|
8576
|
+
e.preventDefault();
|
|
8577
|
+
setFocusedIdx((i) => {
|
|
8578
|
+
const next = Math.max(i - 1, 0);
|
|
8579
|
+
scrollOptionIntoView(next);
|
|
8580
|
+
return next;
|
|
8581
|
+
});
|
|
8582
|
+
} else if (e.key === "Enter") {
|
|
8583
|
+
e.preventDefault();
|
|
8584
|
+
if (focusedIdx >= 0 && filteredCountries[focusedIdx]) {
|
|
8585
|
+
selectCountry(filteredCountries[focusedIdx]);
|
|
8586
|
+
}
|
|
8587
|
+
} else if (e.key === "Escape") {
|
|
8588
|
+
closeDropdown();
|
|
8589
|
+
} else if (e.key.length === 1) {
|
|
8590
|
+
setSearch((s2) => s2 + e.key);
|
|
8591
|
+
} else if (e.key === "Backspace") {
|
|
8592
|
+
setSearch((s2) => s2.slice(0, -1));
|
|
8593
|
+
}
|
|
8594
|
+
};
|
|
8595
|
+
const scrollOptionIntoView = (idx) => {
|
|
8596
|
+
requestAnimationFrame(() => {
|
|
8597
|
+
const el = listRef.current?.querySelector(`[data-idx="${idx}"]`);
|
|
8598
|
+
el?.scrollIntoView({ block: "nearest" });
|
|
8599
|
+
});
|
|
8600
|
+
};
|
|
8601
|
+
const isFloating = Boolean(value || phoneNumber);
|
|
8602
|
+
const hasLabel = Boolean(label);
|
|
8603
|
+
const rootClasses = [
|
|
8604
|
+
"rf-text-field",
|
|
8605
|
+
`rf-text-field--${variant}`,
|
|
8606
|
+
`rf-text-field--${size}`,
|
|
8607
|
+
"rf-text-field--primary",
|
|
8608
|
+
error ? "rf-text-field--error" : "",
|
|
8609
|
+
fullWidth ? "rf-text-field--full-width" : "",
|
|
8610
|
+
disabled ? "rf-text-field--disabled" : "",
|
|
8611
|
+
isFloating ? "rf-text-field--floating" : "",
|
|
8612
|
+
hasLabel ? "rf-text-field--has-label" : "",
|
|
8613
|
+
"rf-text-field--adorned-start",
|
|
8614
|
+
"rf-phone-field",
|
|
8615
|
+
open ? "rf-phone-field--open" : "",
|
|
8616
|
+
margin === "normal" ? "rf-phone-field--margin-normal" : "",
|
|
8617
|
+
margin === "dense" ? "rf-phone-field--margin-dense" : "",
|
|
8618
|
+
sxClass,
|
|
8619
|
+
className
|
|
8620
|
+
].filter(Boolean).join(" ");
|
|
8621
|
+
return /* @__PURE__ */ React106.createElement(
|
|
8622
|
+
"div",
|
|
8623
|
+
{
|
|
8624
|
+
ref: (node) => {
|
|
8625
|
+
containerRef.current = node;
|
|
8626
|
+
if (typeof ref === "function") ref(node);
|
|
8627
|
+
else if (ref) ref.current = node;
|
|
8628
|
+
},
|
|
8629
|
+
className: rootClasses,
|
|
8630
|
+
style
|
|
8631
|
+
},
|
|
8632
|
+
/* @__PURE__ */ React106.createElement("div", { className: "rf-text-field__wrapper" }, /* @__PURE__ */ React106.createElement(
|
|
8633
|
+
"div",
|
|
8634
|
+
{
|
|
8635
|
+
className: `rf-phone-field__country-selector ${disabled || !countryCodeEditable ? "rf-phone-field__country-selector--disabled" : ""}`,
|
|
8636
|
+
onClick: () => !disabled && countryCodeEditable && (open ? closeDropdown() : openDropdown()),
|
|
8637
|
+
onKeyDown: open ? handleDropdownKeyDown : void 0,
|
|
8638
|
+
tabIndex: disabled || !countryCodeEditable ? -1 : 0,
|
|
8639
|
+
role: "button",
|
|
8640
|
+
"aria-haspopup": "listbox",
|
|
8641
|
+
"aria-expanded": open,
|
|
8642
|
+
"aria-label": "Select country code"
|
|
8643
|
+
},
|
|
8644
|
+
/* @__PURE__ */ React106.createElement("span", { className: "rf-phone-field__flag" }, selectedCountry?.flag),
|
|
8645
|
+
/* @__PURE__ */ React106.createElement("span", { className: "rf-phone-field__dial-code" }, "+", dialCode)
|
|
8646
|
+
), /* @__PURE__ */ React106.createElement(
|
|
8647
|
+
"input",
|
|
8648
|
+
{
|
|
8649
|
+
ref: inputRef,
|
|
8650
|
+
type: "tel",
|
|
8651
|
+
className: "rf-text-field__input rf-phone-field__input",
|
|
8652
|
+
id: inputId,
|
|
8653
|
+
value: phoneNumber,
|
|
8654
|
+
onChange: handleInputChange,
|
|
8655
|
+
disabled,
|
|
8656
|
+
required,
|
|
8657
|
+
placeholder: " ",
|
|
8658
|
+
maxLength: 15,
|
|
8659
|
+
...inputProps
|
|
8660
|
+
}
|
|
8661
|
+
), hasLabel && /* @__PURE__ */ React106.createElement("label", { htmlFor: inputId, className: "rf-text-field__label" }, label, required && /* @__PURE__ */ React106.createElement("span", { className: "rf-text-field__asterisk" }, " *")), variant === "outlined" && /* @__PURE__ */ React106.createElement("fieldset", { className: "rf-text-field__notch" }, hasLabel ? /* @__PURE__ */ React106.createElement("legend", { className: "rf-text-field__legend" }, /* @__PURE__ */ React106.createElement("span", null, label, required ? " *" : "")) : /* @__PURE__ */ React106.createElement("legend", { className: "rf-text-field__legend--empty" }))),
|
|
8662
|
+
helperText && /* @__PURE__ */ React106.createElement("div", { className: `rf-text-field__helper-text${error ? " rf-text-field__helper-text--error" : ""}` }, helperText),
|
|
8663
|
+
open && !disabled && /* @__PURE__ */ React106.createElement(
|
|
8664
|
+
"div",
|
|
8665
|
+
{
|
|
8666
|
+
ref: popupRef,
|
|
8667
|
+
className: "rf-select__popup rf-phone-field__popup",
|
|
8668
|
+
role: "presentation"
|
|
8669
|
+
},
|
|
8670
|
+
search && /* @__PURE__ */ React106.createElement("div", { className: "rf-phone-field__search-indicator" }, "Search: ", search),
|
|
8671
|
+
/* @__PURE__ */ React106.createElement("ul", { ref: listRef, className: "rf-select__listbox", role: "listbox" }, filteredCountries.map((country, idx) => {
|
|
8672
|
+
const isActive = selectedCountry?.isoCode === country.isoCode;
|
|
8673
|
+
const focused = focusedIdx === idx;
|
|
8674
|
+
return /* @__PURE__ */ React106.createElement(
|
|
8675
|
+
"li",
|
|
8676
|
+
{
|
|
8677
|
+
key: country.isoCode,
|
|
8678
|
+
"data-idx": idx,
|
|
8679
|
+
role: "option",
|
|
8680
|
+
"aria-selected": isActive,
|
|
8681
|
+
className: [
|
|
8682
|
+
"rf-select__option",
|
|
8683
|
+
isActive ? "rf-select__option--selected" : "",
|
|
8684
|
+
focused ? "rf-select__option--focused" : ""
|
|
8685
|
+
].filter(Boolean).join(" "),
|
|
8686
|
+
onMouseEnter: () => setFocusedIdx(idx),
|
|
8687
|
+
onMouseLeave: () => setFocusedIdx(-1),
|
|
8688
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
8689
|
+
onClick: () => selectCountry(country)
|
|
8690
|
+
},
|
|
8691
|
+
/* @__PURE__ */ React106.createElement("span", { className: "rf-phone-field__option-flag" }, country.flag),
|
|
8692
|
+
/* @__PURE__ */ React106.createElement("span", { className: "rf-select__option-label", title: country.name }, country.name),
|
|
8693
|
+
/* @__PURE__ */ React106.createElement("span", { className: "rf-phone-field__option-code" }, "+", country.phonecode)
|
|
8694
|
+
);
|
|
8695
|
+
}), filteredCountries.length === 0 && /* @__PURE__ */ React106.createElement("li", { className: "rf-phone-field__no-results" }, "No countries found"))
|
|
8696
|
+
)
|
|
8697
|
+
);
|
|
8698
|
+
});
|
|
8699
|
+
PhoneField.displayName = "PhoneField";
|
|
8700
|
+
|
|
8395
8701
|
// lib/RufousTextEditor/RufousTextEditor.tsx
|
|
8396
|
-
import
|
|
8702
|
+
import React116, { useMemo as useMemo4, useCallback as useCallback13, useState as useState34 } from "react";
|
|
8397
8703
|
import { useEditor, EditorContent, EditorContext, FloatingMenu, BubbleMenu } from "@tiptap/react";
|
|
8398
8704
|
import StarterKit from "@tiptap/starter-kit";
|
|
8399
8705
|
import Placeholder from "@tiptap/extension-placeholder";
|
|
@@ -8419,16 +8725,16 @@ import { ReactRenderer } from "@tiptap/react";
|
|
|
8419
8725
|
import tippy from "tippy.js";
|
|
8420
8726
|
|
|
8421
8727
|
// lib/RufousTextEditor/MentionList.tsx
|
|
8422
|
-
import
|
|
8423
|
-
var MentionList =
|
|
8424
|
-
const [selectedIndex, setSelectedIndex] =
|
|
8728
|
+
import React107, { forwardRef as forwardRef11, useEffect as useEffect20, useImperativeHandle, useState as useState26 } from "react";
|
|
8729
|
+
var MentionList = forwardRef11((props, ref) => {
|
|
8730
|
+
const [selectedIndex, setSelectedIndex] = useState26(0);
|
|
8425
8731
|
const selectItem = (index) => {
|
|
8426
8732
|
const item = props.items[index];
|
|
8427
8733
|
if (item) {
|
|
8428
8734
|
props.command({ id: item.id, label: item.name });
|
|
8429
8735
|
}
|
|
8430
8736
|
};
|
|
8431
|
-
|
|
8737
|
+
useEffect20(() => setSelectedIndex(0), [props.items]);
|
|
8432
8738
|
useImperativeHandle(ref, () => ({
|
|
8433
8739
|
onKeyDown: ({ event }) => {
|
|
8434
8740
|
if (event.key === "ArrowUp") {
|
|
@@ -8447,17 +8753,17 @@ var MentionList = forwardRef10((props, ref) => {
|
|
|
8447
8753
|
}
|
|
8448
8754
|
}));
|
|
8449
8755
|
if (!props.items.length) {
|
|
8450
|
-
return /* @__PURE__ */
|
|
8756
|
+
return /* @__PURE__ */ React107.createElement("div", { className: "rf-rte-mention-dropdown" }, /* @__PURE__ */ React107.createElement("div", { className: "rf-rte-mention-item rf-rte-mention-no-result" }, "No results"));
|
|
8451
8757
|
}
|
|
8452
|
-
return /* @__PURE__ */
|
|
8758
|
+
return /* @__PURE__ */ React107.createElement("div", { className: "rf-rte-mention-dropdown" }, props.items.map((item, index) => /* @__PURE__ */ React107.createElement(
|
|
8453
8759
|
"button",
|
|
8454
8760
|
{
|
|
8455
8761
|
className: `rf-rte-mention-item ${index === selectedIndex ? "is-selected" : ""}`,
|
|
8456
8762
|
key: item.id,
|
|
8457
8763
|
onClick: () => selectItem(index)
|
|
8458
8764
|
},
|
|
8459
|
-
/* @__PURE__ */
|
|
8460
|
-
/* @__PURE__ */
|
|
8765
|
+
/* @__PURE__ */ React107.createElement("span", { className: "rf-rte-mention-avatar" }, item.avatar || item.name.charAt(0).toUpperCase()),
|
|
8766
|
+
/* @__PURE__ */ React107.createElement("span", { className: "rf-rte-mention-name" }, item.name)
|
|
8461
8767
|
)));
|
|
8462
8768
|
});
|
|
8463
8769
|
MentionList.displayName = "MentionList";
|
|
@@ -8515,20 +8821,20 @@ function createMentionSuggestion(users) {
|
|
|
8515
8821
|
}
|
|
8516
8822
|
|
|
8517
8823
|
// lib/RufousTextEditor/Toolbar.tsx
|
|
8518
|
-
import
|
|
8824
|
+
import React113, { useState as useState31, useRef as useRef27, useEffect as useEffect24, useCallback as useCallback12 } from "react";
|
|
8519
8825
|
|
|
8520
8826
|
// lib/RufousTextEditor/TextToSpeech.tsx
|
|
8521
|
-
import
|
|
8827
|
+
import React108, { useState as useState27, useEffect as useEffect21, useRef as useRef24, useCallback as useCallback9 } from "react";
|
|
8522
8828
|
var TextToSpeech = ({ editor, onTextToSpeech }) => {
|
|
8523
|
-
const [speaking, setSpeaking] =
|
|
8524
|
-
const [paused, setPaused] =
|
|
8525
|
-
const [voices, setVoices] =
|
|
8526
|
-
const [selectedVoice, setSelectedVoice] =
|
|
8527
|
-
const [rate, setRate] =
|
|
8528
|
-
const [showPanel, setShowPanel] =
|
|
8529
|
-
const utteranceRef =
|
|
8530
|
-
const panelRef =
|
|
8531
|
-
|
|
8829
|
+
const [speaking, setSpeaking] = useState27(false);
|
|
8830
|
+
const [paused, setPaused] = useState27(false);
|
|
8831
|
+
const [voices, setVoices] = useState27([]);
|
|
8832
|
+
const [selectedVoice, setSelectedVoice] = useState27("");
|
|
8833
|
+
const [rate, setRate] = useState27(1);
|
|
8834
|
+
const [showPanel, setShowPanel] = useState27(false);
|
|
8835
|
+
const utteranceRef = useRef24(null);
|
|
8836
|
+
const panelRef = useRef24(null);
|
|
8837
|
+
useEffect21(() => {
|
|
8532
8838
|
const loadVoices = async () => {
|
|
8533
8839
|
const available = await window.speechSynthesis.getVoices();
|
|
8534
8840
|
setVoices(available);
|
|
@@ -8543,7 +8849,7 @@ var TextToSpeech = ({ editor, onTextToSpeech }) => {
|
|
|
8543
8849
|
window.speechSynthesis.onvoiceschanged = null;
|
|
8544
8850
|
};
|
|
8545
8851
|
}, []);
|
|
8546
|
-
|
|
8852
|
+
useEffect21(() => {
|
|
8547
8853
|
const handleClick = (e) => {
|
|
8548
8854
|
if (panelRef.current && !panelRef.current.contains(e.target)) {
|
|
8549
8855
|
setShowPanel(false);
|
|
@@ -8552,7 +8858,7 @@ var TextToSpeech = ({ editor, onTextToSpeech }) => {
|
|
|
8552
8858
|
document.addEventListener("mousedown", handleClick);
|
|
8553
8859
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
8554
8860
|
}, []);
|
|
8555
|
-
const getTextToSpeak =
|
|
8861
|
+
const getTextToSpeak = useCallback9(() => {
|
|
8556
8862
|
if (!editor) return "";
|
|
8557
8863
|
const { from, to, empty } = editor.state.selection;
|
|
8558
8864
|
if (!empty) {
|
|
@@ -8560,7 +8866,7 @@ var TextToSpeech = ({ editor, onTextToSpeech }) => {
|
|
|
8560
8866
|
}
|
|
8561
8867
|
return editor.getText();
|
|
8562
8868
|
}, [editor]);
|
|
8563
|
-
const handleSpeak =
|
|
8869
|
+
const handleSpeak = useCallback9(async () => {
|
|
8564
8870
|
const text = getTextToSpeak();
|
|
8565
8871
|
if (!text.trim()) return;
|
|
8566
8872
|
if (onTextToSpeech) {
|
|
@@ -8602,24 +8908,24 @@ var TextToSpeech = ({ editor, onTextToSpeech }) => {
|
|
|
8602
8908
|
setSpeaking(true);
|
|
8603
8909
|
setPaused(false);
|
|
8604
8910
|
}, [getTextToSpeak, voices, selectedVoice, rate, onTextToSpeech]);
|
|
8605
|
-
const handlePause =
|
|
8911
|
+
const handlePause = useCallback9(() => {
|
|
8606
8912
|
if (window.speechSynthesis.speaking && !window.speechSynthesis.paused) {
|
|
8607
8913
|
window.speechSynthesis.pause();
|
|
8608
8914
|
setPaused(true);
|
|
8609
8915
|
}
|
|
8610
8916
|
}, []);
|
|
8611
|
-
const handleResume =
|
|
8917
|
+
const handleResume = useCallback9(() => {
|
|
8612
8918
|
if (window.speechSynthesis.paused) {
|
|
8613
8919
|
window.speechSynthesis.resume();
|
|
8614
8920
|
setPaused(false);
|
|
8615
8921
|
}
|
|
8616
8922
|
}, []);
|
|
8617
|
-
const handleStop =
|
|
8923
|
+
const handleStop = useCallback9(() => {
|
|
8618
8924
|
window.speechSynthesis.cancel();
|
|
8619
8925
|
setSpeaking(false);
|
|
8620
8926
|
setPaused(false);
|
|
8621
8927
|
}, []);
|
|
8622
|
-
return /* @__PURE__ */
|
|
8928
|
+
return /* @__PURE__ */ React108.createElement("div", { className: "tts-wrapper", ref: panelRef }, /* @__PURE__ */ React108.createElement(
|
|
8623
8929
|
"button",
|
|
8624
8930
|
{
|
|
8625
8931
|
className: `toolbar-btn ${speaking ? "is-active" : ""}`,
|
|
@@ -8633,15 +8939,15 @@ var TextToSpeech = ({ editor, onTextToSpeech }) => {
|
|
|
8633
8939
|
title: "Text to Speech"
|
|
8634
8940
|
},
|
|
8635
8941
|
speaking ? "\u23F9" : "\u{1F50A}"
|
|
8636
|
-
), showPanel && !speaking && /* @__PURE__ */
|
|
8942
|
+
), showPanel && !speaking && /* @__PURE__ */ React108.createElement("div", { className: "tts-panel" }, /* @__PURE__ */ React108.createElement("div", { className: "tts-panel-header" }, "Text to Speech"), /* @__PURE__ */ React108.createElement("label", { className: "tts-label" }, "Voice"), /* @__PURE__ */ React108.createElement(
|
|
8637
8943
|
"select",
|
|
8638
8944
|
{
|
|
8639
8945
|
className: "tts-select",
|
|
8640
8946
|
value: selectedVoice,
|
|
8641
8947
|
onChange: (e) => setSelectedVoice(e.target.value)
|
|
8642
8948
|
},
|
|
8643
|
-
voices.map((v) => /* @__PURE__ */
|
|
8644
|
-
), /* @__PURE__ */
|
|
8949
|
+
voices.map((v) => /* @__PURE__ */ React108.createElement("option", { key: v.name, value: v.name }, v.name, " (", v.lang, ")"))
|
|
8950
|
+
), /* @__PURE__ */ React108.createElement("label", { className: "tts-label" }, "Speed: ", rate, "x"), /* @__PURE__ */ React108.createElement(
|
|
8645
8951
|
"input",
|
|
8646
8952
|
{
|
|
8647
8953
|
type: "range",
|
|
@@ -8652,26 +8958,26 @@ var TextToSpeech = ({ editor, onTextToSpeech }) => {
|
|
|
8652
8958
|
value: rate,
|
|
8653
8959
|
onChange: (e) => setRate(Number(e.target.value))
|
|
8654
8960
|
}
|
|
8655
|
-
), /* @__PURE__ */
|
|
8961
|
+
), /* @__PURE__ */ React108.createElement("div", { className: "tts-info" }, editor && !editor.state.selection.empty ? "Will read selected text" : "Will read all editor text"), /* @__PURE__ */ React108.createElement("button", { className: "tts-speak-btn", onClick: () => {
|
|
8656
8962
|
handleSpeak();
|
|
8657
8963
|
setShowPanel(false);
|
|
8658
|
-
} }, "\u25B6 Speak")), speaking && /* @__PURE__ */
|
|
8964
|
+
} }, "\u25B6 Speak")), speaking && /* @__PURE__ */ React108.createElement("div", { className: "tts-controls" }, paused ? /* @__PURE__ */ React108.createElement("button", { className: "toolbar-btn", onClick: handleResume, title: "Resume" }, "\u25B6") : /* @__PURE__ */ React108.createElement("button", { className: "toolbar-btn", onClick: handlePause, title: "Pause" }, "\u275A\u275A"), /* @__PURE__ */ React108.createElement("button", { className: "toolbar-btn", onClick: handleStop, title: "Stop" }, "\u25A0")));
|
|
8659
8965
|
};
|
|
8660
8966
|
var TextToSpeech_default = TextToSpeech;
|
|
8661
8967
|
|
|
8662
8968
|
// lib/RufousTextEditor/SpeechToText.tsx
|
|
8663
|
-
import
|
|
8969
|
+
import React109, { useState as useState28, useRef as useRef25, useCallback as useCallback10, useEffect as useEffect22 } from "react";
|
|
8664
8970
|
var SpeechRecognitionAPI = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
8665
8971
|
var SpeechToText = ({ editor, onSpeechToText }) => {
|
|
8666
|
-
const [listening, setListening] =
|
|
8667
|
-
const [showPanel, setShowPanel] =
|
|
8668
|
-
const [language, setLanguage] =
|
|
8669
|
-
const [interim, setInterim] =
|
|
8670
|
-
const recognitionRef =
|
|
8671
|
-
const panelRef =
|
|
8672
|
-
const isListeningRef =
|
|
8972
|
+
const [listening, setListening] = useState28(false);
|
|
8973
|
+
const [showPanel, setShowPanel] = useState28(false);
|
|
8974
|
+
const [language, setLanguage] = useState28("en-US");
|
|
8975
|
+
const [interim, setInterim] = useState28("");
|
|
8976
|
+
const recognitionRef = useRef25(null);
|
|
8977
|
+
const panelRef = useRef25(null);
|
|
8978
|
+
const isListeningRef = useRef25(false);
|
|
8673
8979
|
const supported = !!SpeechRecognitionAPI;
|
|
8674
|
-
|
|
8980
|
+
useEffect22(() => {
|
|
8675
8981
|
const handleClick = (e) => {
|
|
8676
8982
|
if (panelRef.current && !panelRef.current.contains(e.target)) {
|
|
8677
8983
|
setShowPanel(false);
|
|
@@ -8680,7 +8986,7 @@ var SpeechToText = ({ editor, onSpeechToText }) => {
|
|
|
8680
8986
|
document.addEventListener("mousedown", handleClick);
|
|
8681
8987
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
8682
8988
|
}, []);
|
|
8683
|
-
const createRecognition =
|
|
8989
|
+
const createRecognition = useCallback10(() => {
|
|
8684
8990
|
if (!supported) return null;
|
|
8685
8991
|
const recognition = new SpeechRecognitionAPI();
|
|
8686
8992
|
recognition.lang = language;
|
|
@@ -8689,7 +8995,7 @@ var SpeechToText = ({ editor, onSpeechToText }) => {
|
|
|
8689
8995
|
recognition.maxAlternatives = 1;
|
|
8690
8996
|
return recognition;
|
|
8691
8997
|
}, [supported, language]);
|
|
8692
|
-
const startSession =
|
|
8998
|
+
const startSession = useCallback10((recognition) => {
|
|
8693
8999
|
if (!recognition || !editor) return;
|
|
8694
9000
|
recognition.onresult = async (event) => {
|
|
8695
9001
|
let finalText = "";
|
|
@@ -8744,7 +9050,7 @@ var SpeechToText = ({ editor, onSpeechToText }) => {
|
|
|
8744
9050
|
}
|
|
8745
9051
|
};
|
|
8746
9052
|
}, [editor, createRecognition, onSpeechToText]);
|
|
8747
|
-
const startListening =
|
|
9053
|
+
const startListening = useCallback10(() => {
|
|
8748
9054
|
if (!supported || !editor) return;
|
|
8749
9055
|
const recognition = createRecognition();
|
|
8750
9056
|
if (!recognition) return;
|
|
@@ -8760,7 +9066,7 @@ var SpeechToText = ({ editor, onSpeechToText }) => {
|
|
|
8760
9066
|
setListening(false);
|
|
8761
9067
|
}
|
|
8762
9068
|
}, [supported, editor, createRecognition, startSession]);
|
|
8763
|
-
const stopListening =
|
|
9069
|
+
const stopListening = useCallback10(() => {
|
|
8764
9070
|
isListeningRef.current = false;
|
|
8765
9071
|
if (recognitionRef.current) {
|
|
8766
9072
|
try {
|
|
@@ -8773,7 +9079,7 @@ var SpeechToText = ({ editor, onSpeechToText }) => {
|
|
|
8773
9079
|
setInterim("");
|
|
8774
9080
|
}, []);
|
|
8775
9081
|
if (!supported) {
|
|
8776
|
-
return /* @__PURE__ */
|
|
9082
|
+
return /* @__PURE__ */ React109.createElement("button", { className: "toolbar-btn", disabled: true, title: "Speech recognition not supported in this browser" }, "\u{1F3A4}");
|
|
8777
9083
|
}
|
|
8778
9084
|
const LANGUAGES2 = [
|
|
8779
9085
|
{ code: "en-US", label: "English (US)" },
|
|
@@ -8795,7 +9101,7 @@ var SpeechToText = ({ editor, onSpeechToText }) => {
|
|
|
8795
9101
|
{ code: "kn-IN", label: "Kannada" },
|
|
8796
9102
|
{ code: "ml-IN", label: "Malayalam" }
|
|
8797
9103
|
];
|
|
8798
|
-
return /* @__PURE__ */
|
|
9104
|
+
return /* @__PURE__ */ React109.createElement("div", { className: "stt-wrapper", ref: panelRef }, /* @__PURE__ */ React109.createElement(
|
|
8799
9105
|
"button",
|
|
8800
9106
|
{
|
|
8801
9107
|
className: `toolbar-btn ${listening ? "is-active stt-recording" : ""}`,
|
|
@@ -8809,20 +9115,20 @@ var SpeechToText = ({ editor, onSpeechToText }) => {
|
|
|
8809
9115
|
title: listening ? "Stop recording" : "Speech to Text"
|
|
8810
9116
|
},
|
|
8811
9117
|
"\u{1F3A4}"
|
|
8812
|
-
), showPanel && !listening && /* @__PURE__ */
|
|
9118
|
+
), showPanel && !listening && /* @__PURE__ */ React109.createElement("div", { className: "stt-panel" }, /* @__PURE__ */ React109.createElement("div", { className: "stt-panel-header" }, "Speech to Text"), /* @__PURE__ */ React109.createElement("label", { className: "stt-label" }, "Language"), /* @__PURE__ */ React109.createElement(
|
|
8813
9119
|
"select",
|
|
8814
9120
|
{
|
|
8815
9121
|
className: "stt-select",
|
|
8816
9122
|
value: language,
|
|
8817
9123
|
onChange: (e) => setLanguage(e.target.value)
|
|
8818
9124
|
},
|
|
8819
|
-
LANGUAGES2.map((l) => /* @__PURE__ */
|
|
8820
|
-
), /* @__PURE__ */
|
|
9125
|
+
LANGUAGES2.map((l) => /* @__PURE__ */ React109.createElement("option", { key: l.code, value: l.code }, l.label))
|
|
9126
|
+
), /* @__PURE__ */ React109.createElement("div", { className: "stt-info" }, "Speak into your microphone and the text will be typed into the editor."), /* @__PURE__ */ React109.createElement("button", { className: "stt-start-btn", onClick: startListening }, "\u{1F3A4} Start Listening")), listening && interim && /* @__PURE__ */ React109.createElement("div", { className: "stt-interim" }, interim));
|
|
8821
9127
|
};
|
|
8822
9128
|
var SpeechToText_default = SpeechToText;
|
|
8823
9129
|
|
|
8824
9130
|
// lib/RufousTextEditor/AICommands.tsx
|
|
8825
|
-
import
|
|
9131
|
+
import React110, { useState as useState29, useRef as useRef26, useEffect as useEffect23, useCallback as useCallback11 } from "react";
|
|
8826
9132
|
var AI_COMMANDS = [
|
|
8827
9133
|
{ 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." },
|
|
8828
9134
|
{ id: "shorter", label: "Make shorter", prompt: "Make the following text shorter and more concise while keeping the key points. Return only the shortened text, no explanations." },
|
|
@@ -8869,16 +9175,16 @@ var callOpenAI = async (prompt, text, previousResults = []) => {
|
|
|
8869
9175
|
return data.choices?.[0]?.message?.content?.trim() || "";
|
|
8870
9176
|
};
|
|
8871
9177
|
var AICommands = ({ editor, onAICommand }) => {
|
|
8872
|
-
const [open, setOpen] =
|
|
8873
|
-
const [showModal, setShowModal] =
|
|
8874
|
-
const [loading, setLoading] =
|
|
8875
|
-
const [promptText, setPromptText] =
|
|
8876
|
-
const [resultText, setResultText] =
|
|
8877
|
-
const [originalText, setOriginalText] =
|
|
8878
|
-
const [selectionRange, setSelectionRange] =
|
|
8879
|
-
const [previousResults, setPreviousResults] =
|
|
8880
|
-
const panelRef =
|
|
8881
|
-
|
|
9178
|
+
const [open, setOpen] = useState29(false);
|
|
9179
|
+
const [showModal, setShowModal] = useState29(false);
|
|
9180
|
+
const [loading, setLoading] = useState29(false);
|
|
9181
|
+
const [promptText, setPromptText] = useState29("");
|
|
9182
|
+
const [resultText, setResultText] = useState29("");
|
|
9183
|
+
const [originalText, setOriginalText] = useState29("");
|
|
9184
|
+
const [selectionRange, setSelectionRange] = useState29(null);
|
|
9185
|
+
const [previousResults, setPreviousResults] = useState29([]);
|
|
9186
|
+
const panelRef = useRef26(null);
|
|
9187
|
+
useEffect23(() => {
|
|
8882
9188
|
const handleClick = (e) => {
|
|
8883
9189
|
if (panelRef.current && !panelRef.current.contains(e.target)) {
|
|
8884
9190
|
setOpen(false);
|
|
@@ -8887,7 +9193,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8887
9193
|
document.addEventListener("mousedown", handleClick);
|
|
8888
9194
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
8889
9195
|
}, []);
|
|
8890
|
-
const getSelectedText =
|
|
9196
|
+
const getSelectedText = useCallback11(() => {
|
|
8891
9197
|
if (!editor) return { text: "", range: null };
|
|
8892
9198
|
const { from, to, empty } = editor.state.selection;
|
|
8893
9199
|
if (!empty) {
|
|
@@ -8895,7 +9201,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8895
9201
|
}
|
|
8896
9202
|
return { text: editor.getText(), range: null };
|
|
8897
9203
|
}, [editor]);
|
|
8898
|
-
const fetchAIResult =
|
|
9204
|
+
const fetchAIResult = useCallback11(async (prompt, text, prevResults = []) => {
|
|
8899
9205
|
setLoading(true);
|
|
8900
9206
|
setResultText("");
|
|
8901
9207
|
try {
|
|
@@ -8913,7 +9219,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8913
9219
|
setLoading(false);
|
|
8914
9220
|
}
|
|
8915
9221
|
}, [onAICommand]);
|
|
8916
|
-
const handleCommandSelect =
|
|
9222
|
+
const handleCommandSelect = useCallback11((command) => {
|
|
8917
9223
|
const { text, range } = getSelectedText();
|
|
8918
9224
|
if (!text.trim()) return;
|
|
8919
9225
|
setOriginalText(text);
|
|
@@ -8924,7 +9230,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8924
9230
|
setShowModal(true);
|
|
8925
9231
|
fetchAIResult(command.prompt, text, []);
|
|
8926
9232
|
}, [getSelectedText, fetchAIResult]);
|
|
8927
|
-
const handleInsert =
|
|
9233
|
+
const handleInsert = useCallback11(() => {
|
|
8928
9234
|
if (!resultText || !editor) return;
|
|
8929
9235
|
if (selectionRange) {
|
|
8930
9236
|
editor.chain().focus().deleteRange(selectionRange).insertContentAt(selectionRange.from, resultText).run();
|
|
@@ -8934,7 +9240,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8934
9240
|
setShowModal(false);
|
|
8935
9241
|
setResultText("");
|
|
8936
9242
|
}, [editor, resultText, selectionRange]);
|
|
8937
|
-
const handleInsertAfter =
|
|
9243
|
+
const handleInsertAfter = useCallback11(() => {
|
|
8938
9244
|
if (!resultText || !editor) return;
|
|
8939
9245
|
if (selectionRange) {
|
|
8940
9246
|
editor.chain().focus().insertContentAt(selectionRange.to, "\n" + resultText).run();
|
|
@@ -8949,11 +9255,11 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8949
9255
|
setShowModal(false);
|
|
8950
9256
|
setResultText("");
|
|
8951
9257
|
}, [editor, resultText, selectionRange]);
|
|
8952
|
-
const handleRefresh =
|
|
9258
|
+
const handleRefresh = useCallback11(() => {
|
|
8953
9259
|
if (!originalText.trim()) return;
|
|
8954
9260
|
fetchAIResult(promptText, originalText, previousResults);
|
|
8955
9261
|
}, [originalText, promptText, previousResults, fetchAIResult]);
|
|
8956
|
-
const handleCancel =
|
|
9262
|
+
const handleCancel = useCallback11(() => {
|
|
8957
9263
|
setShowModal(false);
|
|
8958
9264
|
setResultText("");
|
|
8959
9265
|
setPromptText("");
|
|
@@ -8962,16 +9268,16 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8962
9268
|
setPreviousResults([]);
|
|
8963
9269
|
}, []);
|
|
8964
9270
|
if (!editor) return null;
|
|
8965
|
-
return /* @__PURE__ */
|
|
9271
|
+
return /* @__PURE__ */ React110.createElement(React110.Fragment, null, /* @__PURE__ */ React110.createElement("div", { className: "ai-commands-wrapper", ref: panelRef }, /* @__PURE__ */ React110.createElement(
|
|
8966
9272
|
"button",
|
|
8967
9273
|
{
|
|
8968
9274
|
className: `toolbar-btn ${open ? "is-active" : ""}`,
|
|
8969
9275
|
onClick: () => setOpen(!open),
|
|
8970
9276
|
title: "AI Commands"
|
|
8971
9277
|
},
|
|
8972
|
-
/* @__PURE__ */
|
|
8973
|
-
/* @__PURE__ */
|
|
8974
|
-
), open && /* @__PURE__ */
|
|
9278
|
+
/* @__PURE__ */ React110.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", stroke: "none" }, /* @__PURE__ */ React110.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" })),
|
|
9279
|
+
/* @__PURE__ */ React110.createElement("span", { className: "dropdown-arrow" }, "\u25BE")
|
|
9280
|
+
), open && /* @__PURE__ */ React110.createElement("div", { className: "ai-commands-panel" }, /* @__PURE__ */ React110.createElement("div", { className: "ai-commands-header" }, "AI Commands"), /* @__PURE__ */ React110.createElement("div", { className: "ai-commands-list" }, AI_COMMANDS.map((cmd) => /* @__PURE__ */ React110.createElement(
|
|
8975
9281
|
"button",
|
|
8976
9282
|
{
|
|
8977
9283
|
key: cmd.id,
|
|
@@ -8979,7 +9285,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8979
9285
|
onClick: () => handleCommandSelect(cmd)
|
|
8980
9286
|
},
|
|
8981
9287
|
cmd.label
|
|
8982
|
-
))), /* @__PURE__ */
|
|
9288
|
+
))), /* @__PURE__ */ React110.createElement("div", { className: "ai-commands-hint" }, editor.state.selection.empty ? "Will apply to all text" : "Will apply to selected text"))), showModal && /* @__PURE__ */ React110.createElement("div", { className: "ai-modal-overlay", onMouseDown: handleCancel }, /* @__PURE__ */ React110.createElement("div", { className: "ai-modal", onMouseDown: (e) => e.stopPropagation() }, /* @__PURE__ */ React110.createElement("div", { className: "ai-modal-header" }, /* @__PURE__ */ React110.createElement("span", { className: "ai-modal-title" }, "AI Assistant"), /* @__PURE__ */ React110.createElement("button", { className: "ai-modal-close", onClick: handleCancel }, "\xD7")), /* @__PURE__ */ React110.createElement("div", { className: "ai-modal-prompt-section" }, /* @__PURE__ */ React110.createElement("label", { className: "ai-modal-label" }, "Prompt"), /* @__PURE__ */ React110.createElement("div", { className: "ai-modal-prompt-row" }, /* @__PURE__ */ React110.createElement(
|
|
8983
9289
|
"textarea",
|
|
8984
9290
|
{
|
|
8985
9291
|
className: "ai-modal-prompt",
|
|
@@ -8987,7 +9293,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8987
9293
|
onChange: (e) => setPromptText(e.target.value),
|
|
8988
9294
|
rows: 3
|
|
8989
9295
|
}
|
|
8990
|
-
), /* @__PURE__ */
|
|
9296
|
+
), /* @__PURE__ */ React110.createElement(
|
|
8991
9297
|
"button",
|
|
8992
9298
|
{
|
|
8993
9299
|
className: "ai-modal-robot-btn",
|
|
@@ -8995,8 +9301,8 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
8995
9301
|
disabled: loading,
|
|
8996
9302
|
title: "Run with custom prompt"
|
|
8997
9303
|
},
|
|
8998
|
-
/* @__PURE__ */
|
|
8999
|
-
))), /* @__PURE__ */
|
|
9304
|
+
/* @__PURE__ */ React110.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React110.createElement("rect", { x: "3", y: "11", width: "18", height: "10", rx: "2" }), /* @__PURE__ */ React110.createElement("circle", { cx: "9", cy: "16", r: "1" }), /* @__PURE__ */ React110.createElement("circle", { cx: "15", cy: "16", r: "1" }), /* @__PURE__ */ React110.createElement("path", { d: "M12 2v4" }), /* @__PURE__ */ React110.createElement("path", { d: "M8 7h8" }))
|
|
9305
|
+
))), /* @__PURE__ */ React110.createElement("div", { className: "ai-modal-actions" }, /* @__PURE__ */ React110.createElement(
|
|
9000
9306
|
"button",
|
|
9001
9307
|
{
|
|
9002
9308
|
className: "ai-modal-action-btn ai-modal-insert-btn",
|
|
@@ -9004,7 +9310,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
9004
9310
|
disabled: loading || !resultText
|
|
9005
9311
|
},
|
|
9006
9312
|
"Insert"
|
|
9007
|
-
), /* @__PURE__ */
|
|
9313
|
+
), /* @__PURE__ */ React110.createElement(
|
|
9008
9314
|
"button",
|
|
9009
9315
|
{
|
|
9010
9316
|
className: "ai-modal-action-btn ai-modal-insert-after-btn ms-2",
|
|
@@ -9012,7 +9318,7 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
9012
9318
|
disabled: loading || !resultText
|
|
9013
9319
|
},
|
|
9014
9320
|
"Insert After"
|
|
9015
|
-
), /* @__PURE__ */
|
|
9321
|
+
), /* @__PURE__ */ React110.createElement(
|
|
9016
9322
|
"button",
|
|
9017
9323
|
{
|
|
9018
9324
|
className: "ai-modal-action-btn ai-modal-refresh-btn",
|
|
@@ -9020,13 +9326,13 @@ var AICommands = ({ editor, onAICommand }) => {
|
|
|
9020
9326
|
disabled: loading,
|
|
9021
9327
|
title: "Generate another response"
|
|
9022
9328
|
},
|
|
9023
|
-
/* @__PURE__ */
|
|
9024
|
-
)), /* @__PURE__ */
|
|
9329
|
+
/* @__PURE__ */ React110.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React110.createElement("path", { d: "M21 2v6h-6" }), /* @__PURE__ */ React110.createElement("path", { d: "M3 12a9 9 0 0 1 15-6.7L21 8" }), /* @__PURE__ */ React110.createElement("path", { d: "M3 22v-6h6" }), /* @__PURE__ */ React110.createElement("path", { d: "M21 12a9 9 0 0 1-15 6.7L3 16" }))
|
|
9330
|
+
)), /* @__PURE__ */ React110.createElement("div", { className: "ai-modal-result-section" }, loading ? /* @__PURE__ */ React110.createElement("div", { className: "ai-modal-loading" }, /* @__PURE__ */ React110.createElement("span", { className: "ai-spinner" }), /* @__PURE__ */ React110.createElement("span", null, "Generating response...")) : /* @__PURE__ */ React110.createElement("div", { className: "ai-modal-result" }, resultText)), /* @__PURE__ */ React110.createElement("div", { className: "ai-modal-footer" }, /* @__PURE__ */ React110.createElement("button", { className: "ai-modal-cancel-btn", onClick: handleCancel }, "CANCEL")))));
|
|
9025
9331
|
};
|
|
9026
9332
|
var AICommands_default = AICommands;
|
|
9027
9333
|
|
|
9028
9334
|
// lib/RufousTextEditor/TranslateModal.tsx
|
|
9029
|
-
import
|
|
9335
|
+
import React111, { useState as useState30, useMemo as useMemo3 } from "react";
|
|
9030
9336
|
var LANGUAGES = [
|
|
9031
9337
|
{ code: "af", name: "Afrikaans" },
|
|
9032
9338
|
{ code: "sq", name: "Albanian" },
|
|
@@ -9165,12 +9471,12 @@ async function translateText(text, sourceLang, targetLang) {
|
|
|
9165
9471
|
return null;
|
|
9166
9472
|
}
|
|
9167
9473
|
var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarget, onLangChange }) => {
|
|
9168
|
-
const [sourceLang, setSourceLang] =
|
|
9169
|
-
const [targetLang, setTargetLang] =
|
|
9170
|
-
const [sourceFilter, setSourceFilter] =
|
|
9171
|
-
const [targetFilter, setTargetFilter] =
|
|
9172
|
-
const [translating, setTranslating] =
|
|
9173
|
-
const [error, setError] =
|
|
9474
|
+
const [sourceLang, setSourceLang] = useState30(initialSource || "en");
|
|
9475
|
+
const [targetLang, setTargetLang] = useState30(initialTarget || "hi");
|
|
9476
|
+
const [sourceFilter, setSourceFilter] = useState30("");
|
|
9477
|
+
const [targetFilter, setTargetFilter] = useState30("");
|
|
9478
|
+
const [translating, setTranslating] = useState30(false);
|
|
9479
|
+
const [error, setError] = useState30("");
|
|
9174
9480
|
const filteredSource = useMemo3(() => LANGUAGES.filter(
|
|
9175
9481
|
(l) => l.name.toLowerCase().includes(sourceFilter.toLowerCase()) || l.code.toLowerCase().includes(sourceFilter.toLowerCase())
|
|
9176
9482
|
), [sourceFilter]);
|
|
@@ -9217,7 +9523,7 @@ var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarg
|
|
|
9217
9523
|
setTranslating(false);
|
|
9218
9524
|
}
|
|
9219
9525
|
};
|
|
9220
|
-
return /* @__PURE__ */
|
|
9526
|
+
return /* @__PURE__ */ React111.createElement("div", { className: "modal-overlay", onClick: onClose }, /* @__PURE__ */ React111.createElement("div", { className: "modal-content translate-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React111.createElement("div", { className: "modal-header" }, /* @__PURE__ */ React111.createElement("h3", null, "Translate options"), /* @__PURE__ */ React111.createElement("button", { className: "modal-close", onClick: onClose }, "\xD7")), /* @__PURE__ */ React111.createElement("div", { className: "modal-body" }, /* @__PURE__ */ React111.createElement("div", { className: "translate-columns" }, /* @__PURE__ */ React111.createElement("div", { className: "translate-col" }, /* @__PURE__ */ React111.createElement("div", { className: "translate-filter" }, /* @__PURE__ */ React111.createElement(
|
|
9221
9527
|
"input",
|
|
9222
9528
|
{
|
|
9223
9529
|
type: "text",
|
|
@@ -9226,16 +9532,16 @@ var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarg
|
|
|
9226
9532
|
onChange: (e) => setSourceFilter(e.target.value),
|
|
9227
9533
|
className: "translate-filter-input"
|
|
9228
9534
|
}
|
|
9229
|
-
)), /* @__PURE__ */
|
|
9535
|
+
)), /* @__PURE__ */ React111.createElement("div", { className: "translate-list" }, filteredSource.map((lang) => /* @__PURE__ */ React111.createElement(
|
|
9230
9536
|
"button",
|
|
9231
9537
|
{
|
|
9232
9538
|
key: lang.code,
|
|
9233
9539
|
className: `translate-item ${sourceLang === lang.code ? "active" : ""}`,
|
|
9234
9540
|
onClick: () => setSourceLang(lang.code)
|
|
9235
9541
|
},
|
|
9236
|
-
/* @__PURE__ */
|
|
9237
|
-
/* @__PURE__ */
|
|
9238
|
-
)))), /* @__PURE__ */
|
|
9542
|
+
/* @__PURE__ */ React111.createElement("span", { className: "translate-code" }, lang.code),
|
|
9543
|
+
/* @__PURE__ */ React111.createElement("span", { className: "translate-name" }, lang.name)
|
|
9544
|
+
)))), /* @__PURE__ */ React111.createElement("div", { className: "translate-swap" }, /* @__PURE__ */ React111.createElement("button", { className: "translate-swap-btn", onClick: handleSwap, title: "Swap languages" }, "\u21C4")), /* @__PURE__ */ React111.createElement("div", { className: "translate-col" }, /* @__PURE__ */ React111.createElement("div", { className: "translate-filter" }, /* @__PURE__ */ React111.createElement(
|
|
9239
9545
|
"input",
|
|
9240
9546
|
{
|
|
9241
9547
|
type: "text",
|
|
@@ -9244,16 +9550,16 @@ var TranslateModal = ({ editor, onClose, onTranslate, initialSource, initialTarg
|
|
|
9244
9550
|
onChange: (e) => setTargetFilter(e.target.value),
|
|
9245
9551
|
className: "translate-filter-input"
|
|
9246
9552
|
}
|
|
9247
|
-
)), /* @__PURE__ */
|
|
9553
|
+
)), /* @__PURE__ */ React111.createElement("div", { className: "translate-list" }, filteredTarget.map((lang) => /* @__PURE__ */ React111.createElement(
|
|
9248
9554
|
"button",
|
|
9249
9555
|
{
|
|
9250
9556
|
key: lang.code,
|
|
9251
9557
|
className: `translate-item ${targetLang === lang.code ? "active" : ""}`,
|
|
9252
9558
|
onClick: () => setTargetLang(lang.code)
|
|
9253
9559
|
},
|
|
9254
|
-
/* @__PURE__ */
|
|
9255
|
-
/* @__PURE__ */
|
|
9256
|
-
))))), error && /* @__PURE__ */
|
|
9560
|
+
/* @__PURE__ */ React111.createElement("span", { className: "translate-code" }, lang.code),
|
|
9561
|
+
/* @__PURE__ */ React111.createElement("span", { className: "translate-name" }, lang.name)
|
|
9562
|
+
))))), error && /* @__PURE__ */ React111.createElement("div", { className: "translate-error" }, error)), /* @__PURE__ */ React111.createElement("div", { className: "modal-footer" }, /* @__PURE__ */ React111.createElement("div", { className: "modal-footer-left" }, /* @__PURE__ */ React111.createElement("button", { className: "modal-btn-cancel", onClick: onClose }, "\xD7 Cancel")), /* @__PURE__ */ React111.createElement("button", { className: "modal-btn-apply", onClick: handleSave, disabled: translating }, translating ? "Translating..." : "\u2714 Save"))));
|
|
9257
9563
|
};
|
|
9258
9564
|
var TranslateModal_default = TranslateModal;
|
|
9259
9565
|
|
|
@@ -9610,9 +9916,9 @@ var Fragment = class _Fragment {
|
|
|
9610
9916
|
};
|
|
9611
9917
|
Fragment.empty = new Fragment([], 0);
|
|
9612
9918
|
var found = { index: 0, offset: 0 };
|
|
9613
|
-
function retIndex(index,
|
|
9919
|
+
function retIndex(index, offset2) {
|
|
9614
9920
|
found.index = index;
|
|
9615
|
-
found.offset =
|
|
9921
|
+
found.offset = offset2;
|
|
9616
9922
|
return found;
|
|
9617
9923
|
}
|
|
9618
9924
|
function compareDeep(a, b) {
|
|
@@ -9850,25 +10156,25 @@ var Slice = class _Slice {
|
|
|
9850
10156
|
};
|
|
9851
10157
|
Slice.empty = new Slice(Fragment.empty, 0, 0);
|
|
9852
10158
|
function removeRange(content, from, to) {
|
|
9853
|
-
let { index, offset } = content.findIndex(from), child = content.maybeChild(index);
|
|
10159
|
+
let { index, offset: offset2 } = content.findIndex(from), child = content.maybeChild(index);
|
|
9854
10160
|
let { index: indexTo, offset: offsetTo } = content.findIndex(to);
|
|
9855
|
-
if (
|
|
10161
|
+
if (offset2 == from || child.isText) {
|
|
9856
10162
|
if (offsetTo != to && !content.child(indexTo).isText)
|
|
9857
10163
|
throw new RangeError("Removing non-flat range");
|
|
9858
10164
|
return content.cut(0, from).append(content.cut(to));
|
|
9859
10165
|
}
|
|
9860
10166
|
if (index != indexTo)
|
|
9861
10167
|
throw new RangeError("Removing non-flat range");
|
|
9862
|
-
return content.replaceChild(index, child.copy(removeRange(child.content, from -
|
|
10168
|
+
return content.replaceChild(index, child.copy(removeRange(child.content, from - offset2 - 1, to - offset2 - 1)));
|
|
9863
10169
|
}
|
|
9864
10170
|
function insertInto(content, dist, insert, parent) {
|
|
9865
|
-
let { index, offset } = content.findIndex(dist), child = content.maybeChild(index);
|
|
9866
|
-
if (
|
|
10171
|
+
let { index, offset: offset2 } = content.findIndex(dist), child = content.maybeChild(index);
|
|
10172
|
+
if (offset2 == dist || child.isText) {
|
|
9867
10173
|
if (parent && !parent.canReplace(index, index, insert))
|
|
9868
10174
|
return null;
|
|
9869
10175
|
return content.cut(0, dist).append(insert).append(content.cut(dist));
|
|
9870
10176
|
}
|
|
9871
|
-
let inner = insertInto(child.content, dist -
|
|
10177
|
+
let inner = insertInto(child.content, dist - offset2 - 1, insert, child);
|
|
9872
10178
|
return inner && content.replaceChild(index, child.copy(inner));
|
|
9873
10179
|
}
|
|
9874
10180
|
function replace($from, $to, slice) {
|
|
@@ -10210,16 +10516,16 @@ var ResolvedPos = class _ResolvedPos {
|
|
|
10210
10516
|
let path = [];
|
|
10211
10517
|
let start = 0, parentOffset = pos;
|
|
10212
10518
|
for (let node = doc; ; ) {
|
|
10213
|
-
let { index, offset } = node.content.findIndex(parentOffset);
|
|
10214
|
-
let rem = parentOffset -
|
|
10215
|
-
path.push(node, index, start +
|
|
10519
|
+
let { index, offset: offset2 } = node.content.findIndex(parentOffset);
|
|
10520
|
+
let rem = parentOffset - offset2;
|
|
10521
|
+
path.push(node, index, start + offset2);
|
|
10216
10522
|
if (!rem)
|
|
10217
10523
|
break;
|
|
10218
10524
|
node = node.child(index);
|
|
10219
10525
|
if (node.isText)
|
|
10220
10526
|
break;
|
|
10221
10527
|
parentOffset = rem - 1;
|
|
10222
|
-
start +=
|
|
10528
|
+
start += offset2 + 1;
|
|
10223
10529
|
}
|
|
10224
10530
|
return new _ResolvedPos(pos, path, parentOffset);
|
|
10225
10531
|
}
|
|
@@ -10471,13 +10777,13 @@ var Node = class _Node {
|
|
|
10471
10777
|
*/
|
|
10472
10778
|
nodeAt(pos) {
|
|
10473
10779
|
for (let node = this; ; ) {
|
|
10474
|
-
let { index, offset } = node.content.findIndex(pos);
|
|
10780
|
+
let { index, offset: offset2 } = node.content.findIndex(pos);
|
|
10475
10781
|
node = node.maybeChild(index);
|
|
10476
10782
|
if (!node)
|
|
10477
10783
|
return null;
|
|
10478
|
-
if (
|
|
10784
|
+
if (offset2 == pos || node.isText)
|
|
10479
10785
|
return node;
|
|
10480
|
-
pos -=
|
|
10786
|
+
pos -= offset2 + 1;
|
|
10481
10787
|
}
|
|
10482
10788
|
}
|
|
10483
10789
|
/**
|
|
@@ -10486,8 +10792,8 @@ var Node = class _Node {
|
|
|
10486
10792
|
node.
|
|
10487
10793
|
*/
|
|
10488
10794
|
childAfter(pos) {
|
|
10489
|
-
let { index, offset } = this.content.findIndex(pos);
|
|
10490
|
-
return { node: this.content.maybeChild(index), index, offset };
|
|
10795
|
+
let { index, offset: offset2 } = this.content.findIndex(pos);
|
|
10796
|
+
return { node: this.content.maybeChild(index), index, offset: offset2 };
|
|
10491
10797
|
}
|
|
10492
10798
|
/**
|
|
10493
10799
|
Find the (direct) child node before the given offset, if any,
|
|
@@ -10497,11 +10803,11 @@ var Node = class _Node {
|
|
|
10497
10803
|
childBefore(pos) {
|
|
10498
10804
|
if (pos == 0)
|
|
10499
10805
|
return { node: null, index: 0, offset: 0 };
|
|
10500
|
-
let { index, offset } = this.content.findIndex(pos);
|
|
10501
|
-
if (
|
|
10502
|
-
return { node: this.content.child(index), index, offset };
|
|
10806
|
+
let { index, offset: offset2 } = this.content.findIndex(pos);
|
|
10807
|
+
if (offset2 < pos)
|
|
10808
|
+
return { node: this.content.child(index), index, offset: offset2 };
|
|
10503
10809
|
let node = this.content.child(index - 1);
|
|
10504
|
-
return { node, index: index - 1, offset:
|
|
10810
|
+
return { node, index: index - 1, offset: offset2 - node.nodeSize };
|
|
10505
10811
|
}
|
|
10506
10812
|
/**
|
|
10507
10813
|
Resolve the given position in the document, returning an
|
|
@@ -11106,8 +11412,8 @@ function checkForDeadEnds(match, stream) {
|
|
|
11106
11412
|
// node_modules/prosemirror-transform/dist/index.js
|
|
11107
11413
|
var lower16 = 65535;
|
|
11108
11414
|
var factor16 = Math.pow(2, 16);
|
|
11109
|
-
function makeRecover(index,
|
|
11110
|
-
return index +
|
|
11415
|
+
function makeRecover(index, offset2) {
|
|
11416
|
+
return index + offset2 * factor16;
|
|
11111
11417
|
}
|
|
11112
11418
|
function recoverIndex(value) {
|
|
11113
11419
|
return value & lower16;
|
|
@@ -12606,37 +12912,37 @@ var CustomTaskItem = TaskItem.extend({
|
|
|
12606
12912
|
});
|
|
12607
12913
|
|
|
12608
12914
|
// lib/RufousTextEditor/icons.tsx
|
|
12609
|
-
import * as
|
|
12915
|
+
import * as React112 from "react";
|
|
12610
12916
|
var s = { width: 20, height: 20, viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg" };
|
|
12611
|
-
var IconUndo = () => /* @__PURE__ */
|
|
12612
|
-
var IconRedo = () => /* @__PURE__ */
|
|
12613
|
-
var IconBold = () => /* @__PURE__ */
|
|
12614
|
-
var IconItalic = () => /* @__PURE__ */
|
|
12615
|
-
var IconLink = () => /* @__PURE__ */
|
|
12616
|
-
var IconStrike = () => /* @__PURE__ */
|
|
12617
|
-
var IconHeading = () => /* @__PURE__ */
|
|
12618
|
-
var IconFontSize = () => /* @__PURE__ */
|
|
12619
|
-
var IconColor = () => /* @__PURE__ */
|
|
12620
|
-
var IconFont = () => /* @__PURE__ */
|
|
12621
|
-
var IconLineHeight = () => /* @__PURE__ */
|
|
12622
|
-
var IconBulletList = () => /* @__PURE__ */
|
|
12623
|
-
var IconOrderedList = () => /* @__PURE__ */
|
|
12624
|
-
var IconAlignLeft = () => /* @__PURE__ */
|
|
12625
|
-
var IconAlignCenter = () => /* @__PURE__ */
|
|
12626
|
-
var IconAlignRight = () => /* @__PURE__ */
|
|
12627
|
-
var IconAlignJustify = () => /* @__PURE__ */
|
|
12628
|
-
var IconIndentIncrease = () => /* @__PURE__ */
|
|
12629
|
-
var IconIndentDecrease = () => /* @__PURE__ */
|
|
12630
|
-
var IconTable = () => /* @__PURE__ */
|
|
12631
|
-
var IconImage = () => /* @__PURE__ */
|
|
12632
|
-
var IconVideo = () => /* @__PURE__ */
|
|
12633
|
-
var IconCut = () => /* @__PURE__ */
|
|
12634
|
-
var IconCopy = () => /* @__PURE__ */
|
|
12635
|
-
var IconCode = () => /* @__PURE__ */
|
|
12636
|
-
var IconFullscreen = () => /* @__PURE__ */
|
|
12637
|
-
var IconTranslate = () => /* @__PURE__ */
|
|
12638
|
-
var IconTaskList = () => /* @__PURE__ */
|
|
12639
|
-
var IconCheck = () => /* @__PURE__ */
|
|
12917
|
+
var IconUndo = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12918
|
+
var IconRedo = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12919
|
+
var IconBold = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12920
|
+
var IconItalic = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z" }));
|
|
12921
|
+
var IconLink = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12922
|
+
var IconStrike = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12923
|
+
var IconHeading = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M5 4v3h5.5v12h3V7H19V4z" }));
|
|
12924
|
+
var IconFontSize = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M9 4v3h5v12h2V7h5V4H9zm-6 8h3v7h2v-7h3v-2H3v2z" }));
|
|
12925
|
+
var IconColor = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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__ */ React112.createElement("path", { d: "M3 20h18v3H3z", opacity: "0.8" }));
|
|
12926
|
+
var IconFont = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12927
|
+
var IconLineHeight = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12928
|
+
var IconBulletList = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12929
|
+
var IconOrderedList = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z" }));
|
|
12930
|
+
var IconAlignLeft = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zM3 21h18v-2H3v2zM3 3v2h18V3H3z" }));
|
|
12931
|
+
var IconAlignCenter = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z" }));
|
|
12932
|
+
var IconAlignRight = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z" }));
|
|
12933
|
+
var IconAlignJustify = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zM3 3v2h18V3H3z" }));
|
|
12934
|
+
var IconIndentIncrease = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z" }));
|
|
12935
|
+
var IconIndentDecrease = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M11 17h10v-2H11v2zm-8-5l4 4V8l-4 4zm0 9h18v-2H3v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z" }));
|
|
12936
|
+
var IconTable = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12937
|
+
var IconImage = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12938
|
+
var IconVideo = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12939
|
+
var IconCut = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12940
|
+
var IconCopy = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12941
|
+
var IconCode = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12942
|
+
var IconFullscreen = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }));
|
|
12943
|
+
var IconTranslate = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12944
|
+
var IconTaskList = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.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" }));
|
|
12945
|
+
var IconCheck = () => /* @__PURE__ */ React112.createElement("svg", { ...s }, /* @__PURE__ */ React112.createElement("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }));
|
|
12640
12946
|
|
|
12641
12947
|
// lib/RufousTextEditor/Toolbar.tsx
|
|
12642
12948
|
var COLOR_PALETTE = [
|
|
@@ -12774,16 +13080,16 @@ var SPECIAL_CHARS = [
|
|
|
12774
13080
|
"\xA2"
|
|
12775
13081
|
];
|
|
12776
13082
|
var Dropdown = ({ trigger, children, className = "", keepOpen = false }) => {
|
|
12777
|
-
const [open, setOpen] =
|
|
12778
|
-
const ref =
|
|
12779
|
-
|
|
13083
|
+
const [open, setOpen] = useState31(false);
|
|
13084
|
+
const ref = useRef27(null);
|
|
13085
|
+
useEffect24(() => {
|
|
12780
13086
|
const handleClick = (e) => {
|
|
12781
13087
|
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
12782
13088
|
};
|
|
12783
13089
|
document.addEventListener("mousedown", handleClick);
|
|
12784
13090
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
12785
13091
|
}, []);
|
|
12786
|
-
return /* @__PURE__ */
|
|
13092
|
+
return /* @__PURE__ */ React113.createElement("div", { className: `dropdown ${className}`, ref }, /* @__PURE__ */ React113.createElement(
|
|
12787
13093
|
"button",
|
|
12788
13094
|
{
|
|
12789
13095
|
className: `toolbar-btn ${trigger.className || ""}`,
|
|
@@ -12791,12 +13097,12 @@ var Dropdown = ({ trigger, children, className = "", keepOpen = false }) => {
|
|
|
12791
13097
|
title: trigger.title
|
|
12792
13098
|
},
|
|
12793
13099
|
trigger.label,
|
|
12794
|
-
/* @__PURE__ */
|
|
12795
|
-
), open && /* @__PURE__ */
|
|
13100
|
+
/* @__PURE__ */ React113.createElement("span", { className: "dropdown-arrow" }, "\u25BE")
|
|
13101
|
+
), open && /* @__PURE__ */ React113.createElement("div", { className: "dropdown-menu", onClick: keepOpen ? void 0 : () => setOpen(false) }, typeof children === "function" ? children(() => setOpen(false)) : children));
|
|
12796
13102
|
};
|
|
12797
13103
|
var InsertPanel = ({ editor, onClose, mode = "video" }) => {
|
|
12798
|
-
const [activeTab, setActiveTab] =
|
|
12799
|
-
const [url, setUrl] =
|
|
13104
|
+
const [activeTab, setActiveTab] = useState31("link");
|
|
13105
|
+
const [url, setUrl] = useState31("");
|
|
12800
13106
|
const extractIframeSrc = (html) => {
|
|
12801
13107
|
const match = html.match(/<iframe[^>]+src=["']([^"']+)["']/);
|
|
12802
13108
|
return match ? match[1] : null;
|
|
@@ -12823,14 +13129,14 @@ var InsertPanel = ({ editor, onClose, mode = "video" }) => {
|
|
|
12823
13129
|
}
|
|
12824
13130
|
onClose();
|
|
12825
13131
|
};
|
|
12826
|
-
return /* @__PURE__ */
|
|
13132
|
+
return /* @__PURE__ */ React113.createElement("div", { className: "insert-panel", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React113.createElement("div", { className: "insert-panel-tabs" }, /* @__PURE__ */ React113.createElement(
|
|
12827
13133
|
"button",
|
|
12828
13134
|
{
|
|
12829
13135
|
className: `insert-tab ${activeTab === "link" ? "active" : ""}`,
|
|
12830
13136
|
onClick: () => setActiveTab("link")
|
|
12831
13137
|
},
|
|
12832
13138
|
"\u{1F517} Link"
|
|
12833
|
-
), /* @__PURE__ */
|
|
13139
|
+
), /* @__PURE__ */ React113.createElement(
|
|
12834
13140
|
"button",
|
|
12835
13141
|
{
|
|
12836
13142
|
className: `insert-tab ${activeTab === "code" ? "active" : ""}`,
|
|
@@ -12838,7 +13144,7 @@ var InsertPanel = ({ editor, onClose, mode = "video" }) => {
|
|
|
12838
13144
|
},
|
|
12839
13145
|
"</>",
|
|
12840
13146
|
" Code"
|
|
12841
|
-
)), /* @__PURE__ */
|
|
13147
|
+
)), /* @__PURE__ */ React113.createElement("label", { className: "insert-panel-label" }, activeTab === "link" ? "URL" : "Embed Code"), activeTab === "link" ? /* @__PURE__ */ React113.createElement(
|
|
12842
13148
|
"input",
|
|
12843
13149
|
{
|
|
12844
13150
|
type: "text",
|
|
@@ -12849,7 +13155,7 @@ var InsertPanel = ({ editor, onClose, mode = "video" }) => {
|
|
|
12849
13155
|
onKeyDown: (e) => e.key === "Enter" && handleInsert(),
|
|
12850
13156
|
autoFocus: true
|
|
12851
13157
|
}
|
|
12852
|
-
) : /* @__PURE__ */
|
|
13158
|
+
) : /* @__PURE__ */ React113.createElement(
|
|
12853
13159
|
"textarea",
|
|
12854
13160
|
{
|
|
12855
13161
|
className: "insert-panel-textarea",
|
|
@@ -12858,13 +13164,13 @@ var InsertPanel = ({ editor, onClose, mode = "video" }) => {
|
|
|
12858
13164
|
onChange: (e) => setUrl(e.target.value),
|
|
12859
13165
|
rows: 3
|
|
12860
13166
|
}
|
|
12861
|
-
), /* @__PURE__ */
|
|
13167
|
+
), /* @__PURE__ */ React113.createElement("button", { className: "insert-panel-btn", onClick: handleInsert }, "Insert"));
|
|
12862
13168
|
};
|
|
12863
13169
|
var ImagePanel = ({ editor, onClose }) => {
|
|
12864
|
-
const [activeTab, setActiveTab] =
|
|
12865
|
-
const [url, setUrl] =
|
|
12866
|
-
const [isDragging, setIsDragging] =
|
|
12867
|
-
const fileInputRef =
|
|
13170
|
+
const [activeTab, setActiveTab] = useState31("upload");
|
|
13171
|
+
const [url, setUrl] = useState31("");
|
|
13172
|
+
const [isDragging, setIsDragging] = useState31(false);
|
|
13173
|
+
const fileInputRef = useRef27(null);
|
|
12868
13174
|
const insertImageFromFile = (file) => {
|
|
12869
13175
|
if (!file || !editor) return;
|
|
12870
13176
|
const reader = new FileReader();
|
|
@@ -12891,21 +13197,21 @@ var ImagePanel = ({ editor, onClose }) => {
|
|
|
12891
13197
|
editor.chain().focus().setImage({ src: url }).run();
|
|
12892
13198
|
onClose();
|
|
12893
13199
|
};
|
|
12894
|
-
return /* @__PURE__ */
|
|
13200
|
+
return /* @__PURE__ */ React113.createElement("div", { className: "insert-panel", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React113.createElement("div", { className: "insert-panel-tabs" }, /* @__PURE__ */ React113.createElement(
|
|
12895
13201
|
"button",
|
|
12896
13202
|
{
|
|
12897
13203
|
className: `insert-tab ${activeTab === "upload" ? "active" : ""}`,
|
|
12898
13204
|
onClick: () => setActiveTab("upload")
|
|
12899
13205
|
},
|
|
12900
13206
|
"\u2B06 Upload"
|
|
12901
|
-
), /* @__PURE__ */
|
|
13207
|
+
), /* @__PURE__ */ React113.createElement(
|
|
12902
13208
|
"button",
|
|
12903
13209
|
{
|
|
12904
13210
|
className: `insert-tab ${activeTab === "url" ? "active" : ""}`,
|
|
12905
13211
|
onClick: () => setActiveTab("url")
|
|
12906
13212
|
},
|
|
12907
13213
|
"\u{1F517} URL"
|
|
12908
|
-
)), activeTab === "upload" ? /* @__PURE__ */
|
|
13214
|
+
)), activeTab === "upload" ? /* @__PURE__ */ React113.createElement(React113.Fragment, null, /* @__PURE__ */ React113.createElement(
|
|
12909
13215
|
"div",
|
|
12910
13216
|
{
|
|
12911
13217
|
className: `drop-zone ${isDragging ? "dragging" : ""}`,
|
|
@@ -12917,9 +13223,9 @@ var ImagePanel = ({ editor, onClose }) => {
|
|
|
12917
13223
|
onDrop: handleDrop,
|
|
12918
13224
|
onClick: () => fileInputRef.current?.click()
|
|
12919
13225
|
},
|
|
12920
|
-
/* @__PURE__ */
|
|
12921
|
-
/* @__PURE__ */
|
|
12922
|
-
), /* @__PURE__ */
|
|
13226
|
+
/* @__PURE__ */ React113.createElement("span", { className: "drop-zone-text-bold" }, "Drop image"),
|
|
13227
|
+
/* @__PURE__ */ React113.createElement("span", { className: "drop-zone-text-sub" }, "or click")
|
|
13228
|
+
), /* @__PURE__ */ React113.createElement(
|
|
12923
13229
|
"input",
|
|
12924
13230
|
{
|
|
12925
13231
|
ref: fileInputRef,
|
|
@@ -12928,7 +13234,7 @@ var ImagePanel = ({ editor, onClose }) => {
|
|
|
12928
13234
|
style: { display: "none" },
|
|
12929
13235
|
onChange: handleFileSelect
|
|
12930
13236
|
}
|
|
12931
|
-
)) : /* @__PURE__ */
|
|
13237
|
+
)) : /* @__PURE__ */ React113.createElement(React113.Fragment, null, /* @__PURE__ */ React113.createElement("label", { className: "insert-panel-label" }, "URL"), /* @__PURE__ */ React113.createElement(
|
|
12932
13238
|
"input",
|
|
12933
13239
|
{
|
|
12934
13240
|
type: "text",
|
|
@@ -12939,18 +13245,18 @@ var ImagePanel = ({ editor, onClose }) => {
|
|
|
12939
13245
|
onKeyDown: (e) => e.key === "Enter" && handleUrlInsert(),
|
|
12940
13246
|
autoFocus: true
|
|
12941
13247
|
}
|
|
12942
|
-
), /* @__PURE__ */
|
|
13248
|
+
), /* @__PURE__ */ React113.createElement("button", { className: "insert-panel-btn", onClick: handleUrlInsert }, "Insert")));
|
|
12943
13249
|
};
|
|
12944
13250
|
var MAX_GRID = 10;
|
|
12945
13251
|
var TableGridSelector = ({ editor, onClose }) => {
|
|
12946
|
-
const [hoverRow, setHoverRow] =
|
|
12947
|
-
const [hoverCol, setHoverCol] =
|
|
13252
|
+
const [hoverRow, setHoverRow] = useState31(0);
|
|
13253
|
+
const [hoverCol, setHoverCol] = useState31(0);
|
|
12948
13254
|
const handleInsert = () => {
|
|
12949
13255
|
if (!editor || hoverRow === 0 || hoverCol === 0) return;
|
|
12950
13256
|
editor.chain().focus().insertTable({ rows: hoverRow, cols: hoverCol, withHeaderRow: true }).run();
|
|
12951
13257
|
onClose();
|
|
12952
13258
|
};
|
|
12953
|
-
return /* @__PURE__ */
|
|
13259
|
+
return /* @__PURE__ */ React113.createElement("div", { className: "table-grid-panel", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React113.createElement(
|
|
12954
13260
|
"div",
|
|
12955
13261
|
{
|
|
12956
13262
|
className: "table-grid",
|
|
@@ -12959,7 +13265,7 @@ var TableGridSelector = ({ editor, onClose }) => {
|
|
|
12959
13265
|
setHoverCol(0);
|
|
12960
13266
|
}
|
|
12961
13267
|
},
|
|
12962
|
-
Array.from({ length: MAX_GRID }, (_, r) => /* @__PURE__ */
|
|
13268
|
+
Array.from({ length: MAX_GRID }, (_, r) => /* @__PURE__ */ React113.createElement("div", { key: r, className: "table-grid-row" }, Array.from({ length: MAX_GRID }, (_2, c) => /* @__PURE__ */ React113.createElement(
|
|
12963
13269
|
"div",
|
|
12964
13270
|
{
|
|
12965
13271
|
key: c,
|
|
@@ -12971,7 +13277,7 @@ var TableGridSelector = ({ editor, onClose }) => {
|
|
|
12971
13277
|
onClick: handleInsert
|
|
12972
13278
|
}
|
|
12973
13279
|
))))
|
|
12974
|
-
), /* @__PURE__ */
|
|
13280
|
+
), /* @__PURE__ */ React113.createElement("div", { className: "table-grid-footer" }, /* @__PURE__ */ React113.createElement("span", { className: "table-grid-size" }, hoverRow > 0 && hoverCol > 0 ? `${hoverRow}\xD7${hoverCol}` : "Select size"), /* @__PURE__ */ React113.createElement(
|
|
12975
13281
|
"button",
|
|
12976
13282
|
{
|
|
12977
13283
|
className: "table-grid-submit",
|
|
@@ -12982,9 +13288,9 @@ var TableGridSelector = ({ editor, onClose }) => {
|
|
|
12982
13288
|
)));
|
|
12983
13289
|
};
|
|
12984
13290
|
var ColorPickerPanel = ({ editor, onClose }) => {
|
|
12985
|
-
const [tab, setTab] =
|
|
12986
|
-
const [activeBg, setActiveBg] =
|
|
12987
|
-
const [activeText, setActiveText] =
|
|
13291
|
+
const [tab, setTab] = useState31("background");
|
|
13292
|
+
const [activeBg, setActiveBg] = useState31(() => editor.getAttributes("highlight").color || null);
|
|
13293
|
+
const [activeText, setActiveText] = useState31(() => editor.getAttributes("textStyle").color || null);
|
|
12988
13294
|
const activeColor = tab === "background" ? activeBg : activeText;
|
|
12989
13295
|
const applyColor = (color) => {
|
|
12990
13296
|
if (tab === "background") {
|
|
@@ -13005,21 +13311,21 @@ var ColorPickerPanel = ({ editor, onClose }) => {
|
|
|
13005
13311
|
}
|
|
13006
13312
|
onClose();
|
|
13007
13313
|
};
|
|
13008
|
-
return /* @__PURE__ */
|
|
13314
|
+
return /* @__PURE__ */ React113.createElement("div", { className: "color-picker-panel", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React113.createElement("div", { className: "color-picker-tabs" }, /* @__PURE__ */ React113.createElement(
|
|
13009
13315
|
"button",
|
|
13010
13316
|
{
|
|
13011
13317
|
className: `color-picker-tab ${tab === "background" ? "active" : ""}`,
|
|
13012
13318
|
onClick: () => setTab("background")
|
|
13013
13319
|
},
|
|
13014
13320
|
"Background"
|
|
13015
|
-
), /* @__PURE__ */
|
|
13321
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13016
13322
|
"button",
|
|
13017
13323
|
{
|
|
13018
13324
|
className: `color-picker-tab ${tab === "text" ? "active" : ""}`,
|
|
13019
13325
|
onClick: () => setTab("text")
|
|
13020
13326
|
},
|
|
13021
13327
|
"Text"
|
|
13022
|
-
)), /* @__PURE__ */
|
|
13328
|
+
)), /* @__PURE__ */ React113.createElement("div", { className: "color-picker-grid" }, COLOR_PALETTE.map((color, i) => /* @__PURE__ */ React113.createElement(
|
|
13023
13329
|
"button",
|
|
13024
13330
|
{
|
|
13025
13331
|
key: i,
|
|
@@ -13028,18 +13334,18 @@ var ColorPickerPanel = ({ editor, onClose }) => {
|
|
|
13028
13334
|
onClick: () => applyColor(color),
|
|
13029
13335
|
title: color
|
|
13030
13336
|
}
|
|
13031
|
-
))), /* @__PURE__ */
|
|
13337
|
+
))), /* @__PURE__ */ React113.createElement("div", { className: "color-picker-footer" }, /* @__PURE__ */ React113.createElement("div", { className: "color-picker-preview", style: { background: activeColor || "#000" } }), /* @__PURE__ */ React113.createElement("button", { className: "color-picker-remove", onClick: removeColor, title: "Remove color" }, "\u2713")));
|
|
13032
13338
|
};
|
|
13033
13339
|
var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTextToSpeech }) => {
|
|
13034
|
-
const [, setEditorState] =
|
|
13035
|
-
const [isFullscreen, setIsFullscreen] =
|
|
13036
|
-
|
|
13340
|
+
const [, setEditorState] = useState31(0);
|
|
13341
|
+
const [isFullscreen, setIsFullscreen] = useState31(false);
|
|
13342
|
+
useEffect24(() => {
|
|
13037
13343
|
if (!editor) return;
|
|
13038
13344
|
const onTransaction = () => setEditorState((n) => n + 1);
|
|
13039
13345
|
editor.on("transaction", onTransaction);
|
|
13040
13346
|
return () => editor.off("transaction", onTransaction);
|
|
13041
13347
|
}, [editor]);
|
|
13042
|
-
const toggleFullscreen =
|
|
13348
|
+
const toggleFullscreen = useCallback12(() => {
|
|
13043
13349
|
const wrapper = document.querySelector(".editor-wrapper");
|
|
13044
13350
|
if (!wrapper) return;
|
|
13045
13351
|
if (!isFullscreen) {
|
|
@@ -13049,16 +13355,16 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13049
13355
|
}
|
|
13050
13356
|
setIsFullscreen(!isFullscreen);
|
|
13051
13357
|
}, [isFullscreen]);
|
|
13052
|
-
const insertSpecialChar =
|
|
13358
|
+
const insertSpecialChar = useCallback12((char) => {
|
|
13053
13359
|
if (!editor) return;
|
|
13054
13360
|
editor.chain().focus().insertContent(char).run();
|
|
13055
13361
|
}, [editor]);
|
|
13056
|
-
const [copySuccess, setCopySuccess] =
|
|
13057
|
-
const [translateSource, setTranslateSource] =
|
|
13058
|
-
const [translateTarget, setTranslateTarget] =
|
|
13059
|
-
const [translateStatus, setTranslateStatus] =
|
|
13060
|
-
const [showTranslateModal, setShowTranslateModal] =
|
|
13061
|
-
const handleCopy =
|
|
13362
|
+
const [copySuccess, setCopySuccess] = useState31(false);
|
|
13363
|
+
const [translateSource, setTranslateSource] = useState31("en");
|
|
13364
|
+
const [translateTarget, setTranslateTarget] = useState31("hi");
|
|
13365
|
+
const [translateStatus, setTranslateStatus] = useState31("");
|
|
13366
|
+
const [showTranslateModal, setShowTranslateModal] = useState31(false);
|
|
13367
|
+
const handleCopy = useCallback12(async () => {
|
|
13062
13368
|
if (!editor) return;
|
|
13063
13369
|
const { from, to, empty } = editor.state.selection;
|
|
13064
13370
|
if (empty) return;
|
|
@@ -13073,7 +13379,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13073
13379
|
setTimeout(() => setCopySuccess(false), 2e3);
|
|
13074
13380
|
}
|
|
13075
13381
|
}, [editor]);
|
|
13076
|
-
const handleQuickTranslate =
|
|
13382
|
+
const handleQuickTranslate = useCallback12(async () => {
|
|
13077
13383
|
if (!editor) return;
|
|
13078
13384
|
const { from, to, empty } = editor.state.selection;
|
|
13079
13385
|
if (empty) {
|
|
@@ -13107,7 +13413,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13107
13413
|
setTimeout(() => setTranslateStatus(""), 2e3);
|
|
13108
13414
|
}, [editor, translateSource, translateTarget, onTranslate]);
|
|
13109
13415
|
if (!editor) return null;
|
|
13110
|
-
return /* @__PURE__ */
|
|
13416
|
+
return /* @__PURE__ */ React113.createElement("div", { className: "toolbar" }, /* @__PURE__ */ React113.createElement("div", { className: "toolbar-row" }, /* @__PURE__ */ React113.createElement("div", { className: "toolbar-group" }, /* @__PURE__ */ React113.createElement(
|
|
13111
13417
|
"button",
|
|
13112
13418
|
{
|
|
13113
13419
|
className: "toolbar-btn",
|
|
@@ -13115,8 +13421,8 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13115
13421
|
disabled: !editor.can().undo(),
|
|
13116
13422
|
title: "Undo (Ctrl+Z)"
|
|
13117
13423
|
},
|
|
13118
|
-
/* @__PURE__ */
|
|
13119
|
-
), /* @__PURE__ */
|
|
13424
|
+
/* @__PURE__ */ React113.createElement(IconUndo, null)
|
|
13425
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13120
13426
|
"button",
|
|
13121
13427
|
{
|
|
13122
13428
|
className: "toolbar-btn",
|
|
@@ -13124,17 +13430,17 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13124
13430
|
disabled: !editor.can().redo(),
|
|
13125
13431
|
title: "Redo (Ctrl+Y)"
|
|
13126
13432
|
},
|
|
13127
|
-
/* @__PURE__ */
|
|
13128
|
-
)), /* @__PURE__ */
|
|
13433
|
+
/* @__PURE__ */ React113.createElement(IconRedo, null)
|
|
13434
|
+
)), /* @__PURE__ */ React113.createElement(
|
|
13129
13435
|
Dropdown,
|
|
13130
13436
|
{
|
|
13131
|
-
trigger: { label: /* @__PURE__ */
|
|
13437
|
+
trigger: { label: /* @__PURE__ */ React113.createElement(IconStrike, null), title: "Text decoration", className: editor.isActive("strike") ? "is-active" : "" }
|
|
13132
13438
|
},
|
|
13133
|
-
/* @__PURE__ */
|
|
13134
|
-
/* @__PURE__ */
|
|
13135
|
-
/* @__PURE__ */
|
|
13136
|
-
/* @__PURE__ */
|
|
13137
|
-
/* @__PURE__ */
|
|
13439
|
+
/* @__PURE__ */ React113.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleStrike().run() }, /* @__PURE__ */ React113.createElement("s", null, "Strikethrough")),
|
|
13440
|
+
/* @__PURE__ */ React113.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleUnderline().run() }, /* @__PURE__ */ React113.createElement("u", null, "Underline")),
|
|
13441
|
+
/* @__PURE__ */ React113.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleSuperscript().run() }, "X", /* @__PURE__ */ React113.createElement("sup", null, "2"), " Superscript"),
|
|
13442
|
+
/* @__PURE__ */ React113.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleSubscript().run() }, "X", /* @__PURE__ */ React113.createElement("sub", null, "2"), " Subscript"),
|
|
13443
|
+
/* @__PURE__ */ React113.createElement("button", { className: "dropdown-item", onMouseDown: (e) => {
|
|
13138
13444
|
e.preventDefault();
|
|
13139
13445
|
const chain = editor.chain().focus();
|
|
13140
13446
|
if (!editor.state.selection.empty) {
|
|
@@ -13150,16 +13456,16 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13150
13456
|
c.run();
|
|
13151
13457
|
}
|
|
13152
13458
|
} }, "\u2715 Clear formatting")
|
|
13153
|
-
), /* @__PURE__ */
|
|
13459
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13154
13460
|
Dropdown,
|
|
13155
13461
|
{
|
|
13156
13462
|
trigger: {
|
|
13157
|
-
label: /* @__PURE__ */
|
|
13463
|
+
label: /* @__PURE__ */ React113.createElement(IconHeading, null),
|
|
13158
13464
|
title: "Block type",
|
|
13159
13465
|
className: editor.isActive("heading") ? "is-active" : ""
|
|
13160
13466
|
}
|
|
13161
13467
|
},
|
|
13162
|
-
/* @__PURE__ */
|
|
13468
|
+
/* @__PURE__ */ React113.createElement(
|
|
13163
13469
|
"button",
|
|
13164
13470
|
{
|
|
13165
13471
|
className: `dropdown-item ${!editor.isActive("heading") && !editor.isActive("blockquote") && !editor.isActive("codeBlock") ? "is-active" : ""}`,
|
|
@@ -13167,7 +13473,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13167
13473
|
},
|
|
13168
13474
|
"\xB6 Paragraph"
|
|
13169
13475
|
),
|
|
13170
|
-
/* @__PURE__ */
|
|
13476
|
+
/* @__PURE__ */ React113.createElement(
|
|
13171
13477
|
"button",
|
|
13172
13478
|
{
|
|
13173
13479
|
className: `dropdown-item heading-1 ${editor.isActive("heading", { level: 1 }) ? "is-active" : ""}`,
|
|
@@ -13175,7 +13481,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13175
13481
|
},
|
|
13176
13482
|
"Heading 1"
|
|
13177
13483
|
),
|
|
13178
|
-
/* @__PURE__ */
|
|
13484
|
+
/* @__PURE__ */ React113.createElement(
|
|
13179
13485
|
"button",
|
|
13180
13486
|
{
|
|
13181
13487
|
className: `dropdown-item heading-2 ${editor.isActive("heading", { level: 2 }) ? "is-active" : ""}`,
|
|
@@ -13183,7 +13489,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13183
13489
|
},
|
|
13184
13490
|
"Heading 2"
|
|
13185
13491
|
),
|
|
13186
|
-
/* @__PURE__ */
|
|
13492
|
+
/* @__PURE__ */ React113.createElement(
|
|
13187
13493
|
"button",
|
|
13188
13494
|
{
|
|
13189
13495
|
className: `dropdown-item heading-3 ${editor.isActive("heading", { level: 3 }) ? "is-active" : ""}`,
|
|
@@ -13191,7 +13497,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13191
13497
|
},
|
|
13192
13498
|
"Heading 3"
|
|
13193
13499
|
),
|
|
13194
|
-
/* @__PURE__ */
|
|
13500
|
+
/* @__PURE__ */ React113.createElement(
|
|
13195
13501
|
"button",
|
|
13196
13502
|
{
|
|
13197
13503
|
className: `dropdown-item heading-4 ${editor.isActive("heading", { level: 4 }) ? "is-active" : ""}`,
|
|
@@ -13199,7 +13505,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13199
13505
|
},
|
|
13200
13506
|
"Heading 4"
|
|
13201
13507
|
),
|
|
13202
|
-
/* @__PURE__ */
|
|
13508
|
+
/* @__PURE__ */ React113.createElement(
|
|
13203
13509
|
"button",
|
|
13204
13510
|
{
|
|
13205
13511
|
className: `dropdown-item ${editor.isActive("blockquote") ? "is-active" : ""}`,
|
|
@@ -13207,7 +13513,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13207
13513
|
},
|
|
13208
13514
|
"\u275E Blockquote"
|
|
13209
13515
|
),
|
|
13210
|
-
/* @__PURE__ */
|
|
13516
|
+
/* @__PURE__ */ React113.createElement(
|
|
13211
13517
|
"button",
|
|
13212
13518
|
{
|
|
13213
13519
|
className: `dropdown-item ${editor.isActive("codeBlock") ? "is-active" : ""}`,
|
|
@@ -13216,19 +13522,19 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13216
13522
|
"{ }",
|
|
13217
13523
|
" Code Block"
|
|
13218
13524
|
),
|
|
13219
|
-
/* @__PURE__ */
|
|
13220
|
-
), /* @__PURE__ */
|
|
13525
|
+
/* @__PURE__ */ React113.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().setHorizontalRule().run() }, "\u2014 Horizontal Rule")
|
|
13526
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13221
13527
|
Dropdown,
|
|
13222
13528
|
{
|
|
13223
13529
|
trigger: {
|
|
13224
|
-
label: /* @__PURE__ */
|
|
13530
|
+
label: /* @__PURE__ */ React113.createElement(IconFontSize, null),
|
|
13225
13531
|
title: "Font size"
|
|
13226
13532
|
}
|
|
13227
13533
|
},
|
|
13228
13534
|
[8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 42, 48, 56, 64, 72, 80, 96].map((size) => {
|
|
13229
13535
|
const sizeStr = `${size}px`;
|
|
13230
13536
|
const isActive = editor.getAttributes("textStyle").fontSize === sizeStr;
|
|
13231
|
-
return /* @__PURE__ */
|
|
13537
|
+
return /* @__PURE__ */ React113.createElement(
|
|
13232
13538
|
"button",
|
|
13233
13539
|
{
|
|
13234
13540
|
key: size,
|
|
@@ -13244,27 +13550,27 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13244
13550
|
sizeStr
|
|
13245
13551
|
);
|
|
13246
13552
|
})
|
|
13247
|
-
), /* @__PURE__ */
|
|
13553
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13248
13554
|
Dropdown,
|
|
13249
13555
|
{
|
|
13250
13556
|
trigger: {
|
|
13251
|
-
label: /* @__PURE__ */
|
|
13557
|
+
label: /* @__PURE__ */ React113.createElement("span", { style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React113.createElement(IconColor, null)),
|
|
13252
13558
|
title: "Colors"
|
|
13253
13559
|
},
|
|
13254
13560
|
keepOpen: true
|
|
13255
13561
|
},
|
|
13256
|
-
(close2) => /* @__PURE__ */
|
|
13257
|
-
), /* @__PURE__ */
|
|
13562
|
+
(close2) => /* @__PURE__ */ React113.createElement(ColorPickerPanel, { editor, onClose: close2 })
|
|
13563
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13258
13564
|
Dropdown,
|
|
13259
13565
|
{
|
|
13260
13566
|
trigger: {
|
|
13261
|
-
label: /* @__PURE__ */
|
|
13567
|
+
label: /* @__PURE__ */ React113.createElement(IconFont, null),
|
|
13262
13568
|
title: "Font family"
|
|
13263
13569
|
}
|
|
13264
13570
|
},
|
|
13265
13571
|
FONT_FAMILIES.map((font) => {
|
|
13266
13572
|
const isActive = editor.getAttributes("textStyle").fontFamily === font;
|
|
13267
|
-
return /* @__PURE__ */
|
|
13573
|
+
return /* @__PURE__ */ React113.createElement(
|
|
13268
13574
|
"button",
|
|
13269
13575
|
{
|
|
13270
13576
|
key: font,
|
|
@@ -13281,35 +13587,35 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13281
13587
|
font
|
|
13282
13588
|
);
|
|
13283
13589
|
})
|
|
13284
|
-
), /* @__PURE__ */
|
|
13590
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13285
13591
|
"button",
|
|
13286
13592
|
{
|
|
13287
13593
|
className: `toolbar-btn ${editor.isActive("bold") ? "is-active" : ""}`,
|
|
13288
13594
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
13289
13595
|
title: "Bold (Ctrl+B)"
|
|
13290
13596
|
},
|
|
13291
|
-
/* @__PURE__ */
|
|
13292
|
-
), /* @__PURE__ */
|
|
13597
|
+
/* @__PURE__ */ React113.createElement(IconBold, null)
|
|
13598
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13293
13599
|
"button",
|
|
13294
13600
|
{
|
|
13295
13601
|
className: `toolbar-btn ${editor.isActive("italic") ? "is-active" : ""}`,
|
|
13296
13602
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
13297
13603
|
title: "Italic (Ctrl+I)"
|
|
13298
13604
|
},
|
|
13299
|
-
/* @__PURE__ */
|
|
13300
|
-
), /* @__PURE__ */
|
|
13605
|
+
/* @__PURE__ */ React113.createElement(IconItalic, null)
|
|
13606
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13301
13607
|
"button",
|
|
13302
13608
|
{
|
|
13303
13609
|
className: `toolbar-btn ${editor.isActive("link") ? "is-active" : ""}`,
|
|
13304
13610
|
onClick: setLink,
|
|
13305
13611
|
title: "Insert Link"
|
|
13306
13612
|
},
|
|
13307
|
-
/* @__PURE__ */
|
|
13308
|
-
), /* @__PURE__ */
|
|
13613
|
+
/* @__PURE__ */ React113.createElement(IconLink, null)
|
|
13614
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13309
13615
|
Dropdown,
|
|
13310
13616
|
{
|
|
13311
13617
|
trigger: {
|
|
13312
|
-
label: /* @__PURE__ */
|
|
13618
|
+
label: /* @__PURE__ */ React113.createElement(IconLineHeight, null),
|
|
13313
13619
|
title: "Line height"
|
|
13314
13620
|
}
|
|
13315
13621
|
},
|
|
@@ -13317,7 +13623,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13317
13623
|
const currentLH = editor.getAttributes("paragraph").lineHeight || editor.getAttributes("heading").lineHeight;
|
|
13318
13624
|
const lhStr = String(lh);
|
|
13319
13625
|
const isActive = currentLH === lhStr;
|
|
13320
|
-
return /* @__PURE__ */
|
|
13626
|
+
return /* @__PURE__ */ React113.createElement(
|
|
13321
13627
|
"button",
|
|
13322
13628
|
{
|
|
13323
13629
|
key: lh,
|
|
@@ -13333,11 +13639,11 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13333
13639
|
lh
|
|
13334
13640
|
);
|
|
13335
13641
|
})
|
|
13336
|
-
), /* @__PURE__ */
|
|
13642
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13337
13643
|
Dropdown,
|
|
13338
13644
|
{
|
|
13339
13645
|
trigger: {
|
|
13340
|
-
label: /* @__PURE__ */
|
|
13646
|
+
label: /* @__PURE__ */ React113.createElement(IconBulletList, null),
|
|
13341
13647
|
title: "Insert Unordered List",
|
|
13342
13648
|
className: editor.isActive("bulletList") ? "is-active" : ""
|
|
13343
13649
|
}
|
|
@@ -13347,7 +13653,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13347
13653
|
{ label: "Circle", style: "circle", icon: "\u25CB" },
|
|
13348
13654
|
{ label: "Dot", style: "disc", icon: "\u2219" },
|
|
13349
13655
|
{ label: "Square", style: "square", icon: "\u25A0" }
|
|
13350
|
-
].map((item) => /* @__PURE__ */
|
|
13656
|
+
].map((item) => /* @__PURE__ */ React113.createElement(
|
|
13351
13657
|
"button",
|
|
13352
13658
|
{
|
|
13353
13659
|
key: item.label,
|
|
@@ -13372,15 +13678,15 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13372
13678
|
}).run();
|
|
13373
13679
|
}
|
|
13374
13680
|
},
|
|
13375
|
-
/* @__PURE__ */
|
|
13681
|
+
/* @__PURE__ */ React113.createElement("span", { className: "bullet-style-icon" }, item.icon),
|
|
13376
13682
|
" ",
|
|
13377
13683
|
item.label
|
|
13378
13684
|
))
|
|
13379
|
-
), /* @__PURE__ */
|
|
13685
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13380
13686
|
Dropdown,
|
|
13381
13687
|
{
|
|
13382
13688
|
trigger: {
|
|
13383
|
-
label: /* @__PURE__ */
|
|
13689
|
+
label: /* @__PURE__ */ React113.createElement(IconOrderedList, null),
|
|
13384
13690
|
title: "Insert Ordered List",
|
|
13385
13691
|
className: editor.isActive("orderedList") ? "is-active" : ""
|
|
13386
13692
|
}
|
|
@@ -13392,7 +13698,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13392
13698
|
{ label: "Lower Roman", style: "lower-roman", icon: "i." },
|
|
13393
13699
|
{ label: "Upper Alpha", style: "upper-alpha", icon: "A." },
|
|
13394
13700
|
{ label: "Upper Roman", style: "upper-roman", icon: "I." }
|
|
13395
|
-
].map((item) => /* @__PURE__ */
|
|
13701
|
+
].map((item) => /* @__PURE__ */ React113.createElement(
|
|
13396
13702
|
"button",
|
|
13397
13703
|
{
|
|
13398
13704
|
key: item.label,
|
|
@@ -13417,25 +13723,25 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13417
13723
|
}).run();
|
|
13418
13724
|
}
|
|
13419
13725
|
},
|
|
13420
|
-
/* @__PURE__ */
|
|
13726
|
+
/* @__PURE__ */ React113.createElement("span", { className: "bullet-style-icon" }, item.icon),
|
|
13421
13727
|
" ",
|
|
13422
13728
|
item.label
|
|
13423
13729
|
))
|
|
13424
|
-
), /* @__PURE__ */
|
|
13730
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13425
13731
|
Dropdown,
|
|
13426
13732
|
{
|
|
13427
13733
|
trigger: {
|
|
13428
|
-
label: /* @__PURE__ */
|
|
13734
|
+
label: /* @__PURE__ */ React113.createElement(IconAlignLeft, null),
|
|
13429
13735
|
title: "Align",
|
|
13430
13736
|
className: editor.isActive({ textAlign: "center" }) || editor.isActive({ textAlign: "right" }) || editor.isActive({ textAlign: "justify" }) ? "is-active" : ""
|
|
13431
13737
|
}
|
|
13432
13738
|
},
|
|
13433
13739
|
[
|
|
13434
|
-
{ label: "Align Left", value: "left", icon: /* @__PURE__ */
|
|
13435
|
-
{ label: "Align Center", value: "center", icon: /* @__PURE__ */
|
|
13436
|
-
{ label: "Align Right", value: "right", icon: /* @__PURE__ */
|
|
13437
|
-
{ label: "Align Justify", value: "justify", icon: /* @__PURE__ */
|
|
13438
|
-
].map((item) => /* @__PURE__ */
|
|
13740
|
+
{ label: "Align Left", value: "left", icon: /* @__PURE__ */ React113.createElement(IconAlignLeft, null) },
|
|
13741
|
+
{ label: "Align Center", value: "center", icon: /* @__PURE__ */ React113.createElement(IconAlignCenter, null) },
|
|
13742
|
+
{ label: "Align Right", value: "right", icon: /* @__PURE__ */ React113.createElement(IconAlignRight, null) },
|
|
13743
|
+
{ label: "Align Justify", value: "justify", icon: /* @__PURE__ */ React113.createElement(IconAlignJustify, null) }
|
|
13744
|
+
].map((item) => /* @__PURE__ */ React113.createElement(
|
|
13439
13745
|
"button",
|
|
13440
13746
|
{
|
|
13441
13747
|
key: item.value,
|
|
@@ -13446,7 +13752,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13446
13752
|
" ",
|
|
13447
13753
|
item.label
|
|
13448
13754
|
))
|
|
13449
|
-
), /* @__PURE__ */
|
|
13755
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13450
13756
|
"button",
|
|
13451
13757
|
{
|
|
13452
13758
|
className: "toolbar-btn",
|
|
@@ -13466,8 +13772,8 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13466
13772
|
},
|
|
13467
13773
|
title: "Increase Indent"
|
|
13468
13774
|
},
|
|
13469
|
-
/* @__PURE__ */
|
|
13470
|
-
), /* @__PURE__ */
|
|
13775
|
+
/* @__PURE__ */ React113.createElement(IconIndentIncrease, null)
|
|
13776
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13471
13777
|
"button",
|
|
13472
13778
|
{
|
|
13473
13779
|
className: "toolbar-btn",
|
|
@@ -13487,24 +13793,24 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13487
13793
|
},
|
|
13488
13794
|
title: "Decrease Indent"
|
|
13489
13795
|
},
|
|
13490
|
-
/* @__PURE__ */
|
|
13491
|
-
), /* @__PURE__ */
|
|
13796
|
+
/* @__PURE__ */ React113.createElement(IconIndentDecrease, null)
|
|
13797
|
+
), /* @__PURE__ */ React113.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React113.createElement(IconTable, null), title: "Insert Table" }, keepOpen: true }, (close2) => /* @__PURE__ */ React113.createElement(TableGridSelector, { editor, onClose: close2 })), /* @__PURE__ */ React113.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React113.createElement(IconImage, null), title: "Insert Image" }, keepOpen: true }, (close2) => /* @__PURE__ */ React113.createElement(ImagePanel, { editor, onClose: close2 })), /* @__PURE__ */ React113.createElement(Dropdown, { trigger: { label: /* @__PURE__ */ React113.createElement(IconVideo, null), title: "Insert Video" }, keepOpen: true }, (close2) => /* @__PURE__ */ React113.createElement(InsertPanel, { editor, onClose: close2, mode: "video" })), /* @__PURE__ */ React113.createElement(
|
|
13492
13798
|
"button",
|
|
13493
13799
|
{
|
|
13494
13800
|
className: "toolbar-btn",
|
|
13495
13801
|
onClick: () => document.execCommand("cut"),
|
|
13496
13802
|
title: "Cut (Ctrl+X)"
|
|
13497
13803
|
},
|
|
13498
|
-
/* @__PURE__ */
|
|
13499
|
-
), /* @__PURE__ */
|
|
13804
|
+
/* @__PURE__ */ React113.createElement(IconCut, null)
|
|
13805
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13500
13806
|
"button",
|
|
13501
13807
|
{
|
|
13502
13808
|
className: "toolbar-btn",
|
|
13503
13809
|
onClick: handleCopy,
|
|
13504
13810
|
title: "Copy selected text"
|
|
13505
13811
|
},
|
|
13506
|
-
copySuccess ? /* @__PURE__ */
|
|
13507
|
-
), /* @__PURE__ */
|
|
13812
|
+
copySuccess ? /* @__PURE__ */ React113.createElement(IconCheck, null) : /* @__PURE__ */ React113.createElement(IconCopy, null)
|
|
13813
|
+
), /* @__PURE__ */ React113.createElement(Dropdown, { trigger: { label: "\u03A9", title: "Special characters" } }, /* @__PURE__ */ React113.createElement("div", { className: "char-grid" }, SPECIAL_CHARS.map((char) => /* @__PURE__ */ React113.createElement(
|
|
13508
13814
|
"button",
|
|
13509
13815
|
{
|
|
13510
13816
|
key: char,
|
|
@@ -13512,39 +13818,39 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13512
13818
|
onClick: () => insertSpecialChar(char)
|
|
13513
13819
|
},
|
|
13514
13820
|
char
|
|
13515
|
-
)))), /* @__PURE__ */
|
|
13821
|
+
)))), /* @__PURE__ */ React113.createElement(
|
|
13516
13822
|
Dropdown,
|
|
13517
13823
|
{
|
|
13518
|
-
trigger: { label: /* @__PURE__ */
|
|
13824
|
+
trigger: { label: /* @__PURE__ */ React113.createElement(IconCode, null), title: "Code", className: editor.isActive("code") ? "is-active" : "" }
|
|
13519
13825
|
},
|
|
13520
|
-
/* @__PURE__ */
|
|
13521
|
-
/* @__PURE__ */
|
|
13522
|
-
), /* @__PURE__ */
|
|
13826
|
+
/* @__PURE__ */ React113.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleCode().run() }, "</>", " Inline Code"),
|
|
13827
|
+
/* @__PURE__ */ React113.createElement("button", { className: "dropdown-item", onClick: () => editor.chain().focus().toggleCodeBlock().run() }, "{ }", " Code Block")
|
|
13828
|
+
), /* @__PURE__ */ React113.createElement(
|
|
13523
13829
|
"button",
|
|
13524
13830
|
{
|
|
13525
13831
|
className: `toolbar-btn ${isFullscreen ? "is-active" : ""}`,
|
|
13526
13832
|
onClick: toggleFullscreen,
|
|
13527
13833
|
title: "Toggle Fullscreen"
|
|
13528
13834
|
},
|
|
13529
|
-
/* @__PURE__ */
|
|
13530
|
-
), /* @__PURE__ */
|
|
13835
|
+
/* @__PURE__ */ React113.createElement(IconFullscreen, null)
|
|
13836
|
+
), /* @__PURE__ */ React113.createElement(TextToSpeech_default, { editor, onTextToSpeech }), /* @__PURE__ */ React113.createElement(SpeechToText_default, { editor, onSpeechToText }), /* @__PURE__ */ React113.createElement("div", { className: "translate-split-btn" }, /* @__PURE__ */ React113.createElement(
|
|
13531
13837
|
"button",
|
|
13532
13838
|
{
|
|
13533
13839
|
className: "toolbar-btn",
|
|
13534
13840
|
onClick: handleQuickTranslate,
|
|
13535
13841
|
title: "Translate selected text"
|
|
13536
13842
|
},
|
|
13537
|
-
/* @__PURE__ */
|
|
13538
|
-
), /* @__PURE__ */
|
|
13843
|
+
/* @__PURE__ */ React113.createElement(IconTranslate, null)
|
|
13844
|
+
), /* @__PURE__ */ React113.createElement(Dropdown, { trigger: { label: "", title: "Translate options", className: "translate-arrow-btn" } }, /* @__PURE__ */ React113.createElement("button", { className: "dropdown-item", onClick: () => setShowTranslateModal(true) }, "Options")), translateStatus && /* @__PURE__ */ React113.createElement("span", { className: `translate-toast-popup ${translateStatus === "Please select the text" || translateStatus === "Translation failed" ? "error" : ""}` }, translateStatus)), /* @__PURE__ */ React113.createElement(AICommands_default, { editor, onAICommand }), /* @__PURE__ */ React113.createElement(
|
|
13539
13845
|
Dropdown,
|
|
13540
13846
|
{
|
|
13541
|
-
trigger: { label: /* @__PURE__ */
|
|
13847
|
+
trigger: { label: /* @__PURE__ */ React113.createElement(IconTaskList, null), title: "Task list", className: editor.isActive("taskList") ? "is-active" : "" },
|
|
13542
13848
|
keepOpen: true
|
|
13543
13849
|
},
|
|
13544
13850
|
["todo", "working", "blocked", "resolved"].map((status) => {
|
|
13545
13851
|
const symbols = { todo: "\u2610", working: "\u27F3", blocked: "\u25A0", resolved: "\u2611" };
|
|
13546
13852
|
const labels = { todo: "Todo", working: "Working", blocked: "Blocked", resolved: "Resolved" };
|
|
13547
|
-
return /* @__PURE__ */
|
|
13853
|
+
return /* @__PURE__ */ React113.createElement("button", { key: status, className: `dropdown-item task-status-item`, onClick: () => {
|
|
13548
13854
|
const { state } = editor;
|
|
13549
13855
|
const { schema } = state;
|
|
13550
13856
|
const taskItemType = schema.nodes.taskItem;
|
|
@@ -13577,9 +13883,9 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13577
13883
|
}
|
|
13578
13884
|
return true;
|
|
13579
13885
|
}).run();
|
|
13580
|
-
} }, /* @__PURE__ */
|
|
13886
|
+
} }, /* @__PURE__ */ React113.createElement("span", { className: `task-icon task-${status}` }, symbols[status]), " ", labels[status]);
|
|
13581
13887
|
})
|
|
13582
|
-
)), showTranslateModal && /* @__PURE__ */
|
|
13888
|
+
)), showTranslateModal && /* @__PURE__ */ React113.createElement(
|
|
13583
13889
|
TranslateModal_default,
|
|
13584
13890
|
{
|
|
13585
13891
|
editor,
|
|
@@ -13597,7 +13903,7 @@ var Toolbar = ({ editor, setLink, onAICommand, onTranslate, onSpeechToText, onTe
|
|
|
13597
13903
|
var Toolbar_default = Toolbar;
|
|
13598
13904
|
|
|
13599
13905
|
// lib/RufousTextEditor/ImageToolbar.tsx
|
|
13600
|
-
import
|
|
13906
|
+
import React114, { useState as useState32, useEffect as useEffect25, useRef as useRef28 } from "react";
|
|
13601
13907
|
var ALIGNMENTS = [
|
|
13602
13908
|
{ value: "left", label: "Left", icon: "\u2630" },
|
|
13603
13909
|
{ value: "center", label: "Center", icon: "\u2261" },
|
|
@@ -13609,18 +13915,18 @@ var VERTICAL_ALIGNMENTS = [
|
|
|
13609
13915
|
{ value: "bottom", label: "Bottom", icon: "\u2193" }
|
|
13610
13916
|
];
|
|
13611
13917
|
var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
13612
|
-
const [activeTab, setActiveTab] =
|
|
13613
|
-
const [src, setSrc] =
|
|
13614
|
-
const [title, setTitle] =
|
|
13615
|
-
const [alt, setAlt] =
|
|
13616
|
-
const [link, setLink] =
|
|
13617
|
-
const [openInNewTab, setOpenInNewTab] =
|
|
13618
|
-
const [width, setWidth] =
|
|
13619
|
-
const [height, setHeight] =
|
|
13620
|
-
const [lockRatio, setLockRatio] =
|
|
13621
|
-
const [naturalWidth, setNaturalWidth] =
|
|
13622
|
-
const [naturalHeight, setNaturalHeight] =
|
|
13623
|
-
|
|
13918
|
+
const [activeTab, setActiveTab] = useState32("image");
|
|
13919
|
+
const [src, setSrc] = useState32(node?.attrs?.src || "");
|
|
13920
|
+
const [title, setTitle] = useState32(node?.attrs?.title || "");
|
|
13921
|
+
const [alt, setAlt] = useState32(node?.attrs?.alt || "");
|
|
13922
|
+
const [link, setLink] = useState32("");
|
|
13923
|
+
const [openInNewTab, setOpenInNewTab] = useState32(false);
|
|
13924
|
+
const [width, setWidth] = useState32("");
|
|
13925
|
+
const [height, setHeight] = useState32("");
|
|
13926
|
+
const [lockRatio, setLockRatio] = useState32(true);
|
|
13927
|
+
const [naturalWidth, setNaturalWidth] = useState32(0);
|
|
13928
|
+
const [naturalHeight, setNaturalHeight] = useState32(0);
|
|
13929
|
+
useEffect25(() => {
|
|
13624
13930
|
if (src) {
|
|
13625
13931
|
const img = new window.Image();
|
|
13626
13932
|
img.onload = () => {
|
|
@@ -13659,7 +13965,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13659
13965
|
editor.chain().focus().deleteSelection().run();
|
|
13660
13966
|
onClose();
|
|
13661
13967
|
};
|
|
13662
|
-
return /* @__PURE__ */
|
|
13968
|
+
return /* @__PURE__ */ React114.createElement("div", { className: "modal-overlay", onClick: onClose }, /* @__PURE__ */ React114.createElement("div", { className: "modal-content", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React114.createElement("div", { className: "modal-header" }, /* @__PURE__ */ React114.createElement("h3", null, "Image properties"), /* @__PURE__ */ React114.createElement("button", { className: "modal-close", onClick: onClose }, "\xD7")), /* @__PURE__ */ React114.createElement("div", { className: "modal-body" }, /* @__PURE__ */ React114.createElement("div", { className: "modal-layout" }, /* @__PURE__ */ React114.createElement("div", { className: "modal-preview-col" }, src && /* @__PURE__ */ React114.createElement("div", { className: "modal-preview" }, /* @__PURE__ */ React114.createElement("img", { src, alt: alt || "Preview" })), /* @__PURE__ */ React114.createElement("div", { className: "modal-dimensions" }, /* @__PURE__ */ React114.createElement(
|
|
13663
13969
|
"input",
|
|
13664
13970
|
{
|
|
13665
13971
|
type: "number",
|
|
@@ -13667,7 +13973,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13667
13973
|
value: width,
|
|
13668
13974
|
onChange: (e) => handleWidthChange(e.target.value)
|
|
13669
13975
|
}
|
|
13670
|
-
), /* @__PURE__ */
|
|
13976
|
+
), /* @__PURE__ */ React114.createElement(
|
|
13671
13977
|
"button",
|
|
13672
13978
|
{
|
|
13673
13979
|
className: `lock-btn ${lockRatio ? "locked" : ""}`,
|
|
@@ -13675,7 +13981,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13675
13981
|
title: lockRatio ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
13676
13982
|
},
|
|
13677
13983
|
lockRatio ? "\u{1F512}" : "\u{1F513}"
|
|
13678
|
-
), /* @__PURE__ */
|
|
13984
|
+
), /* @__PURE__ */ React114.createElement(
|
|
13679
13985
|
"input",
|
|
13680
13986
|
{
|
|
13681
13987
|
type: "number",
|
|
@@ -13683,21 +13989,21 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13683
13989
|
value: height,
|
|
13684
13990
|
onChange: (e) => handleHeightChange(e.target.value)
|
|
13685
13991
|
}
|
|
13686
|
-
))), /* @__PURE__ */
|
|
13992
|
+
))), /* @__PURE__ */ React114.createElement("div", { className: "modal-fields-col" }, /* @__PURE__ */ React114.createElement("div", { className: "modal-tabs" }, /* @__PURE__ */ React114.createElement(
|
|
13687
13993
|
"button",
|
|
13688
13994
|
{
|
|
13689
13995
|
className: `modal-tab ${activeTab === "image" ? "active" : ""}`,
|
|
13690
13996
|
onClick: () => setActiveTab("image")
|
|
13691
13997
|
},
|
|
13692
13998
|
"Image"
|
|
13693
|
-
), /* @__PURE__ */
|
|
13999
|
+
), /* @__PURE__ */ React114.createElement(
|
|
13694
14000
|
"button",
|
|
13695
14001
|
{
|
|
13696
14002
|
className: `modal-tab ${activeTab === "advanced" ? "active" : ""}`,
|
|
13697
14003
|
onClick: () => setActiveTab("advanced")
|
|
13698
14004
|
},
|
|
13699
14005
|
"Advanced"
|
|
13700
|
-
)), activeTab === "image" ? /* @__PURE__ */
|
|
14006
|
+
)), activeTab === "image" ? /* @__PURE__ */ React114.createElement(React114.Fragment, null, /* @__PURE__ */ React114.createElement("label", { className: "modal-label" }, "Src"), /* @__PURE__ */ React114.createElement(
|
|
13701
14007
|
"input",
|
|
13702
14008
|
{
|
|
13703
14009
|
type: "text",
|
|
@@ -13705,7 +14011,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13705
14011
|
value: src,
|
|
13706
14012
|
onChange: (e) => setSrc(e.target.value)
|
|
13707
14013
|
}
|
|
13708
|
-
), /* @__PURE__ */
|
|
14014
|
+
), /* @__PURE__ */ React114.createElement("label", { className: "modal-label" }, "Title"), /* @__PURE__ */ React114.createElement(
|
|
13709
14015
|
"input",
|
|
13710
14016
|
{
|
|
13711
14017
|
type: "text",
|
|
@@ -13713,7 +14019,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13713
14019
|
value: title,
|
|
13714
14020
|
onChange: (e) => setTitle(e.target.value)
|
|
13715
14021
|
}
|
|
13716
|
-
), /* @__PURE__ */
|
|
14022
|
+
), /* @__PURE__ */ React114.createElement("label", { className: "modal-label" }, "Alternative"), /* @__PURE__ */ React114.createElement(
|
|
13717
14023
|
"input",
|
|
13718
14024
|
{
|
|
13719
14025
|
type: "text",
|
|
@@ -13721,7 +14027,7 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13721
14027
|
value: alt,
|
|
13722
14028
|
onChange: (e) => setAlt(e.target.value)
|
|
13723
14029
|
}
|
|
13724
|
-
), /* @__PURE__ */
|
|
14030
|
+
), /* @__PURE__ */ React114.createElement("label", { className: "modal-label" }, "Link"), /* @__PURE__ */ React114.createElement(
|
|
13725
14031
|
"input",
|
|
13726
14032
|
{
|
|
13727
14033
|
type: "text",
|
|
@@ -13729,23 +14035,23 @@ var ImagePropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13729
14035
|
value: link,
|
|
13730
14036
|
onChange: (e) => setLink(e.target.value)
|
|
13731
14037
|
}
|
|
13732
|
-
), /* @__PURE__ */
|
|
14038
|
+
), /* @__PURE__ */ React114.createElement("label", { className: "modal-checkbox" }, /* @__PURE__ */ React114.createElement(
|
|
13733
14039
|
"input",
|
|
13734
14040
|
{
|
|
13735
14041
|
type: "checkbox",
|
|
13736
14042
|
checked: openInNewTab,
|
|
13737
14043
|
onChange: (e) => setOpenInNewTab(e.target.checked)
|
|
13738
14044
|
}
|
|
13739
|
-
), "Open link in new tab")) : /* @__PURE__ */
|
|
14045
|
+
), "Open link in new tab")) : /* @__PURE__ */ React114.createElement(React114.Fragment, null, /* @__PURE__ */ React114.createElement("label", { className: "modal-label" }, "CSS Class"), /* @__PURE__ */ React114.createElement("input", { type: "text", className: "modal-input", placeholder: "e.g. rounded shadow" }), /* @__PURE__ */ React114.createElement("label", { className: "modal-label" }, "Inline Style"), /* @__PURE__ */ React114.createElement("input", { type: "text", className: "modal-input", placeholder: "e.g. border: 1px solid #ccc" }))))), /* @__PURE__ */ React114.createElement("div", { className: "modal-footer" }, /* @__PURE__ */ React114.createElement("div", { className: "modal-footer-left" }, /* @__PURE__ */ React114.createElement("button", { className: "modal-btn-cancel", onClick: onClose }, "\xD7 Cancel"), /* @__PURE__ */ React114.createElement("button", { className: "modal-btn-delete", onClick: handleDelete }, "\u{1F5D1} Delete")), /* @__PURE__ */ React114.createElement("button", { className: "modal-btn-apply", onClick: handleApply }, "\u2714 Apply"))));
|
|
13740
14046
|
};
|
|
13741
14047
|
var ImageToolbar = ({ editor }) => {
|
|
13742
|
-
const [showModal, setShowModal] =
|
|
13743
|
-
const [showAlign, setShowAlign] =
|
|
13744
|
-
const [showVAlign, setShowVAlign] =
|
|
13745
|
-
const [copyStatus, setCopyStatus] =
|
|
13746
|
-
const [pos, setPos] =
|
|
13747
|
-
const toolbarRef =
|
|
13748
|
-
|
|
14048
|
+
const [showModal, setShowModal] = useState32(false);
|
|
14049
|
+
const [showAlign, setShowAlign] = useState32(false);
|
|
14050
|
+
const [showVAlign, setShowVAlign] = useState32(false);
|
|
14051
|
+
const [copyStatus, setCopyStatus] = useState32("");
|
|
14052
|
+
const [pos, setPos] = useState32(null);
|
|
14053
|
+
const toolbarRef = useRef28(null);
|
|
14054
|
+
useEffect25(() => {
|
|
13749
14055
|
if (!editor) return;
|
|
13750
14056
|
const update = () => {
|
|
13751
14057
|
const { selection } = editor.state;
|
|
@@ -13775,7 +14081,7 @@ var ImageToolbar = ({ editor }) => {
|
|
|
13775
14081
|
}, [editor]);
|
|
13776
14082
|
const node = editor?.state.selection.node;
|
|
13777
14083
|
const isImage = node && node.type.name === "image";
|
|
13778
|
-
if (!editor || !isImage || !pos) return showModal ? /* @__PURE__ */
|
|
14084
|
+
if (!editor || !isImage || !pos) return showModal ? /* @__PURE__ */ React114.createElement(ImagePropertiesModal, { editor, node, onClose: () => setShowModal(false) }) : null;
|
|
13779
14085
|
const handleDelete = () => {
|
|
13780
14086
|
editor.chain().focus().deleteSelection().run();
|
|
13781
14087
|
};
|
|
@@ -13830,7 +14136,7 @@ var ImageToolbar = ({ editor }) => {
|
|
|
13830
14136
|
);
|
|
13831
14137
|
setShowVAlign(false);
|
|
13832
14138
|
};
|
|
13833
|
-
return /* @__PURE__ */
|
|
14139
|
+
return /* @__PURE__ */ React114.createElement(React114.Fragment, null, /* @__PURE__ */ React114.createElement(
|
|
13834
14140
|
"div",
|
|
13835
14141
|
{
|
|
13836
14142
|
className: "image-toolbar",
|
|
@@ -13838,18 +14144,18 @@ var ImageToolbar = ({ editor }) => {
|
|
|
13838
14144
|
style: { top: pos.top, left: pos.left },
|
|
13839
14145
|
onMouseDown: (e) => e.preventDefault()
|
|
13840
14146
|
},
|
|
13841
|
-
/* @__PURE__ */
|
|
13842
|
-
/* @__PURE__ */
|
|
13843
|
-
/* @__PURE__ */
|
|
13844
|
-
/* @__PURE__ */
|
|
14147
|
+
/* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: handleDelete, title: "Delete" }, "\u{1F5D1}"),
|
|
14148
|
+
/* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: () => setShowModal(true), title: "Edit properties" }, "\u270E"),
|
|
14149
|
+
/* @__PURE__ */ React114.createElement("div", { className: "img-tool-copy-wrapper" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: handleCopy, title: "Copy image" }, copyStatus ? "\u2713" : "\u{1F4CB}"), copyStatus && /* @__PURE__ */ React114.createElement("span", { className: "img-copy-toast" }, copyStatus)),
|
|
14150
|
+
/* @__PURE__ */ React114.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
13845
14151
|
setShowVAlign(!showVAlign);
|
|
13846
14152
|
setShowAlign(false);
|
|
13847
|
-
}, title: "Vertical alignment" }, "\u2195 ", /* @__PURE__ */
|
|
13848
|
-
/* @__PURE__ */
|
|
14153
|
+
}, title: "Vertical alignment" }, "\u2195 ", /* @__PURE__ */ React114.createElement("span", { className: "dropdown-arrow" }, "\u25BE")), showVAlign && /* @__PURE__ */ React114.createElement("div", { className: "img-tool-menu" }, VERTICAL_ALIGNMENTS.map((a) => /* @__PURE__ */ React114.createElement("button", { key: a.value, className: "dropdown-item", onClick: () => setVerticalAlignmentVal(a.value) }, a.icon, " ", a.label)))),
|
|
14154
|
+
/* @__PURE__ */ React114.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React114.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
13849
14155
|
setShowAlign(!showAlign);
|
|
13850
14156
|
setShowVAlign(false);
|
|
13851
|
-
}, title: "Horizontal alignment" }, "\u2630 ", /* @__PURE__ */
|
|
13852
|
-
), showModal && /* @__PURE__ */
|
|
14157
|
+
}, title: "Horizontal alignment" }, "\u2630 ", /* @__PURE__ */ React114.createElement("span", { className: "dropdown-arrow" }, "\u25BE")), showAlign && /* @__PURE__ */ React114.createElement("div", { className: "img-tool-menu" }, ALIGNMENTS.map((a) => /* @__PURE__ */ React114.createElement("button", { key: a.value, className: "dropdown-item", onClick: () => setAlignmentVal(a.value) }, a.icon, " ", a.label))))
|
|
14158
|
+
), showModal && /* @__PURE__ */ React114.createElement(
|
|
13853
14159
|
ImagePropertiesModal,
|
|
13854
14160
|
{
|
|
13855
14161
|
editor,
|
|
@@ -13861,17 +14167,17 @@ var ImageToolbar = ({ editor }) => {
|
|
|
13861
14167
|
var ImageToolbar_default = ImageToolbar;
|
|
13862
14168
|
|
|
13863
14169
|
// lib/RufousTextEditor/VideoToolbar.tsx
|
|
13864
|
-
import
|
|
14170
|
+
import React115, { useState as useState33, useEffect as useEffect26, useRef as useRef29 } from "react";
|
|
13865
14171
|
var ALIGNMENTS2 = [
|
|
13866
14172
|
{ value: "left", label: "Left", icon: "\u2630" },
|
|
13867
14173
|
{ value: "center", label: "Center", icon: "\u2261" },
|
|
13868
14174
|
{ value: "right", label: "Right", icon: "\u2263" }
|
|
13869
14175
|
];
|
|
13870
14176
|
var VideoPropertiesModal = ({ editor, node, onClose }) => {
|
|
13871
|
-
const [src, setSrc] =
|
|
13872
|
-
const [width, setWidth] =
|
|
13873
|
-
const [height, setHeight] =
|
|
13874
|
-
const [lockRatio, setLockRatio] =
|
|
14177
|
+
const [src, setSrc] = useState33(node?.attrs?.src || "");
|
|
14178
|
+
const [width, setWidth] = useState33(String(node?.attrs?.width || 640));
|
|
14179
|
+
const [height, setHeight] = useState33(String(node?.attrs?.height || 360));
|
|
14180
|
+
const [lockRatio, setLockRatio] = useState33(true);
|
|
13875
14181
|
const handleWidthChange = (val) => {
|
|
13876
14182
|
setWidth(val);
|
|
13877
14183
|
if (lockRatio) {
|
|
@@ -13903,7 +14209,7 @@ var VideoPropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13903
14209
|
editor.chain().focus().deleteSelection().run();
|
|
13904
14210
|
onClose();
|
|
13905
14211
|
};
|
|
13906
|
-
return /* @__PURE__ */
|
|
14212
|
+
return /* @__PURE__ */ React115.createElement("div", { className: "modal-overlay", onClick: onClose }, /* @__PURE__ */ React115.createElement("div", { className: "modal-content", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React115.createElement("div", { className: "modal-header" }, /* @__PURE__ */ React115.createElement("h3", null, "Video properties"), /* @__PURE__ */ React115.createElement("button", { className: "modal-close", onClick: onClose }, "\xD7")), /* @__PURE__ */ React115.createElement("div", { className: "modal-body" }, /* @__PURE__ */ React115.createElement("div", { className: "modal-layout" }, /* @__PURE__ */ React115.createElement("div", { className: "modal-preview-col" }, src && /* @__PURE__ */ React115.createElement("div", { className: "modal-preview", style: { background: "#000" } }, /* @__PURE__ */ React115.createElement(
|
|
13907
14213
|
"iframe",
|
|
13908
14214
|
{
|
|
13909
14215
|
src,
|
|
@@ -13911,7 +14217,7 @@ var VideoPropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13911
14217
|
style: { width: "100%", aspectRatio: "16/9", border: "none", display: "block" },
|
|
13912
14218
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
|
13913
14219
|
}
|
|
13914
|
-
)), /* @__PURE__ */
|
|
14220
|
+
)), /* @__PURE__ */ React115.createElement("div", { className: "modal-dimensions" }, /* @__PURE__ */ React115.createElement(
|
|
13915
14221
|
"input",
|
|
13916
14222
|
{
|
|
13917
14223
|
type: "number",
|
|
@@ -13919,7 +14225,7 @@ var VideoPropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13919
14225
|
value: width,
|
|
13920
14226
|
onChange: (e) => handleWidthChange(e.target.value)
|
|
13921
14227
|
}
|
|
13922
|
-
), /* @__PURE__ */
|
|
14228
|
+
), /* @__PURE__ */ React115.createElement(
|
|
13923
14229
|
"button",
|
|
13924
14230
|
{
|
|
13925
14231
|
className: `lock-btn ${lockRatio ? "locked" : ""}`,
|
|
@@ -13927,7 +14233,7 @@ var VideoPropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13927
14233
|
title: lockRatio ? "Unlock aspect ratio" : "Lock aspect ratio"
|
|
13928
14234
|
},
|
|
13929
14235
|
lockRatio ? "\u{1F512}" : "\u{1F513}"
|
|
13930
|
-
), /* @__PURE__ */
|
|
14236
|
+
), /* @__PURE__ */ React115.createElement(
|
|
13931
14237
|
"input",
|
|
13932
14238
|
{
|
|
13933
14239
|
type: "number",
|
|
@@ -13935,7 +14241,7 @@ var VideoPropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13935
14241
|
value: height,
|
|
13936
14242
|
onChange: (e) => handleHeightChange(e.target.value)
|
|
13937
14243
|
}
|
|
13938
|
-
))), /* @__PURE__ */
|
|
14244
|
+
))), /* @__PURE__ */ React115.createElement("div", { className: "modal-fields-col" }, /* @__PURE__ */ React115.createElement("label", { className: "modal-label" }, "Video URL"), /* @__PURE__ */ React115.createElement(
|
|
13939
14245
|
"input",
|
|
13940
14246
|
{
|
|
13941
14247
|
type: "text",
|
|
@@ -13943,7 +14249,7 @@ var VideoPropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13943
14249
|
value: src,
|
|
13944
14250
|
onChange: (e) => setSrc(e.target.value)
|
|
13945
14251
|
}
|
|
13946
|
-
), /* @__PURE__ */
|
|
14252
|
+
), /* @__PURE__ */ React115.createElement("label", { className: "modal-label" }, "Width"), /* @__PURE__ */ React115.createElement(
|
|
13947
14253
|
"input",
|
|
13948
14254
|
{
|
|
13949
14255
|
type: "number",
|
|
@@ -13951,7 +14257,7 @@ var VideoPropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13951
14257
|
value: width,
|
|
13952
14258
|
onChange: (e) => handleWidthChange(e.target.value)
|
|
13953
14259
|
}
|
|
13954
|
-
), /* @__PURE__ */
|
|
14260
|
+
), /* @__PURE__ */ React115.createElement("label", { className: "modal-label" }, "Height"), /* @__PURE__ */ React115.createElement(
|
|
13955
14261
|
"input",
|
|
13956
14262
|
{
|
|
13957
14263
|
type: "number",
|
|
@@ -13959,16 +14265,16 @@ var VideoPropertiesModal = ({ editor, node, onClose }) => {
|
|
|
13959
14265
|
value: height,
|
|
13960
14266
|
onChange: (e) => handleHeightChange(e.target.value)
|
|
13961
14267
|
}
|
|
13962
|
-
)))), /* @__PURE__ */
|
|
14268
|
+
)))), /* @__PURE__ */ React115.createElement("div", { className: "modal-footer" }, /* @__PURE__ */ React115.createElement("div", { className: "modal-footer-left" }, /* @__PURE__ */ React115.createElement("button", { className: "modal-btn-cancel", onClick: onClose }, "\xD7 Cancel"), /* @__PURE__ */ React115.createElement("button", { className: "modal-btn-delete", onClick: handleDelete }, "\u{1F5D1} Delete")), /* @__PURE__ */ React115.createElement("button", { className: "modal-btn-apply", onClick: handleApply }, "\u2714 Apply"))));
|
|
13963
14269
|
};
|
|
13964
14270
|
var VideoToolbar = ({ editor }) => {
|
|
13965
|
-
const [showModal, setShowModal] =
|
|
13966
|
-
const [showSize, setShowSize] =
|
|
13967
|
-
const [showAlign, setShowAlign] =
|
|
13968
|
-
const [copyStatus, setCopyStatus] =
|
|
13969
|
-
const [pos, setPos] =
|
|
13970
|
-
const toolbarRef =
|
|
13971
|
-
|
|
14271
|
+
const [showModal, setShowModal] = useState33(false);
|
|
14272
|
+
const [showSize, setShowSize] = useState33(false);
|
|
14273
|
+
const [showAlign, setShowAlign] = useState33(false);
|
|
14274
|
+
const [copyStatus, setCopyStatus] = useState33("");
|
|
14275
|
+
const [pos, setPos] = useState33(null);
|
|
14276
|
+
const toolbarRef = useRef29(null);
|
|
14277
|
+
useEffect26(() => {
|
|
13972
14278
|
if (!editor) return;
|
|
13973
14279
|
const update = () => {
|
|
13974
14280
|
const { selection } = editor.state;
|
|
@@ -13998,7 +14304,7 @@ var VideoToolbar = ({ editor }) => {
|
|
|
13998
14304
|
}, [editor]);
|
|
13999
14305
|
const node = editor?.state.selection.node;
|
|
14000
14306
|
const isVideo = node && node.type.name === "youtube";
|
|
14001
|
-
if (!editor || !isVideo || !pos) return showModal ? /* @__PURE__ */
|
|
14307
|
+
if (!editor || !isVideo || !pos) return showModal ? /* @__PURE__ */ React115.createElement(VideoPropertiesModal, { editor, node, onClose: () => setShowModal(false) }) : null;
|
|
14002
14308
|
const handleDelete = () => {
|
|
14003
14309
|
editor.chain().focus().deleteSelection().run();
|
|
14004
14310
|
};
|
|
@@ -14042,7 +14348,7 @@ var VideoToolbar = ({ editor }) => {
|
|
|
14042
14348
|
})
|
|
14043
14349
|
);
|
|
14044
14350
|
};
|
|
14045
|
-
return /* @__PURE__ */
|
|
14351
|
+
return /* @__PURE__ */ React115.createElement(React115.Fragment, null, /* @__PURE__ */ React115.createElement(
|
|
14046
14352
|
"div",
|
|
14047
14353
|
{
|
|
14048
14354
|
className: "image-toolbar",
|
|
@@ -14050,30 +14356,30 @@ var VideoToolbar = ({ editor }) => {
|
|
|
14050
14356
|
style: { top: pos.top, left: pos.left },
|
|
14051
14357
|
onMouseDown: (e) => e.preventDefault()
|
|
14052
14358
|
},
|
|
14053
|
-
/* @__PURE__ */
|
|
14054
|
-
/* @__PURE__ */
|
|
14055
|
-
/* @__PURE__ */
|
|
14056
|
-
/* @__PURE__ */
|
|
14359
|
+
/* @__PURE__ */ React115.createElement("button", { className: "img-tool-btn", onClick: handleDelete, title: "Delete" }, "\u{1F5D1}"),
|
|
14360
|
+
/* @__PURE__ */ React115.createElement("button", { className: "img-tool-btn", onClick: () => setShowModal(true), title: "Edit properties" }, "\u270E"),
|
|
14361
|
+
/* @__PURE__ */ React115.createElement("div", { className: "img-tool-copy-wrapper" }, /* @__PURE__ */ React115.createElement("button", { className: "img-tool-btn", onClick: handleCopy, title: "Copy URL" }, copyStatus ? "\u2713" : "\u{1F4CB}"), copyStatus && /* @__PURE__ */ React115.createElement("span", { className: "img-copy-toast" }, copyStatus)),
|
|
14362
|
+
/* @__PURE__ */ React115.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React115.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
14057
14363
|
setShowSize(!showSize);
|
|
14058
14364
|
setShowAlign(false);
|
|
14059
|
-
}, title: "Size presets" }, /* @__PURE__ */
|
|
14365
|
+
}, title: "Size presets" }, /* @__PURE__ */ React115.createElement("span", { style: { fontSize: "11px" } }, node.attrs.width || 640, "x", node.attrs.height || 360), /* @__PURE__ */ React115.createElement("span", { className: "dropdown-arrow" }, "\u25BE")), showSize && /* @__PURE__ */ React115.createElement("div", { className: "img-tool-menu" }, /* @__PURE__ */ React115.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
14060
14366
|
handleResize("small");
|
|
14061
14367
|
setShowSize(false);
|
|
14062
|
-
} }, "Small (320x180)"), /* @__PURE__ */
|
|
14368
|
+
} }, "Small (320x180)"), /* @__PURE__ */ React115.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
14063
14369
|
handleResize("medium");
|
|
14064
14370
|
setShowSize(false);
|
|
14065
|
-
} }, "Medium (480x270)"), /* @__PURE__ */
|
|
14371
|
+
} }, "Medium (480x270)"), /* @__PURE__ */ React115.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
14066
14372
|
handleResize("large");
|
|
14067
14373
|
setShowSize(false);
|
|
14068
|
-
} }, "Large (640x360)"), /* @__PURE__ */
|
|
14374
|
+
} }, "Large (640x360)"), /* @__PURE__ */ React115.createElement("button", { className: "dropdown-item", onClick: () => {
|
|
14069
14375
|
handleResize("full");
|
|
14070
14376
|
setShowSize(false);
|
|
14071
14377
|
} }, "Full (854x480)"))),
|
|
14072
|
-
/* @__PURE__ */
|
|
14378
|
+
/* @__PURE__ */ React115.createElement("div", { className: "img-tool-dropdown" }, /* @__PURE__ */ React115.createElement("button", { className: "img-tool-btn", onClick: () => {
|
|
14073
14379
|
setShowAlign(!showAlign);
|
|
14074
14380
|
setShowSize(false);
|
|
14075
|
-
}, title: "Horizontal alignment" }, "\u2630 ", /* @__PURE__ */
|
|
14076
|
-
), showModal && /* @__PURE__ */
|
|
14381
|
+
}, title: "Horizontal alignment" }, "\u2630 ", /* @__PURE__ */ React115.createElement("span", { className: "dropdown-arrow" }, "\u25BE")), showAlign && /* @__PURE__ */ React115.createElement("div", { className: "img-tool-menu" }, ALIGNMENTS2.map((a) => /* @__PURE__ */ React115.createElement("button", { key: a.value, className: "dropdown-item", onClick: () => setAlignmentVal(a.value) }, a.icon, " ", a.label))))
|
|
14382
|
+
), showModal && /* @__PURE__ */ React115.createElement(
|
|
14077
14383
|
VideoPropertiesModal,
|
|
14078
14384
|
{
|
|
14079
14385
|
editor,
|
|
@@ -14193,14 +14499,14 @@ var RufousTextEditor = ({
|
|
|
14193
14499
|
}
|
|
14194
14500
|
}
|
|
14195
14501
|
});
|
|
14196
|
-
const [linkModalOpen, setLinkModalOpen] =
|
|
14197
|
-
const [linkUrl, setLinkUrl] =
|
|
14198
|
-
const [linkText, setLinkText] =
|
|
14199
|
-
const [linkClassName, setLinkClassName] =
|
|
14200
|
-
const [linkNewTab, setLinkNewTab] =
|
|
14201
|
-
const [linkNoFollow, setLinkNoFollow] =
|
|
14202
|
-
const [linkSelection, setLinkSelection] =
|
|
14203
|
-
const setLink =
|
|
14502
|
+
const [linkModalOpen, setLinkModalOpen] = useState34(false);
|
|
14503
|
+
const [linkUrl, setLinkUrl] = useState34("");
|
|
14504
|
+
const [linkText, setLinkText] = useState34("");
|
|
14505
|
+
const [linkClassName, setLinkClassName] = useState34("");
|
|
14506
|
+
const [linkNewTab, setLinkNewTab] = useState34(true);
|
|
14507
|
+
const [linkNoFollow, setLinkNoFollow] = useState34(false);
|
|
14508
|
+
const [linkSelection, setLinkSelection] = useState34(null);
|
|
14509
|
+
const setLink = useCallback13(() => {
|
|
14204
14510
|
if (!editor) return;
|
|
14205
14511
|
const attrs = editor.getAttributes("link");
|
|
14206
14512
|
const previousUrl = attrs.href || "";
|
|
@@ -14214,7 +14520,7 @@ var RufousTextEditor = ({
|
|
|
14214
14520
|
setLinkSelection({ from, to });
|
|
14215
14521
|
setLinkModalOpen(true);
|
|
14216
14522
|
}, [editor]);
|
|
14217
|
-
const handleLinkSubmit =
|
|
14523
|
+
const handleLinkSubmit = useCallback13(() => {
|
|
14218
14524
|
if (!editor || !linkSelection) return;
|
|
14219
14525
|
editor.chain().focus().setTextSelection(linkSelection).run();
|
|
14220
14526
|
if (linkUrl === "") {
|
|
@@ -14250,7 +14556,7 @@ var RufousTextEditor = ({
|
|
|
14250
14556
|
setLinkClassName("");
|
|
14251
14557
|
setLinkSelection(null);
|
|
14252
14558
|
}, [editor, linkUrl, linkText, linkClassName, linkNewTab, linkNoFollow, linkSelection]);
|
|
14253
|
-
const handleLinkRemove =
|
|
14559
|
+
const handleLinkRemove = useCallback13(() => {
|
|
14254
14560
|
if (!editor || !linkSelection) return;
|
|
14255
14561
|
editor.chain().focus().setTextSelection(linkSelection).extendMarkRange("link").unsetLink().run();
|
|
14256
14562
|
setLinkModalOpen(false);
|
|
@@ -14259,7 +14565,7 @@ var RufousTextEditor = ({
|
|
|
14259
14565
|
setLinkClassName("");
|
|
14260
14566
|
setLinkSelection(null);
|
|
14261
14567
|
}, [editor, linkSelection]);
|
|
14262
|
-
const handleLinkCancel =
|
|
14568
|
+
const handleLinkCancel = useCallback13(() => {
|
|
14263
14569
|
setLinkModalOpen(false);
|
|
14264
14570
|
setLinkUrl("");
|
|
14265
14571
|
setLinkText("");
|
|
@@ -14267,26 +14573,26 @@ var RufousTextEditor = ({
|
|
|
14267
14573
|
setLinkSelection(null);
|
|
14268
14574
|
editor?.chain().focus().run();
|
|
14269
14575
|
}, [editor]);
|
|
14270
|
-
const [saveFormat, setSaveFormat] =
|
|
14271
|
-
const [saveStatus, setSaveStatus] =
|
|
14272
|
-
const handleSave =
|
|
14576
|
+
const [saveFormat, setSaveFormat] = useState34("html");
|
|
14577
|
+
const [saveStatus, setSaveStatus] = useState34("");
|
|
14578
|
+
const handleSave = useCallback13(() => {
|
|
14273
14579
|
if (!editor || !onSaveProp) return;
|
|
14274
14580
|
onSaveProp(editor.getHTML(), editor.getJSON());
|
|
14275
14581
|
setSaveStatus("Saved!");
|
|
14276
14582
|
setTimeout(() => setSaveStatus(""), 2e3);
|
|
14277
14583
|
}, [editor, onSaveProp]);
|
|
14278
|
-
const handleExport =
|
|
14584
|
+
const handleExport = useCallback13(() => {
|
|
14279
14585
|
if (!editor || !onExportProp) return;
|
|
14280
14586
|
onExportProp(editor.getHTML(), editor.getJSON());
|
|
14281
14587
|
}, [editor, onExportProp]);
|
|
14282
|
-
const handleClear =
|
|
14588
|
+
const handleClear = useCallback13(() => {
|
|
14283
14589
|
if (!editor) return;
|
|
14284
14590
|
if (window.confirm("Clear all content? This cannot be undone.")) {
|
|
14285
14591
|
editor.commands.clearContent();
|
|
14286
14592
|
}
|
|
14287
14593
|
}, [editor]);
|
|
14288
14594
|
const providerValue = useMemo4(() => ({ editor }), [editor]);
|
|
14289
|
-
return /* @__PURE__ */
|
|
14595
|
+
return /* @__PURE__ */ React116.createElement("div", { className: `rf-rte-wrapper editor-wrapper ${className || ""}`, style }, /* @__PURE__ */ React116.createElement(EditorContext.Provider, { value: providerValue }, /* @__PURE__ */ React116.createElement(
|
|
14290
14596
|
Toolbar_default,
|
|
14291
14597
|
{
|
|
14292
14598
|
editor,
|
|
@@ -14296,7 +14602,7 @@ var RufousTextEditor = ({
|
|
|
14296
14602
|
onSpeechToText,
|
|
14297
14603
|
onTextToSpeech
|
|
14298
14604
|
}
|
|
14299
|
-
), /* @__PURE__ */
|
|
14605
|
+
), /* @__PURE__ */ React116.createElement(EditorContent, { editor, className: "editor-content-wrapper" }), /* @__PURE__ */ React116.createElement(ImageToolbar_default, { editor }), /* @__PURE__ */ React116.createElement(VideoToolbar_default, { editor }), /* @__PURE__ */ React116.createElement(
|
|
14300
14606
|
BubbleMenu,
|
|
14301
14607
|
{
|
|
14302
14608
|
editor,
|
|
@@ -14308,31 +14614,31 @@ var RufousTextEditor = ({
|
|
|
14308
14614
|
return !selection.empty;
|
|
14309
14615
|
}
|
|
14310
14616
|
},
|
|
14311
|
-
/* @__PURE__ */
|
|
14617
|
+
/* @__PURE__ */ React116.createElement(
|
|
14312
14618
|
"button",
|
|
14313
14619
|
{
|
|
14314
14620
|
onClick: () => editor?.chain().focus().toggleBold().run(),
|
|
14315
14621
|
className: editor?.isActive("bold") ? "is-active" : ""
|
|
14316
14622
|
},
|
|
14317
|
-
/* @__PURE__ */
|
|
14623
|
+
/* @__PURE__ */ React116.createElement("strong", null, "B")
|
|
14318
14624
|
),
|
|
14319
|
-
/* @__PURE__ */
|
|
14625
|
+
/* @__PURE__ */ React116.createElement(
|
|
14320
14626
|
"button",
|
|
14321
14627
|
{
|
|
14322
14628
|
onClick: () => editor?.chain().focus().toggleItalic().run(),
|
|
14323
14629
|
className: editor?.isActive("italic") ? "is-active" : ""
|
|
14324
14630
|
},
|
|
14325
|
-
/* @__PURE__ */
|
|
14631
|
+
/* @__PURE__ */ React116.createElement("em", null, "I")
|
|
14326
14632
|
),
|
|
14327
|
-
/* @__PURE__ */
|
|
14633
|
+
/* @__PURE__ */ React116.createElement(
|
|
14328
14634
|
"button",
|
|
14329
14635
|
{
|
|
14330
14636
|
onClick: () => editor?.chain().focus().toggleStrike().run(),
|
|
14331
14637
|
className: editor?.isActive("strike") ? "is-active" : ""
|
|
14332
14638
|
},
|
|
14333
|
-
/* @__PURE__ */
|
|
14639
|
+
/* @__PURE__ */ React116.createElement("s", null, "S")
|
|
14334
14640
|
),
|
|
14335
|
-
/* @__PURE__ */
|
|
14641
|
+
/* @__PURE__ */ React116.createElement(
|
|
14336
14642
|
"button",
|
|
14337
14643
|
{
|
|
14338
14644
|
onClick: () => editor?.chain().focus().toggleCode().run(),
|
|
@@ -14340,7 +14646,7 @@ var RufousTextEditor = ({
|
|
|
14340
14646
|
},
|
|
14341
14647
|
"</>"
|
|
14342
14648
|
),
|
|
14343
|
-
/* @__PURE__ */
|
|
14649
|
+
/* @__PURE__ */ React116.createElement(
|
|
14344
14650
|
"button",
|
|
14345
14651
|
{
|
|
14346
14652
|
onClick: setLink,
|
|
@@ -14348,51 +14654,51 @@ var RufousTextEditor = ({
|
|
|
14348
14654
|
},
|
|
14349
14655
|
"\u{1F517}"
|
|
14350
14656
|
)
|
|
14351
|
-
), /* @__PURE__ */
|
|
14657
|
+
), /* @__PURE__ */ React116.createElement(FloatingMenu, { editor, className: "floating-menu" }, /* @__PURE__ */ React116.createElement(
|
|
14352
14658
|
"button",
|
|
14353
14659
|
{
|
|
14354
14660
|
onClick: () => editor?.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
14355
14661
|
className: editor?.isActive("heading", { level: 1 }) ? "is-active" : ""
|
|
14356
14662
|
},
|
|
14357
14663
|
"H1"
|
|
14358
|
-
), /* @__PURE__ */
|
|
14664
|
+
), /* @__PURE__ */ React116.createElement(
|
|
14359
14665
|
"button",
|
|
14360
14666
|
{
|
|
14361
14667
|
onClick: () => editor?.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
14362
14668
|
className: editor?.isActive("heading", { level: 2 }) ? "is-active" : ""
|
|
14363
14669
|
},
|
|
14364
14670
|
"H2"
|
|
14365
|
-
), /* @__PURE__ */
|
|
14671
|
+
), /* @__PURE__ */ React116.createElement(
|
|
14366
14672
|
"button",
|
|
14367
14673
|
{
|
|
14368
14674
|
onClick: () => editor?.chain().focus().toggleBulletList().run(),
|
|
14369
14675
|
className: editor?.isActive("bulletList") ? "is-active" : ""
|
|
14370
14676
|
},
|
|
14371
14677
|
"\u2022 List"
|
|
14372
|
-
), /* @__PURE__ */
|
|
14678
|
+
), /* @__PURE__ */ React116.createElement(
|
|
14373
14679
|
"button",
|
|
14374
14680
|
{
|
|
14375
14681
|
onClick: () => editor?.chain().focus().toggleOrderedList().run(),
|
|
14376
14682
|
className: editor?.isActive("orderedList") ? "is-active" : ""
|
|
14377
14683
|
},
|
|
14378
14684
|
"1. List"
|
|
14379
|
-
), /* @__PURE__ */
|
|
14685
|
+
), /* @__PURE__ */ React116.createElement(
|
|
14380
14686
|
"button",
|
|
14381
14687
|
{
|
|
14382
14688
|
onClick: () => editor?.chain().focus().toggleBlockquote().run(),
|
|
14383
14689
|
className: editor?.isActive("blockquote") ? "is-active" : ""
|
|
14384
14690
|
},
|
|
14385
14691
|
"\u201C Quote"
|
|
14386
|
-
)), /* @__PURE__ */
|
|
14692
|
+
)), /* @__PURE__ */ React116.createElement("div", { className: "status-bar" }, /* @__PURE__ */ React116.createElement("div", { className: "status-bar-left" }, /* @__PURE__ */ React116.createElement(
|
|
14387
14693
|
"select",
|
|
14388
14694
|
{
|
|
14389
14695
|
value: saveFormat,
|
|
14390
14696
|
onChange: (e) => setSaveFormat(e.target.value),
|
|
14391
14697
|
className: "format-select"
|
|
14392
14698
|
},
|
|
14393
|
-
/* @__PURE__ */
|
|
14394
|
-
/* @__PURE__ */
|
|
14395
|
-
), onSaveProp && /* @__PURE__ */
|
|
14699
|
+
/* @__PURE__ */ React116.createElement("option", { value: "html" }, "HTML"),
|
|
14700
|
+
/* @__PURE__ */ React116.createElement("option", { value: "json" }, "JSON")
|
|
14701
|
+
), onSaveProp && /* @__PURE__ */ React116.createElement("button", { onClick: handleSave, className: "status-btn save-btn" }, "Save"), onExportProp && /* @__PURE__ */ React116.createElement("button", { onClick: handleExport, className: "status-btn export-btn" }, "Export"), /* @__PURE__ */ React116.createElement("button", { onClick: handleClear, className: "status-btn clear-btn" }, "Clear")), /* @__PURE__ */ React116.createElement("div", { className: "status-bar-right" }, saveStatus && /* @__PURE__ */ React116.createElement("span", { className: "save-status" }, saveStatus), editor && /* @__PURE__ */ React116.createElement(React116.Fragment, null, /* @__PURE__ */ React116.createElement("span", { className: "word-count" }, "CHARS: ", editor.storage.characterCount?.characters?.() ?? editor.getText().length), /* @__PURE__ */ React116.createElement("span", { className: "word-count" }, "WORDS: ", editor.storage.characterCount?.words?.() ?? editor.getText().split(/\s+/).filter(Boolean).length)))), linkModalOpen && /* @__PURE__ */ React116.createElement("div", { className: "link-modal-overlay", onClick: handleLinkCancel }, /* @__PURE__ */ React116.createElement("div", { className: "link-modal", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React116.createElement("div", { className: "link-modal-body" }, /* @__PURE__ */ React116.createElement("div", { className: "link-modal-field" }, /* @__PURE__ */ React116.createElement("label", { className: "link-modal-label" }, "URL"), /* @__PURE__ */ React116.createElement(
|
|
14396
14702
|
"input",
|
|
14397
14703
|
{
|
|
14398
14704
|
type: "url",
|
|
@@ -14405,7 +14711,7 @@ var RufousTextEditor = ({
|
|
|
14405
14711
|
placeholder: "https://example.com",
|
|
14406
14712
|
autoFocus: true
|
|
14407
14713
|
}
|
|
14408
|
-
)), /* @__PURE__ */
|
|
14714
|
+
)), /* @__PURE__ */ React116.createElement("div", { className: "link-modal-field" }, /* @__PURE__ */ React116.createElement("label", { className: "link-modal-label" }, "Text"), /* @__PURE__ */ React116.createElement(
|
|
14409
14715
|
"input",
|
|
14410
14716
|
{
|
|
14411
14717
|
type: "text",
|
|
@@ -14417,7 +14723,7 @@ var RufousTextEditor = ({
|
|
|
14417
14723
|
},
|
|
14418
14724
|
placeholder: "Link text"
|
|
14419
14725
|
}
|
|
14420
|
-
)), /* @__PURE__ */
|
|
14726
|
+
)), /* @__PURE__ */ React116.createElement("div", { className: "link-modal-field" }, /* @__PURE__ */ React116.createElement("label", { className: "link-modal-label" }, "Class name"), /* @__PURE__ */ React116.createElement(
|
|
14421
14727
|
"input",
|
|
14422
14728
|
{
|
|
14423
14729
|
type: "text",
|
|
@@ -14429,21 +14735,21 @@ var RufousTextEditor = ({
|
|
|
14429
14735
|
},
|
|
14430
14736
|
placeholder: ""
|
|
14431
14737
|
}
|
|
14432
|
-
)), /* @__PURE__ */
|
|
14738
|
+
)), /* @__PURE__ */ React116.createElement("div", { className: "link-modal-checkboxes" }, /* @__PURE__ */ React116.createElement("label", { className: "link-modal-checkbox" }, /* @__PURE__ */ React116.createElement(
|
|
14433
14739
|
"input",
|
|
14434
14740
|
{
|
|
14435
14741
|
type: "checkbox",
|
|
14436
14742
|
checked: linkNewTab,
|
|
14437
14743
|
onChange: (e) => setLinkNewTab(e.target.checked)
|
|
14438
14744
|
}
|
|
14439
|
-
), "Open in new tab"), /* @__PURE__ */
|
|
14745
|
+
), "Open in new tab"), /* @__PURE__ */ React116.createElement("label", { className: "link-modal-checkbox" }, /* @__PURE__ */ React116.createElement(
|
|
14440
14746
|
"input",
|
|
14441
14747
|
{
|
|
14442
14748
|
type: "checkbox",
|
|
14443
14749
|
checked: linkNoFollow,
|
|
14444
14750
|
onChange: (e) => setLinkNoFollow(e.target.checked)
|
|
14445
14751
|
}
|
|
14446
|
-
), "No follow"))), /* @__PURE__ */
|
|
14752
|
+
), "No follow"))), /* @__PURE__ */ React116.createElement("div", { className: "link-modal-footer" }, /* @__PURE__ */ React116.createElement("button", { className: "link-modal-btn-unlink", onClick: handleLinkRemove }, "Unlink"), /* @__PURE__ */ React116.createElement("button", { className: "link-modal-btn-apply", onClick: handleLinkSubmit }, "Update"))))));
|
|
14447
14753
|
};
|
|
14448
14754
|
export {
|
|
14449
14755
|
APP_THEMES,
|
|
@@ -14519,6 +14825,7 @@ export {
|
|
|
14519
14825
|
nineDotMenuIcon_default as NineDotMenuIcon,
|
|
14520
14826
|
notificationIcon_default as NotificationIcon,
|
|
14521
14827
|
Paper,
|
|
14828
|
+
PhoneField,
|
|
14522
14829
|
Popover,
|
|
14523
14830
|
Popper,
|
|
14524
14831
|
projectIcon_default as ProjectIcon,
|