@fluidframework/tree 2.40.0 → 2.41.0-338186
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/api-report/tree.alpha.api.md +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +0 -7
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +16 -14
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +12 -18
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -2
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +1 -5
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +2 -16
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +6 -6
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +6 -7
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +1 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +7 -3
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.js +11 -2
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +1 -1
- package/dist/shared-tree/schematizeTree.js +1 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +3 -0
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +13 -7
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +1 -4
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +6 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +5 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +10 -11
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +1 -8
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +3 -14
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +3 -9
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +4 -4
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +9 -5
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +6 -4
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +17 -20
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +2 -4
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +30 -0
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -0
- package/dist/simple-tree/prepareForInsertion.js +137 -0
- package/dist/simple-tree/prepareForInsertion.js.map +1 -0
- package/dist/simple-tree/proxies.d.ts +1 -12
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +10 -106
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +1 -1
- package/dist/simple-tree/toMapTree.js +1 -1
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/tableSchema.d.ts +108 -59
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +93 -44
- package/dist/tableSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +0 -7
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +16 -14
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +11 -16
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +1 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +1 -5
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +1 -14
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +6 -6
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +6 -7
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +7 -3
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.js +12 -3
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +1 -1
- package/lib/shared-tree/schematizeTree.js +1 -1
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +3 -0
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +14 -8
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +1 -4
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +7 -2
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +5 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +8 -10
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -2
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +1 -8
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +2 -12
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +4 -10
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +4 -4
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +9 -5
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +3 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +3 -6
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +4 -6
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +30 -0
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -0
- package/lib/simple-tree/prepareForInsertion.js +131 -0
- package/lib/simple-tree/prepareForInsertion.js.map +1 -0
- package/lib/simple-tree/proxies.d.ts +1 -12
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +1 -96
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +1 -1
- package/lib/simple-tree/toMapTree.js +1 -1
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/tableSchema.d.ts +108 -59
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +94 -45
- package/lib/tableSchema.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +25 -25
- package/src/feature-libraries/default-schema/schemaChecker.ts +0 -8
- package/src/feature-libraries/flex-tree/context.ts +18 -20
- package/src/feature-libraries/flex-tree/index.ts +0 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +2 -14
- package/src/feature-libraries/flex-tree/utilities.ts +8 -8
- package/src/feature-libraries/index.ts +0 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +10 -6
- package/src/shared-tree/schematizeTree.ts +1 -1
- package/src/shared-tree/schematizingTreeView.ts +14 -14
- package/src/shared-tree/treeAlpha.ts +21 -5
- package/src/simple-tree/api/create.ts +15 -15
- package/src/simple-tree/api/index.ts +6 -2
- package/src/simple-tree/api/storedSchema.ts +2 -19
- package/src/simple-tree/arrayNode.ts +9 -20
- package/src/simple-tree/core/unhydratedFlexTree.ts +10 -5
- package/src/simple-tree/index.ts +6 -5
- package/src/simple-tree/mapNode.ts +8 -12
- package/src/simple-tree/objectNode.ts +3 -12
- package/src/simple-tree/prepareForInsertion.ts +236 -0
- package/src/simple-tree/proxies.ts +2 -147
- package/src/simple-tree/toMapTree.ts +1 -1
- package/src/tableSchema.ts +310 -158
|
@@ -108,7 +108,7 @@ export interface CommitMetadata {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
// @alpha
|
|
111
|
-
export function comparePersistedSchema(persisted: JsonCompatible, view: ImplicitFieldSchema, options: ICodecOptions
|
|
111
|
+
export function comparePersistedSchema(persisted: JsonCompatible, view: ImplicitFieldSchema, options: ICodecOptions): Omit<SchemaCompatibilityStatus, "canInitialize">;
|
|
112
112
|
|
|
113
113
|
// @alpha
|
|
114
114
|
export type ConciseTree<THandle = IFluidHandle> = Exclude<TreeLeafValue, IFluidHandle> | THandle | ConciseTree<THandle>[] | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaChecker.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/schemaChecker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAI1B,YAAY,EACZ,KAAK,eAAe,EACpB,MAAM,qBAAqB,CAAC;AAG7B,0BAAkB,sBAAsB;IACvC,OAAO,IAAA;IACP,2BAA2B,IAAA;IAC3B,2BAA2B,IAAA;IAC3B,wBAAwB,IAAA;IACxB,qBAAqB,IAAA;IACrB,yBAAyB,IAAA;IACzB,2BAA2B,IAAA;IAC3B,2BAA2B,IAAA;IAC3B,kBAAkB,IAAA;IAClB,YAAY,IAAA;CACZ;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,OAAO,EACb,eAAe,EAAE,eAAe,GAC9B,sBAAsB,
|
|
1
|
+
{"version":3,"file":"schemaChecker.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/schemaChecker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAI1B,YAAY,EACZ,KAAK,eAAe,EACpB,MAAM,qBAAqB,CAAC;AAG7B,0BAAkB,sBAAsB;IACvC,OAAO,IAAA;IACP,2BAA2B,IAAA;IAC3B,2BAA2B,IAAA;IAC3B,wBAAwB,IAAA;IACxB,qBAAqB,IAAA;IACrB,yBAAyB,IAAA;IACzB,2BAA2B,IAAA;IAC3B,2BAA2B,IAAA;IAC3B,kBAAkB,IAAA;IAClB,YAAY,IAAA;CACZ;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,OAAO,EACb,eAAe,EAAE,eAAe,GAC9B,sBAAsB,CAmDxB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,UAAU,EAAE,SAAS,OAAO,EAAE,EAC9B,MAAM,EAAE,qBAAqB,EAC7B,eAAe,EAAE,eAAe,GAC9B,sBAAsB,CA0BxB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACvC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,YAAY,GACxB,OAAO,CAaT"}
|
|
@@ -25,13 +25,6 @@ var SchemaValidationErrors;
|
|
|
25
25
|
* Deeply checks that the provided node complies with the schema based on its identifier.
|
|
26
26
|
*/
|
|
27
27
|
function isNodeInSchema(node, schemaAndPolicy) {
|
|
28
|
-
// If the stored schema is completely empty it _probably_ (in almost all cases?) means the tree is brand new and we
|
|
29
|
-
// shouldn't validate the data.
|
|
30
|
-
// TODO: AB#8197
|
|
31
|
-
// See https://github.com/microsoft/FluidFramework/pull/21305#discussion_r1626595991 for further discussion.
|
|
32
|
-
if (schemaAndPolicy.schema.nodeSchema.size === 0) {
|
|
33
|
-
return 0 /* SchemaValidationErrors.NoError */;
|
|
34
|
-
}
|
|
35
28
|
// Validate the schema declared by the node exists
|
|
36
29
|
const schema = schemaAndPolicy.schema.nodeSchema.get(node.type);
|
|
37
30
|
if (schema === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaChecker.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/schemaChecker.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA4E;AAC5E,kDAQ6B;AAC7B,4DAAmD;AAEnD,IAAkB,sBAWjB;AAXD,WAAkB,sBAAsB;IACvC,yEAAO,CAAA;IACP,iHAA2B,CAAA;IAC3B,iHAA2B,CAAA;IAC3B,2GAAwB,CAAA;IACxB,qGAAqB,CAAA;IACrB,6GAAyB,CAAA;IACzB,iHAA2B,CAAA;IAC3B,iHAA2B,CAAA;IAC3B,+FAAkB,CAAA;IAClB,mFAAY,CAAA;AACb,CAAC,EAXiB,sBAAsB,sCAAtB,sBAAsB,QAWvC;AAED;;GAEG;AACH,SAAgB,cAAc,CAC7B,IAAa,EACb,eAAgC;IAEhC,
|
|
1
|
+
{"version":3,"file":"schemaChecker.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/schemaChecker.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA4E;AAC5E,kDAQ6B;AAC7B,4DAAmD;AAEnD,IAAkB,sBAWjB;AAXD,WAAkB,sBAAsB;IACvC,yEAAO,CAAA;IACP,iHAA2B,CAAA;IAC3B,iHAA2B,CAAA;IAC3B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AAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC/B,kEAAkE;QAClE,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAChE,+DAAuD;QACxD,CAAC;QAED,8DAA8D;QAC9D,MAAM,kBAAkB,GAAG,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QACjE,IAAI,kBAAkB,2CAAmC,EAAE,CAAC;YAC3D,OAAO,kBAAkB,CAAC;QAC3B,CAAC;IACF,CAAC;IAED,8CAAsC;AACvC,CAAC;AA9BD,0CA8BC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CACvC,aAAqB,EACrB,YAA0B;IAE1B,QAAQ,YAAY,EAAE,CAAC;QACtB,KAAK,uBAAY,CAAC,MAAM;YACvB,OAAO,aAAa,KAAK,CAAC,CAAC;QAC5B,KAAK,uBAAY,CAAC,QAAQ;YACzB,OAAO,aAAa,IAAI,CAAC,CAAC;QAC3B,KAAK,uBAAY,CAAC,QAAQ;YACzB,OAAO,IAAI,CAAC;QACb,KAAK,uBAAY,CAAC,SAAS;YAC1B,OAAO,aAAa,KAAK,CAAC,CAAC;QAC5B;YACC,IAAA,0BAAe,EAAC,YAAY,CAAC,CAAC;IAChC,CAAC;AACF,CAAC;AAhBD,4DAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype MapTree,\n\ttype TreeFieldStoredSchema,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tMultiplicity,\n\ttype SchemaAndPolicy,\n} from \"../../core/index.js\";\nimport { allowsValue } from \"../valueUtilities.js\";\n\nexport const enum SchemaValidationErrors {\n\tNoError,\n\tField_KindNotInSchemaPolicy,\n\tField_IncorrectMultiplicity,\n\tField_NodeTypeNotAllowed,\n\tLeafNode_InvalidValue,\n\tLeafNode_FieldsNotAllowed,\n\tObjectNode_FieldNotInSchema,\n\tNonLeafNode_ValueNotAllowed,\n\tNode_MissingSchema,\n\tUnknownError,\n}\n\n/**\n * Deeply checks that the provided node complies with the schema based on its identifier.\n */\nexport function isNodeInSchema(\n\tnode: MapTree,\n\tschemaAndPolicy: SchemaAndPolicy,\n): SchemaValidationErrors {\n\t// Validate the schema declared by the node exists\n\tconst schema = schemaAndPolicy.schema.nodeSchema.get(node.type);\n\tif (schema === undefined) {\n\t\treturn SchemaValidationErrors.Node_MissingSchema;\n\t}\n\n\t// Validate the node is well formed according to its schema\n\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tif (node.fields.size !== 0) {\n\t\t\treturn SchemaValidationErrors.LeafNode_FieldsNotAllowed;\n\t\t}\n\t\tif (!allowsValue(schema.leafValue, node.value)) {\n\t\t\treturn SchemaValidationErrors.LeafNode_InvalidValue;\n\t\t}\n\t} else if (schema instanceof ObjectNodeStoredSchema) {\n\t\tif (node.value !== undefined) {\n\t\t\treturn SchemaValidationErrors.NonLeafNode_ValueNotAllowed;\n\t\t}\n\t\tconst uncheckedFieldsFromNode = new Set(node.fields.keys());\n\t\tfor (const [fieldKey, fieldSchema] of schema.objectNodeFields) {\n\t\t\tconst nodeField = node.fields.get(fieldKey) ?? [];\n\t\t\tconst fieldInSchemaResult = isFieldInSchema(nodeField, fieldSchema, schemaAndPolicy);\n\t\t\tif (fieldInSchemaResult !== SchemaValidationErrors.NoError) {\n\t\t\t\treturn fieldInSchemaResult;\n\t\t\t}\n\t\t\tuncheckedFieldsFromNode.delete(fieldKey);\n\t\t}\n\t\t// The node has fields that we did not check as part of looking at every field defined in the node's schema\n\t\tif (\n\t\t\tuncheckedFieldsFromNode.size !== 0 &&\n\t\t\t!schemaAndPolicy.policy.allowUnknownOptionalFields(node.type)\n\t\t) {\n\t\t\treturn SchemaValidationErrors.ObjectNode_FieldNotInSchema;\n\t\t}\n\t} else if (schema instanceof MapNodeStoredSchema) {\n\t\tif (node.value !== undefined) {\n\t\t\treturn SchemaValidationErrors.NonLeafNode_ValueNotAllowed;\n\t\t}\n\t\tfor (const field of node.fields.values()) {\n\t\t\tconst fieldInSchemaResult = isFieldInSchema(field, schema.mapFields, schemaAndPolicy);\n\t\t\tif (fieldInSchemaResult !== SchemaValidationErrors.NoError) {\n\t\t\t\treturn fieldInSchemaResult;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfail(0xb0e /* Unknown TreeNodeStoredSchema type */);\n\t}\n\n\treturn SchemaValidationErrors.NoError;\n}\n\n/**\n * Deeply checks that the nodes comply with the field schema and included schema.\n */\nexport function isFieldInSchema(\n\tchildNodes: readonly MapTree[],\n\tschema: TreeFieldStoredSchema,\n\tschemaAndPolicy: SchemaAndPolicy,\n): SchemaValidationErrors {\n\t// Validate that the field kind is handled by the schema policy\n\tconst kind = schemaAndPolicy.policy.fieldKinds.get(schema.kind);\n\tif (kind === undefined) {\n\t\treturn SchemaValidationErrors.Field_KindNotInSchemaPolicy;\n\t}\n\n\t// Validate that the field doesn't contain more nodes than its type supports\n\tif (!compliesWithMultiplicity(childNodes.length, kind.multiplicity)) {\n\t\treturn SchemaValidationErrors.Field_IncorrectMultiplicity;\n\t}\n\n\tfor (const node of childNodes) {\n\t\t// Validate the type declared by the node is allowed in this field\n\t\tif (schema.types !== undefined && !schema.types.has(node.type)) {\n\t\t\treturn SchemaValidationErrors.Field_NodeTypeNotAllowed;\n\t\t}\n\n\t\t// Validate the node complies with the type it declares to be.\n\t\tconst nodeInSchemaResult = isNodeInSchema(node, schemaAndPolicy);\n\t\tif (nodeInSchemaResult !== SchemaValidationErrors.NoError) {\n\t\t\treturn nodeInSchemaResult;\n\t\t}\n\t}\n\n\treturn SchemaValidationErrors.NoError;\n}\n\n/**\n * Validates that a given number of items complies with the specified {@link Multiplicity | multiplicity}.\n * @param numberOfItems - Number of items.\n * @param multiplicity - Kind of multiplicity to validate against.\n * @returns `true` if the specified number of items complies with the specified multiplicity; otherwise, `false`.\n */\nexport function compliesWithMultiplicity(\n\tnumberOfItems: number,\n\tmultiplicity: Multiplicity,\n): boolean {\n\tswitch (multiplicity) {\n\t\tcase Multiplicity.Single:\n\t\t\treturn numberOfItems === 1;\n\t\tcase Multiplicity.Optional:\n\t\t\treturn numberOfItems <= 1;\n\t\tcase Multiplicity.Sequence:\n\t\t\treturn true;\n\t\tcase Multiplicity.Forbidden:\n\t\t\treturn numberOfItems === 0;\n\t\tdefault:\n\t\t\tunreachableCase(multiplicity);\n\t}\n}\n"]}
|
|
@@ -59,21 +59,33 @@ export declare const ContextSlot: import("../../core/index.js").AnchorSlot<Conte
|
|
|
59
59
|
* Implementation of `FlexTreeContext`.
|
|
60
60
|
*
|
|
61
61
|
* @remarks An editor is required to edit the FlexTree.
|
|
62
|
+
*
|
|
63
|
+
* A {@link FlexTreeContext} which is used to manage the cursors and anchors within the FlexTrees:
|
|
64
|
+
* This is necessary for supporting using this tree across edits to the forest, and not leaking memory.
|
|
62
65
|
*/
|
|
63
66
|
export declare class Context implements FlexTreeHydratedContext, IDisposable {
|
|
64
67
|
readonly schemaPolicy: SchemaPolicy;
|
|
65
68
|
readonly checkout: ITreeCheckout;
|
|
69
|
+
/**
|
|
70
|
+
* An object which handles node key generation and conversion
|
|
71
|
+
*/
|
|
66
72
|
readonly nodeKeyManager: NodeIdentifierManager;
|
|
67
73
|
readonly withCursors: Set<LazyEntity>;
|
|
68
74
|
readonly withAnchors: Set<LazyEntity>;
|
|
69
75
|
private readonly eventUnregister;
|
|
70
76
|
private disposed;
|
|
71
77
|
/**
|
|
72
|
-
*
|
|
73
|
-
* @
|
|
74
|
-
*
|
|
78
|
+
* Stores the last accessed version of the root.
|
|
79
|
+
* @remarks
|
|
80
|
+
* Anything which can delete this field must clear it.
|
|
81
|
+
* Currently "clear" is the only case.
|
|
82
|
+
*/
|
|
83
|
+
private lazyRootCache;
|
|
84
|
+
constructor(schemaPolicy: SchemaPolicy, checkout: ITreeCheckout,
|
|
85
|
+
/**
|
|
86
|
+
* An object which handles node key generation and conversion
|
|
75
87
|
*/
|
|
76
|
-
|
|
88
|
+
nodeKeyManager: NodeIdentifierManager);
|
|
77
89
|
isHydrated(): this is FlexTreeHydratedContext;
|
|
78
90
|
isDisposed(): boolean;
|
|
79
91
|
get schema(): TreeStoredSchema;
|
|
@@ -93,14 +105,4 @@ export declare class Context implements FlexTreeHydratedContext, IDisposable {
|
|
|
93
105
|
get root(): FlexTreeField;
|
|
94
106
|
get events(): Listenable<ForestEvents>;
|
|
95
107
|
}
|
|
96
|
-
/**
|
|
97
|
-
* A simple API for a Forest to interact with the tree.
|
|
98
|
-
*
|
|
99
|
-
* @param forest - the Forest
|
|
100
|
-
* @param editor - an editor that makes changes to the forest.
|
|
101
|
-
* @param nodeKeyManager - an object which handles node key generation and conversion.
|
|
102
|
-
* @returns {@link FlexTreeContext} which is used to manage the cursors and anchors within the FlexTrees:
|
|
103
|
-
* This is necessary for supporting using this tree across edits to the forest, and not leaking memory.
|
|
104
|
-
*/
|
|
105
|
-
export declare function getTreeContext(schema: SchemaPolicy, checkout: ITreeCheckout, nodeKeyManager: NodeIdentifierManager): Context;
|
|
106
108
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAGrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,KAAK,EAAE,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AAgB,CAEpC;IAED;;;OAGG;IACH,OAAO,CAAC,cAAc;IAQf,CAAC,aAAa,CAAC,IAAI,IAAI;IAa9B;;;;;OAKG;IACI,KAAK,IAAI,IAAI;IASpB,IAAW,IAAI,IAAI,aAAa,CAY/B;IAED,IAAW,MAAM,IAAI,UAAU,CAAC,YAAY,CAAC,CAE5C;CACD"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.Context = exports.ContextSlot = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../../core/index.js");
|
|
10
10
|
const index_js_2 = require("../../util/index.js");
|
|
@@ -18,14 +18,16 @@ exports.ContextSlot = (0, index_js_1.anchorSlot)();
|
|
|
18
18
|
* Implementation of `FlexTreeContext`.
|
|
19
19
|
*
|
|
20
20
|
* @remarks An editor is required to edit the FlexTree.
|
|
21
|
+
*
|
|
22
|
+
* A {@link FlexTreeContext} which is used to manage the cursors and anchors within the FlexTrees:
|
|
23
|
+
* This is necessary for supporting using this tree across edits to the forest, and not leaking memory.
|
|
21
24
|
*/
|
|
22
25
|
class Context {
|
|
26
|
+
constructor(schemaPolicy, checkout,
|
|
23
27
|
/**
|
|
24
|
-
*
|
|
25
|
-
* @param checkout - The checkout.
|
|
26
|
-
* @param nodeKeyManager - An object which handles node key generation and conversion
|
|
28
|
+
* An object which handles node key generation and conversion
|
|
27
29
|
*/
|
|
28
|
-
|
|
30
|
+
nodeKeyManager) {
|
|
29
31
|
this.schemaPolicy = schemaPolicy;
|
|
30
32
|
this.checkout = checkout;
|
|
31
33
|
this.nodeKeyManager = nodeKeyManager;
|
|
@@ -82,15 +84,20 @@ class Context {
|
|
|
82
84
|
for (const target of this.withAnchors) {
|
|
83
85
|
target[index_js_2.disposeSymbol]();
|
|
84
86
|
}
|
|
87
|
+
this.lazyRootCache = undefined;
|
|
85
88
|
(0, internal_1.assert)(this.withCursors.size === 0, 0x774 /* free should remove all cursors */);
|
|
86
89
|
(0, internal_1.assert)(this.withAnchors.size === 0, 0x775 /* free should remove all anchors */);
|
|
87
90
|
}
|
|
88
91
|
get root() {
|
|
89
92
|
(0, internal_1.assert)(this.disposed === false, 0x804 /* use after dispose */);
|
|
93
|
+
if (this.lazyRootCache !== undefined) {
|
|
94
|
+
return this.lazyRootCache;
|
|
95
|
+
}
|
|
90
96
|
const cursor = this.checkout.forest.allocateCursor("root");
|
|
91
97
|
(0, index_js_1.moveToDetachedField)(this.checkout.forest, cursor);
|
|
92
98
|
const field = (0, lazyField_js_1.makeField)(this, this.schema.rootFieldSchema.kind, cursor);
|
|
93
99
|
cursor.free();
|
|
100
|
+
this.lazyRootCache = field;
|
|
94
101
|
return field;
|
|
95
102
|
}
|
|
96
103
|
get events() {
|
|
@@ -98,17 +105,4 @@ class Context {
|
|
|
98
105
|
}
|
|
99
106
|
}
|
|
100
107
|
exports.Context = Context;
|
|
101
|
-
/**
|
|
102
|
-
* A simple API for a Forest to interact with the tree.
|
|
103
|
-
*
|
|
104
|
-
* @param forest - the Forest
|
|
105
|
-
* @param editor - an editor that makes changes to the forest.
|
|
106
|
-
* @param nodeKeyManager - an object which handles node key generation and conversion.
|
|
107
|
-
* @returns {@link FlexTreeContext} which is used to manage the cursors and anchors within the FlexTrees:
|
|
108
|
-
* This is necessary for supporting using this tree across edits to the forest, and not leaking memory.
|
|
109
|
-
*/
|
|
110
|
-
function getTreeContext(schema, checkout, nodeKeyManager) {
|
|
111
|
-
return new Context(schema, checkout, nodeKeyManager);
|
|
112
|
-
}
|
|
113
|
-
exports.getTreeContext = getTreeContext;
|
|
114
108
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/context.ts"],"names":[],"mappings":";AAAA;;;GA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,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAA,iBAAM,EAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,CAAC,oCAAoC,CAAC,CAAC;QAChF,IAAA,iBAAM,EAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACjF,CAAC;IAED,IAAW,IAAI;QACd,IAAA,iBAAM,EAAC,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC/D,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC,aAAa,CAAC;QAC3B,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC3D,IAAA,8BAAmB,EAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClD,MAAM,KAAK,GAAG,IAAA,wBAAS,EAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACxE,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,CAAC;CACD;AA1GD,0BA0GC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, debugAssert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ForestEvents,\n\ttype SchemaPolicy,\n\ttype TreeStoredSchema,\n\tanchorSlot,\n\tmoveToDetachedField,\n} from \"../../core/index.js\";\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport { type IDisposable, disposeSymbol } from \"../../util/index.js\";\nimport type { NodeIdentifierManager } from \"../node-identifier/index.js\";\n\nimport type { FlexTreeField } from \"./flexTreeTypes.js\";\nimport type { LazyEntity } from \"./lazyEntity.js\";\nimport { makeField } from \"./lazyField.js\";\nimport type { ITreeCheckout } from \"../../shared-tree/index.js\";\n\n/**\n * Context for FlexTrees.\n */\nexport interface FlexTreeContext {\n\t/**\n\t * Schema used within this context.\n\t * All data must conform to these schema.\n\t */\n\treadonly schema: TreeStoredSchema;\n\n\t/**\n\t * SchemaPolicy used within this context.\n\t */\n\treadonly schemaPolicy: SchemaPolicy;\n\n\t/**\n\t * If true, this context is the canonical context instance for a given view,\n\t * and its schema include all schema from the document.\n\t *\n\t * If false, this context was created for use in a unhydrated tree, and the full document schema is unknown.\n\t */\n\tisHydrated(): this is FlexTreeHydratedContext;\n\n\t/**\n\t * If true, none of the nodes in this context can be used.\n\t */\n\tisDisposed(): boolean;\n}\n\n/**\n * A common context of a \"forest\" of FlexTrees.\n * It handles group operations like transforming cursors into anchors for edits.\n */\nexport interface FlexTreeHydratedContext extends FlexTreeContext {\n\treadonly events: Listenable<ForestEvents>;\n\t/**\n\t * Gets the root field of the tree.\n\t */\n\tget root(): FlexTreeField;\n\n\treadonly nodeKeyManager: NodeIdentifierManager;\n\n\t/**\n\t * The checkout object associated with this context.\n\t */\n\treadonly checkout: ITreeCheckout;\n}\n\n/**\n * Creating multiple flex tree contexts for the same branch, and thus with the same underlying AnchorSet does not work due to how TreeNode caching works.\n * This slot is used to detect if one already exists and error if creating a second.\n */\nexport const ContextSlot = anchorSlot<Context>();\n\n/**\n * Implementation of `FlexTreeContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n *\n * A {@link FlexTreeContext} which is used to manage the cursors and anchors within the FlexTrees:\n * This is necessary for supporting using this tree across edits to the forest, and not leaking memory.\n */\nexport class Context implements FlexTreeHydratedContext, IDisposable {\n\tpublic readonly withCursors: Set<LazyEntity> = new Set();\n\tpublic readonly withAnchors: Set<LazyEntity> = new Set();\n\n\tprivate readonly eventUnregister: (() => void)[];\n\tprivate disposed = false;\n\n\t/**\n\t * Stores the last accessed version of the root.\n\t * @remarks\n\t * Anything which can delete this field must clear it.\n\t * Currently \"clear\" is the only case.\n\t */\n\tprivate lazyRootCache: FlexTreeField | undefined;\n\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly checkout: ITreeCheckout,\n\t\t/**\n\t\t * An object which handles node key generation and conversion\n\t\t */\n\t\tpublic readonly nodeKeyManager: NodeIdentifierManager,\n\t) {\n\t\tthis.eventUnregister = [\n\t\t\tthis.checkout.forest.events.on(\"beforeChange\", () => {\n\t\t\t\tthis.prepareForEdit();\n\t\t\t}),\n\t\t];\n\n\t\tassert(\n\t\t\t!this.checkout.forest.anchors.slots.has(ContextSlot),\n\t\t\t0x92b /* Cannot create second flex-tree from checkout */,\n\t\t);\n\t\tthis.checkout.forest.anchors.slots.set(ContextSlot, this);\n\t}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\tdebugAssert(() => !this.disposed || \"Disposed\");\n\t\treturn true;\n\t}\n\n\tpublic isDisposed(): boolean {\n\t\treturn this.disposed;\n\t}\n\n\tpublic get schema(): TreeStoredSchema {\n\t\treturn this.checkout.storedSchema;\n\t}\n\n\t/**\n\t * Called before editing.\n\t * Clears all cursors so editing can proceed.\n\t */\n\tprivate prepareForEdit(): void {\n\t\tassert(this.disposed === false, 0x802 /* use after dispose */);\n\t\tfor (const target of this.withCursors) {\n\t\t\ttarget.prepareForEdit();\n\t\t}\n\t\tassert(this.withCursors.size === 0, 0x773 /* prepareForEdit should remove all cursors */);\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tassert(this.disposed === false, 0x803 /* double dispose */);\n\t\tthis.disposed = true;\n\t\tthis.clear();\n\t\tfor (const unregister of this.eventUnregister) {\n\t\t\tunregister();\n\t\t}\n\t\tthis.eventUnregister.length = 0;\n\n\t\tconst deleted = this.checkout.forest.anchors.slots.delete(ContextSlot);\n\t\tassert(deleted, 0x8c4 /* unexpected dispose */);\n\t}\n\n\t/**\n\t * Release any cursors and anchors held by tree entities created in this context.\n\t * Ensures the cashed references to those entities on the Anchors are also cleared.\n\t * The tree entities are invalid to use after this, but the context may still be used\n\t * to create new trees starting from the root.\n\t */\n\tpublic clear(): void {\n\t\tfor (const target of this.withAnchors) {\n\t\t\ttarget[disposeSymbol]();\n\t\t}\n\t\tthis.lazyRootCache = undefined;\n\t\tassert(this.withCursors.size === 0, 0x774 /* free should remove all cursors */);\n\t\tassert(this.withAnchors.size === 0, 0x775 /* free should remove all anchors */);\n\t}\n\n\tpublic get root(): FlexTreeField {\n\t\tassert(this.disposed === false, 0x804 /* use after dispose */);\n\t\tif (this.lazyRootCache !== undefined) {\n\t\t\treturn this.lazyRootCache;\n\t\t}\n\n\t\tconst cursor = this.checkout.forest.allocateCursor(\"root\");\n\t\tmoveToDetachedField(this.checkout.forest, cursor);\n\t\tconst field = makeField(this, this.schema.rootFieldSchema.kind, cursor);\n\t\tcursor.free();\n\t\tthis.lazyRootCache = field;\n\t\treturn field;\n\t}\n\n\tpublic get events(): Listenable<ForestEvents> {\n\t\treturn this.checkout.forest.events;\n\t}\n}\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { type FlexTreeField, type FlexTreeNode, type FlexTreeEntity, type FlexTreeTypedField, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, TreeStatus, type FlexTreeUnknownUnboxed, flexTreeMarker, FlexTreeEntityKind, isFlexTreeNode, flexTreeSlot, } from "./flexTreeTypes.js";
|
|
6
6
|
export { visitBipartiteIterableTree, Skip, visitBipartiteIterableTreeWithState, visitIterableTree, visitIterableTreeWithState, } from "./navigation.js";
|
|
7
|
-
export {
|
|
7
|
+
export { type FlexTreeContext, type FlexTreeHydratedContext, Context, ContextSlot, } from "./context.js";
|
|
8
8
|
export { type FlexTreeNodeEvents } from "./treeEvents.js";
|
|
9
9
|
export { assertFlexTreeEntityNotFreed, LazyEntity, } from "./lazyEntity.js";
|
|
10
10
|
export { getSchemaAndPolicy, indexForAt } from "./utilities.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,UAAU,EACV,KAAK,sBAAsB,EAC3B,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,0BAA0B,EAC1B,IAAI,EACJ,mCAAmC,EACnC,iBAAiB,EACjB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,UAAU,EACV,KAAK,sBAAsB,EAC3B,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,0BAA0B,EAC1B,IAAI,EACJ,mCAAmC,EACnC,iBAAiB,EACjB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,OAAO,EACP,WAAW,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACN,4BAA4B,EAC5B,UAAU,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.treeStatusFromAnchorCache = exports.indexForAt = exports.getSchemaAndPolicy = exports.LazyEntity = exports.assertFlexTreeEntityNotFreed = exports.ContextSlot = exports.Context = exports.
|
|
7
|
+
exports.treeStatusFromAnchorCache = exports.indexForAt = exports.getSchemaAndPolicy = exports.LazyEntity = exports.assertFlexTreeEntityNotFreed = exports.ContextSlot = exports.Context = exports.visitIterableTreeWithState = exports.visitIterableTree = exports.visitBipartiteIterableTreeWithState = exports.Skip = exports.visitBipartiteIterableTree = exports.flexTreeSlot = exports.isFlexTreeNode = exports.FlexTreeEntityKind = exports.flexTreeMarker = exports.TreeStatus = void 0;
|
|
8
8
|
var flexTreeTypes_js_1 = require("./flexTreeTypes.js");
|
|
9
9
|
Object.defineProperty(exports, "TreeStatus", { enumerable: true, get: function () { return flexTreeTypes_js_1.TreeStatus; } });
|
|
10
10
|
Object.defineProperty(exports, "flexTreeMarker", { enumerable: true, get: function () { return flexTreeTypes_js_1.flexTreeMarker; } });
|
|
@@ -18,7 +18,6 @@ Object.defineProperty(exports, "visitBipartiteIterableTreeWithState", { enumerab
|
|
|
18
18
|
Object.defineProperty(exports, "visitIterableTree", { enumerable: true, get: function () { return navigation_js_1.visitIterableTree; } });
|
|
19
19
|
Object.defineProperty(exports, "visitIterableTreeWithState", { enumerable: true, get: function () { return navigation_js_1.visitIterableTreeWithState; } });
|
|
20
20
|
var context_js_1 = require("./context.js");
|
|
21
|
-
Object.defineProperty(exports, "getTreeContext", { enumerable: true, get: function () { return context_js_1.getTreeContext; } });
|
|
22
21
|
Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return context_js_1.Context; } });
|
|
23
22
|
Object.defineProperty(exports, "ContextSlot", { enumerable: true, get: function () { return context_js_1.ContextSlot; } });
|
|
24
23
|
var lazyEntity_js_1 = require("./lazyEntity.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAc4B;AAN3B,8GAAA,UAAU,OAAA;AAEV,kHAAA,cAAc,OAAA;AACd,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AACd,gHAAA,YAAY,OAAA;AAGb,iDAMyB;AALxB,2HAAA,0BAA0B,OAAA;AAC1B,qGAAA,IAAI,OAAA;AACJ,oIAAA,mCAAmC,OAAA;AACnC,kHAAA,iBAAiB,OAAA;AACjB,2HAAA,0BAA0B,OAAA;AAG3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAc4B;AAN3B,8GAAA,UAAU,OAAA;AAEV,kHAAA,cAAc,OAAA;AACd,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AACd,gHAAA,YAAY,OAAA;AAGb,iDAMyB;AALxB,2HAAA,0BAA0B,OAAA;AAC1B,qGAAA,IAAI,OAAA;AACJ,oIAAA,mCAAmC,OAAA;AACnC,kHAAA,iBAAiB,OAAA;AACjB,2HAAA,0BAA0B,OAAA;AAG3B,2CAKsB;AAFrB,qGAAA,OAAO,OAAA;AACP,yGAAA,WAAW,OAAA;AAKZ,iDAGyB;AAFxB,6HAAA,4BAA4B,OAAA;AAC5B,2GAAA,UAAU,OAAA;AAGX,+CAAgE;AAAvD,kHAAA,kBAAkB,OAAA;AAAE,0GAAA,UAAU,OAAA;AAEvC,+CAA2D;AAAlD,yHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeEntity,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\tTreeStatus,\n\ttype FlexTreeUnknownUnboxed,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\tisFlexTreeNode,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\n\nexport {\n\tvisitBipartiteIterableTree,\n\tSkip,\n\tvisitBipartiteIterableTreeWithState,\n\tvisitIterableTree,\n\tvisitIterableTreeWithState,\n} from \"./navigation.js\";\n\nexport {\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\tContext,\n\tContextSlot,\n} from \"./context.js\";\n\nexport { type FlexTreeNodeEvents } from \"./treeEvents.js\";\n\nexport {\n\tassertFlexTreeEntityNotFreed,\n\tLazyEntity,\n} from \"./lazyEntity.js\";\n\nexport { getSchemaAndPolicy, indexForAt } from \"./utilities.js\";\n\nexport { treeStatusFromAnchorCache } from \"./utilities.js\";\n"]}
|
|
@@ -46,11 +46,7 @@ export declare class LazySequence extends LazyField implements FlexTreeSequenceF
|
|
|
46
46
|
editor: SequenceFieldEditBuilder<ExclusiveMapTree[]>;
|
|
47
47
|
private sequenceEditor;
|
|
48
48
|
}
|
|
49
|
-
export declare class
|
|
50
|
-
editor: ValueFieldEditBuilder<ExclusiveMapTree>;
|
|
51
|
-
get content(): FlexTreeUnknownUnboxed;
|
|
52
|
-
}
|
|
53
|
-
export declare class LazyValueField extends ReadonlyLazyValueField implements FlexTreeRequiredField {
|
|
49
|
+
export declare class LazyValueField extends LazyField implements FlexTreeRequiredField {
|
|
54
50
|
editor: ValueFieldEditBuilder<ExclusiveMapTree>;
|
|
55
51
|
private valueFieldEditor;
|
|
56
52
|
get content(): FlexTreeUnknownUnboxed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyField.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAGN,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAE3B,cAAc,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAqB7C,wBAAgB,SAAS,CACxB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,uBAAuB,GAC7B,aAAa,CAyCf;AAED;;GAEG;AACH,8BAAsB,SAAU,SAAQ,UAAU,CAAC,WAAW,CAAE,YAAW,aAAa;aActE,MAAM,EAAE,mBAAmB;IAb5C,IAAW,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC,KAAK,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BAAgB;IAMxB,IAAW,OAAO,IAAI,sBAAsB,CAE3C;CACD;AAED,qBAAa,iBAAkB,SAAQ,SAAU,YAAW,qBAAqB;IACzE,MAAM,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAOvD;IAEF,OAAO,CAAC,cAAc;IAMtB,IAAW,OAAO,IAAI,sBAAsB,GAAG,SAAS,CAEvD;CACD;AAED,qBAAa,kBAAmB,SAAQ,SAAS;CAAG;AAoBpD;;GAEG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW,GACtB,sBAAsB,CA8BxB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.unboxedFlexNode = exports.LazyForbiddenField = exports.LazyOptionalField = exports.LazyValueField = exports.
|
|
7
|
+
exports.unboxedFlexNode = exports.LazyForbiddenField = exports.LazyOptionalField = exports.LazyValueField = exports.LazySequence = exports.LazyField = exports.makeField = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const internal_2 = require("@fluidframework/telemetry-utils/internal");
|
|
10
10
|
const index_js_1 = require("../../core/index.js");
|
|
@@ -180,21 +180,7 @@ class LazySequence extends LazyField {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
exports.LazySequence = LazySequence;
|
|
183
|
-
class
|
|
184
|
-
constructor() {
|
|
185
|
-
super(...arguments);
|
|
186
|
-
this.editor = {
|
|
187
|
-
set: (newContent) => {
|
|
188
|
-
(0, internal_1.assert)(false, 0xa0c /* Unexpected set of readonly field */);
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
get content() {
|
|
193
|
-
return this.atIndex(0);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
exports.ReadonlyLazyValueField = ReadonlyLazyValueField;
|
|
197
|
-
class LazyValueField extends ReadonlyLazyValueField {
|
|
183
|
+
class LazyValueField extends LazyField {
|
|
198
184
|
constructor() {
|
|
199
185
|
super(...arguments);
|
|
200
186
|
this.editor = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyField.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,uEAAsE;AAEtE,kDAc6B;AAC7B,kDAAiE;AACjE,yDAOoC;AAIpC,yDAY4B;AAC5B,mDAA6C;AAC7C,+CAA4D;AAC5D,iDAAuE;AACvE,0DAA4D;AAE5D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,GAAwD,IAAI,OAAO,EAAE,CAAC;AAEtF,SAAgB,SAAS,CACxB,OAAgB,EAChB,MAA2B,EAC3B,MAA+B;IAE/B,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC9C,IAAI,UAAU,GAAG,KAAK,CAAC;IAEvB,MAAM,iBAAiB,GAAG,GAAkB,EAAE;QAC7C,UAAU,GAAG,IAAI,CAAC;QAClB,MAAM,KAAK,GAAG,IAAI,CACjB,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,kCAAkC,CAAC,CACzE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACxC,OAAO,KAAK,CAAC;IACd,CAAC,CAAC;IAEF,IAAI,WAAW,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,iBAAiB,EAAE,CAAC;IAC5B,CAAC;IAED,oGAAoG;IACpG,MAAM,UAAU,GACf,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;QAC1D,IAAA,eAAI,EAAC,KAAK,CAAC,oBAAoB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AC1B,OAAO,MAAM,CAAC;QACf,CAAC;IACF,CAAC;IAED,OAAO,IAAA,sBAAQ,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC;AAlCD,0CAkCC","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 { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorNode,\n\tCursorLocationType,\n\ttype ExclusiveMapTree,\n\ttype FieldAnchor,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype NormalizedFieldUpPath,\n\ttype TreeNavigationResult,\n\tinCursorNode,\n\titerateCursorField,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport { disposeSymbol, getOrCreate } from \"../../util/index.js\";\nimport {\n\tFieldKinds,\n\tMappedEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\ttype ValueFieldEditBuilder,\n} from \"../default-schema/index.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\tTreeStatus,\n\tflexTreeMarker,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\nimport { LazyEntity } from \"./lazyEntity.js\";\nimport { type LazyTreeNode, makeTree } from \"./lazyNode.js\";\nimport { indexForAt, treeStatusFromAnchorCache } from \"./utilities.js\";\nimport { cursorForMapTreeField } from \"../mapTreeCursor.js\";\n\n/**\n * Reuse fields.\n * Since field currently own cursors and register themselves for disposal when the node hit end of life,\n * not reusing them results in memory leaks every time the field is accessed.\n * Since the fields stay alive until the node is end of life reusing them this way is safe.\n *\n * This ins't a perfect solution:\n *\n * - This can cause leaks, like map nodes will keep all accessed field objects around. Since other things cause this same leak already, its not too bad.\n * - This does not cache the root.\n * - Finding the parent anchor to do the caching on has significant cost.\n *\n * Despite these limitations, this cache provides a large performance win in some common cases (over 10x), especially with how simple tree requests far more field objects than necessary currently.\n */\nconst fieldCache: WeakMap<LazyTreeNode, Map<FieldKey, FlexTreeField>> = new WeakMap();\n\nexport function makeField(\n\tcontext: Context,\n\tschema: FieldKindIdentifier,\n\tcursor: ITreeSubscriptionCursor,\n): FlexTreeField {\n\tconst fieldAnchor = cursor.buildFieldAnchor();\n\tlet usedAnchor = false;\n\n\tconst makeFlexTreeField = (): FlexTreeField => {\n\t\tusedAnchor = true;\n\t\tconst field = new (\n\t\t\tkindToClass.get(schema) ?? fail(0xb0f /* missing field implementation */)\n\t\t)(context, schema, cursor, fieldAnchor);\n\t\treturn field;\n\t};\n\n\tif (fieldAnchor.parent === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\t// For the common case (all but roots), cache field associated with its node's anchor and field key.\n\tconst anchorNode =\n\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\tfail(0xb10 /* missing anchor */);\n\n\t// Since anchor-set could be reused across a flex tree context getting disposed, key off the flex tree node not the anchor.\n\tconst cacheKey = anchorNode.slots.get(flexTreeSlot);\n\n\t// If there is no flex tree parent node, skip caching: this is not expected to be a hot path, but should probably be fixed at some point.\n\tif (cacheKey === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\tconst innerCache = getOrCreate(\n\t\tfieldCache,\n\t\tcacheKey,\n\t\t() => new Map<FieldKey, FlexTreeField>(),\n\t);\n\tconst result = getOrCreate(innerCache, fieldAnchor.fieldKey, makeFlexTreeField);\n\tif (!usedAnchor) {\n\t\t// The anchor must be disposed to avoid leaking. In the case of a cache hit,\n\t\t// we are not transferring ownership to a new FlexTreeField, so it must be disposed of here to avoid the leak.\n\t\tcontext.checkout.forest.anchors.forget(fieldAnchor.parent);\n\t}\n\treturn result;\n}\n\n/**\n * Base type for fields implementing {@link FlexTreeField} using cursors.\n */\nexport abstract class LazyField extends LazyEntity<FieldAnchor> implements FlexTreeField {\n\tpublic get [flexTreeMarker](): FlexTreeEntityKind.Field {\n\t\treturn FlexTreeEntityKind.Field;\n\t}\n\tpublic readonly key: FieldKey;\n\n\t/**\n\t * If this field ends its lifetime before the Anchor does, this needs to be invoked to avoid a double free\n\t * if/when the Anchor is destroyed.\n\t */\n\tprivate readonly offAfterDestroy?: () => void;\n\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, cursor, fieldAnchor);\n\t\tassert(cursor.mode === CursorLocationType.Fields, 0x77b /* must be in fields mode */);\n\t\tthis.key = cursor.getFieldKey();\n\t\t// Fields currently live as long as their parent does.\n\t\t// For root fields, this means forever, but other cases can be cleaned up when their parent anchor is deleted.\n\t\tif (fieldAnchor.parent !== undefined) {\n\t\t\tconst anchorNode =\n\t\t\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\t\t\tfail(0xb11 /* parent anchor node should always exist since field is under a node */);\n\t\t\tthis.offAfterDestroy = anchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis[disposeSymbol]();\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\tassert(\n\t\t\tthis.context.schemaPolicy.fieldKinds.get(kind.identifier) === kind,\n\t\t\t0xa26 /* Narrowing must be done to a kind that exists in this context */,\n\t\t);\n\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic get parent(): FlexTreeNode | undefined {\n\t\tif (this.anchor.parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst cursor = this.cursor;\n\t\tcursor.exitField();\n\t\tconst output = makeTree(this.context, cursor);\n\t\tcursor.enterField(this.key);\n\t\treturn output;\n\t}\n\n\tprotected override tryMoveCursorToAnchor(\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\treturn this.context.checkout.forest.tryMoveCursorToField(this.anchor, cursor);\n\t}\n\n\tprotected override forgetAnchor(): void {\n\t\tthis.offAfterDestroy?.();\n\t\tif (this.anchor.parent === undefined) return;\n\t\tthis.context.checkout.forest.anchors.forget(this.anchor.parent);\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.cursor.getFieldLength();\n\t}\n\n\tpublic atIndex(index: number): FlexTreeUnknownUnboxed {\n\t\treturn inCursorNode(this.cursor, index, (cursor) =>\n\t\t\tunboxedFlexNode(this.context, cursor, this.anchor),\n\t\t);\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeNode | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn inCursorNode(this.cursor, finalIndex, (cursor) => makeTree(this.context, cursor));\n\t}\n\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeNode> {\n\t\treturn iterateCursorField(this.cursor, (cursor) => makeTree(this.context, cursor));\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<FlexTreeUnknownUnboxed> {\n\t\treturn iterateCursorField(this.cursor, (cursor) =>\n\t\t\tunboxedFlexNode(this.context, cursor, this.anchor),\n\t\t);\n\t}\n\n\tpublic getFieldPath(): NormalizedFieldUpPath {\n\t\treturn { parent: this.parent?.anchorNode, field: this.key };\n\t}\n\n\t/**\n\t * Returns the path to this field to use for editing. Throws iff this path is not {@link TreeStatus#InDocument}.\n\t * This path is not valid to hold onto across edits: this must be recalled for each edit.\n\t */\n\tpublic getFieldPathForEditing(): NormalizedFieldUpPath {\n\t\tif (!this.isFreed()) {\n\t\t\tif (\n\t\t\t\t// Only allow editing if we are the root document field...\n\t\t\t\t(this.parent === undefined && this.anchor.fieldKey === rootFieldKey) ||\n\t\t\t\t// ...or are under a node in the document\n\t\t\t\t(this.parent !== undefined &&\n\t\t\t\t\ttreeStatusFromAnchorCache(this.parent.anchorNode) === TreeStatus.InDocument)\n\t\t\t) {\n\t\t\t\treturn this.getFieldPath();\n\t\t\t}\n\t\t}\n\n\t\tthrow new UsageError(\"Editing only allowed on fields with TreeStatus.InDocument status\");\n\t}\n\n\tprotected getEditor(): IDefaultEditBuilder<ITreeCursorSynchronous> {\n\t\treturn new MappedEditBuilder(\n\t\t\tthis.context.checkout.editor,\n\t\t\t(cursor: ITreeCursorSynchronous) => this.context.checkout.forest.chunkField(cursor),\n\t\t);\n\t}\n}\n\nexport class LazySequence extends LazyField implements FlexTreeSequenceField {\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn this.atIndex(finalIndex);\n\t}\n\tpublic get asArray(): readonly FlexTreeUnknownUnboxed[] {\n\t\treturn this.map((x) => x);\n\t}\n\n\tpublic editor: SequenceFieldEditBuilder<ExclusiveMapTree[]> = {\n\t\tinsert: (index, newContent) => {\n\t\t\tthis.sequenceEditor().insert(index, cursorForMapTreeField(newContent));\n\t\t},\n\t\tremove: (index, count) => {\n\t\t\tthis.sequenceEditor().remove(index, count);\n\t\t},\n\t};\n\n\tprivate sequenceEditor(): SequenceFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\treturn this.getEditor().sequenceField(fieldPath);\n\t}\n}\n\nexport class ReadonlyLazyValueField extends LazyField implements FlexTreeRequiredField {\n\tpublic editor: ValueFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent) => {\n\t\t\tassert(false, 0xa0c /* Unexpected set of readonly field */);\n\t\t},\n\t};\n\n\tpublic get content(): FlexTreeUnknownUnboxed {\n\t\treturn this.atIndex(0);\n\t}\n}\n\nexport class LazyValueField extends ReadonlyLazyValueField implements FlexTreeRequiredField {\n\tpublic override editor: ValueFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent) => {\n\t\t\tthis.valueFieldEditor().set(cursorForMapTreeField([newContent]));\n\t\t},\n\t};\n\n\tprivate valueFieldEditor(): ValueFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.getEditor().valueField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic override get content(): FlexTreeUnknownUnboxed {\n\t\treturn this.atIndex(0);\n\t}\n}\n\nexport class LazyOptionalField extends LazyField implements FlexTreeOptionalField {\n\tpublic editor: OptionalFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent, wasEmpty) => {\n\t\t\tthis.optionalEditor().set(\n\t\t\t\tnewContent !== undefined ? cursorForMapTreeField([newContent]) : newContent,\n\t\t\t\twasEmpty,\n\t\t\t);\n\t\t},\n\t};\n\n\tprivate optionalEditor(): OptionalFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.getEditor().optionalField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\treturn this.length === 0 ? undefined : this.atIndex(0);\n\t}\n}\n\nexport class LazyForbiddenField extends LazyField {}\n\ntype Builder = new (\n\tcontext: Context,\n\t// Correct use of these builders requires the builder of the matching type to be used.\n\tschema: FieldKindIdentifier,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n) => LazyField;\n\nconst builderList: [FieldKindIdentifier, Builder][] = [\n\t[FieldKinds.forbidden.identifier, LazyForbiddenField],\n\t[FieldKinds.optional.identifier, LazyOptionalField],\n\t[FieldKinds.sequence.identifier, LazySequence],\n\t[FieldKinds.required.identifier, LazyValueField],\n\t[FieldKinds.identifier.identifier, LazyValueField],\n];\n\nconst kindToClass: ReadonlyMap<FieldKindIdentifier, Builder> = new Map(builderList);\n\n/**\n * Returns the flex tree node, or the value if it has one.\n */\nexport function unboxedFlexNode(\n\tcontext: Context,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n): FlexTreeUnknownUnboxed {\n\tconst value = cursor.value;\n\tif (value !== undefined) {\n\t\treturn value;\n\t}\n\n\t// Try accessing cached child node via anchors.\n\t// This avoids O(depth) related costs from makeTree in the cached case.\n\tconst anchor = fieldAnchor.parent;\n\tlet child: AnchorNode | undefined;\n\tif (anchor !== undefined) {\n\t\tconst anchorNode = context.checkout.forest.anchors.locate(anchor);\n\t\tassert(anchorNode !== undefined, 0xa4c /* missing anchor */);\n\t\tchild = anchorNode.childIfAnchored(fieldAnchor.fieldKey, cursor.fieldIndex);\n\t} else {\n\t\tchild = context.checkout.forest.anchors.find({\n\t\t\tparent: undefined,\n\t\t\tparentField: fieldAnchor.fieldKey,\n\t\t\tparentIndex: cursor.fieldIndex,\n\t\t});\n\t}\n\n\tif (child !== undefined) {\n\t\tconst cached = child.slots.get(flexTreeSlot);\n\t\tif (cached !== undefined) {\n\t\t\treturn cached;\n\t\t}\n\t}\n\n\treturn makeTree(context, cursor);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"lazyField.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AACnE,uEAAsE;AAEtE,kDAc6B;AAC7B,kDAAiE;AACjE,yDAOoC;AAIpC,yDAY4B;AAC5B,mDAA6C;AAC7C,+CAA4D;AAC5D,iDAAuE;AACvE,0DAA4D;AAE5D;;;;;;;;;;;;;GAaG;AACH,MAA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,CAAC,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC7E,CAAC;SAAM,CAAC;QACP,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;YAC5C,MAAM,EAAE,SAAS;YACjB,WAAW,EAAE,WAAW,CAAC,QAAQ;YACjC,WAAW,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,+BAAY,CAAC,CAAC;QAC7C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC;QACf,CAAC;IACF,CAAC;IAED,OAAO,IAAA,sBAAQ,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC;AAlCD,0CAkCC","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 { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorNode,\n\tCursorLocationType,\n\ttype ExclusiveMapTree,\n\ttype FieldAnchor,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype NormalizedFieldUpPath,\n\ttype TreeNavigationResult,\n\tinCursorNode,\n\titerateCursorField,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport { disposeSymbol, getOrCreate } from \"../../util/index.js\";\nimport {\n\tFieldKinds,\n\tMappedEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\ttype ValueFieldEditBuilder,\n} from \"../default-schema/index.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\tTreeStatus,\n\tflexTreeMarker,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\nimport { LazyEntity } from \"./lazyEntity.js\";\nimport { type LazyTreeNode, makeTree } from \"./lazyNode.js\";\nimport { indexForAt, treeStatusFromAnchorCache } from \"./utilities.js\";\nimport { cursorForMapTreeField } from \"../mapTreeCursor.js\";\n\n/**\n * Reuse fields.\n * Since field currently own cursors and register themselves for disposal when the node hit end of life,\n * not reusing them results in memory leaks every time the field is accessed.\n * Since the fields stay alive until the node is end of life reusing them this way is safe.\n *\n * This ins't a perfect solution:\n *\n * - This can cause leaks, like map nodes will keep all accessed field objects around. Since other things cause this same leak already, its not too bad.\n * - This does not cache the root.\n * - Finding the parent anchor to do the caching on has significant cost.\n *\n * Despite these limitations, this cache provides a large performance win in some common cases (over 10x), especially with how simple tree requests far more field objects than necessary currently.\n */\nconst fieldCache: WeakMap<LazyTreeNode, Map<FieldKey, FlexTreeField>> = new WeakMap();\n\nexport function makeField(\n\tcontext: Context,\n\tschema: FieldKindIdentifier,\n\tcursor: ITreeSubscriptionCursor,\n): FlexTreeField {\n\tconst fieldAnchor = cursor.buildFieldAnchor();\n\tlet usedAnchor = false;\n\n\tconst makeFlexTreeField = (): FlexTreeField => {\n\t\tusedAnchor = true;\n\t\tconst field = new (\n\t\t\tkindToClass.get(schema) ?? fail(0xb0f /* missing field implementation */)\n\t\t)(context, schema, cursor, fieldAnchor);\n\t\treturn field;\n\t};\n\n\tif (fieldAnchor.parent === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\t// For the common case (all but roots), cache field associated with its node's anchor and field key.\n\tconst anchorNode =\n\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\tfail(0xb10 /* missing anchor */);\n\n\t// Since anchor-set could be reused across a flex tree context getting disposed, key off the flex tree node not the anchor.\n\tconst cacheKey = anchorNode.slots.get(flexTreeSlot);\n\n\t// If there is no flex tree parent node, skip caching: this is not expected to be a hot path, but should probably be fixed at some point.\n\tif (cacheKey === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\tconst innerCache = getOrCreate(\n\t\tfieldCache,\n\t\tcacheKey,\n\t\t() => new Map<FieldKey, FlexTreeField>(),\n\t);\n\tconst result = getOrCreate(innerCache, fieldAnchor.fieldKey, makeFlexTreeField);\n\tif (!usedAnchor) {\n\t\t// The anchor must be disposed to avoid leaking. In the case of a cache hit,\n\t\t// we are not transferring ownership to a new FlexTreeField, so it must be disposed of here to avoid the leak.\n\t\tcontext.checkout.forest.anchors.forget(fieldAnchor.parent);\n\t}\n\treturn result;\n}\n\n/**\n * Base type for fields implementing {@link FlexTreeField} using cursors.\n */\nexport abstract class LazyField extends LazyEntity<FieldAnchor> implements FlexTreeField {\n\tpublic get [flexTreeMarker](): FlexTreeEntityKind.Field {\n\t\treturn FlexTreeEntityKind.Field;\n\t}\n\tpublic readonly key: FieldKey;\n\n\t/**\n\t * If this field ends its lifetime before the Anchor does, this needs to be invoked to avoid a double free\n\t * if/when the Anchor is destroyed.\n\t */\n\tprivate readonly offAfterDestroy?: () => void;\n\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, cursor, fieldAnchor);\n\t\tassert(cursor.mode === CursorLocationType.Fields, 0x77b /* must be in fields mode */);\n\t\tthis.key = cursor.getFieldKey();\n\t\t// Fields currently live as long as their parent does.\n\t\t// For root fields, this means forever, but other cases can be cleaned up when their parent anchor is deleted.\n\t\tif (fieldAnchor.parent !== undefined) {\n\t\t\tconst anchorNode =\n\t\t\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\t\t\tfail(0xb11 /* parent anchor node should always exist since field is under a node */);\n\t\t\tthis.offAfterDestroy = anchorNode.events.on(\"afterDestroy\", () => {\n\t\t\t\tthis[disposeSymbol]();\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\tassert(\n\t\t\tthis.context.schemaPolicy.fieldKinds.get(kind.identifier) === kind,\n\t\t\t0xa26 /* Narrowing must be done to a kind that exists in this context */,\n\t\t);\n\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic get parent(): FlexTreeNode | undefined {\n\t\tif (this.anchor.parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst cursor = this.cursor;\n\t\tcursor.exitField();\n\t\tconst output = makeTree(this.context, cursor);\n\t\tcursor.enterField(this.key);\n\t\treturn output;\n\t}\n\n\tprotected override tryMoveCursorToAnchor(\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\treturn this.context.checkout.forest.tryMoveCursorToField(this.anchor, cursor);\n\t}\n\n\tprotected override forgetAnchor(): void {\n\t\tthis.offAfterDestroy?.();\n\t\tif (this.anchor.parent === undefined) return;\n\t\tthis.context.checkout.forest.anchors.forget(this.anchor.parent);\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.cursor.getFieldLength();\n\t}\n\n\tpublic atIndex(index: number): FlexTreeUnknownUnboxed {\n\t\treturn inCursorNode(this.cursor, index, (cursor) =>\n\t\t\tunboxedFlexNode(this.context, cursor, this.anchor),\n\t\t);\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeNode | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn inCursorNode(this.cursor, finalIndex, (cursor) => makeTree(this.context, cursor));\n\t}\n\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeNode> {\n\t\treturn iterateCursorField(this.cursor, (cursor) => makeTree(this.context, cursor));\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<FlexTreeUnknownUnboxed> {\n\t\treturn iterateCursorField(this.cursor, (cursor) =>\n\t\t\tunboxedFlexNode(this.context, cursor, this.anchor),\n\t\t);\n\t}\n\n\tpublic getFieldPath(): NormalizedFieldUpPath {\n\t\treturn { parent: this.parent?.anchorNode, field: this.key };\n\t}\n\n\t/**\n\t * Returns the path to this field to use for editing. Throws iff this path is not {@link TreeStatus#InDocument}.\n\t * This path is not valid to hold onto across edits: this must be recalled for each edit.\n\t */\n\tpublic getFieldPathForEditing(): NormalizedFieldUpPath {\n\t\tif (!this.isFreed()) {\n\t\t\tif (\n\t\t\t\t// Only allow editing if we are the root document field...\n\t\t\t\t(this.parent === undefined && this.anchor.fieldKey === rootFieldKey) ||\n\t\t\t\t// ...or are under a node in the document\n\t\t\t\t(this.parent !== undefined &&\n\t\t\t\t\ttreeStatusFromAnchorCache(this.parent.anchorNode) === TreeStatus.InDocument)\n\t\t\t) {\n\t\t\t\treturn this.getFieldPath();\n\t\t\t}\n\t\t}\n\n\t\tthrow new UsageError(\"Editing only allowed on fields with TreeStatus.InDocument status\");\n\t}\n\n\tprotected getEditor(): IDefaultEditBuilder<ITreeCursorSynchronous> {\n\t\treturn new MappedEditBuilder(\n\t\t\tthis.context.checkout.editor,\n\t\t\t(cursor: ITreeCursorSynchronous) => this.context.checkout.forest.chunkField(cursor),\n\t\t);\n\t}\n}\n\nexport class LazySequence extends LazyField implements FlexTreeSequenceField {\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn this.atIndex(finalIndex);\n\t}\n\tpublic get asArray(): readonly FlexTreeUnknownUnboxed[] {\n\t\treturn this.map((x) => x);\n\t}\n\n\tpublic editor: SequenceFieldEditBuilder<ExclusiveMapTree[]> = {\n\t\tinsert: (index, newContent) => {\n\t\t\tthis.sequenceEditor().insert(index, cursorForMapTreeField(newContent));\n\t\t},\n\t\tremove: (index, count) => {\n\t\t\tthis.sequenceEditor().remove(index, count);\n\t\t},\n\t};\n\n\tprivate sequenceEditor(): SequenceFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\treturn this.getEditor().sequenceField(fieldPath);\n\t}\n}\n\nexport class LazyValueField extends LazyField implements FlexTreeRequiredField {\n\tpublic editor: ValueFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent) => {\n\t\t\tthis.valueFieldEditor().set(cursorForMapTreeField([newContent]));\n\t\t},\n\t};\n\n\tprivate valueFieldEditor(): ValueFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.getEditor().valueField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic get content(): FlexTreeUnknownUnboxed {\n\t\treturn this.atIndex(0);\n\t}\n}\n\nexport class LazyOptionalField extends LazyField implements FlexTreeOptionalField {\n\tpublic editor: OptionalFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent, wasEmpty) => {\n\t\t\tthis.optionalEditor().set(\n\t\t\t\tnewContent !== undefined ? cursorForMapTreeField([newContent]) : newContent,\n\t\t\t\twasEmpty,\n\t\t\t);\n\t\t},\n\t};\n\n\tprivate optionalEditor(): OptionalFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.getEditor().optionalField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\treturn this.length === 0 ? undefined : this.atIndex(0);\n\t}\n}\n\nexport class LazyForbiddenField extends LazyField {}\n\ntype Builder = new (\n\tcontext: Context,\n\t// Correct use of these builders requires the builder of the matching type to be used.\n\tschema: FieldKindIdentifier,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n) => LazyField;\n\nconst builderList: [FieldKindIdentifier, Builder][] = [\n\t[FieldKinds.forbidden.identifier, LazyForbiddenField],\n\t[FieldKinds.optional.identifier, LazyOptionalField],\n\t[FieldKinds.sequence.identifier, LazySequence],\n\t[FieldKinds.required.identifier, LazyValueField],\n\t[FieldKinds.identifier.identifier, LazyValueField],\n];\n\nconst kindToClass: ReadonlyMap<FieldKindIdentifier, Builder> = new Map(builderList);\n\n/**\n * Returns the flex tree node, or the value if it has one.\n */\nexport function unboxedFlexNode(\n\tcontext: Context,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n): FlexTreeUnknownUnboxed {\n\tconst value = cursor.value;\n\tif (value !== undefined) {\n\t\treturn value;\n\t}\n\n\t// Try accessing cached child node via anchors.\n\t// This avoids O(depth) related costs from makeTree in the cached case.\n\tconst anchor = fieldAnchor.parent;\n\tlet child: AnchorNode | undefined;\n\tif (anchor !== undefined) {\n\t\tconst anchorNode = context.checkout.forest.anchors.locate(anchor);\n\t\tassert(anchorNode !== undefined, 0xa4c /* missing anchor */);\n\t\tchild = anchorNode.childIfAnchored(fieldAnchor.fieldKey, cursor.fieldIndex);\n\t} else {\n\t\tchild = context.checkout.forest.anchors.find({\n\t\t\tparent: undefined,\n\t\t\tparentField: fieldAnchor.fieldKey,\n\t\t\tparentIndex: cursor.fieldIndex,\n\t\t});\n\t}\n\n\tif (child !== undefined) {\n\t\tconst cached = child.slots.get(flexTreeSlot);\n\t\tif (cached !== undefined) {\n\t\t\treturn cached;\n\t\t}\n\t}\n\n\treturn makeTree(context, cursor);\n}\n"]}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { type AnchorNode, type DetachedField, type SchemaAndPolicy } from "../../core/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import type { FlexTreeContext } from "./context.js";
|
|
7
|
+
import { TreeStatus } from "./flexTreeTypes.js";
|
|
7
8
|
/**
|
|
8
9
|
* Checks the detached field and returns the TreeStatus based on whether or not the detached field is a root field.
|
|
9
10
|
* @param detachedField - the detached field you want to check.
|
|
@@ -27,12 +28,11 @@ export interface DetachedFieldCache {
|
|
|
27
28
|
detachedField: DetachedField;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
* Utility function to get a {@link SchemaAndPolicy} object from a {@link
|
|
31
|
-
* @
|
|
32
|
-
*
|
|
33
|
-
* For {@link Unhydrated} nodes this schema may only describe the types allowed subtree for this particular entity.
|
|
31
|
+
* Utility function to get a {@link SchemaAndPolicy} object from a {@link FlexTreeContext}.
|
|
32
|
+
* @returns A {@link SchemaAndPolicy} object with the stored schema and policy from the context provided.
|
|
33
|
+
* For {@link Unhydrated} contexts this schema may only describe the types allowed subtree for this particular entity.
|
|
34
34
|
*/
|
|
35
|
-
export declare function getSchemaAndPolicy(
|
|
35
|
+
export declare function getSchemaAndPolicy(context: FlexTreeContext): SchemaAndPolicy;
|
|
36
36
|
/**
|
|
37
37
|
* Indexing for {@link FlexTreeField.boxedAt} and {@link FlexTreeSequenceField.at} supports the
|
|
38
38
|
* usage of negative indices, which regular indexing using `[` and `]` does not.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/utilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,UAAU,EACf,KAAK,aAAa,EAIlB,KAAK,eAAe,EACpB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/utilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,UAAU,EACf,KAAK,aAAa,EAIlB,KAAK,eAAe,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,aAAa,GAAG,UAAU,CAEpF;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAkB5E;AAiBD,eAAO,MAAM,iBAAiB,8DAAmC,CAAC;AAElE,MAAM,WAAW,kBAAkB;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,CAK5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY5E"}
|
|
@@ -56,15 +56,14 @@ function getCachedUpdatedDetachedField(anchorNode, generationNumber) {
|
|
|
56
56
|
}
|
|
57
57
|
exports.detachedFieldSlot = (0, index_js_1.anchorSlot)();
|
|
58
58
|
/**
|
|
59
|
-
* Utility function to get a {@link SchemaAndPolicy} object from a {@link
|
|
60
|
-
* @
|
|
61
|
-
*
|
|
62
|
-
* For {@link Unhydrated} nodes this schema may only describe the types allowed subtree for this particular entity.
|
|
59
|
+
* Utility function to get a {@link SchemaAndPolicy} object from a {@link FlexTreeContext}.
|
|
60
|
+
* @returns A {@link SchemaAndPolicy} object with the stored schema and policy from the context provided.
|
|
61
|
+
* For {@link Unhydrated} contexts this schema may only describe the types allowed subtree for this particular entity.
|
|
63
62
|
*/
|
|
64
|
-
function getSchemaAndPolicy(
|
|
63
|
+
function getSchemaAndPolicy(context) {
|
|
65
64
|
return {
|
|
66
|
-
schema:
|
|
67
|
-
policy:
|
|
65
|
+
schema: context.schema,
|
|
66
|
+
policy: context.schemaPolicy,
|
|
68
67
|
};
|
|
69
68
|
}
|
|
70
69
|
exports.getSchemaAndPolicy = getSchemaAndPolicy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/utilities.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAO6B;
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/utilities.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAO6B;AAG7B,yDAAgD;AAChD;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,aAA4B;IACvE,OAAO,aAAa,KAAK,oBAAS,CAAC,CAAC,CAAC,6BAAU,CAAC,UAAU,CAAC,CAAC,CAAC,6BAAU,CAAC,OAAO,CAAC;AACjF,CAAC;AAFD,kEAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,yBAAyB,CAAC,UAAsB;IAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAiB,CAAC,CAAC;IACtD,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC;IAClD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,kGAAkG;QAClG,OAAO,2BAA2B,CACjC,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAC3D,CAAC;IACH,CAAC;SAAM,CAAC;QACP,wFAAwF;QACxF,IAAI,KAAK,CAAC,gBAAgB,KAAK,gBAAgB,EAAE,CAAC;YACjD,OAAO,2BAA2B,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACzD,CAAC;QACD,kHAAkH;QAClH,OAAO,2BAA2B,CACjC,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAC3D,CAAC;IACH,CAAC;AACF,CAAC;AAlBD,8DAkBC;AAED;;GAEG;AACH,SAAS,6BAA6B,CACrC,UAAsB,EACtB,gBAAwB;IAExB,MAAM,aAAa,GAAG,IAAA,yCAA8B,EAAC,UAAU,CAAC,CAAC;IACjE,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAiB,EAAE;QACvC,gBAAgB;QAChB,aAAa;KACb,CAAC,CAAC;IACH,OAAO,aAAa,CAAC;AACtB,CAAC;AAEY,QAAA,iBAAiB,GAAG,IAAA,qBAAU,GAAsB,CAAC;AAOlE;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,OAAwB;IAC1D,OAAO;QACN,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,YAAY;KAC5B,CAAC;AACH,CAAC;AALD,gDAKC;AAED;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAAC,KAAa,EAAE,MAAc;IACvD,IAAI,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,UAAU,GAAG,CAAC,CAAC;IAChB,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,MAAM,IAAI,UAAU,IAAI,MAAM,EAAE,CAAC;QAClD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACpB,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IAClC,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AAZD,gCAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype DetachedField,\n\tanchorSlot,\n\tgetDetachedFieldContainingPath,\n\trootField,\n\ttype SchemaAndPolicy,\n} from \"../../core/index.js\";\nimport type { FlexTreeContext } from \"./context.js\";\n\nimport { TreeStatus } from \"./flexTreeTypes.js\";\n/**\n * Checks the detached field and returns the TreeStatus based on whether or not the detached field is a root field.\n * @param detachedField - the detached field you want to check.\n * @returns the {@link TreeStatus} from the detached field provided.\n */\nexport function treeStatusFromDetachedField(detachedField: DetachedField): TreeStatus {\n\treturn detachedField === rootField ? TreeStatus.InDocument : TreeStatus.Removed;\n}\n\n/**\n * Determines the tree status based on the anchor cache.\n *\n * Checks the anchorNode's cache to get the tree status.\n * If the cache is undefined or stale, it is updated and the treeStatus based on its detachedField is returned.\n *\n * @param anchors - the {@link AnchorSet} to compare your anchorNode cache to.\n * @param anchorNode - the {@link AnchorNode} to get the {@link TreeStatus} of.\n * @returns - the {@link TreeStatus} of the anchorNode provided.\n */\nexport function treeStatusFromAnchorCache(anchorNode: AnchorNode): TreeStatus {\n\tconst cache = anchorNode.slots.get(detachedFieldSlot);\n\tconst { generationNumber } = anchorNode.anchorSet;\n\tif (cache === undefined) {\n\t\t// If the cache is undefined, set the cache and return the treeStatus based on the detached field.\n\t\treturn treeStatusFromDetachedField(\n\t\t\tgetCachedUpdatedDetachedField(anchorNode, generationNumber),\n\t\t);\n\t} else {\n\t\t// If the cache is up to date, return the treeStatus based on the cached detached field.\n\t\tif (cache.generationNumber === generationNumber) {\n\t\t\treturn treeStatusFromDetachedField(cache.detachedField);\n\t\t}\n\t\t// If the cache is not up to date, update the cache and return the treeStatus based on the updated detached field.\n\t\treturn treeStatusFromDetachedField(\n\t\t\tgetCachedUpdatedDetachedField(anchorNode, generationNumber),\n\t\t);\n\t}\n}\n\n/**\n * Updates the anchorNode cache with the provided generation number, and returns its detachedField.\n */\nfunction getCachedUpdatedDetachedField(\n\tanchorNode: AnchorNode,\n\tgenerationNumber: number,\n): DetachedField {\n\tconst detachedField = getDetachedFieldContainingPath(anchorNode);\n\tanchorNode.slots.set(detachedFieldSlot, {\n\t\tgenerationNumber,\n\t\tdetachedField,\n\t});\n\treturn detachedField;\n}\n\nexport const detachedFieldSlot = anchorSlot<DetachedFieldCache>();\n\nexport interface DetachedFieldCache {\n\tgenerationNumber: number;\n\tdetachedField: DetachedField;\n}\n\n/**\n * Utility function to get a {@link SchemaAndPolicy} object from a {@link FlexTreeContext}.\n * @returns A {@link SchemaAndPolicy} object with the stored schema and policy from the context provided.\n * For {@link Unhydrated} contexts this schema may only describe the types allowed subtree for this particular entity.\n */\nexport function getSchemaAndPolicy(context: FlexTreeContext): SchemaAndPolicy {\n\treturn {\n\t\tschema: context.schema,\n\t\tpolicy: context.schemaPolicy,\n\t};\n}\n\n/**\n * Indexing for {@link FlexTreeField.boxedAt} and {@link FlexTreeSequenceField.at} supports the\n * usage of negative indices, which regular indexing using `[` and `]` does not.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at\n * for additional context on the semantics.\n *\n * @returns A positive index that can be used in regular indexing. Returns\n * undefined if that index would be out-of-bounds.\n */\nexport function indexForAt(index: number, length: number): number | undefined {\n\tlet finalIndex = Math.trunc(+index);\n\tif (Number.isNaN(finalIndex)) {\n\t\tfinalIndex = 0;\n\t}\n\tif (finalIndex < -length || finalIndex >= length) {\n\t\treturn undefined;\n\t}\n\tif (finalIndex < 0) {\n\t\tfinalIndex = finalIndex + length;\n\t}\n\treturn finalIndex;\n}\n"]}
|
|
@@ -17,7 +17,7 @@ export { mapRootChanges } from "./deltaUtils.js";
|
|
|
17
17
|
export { type TreeChunk, chunkTree, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, makeTreeChunker, makeFieldBatchCodec, type FieldBatchEncodingContext, } from "./chunked-forest/index.js";
|
|
18
18
|
export { compareLocalNodeIdentifiers, createNodeIdentifierManager, isStableNodeIdentifier, type LocalNodeIdentifier, MockNodeIdentifierManager, type NodeIdentifierManager, nodeKeyTreeIdentifier, type StableNodeIdentifier, } from "./node-identifier/index.js";
|
|
19
19
|
export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationErrors, isNodeInSchema, isFieldInSchema, } from "./default-schema/index.js";
|
|
20
|
-
export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, Skip, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode,
|
|
20
|
+
export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, Skip, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, } from "./flex-tree/index.js";
|
|
21
21
|
export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
|
|
22
22
|
export { valueSchemaAllows } from "./valueUtilities.js";
|
|
23
23
|
export { DetachedFieldIndexSummarizer } from "./detachedFieldIndexSummarizer.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,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