Skip to content

Commit f4b697b

Browse files
committed
fix(history): renaming histories not to contain "undo"
1 parent 7bb04f0 commit f4b697b

56 files changed

Lines changed: 252 additions & 252 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
* change(api): encapsulating the bindings routines into a class
304304
* change(api): moving the undo/redo history into the bindings class. So removing the Single instance.
305305
* change(api): moving implementation classes into the impl folder
306-
* change(api): separating API / implementation of the UndoHistory
306+
* change(api): separating API / implementation of the LinearHistory
307307
* change(api): the error class must be located in the impl folder
308308
* change(api): the useless command registry and the registration policy removed
309309
* change(api): major refactoring of interaction data to match the Web API

src/api/binding/Bindings.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import type {GeneralTwoTouchData, TwoTouchData} from "../interaction/TwoTouchDat
4343
import type {WheelData} from "../interaction/WheelData";
4444
import type {WidgetData} from "../interaction/WidgetData";
4545
import type {Logger} from "../logging/Logger";
46-
import type {UndoHistoryBase} from "../undo/UndoHistoryBase";
46+
import type {LinearHistoryBase} from "../history/LinearHistoryBase";
4747

4848
/**
4949
* Defines a partly defined binder for buttons
@@ -195,15 +195,15 @@ export type PartialThenBinder<XS extends Array<Interaction<object>>, A = unknown
195195
/**
196196
* A contextual object for creating binders and thus bindings.
197197
* allows the observation of the created bindings.
198-
* Provides an undo/redo history.
198+
* Provides an history/redo history.
199199
* Why a pure abstract class and not an interface?
200-
* Because interfaces are not retained at runtime in TS and we want DI (that thus cannot inject interface types).
201-
* @template H -- The undo history algorithm
200+
* Because interfaces are not retained at run time in TS, and we want DI (that thus cannot inject interface types).
201+
* @template H -- The linear history
202202
* @category API Binding
203203
*/
204-
export abstract class Bindings<H extends UndoHistoryBase> {
204+
export abstract class Bindings<H extends LinearHistoryBase> {
205205
/**
206-
* The undo/redo history of the current binding context
206+
* The history/redo history of the current binding context
207207
*/
208208
public abstract readonly undoHistory: H;
209209

@@ -572,10 +572,10 @@ export abstract class Bindings<H extends UndoHistoryBase> {
572572
accInit?: A): PartialTouchMouseDnDTypedBinder<A>;
573573

574574
/**
575-
* Creates two bindings for undo and redo operations with buttons.
576-
* @param undo - The undo button
575+
* Creates two bindings for history and redo operations with buttons.
576+
* @param undo - The history button
577577
* @param redo - The redo button
578-
* @param catchFn - The function that will treat the errors for both undo and redo bindings
578+
* @param catchFn - The function that will treat the errors for both history and redo bindings
579579
*/
580580
public abstract undoRedoBinder(undo: Widget<HTMLButtonElement>, redo: Widget<HTMLButtonElement>, catchFn?: ((err: unknown) => void)):
581581
[Binding<Command, Interaction<WidgetData<HTMLButtonElement>>, unknown>,
@@ -591,7 +591,7 @@ export abstract class Bindings<H extends UndoHistoryBase> {
591591
/**
592592
* Clears all the data of this binding context:
593593
* the possible current `BindingsObserver` object;
594-
* the undo/redo history.
594+
* the history/redo history.
595595
*/
596596
public abstract clear(): void;
597597

src/api/binding/VisitorBinding.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {Bindings} from "./Bindings";
1717
import type {Command} from "../command/Command";
1818
import type {Interaction} from "../interaction/Interaction";
1919
import type {VisitorInteraction} from "../interaction/VisitorInteraction";
20-
import type {UndoHistoryBase} from "../undo/UndoHistoryBase";
20+
import type {LinearHistoryBase} from "../history/LinearHistoryBase";
2121

2222
/**
2323
* The main interface for visiting user interactions.
@@ -26,5 +26,5 @@ import type {UndoHistoryBase} from "../undo/UndoHistoryBase";
2626
export interface VisitorBinding extends VisitorInteraction {
2727
visitBinding(binding: Binding<Command, Interaction<object>, unknown>): void;
2828

29-
visitBindings(bindings: Bindings<UndoHistoryBase>): void;
29+
visitBindings(bindings: Bindings<LinearHistoryBase>): void;
3030
}

src/api/command/Command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export type CmdStatus =
3232
* A command is produced and executed in reaction of a user interaction.
3333
* It follows the command design pattern.
3434
* It contains statements to execute to perform the command.
35-
* The interface Undoable can be used to add undo/redo features to a command.
35+
* The interface Undoable can be used to add history/redo features to a command.
3636
* @category API Command
3737
*/
3838
export interface Command {

src/api/command/ModifiableCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* You should have received a copy of the GNU General Public License
1212
* along with Interacto. If not, see <https://www.gnu.org/licenses/>.
1313
*/
14-
import {isUndoableType} from "../undo/Undoable";
14+
import {isUndoableType} from "../history/Undoable";
1515
import type {Command} from "./Command";
16-
import type {Undoable} from "../undo/Undoable";
16+
import type {Undoable} from "../history/Undoable";
1717

1818
const INTERACTO_MODIFIABLE: unique symbol = Symbol("interacto-cmd-modifiable");
1919

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
*/
1414

1515
import type {Undoable} from "./Undoable";
16-
import type {UndoHistoryBase} from "./UndoHistoryBase";
16+
import type {LinearHistoryBase} from "./LinearHistoryBase";
1717
import type {Observable} from "rxjs";
1818

1919
/**
20-
* A history of undone/redone objects.
20+
* A linear command history.
2121
* Why a pure abstract class and not an interface?
2222
* Because interfaces are not retained at runtime in TS and we want DI (that thus cannot inject interface types).
2323
* @category API History
2424
*/
25-
export abstract class UndoHistory implements UndoHistoryBase {
25+
export abstract class LinearHistory implements LinearHistoryBase {
2626
public abstract add(undoable: Undoable): void;
2727

2828
public abstract clear(): void;
@@ -73,7 +73,7 @@ export abstract class UndoHistory implements UndoHistoryBase {
7373

7474
/**
7575
* The number of elements the history contains.
76-
* Provide both the size of the undo and the redo stacks in the produced tuple.
76+
* Provide both the size of the history and the redo stacks in the produced tuple.
7777
*/
7878
public abstract size(): [undos: number, redos: number];
7979

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import type {Undoable} from "./Undoable";
1616
import type {Observable} from "rxjs";
1717

1818
/**
19-
* The base interface for undo histories.
19+
* The base interface for linear histories.
2020
* @category API History
2121
*/
22-
export interface UndoHistoryBase {
22+
export interface LinearHistoryBase {
2323
/**
2424
* Undoes the last undoable object.
2525
*/
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
*/
1414

1515
import type {Undoable, UndoableSnapshot} from "./Undoable";
16-
import type {UndoHistoryBase} from "./UndoHistoryBase";
16+
import type {LinearHistoryBase} from "./LinearHistoryBase";
1717
import type {Observable} from "rxjs";
1818

1919
/**
20-
* The interface for nodes in a tree-based history.
20+
* The type that defines the concept of a node stored in a tree-based history.
2121
* @category API History
2222
*/
2323
export interface UndoableTreeNode {
2424
/**
25-
* Among the children of the node, iidentifies the one that was undone recently.
25+
* Among the children of the node, identifies the one that was undone recently.
2626
*/
2727
lastChildUndone: UndoableTreeNode | undefined;
2828

@@ -73,7 +73,7 @@ export interface UndoableTreeNodeDTO {
7373
readonly id: number;
7474

7575
/**
76-
* The undoable object contained in the node, in an unkown format as
76+
* The undoable object contained in the node, in an unknown format as
7777
* the format is defined by the developer while exporting the history.
7878
*/
7979
readonly undoable: unknown;
@@ -101,13 +101,13 @@ export interface TreeUndoHistoryDTO {
101101
}
102102

103103
/**
104-
* Tree-based undo history.
105-
* On adding undoables after an undo operation, the redoable objects are no more flush but
106-
* kept in the history as a granch of the graph.
104+
* The type that defines the concept of a tree-based history.
105+
* On adding undoable objects after a history operation, the redoable objects are no more flush but
106+
* kept in the history as a branch of the graph.
107107
* Useful for exploration.
108108
* @category API History
109109
*/
110-
export abstract class TreeUndoHistory implements UndoHistoryBase {
110+
export abstract class TreeHistory implements LinearHistoryBase {
111111
/**
112112
* States whether the path of kept. If kept, users cannot delete
113113
* nodes.
@@ -134,7 +134,7 @@ export abstract class TreeUndoHistory implements UndoHistoryBase {
134134

135135
/**
136136
* The current node. As the history is a tree in which one can navigate using
137-
* undo, redo, gotTo, this current node refers to the node
137+
* history, redo, gotTo, this current node refers to the node
138138
* where the system state is.
139139
*/
140140
public abstract get currentNode(): UndoableTreeNode;
@@ -212,7 +212,7 @@ export abstract class TreeUndoHistory implements UndoHistoryBase {
212212
/**
213213
* Imports the given DTO history. Flushes the current history.
214214
* @param dtoHistory - The DTO history to import.
215-
* @param fn - The convertion fonction that transforms undoable DTO (of nodes) into Undoable.
215+
* @param fn - The transformation function that transforms undoable DTO (of nodes) into Undoable.
216216
*/
217217
public abstract import(dtoHistory: TreeUndoHistoryDTO, fn: (dtoUndoable: unknown) => Undoable): void;
218218

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
export type PrimitiveUndoableSnapshot = HTMLElement | SVGElement | string;
2020

2121
/**
22-
* The type of the visual snpashot that an undoable command can produce
22+
* The type of the visual snapshot that an undoable command can produce
2323
* @category API History
2424
*/
2525
export type UndoableSnapshot = PrimitiveUndoableSnapshot | Promise<PrimitiveUndoableSnapshot> | undefined;
@@ -40,13 +40,13 @@ export interface Undoable {
4040
redo(): void;
4141

4242
/**
43-
* @returns The name of the undo command.
43+
* @returns The name of the history command.
4444
*/
4545
getUndoName(): string;
4646

4747
/**
4848
* Gives some information about the impact of a command.
49-
* @returns Information about the impact of the commmand as an SVG element or text.
49+
* @returns Information about the impact of the command as an SVG element or text.
5050
*/
5151
getVisualSnapshot(): UndoableSnapshot;
5252

src/impl/binder/Binder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import type {Command} from "../../api/command/Command";
2626
import type {Interaction, InteractionDataType} from "../../api/interaction/Interaction";
2727
import type {Logger} from "../../api/logging/Logger";
2828
import type {LogLevel} from "../../api/logging/LogLevel";
29-
import type {UndoHistoryBase} from "../../api/undo/UndoHistoryBase";
29+
import type {LinearHistoryBase} from "../../api/history/LinearHistoryBase";
3030

3131
/**
3232
* The base class that defines the concept of binding builder (called binder).
@@ -67,7 +67,7 @@ implements CmdBinder<C>, InteractionBinder<I, A, D>, InteractionCmdBinder<C, I,
6767

6868
protected observer: BindingsObserver | undefined;
6969

70-
protected undoHistory: UndoHistoryBase;
70+
protected undoHistory: LinearHistoryBase;
7171

7272
protected logger: Logger;
7373

@@ -89,7 +89,7 @@ implements CmdBinder<C>, InteractionBinder<I, A, D>, InteractionCmdBinder<C, I,
8989

9090
protected linterRules: Map<RuleName, Severity>;
9191

92-
protected constructor(undoHistory: UndoHistoryBase, logger: Logger, observer?: BindingsObserver,
92+
protected constructor(undoHistory: LinearHistoryBase, logger: Logger, observer?: BindingsObserver,
9393
binder?: Partial<Binder<C, I, A, D>>, acc?: A) {
9494
this.widgets = [];
9595
this.dynamicNodes = [];

0 commit comments

Comments
 (0)