UNPKG

@wordpress/block-editor

Version:
64 lines (63 loc) 1.58 kB
// packages/block-editor/src/components/resolution-tool/index.js import { SelectControl, __experimentalToolsPanelItem as ToolsPanelItem } from "@wordpress/components"; import { __, _x } from "@wordpress/i18n"; import { jsx } from "react/jsx-runtime"; var DEFAULT_SIZE_OPTIONS = [ { label: _x("Thumbnail", "Image size option for resolution control"), value: "thumbnail" }, { label: _x("Medium", "Image size option for resolution control"), value: "medium" }, { label: _x("Large", "Image size option for resolution control"), value: "large" }, { label: _x("Full Size", "Image size option for resolution control"), value: "full" } ]; function ResolutionTool({ panelId, value, onChange, options = DEFAULT_SIZE_OPTIONS, defaultValue = DEFAULT_SIZE_OPTIONS[0].value, isShownByDefault = true, resetAllFilter }) { const displayValue = value ?? defaultValue; return /* @__PURE__ */ jsx( ToolsPanelItem, { hasValue: () => displayValue !== defaultValue, label: __("Resolution"), onDeselect: () => onChange(defaultValue), isShownByDefault, panelId, resetAllFilter, children: /* @__PURE__ */ jsx( SelectControl, { __nextHasNoMarginBottom: true, label: __("Resolution"), value: displayValue, options, onChange, help: __("Select the size of the source image."), size: "__unstable-large" } ) } ); } export { ResolutionTool as default }; //# sourceMappingURL=index.js.map