flipper-plugin-player-ui-devtools 0.13.0-next.4 → 0.13.0
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/dist/index.css +5 -5
- package/dist/index.js +13602 -18849
- package/package.json +10 -6
- package/src/index.tsx +45 -8
- package/src/theme/select.ts +18 -0
- package/src/theme/table.ts +22 -0
package/package.json
CHANGED
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
"name": "flipper-plugin-player-ui-devtools",
|
|
10
10
|
"id": "player-ui-devtools",
|
|
11
11
|
"pluginType": "client",
|
|
12
|
-
"version": "0.13.0
|
|
12
|
+
"version": "0.13.0",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@player-
|
|
16
|
-
"@player-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
15
|
+
"@player-devtools/client": "0.13.0",
|
|
16
|
+
"@player-devtools/types": "0.13.0",
|
|
17
|
+
"dlv": "^1.1.3",
|
|
18
|
+
"@chakra-ui/anatomy": "2.3.4",
|
|
19
|
+
"@types/react": "^18.2.51"
|
|
19
20
|
},
|
|
20
21
|
"flipperBundlerEntry": "src/index.tsx",
|
|
21
22
|
"keywords": [
|
|
@@ -27,6 +28,9 @@
|
|
|
27
28
|
"title": "Player UI Devtools",
|
|
28
29
|
"description": "A Flipper plugin able to interact with an active Player instance",
|
|
29
30
|
"peerDependencies": {
|
|
30
|
-
"flipper-plugin": "^0.212.0"
|
|
31
|
+
"flipper-plugin": "^0.212.0",
|
|
32
|
+
"react": "^18.2.0",
|
|
33
|
+
"@chakra-ui/react": "2.8.2",
|
|
34
|
+
"@emotion/styled": "^11"
|
|
31
35
|
}
|
|
32
36
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
1
|
+
import React, { Suspense, useEffect, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
type PluginClient,
|
|
4
|
+
Layout,
|
|
5
|
+
usePlugin,
|
|
6
|
+
theme as baseTheme,
|
|
7
|
+
} from "flipper-plugin";
|
|
3
8
|
import type {
|
|
4
9
|
CommunicationLayerMethods,
|
|
5
10
|
ExtensionSupportedEvents,
|
|
6
11
|
MessengerEvent,
|
|
7
12
|
TransactionMetadata,
|
|
8
|
-
} from "@player-
|
|
9
|
-
import { Panel } from "@player-
|
|
13
|
+
} from "@player-devtools/types";
|
|
14
|
+
import { Panel } from "@player-devtools/client";
|
|
15
|
+
import {
|
|
16
|
+
Button,
|
|
17
|
+
ChakraProvider,
|
|
18
|
+
ColorModeScript,
|
|
19
|
+
DarkMode,
|
|
20
|
+
defineStyle,
|
|
21
|
+
defineStyleConfig,
|
|
22
|
+
extendTheme,
|
|
23
|
+
Input,
|
|
24
|
+
LightMode,
|
|
25
|
+
ThemeConfig,
|
|
26
|
+
useBoolean,
|
|
27
|
+
useColorMode,
|
|
28
|
+
theme as ChakraTheme,
|
|
29
|
+
Box,
|
|
30
|
+
Spinner,
|
|
31
|
+
} from "@chakra-ui/react";
|
|
32
|
+
import { ThemeProvider, useDarkMode } from "@devtools-ds/themes";
|
|
33
|
+
import { Select } from "./theme/select";
|
|
34
|
+
import { Table } from "./theme/table";
|
|
35
|
+
|
|
36
|
+
const ID = "flipper-plugin-player-ui-devtools";
|
|
10
37
|
|
|
11
38
|
type Events = {
|
|
12
39
|
/** message received */
|
|
@@ -62,11 +89,21 @@ export function plugin(
|
|
|
62
89
|
}
|
|
63
90
|
|
|
64
91
|
/** Flipper desktop plugin component */
|
|
65
|
-
export const Component = () => {
|
|
92
|
+
export const Component: React.FC = () => {
|
|
66
93
|
const communicationLayer = usePlugin(plugin);
|
|
94
|
+
|
|
67
95
|
return (
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
|
|
96
|
+
<Suspense fallback={<Spinner size="xl" />}>
|
|
97
|
+
<Layout.Container id={ID} pad="medium">
|
|
98
|
+
<Box
|
|
99
|
+
sx={{
|
|
100
|
+
// Scoped style fixes for our devtools client
|
|
101
|
+
p: { margin: 0 },
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<Panel communicationLayer={communicationLayer} />
|
|
105
|
+
</Box>
|
|
106
|
+
</Layout.Container>
|
|
107
|
+
</Suspense>
|
|
71
108
|
);
|
|
72
109
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { selectAnatomy } from "@chakra-ui/anatomy";
|
|
2
|
+
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
|
3
|
+
import { theme } from "flipper-plugin";
|
|
4
|
+
|
|
5
|
+
const { definePartsStyle, defineMultiStyleConfig } =
|
|
6
|
+
createMultiStyleConfigHelpers(selectAnatomy.keys);
|
|
7
|
+
|
|
8
|
+
export const Select = defineMultiStyleConfig({
|
|
9
|
+
baseStyle: definePartsStyle({
|
|
10
|
+
field: {
|
|
11
|
+
background: theme.buttonDefaultBackground,
|
|
12
|
+
color: theme.textColorPrimary,
|
|
13
|
+
},
|
|
14
|
+
icon: {
|
|
15
|
+
color: theme.textColorPrimary,
|
|
16
|
+
},
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { tableAnatomy } from "@chakra-ui/anatomy";
|
|
2
|
+
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
|
3
|
+
import { theme } from "flipper-plugin";
|
|
4
|
+
|
|
5
|
+
const { definePartsStyle, defineMultiStyleConfig } =
|
|
6
|
+
createMultiStyleConfigHelpers(tableAnatomy.keys);
|
|
7
|
+
|
|
8
|
+
export const Table = defineMultiStyleConfig({
|
|
9
|
+
baseStyle: definePartsStyle({
|
|
10
|
+
table: {
|
|
11
|
+
lineHeight: 1,
|
|
12
|
+
},
|
|
13
|
+
td: {
|
|
14
|
+
lineHeight: 1,
|
|
15
|
+
color: theme.textColorPrimary,
|
|
16
|
+
},
|
|
17
|
+
th: {
|
|
18
|
+
lineHeight: 1,
|
|
19
|
+
color: theme.textColorSecondary,
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
});
|