= ({node}) => {
+ return (
+
+
+
+
+
+ }>
+
+
+
+
+
+ }>
+
+
+
+
+
+ }>
+
+
+
+
+
+ }>
+
+
+
+
+ );
+};
diff --git a/desktop/plugins/public/ui-debugger/components/sidebar/inspector/AttributesInspector.tsx b/desktop/plugins/public/ui-debugger/components/sidebar/inspector/AttributesInspector.tsx
new file mode 100644
index 000000000..844cde590
--- /dev/null
+++ b/desktop/plugins/public/ui-debugger/components/sidebar/inspector/AttributesInspector.tsx
@@ -0,0 +1,97 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+import React from 'react';
+import {Color, Inspectable, InspectableObject, UINode} from '../../../types';
+import {Panel} from 'flipper-plugin';
+
+type Props = {
+ node: UINode;
+};
+
+const TextAttributeInspector: React.FC<{name: string; value: string}> = ({
+ name,
+ value,
+}) => {
+ return (
+
+ {name}: {value}
+
+ );
+};
+
+const NumberAttributeInspector: React.FC<{name: string; value: number}> = ({
+ name,
+ value,
+}) => {
+ return (
+
+ {name}: {value}
+
+ );
+};
+
+const ColorAttributeInspector: React.FC<{name: string; value: Color}> = ({
+ name,
+ value,
+}) => {
+ return (
+
+ {name}: {JSON.stringify(value)}
+
+ );
+};
+
+const ObjectAttributeInspector: React.FC<{
+ name: string;
+ value: Record;
+}> = ({name, value}) => {
+ return (
+
+ {name}: {JSON.stringify(value)}
+
+ );
+};
+
+function create(key: string, inspectable: Inspectable) {
+ switch (inspectable.type) {
+ case 'text':
+ return ;
+ case 'number':
+ return ;
+ case 'color':
+ return ;
+ case 'object':
+ return ;
+ default:
+ return;
+ }
+}
+
+function createSection(name: string, inspectable: InspectableObject) {
+ return (
+
+ {' '}
+ {Object.keys(inspectable.fields).map(function (key, _) {
+ return create(key, inspectable.fields[key]);
+ })}
+
+ );
+}
+
+export const AttributesInspector: React.FC = ({node}) => {
+ // TODO: add raw panel to inspect data as received.
+ return (
+ <>
+ {Object.keys(node.attributes).map(function (key, _) {
+ return createSection(key, node.attributes[key] as InspectableObject);
+ })}
+ >
+ );
+};
diff --git a/desktop/plugins/public/ui-debugger/components/sidebar/inspector/DocumentationInspector.tsx b/desktop/plugins/public/ui-debugger/components/sidebar/inspector/DocumentationInspector.tsx
new file mode 100644
index 000000000..a5bf2ef5b
--- /dev/null
+++ b/desktop/plugins/public/ui-debugger/components/sidebar/inspector/DocumentationInspector.tsx
@@ -0,0 +1,19 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+import React from 'react';
+import {UINode} from '../../../types';
+
+type Props = {
+ node: UINode;
+};
+
+export const DocumentationInspector: React.FC = () => {
+ return Quick Help and Documentation
;
+};
diff --git a/desktop/plugins/public/ui-debugger/components/sidebar/inspector/IdentityInspector.tsx b/desktop/plugins/public/ui-debugger/components/sidebar/inspector/IdentityInspector.tsx
new file mode 100644
index 000000000..e09b5633b
--- /dev/null
+++ b/desktop/plugins/public/ui-debugger/components/sidebar/inspector/IdentityInspector.tsx
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+import React from 'react';
+import {Col, Row} from 'antd';
+import {UINode} from '../../../types';
+
+type Props = {
+ node: UINode;
+};
+
+export const IdentityInspector: React.FC = ({node}) => {
+ return (
+ <>
+
+
+ Name:
+
+ {node.name}
+
+
+
+ Id:
+
+ {node.id}
+
+ >
+ );
+};
diff --git a/desktop/plugins/public/ui-debugger/components/sidebar/inspector/LayoutInspector.tsx b/desktop/plugins/public/ui-debugger/components/sidebar/inspector/LayoutInspector.tsx
new file mode 100644
index 000000000..0044bf9ae
--- /dev/null
+++ b/desktop/plugins/public/ui-debugger/components/sidebar/inspector/LayoutInspector.tsx
@@ -0,0 +1,19 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @format
+ */
+
+import React from 'react';
+import {UINode} from '../../../types';
+
+type Props = {
+ node: UINode;
+};
+
+export const LayoutInspector: React.FC = () => {
+ return Origin and size
;
+};
diff --git a/desktop/plugins/public/ui-debugger/types.tsx b/desktop/plugins/public/ui-debugger/types.tsx
index 38ba5041a..89a204fcb 100644
--- a/desktop/plugins/public/ui-debugger/types.tsx
+++ b/desktop/plugins/public/ui-debugger/types.tsx
@@ -82,7 +82,7 @@ export type InspectableNumber = {
};
export type InspectableColor = {
- type: 'number';
+ type: 'color';
value: Color;
mutable: boolean;
};
diff --git a/desktop/static/icons.json b/desktop/static/icons.json
index 00fe6748f..a74dda590 100644
--- a/desktop/static/icons.json
+++ b/desktop/static/icons.json
@@ -651,5 +651,11 @@
],
"photo-arrows-left-right": [
16
+ ],
+ "badge": [
+ 16
+ ],
+ "square-ruler": [
+ 16
]
-}
+}
\ No newline at end of file