Update dependency eslint-plugin-import to v2.25.2 (#1555)

* Update dependency eslint-plugin-import to v2.25.2

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Make type imports more explicit

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Enforce use of type imports

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
renovate[bot] 2021-10-17 18:45:58 +02:00 committed by GitHub
parent fc3a3fa1a9
commit 2abe40ef1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
264 changed files with 567 additions and 504 deletions

View file

@ -41,7 +41,7 @@
"emoji-picker-element": "1.8.2", "emoji-picker-element": "1.8.2",
"emoji-picker-element-data": "1.2.0", "emoji-picker-element-data": "1.2.0",
"eslint-config-react-app": "6.0.0", "eslint-config-react-app": "6.0.0",
"eslint-plugin-import": "2.24.2", "eslint-plugin-import": "2.25.2",
"eslint-plugin-jsx-a11y": "6.4.1", "eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.1.0", "eslint-plugin-promise": "5.1.0",
@ -134,7 +134,14 @@
"rules": { "rules": {
"no-use-before-define": "off", "no-use-before-define": "off",
"no-debugger": "warn", "no-debugger": "warn",
"default-param-last": "off" "default-param-last": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"disallowTypeAnnotations": false
}
]
}, },
"plugins": [ "plugins": [
"@typescript-eslint" "@typescript-eslint"
@ -193,7 +200,6 @@
}, },
"resolutions": { "resolutions": {
"cypress": "7.7.0", "cypress": "7.7.0",
"katex": "0.13.18", "katex": "0.13.18"
"eslint-plugin-import": "2.24.2"
} }
} }

View file

