@fluidframework/tree 2.74.0-368706 → 2.74.0-370705

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.
Files changed (104) hide show
  1. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +1 -0
  2. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  3. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -1
  4. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  5. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
  6. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  7. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  8. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  9. package/dist/feature-libraries/default-schema/index.js +2 -1
  10. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  11. package/dist/feature-libraries/index.d.ts +1 -1
  12. package/dist/feature-libraries/index.d.ts.map +1 -1
  13. package/dist/feature-libraries/index.js +2 -1
  14. package/dist/feature-libraries/index.js.map +1 -1
  15. package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
  16. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  17. package/dist/feature-libraries/modular-schema/index.js +2 -1
  18. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  19. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -0
  20. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  21. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +9 -1
  22. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  23. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  24. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  25. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
  26. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  27. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  28. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  29. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
  30. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  31. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  32. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  33. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  34. package/dist/packageVersion.d.ts +1 -1
  35. package/dist/packageVersion.js +1 -1
  36. package/dist/packageVersion.js.map +1 -1
  37. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  38. package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
  39. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  40. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  41. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  42. package/dist/shared-tree/sharedTreeChangeFamily.js +8 -2
  43. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  44. package/dist/shared-tree/sharedTreeEditBuilder.js +1 -1
  45. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  46. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +1 -0
  47. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  48. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +4 -1
  49. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  50. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
  51. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  52. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  53. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  54. package/lib/feature-libraries/default-schema/index.js +1 -1
  55. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  56. package/lib/feature-libraries/index.d.ts +1 -1
  57. package/lib/feature-libraries/index.d.ts.map +1 -1
  58. package/lib/feature-libraries/index.js +1 -1
  59. package/lib/feature-libraries/index.js.map +1 -1
  60. package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
  61. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  62. package/lib/feature-libraries/modular-schema/index.js +1 -1
  63. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  64. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -0
  65. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  66. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +7 -0
  67. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  68. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
  69. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
  70. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
  71. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
  72. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
  73. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
  74. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
  75. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
  76. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  77. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
  78. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  79. package/lib/packageVersion.d.ts +1 -1
  80. package/lib/packageVersion.js +1 -1
  81. package/lib/packageVersion.js.map +1 -1
  82. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  83. package/lib/shared-tree/sharedTreeChangeEnricher.js +2 -2
  84. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  85. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  86. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  87. package/lib/shared-tree/sharedTreeChangeFamily.js +8 -2
  88. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  89. package/lib/shared-tree/sharedTreeEditBuilder.js +1 -1
  90. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  91. package/package.json +21 -21
  92. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -0
  93. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -1
  94. package/src/feature-libraries/default-schema/index.ts +1 -0
  95. package/src/feature-libraries/index.ts +1 -0
  96. package/src/feature-libraries/modular-schema/index.ts +1 -0
  97. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +8 -0
  98. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
  99. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
  100. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
  101. package/src/packageVersion.ts +1 -1
  102. package/src/shared-tree/sharedTreeChangeEnricher.ts +2 -0
  103. package/src/shared-tree/sharedTreeChangeFamily.ts +8 -1
  104. package/src/shared-tree/sharedTreeEditBuilder.ts +1 -1
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { type Static, type TSchema } from "@sinclair/typebox";
6
+ export declare const EncodedOptionalChangeset: <Schema extends TSchema>(tNodeChange: Schema) => import("@sinclair/typebox").TObject<{
7
+ c: Schema extends import("@sinclair/typebox").TOptional<infer S extends TSchema> ? import("@sinclair/typebox").TOptional<S> : import("@sinclair/typebox").Ensure<import("@sinclair/typebox").TOptional<Schema>>;
8
+ r: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
9
+ e: import("@sinclair/typebox").TBoolean;
10
+ s: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>>;
11
+ d: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>;
12
+ }>>;
13
+ d: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>>;
14
+ }>;
15
+ export type EncodedOptionalChangeset<Schema extends TSchema> = Static<ReturnType<typeof EncodedOptionalChangeset<Schema>>>;
16
+ declare const EncodedReplace: import("@sinclair/typebox").TObject<{
17
+ e: import("@sinclair/typebox").TBoolean;
18
+ s: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>>;
19
+ d: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<import("../../core/index.js").ChangesetLocalId>]>;
20
+ }>;
21
+ export type EncodedReplace = Static<typeof EncodedReplace>;
22
+ export {};
23
+ //# sourceMappingURL=optionalFieldChangeFormatV3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionalFieldChangeFormatV3.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AAQxF,eAAO,MAAM,wBAAwB,wCAAyC,MAAM;;;;;;;;EAalF,CAAC;AAEH,MAAM,MAAM,wBAAwB,CAAC,MAAM,SAAS,OAAO,IAAI,MAAM,CACpE,UAAU,CAAC,OAAO,wBAAwB,CAAC,MAAM,CAAC,CAAC,CACnD,CAAC;AAEF,QAAA,MAAM,cAAc;;;;EAWnB,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.EncodedOptionalChangeset = void 0;
8
+ const typebox_1 = require("@sinclair/typebox");
9
+ const index_js_1 = require("../modular-schema/index.js");
10
+ const noAdditionalProps = { additionalProperties: false };
11
+ // Type is intentionally derived.
12
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
13
+ const EncodedOptionalChangeset = (tNodeChange) => typebox_1.Type.Object({
14
+ // Nested changes
15
+ c: typebox_1.Type.Optional(tNodeChange),
16
+ // How to replace the current value of the field.
17
+ r: typebox_1.Type.Optional(EncodedReplace),
18
+ // Node detach
19
+ d: typebox_1.Type.Optional(index_js_1.EncodedChangeAtomId),
20
+ }, noAdditionalProps);
21
+ exports.EncodedOptionalChangeset = EncodedOptionalChangeset;
22
+ const EncodedReplace = typebox_1.Type.Object({
23
+ // Whether the field is empty in the input context of this change.
24
+ e: typebox_1.Type.Boolean(),
25
+ // The ID for the node to put in this field, or undefined if the field should be emptied.
26
+ // Will be "self" when the intention is to keep the current node in this field.
27
+ s: typebox_1.Type.Optional(index_js_1.EncodedChangeAtomId),
28
+ // An ID to associate with the node (if any) which is detached by this edit.
29
+ d: index_js_1.EncodedChangeAtomId,
30
+ }, noAdditionalProps);
31
+ //# sourceMappingURL=optionalFieldChangeFormatV3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionalFieldChangeFormatV3.js","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAwF;AAExF,yDAAiE;AAEjE,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE,iCAAiC;AACjC,4EAA4E;AACrE,MAAM,wBAAwB,GAAG,CAAyB,WAAmB,EAAE,EAAE,CACvF,cAAI,CAAC,MAAM,CACV;IACC,iBAAiB;IACjB,CAAC,EAAE,cAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;IAE7B,iDAAiD;IACjD,CAAC,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;IAEhC,cAAc;IACd,CAAC,EAAE,cAAI,CAAC,QAAQ,CAAC,8BAAmB,CAAC;CACrC,EACD,iBAAiB,CACjB,CAAC;AAbU,QAAA,wBAAwB,4BAalC;AAMH,MAAM,cAAc,GAAG,cAAI,CAAC,MAAM,CACjC;IACC,kEAAkE;IAClE,CAAC,EAAE,cAAI,CAAC,OAAO,EAAE;IACjB,yFAAyF;IACzF,+EAA+E;IAC/E,CAAC,EAAE,cAAI,CAAC,QAAQ,CAAC,8BAAmB,CAAC;IACrC,4EAA4E;IAC5E,CAAC,EAAE,8BAAmB;CACtB,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, type TSchema, Type } from \"@sinclair/typebox\";\n\nimport { EncodedChangeAtomId } from \"../modular-schema/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n// Type is intentionally derived.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const EncodedOptionalChangeset = <Schema extends TSchema>(tNodeChange: Schema) =>\n\tType.Object(\n\t\t{\n\t\t\t// Nested changes\n\t\t\tc: Type.Optional(tNodeChange),\n\n\t\t\t// How to replace the current value of the field.\n\t\t\tr: Type.Optional(EncodedReplace),\n\n\t\t\t// Node detach\n\t\t\td: Type.Optional(EncodedChangeAtomId),\n\t\t},\n\t\tnoAdditionalProps,\n\t);\n\nexport type EncodedOptionalChangeset<Schema extends TSchema> = Static<\n\tReturnType<typeof EncodedOptionalChangeset<Schema>>\n>;\n\nconst EncodedReplace = Type.Object(\n\t{\n\t\t// Whether the field is empty in the input context of this change.\n\t\te: Type.Boolean(),\n\t\t// The ID for the node to put in this field, or undefined if the field should be emptied.\n\t\t// Will be \"self\" when the intention is to keep the current node in this field.\n\t\ts: Type.Optional(EncodedChangeAtomId),\n\t\t// An ID to associate with the node (if any) which is detached by this edit.\n\t\td: EncodedChangeAtomId,\n\t},\n\tnoAdditionalProps,\n);\nexport type EncodedReplace = Static<typeof EncodedReplace>;\n"]}
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { TAnySchema } from "@sinclair/typebox";
6
+ import type { IJsonCodec } from "../../codec/index.js";
7
+ import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from "../../core/index.js";
8
+ import { type FieldChangeEncodingContext } from "../modular-schema/index.js";
9
+ import { EncodedOptionalChangeset } from "./optionalFieldChangeFormatV3.js";
10
+ import type { OptionalChangeset } from "./optionalFieldChangeTypes.js";
11
+ export declare function makeOptionalFieldCodec(revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>): IJsonCodec<OptionalChangeset, EncodedOptionalChangeset<TAnySchema>, EncodedOptionalChangeset<TAnySchema>, FieldChangeEncodingContext>;
12
+ //# sourceMappingURL=optionalFieldCodecV3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionalFieldCodecV3.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldCodecV3.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAEN,KAAK,0BAA0B,EAC/B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAW,MAAM,+BAA+B,CAAC;AAEhF,wBAAgB,sBAAsB,CACrC,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,GACC,UAAU,CACZ,iBAAiB,EACjB,wBAAwB,CAAC,UAAU,CAAC,EACpC,wBAAwB,CAAC,UAAU,CAAC,EACpC,0BAA0B,CAC1B,CA0DA"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.makeOptionalFieldCodec = void 0;
8
+ const changeAtomIdCodec_js_1 = require("../changeAtomIdCodec.js");
9
+ const index_js_1 = require("../modular-schema/index.js");
10
+ const optionalFieldChangeFormatV3_js_1 = require("./optionalFieldChangeFormatV3.js");
11
+ function makeOptionalFieldCodec(revisionTagCodec) {
12
+ const changeAtomIdCodec = (0, changeAtomIdCodec_js_1.makeChangeAtomIdCodec)(revisionTagCodec);
13
+ return {
14
+ encode: (change, context) => {
15
+ const encoded = {};
16
+ if (change.valueReplace !== undefined) {
17
+ encoded.r = {
18
+ e: change.valueReplace.isEmpty,
19
+ d: changeAtomIdCodec.encode(change.valueReplace.dst, context.baseContext),
20
+ };
21
+ if (change.valueReplace.src !== undefined) {
22
+ encoded.r.s = changeAtomIdCodec.encode(change.valueReplace.src, context.baseContext);
23
+ }
24
+ }
25
+ if (change.nodeDetach !== undefined) {
26
+ encoded.d = changeAtomIdCodec.encode(change.nodeDetach, context.baseContext);
27
+ }
28
+ if (change.childChange !== undefined) {
29
+ encoded.c = context.encodeNode(change.childChange);
30
+ }
31
+ return encoded;
32
+ },
33
+ decode: (encoded, context) => {
34
+ const decoded = {};
35
+ if (encoded.r !== undefined) {
36
+ const replace = {
37
+ isEmpty: encoded.r.e,
38
+ dst: changeAtomIdCodec.decode(encoded.r.d, context.baseContext),
39
+ };
40
+ if (encoded.r.s !== undefined) {
41
+ replace.src = changeAtomIdCodec.decode(encoded.r.s, context.baseContext);
42
+ }
43
+ decoded.valueReplace = replace;
44
+ }
45
+ if (encoded.d !== undefined) {
46
+ decoded.nodeDetach = changeAtomIdCodec.decode(encoded.d, context.baseContext);
47
+ }
48
+ if (encoded.c !== undefined) {
49
+ decoded.childChange = context.decodeNode(encoded.c);
50
+ }
51
+ return decoded;
52
+ },
53
+ encodedSchema: (0, optionalFieldChangeFormatV3_js_1.EncodedOptionalChangeset)(index_js_1.EncodedNodeChangeset),
54
+ };
55
+ }
56
+ exports.makeOptionalFieldCodec = makeOptionalFieldCodec;
57
+ //# sourceMappingURL=optionalFieldCodecV3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionalFieldCodecV3.js","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldCodecV3.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,kEAAgE;AAChE,yDAGoC;AAEpC,qFAA4E;AAG5E,SAAgB,sBAAsB,CACrC,gBAKC;IAOD,MAAM,iBAAiB,GAAG,IAAA,4CAAqB,EAAC,gBAAgB,CAAC,CAAC;IAElE,OAAO;QACN,MAAM,EAAE,CAAC,MAAyB,EAAE,OAAmC,EAAE,EAAE;YAC1E,MAAM,OAAO,GAAyC,EAAE,CAAC;YAEzD,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;gBACvC,OAAO,CAAC,CAAC,GAAG;oBACX,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO;oBAC9B,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC;iBACzE,CAAC;gBAEF,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;oBAC3C,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,EAA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KAAK,SAAS,EAAE,CAAC;gBAC7B,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACrD,CAAC;YAED,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,aAAa,EAAE,IAAA,yDAAwB,EAAC,+BAAoB,CAAC;KAC7D,CAAC;AACH,CAAC;AAtED,wDAsEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport type { IJsonCodec } from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { Mutable } from \"../../util/index.js\";\nimport { makeChangeAtomIdCodec } from \"../changeAtomIdCodec.js\";\nimport {\n\tEncodedNodeChangeset,\n\ttype FieldChangeEncodingContext,\n} from \"../modular-schema/index.js\";\n\nimport { EncodedOptionalChangeset } from \"./optionalFieldChangeFormatV3.js\";\nimport type { OptionalChangeset, Replace } from \"./optionalFieldChangeTypes.js\";\n\nexport function makeOptionalFieldCodec(\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): IJsonCodec<\n\tOptionalChangeset,\n\tEncodedOptionalChangeset<TAnySchema>,\n\tEncodedOptionalChangeset<TAnySchema>,\n\tFieldChangeEncodingContext\n> {\n\tconst changeAtomIdCodec = makeChangeAtomIdCodec(revisionTagCodec);\n\n\treturn {\n\t\tencode: (change: OptionalChangeset, context: FieldChangeEncodingContext) => {\n\t\t\tconst encoded: EncodedOptionalChangeset<TAnySchema> = {};\n\n\t\t\tif (change.valueReplace !== undefined) {\n\t\t\t\tencoded.r = {\n\t\t\t\t\te: change.valueReplace.isEmpty,\n\t\t\t\t\td: changeAtomIdCodec.encode(change.valueReplace.dst, context.baseContext),\n\t\t\t\t};\n\n\t\t\t\tif (change.valueReplace.src !== undefined) {\n\t\t\t\t\tencoded.r.s = changeAtomIdCodec.encode(change.valueReplace.src, context.baseContext);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (change.nodeDetach !== undefined) {\n\t\t\t\tencoded.d = changeAtomIdCodec.encode(change.nodeDetach, context.baseContext);\n\t\t\t}\n\n\t\t\tif (change.childChange !== undefined) {\n\t\t\t\tencoded.c = context.encodeNode(change.childChange);\n\t\t\t}\n\n\t\t\treturn encoded;\n\t\t},\n\n\t\tdecode: (\n\t\t\tencoded: EncodedOptionalChangeset<TAnySchema>,\n\t\t\tcontext: FieldChangeEncodingContext,\n\t\t) => {\n\t\t\tconst decoded: Mutable<OptionalChangeset> = {};\n\n\t\t\tif (encoded.r !== undefined) {\n\t\t\t\tconst replace: Mutable<Replace> = {\n\t\t\t\t\tisEmpty: encoded.r.e,\n\t\t\t\t\tdst: changeAtomIdCodec.decode(encoded.r.d, context.baseContext),\n\t\t\t\t};\n\t\t\t\tif (encoded.r.s !== undefined) {\n\t\t\t\t\treplace.src = changeAtomIdCodec.decode(encoded.r.s, context.baseContext);\n\t\t\t\t}\n\t\t\t\tdecoded.valueReplace = replace;\n\t\t\t}\n\n\t\t\tif (encoded.d !== undefined) {\n\t\t\t\tdecoded.nodeDetach = changeAtomIdCodec.decode(encoded.d, context.baseContext);\n\t\t\t}\n\n\t\t\tif (encoded.c !== undefined) {\n\t\t\t\tdecoded.childChange = context.decodeNode(encoded.c);\n\t\t\t}\n\n\t\t\treturn decoded;\n\t\t},\n\t\tencodedSchema: EncodedOptionalChangeset(EncodedNodeChangeset),\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"optionalFieldCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,eAAO,MAAM,4BAA4B,qBACtB,WACjB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,KACC,aAAa,iBAAiB,EAAE,0BAA0B,CACP,CAAC"}
1
+ {"version":3,"file":"optionalFieldCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,eAAO,MAAM,4BAA4B,qBACtB,WACjB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,KACC,aAAa,iBAAiB,EAAE,0BAA0B,CAI1D,CAAC"}
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.makeOptionalFieldCodecFamily = void 0;
8
8
  const index_js_1 = require("../../codec/index.js");
