muffin-admin 2.9.0 → 2.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muffin-admin",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "NPM package for https://github.com/klen/muffin-admin",
5
5
  "files": [
6
6
  "src",
@@ -11,7 +11,6 @@ import {
11
11
  import { buildRA } from "./buildRA"
12
12
  import { ActionButton } from "./buttons"
13
13
  import { useMuffinAdminOpts, useMuffinResourceOpts } from "./hooks"
14
- import { AdminAction } from "./types"
15
14
  import { buildAdmin, findBuilder, setupAdmin } from "./utils"
16
15
 
17
16
  export function MuffinResourceEdit() {
@@ -21,11 +20,11 @@ export function MuffinResourceEdit() {
21
20
  const { edit, name } = useMuffinResourceOpts()
22
21
  if (!edit) return null
23
22
 
24
- const { actions, inputs, remove, ...opts } = edit
25
- const Actions = findBuilder(["edit-actions", name])
23
+ const { inputs, remove } = edit
24
+ const Actions = findBuilder(["edit-actions", name]) as unknown as any
26
25
 
27
26
  return (
28
- <Edit actions={<Actions actions={actions} />} mutationMode={mutationMode} {...opts}>
27
+ <Edit actions={<Actions />} mutationMode={mutationMode}>
29
28
  <SimpleForm
30
29
  toolbar={
31
30
  <Toolbar>
@@ -48,7 +47,10 @@ export function MuffinResourceEdit() {
48
47
 
49
48
  setupAdmin(["edit"], MuffinResourceEdit)
50
49
 
51
- function MuffinResourceEditActions({ actions }: { actions: AdminAction[] }) {
50
+ function MuffinResourceEditActions() {
51
+ const { edit } = useMuffinResourceOpts()
52
+ if (!edit) return null
53
+ const { actions = [] } = edit
52
54
  return (
53
55
  <TopToolbar>
54
56
  {actions.map((props, idx) => (