@fluidframework/devtools-core 2.70.0-361092 → 2.70.0-361788
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/README.md +2 -0
- package/api-extractor/api-extractor-lint-beta.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-beta.esm.json +5 -0
- package/api-report/devtools-core.alpha.api.md +11 -11
- package/api-report/devtools-core.beta.api.md +31 -0
- package/beta.d.ts +11 -0
- package/dist/ContainerDevtools.d.ts +5 -3
- package/dist/ContainerDevtools.d.ts.map +1 -1
- package/dist/ContainerDevtools.js.map +1 -1
- package/dist/ContainerRuntimeDevtools.d.ts +3 -2
- package/dist/ContainerRuntimeDevtools.d.ts.map +1 -1
- package/dist/ContainerRuntimeDevtools.js.map +1 -1
- package/dist/FluidDevtools.d.ts +7 -5
- package/dist/FluidDevtools.d.ts.map +1 -1
- package/dist/FluidDevtools.js +2 -2
- package/dist/FluidDevtools.js.map +1 -1
- package/dist/IFluidDevtools.d.ts +1 -1
- package/dist/IFluidDevtools.js.map +1 -1
- package/dist/alpha.d.ts +4 -7
- package/dist/beta.d.ts +42 -0
- package/dist/data-visualization/SharedTreeVisualizer.d.ts +1 -1
- package/dist/data-visualization/SharedTreeVisualizer.js +2 -2
- package/dist/data-visualization/SharedTreeVisualizer.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/ContainerDevtools.d.ts +5 -3
- package/lib/ContainerDevtools.d.ts.map +1 -1
- package/lib/ContainerDevtools.js.map +1 -1
- package/lib/ContainerRuntimeDevtools.d.ts +3 -2
- package/lib/ContainerRuntimeDevtools.d.ts.map +1 -1
- package/lib/ContainerRuntimeDevtools.js.map +1 -1
- package/lib/FluidDevtools.d.ts +7 -5
- package/lib/FluidDevtools.d.ts.map +1 -1
- package/lib/FluidDevtools.js +2 -2
- package/lib/FluidDevtools.js.map +1 -1
- package/lib/IFluidDevtools.d.ts +1 -1
- package/lib/IFluidDevtools.js.map +1 -1
- package/lib/alpha.d.ts +4 -7
- package/lib/beta.d.ts +42 -0
- package/lib/data-visualization/SharedTreeVisualizer.d.ts +1 -1
- package/lib/data-visualization/SharedTreeVisualizer.js +2 -2
- package/lib/data-visualization/SharedTreeVisualizer.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +35 -23
- package/src/ContainerDevtools.ts +5 -3
- package/src/ContainerRuntimeDevtools.ts +3 -2
- package/src/FluidDevtools.ts +7 -5
- package/src/IFluidDevtools.ts +1 -1
- package/src/data-visualization/SharedTreeVisualizer.ts +2 -2
- package/src/packageVersion.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SharedTreeVisualizer.js","sourceRoot":"","sources":["../../src/data-visualization/SharedTreeVisualizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AASjD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAI9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAEN,cAAc,GAKd,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAwB;IACzD,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,cAAc,CAAC,QAAQ,CAAC;QAC7B,KAAK,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;YACrC,OAAO,cAAc,CAAC,aAAa,CAAC;QACrC,CAAC;QACD,KAAK,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;YAC/B,OAAO,cAAc,CAAC,cAAc,CAAC;QACtC,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,cAAc,CAAC,sBAAsB,CAAC;QAC9C,CAAC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AAM,kBAAkB,CAAC,IAAI,CAAC;YACrC,IAAI,EAAE,wBAAwB,CAAC,QAAQ;SACvC;QACF,CAAC,CAAC,qBAAqB,CACrB,IAAI,EACJ,eAAe,EACf,EAAE,YAAY,EAAE,UAAU,EAAE,EAC5B,kBAAkB,CAClB,CAAC;AACL,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FieldKind } from \"@fluidframework/tree\";\nimport type {\n\tSimpleArrayNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleNodeSchema,\n\tSimpleObjectNodeSchema,\n\tVerboseTree,\n\tVerboseTreeNode,\n} from \"@fluidframework/tree/internal\";\nimport { NodeKind, SchemaFactory, Tree } from \"@fluidframework/tree/internal\";\n\nimport type { VisualizeChildData } from \"./DataVisualization.js\";\nimport type { VisualSharedTreeNode, SharedTreeSchemaNode } from \"./VisualSharedTreeTypes.js\";\nimport { VisualSharedTreeNodeKind } from \"./VisualSharedTreeTypes.js\";\nimport {\n\ttype VisualChildNode,\n\tVisualNodeKind,\n\ttype VisualValueNode,\n\ttype VisualTreeNode,\n\ttype FluidHandleNode,\n\ttype UnknownObjectNode,\n} from \"./VisualTree.js\";\n\n/**\n * Returns VisualNodeKind that is compatible to {@link FluidObjectNode} based on the `visualTree`'s node kind.\n */\nexport function determineNodeKind(nodeKind: VisualNodeKind): VisualNodeKind {\n\tswitch (nodeKind) {\n\t\tcase VisualNodeKind.TreeNode:\n\t\tcase VisualNodeKind.FluidHandleNode: {\n\t\t\treturn VisualNodeKind.FluidTreeNode;\n\t\t}\n\t\tcase VisualNodeKind.ValueNode: {\n\t\t\treturn VisualNodeKind.FluidValueNode;\n\t\t}\n\t\tdefault: {\n\t\t\treturn VisualNodeKind.FluidUnknownObjectNode;\n\t\t}\n\t}\n}\n\n/**\n * Returns allowed types of the non-leaf nodes in the tree.\n * @param allowedTypes - a string if array node, `Record<string, string>` for non-array nodes.\n * @returns - a VisualChildNode with the allowed type.\n */\nfunction createAllowedTypesVisualTree(\n\tallowedTypes: string | Record<string, string>,\n): VisualChildNode {\n\tif (typeof allowedTypes === \"string\") {\n\t\treturn {\n\t\t\tvalue: allowedTypes,\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\tconst result: Record<string, VisualValueNode> = {};\n\tfor (const [allowedTypeKey, allowedType] of Object.entries(allowedTypes)) {\n\t\tresult[allowedTypeKey] = {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: allowedType,\n\t\t};\n\t}\n\n\treturn {\n\t\tchildren: result,\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t};\n}\n\n/**\n * Creates a visual representation of the schema of the tree in {@link VisualTreeNode} format.\n */\nfunction createToolTipContents(schema: SharedTreeSchemaNode): VisualTreeNode {\n\tconst children: Record<string, VisualChildNode> = {\n\t\tname: {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: schema.schemaName,\n\t\t},\n\t};\n\tif (schema.allowedTypes !== undefined) {\n\t\tchildren.allowedTypes = createAllowedTypesVisualTree(schema.allowedTypes);\n\t}\n\tif (schema.isRequired !== undefined) {\n\t\tchildren.isRequired = {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: schema.isRequired,\n\t\t};\n\t}\n\treturn {\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\tchildren,\n\t};\n}\n\n/**\n * Converts the visual representation from {@link visualizeNodeBySchema} to a visual tree compatible with the devtools-view.\n * @param tree - the visual representation of the SharedTree.\n * @returns - the visual representation of type {@link VisualChildNode}\n */\nexport function toVisualTree(tree: VisualSharedTreeNode): VisualChildNode {\n\tif (tree.kind === VisualSharedTreeNodeKind.LeafNode) {\n\t\tswitch (tree.value.nodeKind) {\n\t\t\tcase VisualNodeKind.ValueNode: {\n\t\t\t\tconst result: VisualValueNode = {\n\t\t\t\t\tvalue: tree.value.value,\n\t\t\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase VisualNodeKind.FluidHandleNode: {\n\t\t\t\tconst result: FluidHandleNode = {\n\t\t\t\t\tfluidObjectId: tree.value.fluidObjectId,\n\t\t\t\t\tnodeKind: VisualNodeKind.FluidHandleNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tconsole.error(`Unknown node kind: ${tree.value.nodeKind}`);\n\t\t\t\tconst result: UnknownObjectNode = {\n\t\t\t\t\tnodeKind: VisualNodeKind.UnknownObjectNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst children: Record<string, VisualChildNode> = {};\n\n\t\tfor (const [key, value] of Object.entries(tree.fields)) {\n\t\t\tconst child = toVisualTree(value);\n\t\t\tchildren[key] = child;\n\t\t}\n\n\t\treturn {\n\t\t\tchildren,\n\t\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\t\ttooltipContents: {\n\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * Concatenate allowed types for `ObjectNodeStoredSchema` and `MapNodeStoredSchema`.\n */\nexport function concatenateTypes(fieldTypes: ReadonlySet<string>): string {\n\treturn [...fieldTypes].join(\" | \");\n}\n\n/**\n * Properties that describe schema constraints for a field in the tree\n */\ninterface FieldSchemaProperties {\n\tallowedTypes: ReadonlySet<string> | undefined;\n\n\t/**\n\t * Whether the field is required (true) or optional (false).\n\t *\n\t * `undefined` indicates that the field is implicitly required.\n\t * In this case, no requirement information will be displayed by the devtools.\n\t */\n\tisRequired: boolean | undefined;\n}\n\n/**\n * Processes and visualizes the fields of a verbose tree node.\n *\n * @param treeFields - The fields of the tree node to visualize. Can be either an array of VerboseTree (for array nodes) or a Record of field names to VerboseTree (for object/map nodes).\n * @param treeDefinitions - Map containing all schema definitions for the entire tree structure. Each definition describes the shape and constraints of a particular node type.\n * @param fieldSchemaProperties - Record mapping field names to their schema properties, including allowed types and whether they are required.\n * @param visualizeChildData - Callback function to visualize child node data.\n *\n * @returns A record mapping field names/indices to their visual tree representations.\n */\nasync function visualizeVerboseNodeFields(\n\ttreeFields: readonly VerboseTree[] | Record<string, VerboseTree>,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\tfieldSchemaProperties: Record<string, FieldSchemaProperties>,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<Record<string, VisualSharedTreeNode>> {\n\tconst fields: Record<string | number, VisualSharedTreeNode> = {};\n\n\tfor (const [fieldKey, childField] of Object.entries(treeFields)) {\n\t\tfields[fieldKey] = await visualizeSharedTreeBySchema(\n\t\t\tchildField,\n\t\t\ttreeDefinitions,\n\t\t\t{\n\t\t\t\tallowedTypes: fieldSchemaProperties[fieldKey]?.allowedTypes,\n\t\t\t\tisRequired: fieldSchemaProperties[fieldKey]?.isRequired,\n\t\t\t},\n\t\t\tvisualizeChildData,\n\t\t);\n\t}\n\n\treturn fields;\n}\n\n/**\n * Returns the schema & fields of the node with type {@link ObjectNodeStoredSchema}.\n */\nasync function visualizeObjectNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleObjectNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst objectNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const [fieldKey, treeFieldSimpleSchema] of schema.fields) {\n\t\tobjectNodeSchemaProperties[fieldKey] = {\n\t\t\tallowedTypes: treeFieldSimpleSchema.allowedTypesIdentifiers,\n\t\t\tisRequired: treeFieldSimpleSchema.kind === FieldKind.Required ? true : false,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tobjectNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Returns the schema & fields of the node with type {@link MapNodeStoredSchema}.\n */\nasync function visualizeMapNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleMapNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst mapNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const key of Object.keys(tree.fields)) {\n\t\tmapNodeSchemaProperties[key] = {\n\t\t\tallowedTypes: schema.allowedTypesIdentifiers,\n\t\t\t// Map values are always required. Don't display field requirement information, since that information is redundant.\n\t\t\tisRequired: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tmapNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Returns the schema & fields of the node with type {@link ArrayNodeStoredSchema}.\n */\nasync function visualizeArrayNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleArrayNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst children = tree.fields;\n\tif (!Array.isArray(children)) {\n\t\tthrow new TypeError(\"Invalid array\");\n\t}\n\n\tconst arrayNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const [i] of children.entries()) {\n\t\tarrayNodeSchemaProperties[i] = {\n\t\t\tallowedTypes: schema.allowedTypesIdentifiers,\n\t\t\t// Array values are always required. Don't display field requirement information, since that information is redundant.\n\t\t\tisRequired: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tarrayNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Creates the visual representation of non-leaf SharedTree nodes.\n *\n * @remarks\n * Processes internal tree nodes based on their schema type (e.g., ObjectNodeStoredSchema, MapNodeStoredSchema, ArrayNodeStoredSchema),\n * producing the visual representation for each type.\n *\n * @see {@link https://fluidframework.com/docs/data-structures/tree/} for more information on the SharedTree schema.\n *\n * @remarks\n */\nasync function visualizeNodeBySchema(\n\ttree: VerboseTreeNode,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst schema = treeDefinitions.get(tree.type);\n\n\tif (schema === undefined) {\n\t\tthrow new TypeError(\"Unrecognized schema type.\");\n\t}\n\n\tswitch (schema.kind) {\n\t\tcase NodeKind.Object: {\n\t\t\tconst objectVisualized = visualizeObjectNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t\treturn objectVisualized;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\tconst mapVisualized = visualizeMapNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t\treturn mapVisualized;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\treturn visualizeArrayNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t}\n\t\tdefault: {\n\t\t\tthrow new TypeError(\"Unrecognized schema type.\");\n\t\t}\n\t}\n}\n\n/**\n * Creates a visual representation of a SharedTree based on its schema.\n * @param tree - The {@link VerboseTree} to visualize\n * @param treeDefinitions - Map containing all schema definitions for the entire tree structure. Each definition\n * describes the shape and constraints of a particular node type.\n * @param fieldSchemaProperties - Properties describing schema constraints for this field:\n * - `allowedTypes`: Set of type names that are valid for this specific node position in the tree.\n * This is a subset of the types defined in treeDefinitions.\n * - `isRequired`: Whether this field is required in its parent object schema.\n * Only meaningful for direct children of object nodes.\n * Undefined for array/map elements since they are always required within their parent.\n * @param visualizeChildData - Callback function to visualize child node data\n * @returns A visual representation of the tree that includes schema information and node values\n *\n * @remarks\n * This function handles both leaf nodes (primitive values, handles) and internal nodes (objects, maps, arrays).\n * For leaf nodes, it creates a visual representation with the node's schema and value.\n * For internal nodes, it recursively processes the node's fields using {@link visualizeNodeBySchema}.\n */\nexport async function visualizeSharedTreeBySchema(\n\ttree: VerboseTree,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\treturn Tree.is(tree, SchemaFactory.leaves)\n\t\t? {\n\t\t\t\tschema: {\n\t\t\t\t\tschemaName: Tree.schema(tree).identifier,\n\t\t\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\t\t\tisRequired: isRequired?.toString(),\n\t\t\t\t},\n\t\t\t\tvalue: await visualizeChildData(tree),\n\t\t\t\tkind: VisualSharedTreeNodeKind.LeafNode,\n\t\t\t}\n\t\t: visualizeNodeBySchema(\n\t\t\t\ttree,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SharedTreeVisualizer.js","sourceRoot":"","sources":["../../src/data-visualization/SharedTreeVisualizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AASjD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAI9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAEN,cAAc,GAKd,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAwB;IACzD,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,cAAc,CAAC,QAAQ,CAAC;QAC7B,KAAK,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;YACrC,OAAO,cAAc,CAAC,aAAa,CAAC;QACrC,CAAC;QACD,KAAK,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;YAC/B,OAAO,cAAc,CAAC,cAAc,CAAC;QACtC,CAAC;QACD,OAAO,CAAC,CAAC,CAA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E,UAAU,EAAE,QAAQ,EAAE;aAClC;YACD,KAAK,EAAE,MAAM,kBAAkB,CAAC,IAAI,CAAC;YACrC,IAAI,EAAE,wBAAwB,CAAC,QAAQ;SACvC;QACF,CAAC,CAAC,qBAAqB,CACrB,IAAI,EACJ,eAAe,EACf,EAAE,YAAY,EAAE,UAAU,EAAE,EAC5B,kBAAkB,CAClB,CAAC;AACL,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FieldKind } from \"@fluidframework/tree\";\nimport type {\n\tSimpleArrayNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleNodeSchema,\n\tSimpleObjectNodeSchema,\n\tVerboseTree,\n\tVerboseTreeNode,\n} from \"@fluidframework/tree/internal\";\nimport { NodeKind, SchemaFactory, Tree } from \"@fluidframework/tree/internal\";\n\nimport type { VisualizeChildData } from \"./DataVisualization.js\";\nimport type { VisualSharedTreeNode, SharedTreeSchemaNode } from \"./VisualSharedTreeTypes.js\";\nimport { VisualSharedTreeNodeKind } from \"./VisualSharedTreeTypes.js\";\nimport {\n\ttype VisualChildNode,\n\tVisualNodeKind,\n\ttype VisualValueNode,\n\ttype VisualTreeNode,\n\ttype FluidHandleNode,\n\ttype UnknownObjectNode,\n} from \"./VisualTree.js\";\n\n/**\n * Returns VisualNodeKind that is compatible to {@link FluidObjectNode} based on the `visualTree`'s node kind.\n */\nexport function determineNodeKind(nodeKind: VisualNodeKind): VisualNodeKind {\n\tswitch (nodeKind) {\n\t\tcase VisualNodeKind.TreeNode:\n\t\tcase VisualNodeKind.FluidHandleNode: {\n\t\t\treturn VisualNodeKind.FluidTreeNode;\n\t\t}\n\t\tcase VisualNodeKind.ValueNode: {\n\t\t\treturn VisualNodeKind.FluidValueNode;\n\t\t}\n\t\tdefault: {\n\t\t\treturn VisualNodeKind.FluidUnknownObjectNode;\n\t\t}\n\t}\n}\n\n/**\n * Returns allowed types of the non-leaf nodes in the tree.\n * @param allowedTypes - a string if array node, `Record<string, string>` for non-array nodes.\n * @returns a VisualChildNode with the allowed type.\n */\nfunction createAllowedTypesVisualTree(\n\tallowedTypes: string | Record<string, string>,\n): VisualChildNode {\n\tif (typeof allowedTypes === \"string\") {\n\t\treturn {\n\t\t\tvalue: allowedTypes,\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\tconst result: Record<string, VisualValueNode> = {};\n\tfor (const [allowedTypeKey, allowedType] of Object.entries(allowedTypes)) {\n\t\tresult[allowedTypeKey] = {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: allowedType,\n\t\t};\n\t}\n\n\treturn {\n\t\tchildren: result,\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t};\n}\n\n/**\n * Creates a visual representation of the schema of the tree in {@link VisualTreeNode} format.\n */\nfunction createToolTipContents(schema: SharedTreeSchemaNode): VisualTreeNode {\n\tconst children: Record<string, VisualChildNode> = {\n\t\tname: {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: schema.schemaName,\n\t\t},\n\t};\n\tif (schema.allowedTypes !== undefined) {\n\t\tchildren.allowedTypes = createAllowedTypesVisualTree(schema.allowedTypes);\n\t}\n\tif (schema.isRequired !== undefined) {\n\t\tchildren.isRequired = {\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\tvalue: schema.isRequired,\n\t\t};\n\t}\n\treturn {\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\tchildren,\n\t};\n}\n\n/**\n * Converts the visual representation from {@link visualizeNodeBySchema} to a visual tree compatible with the devtools-view.\n * @param tree - the visual representation of the SharedTree.\n * @returns the visual representation of type {@link VisualChildNode}\n */\nexport function toVisualTree(tree: VisualSharedTreeNode): VisualChildNode {\n\tif (tree.kind === VisualSharedTreeNodeKind.LeafNode) {\n\t\tswitch (tree.value.nodeKind) {\n\t\t\tcase VisualNodeKind.ValueNode: {\n\t\t\t\tconst result: VisualValueNode = {\n\t\t\t\t\tvalue: tree.value.value,\n\t\t\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcase VisualNodeKind.FluidHandleNode: {\n\t\t\t\tconst result: FluidHandleNode = {\n\t\t\t\t\tfluidObjectId: tree.value.fluidObjectId,\n\t\t\t\t\tnodeKind: VisualNodeKind.FluidHandleNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tconsole.error(`Unknown node kind: ${tree.value.nodeKind}`);\n\t\t\t\tconst result: UnknownObjectNode = {\n\t\t\t\t\tnodeKind: VisualNodeKind.UnknownObjectNode,\n\t\t\t\t\ttooltipContents: {\n\t\t\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst children: Record<string, VisualChildNode> = {};\n\n\t\tfor (const [key, value] of Object.entries(tree.fields)) {\n\t\t\tconst child = toVisualTree(value);\n\t\t\tchildren[key] = child;\n\t\t}\n\n\t\treturn {\n\t\t\tchildren,\n\t\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\t\ttooltipContents: {\n\t\t\t\tschema: createToolTipContents(tree.schema),\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * Concatenate allowed types for `ObjectNodeStoredSchema` and `MapNodeStoredSchema`.\n */\nexport function concatenateTypes(fieldTypes: ReadonlySet<string>): string {\n\treturn [...fieldTypes].join(\" | \");\n}\n\n/**\n * Properties that describe schema constraints for a field in the tree\n */\ninterface FieldSchemaProperties {\n\tallowedTypes: ReadonlySet<string> | undefined;\n\n\t/**\n\t * Whether the field is required (true) or optional (false).\n\t *\n\t * `undefined` indicates that the field is implicitly required.\n\t * In this case, no requirement information will be displayed by the devtools.\n\t */\n\tisRequired: boolean | undefined;\n}\n\n/**\n * Processes and visualizes the fields of a verbose tree node.\n *\n * @param treeFields - The fields of the tree node to visualize. Can be either an array of VerboseTree (for array nodes) or a Record of field names to VerboseTree (for object/map nodes).\n * @param treeDefinitions - Map containing all schema definitions for the entire tree structure. Each definition describes the shape and constraints of a particular node type.\n * @param fieldSchemaProperties - Record mapping field names to their schema properties, including allowed types and whether they are required.\n * @param visualizeChildData - Callback function to visualize child node data.\n *\n * @returns A record mapping field names/indices to their visual tree representations.\n */\nasync function visualizeVerboseNodeFields(\n\ttreeFields: readonly VerboseTree[] | Record<string, VerboseTree>,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\tfieldSchemaProperties: Record<string, FieldSchemaProperties>,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<Record<string, VisualSharedTreeNode>> {\n\tconst fields: Record<string | number, VisualSharedTreeNode> = {};\n\n\tfor (const [fieldKey, childField] of Object.entries(treeFields)) {\n\t\tfields[fieldKey] = await visualizeSharedTreeBySchema(\n\t\t\tchildField,\n\t\t\ttreeDefinitions,\n\t\t\t{\n\t\t\t\tallowedTypes: fieldSchemaProperties[fieldKey]?.allowedTypes,\n\t\t\t\tisRequired: fieldSchemaProperties[fieldKey]?.isRequired,\n\t\t\t},\n\t\t\tvisualizeChildData,\n\t\t);\n\t}\n\n\treturn fields;\n}\n\n/**\n * Returns the schema & fields of the node with type {@link ObjectNodeStoredSchema}.\n */\nasync function visualizeObjectNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleObjectNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst objectNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const [fieldKey, treeFieldSimpleSchema] of schema.fields) {\n\t\tobjectNodeSchemaProperties[fieldKey] = {\n\t\t\tallowedTypes: treeFieldSimpleSchema.allowedTypesIdentifiers,\n\t\t\tisRequired: treeFieldSimpleSchema.kind === FieldKind.Required ? true : false,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tobjectNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Returns the schema & fields of the node with type {@link MapNodeStoredSchema}.\n */\nasync function visualizeMapNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleMapNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst mapNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const key of Object.keys(tree.fields)) {\n\t\tmapNodeSchemaProperties[key] = {\n\t\t\tallowedTypes: schema.allowedTypesIdentifiers,\n\t\t\t// Map values are always required. Don't display field requirement information, since that information is redundant.\n\t\t\tisRequired: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tmapNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Returns the schema & fields of the node with type {@link ArrayNodeStoredSchema}.\n */\nasync function visualizeArrayNode(\n\ttree: VerboseTreeNode,\n\tschema: SimpleArrayNodeSchema,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst children = tree.fields;\n\tif (!Array.isArray(children)) {\n\t\tthrow new TypeError(\"Invalid array\");\n\t}\n\n\tconst arrayNodeSchemaProperties: Record<string, FieldSchemaProperties> = {};\n\tfor (const [i] of children.entries()) {\n\t\tarrayNodeSchemaProperties[i] = {\n\t\t\tallowedTypes: schema.allowedTypesIdentifiers,\n\t\t\t// Array values are always required. Don't display field requirement information, since that information is redundant.\n\t\t\tisRequired: undefined,\n\t\t};\n\t}\n\n\treturn {\n\t\tschema: {\n\t\t\tschemaName: tree.type,\n\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\tisRequired: isRequired?.toString(),\n\t\t},\n\t\tfields: await visualizeVerboseNodeFields(\n\t\t\ttree.fields,\n\t\t\ttreeDefinitions,\n\t\t\tarrayNodeSchemaProperties,\n\t\t\tvisualizeChildData,\n\t\t),\n\t\tkind: VisualSharedTreeNodeKind.InternalNode,\n\t};\n}\n\n/**\n * Creates the visual representation of non-leaf SharedTree nodes.\n *\n * @remarks\n * Processes internal tree nodes based on their schema type (e.g., ObjectNodeStoredSchema, MapNodeStoredSchema, ArrayNodeStoredSchema),\n * producing the visual representation for each type.\n *\n * @see {@link https://fluidframework.com/docs/data-structures/tree/} for more information on the SharedTree schema.\n *\n * @remarks\n */\nasync function visualizeNodeBySchema(\n\ttree: VerboseTreeNode,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\tconst schema = treeDefinitions.get(tree.type);\n\n\tif (schema === undefined) {\n\t\tthrow new TypeError(\"Unrecognized schema type.\");\n\t}\n\n\tswitch (schema.kind) {\n\t\tcase NodeKind.Object: {\n\t\t\tconst objectVisualized = visualizeObjectNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t\treturn objectVisualized;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\tconst mapVisualized = visualizeMapNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t\treturn mapVisualized;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\treturn visualizeArrayNode(\n\t\t\t\ttree,\n\t\t\t\tschema,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n\t\t}\n\t\tdefault: {\n\t\t\tthrow new TypeError(\"Unrecognized schema type.\");\n\t\t}\n\t}\n}\n\n/**\n * Creates a visual representation of a SharedTree based on its schema.\n * @param tree - The {@link VerboseTree} to visualize\n * @param treeDefinitions - Map containing all schema definitions for the entire tree structure. Each definition\n * describes the shape and constraints of a particular node type.\n * @param fieldSchemaProperties - Properties describing schema constraints for this field:\n * - `allowedTypes`: Set of type names that are valid for this specific node position in the tree.\n * This is a subset of the types defined in treeDefinitions.\n * - `isRequired`: Whether this field is required in its parent object schema.\n * Only meaningful for direct children of object nodes.\n * Undefined for array/map elements since they are always required within their parent.\n * @param visualizeChildData - Callback function to visualize child node data\n * @returns A visual representation of the tree that includes schema information and node values\n *\n * @remarks\n * This function handles both leaf nodes (primitive values, handles) and internal nodes (objects, maps, arrays).\n * For leaf nodes, it creates a visual representation with the node's schema and value.\n * For internal nodes, it recursively processes the node's fields using {@link visualizeNodeBySchema}.\n */\nexport async function visualizeSharedTreeBySchema(\n\ttree: VerboseTree,\n\ttreeDefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n\t{ allowedTypes, isRequired }: FieldSchemaProperties,\n\tvisualizeChildData: VisualizeChildData,\n): Promise<VisualSharedTreeNode> {\n\treturn Tree.is(tree, SchemaFactory.leaves)\n\t\t? {\n\t\t\t\tschema: {\n\t\t\t\t\tschemaName: Tree.schema(tree).identifier,\n\t\t\t\t\tallowedTypes: concatenateTypes(allowedTypes ?? new Set()),\n\t\t\t\t\tisRequired: isRequired?.toString(),\n\t\t\t\t},\n\t\t\t\tvalue: await visualizeChildData(tree),\n\t\t\t\tkind: VisualSharedTreeNodeKind.LeafNode,\n\t\t\t}\n\t\t: visualizeNodeBySchema(\n\t\t\t\ttree,\n\t\t\t\ttreeDefinitions,\n\t\t\t\t{ allowedTypes, isRequired },\n\t\t\t\tvisualizeChildData,\n\t\t\t);\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -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/devtools-core";
|
|
8
|
-
export declare const pkgVersion = "2.70.0-
|
|
8
|
+
export declare const pkgVersion = "2.70.0-361788";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,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/devtools-core\";\nexport const pkgVersion = \"2.70.0-
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,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/devtools-core\";\nexport const pkgVersion = \"2.70.0-361788\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/devtools-core",
|
|
3
|
-
"version": "2.70.0-
|
|
3
|
+
"version": "2.70.0-361788",
|
|
4
4
|
"description": "Fluid Framework developer tools core functionality",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -33,6 +33,16 @@
|
|
|
33
33
|
"default": "./dist/index.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
+
"./beta": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./lib/beta.d.ts",
|
|
39
|
+
"default": "./lib/index.js"
|
|
40
|
+
},
|
|
41
|
+
"require": {
|
|
42
|
+
"types": "./dist/beta.d.ts",
|
|
43
|
+
"default": "./dist/index.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
36
46
|
"./internal": {
|
|
37
47
|
"import": {
|
|
38
48
|
"types": "./lib/index.d.ts",
|
|
@@ -67,37 +77,37 @@
|
|
|
67
77
|
"temp-directory": "nyc/.nyc_output"
|
|
68
78
|
},
|
|
69
79
|
"dependencies": {
|
|
70
|
-
"@fluid-internal/client-utils": "2.70.0-
|
|
71
|
-
"@fluidframework/aqueduct": "2.70.0-
|
|
72
|
-
"@fluidframework/cell": "2.70.0-
|
|
73
|
-
"@fluidframework/container-definitions": "2.70.0-
|
|
74
|
-
"@fluidframework/container-loader": "2.70.0-
|
|
75
|
-
"@fluidframework/container-runtime": "2.70.0-
|
|
76
|
-
"@fluidframework/container-runtime-definitions": "2.70.0-
|
|
77
|
-
"@fluidframework/core-interfaces": "2.70.0-
|
|
78
|
-
"@fluidframework/core-utils": "2.70.0-
|
|
79
|
-
"@fluidframework/counter": "2.70.0-
|
|
80
|
-
"@fluidframework/datastore-definitions": "2.70.0-
|
|
81
|
-
"@fluidframework/driver-definitions": "2.70.0-
|
|
82
|
-
"@fluidframework/map": "2.70.0-
|
|
83
|
-
"@fluidframework/matrix": "2.70.0-
|
|
84
|
-
"@fluidframework/runtime-definitions": "2.70.0-
|
|
85
|
-
"@fluidframework/sequence": "2.70.0-
|
|
86
|
-
"@fluidframework/shared-object-base": "2.70.0-
|
|
87
|
-
"@fluidframework/telemetry-utils": "2.70.0-
|
|
88
|
-
"@fluidframework/tree": "2.70.0-
|
|
80
|
+
"@fluid-internal/client-utils": "2.70.0-361788",
|
|
81
|
+
"@fluidframework/aqueduct": "2.70.0-361788",
|
|
82
|
+
"@fluidframework/cell": "2.70.0-361788",
|
|
83
|
+
"@fluidframework/container-definitions": "2.70.0-361788",
|
|
84
|
+
"@fluidframework/container-loader": "2.70.0-361788",
|
|
85
|
+
"@fluidframework/container-runtime": "2.70.0-361788",
|
|
86
|
+
"@fluidframework/container-runtime-definitions": "2.70.0-361788",
|
|
87
|
+
"@fluidframework/core-interfaces": "2.70.0-361788",
|
|
88
|
+
"@fluidframework/core-utils": "2.70.0-361788",
|
|
89
|
+
"@fluidframework/counter": "2.70.0-361788",
|
|
90
|
+
"@fluidframework/datastore-definitions": "2.70.0-361788",
|
|
91
|
+
"@fluidframework/driver-definitions": "2.70.0-361788",
|
|
92
|
+
"@fluidframework/map": "2.70.0-361788",
|
|
93
|
+
"@fluidframework/matrix": "2.70.0-361788",
|
|
94
|
+
"@fluidframework/runtime-definitions": "2.70.0-361788",
|
|
95
|
+
"@fluidframework/sequence": "2.70.0-361788",
|
|
96
|
+
"@fluidframework/shared-object-base": "2.70.0-361788",
|
|
97
|
+
"@fluidframework/telemetry-utils": "2.70.0-361788",
|
|
98
|
+
"@fluidframework/tree": "2.70.0-361788"
|
|
89
99
|
},
|
|
90
100
|
"devDependencies": {
|
|
91
101
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
92
102
|
"@biomejs/biome": "~1.9.3",
|
|
93
|
-
"@fluid-internal/mocha-test-setup": "2.70.0-
|
|
103
|
+
"@fluid-internal/mocha-test-setup": "2.70.0-361788",
|
|
94
104
|
"@fluid-tools/build-cli": "^0.58.3",
|
|
95
105
|
"@fluidframework/build-common": "^2.0.3",
|
|
96
106
|
"@fluidframework/build-tools": "^0.58.3",
|
|
97
107
|
"@fluidframework/devtools-core-previous": "npm:@fluidframework/devtools-core@2.63.0",
|
|
98
108
|
"@fluidframework/eslint-config-fluid": "^6.1.0",
|
|
99
|
-
"@fluidframework/id-compressor": "2.70.0-
|
|
100
|
-
"@fluidframework/test-runtime-utils": "2.70.0-
|
|
109
|
+
"@fluidframework/id-compressor": "2.70.0-361788",
|
|
110
|
+
"@fluidframework/test-runtime-utils": "2.70.0-361788",
|
|
101
111
|
"@microsoft/api-extractor": "7.52.11",
|
|
102
112
|
"@types/chai": "^4.0.0",
|
|
103
113
|
"@types/mocha": "^10.0.10",
|
|
@@ -136,8 +146,10 @@
|
|
|
136
146
|
"check:exports": "concurrently \"npm:check:exports:*\"",
|
|
137
147
|
"check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
|
|
138
148
|
"check:exports:cjs:alpha": "api-extractor run --config api-extractor/api-extractor-lint-alpha.cjs.json",
|
|
149
|
+
"check:exports:cjs:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.cjs.json",
|
|
139
150
|
"check:exports:cjs:public": "api-extractor run --config api-extractor/api-extractor-lint-public.cjs.json",
|
|
140
151
|
"check:exports:esm:alpha": "api-extractor run --config api-extractor/api-extractor-lint-alpha.esm.json",
|
|
152
|
+
"check:exports:esm:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.esm.json",
|
|
141
153
|
"check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
|
|
142
154
|
"check:format": "npm run check:biome",
|
|
143
155
|
"ci:build:docs": "api-extractor run",
|
package/src/ContainerDevtools.ts
CHANGED
|
@@ -18,13 +18,15 @@ import {
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Properties for registering a {@link @fluidframework/container-definitions#IContainer} with the Devtools.
|
|
21
|
-
* @
|
|
21
|
+
* @beta
|
|
22
|
+
* @input
|
|
23
|
+
* @sealed
|
|
22
24
|
*/
|
|
23
25
|
export interface ContainerDevtoolsProps extends HasContainerKey {
|
|
24
26
|
/**
|
|
25
27
|
* The Container to register with the Devtools.
|
|
26
28
|
*/
|
|
27
|
-
container: IContainer;
|
|
29
|
+
readonly container: IContainer;
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* (optional) Distributed Data Structures (DDSs) associated with the
|
|
@@ -39,7 +41,7 @@ export interface ContainerDevtoolsProps extends HasContainerKey {
|
|
|
39
41
|
*
|
|
40
42
|
* @privateRemarks TODO: rename this to make it more clear that this data does not *belong* to the Container.
|
|
41
43
|
*/
|
|
42
|
-
containerData?: Record<string, IFluidLoadable>;
|
|
44
|
+
readonly containerData?: Record<string, IFluidLoadable>;
|
|
43
45
|
|
|
44
46
|
// TODO: Add ability for customers to specify custom visualizer overrides
|
|
45
47
|
}
|
|
@@ -23,7 +23,8 @@ import type { InboundHandlers } from "./messaging/index.js";
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Properties for registering a container runtime with the Devtools.
|
|
26
|
-
* @
|
|
26
|
+
* @beta
|
|
27
|
+
* @sealed
|
|
27
28
|
* @input
|
|
28
29
|
*/
|
|
29
30
|
export interface ContainerRuntimeProps {
|
|
@@ -35,7 +36,7 @@ export interface ContainerRuntimeProps {
|
|
|
35
36
|
/**
|
|
36
37
|
* Optional label for the container runtime replacing the guid generated by {@link @fluidframework/container-runtime#IContainerRuntime.generateDocumentUniqueId}.
|
|
37
38
|
*/
|
|
38
|
-
label?: string;
|
|
39
|
+
readonly label?: string;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/**
|
package/src/FluidDevtools.ts
CHANGED
|
@@ -77,7 +77,9 @@ export function getContainerAlreadyRegisteredErrorText(containerKey: ContainerKe
|
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Properties for configuring the Devtools.
|
|
80
|
-
* @
|
|
80
|
+
* @beta
|
|
81
|
+
* @input
|
|
82
|
+
* @sealed
|
|
81
83
|
*/
|
|
82
84
|
export interface FluidDevtoolsProps {
|
|
83
85
|
/**
|
|
@@ -90,14 +92,14 @@ export interface FluidDevtoolsProps {
|
|
|
90
92
|
* This is provided to the Devtools instance strictly to enable communicating supported / desired functionality with
|
|
91
93
|
* external listeners.
|
|
92
94
|
*/
|
|
93
|
-
logger?: IDevtoolsLogger;
|
|
95
|
+
readonly logger?: IDevtoolsLogger;
|
|
94
96
|
|
|
95
97
|
/**
|
|
96
98
|
* (optional) List of Containers to initialize the devtools with.
|
|
97
99
|
*
|
|
98
100
|
* @remarks Additional Containers can be registered with the Devtools via {@link IFluidDevtools.registerContainerDevtools}.
|
|
99
101
|
*/
|
|
100
|
-
initialContainers?: ContainerDevtoolsProps[];
|
|
102
|
+
readonly initialContainers?: ContainerDevtoolsProps[];
|
|
101
103
|
|
|
102
104
|
// TODO: Add ability for customers to specify custom data visualizer overrides
|
|
103
105
|
}
|
|
@@ -517,7 +519,7 @@ export class FluidDevtools implements IFluidDevtools {
|
|
|
517
519
|
*
|
|
518
520
|
* It is automatically disposed on webpage unload, but it can be closed earlier by calling `dispose`
|
|
519
521
|
* on the returned handle.
|
|
520
|
-
* @
|
|
522
|
+
* @beta
|
|
521
523
|
*/
|
|
522
524
|
export function initializeDevtools(props?: FluidDevtoolsProps): IFluidDevtools {
|
|
523
525
|
return FluidDevtools.initialize(props);
|
|
@@ -525,7 +527,7 @@ export function initializeDevtools(props?: FluidDevtoolsProps): IFluidDevtools {
|
|
|
525
527
|
|
|
526
528
|
/**
|
|
527
529
|
* Gets the Devtools singleton if it has been {@link initializeDevtools | initialized}, otherwise returns `undefined`.
|
|
528
|
-
* @
|
|
530
|
+
* @beta
|
|
529
531
|
*/
|
|
530
532
|
export function tryGetFluidDevtools(): IFluidDevtools | undefined {
|
|
531
533
|
return FluidDevtools.tryGet();
|
package/src/IFluidDevtools.ts
CHANGED
|
@@ -21,7 +21,7 @@ import type { ContainerRuntimeProps } from "./ContainerRuntimeDevtools.js";
|
|
|
21
21
|
* The lifetime of the associated singleton is bound by that of the Window (globalThis), and it will be automatically
|
|
22
22
|
* disposed of on Window unload.
|
|
23
23
|
* If you wish to dispose of it earlier, you may call its {@link @fluidframework/core-interfaces#IDisposable.dispose} method.
|
|
24
|
-
* @
|
|
24
|
+
* @beta
|
|
25
25
|
* @sealed
|
|
26
26
|
*/
|
|
27
27
|
export interface IFluidDevtools extends IDisposable {
|
|
@@ -47,7 +47,7 @@ export function determineNodeKind(nodeKind: VisualNodeKind): VisualNodeKind {
|
|
|
47
47
|
/**
|
|
48
48
|
* Returns allowed types of the non-leaf nodes in the tree.
|
|
49
49
|
* @param allowedTypes - a string if array node, `Record<string, string>` for non-array nodes.
|
|
50
|
-
* @returns
|
|
50
|
+
* @returns a VisualChildNode with the allowed type.
|
|
51
51
|
*/
|
|
52
52
|
function createAllowedTypesVisualTree(
|
|
53
53
|
allowedTypes: string | Record<string, string>,
|
|
@@ -101,7 +101,7 @@ function createToolTipContents(schema: SharedTreeSchemaNode): VisualTreeNode {
|
|
|
101
101
|
/**
|
|
102
102
|
* Converts the visual representation from {@link visualizeNodeBySchema} to a visual tree compatible with the devtools-view.
|
|
103
103
|
* @param tree - the visual representation of the SharedTree.
|
|
104
|
-
* @returns
|
|
104
|
+
* @returns the visual representation of type {@link VisualChildNode}
|
|
105
105
|
*/
|
|
106
106
|
export function toVisualTree(tree: VisualSharedTreeNode): VisualChildNode {
|
|
107
107
|
if (tree.kind === VisualSharedTreeNodeKind.LeafNode) {
|
package/src/packageVersion.ts
CHANGED