9
9
  const optionalFieldCodecV2_js_1 = require("./optionalFieldCodecV2.js");
10
- const makeOptionalFieldCodecFamily = (revisionTagCodec) => (0, index_js_1.makeCodecFamily)([[2, (0, optionalFieldCodecV2_js_1.makeOptionalFieldCodec)(revisionTagCodec)]]);
10
+ const optionalFieldCodecV3_js_1 = require("./optionalFieldCodecV3.js");
11
+ const makeOptionalFieldCodecFamily = (revisionTagCodec) => (0, index_js_1.makeCodecFamily)([
12
+ [2, (0, optionalFieldCodecV2_js_1.makeOptionalFieldCodec)(revisionTagCodec)],
13
+ [3, (0, optionalFieldCodecV3_js_1.makeOptionalFieldCodec)(revisionTagCodec)],
14
+ ]);
11
15
  exports.makeOptionalFieldCodecFamily = makeOptionalFieldCodecFamily;
12
16
  //# sourceMappingURL=optionalFieldCodecs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"optionalFieldCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mDAA2F;AAS3F,uEAAkF;AAE3E,MAAM,4BAA4B,GAAG,CAC3C,gBAKC,EAC6D,EAAE,CAChE,IAAA,0BAAe,EAAC,CAAC,CAAC,CAAC,EAAE,IAAA,gDAAW,EAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AAR1C,QAAA,4BAA4B,gCAQc","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ICodecFamily, type IJsonCodec, makeCodecFamily } from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { FieldChangeEncodingContext } from \"../modular-schema/index.js\";\n\nimport type { OptionalChangeset } from \"./optionalFieldChangeTypes.js\";\nimport { makeOptionalFieldCodec as makeV2Codec } from \"./optionalFieldCodecV2.js\";\n\nexport const makeOptionalFieldCodecFamily = (\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): ICodecFamily<OptionalChangeset, FieldChangeEncodingContext> =>\n\tmakeCodecFamily([[2, makeV2Codec(revisionTagCodec)]]);\n"]}
