mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
fix(frontend): reformat source files
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
e260b77760
commit
e390c0dd15
669 changed files with 1741 additions and 2354 deletions
11
frontend/src/redux/application-state.d.ts
vendored
11
frontend/src/redux/application-state.d.ts
vendored
|
@ -3,15 +3,14 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { OptionalUserState } from './user/types'
|
||||
import type { Config } from '../api/config/types'
|
||||
import type { EditorConfig } from './editor/types'
|
||||
import type { DarkModeConfig } from './dark-mode/types'
|
||||
import type { NoteDetails } from './note-details/types/note-details'
|
||||
import type { RendererStatus } from './renderer-status/types'
|
||||
import type { HistoryEntryWithOrigin } from '../api/history/types'
|
||||
import type { DarkModeConfig } from './dark-mode/types'
|
||||
import type { EditorConfig } from './editor/types'
|
||||
import type { NoteDetails } from './note-details/types/note-details'
|
||||
import type { RealtimeState } from './realtime/types'
|
||||
import type { RendererStatus } from './renderer-status/types'
|
||||
import type { OptionalUserState } from './user/types'
|
||||
|
||||
export interface ApplicationState {
|
||||
user: OptionalUserState
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { store } from '..'
|
||||
import type { Config } from '../../api/config/types'
|
||||
import type { SetConfigAction } from './types'
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Reducer } from 'redux'
|
||||
import type { Config } from '../../api/config/types'
|
||||
import type { ConfigActions } from './types'
|
||||
import { ConfigActionType } from './types'
|
||||
import type { Reducer } from 'redux'
|
||||
|
||||
export const initialState: Config = {
|
||||
allowAnonymous: true,
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Action } from 'redux'
|
||||
import type { Config } from '../../api/config/types'
|
||||
import type { Action } from 'redux'
|
||||
|
||||
export enum ConfigActionType {
|
||||
SET_CONFIG = 'config/set'
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { store } from '..'
|
||||
import type { DarkModeConfigAction, DarkModePreference } from './types'
|
||||
import { DarkModeConfigActionType } from './types'
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Reducer } from 'redux'
|
||||
import type { DarkModeConfig, DarkModeConfigAction } from './types'
|
||||
import { DarkModeConfigActionType, DarkModePreference } from './types'
|
||||
import type { Reducer } from 'redux'
|
||||
|
||||
const initialState: DarkModeConfig = {
|
||||
darkModePreference: DarkModePreference.AUTO
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Action } from 'redux'
|
||||
|
||||
export enum DarkModeConfigActionType {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { store } from '..'
|
||||
import { Logger } from '../../utils/logger'
|
||||
import type {
|
||||
EditorConfig,
|
||||
SetEditorLigaturesAction,
|
||||
|
@ -12,7 +12,6 @@ import type {
|
|||
SetEditorSyncScrollAction
|
||||
} from './types'
|
||||
import { EditorConfigActionType } from './types'
|
||||
import { Logger } from '../../utils/logger'
|
||||
|
||||
const log = new Logger('Redux > Editor')
|
||||
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Reducer } from 'redux'
|
||||
import { loadFromLocalStorage, saveToLocalStorage } from './methods'
|
||||
import type { EditorConfig, EditorConfigActions } from './types'
|
||||
import { EditorConfigActionType } from './types'
|
||||
import type { Reducer } from 'redux'
|
||||
|
||||
const initialState: EditorConfig = {
|
||||
ligatures: true,
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Action } from 'redux'
|
||||
|
||||
export enum EditorConfigActionType {
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { getGlobalState, store } from '../index'
|
||||
import type { HistoryExportJson, RemoveEntryAction, SetEntriesAction, UpdateEntryAction, V1HistoryEntry } from './types'
|
||||
import { HistoryActionType } from './types'
|
||||
import { download } from '../../components/common/download/download'
|
||||
import { DateTime } from 'luxon'
|
||||
import {
|
||||
deleteRemoteHistory,
|
||||
deleteRemoteHistoryEntry,
|
||||
|
@ -17,9 +11,14 @@ import {
|
|||
updateRemoteHistoryEntryPinStatus
|
||||
} from '../../api/history'
|
||||
import { addRemoteOriginToHistoryEntry, historyEntryToHistoryEntryPutDto } from '../../api/history/dto-methods'
|
||||
import { Logger } from '../../utils/logger'
|
||||
import type { HistoryEntry, HistoryEntryWithOrigin } from '../../api/history/types'
|
||||
import { HistoryEntryOrigin } from '../../api/history/types'
|
||||
import { download } from '../../components/common/download/download'
|
||||
import { Logger } from '../../utils/logger'
|
||||
import { getGlobalState, store } from '../index'
|
||||
import type { HistoryExportJson, RemoveEntryAction, SetEntriesAction, UpdateEntryAction, V1HistoryEntry } from './types'
|
||||
import { HistoryActionType } from './types'
|
||||
import { DateTime } from 'luxon'
|
||||
|
||||
const log = new Logger('Redux > History')
|
||||
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Reducer } from 'redux'
|
||||
import type { HistoryEntryWithOrigin } from '../../api/history/types'
|
||||
import type { HistoryActions } from './types'
|
||||
import { HistoryActionType } from './types'
|
||||
import type { HistoryEntryWithOrigin } from '../../api/history/types'
|
||||
import type { Reducer } from 'redux'
|
||||
|
||||
// Q: Why is the reducer initialized with an empty array instead of the actual history entries like in the config reducer?
|
||||
// A: The history reducer will be created without entries because of async entry retrieval.
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Action } from 'redux'
|
||||
import type { HistoryEntryWithOrigin } from '../../api/history/types'
|
||||
import type { Action } from 'redux'
|
||||
|
||||
export interface V1HistoryEntry {
|
||||
id: string
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { allReducers } from './reducers'
|
||||
import type { ApplicationState } from './application-state'
|
||||
import { configureStore } from '@reduxjs/toolkit'
|
||||
import { isDevMode } from '../utils/test-modes'
|
||||
import type { ApplicationState } from './application-state'
|
||||
import { allReducers } from './reducers'
|
||||
import { configureStore } from '@reduxjs/toolkit'
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: allReducers,
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { NoteDetails } from './types/note-details'
|
||||
import { extractFrontmatter } from './frontmatter-extractor/extractor'
|
||||
import { initialState } from './initial-state'
|
||||
import type { PresentFrontmatterExtractionResult } from './frontmatter-extractor/types'
|
||||
import { createNoteFrontmatterFromYaml } from './raw-note-frontmatter-parser/parser'
|
||||
import { generateNoteTitle } from './generate-note-title'
|
||||
import { calculateLineStartIndexes } from './calculate-line-start-indexes'
|
||||
import { extractFrontmatter } from './frontmatter-extractor/extractor'
|
||||
import type { PresentFrontmatterExtractionResult } from './frontmatter-extractor/types'
|
||||
import { generateNoteTitle } from './generate-note-title'
|
||||
import { initialState } from './initial-state'
|
||||
import { createNoteFrontmatterFromYaml } from './raw-note-frontmatter-parser/parser'
|
||||
import type { NoteDetails } from './types/note-details'
|
||||
|
||||
/**
|
||||
* Copies a {@link NoteDetails} but with another markdown content.
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { calculateLineStartIndexes } from './calculate-line-start-indexes'
|
||||
|
||||
describe('calculateLineStartIndexes', () => {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { extractFrontmatter } from './extractor'
|
||||
import type { PresentFrontmatterExtractionResult } from './types'
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { generateNoteTitle } from './generate-note-title'
|
||||
import { initialState } from './initial-state'
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { NoteFrontmatter } from './types/note-details'
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { NoteDetails } from './types/note-details'
|
||||
import { NoteTextDirection, NoteType } from './types/note-details'
|
||||
import type { SlideOptions } from './types/slide-show-options'
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { store } from '..'
|
||||
import { getNoteMetadata } from '../../api/notes'
|
||||
import type { Note, NotePermissions } from '../../api/notes/types'
|
||||
import type { CursorSelection } from '../../components/editor-page/editor-pane/tool-bar/formatters/types/cursor-selection'
|
||||
import type {
|
||||
SetNoteDetailsFromServerAction,
|
||||
SetNoteDocumentContentAction,
|
||||
|
@ -15,8 +16,6 @@ import type {
|
|||
UpdateNoteTitleByFirstHeadingAction
|
||||
} from './types'
|
||||
import { NoteDetailsActionType } from './types'
|
||||
import type { CursorSelection } from '../../components/editor-page/editor-pane/tool-bar/formatters/types/cursor-selection'
|
||||
import { getNoteMetadata } from '../../api/notes'
|
||||
|
||||
/**
|
||||
* Sets the content of the current note, extracts and parses the frontmatter and extracts the markdown content part.
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { createNoteFrontmatterFromYaml } from './parser'
|
||||
|
||||
describe('yaml frontmatter', () => {
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { load } from 'js-yaml'
|
||||
import type { SlideOptions } from '../types/slide-show-options'
|
||||
import { initialSlideOptions, initialState } from '../initial-state'
|
||||
import { ISO6391 } from '../types/iso6391'
|
||||
import type { Iso6391Language, NoteFrontmatter, OpenGraph } from '../types/note-details'
|
||||
import { NoteTextDirection, NoteType } from '../types/note-details'
|
||||
import { ISO6391 } from '../types/iso6391'
|
||||
import type { SlideOptions } from '../types/slide-show-options'
|
||||
import type { RawNoteFrontmatter } from './types'
|
||||
import { initialSlideOptions, initialState } from '../initial-state'
|
||||
import { load } from 'js-yaml'
|
||||
|
||||
/**
|
||||
* Creates a new frontmatter metadata instance based on a raw yaml string.
|
||||
|
|
|
@ -3,18 +3,17 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Reducer } from 'redux'
|
||||
import { buildStateFromUpdatedMarkdownContent } from './build-state-from-updated-markdown-content'
|
||||
import { initialState } from './initial-state'
|
||||
import { buildStateFromFirstHeadingUpdate } from './reducers/build-state-from-first-heading-update'
|
||||
import { buildStateFromMetadataUpdate } from './reducers/build-state-from-metadata-update'
|
||||
import { buildStateFromServerPermissions } from './reducers/build-state-from-server-permissions'
|
||||
import { buildStateFromServerDto } from './reducers/build-state-from-set-note-data-from-server'
|
||||
import { buildStateFromUpdateCursorPosition } from './reducers/build-state-from-update-cursor-position'
|
||||
import type { NoteDetailsActions } from './types'
|
||||
import { NoteDetailsActionType } from './types'
|
||||
import { initialState } from './initial-state'
|
||||
import type { NoteDetails } from './types/note-details'
|
||||
import { buildStateFromUpdatedMarkdownContent } from './build-state-from-updated-markdown-content'
|
||||
import { buildStateFromUpdateCursorPosition } from './reducers/build-state-from-update-cursor-position'
|
||||
import { buildStateFromFirstHeadingUpdate } from './reducers/build-state-from-first-heading-update'
|
||||
import { buildStateFromServerDto } from './reducers/build-state-from-set-note-data-from-server'
|
||||
import { buildStateFromServerPermissions } from './reducers/build-state-from-server-permissions'
|
||||
import { buildStateFromMetadataUpdate } from './reducers/build-state-from-metadata-update'
|
||||
import type { Reducer } from 'redux'
|
||||
|
||||
export const NoteDetailsReducer: Reducer<NoteDetails, NoteDetailsActions> = (
|
||||
state: NoteDetails = initialState,
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { buildStateFromFirstHeadingUpdate } from './build-state-from-first-heading-update'
|
||||
import { initialState } from '../initial-state'
|
||||
import { buildStateFromFirstHeadingUpdate } from './build-state-from-first-heading-update'
|
||||
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
jest.mock('../generate-note-title', () => ({
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import { generateNoteTitle } from '../generate-note-title'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
|
||||
/**
|
||||
* Builds a {@link NoteDetails} redux state with an updated note title from frontmatter data and the first heading.
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { initialState } from '../initial-state'
|
||||
import type { NoteMetadata } from '../../../api/notes/types'
|
||||
import { initialState } from '../initial-state'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import { buildStateFromMetadataUpdate } from './build-state-from-metadata-update'
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { initialState } from '../initial-state'
|
||||
import type { NotePermissions } from '../../../api/notes/types'
|
||||
import { buildStateFromServerPermissions } from './build-state-from-server-permissions'
|
||||
import { initialState } from '../initial-state'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import { buildStateFromServerPermissions } from './build-state-from-server-permissions'
|
||||
|
||||
describe('build state from server permissions', () => {
|
||||
it('creates a new state with the given permissions', () => {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import type { NotePermissions } from '../../../api/notes/types'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
|
||||
/**
|
||||
* Builds the updated state from a given previous state and updated NotePermissions data.
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { buildStateFromServerDto } from './build-state-from-set-note-data-from-server'
|
||||
import type { Note } from '../../../api/notes/types'
|
||||
import * as buildStateFromUpdatedMarkdownContentModule from '../build-state-from-updated-markdown-content'
|
||||
import { Mock } from 'ts-mockery'
|
||||
import { initialSlideOptions } from '../initial-state'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import { NoteTextDirection, NoteType } from '../types/note-details'
|
||||
import { buildStateFromServerDto } from './build-state-from-set-note-data-from-server'
|
||||
import { DateTime } from 'luxon'
|
||||
import { initialSlideOptions } from '../initial-state'
|
||||
import type { Note } from '../../../api/notes/types'
|
||||
import { Mock } from 'ts-mockery'
|
||||
|
||||
jest.mock('../build-state-from-updated-markdown-content')
|
||||
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import { buildStateFromUpdatedMarkdownContent } from '../build-state-from-updated-markdown-content'
|
||||
import { initialState } from '../initial-state'
|
||||
import { calculateLineStartIndexes } from '../calculate-line-start-indexes'
|
||||
import type { Note } from '../../../api/notes/types'
|
||||
import { buildStateFromUpdatedMarkdownContent } from '../build-state-from-updated-markdown-content'
|
||||
import { calculateLineStartIndexes } from '../calculate-line-start-indexes'
|
||||
import { initialState } from '../initial-state'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import { buildStateFromMetadataUpdate } from './build-state-from-metadata-update'
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { initialState } from '../initial-state'
|
||||
import * as buildStateFromUpdatedMarkdownContentLinesModule from '../build-state-from-updated-markdown-content'
|
||||
import { Mock } from 'ts-mockery'
|
||||
import { initialState } from '../initial-state'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import { buildStateFromTaskListUpdate } from './build-state-from-task-list-update'
|
||||
import { Mock } from 'ts-mockery'
|
||||
|
||||
jest.mock('../build-state-from-updated-markdown-content')
|
||||
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { buildStateFromUpdatedMarkdownContentLines } from '../build-state-from-updated-markdown-content'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import { Optional } from '@mrdrogdrog/optional'
|
||||
import { buildStateFromUpdatedMarkdownContentLines } from '../build-state-from-updated-markdown-content'
|
||||
|
||||
const TASK_REGEX = /(\s*(?:[-*+]|\d+[.)]) )\[[ xX]?]( .*)/
|
||||
/**
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { initialState } from '../initial-state'
|
||||
import { Mock } from 'ts-mockery'
|
||||
import { buildStateFromUpdateCursorPosition } from './build-state-from-update-cursor-position'
|
||||
import type { CursorSelection } from '../../../components/editor-page/editor-pane/tool-bar/formatters/types/cursor-selection'
|
||||
import { initialState } from '../initial-state'
|
||||
import { buildStateFromUpdateCursorPosition } from './build-state-from-update-cursor-position'
|
||||
import { Mock } from 'ts-mockery'
|
||||
|
||||
describe('build state from update cursor position', () => {
|
||||
it('creates a new state with the given cursor', () => {
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import type { CursorSelection } from '../../../components/editor-page/editor-pane/tool-bar/formatters/types/cursor-selection'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
|
||||
export const buildStateFromUpdateCursorPosition = (state: NoteDetails, selection: CursorSelection): NoteDetails => {
|
||||
const correctedSelection = isFromAfterTo(selection)
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Action } from 'redux'
|
||||
import type { Note, NoteMetadata, NotePermissions } from '../../api/notes/types'
|
||||
import type { CursorSelection } from '../../components/editor-page/editor-pane/tool-bar/formatters/types/cursor-selection'
|
||||
import type { Action } from 'redux'
|
||||
|
||||
export enum NoteDetailsActionType {
|
||||
SET_DOCUMENT_CONTENT = 'note-details/content/set',
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { SlideOptions } from './slide-show-options'
|
||||
import type { ISO6391 } from './iso6391'
|
||||
import type { NoteMetadata } from '../../../api/notes/types'
|
||||
import type { CursorSelection } from '../../../components/editor-page/editor-pane/tool-bar/formatters/types/cursor-selection'
|
||||
import type { ISO6391 } from './iso6391'
|
||||
import type { SlideOptions } from './slide-show-options'
|
||||
|
||||
type UnnecessaryNoteAttributes = 'updatedAt' | 'createdAt' | 'tags' | 'description'
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { RevealOptions } from 'reveal.js'
|
||||
|
||||
type WantedRevealOptions = 'autoSlide' | 'autoSlideStoppable' | 'transition' | 'backgroundTransition' | 'slideNumber'
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { store } from '..'
|
||||
import type { AddOnlineUserAction, OnlineUser, RemoveOnlineUserAction } from './types'
|
||||
import { RealtimeActionType } from './types'
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { buildStateFromAddUser } from './reducers/build-state-from-add-user'
|
||||
import { buildStateFromRemoveUser } from './reducers/build-state-from-remove-user'
|
||||
import type { RealtimeActions, RealtimeState } from './types'
|
||||
import { RealtimeActionType } from './types'
|
||||
import type { Reducer } from 'redux'
|
||||
import { buildStateFromRemoveUser } from './reducers/build-state-from-remove-user'
|
||||
import { buildStateFromAddUser } from './reducers/build-state-from-add-user'
|
||||
|
||||
const initialState: RealtimeState = {
|
||||
users: []
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { OnlineUser, RealtimeState } from '../types'
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { RealtimeState } from '../types'
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Action } from 'redux'
|
||||
|
||||
export enum RealtimeActionType {
|
||||
|
|
|
@ -3,18 +3,17 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { ApplicationState } from './application-state'
|
||||
import { ConfigReducer } from './config/reducers'
|
||||
import { DarkModeConfigReducer } from './dark-mode/reducers'
|
||||
import { EditorConfigReducer } from './editor/reducers'
|
||||
import { HistoryReducer } from './history/reducers'
|
||||
import { NoteDetailsReducer } from './note-details/reducer'
|
||||
import { RealtimeReducer } from './realtime/reducers'
|
||||
import { RendererStatusReducer } from './renderer-status/reducers'
|
||||
import { UserReducer } from './user/reducers'
|
||||
import type { Reducer } from 'redux'
|
||||
import { combineReducers } from 'redux'
|
||||
import { UserReducer } from './user/reducers'
|
||||
import { ConfigReducer } from './config/reducers'
|
||||
import { HistoryReducer } from './history/reducers'
|
||||
import { EditorConfigReducer } from './editor/reducers'
|
||||
import { DarkModeConfigReducer } from './dark-mode/reducers'
|
||||
import { NoteDetailsReducer } from './note-details/reducer'
|
||||
import { RendererStatusReducer } from './renderer-status/reducers'
|
||||
import type { ApplicationState } from './application-state'
|
||||
import { RealtimeReducer } from './realtime/reducers'
|
||||
|
||||
export const allReducers: Reducer<ApplicationState> = combineReducers<ApplicationState>({
|
||||
user: UserReducer,
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { store } from '..'
|
||||
import type { SetRendererStatusAction } from './types'
|
||||
import { RendererStatusActionType } from './types'
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { RendererStatus, RendererStatusActions } from './types'
|
||||
import { RendererStatusActionType } from './types'
|
||||
import type { Reducer } from 'redux'
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Action } from 'redux'
|
||||
|
||||
export enum RendererStatusActionType {
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { store } from './index'
|
||||
import type { PropsWithChildren } from 'react'
|
||||
import React from 'react'
|
||||
import { Provider } from 'react-redux'
|
||||
import { store } from './index'
|
||||
|
||||
/**
|
||||
* Sets the redux store for the children components.
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { store } from '..'
|
||||
import type { LoginUserInfo } from '../../api/me/types'
|
||||
import type { ClearUserAction, SetUserAction } from './types'
|
||||
import { UserActionType } from './types'
|
||||
import type { LoginUserInfo } from '../../api/me/types'
|
||||
|
||||
/**
|
||||
* Sets the given user state into the redux.
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Reducer } from 'redux'
|
||||
import type { OptionalUserState, UserActions } from './types'
|
||||
import { UserActionType } from './types'
|
||||
import type { Reducer } from 'redux'
|
||||
|
||||
export const UserReducer: Reducer<OptionalUserState, UserActions> = (
|
||||
state: OptionalUserState = null,
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Action } from 'redux'
|
||||
import type { LoginUserInfo } from '../../api/me/types'
|
||||
import type { Action } from 'redux'
|
||||
|
||||
export enum UserActionType {
|
||||
SET_USER = 'user/set',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue