@devtools-ui/console 0.4.1--canary.62.3837 → 0.4.1-next.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/README.md +92 -0
- package/package.json +9 -9
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @devtools-ui/console
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
`@devtools-ui/console` is a component package designed to be leveraged by a [Player-UI assets plugin](https://player-ui.github.io/next/plugins).
|
|
6
|
+
|
|
7
|
+
It provides a [Console]([TODO: add link to storybook]) component that can be used to [TODO: define component features].
|
|
8
|
+
|
|
9
|
+
This package is part of a mono-repo built with Bazel, ensuring fast and reliable builds.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
To install `@devtools-ui/console`, you can use pnpm or yarn:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pnpm i @devtools-ui/console
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
or
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
yarn add @devtools-ui/console
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
You can leverage this asset through the `@devtools-ui/plugin`:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { Console } from "@devtools-ui/plugin";
|
|
31
|
+
|
|
32
|
+
// and use it to define your Player-UI content:
|
|
33
|
+
myFlow = {
|
|
34
|
+
id: "my_flow",
|
|
35
|
+
views: [<Console exp={e`my_expression`} binding={b`my_binding`} />],
|
|
36
|
+
};
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For more information on how to author Player-UI content using DSL, please check our [Player-UI docs](https://player-ui.github.io/next/dsl#tsxjsx-content-authoring-player-dsl).
|
|
40
|
+
|
|
41
|
+
Or, your can leverage this asset in your own plugin:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
// TransformPlugin.ts
|
|
45
|
+
import type { Player, PlayerPlugin } from "@player-ui/player";
|
|
46
|
+
import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
|
|
47
|
+
import { consoleTransform } from "@devtools-ui/console";
|
|
48
|
+
|
|
49
|
+
export class TransformsPlugin implements PlayerPlugin {
|
|
50
|
+
name = "my-plugin-transforms";
|
|
51
|
+
|
|
52
|
+
apply(player: Player) {
|
|
53
|
+
player.registerPlugin(
|
|
54
|
+
new AssetTransformPlugin([[{ type: "console" }, consoleTransform]])
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
// AssetRegistryPlugin.ts
|
|
62
|
+
import React from "react";
|
|
63
|
+
import type { Player } from "@player-ui/player";
|
|
64
|
+
import type {
|
|
65
|
+
ExtendedPlayerPlugin,
|
|
66
|
+
ReactPlayer,
|
|
67
|
+
ReactPlayerPlugin,
|
|
68
|
+
} from "@player-ui/react";
|
|
69
|
+
import { AssetProviderPlugin } from "@player-ui/asset-provider-plugin-react";
|
|
70
|
+
import { TransformsPlugin } from "./TransformPlugin";
|
|
71
|
+
import { ConsoleAsset, ConsoleComponent } from "@devtools-ui/console";
|
|
72
|
+
|
|
73
|
+
export class AssetsRegistryPlugin
|
|
74
|
+
implements ReactPlayerPlugin, ExtendedPlayerPlugin<[ConsoleAsset]>
|
|
75
|
+
{
|
|
76
|
+
name = "my-plugin";
|
|
77
|
+
|
|
78
|
+
applyReact(reactPlayer: ReactPlayer) {
|
|
79
|
+
reactPlayer.registerPlugin(
|
|
80
|
+
new AssetProviderPlugin([["console", ConsoleComponent]])
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
apply(player: Player) {
|
|
85
|
+
player.registerPlugin(new TransformsPlugin());
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Contributing
|
|
91
|
+
|
|
92
|
+
We welcome contributions to `@devtools-ui/console`! Please see the [CONTRIBUTING.md](TODO: link to the file) file for more information on how to contribute.
|
package/package.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
+
"sideEffects": false,
|
|
3
|
+
"files": [
|
|
4
|
+
"dist",
|
|
5
|
+
"src",
|
|
6
|
+
"types"
|
|
7
|
+
],
|
|
2
8
|
"name": "@devtools-ui/console",
|
|
3
|
-
"version": "0.4.1
|
|
9
|
+
"version": "0.4.1-next.0",
|
|
4
10
|
"main": "dist/cjs/index.cjs",
|
|
5
11
|
"dependencies": {
|
|
6
|
-
"@devtools-ui/text": "0.4.1
|
|
7
|
-
"@devtools-ui/collection": "0.4.1
|
|
12
|
+
"@devtools-ui/text": "0.4.1-next.0",
|
|
13
|
+
"@devtools-ui/collection": "0.4.1-next.0",
|
|
8
14
|
"@chakra-ui/react": "^2.8.2",
|
|
9
15
|
"@devtools-ds/console": "^1.2.1",
|
|
10
16
|
"@emotion/react": "^11.11.4",
|
|
@@ -17,7 +23,6 @@
|
|
|
17
23
|
},
|
|
18
24
|
"module": "dist/index.legacy-esm.js",
|
|
19
25
|
"types": "types/index.d.ts",
|
|
20
|
-
"sideEffects": false,
|
|
21
26
|
"exports": {
|
|
22
27
|
"./package.json": "./package.json",
|
|
23
28
|
"./dist/index.css": "./dist/index.css",
|
|
@@ -27,11 +32,6 @@
|
|
|
27
32
|
"default": "./dist/cjs/index.cjs"
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
|
-
"files": [
|
|
31
|
-
"dist",
|
|
32
|
-
"src",
|
|
33
|
-
"types"
|
|
34
|
-
],
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@player-lang/react-dsl": "1.0.1",
|
|
37
37
|
"@player-ui/asset-transform-plugin": "0.15.5",
|