@measured/puck 0.10.0-canary.e308381 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/README.md +14 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -120,15 +120,24 @@ Each render function receives three props:
120
120
 
121
121
  #### Example
122
122
 
123
- Here's a basic plugin that renders a "My plugin" heading in the root field area:
123
+ Here's an example plugin that creates a button to toggle the left side-bar:
124
124
 
125
125
  ```jsx
126
126
  const myPlugin = {
127
- renderRootFields: (props) => (
127
+ renderRootFields: ({ children, dispatch, state }) => (
128
128
  <div>
129
- {props.children}
130
-
131
- <h2>My plugin</h2>
129
+ {children}
130
+
131
+ <button
132
+ onClick={() => {
133
+ dispatch({
134
+ type: "setUi",
135
+ ui: { leftSideBarVisible: !state.ui.leftSideBarVisible },
136
+ });
137
+ }}
138
+ >
139
+ Toggle side-bar
140
+ </button>
132
141
  </div>
133
142
  ),
134
143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.10.0-canary.e308381",
3
+ "version": "0.10.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",