@sanity/insert-menu
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -10,4 +10,8 @@ /// <reference types="react" /> | ||
export declare interface InsertMenuOptions { | ||
/** @defaultValue `false` */ | ||
filter?: boolean | ||
/** | ||
* @defaultValue `'auto'` | ||
* `filter: 'auto'` automatically turns on filtering if there are more than 5 | ||
* schema types added to the menu. | ||
*/ | ||
filter?: 'auto' | 'on' | 'off' | ||
groups?: Array<{ | ||
@@ -14,0 +18,0 @@ name: string |
@@ -28,4 +28,4 @@ import { jsx, jsxs } from "react/jsx-runtime"; | ||
function InsertMenu(props) { | ||
var _a, _b; | ||
const showIcons = props.showIcons === void 0 ? !0 : props.showIcons, showFilter = (_a = props.filter) != null ? _a : props.schemaTypes.length > 5, [state, send] = useReducer(fullInsertMenuReducer, { | ||
var _a; | ||
const showIcons = props.showIcons === void 0 ? !0 : props.showIcons, showFilter = props.filter === "on" ? !0 : props.filter === "off" ? !1 : props.schemaTypes.length > 5, [state, send] = useReducer(fullInsertMenuReducer, { | ||
query: "", | ||
@@ -40,3 +40,3 @@ groups: props.groups ? [ | ||
] : [], | ||
views: ((_b = props.views) != null ? _b : [{ name: "list" }]).map((view, index) => ({ | ||
views: ((_a = props.views) != null ? _a : [{ name: "list" }]).map((view, index) => ({ | ||
...view, | ||
@@ -43,0 +43,0 @@ selected: index === 0 |
{ | ||
"name": "@sanity/insert-menu", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
/** @alpha This API may change */ | ||
export interface InsertMenuOptions { | ||
/** @defaultValue `false` */ | ||
filter?: boolean | ||
/** | ||
* @defaultValue `'auto'` | ||
* `filter: 'auto'` automatically turns on filtering if there are more than 5 | ||
* schema types added to the menu. | ||
*/ | ||
filter?: 'auto' | 'on' | 'off' | ||
groups?: Array<{name: string; title?: string; of?: Array<string>}> | ||
@@ -6,0 +10,0 @@ /** defaultValue `true` */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77006
989