@grundyjs/algiviz 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -2
- package/dist/array/trace.d.ts +3 -2
- package/dist/array/trace.js +4 -1
- package/package.json +1 -1
- package/ru/README.md +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.1 — 2026-11-05
|
|
4
|
+
|
|
5
|
+
- Validate both numeric positions in array swap/shift before reading or mutating
|
|
6
|
+
the trace, rejecting invalid JavaScript arguments without losing item identities
|
|
7
|
+
or changing snapshots, counters, markers or the next step index.
|
|
8
|
+
- Allow explicitly undefined sorted-region inputs with exactOptionalPropertyTypes,
|
|
9
|
+
matching the existing runtime behavior of preserving the current marker.
|
|
10
|
+
- Document array guarantees in English and Russian: fixed length, one held item,
|
|
11
|
+
trace-local IDs, immutable snapshots, counters and author-supplied sorted markers.
|
|
12
|
+
- Add an application-owned object lifecycle example and expand playback completion,
|
|
13
|
+
strict type and installed-package consumer checks. No new public exports.
|
|
14
|
+
|
|
3
15
|
## 0.11.0 — 2026-11-02
|
|
4
16
|
|
|
5
17
|
- Add createStatePlayer() for lazy playback of plain immutable states without
|
package/README.md
CHANGED
|
@@ -102,8 +102,8 @@ the [local setup instructions](https://github.com/urffin/algiviz/blob/master/doc
|
|
|
102
102
|
- **Scene:** describes objects with stable IDs, types and application-owned data.
|
|
103
103
|
- **Handler:** chooses geometry and drawing behavior, including interpolation.
|
|
104
104
|
|
|
105
|
-
Do not mutate emitted states.
|
|
106
|
-
|
|
105
|
+
Do not mutate emitted states. `createStatePlayer` completes on source exhaustion;
|
|
106
|
+
`createPlayer` requires an explicit terminal step. Call `dispose()` when removing a visualization. Algorithms, layouts and animation
|
|
107
107
|
scheduling belong to the application.
|
|
108
108
|
|
|
109
109
|
## Playback modes
|
package/dist/array/trace.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Item, ArrayStep } from "./types.js";
|
|
2
|
+
/** Omitted or undefined markers preserve their current values. */
|
|
2
3
|
export interface SortedRegions {
|
|
3
|
-
readonly sortedPrefixLength?: number;
|
|
4
|
-
readonly sortedSuffixLength?: number;
|
|
4
|
+
readonly sortedPrefixLength?: number | undefined;
|
|
5
|
+
readonly sortedSuffixLength?: number | undefined;
|
|
5
6
|
}
|
|
6
7
|
export interface ArrayTrace {
|
|
7
8
|
readonly length: number;
|
package/dist/array/trace.js
CHANGED
|
@@ -54,6 +54,8 @@ export function createArrayTrace(values) {
|
|
|
54
54
|
},
|
|
55
55
|
swap(left, right, update) {
|
|
56
56
|
active();
|
|
57
|
+
index(left);
|
|
58
|
+
index(right);
|
|
57
59
|
const a = item(left), b = item(right);
|
|
58
60
|
if (left === right)
|
|
59
61
|
throw new RangeError("Swap requires distinct positions");
|
|
@@ -74,8 +76,9 @@ export function createArrayTrace(values) {
|
|
|
74
76
|
},
|
|
75
77
|
shift(from, to, update) {
|
|
76
78
|
active();
|
|
77
|
-
|
|
79
|
+
index(from);
|
|
78
80
|
index(to);
|
|
81
|
+
const moved = item(from);
|
|
79
82
|
if (slots[to] !== null)
|
|
80
83
|
throw new Error("Shift destination must be empty");
|
|
81
84
|
regions(update);
|
package/package.json
CHANGED
package/ru/README.md
CHANGED
|
@@ -100,7 +100,8 @@ document.querySelector('#next').onclick = () => player.nextStep();
|
|
|
100
100
|
- **Сцена** описывает объекты: стабильный `id`, тип и собственные данные.
|
|
101
101
|
- **Обработчик** выбирает геометрию и способ рисования. Плавность — его решение.
|
|
102
102
|
|
|
103
|
-
Состояния после выдачи нельзя изменять.
|
|
103
|
+
Состояния после выдачи нельзя изменять. `createStatePlayer` завершается при исчерпании
|
|
104
|
+
источника; `createPlayer` требует явного завершающего шага;
|
|
104
105
|
при удалении визуализации вызовите `dispose()`. Алгоритмы, раскладка и цикл
|
|
105
106
|
анимации принадлежат приложению.
|
|
106
107
|
|