@devtools-ui/plugin 0.0.2--canary.11.588
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 +147 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/index.legacy-esm.js +109 -0
- package/dist/index.mjs +109 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +43 -0
- package/src/index.ts +42 -0
- package/src/plugins/AssetsRegistryPlugin.tsx +91 -0
- package/src/plugins/TransformPlugin.ts +23 -0
- package/src/plugins/index.ts +2 -0
- package/types/index.d.ts +15 -0
- package/types/plugins/AssetsRegistryPlugin.d.ts +29 -0
- package/types/plugins/TransformPlugin.d.ts +6 -0
- package/types/plugins/index.d.ts +3 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
Action: () => import_action3.Action,
|
|
34
|
+
Collection: () => import_collection2.Collection,
|
|
35
|
+
Console: () => import_console3.Console,
|
|
36
|
+
Input: () => import_input3.Input,
|
|
37
|
+
List: () => import_list2.List,
|
|
38
|
+
Navigation: () => import_navigation2.Navigation,
|
|
39
|
+
ObjectInspector: () => import_object_inspector3.ObjectInspector,
|
|
40
|
+
StackedView: () => import_stacked_view2.StackedView,
|
|
41
|
+
Table: () => import_table3.Table,
|
|
42
|
+
Text: () => import_text2.Text,
|
|
43
|
+
default: () => src_default
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(src_exports);
|
|
46
|
+
var import_action3 = require("@devtools-ui/action");
|
|
47
|
+
var import_collection2 = require("@devtools-ui/collection");
|
|
48
|
+
var import_stacked_view2 = require("@devtools-ui/stacked-view");
|
|
49
|
+
var import_input3 = require("@devtools-ui/input");
|
|
50
|
+
var import_list2 = require("@devtools-ui/list");
|
|
51
|
+
var import_navigation2 = require("@devtools-ui/navigation");
|
|
52
|
+
var import_object_inspector3 = require("@devtools-ui/object-inspector");
|
|
53
|
+
var import_text2 = require("@devtools-ui/text");
|
|
54
|
+
var import_console3 = require("@devtools-ui/console");
|
|
55
|
+
var import_table3 = require("@devtools-ui/table");
|
|
56
|
+
|
|
57
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/TransformPlugin.ts
|
|
58
|
+
var import_asset_transform_plugin = require("@player-ui/asset-transform-plugin");
|
|
59
|
+
var import_action = require("@devtools-ui/action");
|
|
60
|
+
var import_input = require("@devtools-ui/input");
|
|
61
|
+
var import_object_inspector = require("@devtools-ui/object-inspector");
|
|
62
|
+
var import_console = require("@devtools-ui/console");
|
|
63
|
+
var import_table = require("@devtools-ui/table");
|
|
64
|
+
var TransformsPlugin = class {
|
|
65
|
+
constructor() {
|
|
66
|
+
this.name = "devtools-ui-transforms";
|
|
67
|
+
}
|
|
68
|
+
apply(player) {
|
|
69
|
+
player.registerPlugin(
|
|
70
|
+
new import_asset_transform_plugin.AssetTransformPlugin([
|
|
71
|
+
[{ type: "action" }, import_action.actionTransform],
|
|
72
|
+
[{ type: "input" }, import_input.inputTransform],
|
|
73
|
+
[{ type: "object-inspector" }, import_object_inspector.objectInspectorTransform],
|
|
74
|
+
[{ type: "console" }, import_console.consoleTransform],
|
|
75
|
+
[{ type: "table" }, import_table.tableTransform]
|
|
76
|
+
])
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/AssetsRegistryPlugin.tsx
|
|
82
|
+
var import_react = __toESM(require("react"));
|
|
83
|
+
var import_react2 = require("@chakra-ui/react");
|
|
84
|
+
var import_asset_provider_plugin_react = require("@player-ui/asset-provider-plugin-react");
|
|
85
|
+
var import_action2 = require("@devtools-ui/action");
|
|
86
|
+
var import_collection = require("@devtools-ui/collection");
|
|
87
|
+
var import_input2 = require("@devtools-ui/input");
|
|
88
|
+
var import_list = require("@devtools-ui/list");
|
|
89
|
+
var import_navigation = require("@devtools-ui/navigation");
|
|
90
|
+
var import_console2 = require("@devtools-ui/console");
|
|
91
|
+
var import_table2 = require("@devtools-ui/table");
|
|
92
|
+
var import_stacked_view = require("@devtools-ui/stacked-view");
|
|
93
|
+
var import_object_inspector2 = require("@devtools-ui/object-inspector");
|
|
94
|
+
var import_text = require("@devtools-ui/text");
|
|
95
|
+
var OptionalChakraThemeProvider = (props) => {
|
|
96
|
+
const theme = (0, import_react2.useTheme)();
|
|
97
|
+
if (theme) {
|
|
98
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.children);
|
|
99
|
+
}
|
|
100
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react2.ChakraProvider, null, props.children);
|
|
101
|
+
};
|
|
102
|
+
var AssetsRegistryPlugin = class {
|
|
103
|
+
constructor() {
|
|
104
|
+
this.name = "devtools-ui";
|
|
105
|
+
}
|
|
106
|
+
applyReact(reactPlayer) {
|
|
107
|
+
reactPlayer.registerPlugin(
|
|
108
|
+
new import_asset_provider_plugin_react.AssetProviderPlugin([
|
|
109
|
+
["action", import_action2.ActionComponent],
|
|
110
|
+
["collection", import_collection.CollectionComponent],
|
|
111
|
+
["input", import_input2.InputComponent],
|
|
112
|
+
["list", import_list.ListComponent],
|
|
113
|
+
["navigation", import_navigation.NavigationComponent],
|
|
114
|
+
["object-inspector", import_object_inspector2.ObjectInspectorComponent],
|
|
115
|
+
["text", import_text.TextComponent],
|
|
116
|
+
["console", import_console2.ConsoleComponent],
|
|
117
|
+
["stacked-view", import_stacked_view.StackedViewComponent],
|
|
118
|
+
["table", import_table2.TableComponent]
|
|
119
|
+
])
|
|
120
|
+
);
|
|
121
|
+
reactPlayer.hooks.webComponent.tap(this.name, (Comp) => {
|
|
122
|
+
return () => {
|
|
123
|
+
return /* @__PURE__ */ import_react.default.createElement(OptionalChakraThemeProvider, null, /* @__PURE__ */ import_react.default.createElement(Comp, null));
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
apply(player) {
|
|
128
|
+
player.registerPlugin(new TransformsPlugin());
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/index.ts
|
|
133
|
+
var src_default = AssetsRegistryPlugin;
|
|
134
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
135
|
+
0 && (module.exports = {
|
|
136
|
+
Action,
|
|
137
|
+
Collection,
|
|
138
|
+
Console,
|
|
139
|
+
Input,
|
|
140
|
+
List,
|
|
141
|
+
Navigation,
|
|
142
|
+
ObjectInspector,
|
|
143
|
+
StackedView,
|
|
144
|
+
Table,
|
|
145
|
+
Text
|
|
146
|
+
});
|
|
147
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/index.ts","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/TransformPlugin.ts","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/AssetsRegistryPlugin.tsx"],"sourcesContent":["import { ActionAsset, Action } from \"@devtools-ui/action\";\nimport { CollectionAsset, Collection } from \"@devtools-ui/collection\";\nimport { StackedViewView, StackedView } from \"@devtools-ui/stacked-view\";\nimport { InputAsset, Input } from \"@devtools-ui/input\";\nimport { ListAsset, List } from \"@devtools-ui/list\";\nimport { NavigationAsset, Navigation } from \"@devtools-ui/navigation\";\nimport {\n ObjectInspectorAsset,\n ObjectInspector,\n} from \"@devtools-ui/object-inspector\";\nimport { TextAsset, Text } from \"@devtools-ui/text\";\nimport { ConsoleAsset, Console } from \"@devtools-ui/console\";\nimport { TableAsset, Table } from \"@devtools-ui/table\";\nimport { AssetsRegistryPlugin } from \"./plugins\";\n\nexport default AssetsRegistryPlugin;\n\nexport type {\n ActionAsset,\n CollectionAsset,\n InputAsset,\n ListAsset,\n NavigationAsset,\n ObjectInspectorAsset,\n TextAsset,\n ConsoleAsset,\n StackedViewView,\n TableAsset,\n};\n\nexport {\n Action,\n Collection,\n Console,\n Input,\n List,\n Navigation,\n ObjectInspector,\n Text,\n StackedView,\n Table,\n};\n","import type { Player, PlayerPlugin } from \"@player-ui/player\";\nimport { AssetTransformPlugin } from \"@player-ui/asset-transform-plugin\";\nimport { actionTransform } from \"@devtools-ui/action\";\nimport { inputTransform } from \"@devtools-ui/input\";\nimport { objectInspectorTransform } from \"@devtools-ui/object-inspector\";\nimport { consoleTransform } from \"@devtools-ui/console\";\nimport { tableTransform } from \"@devtools-ui/table\";\n\nexport class TransformsPlugin implements PlayerPlugin {\n name = \"devtools-ui-transforms\";\n\n apply(player: Player) {\n player.registerPlugin(\n new AssetTransformPlugin([\n [{ type: \"action\" }, actionTransform],\n [{ type: \"input\" }, inputTransform],\n [{ type: \"object-inspector\" }, objectInspectorTransform],\n [{ type: \"console\" }, consoleTransform],\n [{ type: \"table\" }, tableTransform],\n ])\n );\n }\n}\n","import React from \"react\";\nimport type { Player } from \"@player-ui/player\";\nimport { ChakraProvider, useTheme } from \"@chakra-ui/react\";\nimport type {\n ExtendedPlayerPlugin,\n ReactPlayer,\n ReactPlayerPlugin,\n} from \"@player-ui/react\";\nimport { AssetProviderPlugin } from \"@player-ui/asset-provider-plugin-react\";\nimport { ActionAsset, ActionComponent } from \"@devtools-ui/action\";\nimport { CollectionAsset, CollectionComponent } from \"@devtools-ui/collection\";\nimport { InputAsset, InputComponent } from \"@devtools-ui/input\";\nimport { ListAsset, ListComponent } from \"@devtools-ui/list\";\nimport { NavigationAsset, NavigationComponent } from \"@devtools-ui/navigation\";\nimport { ConsoleAsset, ConsoleComponent } from \"@devtools-ui/console\";\nimport { TableAsset, TableComponent } from \"@devtools-ui/table\";\nimport {\n StackedViewView,\n StackedViewComponent,\n} from \"@devtools-ui/stacked-view\";\nimport {\n ObjectInspectorAsset,\n ObjectInspectorComponent,\n} from \"@devtools-ui/object-inspector\";\nimport { TextAsset, TextComponent } from \"@devtools-ui/text\";\nimport { TransformsPlugin } from \"./TransformPlugin\";\n\nconst OptionalChakraThemeProvider = (\n props: React.PropsWithChildren<unknown>\n) => {\n const theme = useTheme();\n\n if (theme) {\n return <>{props.children}</>;\n }\n\n return <ChakraProvider>{props.children}</ChakraProvider>;\n};\n\nexport class AssetsRegistryPlugin\n implements\n ReactPlayerPlugin,\n ExtendedPlayerPlugin<\n [\n ActionAsset,\n ConsoleAsset,\n CollectionAsset,\n InputAsset,\n ListAsset,\n NavigationAsset,\n ObjectInspectorAsset,\n TextAsset,\n StackedViewView,\n TableAsset\n ]\n >\n{\n name = \"devtools-ui\";\n\n applyReact(reactPlayer: ReactPlayer) {\n reactPlayer.registerPlugin(\n new AssetProviderPlugin([\n [\"action\", ActionComponent],\n [\"collection\", CollectionComponent],\n [\"input\", InputComponent],\n [\"list\", ListComponent],\n [\"navigation\", NavigationComponent],\n [\"object-inspector\", ObjectInspectorComponent],\n [\"text\", TextComponent],\n [\"console\", ConsoleComponent],\n [\"stacked-view\", StackedViewComponent],\n [\"table\", TableComponent],\n ])\n );\n\n reactPlayer.hooks.webComponent.tap(this.name, (Comp) => {\n // eslint-disable-next-line react/display-name\n return () => {\n return (\n <OptionalChakraThemeProvider>\n <Comp />\n </OptionalChakraThemeProvider>\n );\n };\n });\n }\n\n apply(player: Player) {\n player.registerPlugin(new TransformsPlugin());\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,iBAAoC;AACpC,IAAAC,qBAA4C;AAC5C,IAAAC,uBAA6C;AAC7C,IAAAC,gBAAkC;AAClC,IAAAC,eAAgC;AAChC,IAAAC,qBAA4C;AAC5C,IAAAC,2BAGO;AACP,IAAAC,eAAgC;AAChC,IAAAC,kBAAsC;AACtC,IAAAC,gBAAkC;;;ACXlC,oCAAqC;AACrC,oBAAgC;AAChC,mBAA+B;AAC/B,8BAAyC;AACzC,qBAAiC;AACjC,mBAA+B;AAExB,IAAM,mBAAN,MAA+C;AAAA,EAA/C;AACL,gBAAO;AAAA;AAAA,EAEP,MAAM,QAAgB;AACpB,WAAO;AAAA,MACL,IAAI,mDAAqB;AAAA,QACvB,CAAC,EAAE,MAAM,SAAS,GAAG,6BAAe;AAAA,QACpC,CAAC,EAAE,MAAM,QAAQ,GAAG,2BAAc;AAAA,QAClC,CAAC,EAAE,MAAM,mBAAmB,GAAG,gDAAwB;AAAA,QACvD,CAAC,EAAE,MAAM,UAAU,GAAG,+BAAgB;AAAA,QACtC,CAAC,EAAE,MAAM,QAAQ,GAAG,2BAAc;AAAA,MACpC,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;ACtBA,mBAAkB;AAElB,IAAAC,gBAAyC;AAMzC,yCAAoC;AACpC,IAAAC,iBAA6C;AAC7C,wBAAqD;AACrD,IAAAC,gBAA2C;AAC3C,kBAAyC;AACzC,wBAAqD;AACrD,IAAAC,kBAA+C;AAC/C,IAAAC,gBAA2C;AAC3C,0BAGO;AACP,IAAAC,2BAGO;AACP,kBAAyC;AAGzC,IAAM,8BAA8B,CAClC,UACG;AACH,QAAM,YAAQ,wBAAS;AAEvB,MAAI,OAAO;AACT,WAAO,6BAAAC,QAAA,2BAAAA,QAAA,gBAAG,MAAM,QAAS;AAAA,EAC3B;AAEA,SAAO,6BAAAA,QAAA,cAAC,oCAAgB,MAAM,QAAS;AACzC;AAEO,IAAM,uBAAN,MAiBP;AAAA,EAjBO;AAkBL,gBAAO;AAAA;AAAA,EAEP,WAAW,aAA0B;AACnC,gBAAY;AAAA,MACV,IAAI,uDAAoB;AAAA,QACtB,CAAC,UAAU,8BAAe;AAAA,QAC1B,CAAC,cAAc,qCAAmB;AAAA,QAClC,CAAC,SAAS,4BAAc;AAAA,QACxB,CAAC,QAAQ,yBAAa;AAAA,QACtB,CAAC,cAAc,qCAAmB;AAAA,QAClC,CAAC,oBAAoB,iDAAwB;AAAA,QAC7C,CAAC,QAAQ,yBAAa;AAAA,QACtB,CAAC,WAAW,gCAAgB;AAAA,QAC5B,CAAC,gBAAgB,wCAAoB;AAAA,QACrC,CAAC,SAAS,4BAAc;AAAA,MAC1B,CAAC;AAAA,IACH;AAEA,gBAAY,MAAM,aAAa,IAAI,KAAK,MAAM,CAAC,SAAS;AAEtD,aAAO,MAAM;AACX,eACE,6BAAAA,QAAA,cAAC,mCACC,6BAAAA,QAAA,cAAC,UAAK,CACR;AAAA,MAEJ;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAgB;AACpB,WAAO,eAAe,IAAI,iBAAiB,CAAC;AAAA,EAC9C;AACF;;;AF3EA,IAAO,cAAQ;","names":["import_action","import_collection","import_stacked_view","import_input","import_list","import_navigation","import_object_inspector","import_text","import_console","import_table","import_react","import_action","import_input","import_console","import_table","import_object_inspector","React"]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/index.ts
|
|
2
|
+
import { Action } from "@devtools-ui/action";
|
|
3
|
+
import { Collection } from "@devtools-ui/collection";
|
|
4
|
+
import { StackedView } from "@devtools-ui/stacked-view";
|
|
5
|
+
import { Input } from "@devtools-ui/input";
|
|
6
|
+
import { List } from "@devtools-ui/list";
|
|
7
|
+
import { Navigation } from "@devtools-ui/navigation";
|
|
8
|
+
import {
|
|
9
|
+
ObjectInspector
|
|
10
|
+
} from "@devtools-ui/object-inspector";
|
|
11
|
+
import { Text } from "@devtools-ui/text";
|
|
12
|
+
import { Console } from "@devtools-ui/console";
|
|
13
|
+
import { Table } from "@devtools-ui/table";
|
|
14
|
+
|
|
15
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/TransformPlugin.ts
|
|
16
|
+
import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
|
|
17
|
+
import { actionTransform } from "@devtools-ui/action";
|
|
18
|
+
import { inputTransform } from "@devtools-ui/input";
|
|
19
|
+
import { objectInspectorTransform } from "@devtools-ui/object-inspector";
|
|
20
|
+
import { consoleTransform } from "@devtools-ui/console";
|
|
21
|
+
import { tableTransform } from "@devtools-ui/table";
|
|
22
|
+
var TransformsPlugin = class {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.name = "devtools-ui-transforms";
|
|
25
|
+
}
|
|
26
|
+
apply(player) {
|
|
27
|
+
player.registerPlugin(
|
|
28
|
+
new AssetTransformPlugin([
|
|
29
|
+
[{ type: "action" }, actionTransform],
|
|
30
|
+
[{ type: "input" }, inputTransform],
|
|
31
|
+
[{ type: "object-inspector" }, objectInspectorTransform],
|
|
32
|
+
[{ type: "console" }, consoleTransform],
|
|
33
|
+
[{ type: "table" }, tableTransform]
|
|
34
|
+
])
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/AssetsRegistryPlugin.tsx
|
|
40
|
+
import React from "react";
|
|
41
|
+
import { ChakraProvider, useTheme } from "@chakra-ui/react";
|
|
42
|
+
import { AssetProviderPlugin } from "@player-ui/asset-provider-plugin-react";
|
|
43
|
+
import { ActionComponent } from "@devtools-ui/action";
|
|
44
|
+
import { CollectionComponent } from "@devtools-ui/collection";
|
|
45
|
+
import { InputComponent } from "@devtools-ui/input";
|
|
46
|
+
import { ListComponent } from "@devtools-ui/list";
|
|
47
|
+
import { NavigationComponent } from "@devtools-ui/navigation";
|
|
48
|
+
import { ConsoleComponent } from "@devtools-ui/console";
|
|
49
|
+
import { TableComponent } from "@devtools-ui/table";
|
|
50
|
+
import {
|
|
51
|
+
StackedViewComponent
|
|
52
|
+
} from "@devtools-ui/stacked-view";
|
|
53
|
+
import {
|
|
54
|
+
ObjectInspectorComponent
|
|
55
|
+
} from "@devtools-ui/object-inspector";
|
|
56
|
+
import { TextComponent } from "@devtools-ui/text";
|
|
57
|
+
var OptionalChakraThemeProvider = (props) => {
|
|
58
|
+
const theme = useTheme();
|
|
59
|
+
if (theme) {
|
|
60
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.children);
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ React.createElement(ChakraProvider, null, props.children);
|
|
63
|
+
};
|
|
64
|
+
var AssetsRegistryPlugin = class {
|
|
65
|
+
constructor() {
|
|
66
|
+
this.name = "devtools-ui";
|
|
67
|
+
}
|
|
68
|
+
applyReact(reactPlayer) {
|
|
69
|
+
reactPlayer.registerPlugin(
|
|
70
|
+
new AssetProviderPlugin([
|
|
71
|
+
["action", ActionComponent],
|
|
72
|
+
["collection", CollectionComponent],
|
|
73
|
+
["input", InputComponent],
|
|
74
|
+
["list", ListComponent],
|
|
75
|
+
["navigation", NavigationComponent],
|
|
76
|
+
["object-inspector", ObjectInspectorComponent],
|
|
77
|
+
["text", TextComponent],
|
|
78
|
+
["console", ConsoleComponent],
|
|
79
|
+
["stacked-view", StackedViewComponent],
|
|
80
|
+
["table", TableComponent]
|
|
81
|
+
])
|
|
82
|
+
);
|
|
83
|
+
reactPlayer.hooks.webComponent.tap(this.name, (Comp) => {
|
|
84
|
+
return () => {
|
|
85
|
+
return /* @__PURE__ */ React.createElement(OptionalChakraThemeProvider, null, /* @__PURE__ */ React.createElement(Comp, null));
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
apply(player) {
|
|
90
|
+
player.registerPlugin(new TransformsPlugin());
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/index.ts
|
|
95
|
+
var src_default = AssetsRegistryPlugin;
|
|
96
|
+
export {
|
|
97
|
+
Action,
|
|
98
|
+
Collection,
|
|
99
|
+
Console,
|
|
100
|
+
Input,
|
|
101
|
+
List,
|
|
102
|
+
Navigation,
|
|
103
|
+
ObjectInspector,
|
|
104
|
+
StackedView,
|
|
105
|
+
Table,
|
|
106
|
+
Text,
|
|
107
|
+
src_default as default
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/index.ts
|
|
2
|
+
import { Action } from "@devtools-ui/action";
|
|
3
|
+
import { Collection } from "@devtools-ui/collection";
|
|
4
|
+
import { StackedView } from "@devtools-ui/stacked-view";
|
|
5
|
+
import { Input } from "@devtools-ui/input";
|
|
6
|
+
import { List } from "@devtools-ui/list";
|
|
7
|
+
import { Navigation } from "@devtools-ui/navigation";
|
|
8
|
+
import {
|
|
9
|
+
ObjectInspector
|
|
10
|
+
} from "@devtools-ui/object-inspector";
|
|
11
|
+
import { Text } from "@devtools-ui/text";
|
|
12
|
+
import { Console } from "@devtools-ui/console";
|
|
13
|
+
import { Table } from "@devtools-ui/table";
|
|
14
|
+
|
|
15
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/TransformPlugin.ts
|
|
16
|
+
import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
|
|
17
|
+
import { actionTransform } from "@devtools-ui/action";
|
|
18
|
+
import { inputTransform } from "@devtools-ui/input";
|
|
19
|
+
import { objectInspectorTransform } from "@devtools-ui/object-inspector";
|
|
20
|
+
import { consoleTransform } from "@devtools-ui/console";
|
|
21
|
+
import { tableTransform } from "@devtools-ui/table";
|
|
22
|
+
var TransformsPlugin = class {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.name = "devtools-ui-transforms";
|
|
25
|
+
}
|
|
26
|
+
apply(player) {
|
|
27
|
+
player.registerPlugin(
|
|
28
|
+
new AssetTransformPlugin([
|
|
29
|
+
[{ type: "action" }, actionTransform],
|
|
30
|
+
[{ type: "input" }, inputTransform],
|
|
31
|
+
[{ type: "object-inspector" }, objectInspectorTransform],
|
|
32
|
+
[{ type: "console" }, consoleTransform],
|
|
33
|
+
[{ type: "table" }, tableTransform]
|
|
34
|
+
])
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/AssetsRegistryPlugin.tsx
|
|
40
|
+
import React from "react";
|
|
41
|
+
import { ChakraProvider, useTheme } from "@chakra-ui/react";
|
|
42
|
+
import { AssetProviderPlugin } from "@player-ui/asset-provider-plugin-react";
|
|
43
|
+
import { ActionComponent } from "@devtools-ui/action";
|
|
44
|
+
import { CollectionComponent } from "@devtools-ui/collection";
|
|
45
|
+
import { InputComponent } from "@devtools-ui/input";
|
|
46
|
+
import { ListComponent } from "@devtools-ui/list";
|
|
47
|
+
import { NavigationComponent } from "@devtools-ui/navigation";
|
|
48
|
+
import { ConsoleComponent } from "@devtools-ui/console";
|
|
49
|
+
import { TableComponent } from "@devtools-ui/table";
|
|
50
|
+
import {
|
|
51
|
+
StackedViewComponent
|
|
52
|
+
} from "@devtools-ui/stacked-view";
|
|
53
|
+
import {
|
|
54
|
+
ObjectInspectorComponent
|
|
55
|
+
} from "@devtools-ui/object-inspector";
|
|
56
|
+
import { TextComponent } from "@devtools-ui/text";
|
|
57
|
+
var OptionalChakraThemeProvider = (props) => {
|
|
58
|
+
const theme = useTheme();
|
|
59
|
+
if (theme) {
|
|
60
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.children);
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ React.createElement(ChakraProvider, null, props.children);
|
|
63
|
+
};
|
|
64
|
+
var AssetsRegistryPlugin = class {
|
|
65
|
+
constructor() {
|
|
66
|
+
this.name = "devtools-ui";
|
|
67
|
+
}
|
|
68
|
+
applyReact(reactPlayer) {
|
|
69
|
+
reactPlayer.registerPlugin(
|
|
70
|
+
new AssetProviderPlugin([
|
|
71
|
+
["action", ActionComponent],
|
|
72
|
+
["collection", CollectionComponent],
|
|
73
|
+
["input", InputComponent],
|
|
74
|
+
["list", ListComponent],
|
|
75
|
+
["navigation", NavigationComponent],
|
|
76
|
+
["object-inspector", ObjectInspectorComponent],
|
|
77
|
+
["text", TextComponent],
|
|
78
|
+
["console", ConsoleComponent],
|
|
79
|
+
["stacked-view", StackedViewComponent],
|
|
80
|
+
["table", TableComponent]
|
|
81
|
+
])
|
|
82
|
+
);
|
|
83
|
+
reactPlayer.hooks.webComponent.tap(this.name, (Comp) => {
|
|
84
|
+
return () => {
|
|
85
|
+
return /* @__PURE__ */ React.createElement(OptionalChakraThemeProvider, null, /* @__PURE__ */ React.createElement(Comp, null));
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
apply(player) {
|
|
90
|
+
player.registerPlugin(new TransformsPlugin());
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/index.ts
|
|
95
|
+
var src_default = AssetsRegistryPlugin;
|
|
96
|
+
export {
|
|
97
|
+
Action,
|
|
98
|
+
Collection,
|
|
99
|
+
Console,
|
|
100
|
+
Input,
|
|
101
|
+
List,
|
|
102
|
+
Navigation,
|
|
103
|
+
ObjectInspector,
|
|
104
|
+
StackedView,
|
|
105
|
+
Table,
|
|
106
|
+
Text,
|
|
107
|
+
src_default as default
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/index.ts","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/TransformPlugin.ts","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugin/src/plugins/AssetsRegistryPlugin.tsx"],"sourcesContent":["import { ActionAsset, Action } from \"@devtools-ui/action\";\nimport { CollectionAsset, Collection } from \"@devtools-ui/collection\";\nimport { StackedViewView, StackedView } from \"@devtools-ui/stacked-view\";\nimport { InputAsset, Input } from \"@devtools-ui/input\";\nimport { ListAsset, List } from \"@devtools-ui/list\";\nimport { NavigationAsset, Navigation } from \"@devtools-ui/navigation\";\nimport {\n ObjectInspectorAsset,\n ObjectInspector,\n} from \"@devtools-ui/object-inspector\";\nimport { TextAsset, Text } from \"@devtools-ui/text\";\nimport { ConsoleAsset, Console } from \"@devtools-ui/console\";\nimport { TableAsset, Table } from \"@devtools-ui/table\";\nimport { AssetsRegistryPlugin } from \"./plugins\";\n\nexport default AssetsRegistryPlugin;\n\nexport type {\n ActionAsset,\n CollectionAsset,\n InputAsset,\n ListAsset,\n NavigationAsset,\n ObjectInspectorAsset,\n TextAsset,\n ConsoleAsset,\n StackedViewView,\n TableAsset,\n};\n\nexport {\n Action,\n Collection,\n Console,\n Input,\n List,\n Navigation,\n ObjectInspector,\n Text,\n StackedView,\n Table,\n};\n","import type { Player, PlayerPlugin } from \"@player-ui/player\";\nimport { AssetTransformPlugin } from \"@player-ui/asset-transform-plugin\";\nimport { actionTransform } from \"@devtools-ui/action\";\nimport { inputTransform } from \"@devtools-ui/input\";\nimport { objectInspectorTransform } from \"@devtools-ui/object-inspector\";\nimport { consoleTransform } from \"@devtools-ui/console\";\nimport { tableTransform } from \"@devtools-ui/table\";\n\nexport class TransformsPlugin implements PlayerPlugin {\n name = \"devtools-ui-transforms\";\n\n apply(player: Player) {\n player.registerPlugin(\n new AssetTransformPlugin([\n [{ type: \"action\" }, actionTransform],\n [{ type: \"input\" }, inputTransform],\n [{ type: \"object-inspector\" }, objectInspectorTransform],\n [{ type: \"console\" }, consoleTransform],\n [{ type: \"table\" }, tableTransform],\n ])\n );\n }\n}\n","import React from \"react\";\nimport type { Player } from \"@player-ui/player\";\nimport { ChakraProvider, useTheme } from \"@chakra-ui/react\";\nimport type {\n ExtendedPlayerPlugin,\n ReactPlayer,\n ReactPlayerPlugin,\n} from \"@player-ui/react\";\nimport { AssetProviderPlugin } from \"@player-ui/asset-provider-plugin-react\";\nimport { ActionAsset, ActionComponent } from \"@devtools-ui/action\";\nimport { CollectionAsset, CollectionComponent } from \"@devtools-ui/collection\";\nimport { InputAsset, InputComponent } from \"@devtools-ui/input\";\nimport { ListAsset, ListComponent } from \"@devtools-ui/list\";\nimport { NavigationAsset, NavigationComponent } from \"@devtools-ui/navigation\";\nimport { ConsoleAsset, ConsoleComponent } from \"@devtools-ui/console\";\nimport { TableAsset, TableComponent } from \"@devtools-ui/table\";\nimport {\n StackedViewView,\n StackedViewComponent,\n} from \"@devtools-ui/stacked-view\";\nimport {\n ObjectInspectorAsset,\n ObjectInspectorComponent,\n} from \"@devtools-ui/object-inspector\";\nimport { TextAsset, TextComponent } from \"@devtools-ui/text\";\nimport { TransformsPlugin } from \"./TransformPlugin\";\n\nconst OptionalChakraThemeProvider = (\n props: React.PropsWithChildren<unknown>\n) => {\n const theme = useTheme();\n\n if (theme) {\n return <>{props.children}</>;\n }\n\n return <ChakraProvider>{props.children}</ChakraProvider>;\n};\n\nexport class AssetsRegistryPlugin\n implements\n ReactPlayerPlugin,\n ExtendedPlayerPlugin<\n [\n ActionAsset,\n ConsoleAsset,\n CollectionAsset,\n InputAsset,\n ListAsset,\n NavigationAsset,\n ObjectInspectorAsset,\n TextAsset,\n StackedViewView,\n TableAsset\n ]\n >\n{\n name = \"devtools-ui\";\n\n applyReact(reactPlayer: ReactPlayer) {\n reactPlayer.registerPlugin(\n new AssetProviderPlugin([\n [\"action\", ActionComponent],\n [\"collection\", CollectionComponent],\n [\"input\", InputComponent],\n [\"list\", ListComponent],\n [\"navigation\", NavigationComponent],\n [\"object-inspector\", ObjectInspectorComponent],\n [\"text\", TextComponent],\n [\"console\", ConsoleComponent],\n [\"stacked-view\", StackedViewComponent],\n [\"table\", TableComponent],\n ])\n );\n\n reactPlayer.hooks.webComponent.tap(this.name, (Comp) => {\n // eslint-disable-next-line react/display-name\n return () => {\n return (\n <OptionalChakraThemeProvider>\n <Comp />\n </OptionalChakraThemeProvider>\n );\n };\n });\n }\n\n apply(player: Player) {\n player.registerPlugin(new TransformsPlugin());\n }\n}\n"],"mappings":";AAAA,SAAsB,cAAc;AACpC,SAA0B,kBAAkB;AAC5C,SAA0B,mBAAmB;AAC7C,SAAqB,aAAa;AAClC,SAAoB,YAAY;AAChC,SAA0B,kBAAkB;AAC5C;AAAA,EAEE;AAAA,OACK;AACP,SAAoB,YAAY;AAChC,SAAuB,eAAe;AACtC,SAAqB,aAAa;;;ACXlC,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,gCAAgC;AACzC,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAExB,IAAM,mBAAN,MAA+C;AAAA,EAA/C;AACL,gBAAO;AAAA;AAAA,EAEP,MAAM,QAAgB;AACpB,WAAO;AAAA,MACL,IAAI,qBAAqB;AAAA,QACvB,CAAC,EAAE,MAAM,SAAS,GAAG,eAAe;AAAA,QACpC,CAAC,EAAE,MAAM,QAAQ,GAAG,cAAc;AAAA,QAClC,CAAC,EAAE,MAAM,mBAAmB,GAAG,wBAAwB;AAAA,QACvD,CAAC,EAAE,MAAM,UAAU,GAAG,gBAAgB;AAAA,QACtC,CAAC,EAAE,MAAM,QAAQ,GAAG,cAAc;AAAA,MACpC,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;ACtBA,OAAO,WAAW;AAElB,SAAS,gBAAgB,gBAAgB;AAMzC,SAAS,2BAA2B;AACpC,SAAsB,uBAAuB;AAC7C,SAA0B,2BAA2B;AACrD,SAAqB,sBAAsB;AAC3C,SAAoB,qBAAqB;AACzC,SAA0B,2BAA2B;AACrD,SAAuB,wBAAwB;AAC/C,SAAqB,sBAAsB;AAC3C;AAAA,EAEE;AAAA,OACK;AACP;AAAA,EAEE;AAAA,OACK;AACP,SAAoB,qBAAqB;AAGzC,IAAM,8BAA8B,CAClC,UACG;AACH,QAAM,QAAQ,SAAS;AAEvB,MAAI,OAAO;AACT,WAAO,0DAAG,MAAM,QAAS;AAAA,EAC3B;AAEA,SAAO,oCAAC,sBAAgB,MAAM,QAAS;AACzC;AAEO,IAAM,uBAAN,MAiBP;AAAA,EAjBO;AAkBL,gBAAO;AAAA;AAAA,EAEP,WAAW,aAA0B;AACnC,gBAAY;AAAA,MACV,IAAI,oBAAoB;AAAA,QACtB,CAAC,UAAU,eAAe;AAAA,QAC1B,CAAC,cAAc,mBAAmB;AAAA,QAClC,CAAC,SAAS,cAAc;AAAA,QACxB,CAAC,QAAQ,aAAa;AAAA,QACtB,CAAC,cAAc,mBAAmB;AAAA,QAClC,CAAC,oBAAoB,wBAAwB;AAAA,QAC7C,CAAC,QAAQ,aAAa;AAAA,QACtB,CAAC,WAAW,gBAAgB;AAAA,QAC5B,CAAC,gBAAgB,oBAAoB;AAAA,QACrC,CAAC,SAAS,cAAc;AAAA,MAC1B,CAAC;AAAA,IACH;AAEA,gBAAY,MAAM,aAAa,IAAI,KAAK,MAAM,CAAC,SAAS;AAEtD,aAAO,MAAM;AACX,eACE,oCAAC,mCACC,oCAAC,UAAK,CACR;AAAA,MAEJ;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAgB;AACpB,WAAO,eAAe,IAAI,iBAAiB,CAAC;AAAA,EAC9C;AACF;;;AF3EA,IAAO,cAAQ;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@devtools-ui/plugin",
|
|
3
|
+
"version": "0.0.2--canary.11.588",
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"main": "dist/cjs/index.cjs",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@devtools-ui/action": "0.0.2--canary.11.588",
|
|
8
|
+
"@devtools-ui/console": "0.0.2--canary.11.588",
|
|
9
|
+
"@devtools-ui/collection": "0.0.2--canary.11.588",
|
|
10
|
+
"@devtools-ui/input": "0.0.2--canary.11.588",
|
|
11
|
+
"@devtools-ui/list": "0.0.2--canary.11.588",
|
|
12
|
+
"@devtools-ui/navigation": "0.0.2--canary.11.588",
|
|
13
|
+
"@devtools-ui/object-inspector": "0.0.2--canary.11.588",
|
|
14
|
+
"@devtools-ui/text": "0.0.2--canary.11.588",
|
|
15
|
+
"@devtools-ui/stacked-view": "0.0.2--canary.11.588",
|
|
16
|
+
"@devtools-ui/table": "0.0.2--canary.11.588",
|
|
17
|
+
"@chakra-ui/react": "^2.8.2",
|
|
18
|
+
"@player-ui/asset-provider-plugin-react": "^0.7.1",
|
|
19
|
+
"@player-ui/asset-transform-plugin": "^0.7.1",
|
|
20
|
+
"@player-ui/player": "0.7.1",
|
|
21
|
+
"@player-ui/react": "^0.7.1",
|
|
22
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
23
|
+
"react": "^18.2.0",
|
|
24
|
+
"@types/react": "^18.2.51",
|
|
25
|
+
"tslib": "^2.6.2"
|
|
26
|
+
},
|
|
27
|
+
"module": "dist/index.legacy-esm.js",
|
|
28
|
+
"types": "types/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
"./package.json": "./package.json",
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./types/index.d.ts",
|
|
33
|
+
"import": "./dist/index.mjs",
|
|
34
|
+
"default": "./dist/cjs/index.cjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"src",
|
|
40
|
+
"types"
|
|
41
|
+
],
|
|
42
|
+
"peerDependencies": {}
|
|
43
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ActionAsset, Action } from "@devtools-ui/action";
|
|
2
|
+
import { CollectionAsset, Collection } from "@devtools-ui/collection";
|
|
3
|
+
import { StackedViewView, StackedView } from "@devtools-ui/stacked-view";
|
|
4
|
+
import { InputAsset, Input } from "@devtools-ui/input";
|
|
5
|
+
import { ListAsset, List } from "@devtools-ui/list";
|
|
6
|
+
import { NavigationAsset, Navigation } from "@devtools-ui/navigation";
|
|
7
|
+
import {
|
|
8
|
+
ObjectInspectorAsset,
|
|
9
|
+
ObjectInspector,
|
|
10
|
+
} from "@devtools-ui/object-inspector";
|
|
11
|
+
import { TextAsset, Text } from "@devtools-ui/text";
|
|
12
|
+
import { ConsoleAsset, Console } from "@devtools-ui/console";
|
|
13
|
+
import { TableAsset, Table } from "@devtools-ui/table";
|
|
14
|
+
import { AssetsRegistryPlugin } from "./plugins";
|
|
15
|
+
|
|
16
|
+
export default AssetsRegistryPlugin;
|
|
17
|
+
|
|
18
|
+
export type {
|
|
19
|
+
ActionAsset,
|
|
20
|
+
CollectionAsset,
|
|
21
|
+
InputAsset,
|
|
22
|
+
ListAsset,
|
|
23
|
+
NavigationAsset,
|
|
24
|
+
ObjectInspectorAsset,
|
|
25
|
+
TextAsset,
|
|
26
|
+
ConsoleAsset,
|
|
27
|
+
StackedViewView,
|
|
28
|
+
TableAsset,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
Action,
|
|
33
|
+
Collection,
|
|
34
|
+
Console,
|
|
35
|
+
Input,
|
|
36
|
+
List,
|
|
37
|
+
Navigation,
|
|
38
|
+
ObjectInspector,
|
|
39
|
+
Text,
|
|
40
|
+
StackedView,
|
|
41
|
+
Table,
|
|
42
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Player } from "@player-ui/player";
|
|
3
|
+
import { ChakraProvider, useTheme } from "@chakra-ui/react";
|
|
4
|
+
import type {
|
|
5
|
+
ExtendedPlayerPlugin,
|
|
6
|
+
ReactPlayer,
|
|
7
|
+
ReactPlayerPlugin,
|
|
8
|
+
} from "@player-ui/react";
|
|
9
|
+
import { AssetProviderPlugin } from "@player-ui/asset-provider-plugin-react";
|
|
10
|
+
import { ActionAsset, ActionComponent } from "@devtools-ui/action";
|
|
11
|
+
import { CollectionAsset, CollectionComponent } from "@devtools-ui/collection";
|
|
12
|
+
import { InputAsset, InputComponent } from "@devtools-ui/input";
|
|
13
|
+
import { ListAsset, ListComponent } from "@devtools-ui/list";
|
|
14
|
+
import { NavigationAsset, NavigationComponent } from "@devtools-ui/navigation";
|
|
15
|
+
import { ConsoleAsset, ConsoleComponent } from "@devtools-ui/console";
|
|
16
|
+
import { TableAsset, TableComponent } from "@devtools-ui/table";
|
|
17
|
+
import {
|
|
18
|
+
StackedViewView,
|
|
19
|
+
StackedViewComponent,
|
|
20
|
+
} from "@devtools-ui/stacked-view";
|
|
21
|
+
import {
|
|
22
|
+
ObjectInspectorAsset,
|
|
23
|
+
ObjectInspectorComponent,
|
|
24
|
+
} from "@devtools-ui/object-inspector";
|
|
25
|
+
import { TextAsset, TextComponent } from "@devtools-ui/text";
|
|
26
|
+
import { TransformsPlugin } from "./TransformPlugin";
|
|
27
|
+
|
|
28
|
+
const OptionalChakraThemeProvider = (
|
|
29
|
+
props: React.PropsWithChildren<unknown>
|
|
30
|
+
) => {
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
|
|
33
|
+
if (theme) {
|
|
34
|
+
return <>{props.children}</>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return <ChakraProvider>{props.children}</ChakraProvider>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export class AssetsRegistryPlugin
|
|
41
|
+
implements
|
|
42
|
+
ReactPlayerPlugin,
|
|
43
|
+
ExtendedPlayerPlugin<
|
|
44
|
+
[
|
|
45
|
+
ActionAsset,
|
|
46
|
+
ConsoleAsset,
|
|
47
|
+
CollectionAsset,
|
|
48
|
+
InputAsset,
|
|
49
|
+
ListAsset,
|
|
50
|
+
NavigationAsset,
|
|
51
|
+
ObjectInspectorAsset,
|
|
52
|
+
TextAsset,
|
|
53
|
+
StackedViewView,
|
|
54
|
+
TableAsset
|
|
55
|
+
]
|
|
56
|
+
>
|
|
57
|
+
{
|
|
58
|
+
name = "devtools-ui";
|
|
59
|
+
|
|
60
|
+
applyReact(reactPlayer: ReactPlayer) {
|
|
61
|
+
reactPlayer.registerPlugin(
|
|
62
|
+
new AssetProviderPlugin([
|
|
63
|
+
["action", ActionComponent],
|
|
64
|
+
["collection", CollectionComponent],
|
|
65
|
+
["input", InputComponent],
|
|
66
|
+
["list", ListComponent],
|
|
67
|
+
["navigation", NavigationComponent],
|
|
68
|
+
["object-inspector", ObjectInspectorComponent],
|
|
69
|
+
["text", TextComponent],
|
|
70
|
+
["console", ConsoleComponent],
|
|
71
|
+
["stacked-view", StackedViewComponent],
|
|
72
|
+
["table", TableComponent],
|
|
73
|
+
])
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
reactPlayer.hooks.webComponent.tap(this.name, (Comp) => {
|
|
77
|
+
// eslint-disable-next-line react/display-name
|
|
78
|
+
return () => {
|
|
79
|
+
return (
|
|
80
|
+
<OptionalChakraThemeProvider>
|
|
81
|
+
<Comp />
|
|
82
|
+
</OptionalChakraThemeProvider>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
apply(player: Player) {
|
|
89
|
+
player.registerPlugin(new TransformsPlugin());
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Player, PlayerPlugin } from "@player-ui/player";
|
|
2
|
+
import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
|
|
3
|
+
import { actionTransform } from "@devtools-ui/action";
|
|
4
|
+
import { inputTransform } from "@devtools-ui/input";
|
|
5
|
+
import { objectInspectorTransform } from "@devtools-ui/object-inspector";
|
|
6
|
+
import { consoleTransform } from "@devtools-ui/console";
|
|
7
|
+
import { tableTransform } from "@devtools-ui/table";
|
|
8
|
+
|
|
9
|
+
export class TransformsPlugin implements PlayerPlugin {
|
|
10
|
+
name = "devtools-ui-transforms";
|
|
11
|
+
|
|
12
|
+
apply(player: Player) {
|
|
13
|
+
player.registerPlugin(
|
|
14
|
+
new AssetTransformPlugin([
|
|
15
|
+
[{ type: "action" }, actionTransform],
|
|
16
|
+
[{ type: "input" }, inputTransform],
|
|
17
|
+
[{ type: "object-inspector" }, objectInspectorTransform],
|
|
18
|
+
[{ type: "console" }, consoleTransform],
|
|
19
|
+
[{ type: "table" }, tableTransform],
|
|
20
|
+
])
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActionAsset, Action } from "@devtools-ui/action";
|
|
2
|
+
import { CollectionAsset, Collection } from "@devtools-ui/collection";
|
|
3
|
+
import { StackedViewView, StackedView } from "@devtools-ui/stacked-view";
|
|
4
|
+
import { InputAsset, Input } from "@devtools-ui/input";
|
|
5
|
+
import { ListAsset, List } from "@devtools-ui/list";
|
|
6
|
+
import { NavigationAsset, Navigation } from "@devtools-ui/navigation";
|
|
7
|
+
import { ObjectInspectorAsset, ObjectInspector } from "@devtools-ui/object-inspector";
|
|
8
|
+
import { TextAsset, Text } from "@devtools-ui/text";
|
|
9
|
+
import { ConsoleAsset, Console } from "@devtools-ui/console";
|
|
10
|
+
import { TableAsset, Table } from "@devtools-ui/table";
|
|
11
|
+
import { AssetsRegistryPlugin } from "./plugins";
|
|
12
|
+
export default AssetsRegistryPlugin;
|
|
13
|
+
export type { ActionAsset, CollectionAsset, InputAsset, ListAsset, NavigationAsset, ObjectInspectorAsset, TextAsset, ConsoleAsset, StackedViewView, TableAsset, };
|
|
14
|
+
export { Action, Collection, Console, Input, List, Navigation, ObjectInspector, Text, StackedView, Table, };
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Player } from "@player-ui/player";
|
|
2
|
+
import type { ExtendedPlayerPlugin, ReactPlayer, ReactPlayerPlugin } from "@player-ui/react";
|
|
3
|
+
import { ActionAsset } from "@devtools-ui/action";
|
|
4
|
+
import { CollectionAsset } from "@devtools-ui/collection";
|
|
5
|
+
import { InputAsset } from "@devtools-ui/input";
|
|
6
|
+
import { ListAsset } from "@devtools-ui/list";
|
|
7
|
+
import { NavigationAsset } from "@devtools-ui/navigation";
|
|
8
|
+
import { ConsoleAsset } from "@devtools-ui/console";
|
|
9
|
+
import { TableAsset } from "@devtools-ui/table";
|
|
10
|
+
import { StackedViewView } from "@devtools-ui/stacked-view";
|
|
11
|
+
import { ObjectInspectorAsset } from "@devtools-ui/object-inspector";
|
|
12
|
+
import { TextAsset } from "@devtools-ui/text";
|
|
13
|
+
export declare class AssetsRegistryPlugin implements ReactPlayerPlugin, ExtendedPlayerPlugin<[
|
|
14
|
+
ActionAsset,
|
|
15
|
+
ConsoleAsset,
|
|
16
|
+
CollectionAsset,
|
|
17
|
+
InputAsset,
|
|
18
|
+
ListAsset,
|
|
19
|
+
NavigationAsset,
|
|
20
|
+
ObjectInspectorAsset,
|
|
21
|
+
TextAsset,
|
|
22
|
+
StackedViewView,
|
|
23
|
+
TableAsset
|
|
24
|
+
]> {
|
|
25
|
+
name: string;
|
|
26
|
+
applyReact(reactPlayer: ReactPlayer): void;
|
|
27
|
+
apply(player: Player): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=AssetsRegistryPlugin.d.ts.map
|