@ -5,7 +5,7 @@
*/ */
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { Config } from './types' import type { Config } from './types'
export const getConfig = async (): Promise<Config> => { export const getConfig = async (): Promise<Config> => {
const response = await fetch(getApiUrl() + 'config', { const response = await fetch(getApiUrl() + 'config', {

View file

@ -4,8 +4,9 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { HistoryEntry, HistoryEntryOrigin } from '../../redux/history/types' import type { HistoryEntry } from '../../redux/history/types'
import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types' import { HistoryEntryOrigin } from '../../redux/history/types'
import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
export const historyEntryDtoToHistoryEntry = (entryDto: HistoryEntryDto): HistoryEntry => { export const historyEntryDtoToHistoryEntry = (entryDto: HistoryEntryDto): HistoryEntry => {
return { return {

View file

@ -5,7 +5,7 @@
*/ */
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types' import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
export const getHistory = async (): Promise<HistoryEntryDto[]> => { export const getHistory = async (): Promise<HistoryEntryDto[]> => {
const response = await fetch(getApiUrl() + 'me/history') const response = await fetch(getApiUrl() + 'me/history')

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { UserResponse } from '../users/types' import type { UserResponse } from '../users/types'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { isMockMode } from '../../utils/test-modes' import { isMockMode } from '../../utils/test-modes'

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { ImageProxyResponse } from '../../components/markdown-renderer/replace-components/image/types' import type { ImageProxyResponse } from '../../components/markdown-renderer/replace-components/image/types'
import { isMockMode } from '../../utils/test-modes' import { isMockMode } from '../../utils/test-modes'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'

View file

@ -5,7 +5,7 @@
*/ */
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { NoteDto } from './types' import type { NoteDto } from './types'
import { isMockMode } from '../../utils/test-modes' import { isMockMode } from '../../utils/test-modes'
export const getNote = async (noteId: string): Promise<NoteDto> => { export const getNote = async (noteId: string): Promise<NoteDto> => {

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { UserInfoDto } from '../users/types' import type { UserInfoDto } from '../users/types'
import { GroupInfoDto } from '../group/types' import type { GroupInfoDto } from '../group/types'
export interface NoteDto { export interface NoteDto {
content: string content: string

View file

@ -6,7 +6,7 @@
import { Cache } from '../../components/common/cache/cache' import { Cache } from '../../components/common/cache/cache'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { Revision, RevisionListEntry } from './types' import type { Revision, RevisionListEntry } from './types'
const revisionCache = new Cache<string, Revision>(3600) const revisionCache = new Cache<string, Revision>(3600)

View file

@ -5,7 +5,7 @@
*/ */
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { AccessToken, AccessTokenSecret } from './types' import type { AccessToken, AccessTokenSecret } from './types'
export const getAccessTokenList = async (): Promise<AccessToken[]> => { export const getAccessTokenList = async (): Promise<AccessToken[]> => {
const response = await fetch(`${getApiUrl()}tokens`, { const response = await fetch(`${getApiUrl()}tokens`, {

View file

@ -6,7 +6,7 @@
import { Cache } from '../../components/common/cache/cache' import { Cache } from '../../components/common/cache/cache'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils' import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { UserResponse } from './types' import type { UserResponse } from './types'
const cache = new Cache<string, UserResponse>(600) const cache = new Cache<string, UserResponse>(600)

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { LoginProvider } from '../../redux/user/types' import type { LoginProvider } from '../../redux/user/types'
export interface UserResponse { export interface UserResponse {
id: string id: string

View file

@ -7,7 +7,8 @@
import React, { Suspense, useCallback, useEffect, useState } from 'react' import React, { Suspense, useCallback, useEffect, useState } from 'react'
import { useBackendBaseUrl } from '../../hooks/common/use-backend-base-url' import { useBackendBaseUrl } from '../../hooks/common/use-backend-base-url'
import './application-loader.scss' import './application-loader.scss'
import { createSetUpTaskList, InitTask } from './initializers' import type { InitTask } from './initializers'
import { createSetUpTaskList } from './initializers'
import { LoadingScreen } from './loading-screen' import { LoadingScreen } from './loading-screen'
import { useCustomizeAssetsUrl } from '../../hooks/common/use-customize-assets-url' import { useCustomizeAssetsUrl } from '../../hooks/common/use-customize-assets-url'
import { useFrontendAssetsUrl } from '../../hooks/common/use-frontend-assets-url' import { useFrontendAssetsUrl } from '../../hooks/common/use-frontend-assets-url'

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import i18n, { ResourceKey } from 'i18next' import type { ResourceKey } from 'i18next'
import i18n from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector' import LanguageDetector from 'i18next-browser-languagedetector'
import resourcesToBackend from 'i18next-resources-to-backend' import resourcesToBackend from 'i18next-resources-to-backend'
import { Settings } from 'luxon' import { Settings } from 'luxon'

View file

@ -4,7 +4,8 @@
SPDX-License-Identifier: AGPL-3.0-only SPDX-License-Identifier: AGPL-3.0-only
*/ */
import React, { RefObject, useCallback, useEffect, useState } from 'react' import type { RefObject } from 'react'
import React, { useCallback, useEffect, useState } from 'react'
import { Overlay, Tooltip } from 'react-bootstrap' import { Overlay, Tooltip } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
import { v4 as uuid } from 'uuid' import { v4 as uuid } from 'uuid'

View file

@ -6,7 +6,7 @@
import React, { Fragment, useRef } from 'react' import React, { Fragment, useRef } from 'react'
import { Button } from 'react-bootstrap' import { Button } from 'react-bootstrap'
import { Variant } from 'react-bootstrap/types' import type { Variant } from 'react-bootstrap/types'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon' import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
import { CopyOverlay } from '../copy-overlay' import { CopyOverlay } from '../copy-overlay'

View file

@ -5,7 +5,7 @@
*/ */
import React from 'react' import React from 'react'
import { IconName, IconSize } from './types' import type { IconName, IconSize } from './types'
export interface ForkAwesomeIconProps { export interface ForkAwesomeIconProps {
icon: IconName icon: IconName

View file

@ -4,9 +4,11 @@
SPDX-License-Identifier: AGPL-3.0-only SPDX-License-Identifier: AGPL-3.0-only
*/ */
import React, { ReactElement } from 'react' import type { ReactElement } from 'react'
import { ForkAwesomeIcon, ForkAwesomeIconProps } from './fork-awesome-icon' import React from 'react'
import { IconSize } from './types' import type { ForkAwesomeIconProps } from './fork-awesome-icon'
import { ForkAwesomeIcon } from './fork-awesome-icon'
import type { IconSize } from './types'
export interface ForkAwesomeStackProps { export interface ForkAwesomeStackProps {
size?: IconSize size?: IconSize

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { ForkAwesomeIcons } from './fork-awesome-icons' import type { ForkAwesomeIcons } from './fork-awesome-icons'
export type IconName = typeof ForkAwesomeIcons[number] export type IconName = typeof ForkAwesomeIcons[number]
export type IconSize = '2x' | '3x' | '4x' | '5x' export type IconSize = '2x' | '3x' | '4x' | '5x'

View file

@ -5,9 +5,10 @@
*/ */
import React from 'react' import React from 'react'
import { Button, ButtonProps } from 'react-bootstrap' import type { ButtonProps } from 'react-bootstrap'
import { Button } from 'react-bootstrap'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon' import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types' import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if' import { ShowIf } from '../show-if/show-if'
import './icon-button.scss' import './icon-button.scss'

View file

@ -6,7 +6,8 @@
import React from 'react' import React from 'react'
import { Trans } from 'react-i18next' import { Trans } from 'react-i18next'
import { IconButton, IconButtonProps } from './icon-button' import type { IconButtonProps } from './icon-button'
import { IconButton } from './icon-button'
export interface TranslatedIconButtonProps extends IconButtonProps { export interface TranslatedIconButtonProps extends IconButtonProps {
i18nKey: string i18nKey: string

View file

@ -6,9 +6,9 @@
import React from 'react' import React from 'react'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon' import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types' import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if' import { ShowIf } from '../show-if/show-if'
import { LinkWithTextProps } from './types' import type { LinkWithTextProps } from './types'
export const ExternalLink: React.FC<LinkWithTextProps> = ({ export const ExternalLink: React.FC<LinkWithTextProps> = ({
href, href,

View file

@ -7,9 +7,9 @@
import React from 'react' import React from 'react'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon' import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types' import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if' import { ShowIf } from '../show-if/show-if'
import { LinkWithTextProps } from './types' import type { LinkWithTextProps } from './types'
export const InternalLink: React.FC<LinkWithTextProps> = ({ export const InternalLink: React.FC<LinkWithTextProps> = ({
href, href,

View file

@ -7,7 +7,7 @@
import React from 'react' import React from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ExternalLink } from './external-link' import { ExternalLink } from './external-link'
import { TranslatedLinkProps } from './types' import type { TranslatedLinkProps } from './types'
export const TranslatedExternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => { export const TranslatedExternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => {
const { t } = useTranslation() const { t } = useTranslation()

View file

@ -7,7 +7,7 @@
import React from 'react' import React from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { InternalLink } from './internal-link' import { InternalLink } from './internal-link'
import { TranslatedLinkProps } from './types' import type { TranslatedLinkProps } from './types'
export const TranslatedInternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => { export const TranslatedInternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => {
const { t } = useTranslation() const { t } = useTranslation()

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { StringMap, TOptionsBase } from 'i18next' import type { StringMap, TOptionsBase } from 'i18next'
import { IconName } from '../fork-awesome/fork-awesome-icon' import type { IconName } from '../fork-awesome/fork-awesome-icon'
interface GeneralLinkProp { interface GeneralLinkProp {
href: string href: string

View file

@ -8,7 +8,7 @@ import React from 'react'
import { Modal } from 'react-bootstrap' import { Modal } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon' import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types' import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if' import { ShowIf } from '../show-if/show-if'
export interface CommonModalProps { export interface CommonModalProps {

View file

@ -7,7 +7,8 @@
import React from 'react' import React from 'react'
import { Button, Modal } from 'react-bootstrap' import { Button, Modal } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
import { CommonModal, CommonModalProps } from './common-modal' import type { CommonModalProps } from './common-modal'
import { CommonModal } from './common-modal'
export interface DeletionModalProps extends CommonModalProps { export interface DeletionModalProps extends CommonModalProps {
onConfirm: () => void onConfirm: () => void

View file

@ -6,7 +6,8 @@
import React from 'react' import React from 'react'
import { Modal } from 'react-bootstrap' import { Modal } from 'react-bootstrap'
import { CommonModal, CommonModalProps } from './common-modal' import type { CommonModalProps } from './common-modal'
import { CommonModal } from './common-modal'
export const ErrorModal: React.FC<CommonModalProps> = ({ show, onHide, titleI18nKey, icon, children }) => { export const ErrorModal: React.FC<CommonModalProps> = ({ show, onHide, titleI18nKey, icon, children }) => {
return ( return (

View file

@ -5,7 +5,7 @@
*/ */
import { extractFrontmatter } from './extract-frontmatter' import { extractFrontmatter } from './extract-frontmatter'
import { PresentFrontmatterExtractionResult } from './types' import type { PresentFrontmatterExtractionResult } from './types'
describe('frontmatter extraction', () => { describe('frontmatter extraction', () => {
describe('isPresent property', () => { describe('isPresent property', () => {

View file

@ -3,7 +3,7 @@
* *
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { FrontmatterExtractionResult } from './types' import type { FrontmatterExtractionResult } from './types'
const FRONTMATTER_BEGIN_REGEX = /^-{3,}$/ const FRONTMATTER_BEGIN_REGEX = /^-{3,}$/
const FRONTMATTER_END_REGEX = /^(?:-{3,}|\.{3,})$/ const FRONTMATTER_END_REGEX = /^(?:-{3,}|\.{3,})$/

View file

@ -6,7 +6,8 @@
// import { RevealOptions } from 'reveal.js' // import { RevealOptions } from 'reveal.js'
import { load } from 'js-yaml' import { load } from 'js-yaml'
import { ISO6391, NoteTextDirection, NoteType, RawNoteFrontmatter, SlideOptions } from './types' import type { RawNoteFrontmatter, SlideOptions } from './types'
import { ISO6391, NoteTextDirection, NoteType } from './types'
import { initialSlideOptions } from '../../../redux/note-details/initial-state' import { initialSlideOptions } from '../../../redux/note-details/initial-state'
/** /**

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { RevealOptions } from 'reveal.js' import type { RevealOptions } from 'reveal.js'
export type FrontmatterExtractionResult = PresentFrontmatterExtractionResult | NonPresentFrontmatterExtractionResult export type FrontmatterExtractionResult = PresentFrontmatterExtractionResult | NonPresentFrontmatterExtractionResult

View file

@ -9,7 +9,7 @@ import { Redirect } from 'react-router'
import { useParams } from 'react-router-dom' import { useParams } from 'react-router-dom'
import { getNote } from '../../../api/notes' import { getNote } from '../../../api/notes'
import { NotFoundErrorScreen } from './not-found-error-screen' import { NotFoundErrorScreen } from './not-found-error-screen'
import { NoteDto } from '../../../api/notes/types' import type { NoteDto } from '../../../api/notes/types'
interface RouteParameters { interface RouteParameters {
id: string id: string

View file

@ -8,7 +8,7 @@ import React from 'react'
import { Alert } from 'react-bootstrap' import { Alert } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
import { ShowIf } from '../common/show-if/show-if' import { ShowIf } from '../common/show-if/show-if'
import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'
export const ErrorWhileLoadingNoteAlert: React.FC<SimpleAlertProps> = ({ show }) => { export const ErrorWhileLoadingNoteAlert: React.FC<SimpleAlertProps> = ({ show }) => {
useTranslation() useTranslation()

View file

@ -8,7 +8,7 @@ import React from 'react'
import { Alert } from 'react-bootstrap' import { Alert } from 'react-bootstrap'
import { Trans } from 'react-i18next' import { Trans } from 'react-i18next'
import { ShowIf } from '../common/show-if/show-if' import { ShowIf } from '../common/show-if/show-if'
import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props' import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'
export const LoadingNoteAlert: React.FC<SimpleAlertProps> = ({ show }) => { export const LoadingNoteAlert: React.FC<SimpleAlertProps> = ({ show }) => {
return ( return (

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { DateTime } from 'luxon' import type { DateTime } from 'luxon'
import React from 'react' import React from 'react'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
import { InternalLink } from '../common/links/internal-link' import { InternalLink } from '../common/links/internal-link'

View file

@ -10,7 +10,7 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useParams } from 'react-router' import { useParams } from 'react-router'
import { EditorPagePathParams } from '../editor-page' import type { EditorPagePathParams } from '../editor-page'
export const ReadOnlyModeButton: React.FC = () => { export const ReadOnlyModeButton: React.FC = () => {
const { t } = useTranslation() const { t } = useTranslation()

View file

@ -10,7 +10,7 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useParams } from 'react-router' import { useParams } from 'react-router'
import { EditorPagePathParams } from '../editor-page' import type { EditorPagePathParams } from '../editor-page'
export const SlideModeButton: React.FC = () => { export const SlideModeButton: React.FC = () => {
const { t } = useTranslation() const { t } = useTranslation()

View file

@ -10,10 +10,8 @@ import { ShowIf } from '../../../common/show-if/show-if'
import { DocumentInfoLine } from './document-info-line' import { DocumentInfoLine } from './document-info-line'
import { UnitalicBoldText } from './unitalic-bold-text' import { UnitalicBoldText } from './unitalic-bold-text'
import { useEditorToRendererCommunicator } from '../../render-context/editor-to-renderer-communicator-context-provider' import { useEditorToRendererCommunicator } from '../../render-context/editor-to-renderer-communicator-context-provider'
import { import type { OnWordCountCalculatedMessage } from '../../../render-page/window-post-message-communicator/rendering-message'
CommunicationMessageType, import { CommunicationMessageType } from '../../../render-page/window-post-message-communicator/rendering-message'
OnWordCountCalculatedMessage
} from '../../../render-page/window-post-message-communicator/rendering-message'
import { useEditorReceiveHandler } from '../../../render-page/window-post-message-communicator/hooks/use-editor-receive-handler' import { useEditorReceiveHandler } from '../../../render-page/window-post-message-communicator/hooks/use-editor-receive-handler'
import { useEffectOnRendererReady } from '../../../render-page/window-post-message-communicator/hooks/use-effect-on-renderer-ready' import { useEffectOnRendererReady } from '../../../render-page/window-post-message-communicator/hooks/use-effect-on-renderer-ready'

View file

@ -6,7 +6,7 @@
import React from 'react' import React from 'react'
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon' import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
import { IconName } from '../../../common/fork-awesome/types' import type { IconName } from '../../../common/fork-awesome/types'
export interface DocumentInfoLineProps { export interface DocumentInfoLineProps {
icon: IconName icon: IconName

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { DateTime } from 'luxon' import type { DateTime } from 'luxon'
import React from 'react' import React from 'react'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
import { IconName } from '../../../common/fork-awesome/types' import type { IconName } from '../../../common/fork-awesome/types'
import { UserAvatar } from '../../../common/user-avatar/user-avatar' import { UserAvatar } from '../../../common/user-avatar/user-avatar'
import { DocumentInfoLine } from './document-info-line' import { DocumentInfoLine } from './document-info-line'
import { TimeFromNow } from './time-from-now' import { TimeFromNow } from './time-from-now'

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { DateTime } from 'luxon' import type { DateTime } from 'luxon'
import React from 'react' import React from 'react'

View file

@ -4,11 +4,12 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import React, { ReactElement, useState } from 'react' import type { ReactElement } from 'react'
import React, { useState } from 'react'
import { Button, FormControl, InputGroup, ToggleButton, ToggleButtonGroup } from 'react-bootstrap' import { Button, FormControl, InputGroup, ToggleButton, ToggleButtonGroup } from 'react-bootstrap'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon' import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
import { Principal } from './permission-modal' import type { Principal } from './permission-modal'
export interface PermissionListProps { export interface PermissionListProps {
list: Principal[] list: Principal[]

View file

@ -10,7 +10,8 @@ import { Trans, useTranslation } from 'react-i18next'
import { getUserById } from '../../../../api/users' import { getUserById } from '../../../../api/users'
import { CommonModal } from '../../../common/modals/common-modal' import { CommonModal } from '../../../common/modals/common-modal'
import { ShowIf } from '../../../common/show-if/show-if' import { ShowIf } from '../../../common/show-if/show-if'
import { UserAvatar, UserAvatarProps } from '../../../common/user-avatar/user-avatar' import type { UserAvatarProps } from '../../../common/user-avatar/user-avatar'
import { UserAvatar } from '../../../common/user-avatar/user-avatar'
import { GroupMode, PermissionGroupEntry } from './permission-group-entry' import { GroupMode, PermissionGroupEntry } from './permission-group-entry'
import { PermissionList } from './permission-list' import { PermissionList } from './permission-list'

View file

@ -8,8 +8,8 @@ import { DateTime } from 'luxon'
import React from 'react' import React from 'react'
import { ListGroup } from 'react-bootstrap' import { ListGroup } from 'react-bootstrap'
import { Trans } from 'react-i18next' import { Trans } from 'react-i18next'
import { RevisionListEntry } from '../../../../api/revisions/types' import type { RevisionListEntry } from '../../../../api/revisions/types'
import { UserResponse } from '../../../../api/users/types' import type { UserResponse } from '../../../../api/users/types'
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon' import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
import { UserAvatar } from '../../../common/user-avatar/user-avatar' import { UserAvatar } from '../../../common/user-avatar/user-avatar'

View file

@ -10,8 +10,8 @@ import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
import { useParams } from 'react-router' import { useParams } from 'react-router'
import { getAllRevisions, getRevision } from '../../../../api/revisions' import { getAllRevisions, getRevision } from '../../../../api/revisions'
import { Revision, RevisionListEntry } from '../../../../api/revisions/types' import type { Revision, RevisionListEntry } from '../../../../api/revisions/types'
import { UserResponse } from '../../../../api/users/types' import type { UserResponse } from '../../../../api/users/types'
import { useIsDarkModeActivated } from '../../../../hooks/common/use-is-dark-mode-activated' import { useIsDarkModeActivated } from '../../../../hooks/common/use-is-dark-mode-activated'
import { useNoteMarkdownContent } from '../../../../hooks/common/use-note-markdown-content' import { useNoteMarkdownContent } from '../../../../hooks/common/use-note-markdown-content'
import { CommonModal } from '../../../common/modals/common-modal' import { CommonModal } from '../../../common/modals/common-modal'

View file

@ -4,9 +4,9 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Revision } from '../../../../api/revisions/types' import type { Revision } from '../../../../api/revisions/types'
import { getUserById } from '../../../../api/users' import { getUserById } from '../../../../api/users'
import { UserResponse } from '../../../../api/users/types' import type { UserResponse } from '../../../../api/users/types'
import { download } from '../../../common/download/download' import { download } from '../../../common/download/download'
import { Logger } from '../../../../utils/logger' import { Logger } from '../../../../utils/logger'

View file

@ -12,7 +12,7 @@ import { useFrontendBaseUrl } from '../../../../hooks/common/use-frontend-base-u
import { CopyableField } from '../../../common/copyable/copyable-field/copyable-field' import { CopyableField } from '../../../common/copyable/copyable-field/copyable-field'
import { CommonModal } from '../../../common/modals/common-modal' import { CommonModal } from '../../../common/modals/common-modal'
import { ShowIf } from '../../../common/show-if/show-if' import { ShowIf } from '../../../common/show-if/show-if'
import { EditorPagePathParams } from '../../editor-page' import type { EditorPagePathParams } from '../../editor-page'
import { NoteType } from '../../../common/note-frontmatter/types' import { NoteType } from '../../../common/note-frontmatter/types'
import { useApplicationState } from '../../../../hooks/common/use-application-state' import { useApplicationState } from '../../../../hooks/common/use-application-state'

View file

@ -5,7 +5,8 @@
*/ */
import React from 'react' import React from 'react'
import { RenderIframe, RenderIframeProps } from '../renderer-pane/render-iframe' import type { RenderIframeProps } from '../renderer-pane/render-iframe'
import { RenderIframe } from '../renderer-pane/render-iframe'
import { useNoteMarkdownContentWithoutFrontmatter } from '../../../hooks/common/use-note-markdown-content-without-frontmatter' import { useNoteMarkdownContentWithoutFrontmatter } from '../../../hooks/common/use-note-markdown-content-without-frontmatter'
import { useSendFrontmatterInfoFromReduxToRenderer } from '../renderer-pane/hooks/use-send-frontmatter-info-from-redux-to-renderer' import { useSendFrontmatterInfoFromReduxToRenderer } from '../renderer-pane/hooks/use-send-frontmatter-info-from-redux-to-renderer'

View file

@ -20,7 +20,7 @@ import { useLoadNoteFromServer } from './hooks/useLoadNoteFromServer'
import { useViewModeShortcuts } from './hooks/useViewModeShortcuts' import { useViewModeShortcuts } from './hooks/useViewModeShortcuts'
import { Sidebar } from './sidebar/sidebar' import { Sidebar } from './sidebar/sidebar'
import { Splitter } from './splitter/splitter' import { Splitter } from './splitter/splitter'
import { DualScrollState, ScrollState } from './synced-scroll/scroll-props' import type { DualScrollState, ScrollState } from './synced-scroll/scroll-props'
import { RendererType } from '../render-page/window-post-message-communicator/rendering-message' import { RendererType } from '../render-page/window-post-message-communicator/rendering-message'
import { useEditorModeFromUrl } from './hooks/useEditorModeFromUrl' import { useEditorModeFromUrl } from './hooks/useEditorModeFromUrl'
import { UiNotifications } from '../notifications/ui-notifications' import { UiNotifications } from '../notifications/ui-notifications'

View file

@ -4,8 +4,10 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Hint, Hints, Pos } from 'codemirror' import type { Editor, Hint, Hints } from 'codemirror'
import { findWordAtCursor, generateHintListByPrefix, Hinter } from './index' import { Pos } from 'codemirror'
import type { Hinter } from './index'
import { findWordAtCursor, generateHintListByPrefix } from './index'
import { showErrorNotification } from '../../../../redux/ui-notifications/methods' import { showErrorNotification } from '../../../../redux/ui-notifications/methods'
import { Logger } from '../../../../utils/logger' import { Logger } from '../../../../utils/logger'

View file

@ -4,8 +4,10 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Hint, Hints, Pos } from 'codemirror' import type { Editor, Hint, Hints } from 'codemirror'
import { findWordAtCursor, Hinter } from './index' import { Pos } from 'codemirror'
import type { Hinter } from './index'
import { findWordAtCursor } from './index'
const wordRegExp = /^(<d(?:e|et|eta|etai|etail|etails)?)$/ const wordRegExp = /^(<d(?:e|et|eta|etai|etail|etails)?)$/

View file

@ -4,9 +4,11 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Hint, Hints, Pos } from 'codemirror' import type { Editor, Hint, Hints } from 'codemirror'
import { Pos } from 'codemirror'
import { validAlertLevels } from '../../../markdown-renderer/markdown-it-plugins/alert-container' import { validAlertLevels } from '../../../markdown-renderer/markdown-it-plugins/alert-container'
import { findWordAtCursor, Hinter } from './index' import type { Hinter } from './index'
import { findWordAtCursor } from './index'
const wordRegExp = /^:::((?:\w|-|\+)*)$/ const wordRegExp = /^:::((?:\w|-|\+)*)$/
const spoilerSuggestion: Hint = { const spoilerSuggestion: Hint = {

View file

@ -4,12 +4,14 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Hint, Hints, Pos } from 'codemirror' import type { Editor, Hint, Hints } from 'codemirror'
import { Pos } from 'codemirror'
import Database from 'emoji-picker-element/database' import Database from 'emoji-picker-element/database'
import { Emoji, EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared' import type { Emoji, EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared'
import { emojiPickerConfig } from '../tool-bar/emoji-picker/emoji-picker' import { emojiPickerConfig } from '../tool-bar/emoji-picker/emoji-picker'
import { getEmojiIcon, getEmojiShortCode } from '../tool-bar/utils/emojiUtils' import { getEmojiIcon, getEmojiShortCode } from '../tool-bar/utils/emojiUtils'
import { findWordAtCursor, Hinter } from './index' import type { Hinter } from './index'
import { findWordAtCursor } from './index'
import { Logger } from '../../../../utils/logger' import { Logger } from '../../../../utils/logger'
const emojiIndex = new Database(emojiPickerConfig) const emojiIndex = new Database(emojiPickerConfig)

View file

@ -4,8 +4,10 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Hint, Hints, Pos } from 'codemirror' import type { Editor, Hint, Hints } from 'codemirror'
import { findWordAtCursor, generateHintListByPrefix, Hinter } from './index' import { Pos } from 'codemirror'
import type { Hinter } from './index'
import { findWordAtCursor, generateHintListByPrefix } from './index'
const wordRegExp = /^(\s{0,3})(#{1,6})$/ const wordRegExp = /^(\s{0,3})(#{1,6})$/
const allSupportedHeaders = ['# h1', '## h2', '### h3', '#### h4', '##### h5', '###### h6', '###### tags: `example`'] const allSupportedHeaders = ['# h1', '## h2', '### h3', '#### h4', '##### h5', '###### h6', '###### tags: `example`']

View file

@ -4,8 +4,10 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Hint, Hints, Pos } from 'codemirror' import type { Editor, Hint, Hints } from 'codemirror'
import { findWordAtCursor, Hinter } from './index' import { Pos } from 'codemirror'
import type { Hinter } from './index'
import { findWordAtCursor } from './index'
const wordRegExp = /^(!(\[.*])?)$/ const wordRegExp = /^(!(\[.*])?)$/
const allSupportedImages = [ const allSupportedImages = [

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Hints } from 'codemirror' import type { Editor, Hints } from 'codemirror'
import { CodeBlockHinter } from './code-block' import { CodeBlockHinter } from './code-block'
import { CollapsableBlockHinter } from './collapsable-block' import { CollapsableBlockHinter } from './collapsable-block'
import { ContainerHinter } from './container' import { ContainerHinter } from './container'

View file

@ -4,9 +4,11 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Hint, Hints, Pos } from 'codemirror' import type { Editor, Hint, Hints } from 'codemirror'
import { Pos } from 'codemirror'
import { DateTime } from 'luxon' import { DateTime } from 'luxon'
import { findWordAtCursor, Hinter } from './index' import type { Hinter } from './index'
import { findWordAtCursor } from './index'
import { store } from '../../../../redux' import { store } from '../../../../redux'
const wordRegExp = /^(\[(.*])?)$/ const wordRegExp = /^(\[(.*])?)$/

View file

@ -4,8 +4,10 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Hint, Hints, Pos } from 'codemirror' import type { Editor, Hint, Hints } from 'codemirror'
import { findWordAtCursor, Hinter } from './index' import { Pos } from 'codemirror'
import type { Hinter } from './index'
import { findWordAtCursor } from './index'
const wordRegExp = /^({[%}]?)$/ const wordRegExp = /^({[%}]?)$/

View file

@ -4,14 +4,15 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, EditorChange } from 'codemirror' import type { Editor, EditorChange } from 'codemirror'
import React, { useCallback, useRef, useState } from 'react' import React, { useCallback, useRef, useState } from 'react'
import { Controlled as ControlledCodeMirror } from 'react-codemirror2' import { Controlled as ControlledCodeMirror } from 'react-codemirror2'
import { MaxLengthWarningModal } from '../editor-modals/max-length-warning-modal' import { MaxLengthWarningModal } from '../editor-modals/max-length-warning-modal'
import { ScrollProps } from '../synced-scroll/scroll-props' import type { ScrollProps } from '../synced-scroll/scroll-props'
import { allHinters, findWordAtCursor } from './autocompletion' import { allHinters, findWordAtCursor } from './autocompletion'
import './editor-pane.scss' import './editor-pane.scss'
import { createStatusInfo, defaultState, StatusBar, StatusBarInfo } from './status-bar/status-bar' import type { StatusBarInfo } from './status-bar/status-bar'
import { createStatusInfo, defaultState, StatusBar } from './status-bar/status-bar'
import { ToolBar } from './tool-bar/tool-bar' import { ToolBar } from './tool-bar/tool-bar'
import { useApplicationState } from '../../../hooks/common/use-application-state' import { useApplicationState } from '../../../hooks/common/use-application-state'
import './codemirror-imports' import './codemirror-imports'

View file

@ -5,8 +5,8 @@
*/ */
import { useEffect, useRef } from 'react' import { useEffect, useRef } from 'react'
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
import { ScrollState } from '../../synced-scroll/scroll-props' import type { ScrollState } from '../../synced-scroll/scroll-props'
/** /**
* Monitors the given scroll state and scrolls the editor to the state if changed. * Monitors the given scroll state and scrolls the editor to the state if changed.

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { EditorConfiguration } from 'codemirror' import type { EditorConfiguration } from 'codemirror'
import { useMemo } from 'react' import { useMemo } from 'react'
import { defaultKeyMap } from '../key-map' import { defaultKeyMap } from '../key-map'
import { useApplicationState } from '../../../../hooks/common/use-application-state' import { useApplicationState } from '../../../../hooks/common/use-application-state'

View file

@ -5,9 +5,9 @@
*/ */
import { useCallback } from 'react' import { useCallback } from 'react'
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
import { handleUpload } from '../upload-handler' import { handleUpload } from '../upload-handler'
import { DomEvent } from 'react-codemirror2' import type { DomEvent } from 'react-codemirror2'
interface DropEvent { interface DropEvent {
pageX: number pageX: number

View file

@ -5,10 +5,11 @@
*/ */
import { useCallback } from 'react' import { useCallback } from 'react'
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
import { handleFilePaste, handleTablePaste, PasteEvent } from '../tool-bar/utils/pasteHandlers' import type { PasteEvent } from '../tool-bar/utils/pasteHandlers'
import { handleFilePaste, handleTablePaste } from '../tool-bar/utils/pasteHandlers'
import { useApplicationState } from '../../../../hooks/common/use-application-state' import { useApplicationState } from '../../../../hooks/common/use-application-state'
import { DomEvent } from 'react-codemirror2' import type { DomEvent } from 'react-codemirror2'
/** /**
* Creates a callback that handles the table or file paste action in code mirror. * Creates a callback that handles the table or file paste action in code mirror.

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { DomEvent } from 'react-codemirror2' import type { DomEvent } from 'react-codemirror2'
import { useCallback, useEffect, useState } from 'react' import { useCallback, useEffect, useState } from 'react'
import { Editor, ScrollInfo } from 'codemirror' import type { Editor, ScrollInfo } from 'codemirror'
import { ScrollState } from '../../synced-scroll/scroll-props' import type { ScrollState } from '../../synced-scroll/scroll-props'
/** /**
* Creates a callback for the scroll binding of the code mirror editor. * Creates a callback for the scroll binding of the code mirror editor.

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import CodeMirror, { Editor, KeyMap, Pass } from 'codemirror' import type { Editor, KeyMap, Pass } from 'codemirror'
import CodeMirror from 'codemirror'
import { isMac } from '../utils' import { isMac } from '../utils'
import { import {
addLink, addLink,

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor, Position } from 'codemirror' import type { Editor, Position } from 'codemirror'
import React, { useMemo } from 'react' import React, { useMemo } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ShowIf } from '../../../common/show-if/show-if' import { ShowIf } from '../../../common/show-if/show-if'

View file

@ -4,12 +4,13 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { EditorConfiguration } from 'codemirror' import type { EditorConfiguration } from 'codemirror'
import React, { ChangeEvent, useCallback } from 'react' import type { ChangeEvent } from 'react'
import React, { useCallback } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { mergeEditorPreferences } from '../../../../../redux/editor/methods' import { mergeEditorPreferences } from '../../../../../redux/editor/methods'
import { EditorPreferenceInput, EditorPreferenceInputType } from './editor-preference-input' import { EditorPreferenceInput, EditorPreferenceInputType } from './editor-preference-input'
import { EditorPreferenceProperty } from './editor-preference-property' import type { EditorPreferenceProperty } from './editor-preference-property'
import { useApplicationState } from '../../../../../hooks/common/use-application-state' import { useApplicationState } from '../../../../../hooks/common/use-application-state'
export interface EditorPreferenceBooleanProps { export interface EditorPreferenceBooleanProps {

View file

@ -3,7 +3,8 @@
* *
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import React, { ChangeEvent, useCallback } from 'react' import type { ChangeEvent } from 'react'
import React, { useCallback } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { setEditorLigatures } from '../../../../../redux/editor/methods' import { setEditorLigatures } from '../../../../../redux/editor/methods'
import { EditorPreferenceInput, EditorPreferenceInputType } from './editor-preference-input' import { EditorPreferenceInput, EditorPreferenceInputType } from './editor-preference-input'

View file

@ -4,11 +4,12 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { EditorConfiguration } from 'codemirror' import type { EditorConfiguration } from 'codemirror'
import React, { ChangeEvent, useCallback } from 'react' import type { ChangeEvent } from 'react'
import React, { useCallback } from 'react'
import { mergeEditorPreferences } from '../../../../../redux/editor/methods' import { mergeEditorPreferences } from '../../../../../redux/editor/methods'
import { EditorPreferenceInput, EditorPreferenceInputType } from './editor-preference-input' import { EditorPreferenceInput, EditorPreferenceInputType } from './editor-preference-input'
import { EditorPreferenceProperty } from './editor-preference-property' import type { EditorPreferenceProperty } from './editor-preference-property'
import { useApplicationState } from '../../../../../hooks/common/use-application-state' import { useApplicationState } from '../../../../../hooks/common/use-application-state'
export interface EditorPreferenceNumberProps { export interface EditorPreferenceNumberProps {

View file

@ -4,12 +4,13 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { EditorConfiguration } from 'codemirror' import type { EditorConfiguration } from 'codemirror'
import React, { ChangeEvent, useCallback } from 'react' import type { ChangeEvent } from 'react'
import React, { useCallback } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { mergeEditorPreferences } from '../../../../../redux/editor/methods' import { mergeEditorPreferences } from '../../../../../redux/editor/methods'
import { EditorPreferenceInput, EditorPreferenceInputType } from './editor-preference-input' import { EditorPreferenceInput, EditorPreferenceInputType } from './editor-preference-input'
import { EditorPreferenceProperty } from './editor-preference-property' import type { EditorPreferenceProperty } from './editor-preference-property'
import { useApplicationState } from '../../../../../hooks/common/use-application-state' import { useApplicationState } from '../../../../../hooks/common/use-application-state'
export interface EditorPreferenceSelectPropertyProps { export interface EditorPreferenceSelectPropertyProps {

View file

@ -3,7 +3,8 @@
* *
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import React, { ChangeEvent, useCallback } from 'react' import type { ChangeEvent } from 'react'
import React, { useCallback } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useApplicationState } from '../../../../../hooks/common/use-application-state' import { useApplicationState } from '../../../../../hooks/common/use-application-state'
import { setEditorSmartPaste } from '../../../../../redux/editor/methods' import { setEditorSmartPaste } from '../../../../../redux/editor/methods'

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import CodeMirror from 'codemirror' import type CodeMirror from 'codemirror'
import React, { Fragment, useState } from 'react' import React, { Fragment, useState } from 'react'
import { Button } from 'react-bootstrap' import { Button } from 'react-bootstrap'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'

View file

@ -5,7 +5,7 @@
*/ */
import { Picker } from 'emoji-picker-element' import { Picker } from 'emoji-picker-element'
import { CustomEmoji, EmojiClickEvent, EmojiClickEventDetail } from 'emoji-picker-element/shared' import type { CustomEmoji, EmojiClickEvent, EmojiClickEventDetail } from 'emoji-picker-element/shared'
import React, { useEffect, useRef } from 'react' import React, { useEffect, useRef } from 'react'
import { useClickAway } from 'react-use' import { useClickAway } from 'react-use'
import { useIsDarkModeActivated } from '../../../../../hooks/common/use-is-dark-mode-activated' import { useIsDarkModeActivated } from '../../../../../hooks/common/use-is-dark-mode-activated'

View file

@ -9,7 +9,7 @@ import { Button, Form, ModalFooter } from 'react-bootstrap'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon' import { ForkAwesomeIcon } from '../../../../common/fork-awesome/fork-awesome-icon'
import { CommonModal } from '../../../../common/modals/common-modal' import { CommonModal } from '../../../../common/modals/common-modal'
import { TableSize } from './table-picker' import type { TableSize } from './table-picker'
export interface CustomTableSizeModalProps { export interface CustomTableSizeModalProps {
showModal: boolean showModal: boolean

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import CodeMirror from 'codemirror' import type CodeMirror from 'codemirror'
import React, { Fragment, useState } from 'react' import React, { Fragment, useState } from 'react'
import { Button } from 'react-bootstrap' import { Button } from 'react-bootstrap'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
import React from 'react' import React from 'react'
import { Button, ButtonGroup, ButtonToolbar } from 'react-bootstrap' import { Button, ButtonGroup, ButtonToolbar } from 'react-bootstrap'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
import React, { Fragment, useCallback, useRef } from 'react' import React, { Fragment, useCallback, useRef } from 'react'
import { Button } from 'react-bootstrap' import { Button } from 'react-bootstrap'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'

View file

@ -5,7 +5,7 @@
*/ */
import { Mock } from 'ts-mockery' import { Mock } from 'ts-mockery'
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
import { isCursorInCodefence } from './codefenceDetection' import { isCursorInCodefence } from './codefenceDetection'
Mock.configure('jest') Mock.configure('jest')

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
export const isCursorInCodefence = (editor: Editor): boolean => { export const isCursorInCodefence = (editor: Editor): boolean => {
const currentLine = editor.getCursor().line const currentLine = editor.getCursor().line

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared' import type { EmojiClickEventDetail, NativeEmoji } from 'emoji-picker-element/shared'
export const getEmojiIcon = (emoji: EmojiClickEventDetail): string => { export const getEmojiIcon = (emoji: EmojiClickEventDetail): string => {
if (emoji.unicode) { if (emoji.unicode) {

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
import { convertClipboardTableToMarkdown, isTable } from '../../table-extractor' import { convertClipboardTableToMarkdown, isTable } from '../../table-extractor'
import { handleUpload } from '../../upload-handler' import { handleUpload } from '../../upload-handler'
import { insertAtCursor } from './toolbarButtonUtils' import { insertAtCursor } from './toolbarButtonUtils'

View file

@ -4,8 +4,9 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import CodeMirror, { Editor, Position, Range } from 'codemirror' import type { Editor, Position, Range } from 'codemirror'
import { EmojiClickEventDetail } from 'emoji-picker-element/shared' import type CodeMirror from 'codemirror'
import type { EmojiClickEventDetail } from 'emoji-picker-element/shared'
import { Mock } from 'ts-mockery' import { Mock } from 'ts-mockery'
import { import {
addCodeFences, addCodeFences,

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
import { EmojiClickEventDetail } from 'emoji-picker-element/shared' import type { EmojiClickEventDetail } from 'emoji-picker-element/shared'
import { createNumberRangeArray } from '../../../../common/number-range/number-range' import { createNumberRangeArray } from '../../../../common/number-range/number-range'
import { getEmojiShortCode } from './emojiUtils' import { getEmojiShortCode } from './emojiUtils'

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Editor } from 'codemirror' import type { Editor } from 'codemirror'
import i18n from 'i18next' import i18n from 'i18next'
import { uploadFile } from '../../../api/media' import { uploadFile } from '../../../api/media'
import { store } from '../../../redux' import { store } from '../../../redux'

View file

@ -8,7 +8,7 @@ import { useEffect, useState } from 'react'
import { useParams } from 'react-router' import { useParams } from 'react-router'
import { getNote } from '../../../api/notes' import { getNote } from '../../../api/notes'
import { setNoteDataFromServer } from '../../../redux/note-details/methods' import { setNoteDataFromServer } from '../../../redux/note-details/methods'
import { EditorPagePathParams } from '../editor-page' import type { EditorPagePathParams } from '../editor-page'
import { Logger } from '../../../utils/logger' import { Logger } from '../../../utils/logger'
const log = new Logger('Load Note From Server') const log = new Logger('Load Note From Server')

View file

@ -8,8 +8,9 @@ import equal from 'fast-deep-equal'
import { useEffect, useRef } from 'react' import { useEffect, useRef } from 'react'
import { store } from '../../../redux' import { store } from '../../../redux'
import { useParams } from 'react-router-dom' import { useParams } from 'react-router-dom'
import { EditorPagePathParams } from '../editor-page' import type { EditorPagePathParams } from '../editor-page'
import { HistoryEntry, HistoryEntryOrigin } from '../../../redux/history/types' import type { HistoryEntry } from '../../../redux/history/types'
import { HistoryEntryOrigin } from '../../../redux/history/types'
import { updateLocalHistoryEntry } from '../../../redux/history/methods' import { updateLocalHistoryEntry } from '../../../redux/history/methods'
import { useApplicationState } from '../../../hooks/common/use-application-state' import { useApplicationState } from '../../../hooks/common/use-application-state'

View file

@ -6,7 +6,7 @@
import React, { createContext, useContext, useEffect, useMemo } from 'react' import React, { createContext, useContext, useEffect, useMemo } from 'react'
import { useSelector } from 'react-redux' import { useSelector } from 'react-redux'
import { ApplicationState } from '../../../redux' import type { ApplicationState } from '../../../redux'
import { RendererToEditorCommunicator } from '../../render-page/window-post-message-communicator/renderer-to-editor-communicator' import { RendererToEditorCommunicator } from '../../render-page/window-post-message-communicator/renderer-to-editor-communicator'
import { CommunicationMessageType } from '../../render-page/window-post-message-communicator/rendering-message' import { CommunicationMessageType } from '../../render-page/window-post-message-communicator/rendering-message'

View file

@ -6,11 +6,11 @@
import React, { useCallback, useState } from 'react' import React, { useCallback, useState } from 'react'
import { ImageLightboxModal } from '../../markdown-renderer/replace-components/image/image-lightbox-modal' import { ImageLightboxModal } from '../../markdown-renderer/replace-components/image/image-lightbox-modal'
import { import type {
CommunicationMessageType,
ImageClickedMessage, ImageClickedMessage,
ImageDetails ImageDetails
} from '../../render-page/window-post-message-communicator/rendering-message' } from '../../render-page/window-post-message-communicator/rendering-message'
import { CommunicationMessageType } from '../../render-page/window-post-message-communicator/rendering-message'
import { useEditorReceiveHandler } from '../../render-page/window-post-message-communicator/hooks/use-editor-receive-handler' import { useEditorReceiveHandler } from '../../render-page/window-post-message-communicator/hooks/use-editor-receive-handler'
export const CommunicatorImageLightbox: React.FC = () => { export const CommunicatorImageLightbox: React.FC = () => {

View file

@ -5,7 +5,7 @@
*/ */
import { useEffect, useRef } from 'react' import { useEffect, useRef } from 'react'
import { RendererType } from '../../../render-page/window-post-message-communicator/rendering-message' import type { RendererType } from '../../../render-page/window-post-message-communicator/rendering-message'
/** /**
* Execute the given reload callback if the given render type changes. * Execute the given reload callback if the given render type changes.

View file

@ -4,7 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { RefObject, useCallback, useEffect, useMemo, useRef } from 'react' import type { RefObject } from 'react'
import { useCallback, useEffect, useMemo, useRef } from 'react'
import { Logger } from '../../../../utils/logger' import { Logger } from '../../../../utils/logger'
const log = new Logger('IframeLoader') const log = new Logger('IframeLoader')

View file

@ -8,7 +8,7 @@ import { useSendToRenderer } from '../../../render-page/window-post-message-comm
import { useMemo, useRef } from 'react' import { useMemo, useRef } from 'react'
import { CommunicationMessageType } from '../../../render-page/window-post-message-communicator/rendering-message' import { CommunicationMessageType } from '../../../render-page/window-post-message-communicator/rendering-message'
import { useApplicationState } from '../../../../hooks/common/use-application-state' import { useApplicationState } from '../../../../hooks/common/use-application-state'
import { RendererFrontmatterInfo } from '../../../common/note-frontmatter/types' import type { RendererFrontmatterInfo } from '../../../common/note-frontmatter/types'
import equal from 'fast-deep-equal' import equal from 'fast-deep-equal'
/** /**

View file

@ -5,7 +5,7 @@
*/ */
import { useCallback, useRef } from 'react' import { useCallback, useRef } from 'react'
import { ScrollState } from '../../synced-scroll/scroll-props' import type { ScrollState } from '../../synced-scroll/scroll-props'
import { CommunicationMessageType } from '../../../render-page/window-post-message-communicator/rendering-message' import { CommunicationMessageType } from '../../../render-page/window-post-message-communicator/rendering-message'
import { useEffectOnRendererReady } from '../../../render-page/window-post-message-communicator/hooks/use-effect-on-renderer-ready' import { useEffectOnRendererReady } from '../../../render-page/window-post-message-communicator/hooks/use-effect-on-renderer-ready'
import equal from 'fast-deep-equal' import equal from 'fast-deep-equal'

View file

@ -5,15 +5,15 @@
*/ */
import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react' import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react'
import { isTestMode } from '../../../utils/test-modes' import { isTestMode } from '../../../utils/test-modes'
import { RendererProps } from '../../render-page/markdown-document' import type { RendererProps } from '../../render-page/markdown-document'
import { import type {
CommunicationMessageType,
OnFirstHeadingChangeMessage, OnFirstHeadingChangeMessage,
OnHeightChangeMessage, OnHeightChangeMessage,
OnTaskCheckboxChangeMessage, OnTaskCheckboxChangeMessage,
RendererType, RendererType,
SetScrollStateMessage SetScrollStateMessage
} from '../../render-page/window-post-message-communicator/rendering-message' } from '../../render-page/window-post-message-communicator/rendering-message'
import { CommunicationMessageType } from '../../render-page/window-post-message-communicator/rendering-message'
import { useEditorToRendererCommunicator } from '../render-context/editor-to-renderer-communicator-context-provider' import { useEditorToRendererCommunicator } from '../render-context/editor-to-renderer-communicator-context-provider'
import { useForceRenderPageUrlOnIframeLoadCallback } from './hooks/use-force-render-page-url-on-iframe-load-callback' import { useForceRenderPageUrlOnIframeLoadCallback } from './hooks/use-force-render-page-url-on-iframe-load-callback'
import { CommunicatorImageLightbox } from './communicator-image-lightbox' import { CommunicatorImageLightbox } from './communicator-image-lightbox'

View file

@ -10,7 +10,7 @@ import { Trans, useTranslation } from 'react-i18next'
import links from '../../../links.json' import links from '../../../links.json'
import { TranslatedExternalLink } from '../../common/links/translated-external-link' import { TranslatedExternalLink } from '../../common/links/translated-external-link'
import { ShowIf } from '../../common/show-if/show-if' import { ShowIf } from '../../common/show-if/show-if'
import { CommonModalProps } from '../../common/modals/common-modal' import type { CommonModalProps } from '../../common/modals/common-modal'
export const YamlArrayDeprecationAlert: React.FC<Partial<CommonModalProps>> = ({ show }) => { export const YamlArrayDeprecationAlert: React.FC<Partial<CommonModalProps>> = ({ show }) => {
useTranslation() useTranslation()

View file

@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
import { DeletionModal } from '../../common/modals/deletion-modal' import { DeletionModal } from '../../common/modals/deletion-modal'
import { SidebarButton } from './sidebar-button' import { SidebarButton } from './sidebar-button'
import { SpecificSidebarEntryProps } from './types' import type { SpecificSidebarEntryProps } from './types'
export const DeleteNoteSidebarEntry: React.FC<SpecificSidebarEntryProps> = ({ hide, className }) => { export const DeleteNoteSidebarEntry: React.FC<SpecificSidebarEntryProps> = ({ hide, className }) => {
useTranslation() useTranslation()

View file

@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
import { DocumentInfoModal } from '../document-bar/document-info/document-info-modal' import { DocumentInfoModal } from '../document-bar/document-info/document-info-modal'
import { SidebarButton } from './sidebar-button' import { SidebarButton } from './sidebar-button'
import { SpecificSidebarEntryProps } from './types' import type { SpecificSidebarEntryProps } from './types'
export const DocumentInfoSidebarEntry: React.FC<SpecificSidebarEntryProps> = ({ className, hide }) => { export const DocumentInfoSidebarEntry: React.FC<SpecificSidebarEntryProps> = ({ className, hide }) => {
const [showModal, setShowModal] = useState(false) const [showModal, setShowModal] = useState(false)

View file

@ -10,7 +10,8 @@ import links from '../../../links.json'
import { ExportMarkdownSidebarEntry } from './export-markdown-sidebar-entry' import { ExportMarkdownSidebarEntry } from './export-markdown-sidebar-entry'
import { SidebarButton } from './sidebar-button' import { SidebarButton } from './sidebar-button'
import { SidebarMenu } from './sidebar-menu' import { SidebarMenu } from './sidebar-menu'
import { DocumentSidebarMenuSelection, SpecificSidebarMenuProps } from './types' import type { SpecificSidebarMenuProps } from './types'
import { DocumentSidebarMenuSelection } from './types'
export const ExportMenuSidebarMenu: React.FC<SpecificSidebarMenuProps> = ({ export const ExportMenuSidebarMenu: React.FC<SpecificSidebarMenuProps> = ({
className, className,

View file

@ -9,7 +9,8 @@ import { Trans, useTranslation } from 'react-i18next'
import { ImportMarkdownSidebarEntry } from './import-markdown-sidebar-entry' import { ImportMarkdownSidebarEntry } from './import-markdown-sidebar-entry'
import { SidebarButton } from './sidebar-button' import { SidebarButton } from './sidebar-button'
import { SidebarMenu } from './sidebar-menu' import { SidebarMenu } from './sidebar-menu'
import { DocumentSidebarMenuSelection, SpecificSidebarMenuProps } from './types' import type { SpecificSidebarMenuProps } from './types'
import { DocumentSidebarMenuSelection } from './types'
export const ImportMenuSidebarMenu: React.FC<SpecificSidebarMenuProps> = ({ export const ImportMenuSidebarMenu: React.FC<SpecificSidebarMenuProps> = ({
className, className,

Some files were not shown because too many files have changed in this diff Show more