1
+ {"version":3,"file":"optionalFieldCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/optional-field/optionalFieldCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mDAA2F;AAS3F,uEAAkF;AAClF,uEAAkF;AAE3E,MAAM,4BAA4B,GAAG,CAC3C,gBAKC,EAC6D,EAAE,CAChE,IAAA,0BAAe,EAAC;IACf,CAAC,CAAC,EAAE,IAAA,gDAAW,EAAC,gBAAgB,CAAC,CAAC;IAClC,CAAC,CAAC,EAAE,IAAA,gDAAW,EAAC,gBAAgB,CAAC,CAAC;CAClC,CAAC,CAAC;AAXS,QAAA,4BAA4B,gCAWrC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ICodecFamily, type IJsonCodec, makeCodecFamily } from \"../../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../../core/index.js\";\nimport type { FieldChangeEncodingContext } from \"../modular-schema/index.js\";\n\nimport type { OptionalChangeset } from \"./optionalFieldChangeTypes.js\";\nimport { makeOptionalFieldCodec as makeV2Codec } from \"./optionalFieldCodecV2.js\";\nimport { makeOptionalFieldCodec as makeV3Codec } from \"./optionalFieldCodecV3.js\";\n\nexport const makeOptionalFieldCodecFamily = (\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n): ICodecFamily<OptionalChangeset, FieldChangeEncodingContext> =>\n\tmakeCodecFamily([\n\t\t[2, makeV2Codec(revisionTagCodec)],\n\t\t[3, makeV3Codec(revisionTagCodec)],\n\t]);\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/tree";
8
- export declare const pkgVersion = "2.74.0-368706";
8
+ export declare const pkgVersion = "2.74.0-370705";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/tree";
11
- exports.pkgVersion = "2.74.0-368706";
11
+ exports.pkgVersion = "2.74.0-370705";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.74.0-368706\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.74.0-370705\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeChangeEnricher.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeEnricher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGN,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,WAAW,EAChB,KAAK,0B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AAE,0BAA0B,EACjB,YAAY,EAAE,kBAAkB,EACjD,YAAY,CAAC,EAAE,aAAa;IAKtB,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI;IAuBtE,CAAC,aAAa,CAAC,IAAI,IAAI;CAG9B"}
@@ -43,7 +43,7 @@ class SharedTreeReadonlyChangeEnricher {
43
43
  return new SharedTreeMutableChangeEnricher(this.borrowedForest.clone(this.schema, new index_js_1.AnchorSet()), this.schema, this.borrowedRemovedRoots.clone());
44
44
  }
45
45
  updateChangeEnrichments(change) {
46
- return (0, sharedTreeChangeFamily_js_1.updateRefreshers)(change, this.getDetachedRoot, index_js_2.relevantRemovedRoots, index_js_2.updateRefreshers);
46
+ return (0, sharedTreeChangeFamily_js_1.updateRefreshers)(change, index_js_2.getBuildsIds, this.getDetachedRoot, index_js_2.relevantRemovedRoots, index_js_2.updateRefreshers);
47
47
  }
48
48
  }
49
49
  exports.SharedTreeReadonlyChangeEnricher = SharedTreeReadonlyChangeEnricher;
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeChangeEnricher.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeEnricher.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsE;AACtE,+CAW0B;AAC1B,4DAOuC;AACvC,+CAAiD;AACjD,2EAA+D;AAQ/D,MAAa,gCAAgC;IAG5C;;;;;;;OAOG;IACH,YACoB,cAAmC,EACrC,MAAkC,EAChC,oBAAgD,EAClD,YAA4B;QAH1B,mBAAc,GAAd,cAAc,CAAqB;QACrC,WAAM,GAAN,MAAM,CAA4B;QAChC,yBAAoB,GAApB,oBAAoB,CAA4B;QAClD,iBAAY,GAAZ,YAAY,CAAgB;QAoB7B,oBAAe,GAAG,CAAC,EAAuB,EAAyB,EAAE;YACrF,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACvD,IAAI,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jD,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC;YACrC,QAAQ,IAAI,EAAE,CAAC;gBACd,KAAK,MAAM,CAAC,CAAC,CAAC;oBACb,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAC,IAAA,oBAAS,EAAC,kBAAkB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;oBAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;oBAC7C,IAAA,qBAAU,EAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;oBACxD,OAAO,CAAC,IAAI,EAAE,CAAC;oBACf,MAAM;gBACP,CAAC;gBACD,KAAK,QAAQ;oBACZ,6DAA6D;oBAC7D,mGAAmG;oBACnG,+FAA+F;oBAC/F,wDAAwD;oBACxD,MAAM;gBACP;oBACC,IAAA,0BAAe,EAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QACF,CAAC;IACF,CAAC;IAEM,CAAC,wBAAa,CAAC;QACrB,yEAAyE;IAC1E,CAAC;CACD;AA/CD,0EA+CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tAnchorSet,\n\ttype DeltaDetachedNodeId,\n\ttype DetachedFieldIndex,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype RevisionTag,\n\ttype TreeStoredSchemaRepository,\n\ttagChange,\n\tvisitDelta,\n} from \"../core/index.js\";\nimport {\n\ttype TreeChunk,\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers as updateDataChangeRefreshers,\n} from \"../feature-libraries/index.js\";\nimport { disposeSymbol } from \"../util/index.js\";\nimport { updateRefreshers } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type {\n\tChangeEnricherMutableCheckout,\n\tChangeEnricherReadonlyCheckout,\n} from \"../shared-tree-core/index.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nexport class SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherReadonlyCheckout<SharedTreeChange>\n{\n\t/**\n\t * @param borrowedForest - The state based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param borrowedRemovedRoots - The set of removed roots based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param idCompressor - The id compressor to use when chunking trees.\n\t */\n\tpublic constructor(\n\t\tprotected readonly borrowedForest: IForestSubscription,\n\t\tprivate readonly schema: TreeStoredSchemaRepository,\n\t\tprotected readonly borrowedRemovedRoots: ReadOnlyDetachedFieldIndex,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t) {}\n\n\tpublic fork(): ChangeEnricherMutableCheckout<SharedTreeChange> {\n\t\treturn new SharedTreeMutableChangeEnricher(\n\t\t\tthis.borrowedForest.clone(this.schema, new AnchorSet()),\n\t\t\tthis.schema,\n\t\t\tthis.borrowedRemovedRoots.clone(),\n\t\t);\n\t}\n\n\tpublic updateChangeEnrichments(change: SharedTreeChange): SharedTreeChange {\n\t\treturn updateRefreshers(\n\t\t\tchange,\n\t\t\tthis.getDetachedRoot,\n\t\t\trelevantRemovedRoots,\n\t\t\tupdateDataChangeRefreshers,\n\t\t);\n\t}\n\n\tprivate readonly getDetachedRoot = (id: DeltaDetachedNodeId): TreeChunk | undefined => {\n\t\tconst root = this.borrowedRemovedRoots.tryGetEntry(id);\n\t\tif (root !== undefined) {\n\t\t\tconst cursor = this.borrowedForest.getCursorAboveDetachedFields();\n\t\t\tconst parentField = this.borrowedRemovedRoots.toFieldKey(root);\n\t\t\tcursor.enterField(parentField);\n\t\t\tcursor.enterNode(0);\n\t\t\treturn chunkTree(cursor, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\nexport class SharedTreeMutableChangeEnricher\n\textends SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherMutableCheckout<SharedTreeChange>\n{\n\t/**\n\t * @param forest - The state based on which to enrich changes.\n\t * Owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param removedRoots - The set of removed roots based on which to enrich changes.\n\t * Owned by the constructed instance.\n\t * @param idCompressor - The id compressor to use when chunking trees.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tschema: TreeStoredSchemaRepository,\n\t\tprivate readonly removedRoots: DetachedFieldIndex,\n\t\tidCompressor?: IIdCompressor,\n\t) {\n\t\tsuper(forest, schema, removedRoots, idCompressor);\n\t}\n\n\tpublic applyTipChange(change: SharedTreeChange, revision?: RevisionTag): void {\n\t\tfor (const dataOrSchemaChange of change.changes) {\n\t\t\tconst type = dataOrSchemaChange.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"data\": {\n\t\t\t\t\tconst delta = intoDelta(tagChange(dataOrSchemaChange.innerChange, revision));\n\t\t\t\t\tconst visitor = this.forest.acquireVisitor();\n\t\t\t\t\tvisitDelta(delta, visitor, this.removedRoots, revision);\n\t\t\t\t\tvisitor.free();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"schema\":\n\t\t\t\t\t// This enricher doesn't need to maintain schema information.\n\t\t\t\t\t// Note that the refreshers being generated through `updateChangeEnrichments` will be encoded using\n\t\t\t\t\t// the schema that was used in the input context of the data changeset these refreshers are on.\n\t\t\t\t\t// See the encoding logic in SharedTreeCore for details.\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\t// TODO: in the future, forest and/or its AnchorSet may require disposal.\n\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M,CAAC,wBAAa,CAAC;QACrB,yEAAyE;IAC1E,CAAC;CACD;AA/CD,0EA+CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tAnchorSet,\n\ttype DeltaDetachedNodeId,\n\ttype DetachedFieldIndex,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype RevisionTag,\n\ttype TreeStoredSchemaRepository,\n\ttagChange,\n\tvisitDelta,\n} from \"../core/index.js\";\nimport {\n\ttype TreeChunk,\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tgetBuildsIds,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers as updateDataChangeRefreshers,\n} from \"../feature-libraries/index.js\";\nimport { disposeSymbol } from \"../util/index.js\";\nimport { updateRefreshers } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type {\n\tChangeEnricherMutableCheckout,\n\tChangeEnricherReadonlyCheckout,\n} from \"../shared-tree-core/index.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nexport class SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherReadonlyCheckout<SharedTreeChange>\n{\n\t/**\n\t * @param borrowedForest - The state based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param borrowedRemovedRoots - The set of removed roots based on which to enrich changes.\n\t * Not owned by the constructed instance.\n\t * @param idCompressor - The id compressor to use when chunking trees.\n\t */\n\tpublic constructor(\n\t\tprotected readonly borrowedForest: IForestSubscription,\n\t\tprivate readonly schema: TreeStoredSchemaRepository,\n\t\tprotected readonly borrowedRemovedRoots: ReadOnlyDetachedFieldIndex,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t) {}\n\n\tpublic fork(): ChangeEnricherMutableCheckout<SharedTreeChange> {\n\t\treturn new SharedTreeMutableChangeEnricher(\n\t\t\tthis.borrowedForest.clone(this.schema, new AnchorSet()),\n\t\t\tthis.schema,\n\t\t\tthis.borrowedRemovedRoots.clone(),\n\t\t);\n\t}\n\n\tpublic updateChangeEnrichments(change: SharedTreeChange): SharedTreeChange {\n\t\treturn updateRefreshers(\n\t\t\tchange,\n\t\t\tgetBuildsIds,\n\t\t\tthis.getDetachedRoot,\n\t\t\trelevantRemovedRoots,\n\t\t\tupdateDataChangeRefreshers,\n\t\t);\n\t}\n\n\tprivate readonly getDetachedRoot = (id: DeltaDetachedNodeId): TreeChunk | undefined => {\n\t\tconst root = this.borrowedRemovedRoots.tryGetEntry(id);\n\t\tif (root !== undefined) {\n\t\t\tconst cursor = this.borrowedForest.getCursorAboveDetachedFields();\n\t\t\tconst parentField = this.borrowedRemovedRoots.toFieldKey(root);\n\t\t\tcursor.enterField(parentField);\n\t\t\tcursor.enterNode(0);\n\t\t\treturn chunkTree(cursor, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t};\n}\n\nexport class SharedTreeMutableChangeEnricher\n\textends SharedTreeReadonlyChangeEnricher\n\timplements ChangeEnricherMutableCheckout<SharedTreeChange>\n{\n\t/**\n\t * @param forest - The state based on which to enrich changes.\n\t * Owned by the constructed instance.\n\t * @param schema - The schema that corresponds to the forest.\n\t * @param removedRoots - The set of removed roots based on which to enrich changes.\n\t * Owned by the constructed instance.\n\t * @param idCompressor - The id compressor to use when chunking trees.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tschema: TreeStoredSchemaRepository,\n\t\tprivate readonly removedRoots: DetachedFieldIndex,\n\t\tidCompressor?: IIdCompressor,\n\t) {\n\t\tsuper(forest, schema, removedRoots, idCompressor);\n\t}\n\n\tpublic applyTipChange(change: SharedTreeChange, revision?: RevisionTag): void {\n\t\tfor (const dataOrSchemaChange of change.changes) {\n\t\t\tconst type = dataOrSchemaChange.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"data\": {\n\t\t\t\t\tconst delta = intoDelta(tagChange(dataOrSchemaChange.innerChange, revision));\n\t\t\t\t\tconst visitor = this.forest.acquireVisitor();\n\t\t\t\t\tvisitDelta(delta, visitor, this.removedRoots, revision);\n\t\t\t\t\tvisitor.free();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"schema\":\n\t\t\t\t\t// This enricher doesn't need to maintain schema information.\n\t\t\t\t\t// Note that the refreshers being generated through `updateChangeEnrichments` will be encoded using\n\t\t\t\t\t// the schema that was used in the input context of the data changeset these refreshers are on.\n\t\t\t\t\t// See the encoding logic in SharedTreeCore for details.\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(type);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\t// TODO: in the future, forest and/or its AnchorSet may require disposal.\n\t}\n}\n"]}
@@ -34,5 +34,5 @@ export declare function hasSchemaChange(change: SharedTreeChange): boolean;
34
34
  * Is expected to read from a forest in a state that corresponds to the input context of the given change.
