feat(editor): header history, save line and Abandonner les modifications
Header Annuler/Retablir on every tab (aria-disabled, commit on pointerdown, refused blur commit skips the undo). Save line: unsaved count selector (savedDistance), saveLineState forms, server save time via readSaveTime (lastSave in the store, never the browser clock). Discard relabelled and names the stored copy. Tool column pair removed, glyphs in EditorGlyph. Rewritten or removed assertions (R-24): - editor-route.test: Revision 3 / unsaved text / Annuler les modifications -> save-line testid, Abandonner label, copy sentence in the dialog - editor-route-conflict, editor-route-recovery: Revision n and copy_cap/ copy_quota text queries -> save-line testid - editor-no-loss: discard button label - editor-annotations-tab: tool column undo/redo test -> no pair left (behaviour moved to editor-history-buttons.test) - e2e journey/annotations/recovery/structures/support saveDraft/lan: undo/redo and revision/unsaved text -> historyButton, saveLine helpers; structures toHaveCount(0) on old text -> exact Revision n line - editor-shell clickability: header Annuler/Retablir added
This commit is contained in:
1 parent
ab51ea764d
commit
99b669bf8f
29 files changed
+1397
-248
No files matched your search
@@ -0,0 +1,71 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import Button from '@/components/ui/Button'
|
||||
import { useEditorReadOnly } from '@/editor/editingContext'
|
||||
import { loadFailureMessage } from '@/editor/messages'
|
||||
import { copyExists } from '@/editor/state/recovery'
|
||||
import { useEditorStore } from '@/editor/state/editorStore'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import ConfirmDialog from './ConfirmDialog'
|
||||
|
||||
/**
|
||||
* « Abandonner les modifications »: asks first, then the store reloads the server draft.
|
||||
* The confirmation names the temporary local copy when one is stored at the moment it
|
||||
* opens (a copy left by an earlier write counts, not only the last write's).
|
||||
*/
|
||||
export default function DiscardButton({
|
||||
onFailure,
|
||||
}: {
|
||||
/** A failed reload after a discard, worded for the notice under the header. */
|
||||
onFailure: (message: string | null) => void
|
||||
}) {
|
||||
const t = useT()
|
||||
const unsaved = useEditorStore((s) => s.unsaved)
|
||||
const saving = useEditorStore((s) => s.saving)
|
||||
const readOnly = useEditorReadOnly()
|
||||
const [asking, setAsking] = useState(false)
|
||||
const [copyNamed, setCopyNamed] = useState(false)
|
||||
// The editor turned read-only while asking: the confirmation closes without effect.
|
||||
useEffect(() => {
|
||||
if (readOnly) setAsking(false)
|
||||
}, [readOnly])
|
||||
const ask = () => {
|
||||
const { userId, versionId } = useEditorStore.getState()
|
||||
setCopyNamed(copyExists(userId ?? '', versionId ?? ''))
|
||||
setAsking(true)
|
||||
}
|
||||
const discard = async () => {
|
||||
setAsking(false)
|
||||
const result = await useEditorStore
|
||||
.getState()
|
||||
.discardChanges({ confirmed: true })
|
||||
onFailure(
|
||||
!result.ok && result.reason === 'load'
|
||||
? loadFailureMessage(t, result.failure)
|
||||
: null,
|
||||
)
|
||||
}
|
||||
const body = copyNamed
|
||||
? `${t('editor.draft.discard_ask')} ${t('editor.draft.discard_copy')}`
|
||||
: t('editor.draft.discard_ask')
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
disabled={!unsaved || saving || readOnly}
|
||||
onClick={ask}
|
||||
>
|
||||
{t('editor.draft.discard')}
|
||||
</Button>
|
||||
<ConfirmDialog
|
||||
open={asking}
|
||||
title={t('editor.draft.discard')}
|
||||
body={body}
|
||||
confirmLabel={t('editor.draft.discard_confirm')}
|
||||
cancelLabel={t('common.cancel')}
|
||||
onConfirm={() => void discard()}
|
||||
onCancel={() => setAsking(false)}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
export type GlyphName =
|
||||
| 'select'
|
||||
| 'point'
|
||||
| 'zone'
|
||||
| 'link'
|
||||
| 'in'
|
||||
| 'out'
|
||||
| 'fit'
|
||||
| 'undo'
|
||||
| 'redo'
|
||||
| 'search'
|
||||
|
||||
/** The editor's one glyph table (24-unit grid strokes); `book` and `close` are in `Icon`. */
|
||||
const GLYPHS: Record<GlyphName, string> = {
|
||||
select: 'M5 3l12 7-5 1-3 5z',
|
||||
point: 'M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 3v3M12 18v3M3 12h3M18 12h3',
|
||||
zone: 'M12 3l8 6-3 10H7L4 9z',
|
||||
link: 'M4 4h8v8H4zM12 12h8v8h-8z',
|
||||
in: 'M11 5v12M5 11h12M20 20l-4-4',
|
||||
out: 'M5 11h12M20 20l-4-4',
|
||||
fit: 'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5',
|
||||
undo: 'M9 7L4 12l5 5M4 12h11a5 5 0 0 1 0 10',
|
||||
redo: 'M15 7l5 5-5 5M20 12H9a5 5 0 0 0 0 10',
|
||||
search: 'M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM20 20l-4-4',
|
||||
}
|
||||
|
||||
/** A decorative glyph of the editor, drawn in the current text colour. */
|
||||
export default function EditorGlyph({
|
||||
name,
|
||||
size = 20,
|
||||
}: {
|
||||
name: GlyphName
|
||||
size?: number
|
||||
}) {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
width={size}
|
||||
height={size}
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="1.8"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path d={GLYPHS[name]} />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
} from '@/editor/tabs'
|
||||
import type { TabTier } from '@/editor/useViewport'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import HistoryButtons from './HistoryButtons'
|
||||
|
||||
const BASE =
|
||||
'min-h-11 whitespace-nowrap border-b-2 px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]'
|
||||
@@ -143,6 +144,7 @@ interface EditorTabsProps {
|
||||
/**
|
||||
* The draft's tab row (boards 04 and 05): the four tabs from 640 px, Annotations and
|
||||
* Vérification below it with « Plus » opening a disclosure of the others (no measurement).
|
||||
* « Annuler » and « Rétablir » sit at the right end of the row on every tab.
|
||||
*/
|
||||
export default function EditorTabs({
|
||||
active,
|
||||
@@ -156,6 +158,7 @@ export default function EditorTabs({
|
||||
{more.length > 0 && (
|
||||
<MoreTabs more={more} active={active} onSelect={onSelect} />
|
||||
)}
|
||||
<HistoryButtons />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import Button from '@/components/ui/Button'
|
||||
import Icon from '@/components/ui/Icon'
|
||||
import { useEditorReadOnly } from '@/editor/editingContext'
|
||||
import { loadFailureMessage } from '@/editor/messages'
|
||||
import { useEditorStore } from '@/editor/state/editorStore'
|
||||
import { REFERENCES_BUTTON_ID } from '@/editor/tabs'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import ConfirmDialog from './ConfirmDialog'
|
||||
import DiscardButton from './DiscardButton'
|
||||
import SaveLine from './SaveLine'
|
||||
|
||||
interface Props {
|
||||
@@ -18,50 +15,6 @@ interface Props {
|
||||
onFailure: (message: string | null) => void
|
||||
}
|
||||
|
||||
/** « Abandonner les modifications »: asks first, then the store reloads the server draft. */
|
||||
function DiscardButton({ onFailure }: Pick<Props, 'onFailure'>) {
|
||||
const t = useT()
|
||||
const unsaved = useEditorStore((s) => s.unsaved)
|
||||
const saving = useEditorStore((s) => s.saving)
|
||||
const readOnly = useEditorReadOnly()
|
||||
const [asking, setAsking] = useState(false)
|
||||
useEffect(() => {
|
||||
if (readOnly) setAsking(false)
|
||||
}, [readOnly])
|
||||
const discard = async () => {
|
||||
setAsking(false)
|
||||
const result = await useEditorStore
|
||||
.getState()
|
||||
.discardChanges({ confirmed: true })
|
||||
onFailure(
|
||||
!result.ok && result.reason === 'load'
|
||||
? loadFailureMessage(t, result.failure)
|
||||
: null,
|
||||
)
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
disabled={!unsaved || saving || readOnly}
|
||||
onClick={() => setAsking(true)}
|
||||
>
|
||||
{t('editor.draft.discard')}
|
||||
</Button>
|
||||
<ConfirmDialog
|
||||
open={asking}
|
||||
title={t('editor.draft.discard')}
|
||||
body={t('editor.draft.discard_ask')}
|
||||
confirmLabel={t('editor.draft.discard_confirm')}
|
||||
cancelLabel={t('common.cancel')}
|
||||
onConfirm={() => void discard()}
|
||||
onCancel={() => setAsking(false)}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function SaveButton() {
|
||||
const t = useT()
|
||||
const unsaved = useEditorStore((s) => s.unsaved)
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
import { useRef } from 'react'
|
||||
import { useEditorReadOnly } from '@/editor/editingContext'
|
||||
import { commitFocusedField } from '@/editor/focusRequest'
|
||||
import { canRedo, canUndo, useEditorStore } from '@/editor/state/editorStore'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import EditorGlyph from './EditorGlyph'
|
||||
|
||||
type Direction = 'undo' | 'redo'
|
||||
|
||||
const SHORTCUT: Record<Direction, string> = {
|
||||
undo: 'Control+Z',
|
||||
redo: 'Control+Shift+Z',
|
||||
}
|
||||
|
||||
const BUTTON =
|
||||
'inline-flex min-h-11 min-w-11 items-center justify-center gap-1.5 rounded-md ' +
|
||||
'px-2 text-sm text-[var(--color-ink)] hover:bg-[var(--color-surface-strong)] ' +
|
||||
'aria-disabled:cursor-not-allowed aria-disabled:opacity-40 aria-disabled:hover:bg-transparent ' +
|
||||
'xl:min-h-9 xl:min-w-0 focus-visible:outline-none focus-visible:ring-2 ' +
|
||||
'focus-visible:ring-[var(--color-accent)]'
|
||||
|
||||
/** The text field the press left, kept to learn whether its commit was refused. */
|
||||
function leavingField(): HTMLElement | null {
|
||||
const active = document.activeElement
|
||||
const isField =
|
||||
active instanceof HTMLInputElement ||
|
||||
active instanceof HTMLTextAreaElement ||
|
||||
active instanceof HTMLSelectElement
|
||||
return isField ? active : null
|
||||
}
|
||||
|
||||
/**
|
||||
* The press, in two steps: the pointer-down commits the typed text (the field's blur), the
|
||||
* click then reads the store, so the typed text is the last change the undo reverts. A
|
||||
* field whose commit was refused keeps its error: the step is skipped, focus goes back.
|
||||
*/
|
||||
function usePress(direction: Direction, readOnly: boolean) {
|
||||
const left = useRef<HTMLElement | null>(null)
|
||||
const onPointerDown = () => {
|
||||
left.current = leavingField()
|
||||
commitFocusedField()
|
||||
}
|
||||
const onClick = () => {
|
||||
const field = left.current
|
||||
left.current = null
|
||||
if (field?.getAttribute('aria-invalid') === 'true') {
|
||||
field.focus()
|
||||
return
|
||||
}
|
||||
const store = useEditorStore.getState()
|
||||
const can = direction === 'undo' ? canUndo(store) : canRedo(store)
|
||||
if (readOnly || !can) return
|
||||
if (direction === 'undo') store.undoStep()
|
||||
else store.redoStep()
|
||||
}
|
||||
return { onPointerDown, onClick, onPointerLeave: () => (left.current = null) }
|
||||
}
|
||||
|
||||
function HistoryButton({ direction }: { direction: Direction }) {
|
||||
const t = useT()
|
||||
const readOnly = useEditorReadOnly()
|
||||
const steppable = useEditorStore(direction === 'undo' ? canUndo : canRedo)
|
||||
const name = t(`editor.history.${direction}_title`)
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
aria-label={name}
|
||||
title={name}
|
||||
aria-disabled={readOnly || !steppable}
|
||||
aria-keyshortcuts={SHORTCUT[direction]}
|
||||
{...usePress(direction, readOnly)}
|
||||
className={BUTTON}
|
||||
>
|
||||
<EditorGlyph name={direction} />
|
||||
<span aria-hidden="true" className="hidden sm:inline">
|
||||
{t(`editor.history.${direction}`)}
|
||||
</span>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
/** « Annuler » and « Rétablir », at the right of the tab row on every tab. */
|
||||
export default function HistoryButtons() {
|
||||
return (
|
||||
<div
|
||||
className="ml-auto flex items-center gap-1"
|
||||
data-testid="history-buttons"
|
||||
>
|
||||
<HistoryButton direction="undo" />
|
||||
<HistoryButton direction="redo" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,39 +1,122 @@
|
||||
import { usePlural } from '@/editor/plural'
|
||||
import { formatParisTime } from '@/editor/format'
|
||||
import {
|
||||
saveLineState,
|
||||
useSavedDistance,
|
||||
type SaveLineState,
|
||||
} from '@/editor/saveLine'
|
||||
import { useEditorStore } from '@/editor/state/editorStore'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import { useLocaleStore } from '@/state/localeStore'
|
||||
|
||||
type Translate = ReturnType<typeof useT>
|
||||
|
||||
interface Status {
|
||||
copyIssue: 'cap' | 'quota' | null
|
||||
saving: boolean
|
||||
unsaved: boolean
|
||||
revision: number
|
||||
/** Widest figures the line can show: a three-digit revision, 00:00, 999 changes. */
|
||||
const WIDEST_REVISION = 999
|
||||
const WIDEST_TIME = '00:00'
|
||||
|
||||
function revisionText(t: Translate, key: string, revision: number): string {
|
||||
return t(key).replace('{revision}', String(revision))
|
||||
}
|
||||
|
||||
/** Board 04's line; only the copy failures replace it (the copy is temporary, this tab's). */
|
||||
function statusText(t: Translate, status: Status): string {
|
||||
if (status.copyIssue !== null)
|
||||
return t(`editor.draft.status.copy_${status.copyIssue}`)
|
||||
if (status.saving) return t('editor.draft.status.saving')
|
||||
const revision = t('editor.draft.status.revision').replace(
|
||||
'{revision}',
|
||||
String(status.revision),
|
||||
)
|
||||
return status.unsaved
|
||||
? `${revision} · ${t('editor.draft.status.unsaved')}`
|
||||
: revision
|
||||
/** The line for a state; `withTime` false gives the form the status region announces. */
|
||||
function lineText(
|
||||
t: Translate,
|
||||
plural: ReturnType<typeof usePlural>,
|
||||
state: SaveLineState,
|
||||
time: string | null,
|
||||
): string {
|
||||
switch (state.kind) {
|
||||
case 'copy_issue':
|
||||
return t(`editor.draft.status.copy_${state.issue}`)
|
||||
case 'saving':
|
||||
return t('editor.draft.status.saving')
|
||||
case 'unsaved':
|
||||
return state.count === null
|
||||
? t('editor.draft.status.unsaved')
|
||||
: plural('editor.draft.status.unsaved_count', state.count)
|
||||
case 'saved':
|
||||
return time === null
|
||||
? revisionText(t, 'editor.draft.status.saved', state.revision)
|
||||
: revisionText(
|
||||
t,
|
||||
'editor.draft.status.saved_at',
|
||||
state.revision,
|
||||
).replace('{time}', time)
|
||||
case 'revision':
|
||||
return revisionText(t, 'editor.draft.status.revision', state.revision)
|
||||
}
|
||||
}
|
||||
|
||||
/** The revision line with its unsaved state, announced politely when it changes. */
|
||||
/** What the status region announces: the state, never each change of the count. */
|
||||
function announcement(t: Translate, state: SaveLineState): string {
|
||||
switch (state.kind) {
|
||||
case 'unsaved':
|
||||
return t('editor.draft.status.unsaved')
|
||||
case 'revision':
|
||||
return ''
|
||||
case 'saved':
|
||||
return revisionText(t, 'editor.draft.status.saved', state.revision)
|
||||
default:
|
||||
return lineText(t, () => '', state, null)
|
||||
}
|
||||
}
|
||||
|
||||
function useSaveLineState(): SaveLineState {
|
||||
const distance = useSavedDistance()
|
||||
const copyIssue = useEditorStore((s) => s.copyIssue)
|
||||
const saving = useEditorStore((s) => s.saving)
|
||||
const unsaved = useEditorStore((s) => s.unsaved)
|
||||
const lastSave = useEditorStore((s) => s.lastSave)
|
||||
const savedRevision = useEditorStore((s) => s.savedRevision)
|
||||
return saveLineState({
|
||||
copyIssue,
|
||||
saving,
|
||||
unsaved,
|
||||
distance,
|
||||
lastSave,
|
||||
savedRevision,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* The save line (board 04). The visible line is a plain paragraph; a hidden status region
|
||||
* announces the state changes. The longest forms are laid out invisibly in the same cell,
|
||||
* so the line keeps its width when the text changes (tabular figures).
|
||||
*/
|
||||
export default function SaveLine() {
|
||||
const t = useT()
|
||||
const unsaved = useEditorStore((s) => s.unsaved)
|
||||
const saving = useEditorStore((s) => s.saving)
|
||||
const revision = useEditorStore((s) => s.savedRevision)
|
||||
const copyIssue = useEditorStore((s) => s.copyIssue)
|
||||
const plural = usePlural()
|
||||
const locale = useLocaleStore((s) => s.locale)
|
||||
const state = useSaveLineState()
|
||||
const savedAt = state.kind === 'saved' ? state.savedAt : null
|
||||
const time = savedAt === null ? null : formatParisTime(savedAt, locale)
|
||||
const widest = [
|
||||
revisionText(t, 'editor.draft.status.saved_at', WIDEST_REVISION).replace(
|
||||
'{time}',
|
||||
WIDEST_TIME,
|
||||
),
|
||||
plural('editor.draft.status.unsaved_count', 999),
|
||||
]
|
||||
return (
|
||||
<p role="status" className="text-sm text-[var(--color-ink-muted)]">
|
||||
{statusText(t, { copyIssue, saving, unsaved, revision })}
|
||||
</p>
|
||||
<>
|
||||
<p className="grid text-sm tabular-nums text-[var(--color-ink-muted)]">
|
||||
<span data-testid="save-line" className="col-start-1 row-start-1">
|
||||
{lineText(t, plural, state, time)}
|
||||
</span>
|
||||
{widest.map((text) => (
|
||||
<span
|
||||
key={text}
|
||||
aria-hidden="true"
|
||||
className="invisible col-start-1 row-start-1 h-0 overflow-hidden whitespace-nowrap"
|
||||
>
|
||||
{text}
|
||||
</span>
|
||||
))}
|
||||
</p>
|
||||
<p role="status" data-testid="save-status" className="sr-only">
|
||||
{announcement(t, state)}
|
||||
</p>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import { canRedo, canUndo, useEditorStore } from '@/editor/state/editorStore'
|
||||
import type { ToolId } from '@/editor/annotations/uiState'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import EditorGlyph, { type GlyphName } from '../EditorGlyph'
|
||||
|
||||
export interface ToolColumnProps {
|
||||
tool: ToolId
|
||||
@@ -21,18 +21,6 @@ const BUTTON =
|
||||
'focus-visible:outline-none focus-visible:ring-2 ' +
|
||||
'focus-visible:ring-[var(--color-accent)]'
|
||||
|
||||
const GLYPHS: Record<string, string> = {
|
||||
select: 'M5 3l12 7-5 1-3 5z',
|
||||
point: 'M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 3v3M12 18v3M3 12h3M18 12h3',
|
||||
zone: 'M12 3l8 6-3 10H7L4 9z',
|
||||
link: 'M4 4h8v8H4zM12 12h8v8h-8z',
|
||||
in: 'M11 5v12M5 11h12M20 20l-4-4',
|
||||
out: 'M5 11h12M20 20l-4-4',
|
||||
fit: 'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5',
|
||||
undo: 'M9 7L4 12l5 5M4 12h11a5 5 0 0 1 0 10',
|
||||
redo: 'M15 7l5 5-5 5M20 12H9a5 5 0 0 0 0 10',
|
||||
}
|
||||
|
||||
function ToolButton({
|
||||
glyph,
|
||||
label,
|
||||
@@ -40,7 +28,7 @@ function ToolButton({
|
||||
disabled,
|
||||
onClick,
|
||||
}: {
|
||||
glyph: string
|
||||
glyph: GlyphName
|
||||
label: string
|
||||
pressed?: boolean
|
||||
disabled?: boolean
|
||||
@@ -60,28 +48,14 @@ function ToolButton({
|
||||
: 'bg-[var(--color-surface)] text-[var(--color-ink)]'
|
||||
}`}
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
width="20"
|
||||
height="20"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="1.8"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path d={GLYPHS[glyph]} />
|
||||
</svg>
|
||||
<EditorGlyph name={glyph} />
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
/** Board 04's tool column: tools, zoom, then undo and redo (icon buttons). */
|
||||
/** Board 04's tool column: tools and zoom (the history sits in the header). */
|
||||
export default function ToolColumn(props: ToolColumnProps) {
|
||||
const t = useT()
|
||||
const undoable = useEditorStore(canUndo)
|
||||
const redoable = useEditorStore(canRedo)
|
||||
const tool = (id: ToolId, disabled: boolean) => (
|
||||
<ToolButton
|
||||
glyph={id}
|
||||
@@ -118,19 +92,6 @@ export default function ToolColumn(props: ToolColumnProps) {
|
||||
label={t('catalogue.zoom.fit')}
|
||||
onClick={props.onFit}
|
||||
/>
|
||||
<hr className="hidden border-[var(--color-border)] lg:block" />
|
||||
<ToolButton
|
||||
glyph="undo"
|
||||
label={t('editor.annotations.undo')}
|
||||
disabled={!undoable}
|
||||
onClick={() => useEditorStore.getState().undoStep()}
|
||||
/>
|
||||
<ToolButton
|
||||
glyph="redo"
|
||||
label={t('editor.annotations.redo')}
|
||||
disabled={!redoable}
|
||||
onClick={() => useEditorStore.getState().redoStep()}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user