Export node as JSON
Summary: There has been multiple requests to incorporate an export to plain text functionality for a while. This diff adds it. It will export a node and optionally its chidren as JSON. Reviewed By: antonk52 Differential Revision: D49596476 fbshipit-source-id: 3681bc0c2d02e1ea64ff589e0e272f6d54ad0524
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5accf039c9
commit
c1b0d9d753
@@ -7,7 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {Id, ClientNode} from '../../ClientTypes';
|
||||
import {Id, ClientNode, MetadataId, Metadata} from '../../ClientTypes';
|
||||
import {Color, OnSelectNode} from '../../DesktopTypes';
|
||||
import React, {
|
||||
CSSProperties,
|
||||
@@ -55,11 +55,13 @@ export type TreeNode = ClientNode & {
|
||||
};
|
||||
export function Tree2({
|
||||
nodes,
|
||||
metadata,
|
||||
rootId,
|
||||
additionalHeightOffset,
|
||||
}: {
|
||||
additionalHeightOffset: number;
|
||||
nodes: Map<Id, ClientNode>;
|
||||
metadata: Map<MetadataId, Metadata>;
|
||||
rootId: Id;
|
||||
}) {
|
||||
const instance = usePlugin(plugin);
|
||||
@@ -216,6 +218,7 @@ export function Tree2({
|
||||
text={searchTerm}
|
||||
highlightColor={theme.searchHighlightBackground.yellow}>
|
||||
<ContextMenu
|
||||
metadata={metadata}
|
||||
frameworkEvents={instance.frameworkEvents}
|
||||
focusedNodeId={focusedNode}
|
||||
hoveredNodeId={hoveredNode}
|
||||
|
||||
Reference in New Issue
Block a user