@contrail/documents 1.15.0-alpha.88778e9 → 1.15.0-alpha.ba306dc
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 +1 -1
- package/lib/element-order.d.ts +3 -6
- package/lib/types/document.d.ts +2 -2
- package/lib/types/document.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,7 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
12
|
- `sortElementsByArrayOrder(elements, sortOrder)` and `assignSortIndexes(orderedElements)` — the two ordering transforms that convert, restore and the document read path had each grown their own copy of. `sortElementsByArrayOrder` puts elements missing from the array last, keeping their relative order.
|
|
13
|
-
- `SORT_MODE` — the named constants for `DocumentSortMode
|
|
13
|
+
- `SORT_MODE` — the named constants for `DocumentSortMode`, alongside the existing `DOCUMENT_SORT_MODES` tuple.
|
|
14
14
|
|
|
15
15
|
## [1.14.0] - 2026-07-29
|
|
16
16
|
|
package/lib/element-order.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare function sortElementsByArrayOrder<T extends OrderableElement>(elements: T[], sortOrder?: string[]): T[];
|
|
6
|
-
export declare function assignSortIndexes<T extends OrderableElement>(orderedElements: T[]): T[];
|
|
1
|
+
import { DocumentElement } from './types';
|
|
2
|
+
export declare function sortElementsByArrayOrder<T extends DocumentElement>(elements: T[], sortOrder?: string[]): T[];
|
|
3
|
+
export declare function assignSortIndexes<T extends DocumentElement>(orderedElements: T[]): T[];
|
package/lib/types/document.d.ts
CHANGED
|
@@ -5,13 +5,13 @@ export interface ImportReferenceDetail {
|
|
|
5
5
|
importedFileReference?: string;
|
|
6
6
|
}
|
|
7
7
|
export type DocumentWriteMode = 'transactional' | 'legacy';
|
|
8
|
+
export declare const DOCUMENT_SORT_MODES: readonly ["array", "elementIndexing", "migrating"];
|
|
9
|
+
export type DocumentSortMode = (typeof DOCUMENT_SORT_MODES)[number];
|
|
8
10
|
export declare const SORT_MODE: {
|
|
9
11
|
readonly ARRAY: "array";
|
|
10
12
|
readonly ELEMENT_INDEXING: "elementIndexing";
|
|
11
13
|
readonly MIGRATING: "migrating";
|
|
12
14
|
};
|
|
13
|
-
export type DocumentSortMode = (typeof SORT_MODE)[keyof typeof SORT_MODE];
|
|
14
|
-
export declare const DOCUMENT_SORT_MODES: readonly DocumentSortMode[];
|
|
15
15
|
export interface Document {
|
|
16
16
|
id?: string;
|
|
17
17
|
name?: string;
|
package/lib/types/document.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SORT_MODE = exports.DOCUMENT_SORT_MODES = void 0;
|
|
4
|
+
exports.DOCUMENT_SORT_MODES = ['array', 'elementIndexing', 'migrating'];
|
|
4
5
|
exports.SORT_MODE = {
|
|
5
6
|
ARRAY: 'array',
|
|
6
7
|
ELEMENT_INDEXING: 'elementIndexing',
|
|
7
8
|
MIGRATING: 'migrating',
|
|
8
9
|
};
|
|
9
|
-
exports.DOCUMENT_SORT_MODES = Object.values(exports.SORT_MODE);
|