mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-24 23:49:33 +01:00
fix: resolve all warnings
This commit is contained in:
15
packages/editor/dist/es/toolbar/tools/link.js
vendored
15
packages/editor/dist/es/toolbar/tools/link.js
vendored
@@ -1,3 +1,14 @@
|
||||
var __rest = (this && this.__rest) || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
||||
import { ToolButton } from "../components/tool-button";
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
@@ -93,12 +104,12 @@ export function OpenLink(props) {
|
||||
return (_jsxs(Flex, Object.assign({ sx: { alignItems: "center" } }, { children: [_jsx(Text, Object.assign({ as: "a", href: href, target: "_blank", variant: "body", sx: { mr: 1 } }, { children: href })), _jsx(ToolButton, Object.assign({}, props, { toggled: false, onClick: () => window.open(href, "_blank") }))] })));
|
||||
}
|
||||
function LinkTool(props) {
|
||||
const { isEditing, onClick, onDone } = props;
|
||||
const { isEditing, onClick, onDone } = props, toolProps = __rest(props, ["isEditing", "onClick", "onDone"]);
|
||||
const buttonRef = useRef(null);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [href, setHref] = useState();
|
||||
const [text, setText] = useState();
|
||||
return (_jsxs(_Fragment, { children: [_jsx(ToolButton, Object.assign({}, props, { buttonRef: buttonRef, onClick: () => {
|
||||
return (_jsxs(_Fragment, { children: [_jsx(ToolButton, Object.assign({}, toolProps, { buttonRef: buttonRef, onClick: () => {
|
||||
const result = onClick();
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -146,7 +146,7 @@ type LinkToolProps = ToolProps & {
|
||||
onClick: () => { href?: string; text: string } | undefined;
|
||||
};
|
||||
function LinkTool(props: LinkToolProps) {
|
||||
const { isEditing, onClick, onDone } = props;
|
||||
const { isEditing, onClick, onDone, ...toolProps } = props;
|
||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
@@ -156,7 +156,7 @@ function LinkTool(props: LinkToolProps) {
|
||||
return (
|
||||
<>
|
||||
<ToolButton
|
||||
{...props}
|
||||
{...toolProps}
|
||||
buttonRef={buttonRef}
|
||||
onClick={() => {
|
||||
const result = onClick();
|
||||
|
||||
Reference in New Issue
Block a user