35
35
  * @returns An equivalent change with an updated set of appropriate refreshers.
36
36
  */
37
- export declare function updateRefreshers(change: SharedTreeChange, getDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined, relevantRemovedRootsFromDataChange: (taggedChange: ModularChangeset) => Iterable<DeltaDetachedNodeId>, updateDataChangeRefreshers: (change: ModularChangeset, getDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined, removedRoots: Iterable<DeltaDetachedNodeId>, requireRefreshers: boolean) => ModularChangeset): SharedTreeChange;
37
+ export declare function updateRefreshers(change: SharedTreeChange, buildsFromDataChange: (taggedChange: ModularChangeset) => Iterable<DeltaDetachedNodeId>, getDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined, relevantRemovedRootsFromDataChange: (taggedChange: ModularChangeset) => Iterable<DeltaDetachedNodeId>, updateDataChangeRefreshers: (change: ModularChangeset, getDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined, removedRoots: Iterable<DeltaDetachedNodeId>, requireRefreshers: boolean) => ModularChangeset): SharedTreeChange;
38
38
  //# sourceMappingURL=sharedTreeChangeFamily.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeChangeFamily.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAEjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,uBAAuB,EAI5B,MAAM,+BAA+B,CAAC;AAUvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E;;;;GAIG;AACH,qBAAa,sBACZ,YACC,YAAY,CAAC,4BAA4B,EAAE,gBAAgB,CAAC,EAC5D,aAAa,CAAC,gBAAgB,CAAC;IAc/B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAZ/B,gBAAuB,WAAW,EAAE,gBAAgB,CAElD;IAEF,SAAgB,MAAM,EAAE,YAAY,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC;IAC9E,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAsB;gBAGz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QAAQ,CAAC,mBAAmB,CAAC,EAC3C,iBAAiB,EAAE,OAAO,KACtB,gBAAgB,GACnB,gBAAgB,CA4DlB"}
