@contrail/documents 1.12.0-alpha.1e36a0e → 1.12.0-alpha.aad6f60

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 CHANGED
@@ -9,7 +9,7 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
9
 
10
10
  ### Added
11
11
 
12
- - Reliable sort-order surface (PLAT-1270): `Document.sortMode` (`'array' | 'elementIndexing'`, `undefined` = `array`) and transient `Document.isSortMigrating` freeze flag; `DocumentElement.sortIndex` (fractional-indexing key).
12
+ - Reliable sort-order surface (PLAT-1270): `Document.sortMode` (`'array' | 'elementIndexing' | 'migrating'`, `undefined` = `array`; `'migrating'` is the transient mid-convert state where ordering edits are rejected); `DocumentElement.sortIndex` (fractional-indexing key).
13
13
  - Sort utilities: `buildKeyBetween` / `buildNKeysBetween` (generate index key(s) between two neighbours), `compareSortIndex` (`(sortIndex, id)` comparator), and `allElementsHaveSortIndex`.
14
14
  - `SortOrderErrorCode` / `SortOrderErrorMessage` — structured code for the mid-convert freeze (`SORT_MIGRATION_IN_PROGRESS`).
15
15
 
package/lib/sort-index.js CHANGED
@@ -6,7 +6,7 @@ exports.buildNKeysBetween = buildNKeysBetween;
6
6
  exports.compareSortIndex = compareSortIndex;
7
7
  const fractional_indexing_1 = require("fractional-indexing");
8
8
  function allElementsHaveSortIndex(elements) {
9
- return elements.every(element => typeof element.sortIndex === 'string' &&
9
+ return elements.every((element) => typeof element.sortIndex === 'string' &&
10
10
  element.sortIndex.length > 0);
11
11
  }
12
12
  function buildKeyBetween(a, b) {
@@ -5,7 +5,7 @@ export interface ImportReferenceDetail {
5
5
  importedFileReference?: string;
6
6
  }
7
7
  export type DocumentWriteMode = 'transactional' | 'legacy';
8
- export type DocumentSortMode = 'array' | 'elementIndexing';
8
+ export type DocumentSortMode = 'array' | 'elementIndexing' | 'migrating';
9
9
  export interface Document {
10
10
  id?: string;
11
11
  name?: string;
@@ -27,5 +27,4 @@ export interface Document {
27
27
  writeMode?: DocumentWriteMode;
28
28
  lastSequenceNumber?: number;
29
29
  sortMode?: DocumentSortMode;
30
- isSortMigrating?: boolean;
31
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/documents",
3
- "version": "1.12.0-alpha.1e36a0e",
3
+ "version": "1.12.0-alpha.aad6f60",
4
4
  "description": "Documents library for contrail platform",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",