@player-tools/devtools-client 0.5.2-next.2 → 0.5.3--canary.90.2515
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/cjs/index.cjs +291 -197
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +293 -198
- package/dist/index.mjs +293 -198
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -4
- package/src/constants/index.ts +41 -0
- package/src/helpers/__tests__/flowDiff.test.ts +72 -0
- package/src/helpers/flowDiff.ts +35 -0
- package/src/index.ts +1 -3
- package/src/panel/index.tsx +190 -0
- package/src/panel/theme.ts +8 -0
- package/src/state/index.ts +105 -0
- package/src/state/reducer.ts +80 -0
- package/types/constants/index.d.ts +8 -0
- package/types/helpers/flowDiff.d.ts +12 -0
- package/types/index.d.ts +1 -3
- package/types/panel/index.d.ts +13 -0
- package/types/panel/theme.d.ts +2 -0
- package/types/state/index.d.ts +17 -0
- package/types/state/reducer.d.ts +4 -0
- package/src/redux/actions.ts +0 -36
- package/src/redux/aliases.ts +0 -45
- package/src/redux/index.ts +0 -70
- package/src/redux/reducers.ts +0 -118
- package/src/rpc/index.ts +0 -21
- package/types/redux/actions.d.ts +0 -12
- package/types/redux/aliases.d.ts +0 -10
- package/types/redux/index.d.ts +0 -7
- package/types/redux/reducers.d.ts +0 -10
- package/types/rpc/index.d.ts +0 -6
package/dist/index.legacy-esm.js
CHANGED
|
@@ -1,218 +1,313 @@
|
|
|
1
|
-
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/
|
|
1
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/panel/index.tsx
|
|
2
|
+
import React, { useRef } from "react";
|
|
3
|
+
import { useReactPlayer } from "@player-ui/react";
|
|
4
|
+
import { useEffect as useEffect2 } from "react";
|
|
5
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
2
6
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Card,
|
|
8
|
+
CardBody,
|
|
9
|
+
CardHeader,
|
|
10
|
+
ChakraProvider,
|
|
11
|
+
Container,
|
|
12
|
+
Flex,
|
|
13
|
+
FormControl,
|
|
14
|
+
FormLabel,
|
|
15
|
+
Heading,
|
|
16
|
+
HStack,
|
|
17
|
+
Select,
|
|
18
|
+
Text,
|
|
19
|
+
VStack
|
|
20
|
+
} from "@chakra-ui/react";
|
|
21
|
+
import { ThemeProvider } from "@devtools-ds/themes";
|
|
11
22
|
|
|
12
|
-
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/constants/index.ts
|
|
24
|
+
import DevtoolsUIAssetsPlugin from "@devtools-ui/plugin";
|
|
25
|
+
import { PubSubPlugin } from "@player-ui/pubsub-plugin";
|
|
26
|
+
var PUBSUB_PLUGIN = new PubSubPlugin();
|
|
27
|
+
var PLAYER_PLUGINS = [
|
|
28
|
+
new DevtoolsUIAssetsPlugin(),
|
|
29
|
+
PUBSUB_PLUGIN
|
|
30
|
+
];
|
|
31
|
+
var INITIAL_FLOW = {
|
|
32
|
+
id: "initial-flow",
|
|
33
|
+
views: [
|
|
34
|
+
{
|
|
35
|
+
id: "view-1",
|
|
36
|
+
type: "text",
|
|
37
|
+
value: "connecting..."
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
navigation: {
|
|
41
|
+
BEGIN: "FLOW_1",
|
|
42
|
+
FLOW_1: {
|
|
43
|
+
startState: "VIEW_1",
|
|
44
|
+
VIEW_1: {
|
|
45
|
+
state_type: "VIEW",
|
|
46
|
+
ref: "view-1",
|
|
47
|
+
transitions: {}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
24
50
|
}
|
|
25
|
-
return next(action);
|
|
26
51
|
};
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
STOP_PROFILER: (action) => actions["player-stop-profiler-request"](action.payload)
|
|
35
|
-
});
|
|
52
|
+
var INITIAL_EXTENSION_STATE = {
|
|
53
|
+
current: {
|
|
54
|
+
player: null,
|
|
55
|
+
plugin: null
|
|
56
|
+
},
|
|
57
|
+
players: {}
|
|
58
|
+
};
|
|
36
59
|
|
|
37
|
-
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
Runtime,
|
|
41
|
-
createLogger,
|
|
42
|
-
BACKGROUND_SOURCE
|
|
43
|
-
} from "@player-tools/devtools-common";
|
|
44
|
-
var logger = createLogger(BACKGROUND_SOURCE);
|
|
45
|
-
var buildRPCActions = (handlers) => Runtime.RuntimeRPCTypes.reduce((acc, rpcType) => {
|
|
46
|
-
acc[rpcType] = createAsyncThunk(rpcType, async (params) => {
|
|
47
|
-
logger.log(`Requesting ${rpcType}`, params);
|
|
48
|
-
const data = await handlers[rpcType].call(params);
|
|
49
|
-
logger.log(`Response from ${rpcType}`, data);
|
|
50
|
-
return data;
|
|
51
|
-
});
|
|
52
|
-
return acc;
|
|
53
|
-
}, {});
|
|
60
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/state/index.ts
|
|
61
|
+
import { Messenger } from "@player-tools/devtools-messenger";
|
|
62
|
+
import { useCallback, useEffect, useMemo, useReducer } from "react";
|
|
54
63
|
|
|
55
|
-
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
64
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/state/reducer.ts
|
|
65
|
+
import { dset } from "dset/merge";
|
|
66
|
+
import { produce } from "immer";
|
|
67
|
+
var reducer = (state, transaction) => {
|
|
68
|
+
switch (transaction.type) {
|
|
69
|
+
case "PLAYER_DEVTOOLS_PLAYER_INIT":
|
|
70
|
+
return produce(state, (draft) => {
|
|
71
|
+
const {
|
|
72
|
+
sender,
|
|
73
|
+
payload: { plugins }
|
|
74
|
+
} = transaction;
|
|
75
|
+
const { player, plugin } = draft.current;
|
|
76
|
+
if (!player && !plugin) {
|
|
77
|
+
dset(draft, ["current", "player"], sender);
|
|
78
|
+
dset(
|
|
79
|
+
draft,
|
|
80
|
+
["current", "plugin"],
|
|
81
|
+
plugins[Object.keys(plugins)[0]].id
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
dset(draft, ["players", sender, "plugins"], plugins);
|
|
85
|
+
dset(draft, ["players", sender, "active"], true);
|
|
86
|
+
});
|
|
87
|
+
case "PLAYER_DEVTOOLS_PLUGIN_FLOW_CHANGE":
|
|
88
|
+
return produce(state, (draft) => {
|
|
89
|
+
const {
|
|
90
|
+
sender,
|
|
91
|
+
payload: { flow, pluginID }
|
|
92
|
+
} = transaction;
|
|
93
|
+
dset(draft, ["players", sender, "plugins", pluginID, "flow"], flow);
|
|
94
|
+
});
|
|
95
|
+
case "PLAYER_DEVTOOLS_PLUGIN_DATA_CHANGE":
|
|
96
|
+
return produce(state, (draft) => {
|
|
97
|
+
const {
|
|
98
|
+
sender,
|
|
99
|
+
payload: { data, pluginID }
|
|
100
|
+
} = transaction;
|
|
101
|
+
dset(
|
|
102
|
+
draft,
|
|
103
|
+
["players", sender, "plugins", pluginID, "flow", "data"],
|
|
104
|
+
data
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
case "MESSENGER_EVENT_BATCH":
|
|
108
|
+
return produce(state, (draft) => {
|
|
109
|
+
return transaction.payload.events.reduce(reducer, draft);
|
|
110
|
+
});
|
|
111
|
+
case "PLAYER_DEVTOOLS_PLAYER_STOPPED":
|
|
112
|
+
return produce(state, (draft) => {
|
|
113
|
+
const { sender } = transaction;
|
|
114
|
+
dset(draft, ["players", sender, "active"], false);
|
|
115
|
+
});
|
|
116
|
+
case "PLAYER_DEVTOOLS_PLAYER_SELECTED":
|
|
117
|
+
return produce(state, (draft) => {
|
|
118
|
+
const { playerID } = transaction.payload;
|
|
119
|
+
dset(draft, ["current", "player"], playerID);
|
|
120
|
+
});
|
|
121
|
+
case "PLAYER_DEVTOOLS_PLUGIN_SELECTED":
|
|
122
|
+
return produce(state, (draft) => {
|
|
123
|
+
const { pluginID } = transaction.payload;
|
|
124
|
+
dset(draft, ["current", "plugin"], pluginID);
|
|
125
|
+
});
|
|
126
|
+
default:
|
|
127
|
+
return state;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/state/index.ts
|
|
132
|
+
var NOOP_ID = -1;
|
|
133
|
+
var useExtensionState = ({
|
|
134
|
+
communicationLayer
|
|
135
|
+
}) => {
|
|
136
|
+
const [state, dispatch] = useReducer(reducer, INITIAL_EXTENSION_STATE);
|
|
137
|
+
const messengerOptions = useMemo(
|
|
138
|
+
() => ({
|
|
139
|
+
context: "devtools",
|
|
140
|
+
target: "player",
|
|
141
|
+
messageCallback: (message) => {
|
|
142
|
+
dispatch(message);
|
|
143
|
+
},
|
|
144
|
+
...communicationLayer,
|
|
145
|
+
logger: console
|
|
146
|
+
}),
|
|
147
|
+
[dispatch, communicationLayer]
|
|
77
148
|
);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const { activePlayers, selectedPlayerId } = state;
|
|
82
|
-
if (!selectedPlayerId) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
activePlayers[selectedPlayerId].view = action.payload?.lastViewUpdate;
|
|
86
|
-
}
|
|
149
|
+
const messenger = useMemo(
|
|
150
|
+
() => new Messenger(messengerOptions),
|
|
151
|
+
[messengerOptions]
|
|
87
152
|
);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
activePlayers[playerID].dataState.selectedBinding = payload;
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
builder.addCase(
|
|
109
|
-
actions["player-execute-expression"].fulfilled,
|
|
110
|
-
(state, action) => {
|
|
111
|
-
const { activePlayers, selectedPlayerId } = state;
|
|
112
|
-
if (!selectedPlayerId) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
activePlayers[selectedPlayerId].consoleState?.history?.push({
|
|
116
|
-
id: action.meta.requestId,
|
|
117
|
-
result: action.payload,
|
|
118
|
-
expression: action.payload?.exp ?? ""
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
return () => {
|
|
155
|
+
messenger.destroy();
|
|
156
|
+
};
|
|
157
|
+
}, []);
|
|
158
|
+
const selectPlayer = useCallback(
|
|
159
|
+
(playerID) => {
|
|
160
|
+
dispatch({
|
|
161
|
+
id: NOOP_ID,
|
|
162
|
+
sender: "internal",
|
|
163
|
+
context: "devtools",
|
|
164
|
+
_messenger_: false,
|
|
165
|
+
timestamp: Date.now(),
|
|
166
|
+
type: "PLAYER_DEVTOOLS_PLAYER_SELECTED",
|
|
167
|
+
payload: {
|
|
168
|
+
playerID
|
|
169
|
+
}
|
|
119
170
|
});
|
|
120
|
-
}
|
|
171
|
+
},
|
|
172
|
+
[dispatch]
|
|
121
173
|
);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
174
|
+
const selectPlugin = useCallback(
|
|
175
|
+
(pluginID) => {
|
|
176
|
+
dispatch({
|
|
177
|
+
id: NOOP_ID,
|
|
178
|
+
sender: "internal",
|
|
179
|
+
context: "devtools",
|
|
180
|
+
_messenger_: false,
|
|
181
|
+
timestamp: Date.now(),
|
|
182
|
+
type: "PLAYER_DEVTOOLS_PLUGIN_SELECTED",
|
|
183
|
+
payload: {
|
|
184
|
+
pluginID
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
[dispatch]
|
|
130
189
|
);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
190
|
+
const handleInteraction = useCallback(
|
|
191
|
+
({
|
|
192
|
+
type,
|
|
193
|
+
payload
|
|
194
|
+
}) => {
|
|
195
|
+
messenger.sendMessage({
|
|
196
|
+
type: "PLAYER_DEVTOOLS_PLUGIN_INTERACTION",
|
|
197
|
+
payload: {
|
|
198
|
+
type,
|
|
199
|
+
payload
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
[messenger]
|
|
139
204
|
);
|
|
205
|
+
return { state, selectPlayer, selectPlugin, handleInteraction };
|
|
140
206
|
};
|
|
141
207
|
|
|
142
|
-
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
store.dispatch(playerRemoveAction(message.playerID));
|
|
154
|
-
store.dispatch(selectedPlayerAction());
|
|
155
|
-
break;
|
|
156
|
-
case "player-flow-start":
|
|
157
|
-
store.dispatch(playerFlowStartAction(message));
|
|
158
|
-
store.dispatch(playerTimelineAction(message));
|
|
159
|
-
store.dispatch({
|
|
160
|
-
type: GET_DATA_BINDING_DETAILS,
|
|
161
|
-
payload: { playerID: message.playerID, binding: "" }
|
|
162
|
-
});
|
|
163
|
-
break;
|
|
164
|
-
case "player-log-event":
|
|
165
|
-
store.dispatch(playerTimelineAction(message));
|
|
166
|
-
break;
|
|
167
|
-
case "player-view-update-event":
|
|
168
|
-
store.dispatch(playerViewUpdateAction(message));
|
|
169
|
-
break;
|
|
170
|
-
case "player-data-change-event": {
|
|
171
|
-
const { players } = store.getState();
|
|
172
|
-
if (players.activePlayers[message.playerID] && players.activePlayers[message.playerID].dataState.selectedBinding) {
|
|
173
|
-
store.dispatch({
|
|
174
|
-
type: GET_DATA_BINDING_DETAILS,
|
|
175
|
-
payload: message
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
store.dispatch({
|
|
179
|
-
type: GET_DATA_BINDING_DETAILS,
|
|
180
|
-
payload: { playerID: message.playerID, binding: "" }
|
|
181
|
-
});
|
|
182
|
-
store.dispatch(playerTimelineAction(message));
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
default:
|
|
186
|
-
console.warn(`Unhandled event: ${JSON.stringify(message)}`);
|
|
187
|
-
break;
|
|
208
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/helpers/flowDiff.ts
|
|
209
|
+
import { dequal } from "dequal";
|
|
210
|
+
var flowDiff = ({
|
|
211
|
+
curr,
|
|
212
|
+
next
|
|
213
|
+
}) => {
|
|
214
|
+
const currCopy = { ...curr, data: null };
|
|
215
|
+
const nextCopy = { ...next, data: null };
|
|
216
|
+
const baseFlowIsEqual = dequal(currCopy, nextCopy);
|
|
217
|
+
if (!baseFlowIsEqual) {
|
|
218
|
+
return { change: "flow", value: next };
|
|
188
219
|
}
|
|
189
|
-
|
|
220
|
+
const currData = curr.data;
|
|
221
|
+
const nextData = next.data;
|
|
222
|
+
const dataIsEqual = dequal(currData, nextData);
|
|
223
|
+
if (!dataIsEqual) {
|
|
224
|
+
return { change: "data", value: nextData };
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
};
|
|
190
228
|
|
|
191
|
-
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/
|
|
192
|
-
import {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
var
|
|
198
|
-
acc[rpcType] = createRPCRequest(rpcType, PANEL_SOURCE, onRequestMessage);
|
|
199
|
-
return acc;
|
|
200
|
-
}, {});
|
|
229
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/panel/theme.ts
|
|
230
|
+
import { extendTheme } from "@chakra-ui/react";
|
|
231
|
+
var config = {
|
|
232
|
+
initialColorMode: "dark",
|
|
233
|
+
useSystemColorMode: false
|
|
234
|
+
};
|
|
235
|
+
var theme = extendTheme({ config });
|
|
201
236
|
|
|
202
|
-
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/index.
|
|
203
|
-
|
|
237
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/devtools/client/src/panel/index.tsx
|
|
238
|
+
var fallbackRender = ({
|
|
239
|
+
error
|
|
240
|
+
}) => {
|
|
241
|
+
return /* @__PURE__ */ React.createElement(Container, { centerContent: true }, /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, null, /* @__PURE__ */ React.createElement(Heading, null, "Ops, something went wrong."))), /* @__PURE__ */ React.createElement(CardBody, null, /* @__PURE__ */ React.createElement(Text, { as: "pre" }, error.message)));
|
|
242
|
+
};
|
|
243
|
+
var Panel = ({
|
|
244
|
+
communicationLayer
|
|
245
|
+
}) => {
|
|
246
|
+
const { state, selectPlayer, selectPlugin, handleInteraction } = useExtensionState({
|
|
247
|
+
communicationLayer
|
|
248
|
+
});
|
|
249
|
+
const { reactPlayer } = useReactPlayer({
|
|
250
|
+
plugins: PLAYER_PLUGINS
|
|
251
|
+
});
|
|
252
|
+
const dataController = useRef(null);
|
|
253
|
+
const currentFlow = useRef(null);
|
|
254
|
+
useEffect2(() => {
|
|
255
|
+
reactPlayer.player.hooks.dataController.tap("panel", (d) => {
|
|
256
|
+
dataController.current = new WeakRef(d);
|
|
257
|
+
});
|
|
258
|
+
}, [reactPlayer]);
|
|
259
|
+
useEffect2(() => {
|
|
260
|
+
PUBSUB_PLUGIN.subscribe("*", (type, payload) => {
|
|
261
|
+
handleInteraction({
|
|
262
|
+
type,
|
|
263
|
+
payload
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
}, []);
|
|
267
|
+
useEffect2(() => {
|
|
268
|
+
const { player, plugin } = state.current;
|
|
269
|
+
const flow = player && plugin ? state.players[player]?.plugins?.[plugin]?.flow || INITIAL_FLOW : INITIAL_FLOW;
|
|
270
|
+
if (!currentFlow.current) {
|
|
271
|
+
currentFlow.current = flow;
|
|
272
|
+
reactPlayer.start(flow);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const diff = flowDiff({
|
|
276
|
+
curr: currentFlow.current,
|
|
277
|
+
next: flow
|
|
278
|
+
});
|
|
279
|
+
if (diff) {
|
|
280
|
+
const { change, value } = diff;
|
|
281
|
+
if (change === "flow") {
|
|
282
|
+
currentFlow.current = value;
|
|
283
|
+
reactPlayer.start(value);
|
|
284
|
+
} else if (change === "data") {
|
|
285
|
+
dataController.current ? dataController.current.deref()?.set(value) : reactPlayer.start(flow);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}, [reactPlayer, state]);
|
|
289
|
+
const Component = reactPlayer.Component;
|
|
290
|
+
return /* @__PURE__ */ React.createElement(ChakraProvider, { theme }, /* @__PURE__ */ React.createElement(ThemeProvider, { colorScheme: "dark" }, /* @__PURE__ */ React.createElement(ErrorBoundary, { fallbackRender }, /* @__PURE__ */ React.createElement(VStack, { w: "100vw", h: "100vh" }, state.current.player ? /* @__PURE__ */ React.createElement(Flex, { direction: "column", marginTop: "4" }, /* @__PURE__ */ React.createElement(HStack, { spacing: "4" }, /* @__PURE__ */ React.createElement(FormControl, null, /* @__PURE__ */ React.createElement(FormLabel, null, "Player"), /* @__PURE__ */ React.createElement(
|
|
291
|
+
Select,
|
|
292
|
+
{
|
|
293
|
+
id: "player",
|
|
294
|
+
value: state.current.player || "",
|
|
295
|
+
onChange: (event) => selectPlayer(event.target.value)
|
|
296
|
+
},
|
|
297
|
+
Object.keys(state.players).map((playerID) => /* @__PURE__ */ React.createElement("option", { key: playerID, value: playerID }, playerID))
|
|
298
|
+
)), /* @__PURE__ */ React.createElement(FormControl, null, /* @__PURE__ */ React.createElement(FormLabel, null, "Plugin"), /* @__PURE__ */ React.createElement(
|
|
299
|
+
Select,
|
|
300
|
+
{
|
|
301
|
+
id: "plugin",
|
|
302
|
+
value: state.current.plugin || "",
|
|
303
|
+
onChange: (event) => selectPlugin(event.target.value)
|
|
304
|
+
},
|
|
305
|
+
Object.keys(
|
|
306
|
+
state.players[state.current.player].plugins
|
|
307
|
+
).map((pluginID) => /* @__PURE__ */ React.createElement("option", { key: pluginID, value: pluginID }, pluginID))
|
|
308
|
+
))), /* @__PURE__ */ React.createElement(Container, { marginY: "6" }, /* @__PURE__ */ React.createElement(Component, null)), /* @__PURE__ */ React.createElement("details", null, /* @__PURE__ */ React.createElement("summary", null, "Debug"), /* @__PURE__ */ React.createElement("pre", null, JSON.stringify(state, null, 2)))) : /* @__PURE__ */ React.createElement(Flex, { justifyContent: "center", padding: "6" }, /* @__PURE__ */ React.createElement(Text, null, "No Player-UI instance or devtools plugin detected. Visit", " ", /* @__PURE__ */ React.createElement("a", { href: "https://player-ui.github.io/" }, "https://player-ui.github.io/"), " ", "for more info."))))));
|
|
309
|
+
};
|
|
204
310
|
export {
|
|
205
|
-
|
|
206
|
-
GET_CONSOLE_EVAL,
|
|
207
|
-
GET_DATA_BINDING_DETAILS,
|
|
208
|
-
GET_INFO_DETAILS,
|
|
209
|
-
GET_VIEW_DETAILS,
|
|
210
|
-
START_PROFILER,
|
|
211
|
-
STOP_PROFILER,
|
|
212
|
-
buildAliases,
|
|
213
|
-
buildPlayerReducerCallback,
|
|
214
|
-
buildRPCActions,
|
|
215
|
-
buildRPCRequests,
|
|
216
|
-
handleMessage
|
|
311
|
+
Panel
|
|
217
312
|
};
|
|
218
313
|
//# sourceMappingURL=index.mjs.map
|