@@ -152,7 +152,7 @@ function mapDataChanges(change, map) {
152
152
  * Is expected to read from a forest in a state that corresponds to the input context of the given change.
153
153
  * @returns An equivalent change with an updated set of appropriate refreshers.
154
154
  */
155
- function updateRefreshers(change, getDetachedNode, relevantRemovedRootsFromDataChange, updateDataChangeRefreshers) {
155
+ function updateRefreshers(change, buildsFromDataChange, getDetachedNode, relevantRemovedRootsFromDataChange, updateDataChangeRefreshers) {
156
156
  // Adding refreshers to a SharedTreeChange is not as simple as adding refreshers to each of its data changes.
157
157
  // This is because earlier data changes affect the state of the forest in ways that can influence the refreshers
158
158
  // needed for later data changes. This can happen in two ways:
@@ -185,10 +185,16 @@ function updateRefreshers(change, getDetachedNode, relevantRemovedRootsFromDataC
185
185
  }
186
186
  let isFirstDataChange = true;
187
187
  return mapDataChanges(change, (dataChange) => {
188
+ const builtRoots = buildsFromDataChange(dataChange);
189
+ for (const id of builtRoots) {
190
+ // Detached root IDs that are used for builds are only ever used by a single node,
191
+ // so there is no risk of excluding needed refreshers by adding them to the list of already included roots.
192
+ (0, index_js_3.addToNestedSet)(includedRoots, id.major, id.minor);
193
+ }
188
194
  const removedRoots = relevantRemovedRootsFromDataChange(dataChange);
189
195
  if (isFirstDataChange) {
190
196
  isFirstDataChange = false;
191
- return updateDataChangeRefreshers(dataChange, getAndRememberDetachedNode, removedRoots, true);
197
+ return updateDataChangeRefreshers(dataChange, getAndRememberDetachedNode, filterIncludedRoots(removedRoots), true);
192
198
  }
193
199
  else {
194
200
  return updateDataChangeRefreshers(dataChange, getAndRememberDetachedNode, filterIncludedRoots(removedRoots), false);
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeChangeFamily.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAInE,+CAW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CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAlED,4CAkEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type { CodecWriteOptions, ICodecFamily } from \"../codec/index.js\";\nimport {\n\ttype ChangeEncodingContext,\n\ttype ChangeFamily,\n\ttype ChangeRebaser,\n\ttype DeltaDetachedNodeId,\n\ttype EditorOptions,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\ttype RevisionTagCodec,\n\ttype TaggedChange,\n\tmapTaggedChange,\n} from \"../core/index.js\";\nimport {\n\ttype FieldBatchCodec,\n\tModularChangeFamily,\n\ttype ModularChangeset,\n\ttype TreeChunk,\n\ttype TreeCompressionStrategy,\n\tfieldKindConfigurations,\n\tfieldKinds,\n\tmakeModularChangeCodecFamily,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype Mutable,\n\ttype NestedSet,\n\taddToNestedSet,\n\thasSingle,\n\tnestedSetContains,\n} from \"../util/index.js\";\n\nimport { makeSharedTreeChangeCodecFamily } from \"./sharedTreeChangeCodecs.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport { IdBasedSharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\n\n/**\n * Implementation of {@link ChangeFamily} that combines edits to fields and schema changes.\n *\n * @sealed\n */\nexport class SharedTreeChangeFamily\n\timplements\n\t\tChangeFamily<IdBasedSharedTreeEditBuilder, SharedTreeChange>,\n\t\tChangeRebaser<SharedTreeChange>\n{\n\tpublic static readonly emptyChange: SharedTreeChange = {\n\t\tchanges: [],\n\t};\n\n\tpublic readonly codecs: ICodecFamily<SharedTreeChange, ChangeEncodingContext>;\n\tprivate readonly modularChangeFamily: ModularChangeFamily;\n\n\tpublic constructor(\n\t\trevisionTagCodec: RevisionTagCodec,\n\t\tfieldBatchCodec: FieldBatchCodec,\n\t\tcodecOptions: CodecWriteOptions,\n\t\tchunkCompressionStrategy?: TreeCompressionStrategy,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t) {\n\t\tconst modularChangeCodec = makeModularChangeCodecFamily(\n\t\t\tfieldKindConfigurations,\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\tcodecOptions,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t\tthis.modularChangeFamily = new ModularChangeFamily(fieldKinds, modularChangeCodec);\n\t\tthis.codecs = makeSharedTreeChangeCodecFamily(\n\t\t\tthis.modularChangeFamily.codecs,\n\t\t\tcodecOptions,\n\t\t);\n\t}\n\n\tpublic buildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<SharedTreeChange>) => void,\n\t\toptions?: EditorOptions,\n\t): IdBasedSharedTreeEditBuilder {\n\t\treturn new IdBasedSharedTreeEditBuilder(\n\t\t\tthis.modularChangeFamily,\n\t\t\tmintRevisionTag,\n\t\t\tchangeReceiver,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tpublic compose(changes: TaggedChange<SharedTreeChange>[]): SharedTreeChange {\n\t\tconst newChanges: Mutable<SharedTreeChange[\"changes\"]> = [];\n\t\tconst dataChangeRun: TaggedChange<ModularChangeset>[] = [];\n\n\t\tconst flushDataChangeRun = (): void => {\n\t\t\tif (dataChangeRun.length > 0) {\n\t\t\t\tnewChanges.push({\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: this.modularChangeFamily.compose(dataChangeRun),\n\t\t\t\t});\n\t\t\t\tdataChangeRun.length = 0;\n\t\t\t}\n\t\t};\n\n\t\tfor (const topChange of changes) {\n\t\t\tfor (const change of topChange.change.changes) {\n\t\t\t\tif (change.type === \"schema\") {\n\t\t\t\t\tflushDataChangeRun();\n\t\t\t\t\tnewChanges.push(change);\n\t\t\t\t} else {\n\t\t\t\t\tdataChangeRun.push(mapTaggedChange(topChange, change.innerChange));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tflushDataChangeRun();\n\t\treturn { changes: newChanges };\n\t}\n\n\tpublic invert(\n\t\tchange: TaggedChange<SharedTreeChange>,\n\t\tisRollback: boolean,\n\t\trevision: RevisionTag,\n\t): SharedTreeChange {\n\t\tconst invertInnerChange: (\n\t\t\tinnerChange: SharedTreeChange[\"changes\"][number],\n\t\t) => SharedTreeChange[\"changes\"][number] = (innerChange) => {\n\t\t\tswitch (innerChange.type) {\n\t\t\t\tcase \"data\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"data\",\n\t\t\t\t\t\tinnerChange: this.modularChangeFamily.invert(\n\t\t\t\t\t\t\tmapTaggedChange(change, innerChange.innerChange),\n\t\t\t\t\t\t\tisRollback,\n\t\t\t\t\t\t\trevision,\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\tcase \"schema\": {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"schema\",\n\t\t\t\t\t\tinnerChange: {\n\t\t\t\t\t\t\tschema: {\n\t\t\t\t\t\t\t\tnew: innerChange.innerChange.schema.old,\n\t\t\t\t\t\t\t\told: innerChange.innerChange.schema.new,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tisInverse: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tfail(0xacc /* Unknown SharedTree change type. */);\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tchanges: change.change.changes.map(invertInnerChange).reverse(),\n\t\t};\n\t}\n\n\tpublic rebase(\n\t\tchange: TaggedChange<SharedTreeChange>,\n\t\tover: TaggedChange<SharedTreeChange>,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): SharedTreeChange {\n\t\tif (change.change.changes.length === 0 || over.change.changes.length === 0) {\n\t\t\treturn change.change;\n\t\t}\n\n\t\tif (hasSchemaChange(change.change) || hasSchemaChange(over.change)) {\n\t\t\t// Any SharedTreeChange (a list of sub-changes) that contains a schema change will cause ANY change that rebases over it to conflict.\n\t\t\t// Similarly, any SharedTreeChange containing a schema change will fail to rebase over ANY change.\n\t\t\t// Those two combine to mean: no concurrency with schema changes is supported.\n\t\t\t// This is fine because it's an open problem. Example: a tree with an A at the root and a schema that allows an A | B at the root will\n\t\t\t// become out of schema if a schema changes to restrict root types to just A is concurrent with a data change that sets it to a B.\n\t\t\t// We don't have an efficient way to detect this document-wide and there are varying opinions on restricting schema changes to prevent this.\n\t\t\t// A SharedTreeChange containing a schema change will NOT conflict in a non-concurrency case, as the \"meatless sandwich\" optimization\n\t\t\t// will result in rebase never being called.\n\t\t\treturn SharedTreeChangeFamily.emptyChange;\n\t\t}\n\t\tassert(\n\t\t\thasSingle(change.change.changes) && hasSingle(over.change.changes),\n\t\t\t0x884 /* SharedTreeChange should have exactly one inner change if no schema change is present. */,\n\t\t);\n\n\t\tconst dataChangeIntention = change.change.changes[0];\n\t\tconst dataChangeOver = over.change.changes[0];\n\t\tassert(\n\t\t\tdataChangeIntention.type === \"data\" && dataChangeOver.type === \"data\",\n\t\t\t0x885 /* Data change should be present. */,\n\t\t);\n\n\t\treturn {\n\t\t\tchanges: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: this.modularChangeFamily.rebase(\n\t\t\t\t\t\tmapTaggedChange(change, dataChangeIntention.innerChange),\n\t\t\t\t\t\tmapTaggedChange(over, dataChangeOver.innerChange),\n\t\t\t\t\t\trevisionMetadata,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tpublic changeRevision(\n\t\tchange: SharedTreeChange,\n\t\tnewRevision: RevisionTag | undefined,\n\t\trollbackOf?: RevisionTag,\n\t): SharedTreeChange {\n\t\treturn {\n\t\t\tchanges: change.changes.map((inner) => {\n\t\t\t\treturn inner.type === \"data\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...inner,\n\t\t\t\t\t\t\tinnerChange: this.modularChangeFamily.rebaser.changeRevision(\n\t\t\t\t\t\t\t\tinner.innerChange,\n\t\t\t\t\t\t\t\tnewRevision,\n\t\t\t\t\t\t\t\trollbackOf,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t: inner;\n\t\t\t}),\n\t\t};\n\t}\n\n\tpublic get rebaser(): ChangeRebaser<SharedTreeChange> {\n\t\treturn this;\n\t}\n}\n\nexport function hasSchemaChange(change: SharedTreeChange): boolean {\n\treturn change.changes.some((innerChange) => innerChange.type === \"schema\");\n}\n\nfunction mapDataChanges(\n\tchange: SharedTreeChange,\n\tmap: (change: ModularChangeset) => ModularChangeset,\n): SharedTreeChange {\n\treturn {\n\t\tchanges: change.changes.map((dataOrSchemaChange) => {\n\t\t\tif (dataOrSchemaChange.type === \"data\") {\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: map(dataOrSchemaChange.innerChange),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn dataOrSchemaChange;\n\t\t}),\n\t};\n}\n\n/**\n * Produces an equivalent change with an updated set of appropriate refreshers.\n * @param change - The change to compute refreshers for. Not mutated.\n * @param getDetachedNode - retrieves a {@link TreeChunk} for the corresponding detached node id.\n * Is expected to read from a forest in a state that corresponds to the input context of the given change.\n * @returns An equivalent change with an updated set of appropriate refreshers.\n */\nexport function updateRefreshers(\n\tchange: SharedTreeChange,\n\tgetDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined,\n\trelevantRemovedRootsFromDataChange: (\n\t\ttaggedChange: ModularChangeset,\n\t) => Iterable<DeltaDetachedNodeId>,\n\tupdateDataChangeRefreshers: (\n\t\tchange: ModularChangeset,\n\t\tgetDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined,\n\t\tremovedRoots: Iterable<DeltaDetachedNodeId>,\n\t\trequireRefreshers: boolean,\n\t) => ModularChangeset,\n): SharedTreeChange {\n\t// Adding refreshers to a SharedTreeChange is not as simple as adding refreshers to each of its data changes.\n\t// This is because earlier data changes affect the state of the forest in ways that can influence the refreshers\n\t// needed for later data changes. This can happen in two ways:\n\t// 1. By removing a tree that is a relevant root to a later data change.\n\t// 2. By changing the contents of a tree that is a relevant root to a later data change.\n\t// (Note that these two cases can compound)\n\t// Thankfully, in both of these cases, refreshers can be omitted from the later data changes because the forest\n\t// applying those data changes is guaranteed to still have have the relevant trees in memory.\n\t// This means that for the first data change, all required refreshers should be added (and none should be missing).\n\t// While for later data changes, we should not include refreshers that either:\n\t// A) were already included in the earlier data changes\n\t// B) correspond to trees that were removed by earlier data changes\n\t// Set A is excluded by tracking which roots have already been included in the earlier data changes, and filtering\n\t// them out from the relevant removed roots.\n\t// Set B is excluded because the `getDetachedNode` is bound to return `undefined` for them, which tell\n\t// `defaultUpdateRefreshers` to ignore. One downside of this approach is that it prevents `defaultUpdateRefreshers`\n\t// from detecting cases where a detached node is missing for another reason (which would be a bug).\n\n\t// The roots that have been included as refreshers across all data changes so far.\n\tconst includedRoots: NestedSet<RevisionTag | undefined, number> = new Map();\n\tfunction getAndRememberDetachedNode(id: DeltaDetachedNodeId): TreeChunk | undefined {\n\t\taddToNestedSet(includedRoots, id.major, id.minor);\n\t\treturn getDetachedNode(id);\n\t}\n\tfunction* filterIncludedRoots(\n\t\ttoFilter: Iterable<DeltaDetachedNodeId>,\n\t): Iterable<DeltaDetachedNodeId> {\n\t\tfor (const id of toFilter) {\n\t\t\tif (!nestedSetContains(includedRoots, id.major, id.minor)) {\n\t\t\t\tyield id;\n\t\t\t}\n\t\t}\n\t}\n\tlet isFirstDataChange = true;\n\treturn mapDataChanges(change, (dataChange) => {\n\t\tconst removedRoots = relevantRemovedRootsFromDataChange(dataChange);\n\t\tif (isFirstDataChange) {\n\t\t\tisFirstDataChange = false;\n\t\t\treturn updateDataChangeRefreshers(\n\t\t\t\tdataChange,\n\t\t\t\tgetAndRememberDetachedNode,\n\t\t\t\tremovedRoots,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t} else {\n\t\t\treturn updateDataChangeRefreshers(\n\t\t\t\tdataChange,\n\t\t\t\tgetAndRememberDetachedNode,\n\t\t\t\tfilterIncludedRoots(removedRoots),\n\t\t\t\tfalse,\n\t\t\t);\n\t\t}\n\t});\n}\n"]}
1
+ {"version":3,"file":"sharedTreeChangeFamily.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAInE,+CAW0B;AAC1B,4DASuC;AACvC,+CAM0B;AAE1B,2EAA8E;AAE9E,yEAA0E;AAE1E;;;;GAIG;AACH,MAAa,sBAAsB;IAYlC,YACC,gBAAkC,EAClC,eAAgC,EAChC,YAA+B,EAC/B,wBAAkD,EACjC,YAA4B;QAA5B,iBAAY,GAAZ,YAAY,CAAgB;QAE7C,MAAM,kBAAkB,GAAG,IAAA,uCAA4B,EACtD,kCAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,wBAAwB,CACxB,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,IAAI,8BAAmB,CAAC,qBAAU,EAAE,kBAAkB,CAAC,CAAC;QACnF,IAAI,CAAC,MAAM,GAAG,IAAA,2DAA+B,EAC5C,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAC/B,YAAY,CACZ,CAAC;IACH,CAAC;IAEM,WAAW,CACjB,eAAkC,EAClC,cAAgE,EAChE,OAAuB;QAEvB,OAAO,IAAI,uDAA4B,CACtC,IAAI,CAAC,mBAAmB,EACxB,eAAe,EACf,cAAc,EACd,OAAO,CACP,CAAC;IACH,CAAC;IAEM,OAAO,CAAC,OAAyC;QACvD,MAAM,UAAU,GAAyC,EAAE,CAAC;QAC5D,MAAM,aAAa,GAAqC,EAAE,CAAC;QAE3D,MAAM,kBAAkB,GAAG,GAAS,EAAE;YACrC,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9B,UAAU,C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E;QAC5C,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACpD,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;YAC7B,kFAAkF;YAClF,2GAA2G;YAC3G,IAAA,yBAAc,EAAC,aAAa,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC;QACD,MAAM,YAAY,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC;QACpE,IAAI,iBAAiB,EAAE,CAAC;YACvB,iBAAiB,GAAG,KAAK,CAAC;YAC1B,OAAO,0BAA0B,CAChC,UAAU,EACV,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CAAC,EACjC,IAAI,CACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACP,OAAO,0BAA0B,CAChC,UAAU,EACV,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CAAC,EACjC,KAAK,CACL,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAzED,4CAyEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type { CodecWriteOptions, ICodecFamily } from \"../codec/index.js\";\nimport {\n\ttype ChangeEncodingContext,\n\ttype ChangeFamily,\n\ttype ChangeRebaser,\n\ttype DeltaDetachedNodeId,\n\ttype EditorOptions,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\ttype RevisionTagCodec,\n\ttype TaggedChange,\n\tmapTaggedChange,\n} from \"../core/index.js\";\nimport {\n\ttype FieldBatchCodec,\n\tModularChangeFamily,\n\ttype ModularChangeset,\n\ttype TreeChunk,\n\ttype TreeCompressionStrategy,\n\tfieldKindConfigurations,\n\tfieldKinds,\n\tmakeModularChangeCodecFamily,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype Mutable,\n\ttype NestedSet,\n\taddToNestedSet,\n\thasSingle,\n\tnestedSetContains,\n} from \"../util/index.js\";\n\nimport { makeSharedTreeChangeCodecFamily } from \"./sharedTreeChangeCodecs.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport { IdBasedSharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\n\n/**\n * Implementation of {@link ChangeFamily} that combines edits to fields and schema changes.\n *\n * @sealed\n */\nexport class SharedTreeChangeFamily\n\timplements\n\t\tChangeFamily<IdBasedSharedTreeEditBuilder, SharedTreeChange>,\n\t\tChangeRebaser<SharedTreeChange>\n{\n\tpublic static readonly emptyChange: SharedTreeChange = {\n\t\tchanges: [],\n\t};\n\n\tpublic readonly codecs: ICodecFamily<SharedTreeChange, ChangeEncodingContext>;\n\tprivate readonly modularChangeFamily: ModularChangeFamily;\n\n\tpublic constructor(\n\t\trevisionTagCodec: RevisionTagCodec,\n\t\tfieldBatchCodec: FieldBatchCodec,\n\t\tcodecOptions: CodecWriteOptions,\n\t\tchunkCompressionStrategy?: TreeCompressionStrategy,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t) {\n\t\tconst modularChangeCodec = makeModularChangeCodecFamily(\n\t\t\tfieldKindConfigurations,\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\tcodecOptions,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t\tthis.modularChangeFamily = new ModularChangeFamily(fieldKinds, modularChangeCodec);\n\t\tthis.codecs = makeSharedTreeChangeCodecFamily(\n\t\t\tthis.modularChangeFamily.codecs,\n\t\t\tcodecOptions,\n\t\t);\n\t}\n\n\tpublic buildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<SharedTreeChange>) => void,\n\t\toptions?: EditorOptions,\n\t): IdBasedSharedTreeEditBuilder {\n\t\treturn new IdBasedSharedTreeEditBuilder(\n\t\t\tthis.modularChangeFamily,\n\t\t\tmintRevisionTag,\n\t\t\tchangeReceiver,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tpublic compose(changes: TaggedChange<SharedTreeChange>[]): SharedTreeChange {\n\t\tconst newChanges: Mutable<SharedTreeChange[\"changes\"]> = [];\n\t\tconst dataChangeRun: TaggedChange<ModularChangeset>[] = [];\n\n\t\tconst flushDataChangeRun = (): void => {\n\t\t\tif (dataChangeRun.length > 0) {\n\t\t\t\tnewChanges.push({\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: this.modularChangeFamily.compose(dataChangeRun),\n\t\t\t\t});\n\t\t\t\tdataChangeRun.length = 0;\n\t\t\t}\n\t\t};\n\n\t\tfor (const topChange of changes) {\n\t\t\tfor (const change of topChange.change.changes) {\n\t\t\t\tif (change.type === \"schema\") {\n\t\t\t\t\tflushDataChangeRun();\n\t\t\t\t\tnewChanges.push(change);\n\t\t\t\t} else {\n\t\t\t\t\tdataChangeRun.push(mapTaggedChange(topChange, change.innerChange));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tflushDataChangeRun();\n\t\treturn { changes: newChanges };\n\t}\n\n\tpublic invert(\n\t\tchange: TaggedChange<SharedTreeChange>,\n\t\tisRollback: boolean,\n\t\trevision: RevisionTag,\n\t): SharedTreeChange {\n\t\tconst invertInnerChange: (\n\t\t\tinnerChange: SharedTreeChange[\"changes\"][number],\n\t\t) => SharedTreeChange[\"changes\"][number] = (innerChange) => {\n\t\t\tswitch (innerChange.type) {\n\t\t\t\tcase \"data\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"data\",\n\t\t\t\t\t\tinnerChange: this.modularChangeFamily.invert(\n\t\t\t\t\t\t\tmapTaggedChange(change, innerChange.innerChange),\n\t\t\t\t\t\t\tisRollback,\n\t\t\t\t\t\t\trevision,\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\tcase \"schema\": {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"schema\",\n\t\t\t\t\t\tinnerChange: {\n\t\t\t\t\t\t\tschema: {\n\t\t\t\t\t\t\t\tnew: innerChange.innerChange.schema.old,\n\t\t\t\t\t\t\t\told: innerChange.innerChange.schema.new,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tisInverse: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tfail(0xacc /* Unknown SharedTree change type. */);\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tchanges: change.change.changes.map(invertInnerChange).reverse(),\n\t\t};\n\t}\n\n\tpublic rebase(\n\t\tchange: TaggedChange<SharedTreeChange>,\n\t\tover: TaggedChange<SharedTreeChange>,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): SharedTreeChange {\n\t\tif (change.change.changes.length === 0 || over.change.changes.length === 0) {\n\t\t\treturn change.change;\n\t\t}\n\n\t\tif (hasSchemaChange(change.change) || hasSchemaChange(over.change)) {\n\t\t\t// Any SharedTreeChange (a list of sub-changes) that contains a schema change will cause ANY change that rebases over it to conflict.\n\t\t\t// Similarly, any SharedTreeChange containing a schema change will fail to rebase over ANY change.\n\t\t\t// Those two combine to mean: no concurrency with schema changes is supported.\n\t\t\t// This is fine because it's an open problem. Example: a tree with an A at the root and a schema that allows an A | B at the root will\n\t\t\t// become out of schema if a schema changes to restrict root types to just A is concurrent with a data change that sets it to a B.\n\t\t\t// We don't have an efficient way to detect this document-wide and there are varying opinions on restricting schema changes to prevent this.\n\t\t\t// A SharedTreeChange containing a schema change will NOT conflict in a non-concurrency case, as the \"meatless sandwich\" optimization\n\t\t\t// will result in rebase never being called.\n\t\t\treturn SharedTreeChangeFamily.emptyChange;\n\t\t}\n\t\tassert(\n\t\t\thasSingle(change.change.changes) && hasSingle(over.change.changes),\n\t\t\t0x884 /* SharedTreeChange should have exactly one inner change if no schema change is present. */,\n\t\t);\n\n\t\tconst dataChangeIntention = change.change.changes[0];\n\t\tconst dataChangeOver = over.change.changes[0];\n\t\tassert(\n\t\t\tdataChangeIntention.type === \"data\" && dataChangeOver.type === \"data\",\n\t\t\t0x885 /* Data change should be present. */,\n\t\t);\n\n\t\treturn {\n\t\t\tchanges: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: this.modularChangeFamily.rebase(\n\t\t\t\t\t\tmapTaggedChange(change, dataChangeIntention.innerChange),\n\t\t\t\t\t\tmapTaggedChange(over, dataChangeOver.innerChange),\n\t\t\t\t\t\trevisionMetadata,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tpublic changeRevision(\n\t\tchange: SharedTreeChange,\n\t\tnewRevision: RevisionTag | undefined,\n\t\trollbackOf?: RevisionTag,\n\t): SharedTreeChange {\n\t\treturn {\n\t\t\tchanges: change.changes.map((inner) => {\n\t\t\t\treturn inner.type === \"data\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...inner,\n\t\t\t\t\t\t\tinnerChange: this.modularChangeFamily.rebaser.changeRevision(\n\t\t\t\t\t\t\t\tinner.innerChange,\n\t\t\t\t\t\t\t\tnewRevision,\n\t\t\t\t\t\t\t\trollbackOf,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t: inner;\n\t\t\t}),\n\t\t};\n\t}\n\n\tpublic get rebaser(): ChangeRebaser<SharedTreeChange> {\n\t\treturn this;\n\t}\n}\n\nexport function hasSchemaChange(change: SharedTreeChange): boolean {\n\treturn change.changes.some((innerChange) => innerChange.type === \"schema\");\n}\n\nfunction mapDataChanges(\n\tchange: SharedTreeChange,\n\tmap: (change: ModularChangeset) => ModularChangeset,\n): SharedTreeChange {\n\treturn {\n\t\tchanges: change.changes.map((dataOrSchemaChange) => {\n\t\t\tif (dataOrSchemaChange.type === \"data\") {\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: map(dataOrSchemaChange.innerChange),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn dataOrSchemaChange;\n\t\t}),\n\t};\n}\n\n/**\n * Produces an equivalent change with an updated set of appropriate refreshers.\n * @param change - The change to compute refreshers for. Not mutated.\n * @param getDetachedNode - retrieves a {@link TreeChunk} for the corresponding detached node id.\n * Is expected to read from a forest in a state that corresponds to the input context of the given change.\n * @returns An equivalent change with an updated set of appropriate refreshers.\n */\nexport function updateRefreshers(\n\tchange: SharedTreeChange,\n\tbuildsFromDataChange: (taggedChange: ModularChangeset) => Iterable<DeltaDetachedNodeId>,\n\tgetDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined,\n\trelevantRemovedRootsFromDataChange: (\n\t\ttaggedChange: ModularChangeset,\n\t) => Iterable<DeltaDetachedNodeId>,\n\tupdateDataChangeRefreshers: (\n\t\tchange: ModularChangeset,\n\t\tgetDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined,\n\t\tremovedRoots: Iterable<DeltaDetachedNodeId>,\n\t\trequireRefreshers: boolean,\n\t) => ModularChangeset,\n): SharedTreeChange {\n\t// Adding refreshers to a SharedTreeChange is not as simple as adding refreshers to each of its data changes.\n\t// This is because earlier data changes affect the state of the forest in ways that can influence the refreshers\n\t// needed for later data changes. This can happen in two ways:\n\t// 1. By removing a tree that is a relevant root to a later data change.\n\t// 2. By changing the contents of a tree that is a relevant root to a later data change.\n\t// (Note that these two cases can compound)\n\t// Thankfully, in both of these cases, refreshers can be omitted from the later data changes because the forest\n\t// applying those data changes is guaranteed to still have have the relevant trees in memory.\n\t// This means that for the first data change, all required refreshers should be added (and none should be missing).\n\t// While for later data changes, we should not include refreshers that either:\n\t// A) were already included in the earlier data changes\n\t// B) correspond to trees that were removed by earlier data changes\n\t// Set A is excluded by tracking which roots have already been included in the earlier data changes, and filtering\n\t// them out from the relevant removed roots.\n\t// Set B is excluded because the `getDetachedNode` is bound to return `undefined` for them, which tell\n\t// `defaultUpdateRefreshers` to ignore. One downside of this approach is that it prevents `defaultUpdateRefreshers`\n\t// from detecting cases where a detached node is missing for another reason (which would be a bug).\n\n\t// The roots that have been included as refreshers across all data changes so far.\n\tconst includedRoots: NestedSet<RevisionTag | undefined, number> = new Map();\n\tfunction getAndRememberDetachedNode(id: DeltaDetachedNodeId): TreeChunk | undefined {\n\t\taddToNestedSet(includedRoots, id.major, id.minor);\n\t\treturn getDetachedNode(id);\n\t}\n\tfunction* filterIncludedRoots(\n\t\ttoFilter: Iterable<DeltaDetachedNodeId>,\n\t): Iterable<DeltaDetachedNodeId> {\n\t\tfor (const id of toFilter) {\n\t\t\tif (!nestedSetContains(includedRoots, id.major, id.minor)) {\n\t\t\t\tyield id;\n\t\t\t}\n\t\t}\n\t}\n\tlet isFirstDataChange = true;\n\treturn mapDataChanges(change, (dataChange) => {\n\t\tconst builtRoots = buildsFromDataChange(dataChange);\n\t\tfor (const id of builtRoots) {\n\t\t\t// Detached root IDs that are used for builds are only ever used by a single node,\n\t\t\t// so there is no risk of excluding needed refreshers by adding them to the list of already included roots.\n\t\t\taddToNestedSet(includedRoots, id.major, id.minor);\n\t\t}\n\t\tconst removedRoots = relevantRemovedRootsFromDataChange(dataChange);\n\t\tif (isFirstDataChange) {\n\t\t\tisFirstDataChange = false;\n\t\t\treturn updateDataChangeRefreshers(\n\t\t\t\tdataChange,\n\t\t\t\tgetAndRememberDetachedNode,\n\t\t\t\tfilterIncludedRoots(removedRoots),\n\t\t\t\ttrue,\n\t\t\t);\n\t\t} else {\n\t\t\treturn updateDataChangeRefreshers(\n\t\t\t\tdataChange,\n\t\t\t\tgetAndRememberDetachedNode,\n\t\t\t\tfilterIncludedRoots(removedRoots),\n\t\t\t\tfalse,\n\t\t\t);\n\t\t}\n\t});\n}\n"]}
@@ -19,7 +19,7 @@ class IdBasedSharedTreeEditBuilder extends index_js_1.DefaultIdBasedDataEditor {
19
19
  this.changeReceiver = changeReceiver;
20
20
  this.schema = {
21
21
  setStoredSchema: (oldSchema, newSchema) => {
22
- this.changeReceiver({
22
+ changeReceiver({
23
23
  revision: mintRevisionTag(),
24
24
  change: {
25
25
  changes: [
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeEditBuilder.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeEditBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,4DASuC;AAoCvC;;;GAGG;AACH,MAAa,4BACZ,SAAQ,mCAAwB;IAKhC,YACC,mBAAwC,EACxC,eAAkC,EACjB,cAAgE,EACjF,OAAuB;QAEvB,KAAK,CACJ,mBAAmB,EACnB,eAAe,EACf,CAAC,YAAY,EAAE,EAAE,CAChB,cAAc,CAAC;YACd,GAAG,YAAY;YACf,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE;SACzE,CAAC,EACH,OAAO,CACP,CAAC;QAZe,mBAAc,GAAd,cAAc,CAAkD;QAcjF,IAAI,CAAC,MAAM,GAAG;YACb,eAAe,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;gBACzC,IAAI,CAAC,cAAc,CAAC;oBACnB,QAAQ,EAAE,eAAe,EAAE;oBAC3B,MAAM,EAAE;wBACP,OAAO,EAAE;4BACR;gCACC,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE;oCACZ,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE;oCAC1C,SAAS,EAAE,KAAK;iCAChB;6BACD;yBACD;qBACD;iBACD,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;CACD;AA1CD,oEA0CC;AAED,MAAa,kCACZ,SAAQ,kCAAuB;IAK/B,YAAmB,aAAuC,EAAE,OAAgB;QAC3E,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;IACpC,CAAC;CACD;AAVD,gFAUC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeAtomId,\n\tChangeFamilyEditor,\n\tEditorOptions,\n\tRevisionTag,\n\tTaggedChange,\n\tTreeChunk,\n\tTreeStoredSchema,\n} from \"../core/index.js\";\nimport {\n\tDefaultIdBasedDataEditor,\n\tLocationBasedDataEditor,\n\ttype DetachedRootIds,\n\ttype DetachedRootLocation,\n\ttype DetachedRootsLocation,\n\ttype Locator,\n\ttype DataEditor,\n\ttype ModularChangeFamily,\n} from \"../feature-libraries/index.js\";\n\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\n\n/**\n * Editor for schema changes.\n * The only currently supported operation is to replace the stored schema.\n */\nexport interface ISchemaEditor {\n\t/**\n\t * Updates the stored schema.\n\t * @param oldSchema - The schema being overwritten.\n\t * @param newSchema - The new schema to apply.\n\t */\n\tsetStoredSchema(oldSchema: TreeStoredSchema, newSchema: TreeStoredSchema): void;\n}\n\n/**\n * SharedTree editor for transactional tree data and schema changes.\n */\nexport interface IIdBasedSharedTreeEditor\n\textends DataEditor<TreeChunk, ChangeAtomId, DetachedRootIds> {\n\t/**\n\t * Editor for schema changes.\n\t */\n\tschema: ISchemaEditor;\n}\n\nexport interface ILocationBasedSharedTreeEditor\n\textends DataEditor<TreeChunk, DetachedRootLocation, DetachedRootsLocation> {\n\t/**\n\t * Editor for schema changes.\n\t */\n\tschema: ISchemaEditor;\n}\n\n/**\n * Implementation of {@link DataEditor} based on the default set of supported field kinds.\n * @sealed\n */\nexport class IdBasedSharedTreeEditBuilder\n\textends DefaultIdBasedDataEditor\n\timplements ChangeFamilyEditor, IIdBasedSharedTreeEditor\n{\n\tpublic readonly schema: ISchemaEditor;\n\n\tpublic constructor(\n\t\tmodularChangeFamily: ModularChangeFamily,\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tprivate readonly changeReceiver: (change: TaggedChange<SharedTreeChange>) => void,\n\t\toptions?: EditorOptions,\n\t) {\n\t\tsuper(\n\t\t\tmodularChangeFamily,\n\t\t\tmintRevisionTag,\n\t\t\t(taggedChange) =>\n\t\t\t\tchangeReceiver({\n\t\t\t\t\t...taggedChange,\n\t\t\t\t\tchange: { changes: [{ type: \"data\", innerChange: taggedChange.change }] },\n\t\t\t\t}),\n\t\t\toptions,\n\t\t);\n\n\t\tthis.schema = {\n\t\t\tsetStoredSchema: (oldSchema, newSchema) => {\n\t\t\t\tthis.changeReceiver({\n\t\t\t\t\trevision: mintRevisionTag(),\n\t\t\t\t\tchange: {\n\t\t\t\t\t\tchanges: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: \"schema\",\n\t\t\t\t\t\t\t\tinnerChange: {\n\t\t\t\t\t\t\t\t\tschema: { new: newSchema, old: oldSchema },\n\t\t\t\t\t\t\t\t\tisInverse: false,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport class LocationBasedSharedTreeEditBuilder\n\textends LocationBasedDataEditor\n\timplements ILocationBasedSharedTreeEditor\n{\n\tpublic readonly schema: ISchemaEditor;\n\n\tpublic constructor(idBasedEditor: IIdBasedSharedTreeEditor, locator: Locator) {\n\t\tsuper(idBasedEditor, locator);\n\t\tthis.schema = idBasedEditor.schema;\n\t}\n}\n"]}
1
+ {"version":3,"file":"sharedTreeEditBuilder.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeEditBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,4DASuC;AAoCvC;;;GAGG;AACH,MAAa,4BACZ,SAAQ,mCAAwB;IAKhC,YACC,mBAAwC,EACxC,eAAkC,EACjB,cAAgE,EACjF,OAAuB;QAEvB,KAAK,CACJ,mBAAmB,EACnB,eAAe,EACf,CAAC,YAAY,EAAE,EAAE,CAChB,cAAc,CAAC;YACd,GAAG,YAAY;YACf,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE;SACzE,CAAC,EACH,OAAO,CACP,CAAC;QAZe,mBAAc,GAAd,cAAc,CAAkD;QAcjF,IAAI,CAAC,MAAM,GAAG;YACb,eAAe,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;gBACzC,cAAc,CAAC;oBACd,QAAQ,EAAE,eAAe,EAAE;oBAC3B,MAAM,EAAE;wBACP,OAAO,EAAE;4BACR;gCACC,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE;oCACZ,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE;oCAC1C,SAAS,EAAE,KAAK;iCAChB;6BACD;yBACD;qBACD;iBACD,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;CACD;AA1CD,oEA0CC;AAED,MAAa,kCACZ,SAAQ,kCAAuB;IAK/B,YAAmB,aAAuC,EAAE,OAAgB;QAC3E,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;IACpC,CAAC;CACD;AAVD,gFAUC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeAtomId,\n\tChangeFamilyEditor,\n\tEditorOptions,\n\tRevisionTag,\n\tTaggedChange,\n\tTreeChunk,\n\tTreeStoredSchema,\n} from \"../core/index.js\";\nimport {\n\tDefaultIdBasedDataEditor,\n\tLocationBasedDataEditor,\n\ttype DetachedRootIds,\n\ttype DetachedRootLocation,\n\ttype DetachedRootsLocation,\n\ttype Locator,\n\ttype DataEditor,\n\ttype ModularChangeFamily,\n} from \"../feature-libraries/index.js\";\n\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\n\n/**\n * Editor for schema changes.\n * The only currently supported operation is to replace the stored schema.\n */\nexport interface ISchemaEditor {\n\t/**\n\t * Updates the stored schema.\n\t * @param oldSchema - The schema being overwritten.\n\t * @param newSchema - The new schema to apply.\n\t */\n\tsetStoredSchema(oldSchema: TreeStoredSchema, newSchema: TreeStoredSchema): void;\n}\n\n/**\n * SharedTree editor for transactional tree data and schema changes.\n */\nexport interface IIdBasedSharedTreeEditor\n\textends DataEditor<TreeChunk, ChangeAtomId, DetachedRootIds> {\n\t/**\n\t * Editor for schema changes.\n\t */\n\tschema: ISchemaEditor;\n}\n\nexport interface ILocationBasedSharedTreeEditor\n\textends DataEditor<TreeChunk, DetachedRootLocation, DetachedRootsLocation> {\n\t/**\n\t * Editor for schema changes.\n\t */\n\tschema: ISchemaEditor;\n}\n\n/**\n * Implementation of {@link DataEditor} based on the default set of supported field kinds.\n * @sealed\n */\nexport class IdBasedSharedTreeEditBuilder\n\textends DefaultIdBasedDataEditor\n\timplements ChangeFamilyEditor, IIdBasedSharedTreeEditor\n{\n\tpublic readonly schema: ISchemaEditor;\n\n\tpublic constructor(\n\t\tmodularChangeFamily: ModularChangeFamily,\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tprivate readonly changeReceiver: (change: TaggedChange<SharedTreeChange>) => void,\n\t\toptions?: EditorOptions,\n\t) {\n\t\tsuper(\n\t\t\tmodularChangeFamily,\n\t\t\tmintRevisionTag,\n\t\t\t(taggedChange) =>\n\t\t\t\tchangeReceiver({\n\t\t\t\t\t...taggedChange,\n\t\t\t\t\tchange: { changes: [{ type: \"data\", innerChange: taggedChange.change }] },\n\t\t\t\t}),\n\t\t\toptions,\n\t\t);\n\n\t\tthis.schema = {\n\t\t\tsetStoredSchema: (oldSchema, newSchema) => {\n\t\t\t\tchangeReceiver({\n\t\t\t\t\trevision: mintRevisionTag(),\n\t\t\t\t\tchange: {\n\t\t\t\t\t\tchanges: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: \"schema\",\n\t\t\t\t\t\t\t\tinnerChange: {\n\t\t\t\t\t\t\t\t\tschema: { new: newSchema, old: oldSchema },\n\t\t\t\t\t\t\t\t\tisInverse: false,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport class LocationBasedSharedTreeEditBuilder\n\textends LocationBasedDataEditor\n\timplements ILocationBasedSharedTreeEditor\n{\n\tpublic readonly schema: ISchemaEditor;\n\n\tpublic constructor(idBasedEditor: IIdBasedSharedTreeEditor, locator: Locator) {\n\t\tsuper(idBasedEditor, locator);\n\t\tthis.schema = idBasedEditor.schema;\n\t}\n}\n"]}
@@ -37,6 +37,7 @@ export declare function intoDelta(taggedChange: TaggedChange<ModularChangeset>):
37
37
  * @param change - The change to be applied.
38
38
  */
39
39
  export declare function relevantRemovedRoots(change: ModularChangeset): Iterable<DeltaDetachedNodeId>;
40
+ export declare function getBuildsIds(change: ModularChangeset): Iterable<DeltaDetachedNodeId>;
40
41
  export type DetachedRootIds = readonly DetachedRootIdRange[];
41
42
  export interface DetachedRootIdRange {
42
43
  readonly first: ChangeAtomId;
@@ -1 +1 @@
1
- {"version":3,"file":"defaultEditBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EAMd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAMN,KAA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E,cAAc,EAAE,QAAQ,GAAG,IAAI;IAC7E;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,GAAG,IAAI,CAAC;IAE7D;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;IAElD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/C"}
1
+ {"version":3,"file":"defaultEditBuilder.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EAMd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAMN,KAAK,gBAAgB,EAKrB,MAAM,4BAA4B,CAAC;AAUpC,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,mBACZ,YAAW,YAAY,CAAC,6BAA6B,EAAE,gBAAgB,CAAC;IAExE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsB;gBAEjC,MAAM,EAAE,YAAY,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;IAIhF,IAAW,OAAO,IAAI,aAAa,CAAC,gBAAgB,CAAC,CAEpD;IAED,IAAW,MAAM,IAAI,YAAY,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAEz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C;CAC/C"}
@@ -6,7 +6,7 @@ import { assert, oob } from "@fluidframework/core-utils/internal";
6
6
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
7
7
  import { compareFieldUpPaths, getDetachedFieldContainingFieldPath, rootField, topDownPath, } from "../../core/index.js";
8
8
  import { brand, RangeMap } from "../../util/index.js";
9
- import { ModularChangeFamily, ModularEditBuilder, intoDelta as intoModularDelta, relevantRemovedRoots as relevantModularRemovedRoots, } from "../modular-schema/index.js";
9
+ import { ModularChangeFamily, ModularEditBuilder, intoDelta as intoModularDelta, relevantRemovedRoots as relevantModularRemovedRoots, getBuildIds as getModularBuildIds, } from "../modular-schema/index.js";
10
10
  import { fieldKinds, optional, sequence, required as valueFieldKind, } from "./defaultFieldKinds.js";
11
11
  /**
12
12
  * Implementation of {@link ChangeFamily} based on the default set of supported field kinds.
@@ -50,6 +50,9 @@ export function intoDelta(taggedChange) {
50
50
  export function relevantRemovedRoots(change) {
51
51
  return relevantModularRemovedRoots(change, fieldKinds);
52
52
  }
53
+ export function getBuildsIds(change) {
54
+ return getModularBuildIds(change);
55
+ }
53
56
  export function offsetChangesetLocalId(id, offset) {
54
57
  return brand(id + offset);
55
58
  }