Liferay.Loader.define("style-book-web@2.0.76/js/style-book-editor/Undo",["module","exports","require","@frontend-taglib-clay$clayui/button","@liferay/frontend-js-react-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","./contexts/StyleBookEditorContext"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function Undo(){const e=(0,l.useOnUndo)(),t=(0,l.useOnRedo)(),r=(0,l.useRedoHistory)(),i=(0,l.useUndoHistory)();return(0,a.useEventListener)("keydown",(n=>{(e=>e.ctrlKey&&!e.metaKey||!e.ctrlKey&&e.metaKey)(n)&&"z"===n.key&&!n.target.closest(".style-book-editor__sidebar-content")&&(n.shiftKey||0===i.length||e(),n.shiftKey&&0!==r.length&&t())}),!0,window),o.default.createElement(o.default.Fragment,null,o.default.createElement(n.default.Group,{className:"flex-nowrap"},o.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("undo"),className:"btn-monospaced",disabled:!i||!i.length,displayType:"secondary",onClick:e,size:"sm",symbol:"undo",title:Liferay.Language.get("undo")}),o.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("redo"),className:"btn-monospaced",disabled:!r||!r.length,displayType:"secondary",onClick:t,size:"sm",symbol:"redo",title:Liferay.Language.get("redo")})))};var n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("@frontend-taglib-clay$clayui/button")),a=r("@liferay/frontend-js-react-web"),o=(_interopRequireDefault(r("liferay!frontend-js-react-web$prop-types")),_interopRequireDefault(r("liferay!frontend-js-react-web$react"))),l=r("./contexts/StyleBookEditorContext");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}}}));
//# sourceMappingURL=Undo.js.map