muffin-admin 3.8.3 → 3.8.5

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/types.d.ts CHANGED
@@ -2,7 +2,7 @@ export type TProps = {
2
2
  [key: string]: any;
3
3
  };
4
4
  export type AdminAction = {
5
- view: ("show" | "edit" | "list" | "bulk")[];
5
+ view?: ("show" | "edit" | "list" | "bulk")[];
6
6
  id: string;
7
7
  label: string;
8
8
  title: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muffin-admin",
3
- "version": "3.8.3",
3
+ "version": "3.8.5",
4
4
  "description": "NPM package for https://github.com/klen/muffin-admin",
5
5
  "files": [
6
6
  "src",
@@ -65,7 +65,7 @@ setupAdmin(["edit-toolbar"], MuffinEditToolbar)
65
65
  export function MuffinEditActions() {
66
66
  const { edit, actions: baseActions = [] } = useMuffinResourceOpts()
67
67
  if (!edit) return null
68
- const actions = baseActions.filter((a => a.view.includes("edit")))
68
+ const actions = baseActions.filter((a) => a.view?.includes("edit"))
69
69
  return (
70
70
  <>
71
71
  {actions.map((props, idx) => (
@@ -93,7 +93,7 @@ function MuffinListBulkActions() {
93
93
  actions: baseActions = [],
94
94
  list: { remove },
95
95
  } = useMuffinResourceOpts()
96
- const actions = baseActions.filter((a) => a.view.includes("bulk"))
96
+ const actions = baseActions.filter((a) => a.view?.includes("bulk"))
97
97
  return (
98
98
  <>
99
99
  {actions.map((props) => (
@@ -40,7 +40,7 @@ setupAdmin(["show-toolbar"], MuffinShowToolbar)
40
40
 
41
41
  export function MuffinShowActions() {
42
42
  const { actions: baseActions = [] } = useMuffinResourceOpts()
43
- const actions = baseActions.filter((a) => a.view.includes("show"))
43
+ const actions = baseActions.filter((a) => a.view?.includes("show"))
44
44
  return actions.map((props) => <ActionButton key={props.id} {...props} />)
45
45
  }
46
46
 
package/src/types.ts CHANGED
@@ -3,7 +3,7 @@ export type TProps = {
3
3
  }
4
4
 
5
5
  export type AdminAction = {
6
- view: ("show" | "edit" | "list" | "bulk")[]
6
+ view?: ("show" | "edit" | "list" | "bulk")[]
7
7
  id: string
8
8
  label: string
9
9
  title: string