From 53754915c9f980c13340fbad34ed1af5f863e739 Mon Sep 17 00:00:00 2001 From: Kamil Mielnik Date: Fri, 19 Mar 2021 15:48:20 +0700 Subject: [PATCH] Attempt to fix TS errors in client code ERROR in (..)/node_modules/@prezly/slate-editor/build/components/FloatingMenu/index.d.ts(1,25): TS2307: Cannot find module './FloatingMenu' or its corresponding type declarations. ERROR in (..)/node_modules/@prezly/slate-editor/build/components/LoadingPlaceholderV2/index.d.ts(1,25): TS2307: Cannot find module './LoadingPlaceholderV2' or its corresponding type declarations. See: https://github.com/microsoft/TypeScript/issues/35822 --- packages/slate-editor/src/components/FloatingMenu/Button.tsx | 2 +- .../slate-editor/src/components/FloatingMenu/ButtonGroup.tsx | 2 +- .../slate-editor/src/components/FloatingMenu/Dropdown.tsx | 2 +- .../slate-editor/src/components/FloatingMenu/FloatingMenu.tsx | 2 +- packages/slate-editor/src/components/FloatingMenu/Icon.tsx | 2 +- packages/slate-editor/src/components/FloatingMenu/Link.tsx | 2 +- packages/slate-editor/src/components/FloatingMenu/SpaLink.tsx | 2 +- packages/slate-editor/src/components/FloatingMenu/Toolbar.tsx | 4 +++- .../src/components/LoadingPlaceholderV2/Description.tsx | 2 +- .../slate-editor/src/components/LoadingPlaceholderV2/Icon.tsx | 2 +- .../components/LoadingPlaceholderV2/LoadingPlaceholderV2.tsx | 2 +- .../src/components/LoadingPlaceholderV2/ProgressBar.tsx | 2 +- 12 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/slate-editor/src/components/FloatingMenu/Button.tsx b/packages/slate-editor/src/components/FloatingMenu/Button.tsx index 58b384c87..38f38348b 100644 --- a/packages/slate-editor/src/components/FloatingMenu/Button.tsx +++ b/packages/slate-editor/src/components/FloatingMenu/Button.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import React, { ButtonHTMLAttributes, FunctionComponent } from 'react'; -interface Props extends ButtonHTMLAttributes { +export interface Props extends ButtonHTMLAttributes { active?: boolean; variant?: 'default' | 'danger'; } diff --git a/packages/slate-editor/src/components/FloatingMenu/ButtonGroup.tsx b/packages/slate-editor/src/components/FloatingMenu/ButtonGroup.tsx index 795367111..3e1ccb9bc 100644 --- a/packages/slate-editor/src/components/FloatingMenu/ButtonGroup.tsx +++ b/packages/slate-editor/src/components/FloatingMenu/ButtonGroup.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import React, { FunctionComponent } from 'react'; -interface Props { +export interface Props { flex?: boolean; } diff --git a/packages/slate-editor/src/components/FloatingMenu/Dropdown.tsx b/packages/slate-editor/src/components/FloatingMenu/Dropdown.tsx index b8d553b98..d0a73580e 100644 --- a/packages/slate-editor/src/components/FloatingMenu/Dropdown.tsx +++ b/packages/slate-editor/src/components/FloatingMenu/Dropdown.tsx @@ -5,7 +5,7 @@ import { Dropdown as BootstrapDropdown, DropdownProps, MenuItem } from 'react-bo import './Dropdown.scss'; import { Option } from './types'; -interface Props extends Omit { +export interface Props extends Omit { onChange: (value: Value) => void; options: Option[]; richTextFormattingOptions?: boolean; diff --git a/packages/slate-editor/src/components/FloatingMenu/FloatingMenu.tsx b/packages/slate-editor/src/components/FloatingMenu/FloatingMenu.tsx index 59387926b..03a142cac 100644 --- a/packages/slate-editor/src/components/FloatingMenu/FloatingMenu.tsx +++ b/packages/slate-editor/src/components/FloatingMenu/FloatingMenu.tsx @@ -12,7 +12,7 @@ import Link from './Link'; import SpaLink from './SpaLink'; import Toolbar from './Toolbar'; -interface Props { +export interface Props { className?: string; containerRef: RefObject; element: HTMLElement; diff --git a/packages/slate-editor/src/components/FloatingMenu/Icon.tsx b/packages/slate-editor/src/components/FloatingMenu/Icon.tsx index 56d714b74..82d79a718 100644 --- a/packages/slate-editor/src/components/FloatingMenu/Icon.tsx +++ b/packages/slate-editor/src/components/FloatingMenu/Icon.tsx @@ -3,7 +3,7 @@ import React, { FunctionComponent } from 'react'; import SvgIcon from '../SvgIcon'; -interface Props { +export interface Props { className?: string; icon: BrowserSpriteSymbol; } diff --git a/packages/slate-editor/src/components/FloatingMenu/Link.tsx b/packages/slate-editor/src/components/FloatingMenu/Link.tsx index f1c96c976..a5c18f95d 100644 --- a/packages/slate-editor/src/components/FloatingMenu/Link.tsx +++ b/packages/slate-editor/src/components/FloatingMenu/Link.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import React, { AnchorHTMLAttributes, FunctionComponent } from 'react'; -interface Props extends AnchorHTMLAttributes { +export interface Props extends AnchorHTMLAttributes { className?: string; disabled?: boolean; } diff --git a/packages/slate-editor/src/components/FloatingMenu/SpaLink.tsx b/packages/slate-editor/src/components/FloatingMenu/SpaLink.tsx index 076162afb..fccb3e572 100644 --- a/packages/slate-editor/src/components/FloatingMenu/SpaLink.tsx +++ b/packages/slate-editor/src/components/FloatingMenu/SpaLink.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import React, { FunctionComponent } from 'react'; import { Link, LinkProps } from 'react-router-dom'; -interface Props extends Partial { +export interface Props extends Partial { className?: string; disabled?: boolean; href: string; diff --git a/packages/slate-editor/src/components/FloatingMenu/Toolbar.tsx b/packages/slate-editor/src/components/FloatingMenu/Toolbar.tsx index 9729649bf..fc1a45185 100644 --- a/packages/slate-editor/src/components/FloatingMenu/Toolbar.tsx +++ b/packages/slate-editor/src/components/FloatingMenu/Toolbar.tsx @@ -1,9 +1,10 @@ import classNames from 'classnames'; import React, { FunctionComponent } from 'react'; -interface Props { +export interface Props { className?: string; } + const Toolbar: FunctionComponent = ({ children, className }) => ( // eslint-disable-next-line jsx-a11y/no-static-element-interactions
= ({ children, className }) => ( {children}
); + export default Toolbar; diff --git a/packages/slate-editor/src/components/LoadingPlaceholderV2/Description.tsx b/packages/slate-editor/src/components/LoadingPlaceholderV2/Description.tsx index 1842142e5..a0e8e8a47 100644 --- a/packages/slate-editor/src/components/LoadingPlaceholderV2/Description.tsx +++ b/packages/slate-editor/src/components/LoadingPlaceholderV2/Description.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import React, { FunctionComponent } from 'react'; -interface Props { +export interface Props { children: string; className?: string; percent: string; diff --git a/packages/slate-editor/src/components/LoadingPlaceholderV2/Icon.tsx b/packages/slate-editor/src/components/LoadingPlaceholderV2/Icon.tsx index d0cfbbe97..25bf8444b 100644 --- a/packages/slate-editor/src/components/LoadingPlaceholderV2/Icon.tsx +++ b/packages/slate-editor/src/components/LoadingPlaceholderV2/Icon.tsx @@ -3,7 +3,7 @@ import React, { FunctionComponent } from 'react'; import SvgIcon from '../SvgIcon'; -interface Props { +export interface Props { className?: string; icon: BrowserSpriteSymbol; } diff --git a/packages/slate-editor/src/components/LoadingPlaceholderV2/LoadingPlaceholderV2.tsx b/packages/slate-editor/src/components/LoadingPlaceholderV2/LoadingPlaceholderV2.tsx index 12487fd3a..619996c4d 100644 --- a/packages/slate-editor/src/components/LoadingPlaceholderV2/LoadingPlaceholderV2.tsx +++ b/packages/slate-editor/src/components/LoadingPlaceholderV2/LoadingPlaceholderV2.tsx @@ -7,7 +7,7 @@ import { useExtrapolatedProgress } from './lib'; import './LoadingPlaceholderV2.scss'; import ProgressBar from './ProgressBar'; -interface Props extends HTMLAttributes { +export interface Props extends HTMLAttributes { children: (props: { percent: string }) => ReactNode; className?: string; estimatedDuration: number; diff --git a/packages/slate-editor/src/components/LoadingPlaceholderV2/ProgressBar.tsx b/packages/slate-editor/src/components/LoadingPlaceholderV2/ProgressBar.tsx index 822f4459d..317ee23e3 100644 --- a/packages/slate-editor/src/components/LoadingPlaceholderV2/ProgressBar.tsx +++ b/packages/slate-editor/src/components/LoadingPlaceholderV2/ProgressBar.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import React, { FunctionComponent } from 'react'; -interface Props { +export interface Props { className?: string; percent: string; }