From 5d5f951cb71fad42211b31a8145ef4aabd29e184 Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Wed, 5 Jul 2023 21:00:56 +0900 Subject: [PATCH] Update CHANGELOG.md for v0.4.4 (#563) * Update CHANGELOG.md for v0.4.4 * Add missing comments to exposed interfaces --- CHANGELOG.md | 6 +++++ package.json | 2 +- package.publish.json | 2 +- src/document/json/tree.ts | 5 ++-- src/document/operation/operation.ts | 40 +++++++++++++++++++++++++++++ src/yorkie.ts | 5 +++- 6 files changed, 55 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a81a0ab46..0e4587382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and Yorkie JS SDK adheres to [Semantic Versioning](https://semver.org/spec/v2.0. ## [Unreleased] +## [0.4.4] - 2023-07-05 + +### Changed +* Cleanup of test-related terminology by @chacha912 in https://github.com/yorkie-team/yorkie-js-sdk/pull/562 +* Use TreeRangeStruct to represent tree selection by @chacha912 in https://github.com/yorkie-team/yorkie-js-sdk/pull/561 + ## [0.4.3] - 2023-06-29 ### Added diff --git a/package.json b/package.json index d2497a8de..64d1331bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yorkie-js-sdk", - "version": "0.4.3", + "version": "0.4.4", "description": "Yorkie JS SDK", "main": "./dist/yorkie-js-sdk.js", "typings": "./dist/yorkie-js-sdk.d.ts", diff --git a/package.publish.json b/package.publish.json index ffcaad012..62642c18c 100644 --- a/package.publish.json +++ b/package.publish.json @@ -1,6 +1,6 @@ { "name": "yorkie-js-sdk", - "version": "0.4.3", + "version": "0.4.4", "description": "Yorkie JS SDK", "main": "./dist/yorkie-js-sdk.js", "typings": "./dist/yorkie-js-sdk.d.ts", diff --git a/src/document/json/tree.ts b/src/document/json/tree.ts index e7fd9d510..d0e74944c 100644 --- a/src/document/json/tree.ts +++ b/src/document/json/tree.ts @@ -163,7 +163,8 @@ export class Tree { } /** - * `getInitialRoot` returns the root node of this tree. + * `buildRoot` builds the root of this tree with the given initial root + * which set by the user. */ public buildRoot(context: ChangeContext): CRDTTreeNode { if (!this.initialRoot) { @@ -438,7 +439,7 @@ export class Tree { } /** - * `createRange` returns pair of CRDTTreePos of the given integer offsets. + * `createRangeByPath` returns pair of CRDTTreePos of the given path. */ createRangeByPath(fromPath: Array, toPath: Array): TreeRange { if (!this.context || !this.tree) { diff --git a/src/document/operation/operation.ts b/src/document/operation/operation.ts index 23630aed9..9b56ce53f 100644 --- a/src/document/operation/operation.ts +++ b/src/document/operation/operation.ts @@ -36,33 +36,57 @@ export type CounterOperationInfo = IncreaseOpInfo; export type ArrayOperationInfo = AddOpInfo | RemoveOpInfo | MoveOpInfo; export type ObjectOperationInfo = SetOpInfo | RemoveOpInfo; export type TreeOperationInfo = TreeEditOpInfo | TreeStyleOpInfo; + +/** + * `AddOpInfo` represents the information of the add operation. + */ export type AddOpInfo = { type: 'add'; path: string; index: number; }; + +/** + * `MoveOpInfo` represents the information of the move operation. + */ export type MoveOpInfo = { type: 'move'; path: string; previousIndex: number; index: number; }; + +/** + * `SetOpInfo` represents the information of the set operation. + */ export type SetOpInfo = { type: 'set'; path: string; key: string; }; + +/** + * `RemoveOpInfo` represents the information of the remove operation. + */ export type RemoveOpInfo = { type: 'remove'; path: string; key?: string; index?: number; }; + +/** + * `IncreaseOpInfo` represents the information of the increase operation. + */ export type IncreaseOpInfo = { type: 'increase'; path: string; value: number; }; + +/** + * `EditOpInfo` represents the information of the edit operation. + */ export type EditOpInfo = { type: 'edit'; from: number; @@ -73,6 +97,10 @@ export type EditOpInfo = { content: string; }; }; + +/** + * `StyleOpInfo` represents the information of the style operation. + */ export type StyleOpInfo = { type: 'style'; from: number; @@ -82,12 +110,20 @@ export type StyleOpInfo = { attributes: Indexable; }; }; + +/** + * `SelectOpInfo` represents the information of the select operation. + */ export type SelectOpInfo = { type: 'select'; from: number; to: number; path: string; }; + +/** + * `TreeEditOpInfo` represents the information of the tree edit operation. + */ export type TreeEditOpInfo = { type: 'tree-edit'; from: number; @@ -97,6 +133,10 @@ export type TreeEditOpInfo = { value: TreeNode; path: string; }; + +/** + * `TreeStyleOpInfo` represents the information of the tree style operation. + */ export type TreeStyleOpInfo = { type: 'tree-style'; from: number; diff --git a/src/yorkie.ts b/src/yorkie.ts index 10dbc344f..f20aca9f5 100644 --- a/src/yorkie.ts +++ b/src/yorkie.ts @@ -55,7 +55,10 @@ export { CompleteFn, Unsubscribe, } from '@yorkie-js-sdk/src/util/observable'; -export { TimeTicket, TimeTicketStruct } from '@yorkie-js-sdk/src/document/time/ticket'; +export { + TimeTicket, + TimeTicketStruct, +} from '@yorkie-js-sdk/src/document/time/ticket'; export { ActorID } from '@yorkie-js-sdk/src/document/time/actor_id'; export type { OperationInfo,