loro-crdt 1.2.6 → 1.2.7
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 +6 -0
- package/base64/index.js +1 -26
- package/base64/loro_wasm.d.ts +31 -39
- package/base64/loro_wasm_bg-68a6c103.js +64 -0
- package/bundler/loro_wasm.d.ts +31 -39
- package/bundler/loro_wasm_bg.js +0 -25
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm.d.ts +31 -39
- package/nodejs/loro_wasm.js +0 -25
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +31 -39
- package/web/loro_wasm.js +0 -25
- package/web/loro_wasm_bg.wasm +0 -0
- package/base64/loro_wasm_bg-982aff63.js +0 -64
package/CHANGELOG.md
CHANGED
package/base64/index.js
CHANGED
|
@@ -5176,26 +5176,6 @@ class LoroTreeNode {
|
|
|
5176
5176
|
}
|
|
5177
5177
|
}
|
|
5178
5178
|
/**
|
|
5179
|
-
* Move this tree node to be a child of the parent.
|
|
5180
|
-
* If the parent is undefined, this node will be a root node.
|
|
5181
|
-
*
|
|
5182
|
-
* If the index is not provided, the node will be appended to the end.
|
|
5183
|
-
*
|
|
5184
|
-
* It's not allowed that the target is an ancestor of the parent.
|
|
5185
|
-
*
|
|
5186
|
-
* @example
|
|
5187
|
-
* ```ts
|
|
5188
|
-
* const doc = new LoroDoc();
|
|
5189
|
-
* const tree = doc.getTree("tree");
|
|
5190
|
-
* const root = tree.createNode();
|
|
5191
|
-
* const node = root.createNode();
|
|
5192
|
-
* const node2 = node.createNode();
|
|
5193
|
-
* node2.move(undefined, 0);
|
|
5194
|
-
* // node2 root
|
|
5195
|
-
* // |
|
|
5196
|
-
* // node
|
|
5197
|
-
*
|
|
5198
|
-
* ```
|
|
5199
5179
|
* @param {LoroTreeNode | undefined} parent
|
|
5200
5180
|
* @param {number | undefined} [index]
|
|
5201
5181
|
*/
|
|
@@ -5358,11 +5338,6 @@ class LoroTreeNode {
|
|
|
5358
5338
|
}
|
|
5359
5339
|
}
|
|
5360
5340
|
/**
|
|
5361
|
-
* Get the parent node of this node.
|
|
5362
|
-
*
|
|
5363
|
-
* - The parent of the root node is `undefined`.
|
|
5364
|
-
* - The object returned is a new js object each time because it need to cross
|
|
5365
|
-
* the WASM boundary.
|
|
5366
5341
|
* @returns {LoroTreeNode | undefined}
|
|
5367
5342
|
*/
|
|
5368
5343
|
parent() {
|
|
@@ -6453,7 +6428,7 @@ var imports = /*#__PURE__*/Object.freeze({
|
|
|
6453
6428
|
// Without this patch, Cloudflare Worker would raise issue like: "Uncaught TypeError: wasm2.__wbindgen_start is not a function"
|
|
6454
6429
|
|
|
6455
6430
|
|
|
6456
|
-
import loro_wasm_bg_js from './loro_wasm_bg-
|
|
6431
|
+
import loro_wasm_bg_js from './loro_wasm_bg-68a6c103.js';
|
|
6457
6432
|
const instance = new WebAssembly.Instance(loro_wasm_bg_js(), {
|
|
6458
6433
|
"./loro_wasm_bg.js": imports,
|
|
6459
6434
|
});
|
package/base64/loro_wasm.d.ts
CHANGED
|
@@ -397,11 +397,6 @@ export type TreeNodeJSON<T> = Omit<TreeNodeValue, 'meta' | 'children'> & {
|
|
|
397
397
|
children: TreeNodeJSON<T>[],
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
interface LoroTree{
|
|
401
|
-
toArray(): TreeNodeValue[];
|
|
402
|
-
getNodes(options?: { withDeleted?: boolean } ): LoroTreeNode[];
|
|
403
|
-
}
|
|
404
|
-
|
|
405
400
|
interface LoroMovableList {
|
|
406
401
|
/**
|
|
407
402
|
* Get the cursor position at the given pos.
|
|
@@ -1129,6 +1124,8 @@ interface LoroTree<T extends Record<string, unknown> = Record<string, unknown>>
|
|
|
1129
1124
|
*/
|
|
1130
1125
|
getNodeByID(target: TreeID): LoroTreeNode<T>;
|
|
1131
1126
|
subscribe(listener: Listener): Subscription;
|
|
1127
|
+
toArray(): TreeNodeValue[];
|
|
1128
|
+
getNodes(options?: { withDeleted?: boolean } ): LoroTreeNode<T>[];
|
|
1132
1129
|
}
|
|
1133
1130
|
interface LoroTreeNode<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
1134
1131
|
/**
|
|
@@ -1156,7 +1153,36 @@ interface LoroTreeNode<T extends Record<string, unknown> = Record<string, unknow
|
|
|
1156
1153
|
* ```
|
|
1157
1154
|
*/
|
|
1158
1155
|
createNode(index?: number): LoroTreeNode<T>;
|
|
1156
|
+
/**
|
|
1157
|
+
* Move this tree node to be a child of the parent.
|
|
1158
|
+
* If the parent is undefined, this node will be a root node.
|
|
1159
|
+
*
|
|
1160
|
+
* If the index is not provided, the node will be appended to the end.
|
|
1161
|
+
*
|
|
1162
|
+
* It's not allowed that the target is an ancestor of the parent.
|
|
1163
|
+
*
|
|
1164
|
+
* @example
|
|
1165
|
+
* ```ts
|
|
1166
|
+
* const doc = new LoroDoc();
|
|
1167
|
+
* const tree = doc.getTree("tree");
|
|
1168
|
+
* const root = tree.createNode();
|
|
1169
|
+
* const node = root.createNode();
|
|
1170
|
+
* const node2 = node.createNode();
|
|
1171
|
+
* node2.move(undefined, 0);
|
|
1172
|
+
* // node2 root
|
|
1173
|
+
* // |
|
|
1174
|
+
* // node
|
|
1175
|
+
*
|
|
1176
|
+
* ```
|
|
1177
|
+
*/
|
|
1159
1178
|
move(parent?: LoroTreeNode<T>, index?: number): void;
|
|
1179
|
+
/**
|
|
1180
|
+
* Get the parent node of this node.
|
|
1181
|
+
*
|
|
1182
|
+
* - The parent of the root node is `undefined`.
|
|
1183
|
+
* - The object returned is a new js object each time because it need to cross
|
|
1184
|
+
* the WASM boundary.
|
|
1185
|
+
*/
|
|
1160
1186
|
parent(): LoroTreeNode<T> | undefined;
|
|
1161
1187
|
/**
|
|
1162
1188
|
* Get the children of this node.
|
|
@@ -3194,31 +3220,6 @@ export class LoroTreeNode {
|
|
|
3194
3220
|
*/
|
|
3195
3221
|
__getClassname(): string;
|
|
3196
3222
|
/**
|
|
3197
|
-
* Move this tree node to be a child of the parent.
|
|
3198
|
-
* If the parent is undefined, this node will be a root node.
|
|
3199
|
-
*
|
|
3200
|
-
* If the index is not provided, the node will be appended to the end.
|
|
3201
|
-
*
|
|
3202
|
-
* It's not allowed that the target is an ancestor of the parent.
|
|
3203
|
-
*
|
|
3204
|
-
* @example
|
|
3205
|
-
* ```ts
|
|
3206
|
-
* const doc = new LoroDoc();
|
|
3207
|
-
* const tree = doc.getTree("tree");
|
|
3208
|
-
* const root = tree.createNode();
|
|
3209
|
-
* const node = root.createNode();
|
|
3210
|
-
* const node2 = node.createNode();
|
|
3211
|
-
* node2.move(undefined, 0);
|
|
3212
|
-
* // node2 root
|
|
3213
|
-
* // |
|
|
3214
|
-
* // node
|
|
3215
|
-
*
|
|
3216
|
-
* ```
|
|
3217
|
-
* @param {LoroTreeNode | undefined} parent
|
|
3218
|
-
* @param {number | undefined} [index]
|
|
3219
|
-
*/
|
|
3220
|
-
move(parent: LoroTreeNode | undefined, index?: number): void;
|
|
3221
|
-
/**
|
|
3222
3223
|
* Move the tree node to be after the target node.
|
|
3223
3224
|
*
|
|
3224
3225
|
* @example
|
|
@@ -3271,15 +3272,6 @@ export class LoroTreeNode {
|
|
|
3271
3272
|
*/
|
|
3272
3273
|
fractionalIndex(): string | undefined;
|
|
3273
3274
|
/**
|
|
3274
|
-
* Get the parent node of this node.
|
|
3275
|
-
*
|
|
3276
|
-
* - The parent of the root node is `undefined`.
|
|
3277
|
-
* - The object returned is a new js object each time because it need to cross
|
|
3278
|
-
* the WASM boundary.
|
|
3279
|
-
* @returns {LoroTreeNode | undefined}
|
|
3280
|
-
*/
|
|
3281
|
-
parent(): LoroTreeNode | undefined;
|
|
3282
|
-
/**
|
|
3283
3275
|
* Check if the node is deleted.
|
|
3284
3276
|
* @returns {boolean}
|
|
3285
3277
|
*/
|