@devtools-ui/object-inspector 0.4.1--canary.62.3837 → 0.4.1

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.
Files changed (2) hide show
  1. package/README.md +101 -0
  2. package/package.json +9 -9
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # @devtools-ui/object-inspector
2
+
3
+ ## Overview
4
+
5
+ `@devtools-ui/object-inspector` 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 an `ObjectInspector` component to display objects for debugging purposes.
8
+
9
+ ## Installation
10
+
11
+ To install `@devtools-ui/object-inspector`, you can use pnpm or yarn:
12
+
13
+ ```sh
14
+ pnpm i @devtools-ui/object-inspector
15
+ ```
16
+
17
+ or
18
+
19
+ ```sh
20
+ yarn add @devtools-ui/object-inspector
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ You can leverage this asset through the `@devtools-ui/plugin`:
26
+
27
+ ```ts
28
+ import { ObjectInspector } from "@devtools-ui/plugin";
29
+
30
+ // and use it to define your Player-UI content:
31
+ myFlow = {
32
+ id: "my_flow",
33
+ views: [
34
+ <MyView>
35
+ <ObjectInspector binding={b`foo`}>
36
+ <ObjectInspector.Label>Label</ObjectInspector.Label>
37
+ </ObjectInspector>
38
+ </MyView>,
39
+ ],
40
+ };
41
+ ```
42
+
43
+ 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).
44
+
45
+ Or, your can leverage this asset in your own plugin:
46
+
47
+ ```ts
48
+ // TransformPlugin.ts
49
+ import type { Player, PlayerPlugin } from "@player-ui/player";
50
+ import { AssetTransformPlugin } from "@player-ui/asset-transform-plugin";
51
+ import { objectInspectorTransform } from "@devtools-ui/object-inspector";
52
+
53
+ export class TransformsPlugin implements PlayerPlugin {
54
+ name = "my-plugin-transforms";
55
+
56
+ apply(player: Player) {
57
+ player.registerPlugin(
58
+ new AssetTransformPlugin([
59
+ [{ type: "object-inspector" }, objectInspectorTransform],
60
+ ])
61
+ );
62
+ }
63
+ }
64
+ ```
65
+
66
+ ```ts
67
+ // AssetRegistryPlugin.ts
68
+ import React from "react";
69
+ import type { Player } from "@player-ui/player";
70
+ import type {
71
+ ExtendedPlayerPlugin,
72
+ ReactPlayer,
73
+ ReactPlayerPlugin,
74
+ } from "@player-ui/react";
75
+ import { AssetProviderPlugin } from "@player-ui/asset-provider-plugin-react";
76
+ import { TransformsPlugin } from "./TransformPlugin";
77
+ import {
78
+ ObjectInspectorAsset,
79
+ ObjectInspectorComponent,
80
+ } from "@devtools-ui/object-inspector";
81
+
82
+ export class AssetsRegistryPlugin
83
+ implements ReactPlayerPlugin, ExtendedPlayerPlugin<[ObjectInspectorAsset]>
84
+ {
85
+ name = "my-plugin";
86
+
87
+ applyReact(reactPlayer: ReactPlayer) {
88
+ reactPlayer.registerPlugin(
89
+ new AssetProviderPlugin([["object-inspector", ObjectInspectorComponent]])
90
+ );
91
+ }
92
+
93
+ apply(player: Player) {
94
+ player.registerPlugin(new TransformsPlugin());
95
+ }
96
+ }
97
+ ```
98
+
99
+ ## Contributing
100
+
101
+ We welcome contributions to `@devtools-ui/object-inspector`!
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/object-inspector",
3
- "version": "0.4.1--canary.62.3837",
9
+ "version": "0.4.1",
4
10
  "main": "dist/cjs/index.cjs",
5
11
  "dependencies": {
6
- "@devtools-ui/collection": "0.4.1--canary.62.3837",
7
- "@devtools-ui/text": "0.4.1--canary.62.3837",
12
+ "@devtools-ui/collection": "0.4.1",
13
+ "@devtools-ui/text": "0.4.1",
8
14
  "@chakra-ui/react": "^2.8.2",
9
15
  "@devtools-ds/object-inspector": "^1.1.2",
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-ui/player": "0.15.5",
37
37
  "@player-ui/react": "0.15.5",