@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
56 lines (53 loc) • 1.67 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _components = require("@wordpress/components");
var _i18n = require("@wordpress/i18n");
var _data = require("@wordpress/data");
var _element = require("@wordpress/element");
var _store = require("../../store");
var _lockUnlock = require("../../lock-unlock");
var _constants = require("./constants");
var _jsxRuntime = require("react/jsx-runtime");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const {
Tabs
} = (0, _lockUnlock.unlock)(_components.privateApis);
const SidebarHeader = (_, ref) => {
const {
documentLabel
} = (0, _data.useSelect)(select => {
const {
getPostTypeLabel
} = select(_store.store);
return {
// translators: Default label for the Document sidebar tab, not selected.
documentLabel: getPostTypeLabel() || (0, _i18n._x)('Document', 'noun')
};
}, []);
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tabs.TabList, {
ref: ref,
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.Tab, {
tabId: _constants.sidebars.document
// Used for focus management in the SettingsSidebar component.
,
"data-tab-id": _constants.sidebars.document,
children: documentLabel
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.Tab, {
tabId: _constants.sidebars.block
// Used for focus management in the SettingsSidebar component.
,
"data-tab-id": _constants.sidebars.block,
children: (0, _i18n.__)('Block')
})]
});
};
var _default = exports.default = (0, _element.forwardRef)(SidebarHeader);
//# sourceMappingURL=header.js.map