@wordpress/block-editor
Version:
32 lines (30 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _i18n = require("@wordpress/i18n");
var _element = require("@wordpress/element");
var _components = require("@wordpress/components");
var _jsxRuntime = require("react/jsx-runtime");
/**
* WordPress dependencies
*/
const globalTips = [(0, _element.createInterpolateElement)((0, _i18n.__)('While writing, you can press <kbd>/</kbd> to quickly insert new blocks.'), {
kbd: /*#__PURE__*/(0, _jsxRuntime.jsx)("kbd", {})
}), (0, _element.createInterpolateElement)((0, _i18n.__)('Indent a list by pressing <kbd>space</kbd> at the beginning of a line.'), {
kbd: /*#__PURE__*/(0, _jsxRuntime.jsx)("kbd", {})
}), (0, _element.createInterpolateElement)((0, _i18n.__)('Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line.'), {
kbd: /*#__PURE__*/(0, _jsxRuntime.jsx)("kbd", {})
}), (0, _i18n.__)('Drag files into the editor to automatically insert media blocks.'), (0, _i18n.__)("Change a block's type by pressing the block icon on the toolbar.")];
function Tips() {
const [randomIndex] = (0, _element.useState)(
// Disable Reason: I'm not generating an HTML id.
// eslint-disable-next-line no-restricted-syntax
Math.floor(Math.random() * globalTips.length));
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tip, {
children: globalTips[randomIndex]
});
}
var _default = exports.default = Tips;
//# sourceMappingURL=tips.js.map