diff options
Diffstat (limited to 'ComboEditorTab.f319f20b57e6e2bd20c9.js')
-rw-r--r-- | ComboEditorTab.f319f20b57e6e2bd20c9.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ComboEditorTab.f319f20b57e6e2bd20c9.js b/ComboEditorTab.f319f20b57e6e2bd20c9.js new file mode 100644 index 0000000..58ad1e3 --- /dev/null +++ b/ComboEditorTab.f319f20b57e6e2bd20c9.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8315],{94062:function(n,e,r){r.d(e,{Z:function(){return a}});var t=r(41051),o=r(2968),i=r(85893);function a(n){var e=n.url,r=n.text;return(0,i.jsxs)(o.Z,{external:!0,href:e,children:[(0,i.jsx)(t.Z,{name:"book"})," ",(0,i.jsx)("span",{children:r})]})}},44019:function(n,e,r){r.r(e),r.d(e,{default:function(){return Xn}});var t=r(50361),o=r.n(t),i=r(67294),a=r(95998),l=r(45697),c=r.n(l),s=r(93379),u=r.n(s),p=r(7795),A=r.n(p),d=r(90569),f=r.n(d),b=r(3565),m=r.n(b),y=r(19216),v=r.n(y),g=r(44589),C=r.n(g),h=r(78207),x={};x.styleTagTransform=C(),x.setAttributes=m(),x.insert=f().bind(null,"head"),x.domAPI=A(),x.insertStyleElement=v(),u()(h.Z,x);var E=h.Z&&h.Z.locals?h.Z.locals:void 0,j=r(15023),B=r(85893);function w(){return(0,B.jsx)("p",{className:E.floatingMessage,children:"Click on a key to add it to the combo"})}function k(n){var e=n.keyPositions,r=n.onUpdate;return(0,B.jsxs)("div",{className:E.comboInputMap,children:[(0,B.jsx)(j.Z,{value:e,onUpdate:r}),e.length<2&&(0,B.jsx)(w,{})]})}k.propTypes={onUpdate:c().func.isRequired,keyPositions:c().arrayOf(c().number).isRequired};var O=k,S=r(82607),P=r(61953),Z=r(27926),N=r(41051),I=r(94062),Y=r(86015),D={};D.styleTagTransform=C(),D.setAttributes=m(),D.insert=f().bind(null,"head"),D.domAPI=A(),D.insertStyleElement=v(),u()(Y.Z,D);var X=Y.Z&&Y.Z.locals?Y.Z.locals:void 0,U=r(56803);function q(n){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},q(n)}function R(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function z(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){T(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function T(n,e,r){return(e=function(n){var e=function(n,e){if("object"!==q(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==q(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===q(e)?e:String(e)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function K(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function M(n){var e,r,t=n.value,o=n.validate,a=n.required,l=n.render,c=n.onUpdate,s=(0,i.useRef)(),u=(e=(0,i.useState)({value:t,editing:!1,attemptedEmpty:!1}),r=2,function(n){if(Array.isArray(n))return n}(e)||function(n,e){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var t,o,i,a,l=[],c=!0,s=!1;try{if(i=(r=r.call(n)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(t=i.call(r)).done)&&(l.push(t.value),l.length!==e);c=!0);}catch(n){s=!0,o=n}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,r)||function(n,e){if(n){if("string"==typeof n)return K(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(n,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=u[0],A=u[1],d=p.attemptedEmpty?"cannot be empty":o&&o(p.value),f=(0,i.useCallback)((function(n){n&&(n.focus(),n.select())}),[]),b=(0,i.useCallback)((function(){A((function(n){return z(z({},n),{},{editing:!1})}))}),[A]),m=(0,i.useCallback)((function(n){s.current&&!s.current.contains(n.target)&&b()}),[s,b]);return(0,i.useEffect)((function(){return document.addEventListener("click",m),function(){return document.removeEventListener("click",m)}}),[m]),p.editing?(0,B.jsxs)("span",{className:X.container,ref:s,children:[(0,B.jsx)("input",{ref:f,value:p.value,onChange:function(n){return A(z(z({},p),{},{attemptedEmpty:!1,value:n.target.value}))},onKeyDown:(0,U.w)({Enter:function(){p.editing&&(""===p.value&&a?A(z(z({},p),{},{attemptedEmpty:!0})):(d||c(p.value),A(z(z({},p),{},{value:p.value,editing:!1}))))},Escape:b})}),d&&(0,B.jsx)("span",{className:X.error,children:d})]}):l((0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("span",{children:t}),(0,B.jsx)(N.Z,{name:"pencil",className:X.edit,onClick:(0,U.s)((function(){return A(z(z({},p),{},{editing:!0}))}))})]}))}M.propTypes={value:c().string.isRequired,validate:c().func,required:c().bool.isRequired,render:c().func.isRequired,onUpdate:c().func.isRequired},M.defaultProps={required:!0};var W=M,F=r(81485),J=r(57557),Q=r.n(J),G=r(64261),L=r(96186),V=r(80993),_=r(80736);function H(n){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},H(n)}function $(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function nn(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){en(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function en(n,e,r){return(e=function(n){var e=function(n,e){if("object"!==H(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==H(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===H(e)?e:String(e)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function rn(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}var tn=function(n){var e,r,t,o,l,c=n.combo,s=n.onUpdate,u=n.onCancel,p=(0,a.v9)(_.vl),A=(o=(0,i.useState)(c),l=2,function(n){if(Array.isArray(n))return n}(o)||function(n,e){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var t,o,i,a,l=[],c=!0,s=!1;try{if(i=(r=r.call(n)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(t=i.call(r)).done)&&(l.push(t.value),l.length!==e);c=!0);}catch(n){s=!0,o=n}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(o,l)||function(n,e){if(n){if("string"==typeof n)return rn(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rn(n,e):void 0}}(o,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=A[0],f=A[1],b=(0,i.useMemo)((function(){return p.map((function(n,e){return{id:e,label:(0,_.EI)(n)}}))}),[p]),m=(0,i.useMemo)((function(){var n;return((null===(n=d.properties.layers)||void 0===n?void 0:n.parsed)||[]).map((function(n){return b.find((function(e){return e.id===n}))}))}),[d,b]),y=(0,i.useCallback)((function(n){return f((function(e){return nn(nn({},e),{},{properties:nn(nn({},e.properties),{},{layers:{parsed:n.map((function(n){return n.id}))}})})}))}),[f]);return(0,B.jsx)(G.Z,{onDismiss:u,children:(0,B.jsxs)(L.Z,{dismissText:null,children:[(0,B.jsxs)("h2",{children:["Customize ",(0,B.jsx)("code",{children:c.name})]}),(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:E.field,children:[(0,B.jsx)("label",{htmlFor:"customize-combo-timeout",children:"Timeout (ms)"}),(0,B.jsx)("input",{id:"customize-combo-timeout",type:"number",placeholder:"Default",value:(null===(e=d.properties["timeout-ms"])||void 0===e?void 0:e.parsed)||"",onChange:function(n){var e=Number(n.target.value);f((function(r){return nn(nn({},r),{},{properties:""!==n.target.value?nn(nn({},r.properties),{},{"timeout-ms":{parsed:e}}):nn({},Q()(r.properties,"timeout-ms"))})}))}})]}),(0,B.jsxs)("div",{className:E.field,children:[(0,B.jsx)("label",{htmlFor:"customize-combo-idle",children:"Require Prior Idle (ms)"}),(0,B.jsx)("input",{id:"customize-combo-idle",type:"number",placeholder:"Default",value:(null===(r=d.properties["require-prior-idle-ms"])||void 0===r?void 0:r.parsed)||"",onChange:function(n){var e=Number(n.target.value);f((function(r){return nn(nn({},r),{},{properties:""!==n.target.value?nn(nn({},r.properties),{},{"require-prior-idle-ms":{parsed:e}}):nn({},Q()(r.properties,"require-prior-idle-ms"))})}))}})]}),(0,B.jsxs)("div",{className:E.field,children:[(0,B.jsx)("label",{htmlFor:"customize-combo-slow-release",children:"Slow Release"}),(0,B.jsx)("input",{id:"customize-combo-slow-release",type:"checkbox",checked:(null===(t=d.properties["slow-release"])||void 0===t?void 0:t.parsed)||!1,onChange:function(n){return f((function(e){return nn(nn({},e),{},{properties:nn(nn({},e.properties),{},{"slow-release":{parsed:n.target.checked}})})}))}})]}),(0,B.jsxs)("div",{className:E.field,children:[(0,B.jsx)("label",{htmlFor:"pending_layers",children:"Layers"}),(0,B.jsx)(V.Z,{isMulti:!0,isSearchable:!0,id:"pending_layers",value:m,options:b,onChange:y,getOptionValue:function(n){return n.id}})]}),(0,B.jsxs)("div",{style:{textAlign:"center",marginTop:"10px"},children:[(0,B.jsx)(Z.Z,{onClick:function(){s(d)},children:"Okay"}),(0,B.jsx)(Z.Z,{onClick:u,secondary:!0,children:"Cancel"})]})]})]})})},on=r(62417),an=r(76106),ln=r(94596),cn=r(80671),sn=r(58887),un=r(91118),pn=r(2732);function An(n){return An="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},An(n)}function dn(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function fn(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?dn(Object(r),!0).forEach((function(e){bn(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):dn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function bn(n,e,r){return(e=function(n){var e=function(n,e){if("object"!==An(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==An(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===An(e)?e:String(e)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function mn(n){return(0,B.jsx)(cn.Z,fn(fn({},n),{},{Heading:yn}))}function yn(n){var e=n.bindingIndex,r=n.bindTree,t=(0,a.v9)(pn.DP)[e];return t?(0,B.jsxs)("div",{className:ln.Z.keyBindingHeader,children:[(0,B.jsx)(sn.Z,{keyPositions:t.properties["key-positions"].parsed,styleOverrides:{display:"inline-block",padding:"3px",borderRadius:"3px"},scale:.15}),(0,B.jsx)(N.Z,{name:"arrow-right"}),(0,B.jsx)(un.Z,{selectable:!1,children:(0,B.jsx)(an.Z,{value:r})})]}):null}function vn(n){return vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},vn(n)}function gn(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function Cn(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gn(Object(r),!0).forEach((function(e){hn(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):gn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function hn(n,e,r){return(e=function(n){var e=function(n,e){if("object"!==vn(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==vn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===vn(e)?e:String(e)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function xn(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var t,o,i,a,l=[],c=!0,s=!1;try{if(i=(r=r.call(n)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(t=i.call(r)).done)&&(l.push(t.value),l.length!==e);c=!0);}catch(n){s=!0,o=n}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(n,e)||function(n,e){if(n){if("string"==typeof n)return En(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?En(n,e):void 0}}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function En(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function jn(n){var e,r=n.onSubmit,t=n.onCancel,o=n.initial,a=void 0===o?Bn:o,l=(e=(0,i.useContext)(F.c).identifiers,(0,i.useCallback)((function(n){return(0,on.G3)(n)||(e.includes(n)?'Cannot use existing identifier "'.concat(n,'"'):null)}),[e])),c=xn((0,i.useState)(a),2),s=c[0],u=c[1],p=xn((0,G.X)(),3),A=p[0],d=p[1],f=p[2],b=xn((0,i.useState)(!1),2),m=b[0],y=b[1],v=(0,i.useCallback)((function(n){return u((function(e){return Cn(Cn({},e),{},{name:n})}))}),[u]),g=wn(u,"bindings"),C=wn(u,"key-positions"),h=(0,i.useCallback)((function(n){u(n),f()}),[u,f]),x=(0,i.useCallback)((function(){r(s)}),[s,r]),j=(0,i.useMemo)((function(){return!!s.name&&s.properties["key-positions"].parsed.length>0}),[s]);return(0,B.jsx)(G.Z,{onDismiss:t,children:(0,B.jsxs)(L.Z,{dismissText:!1,classes:[E.comboPanel],children:[A&&(0,B.jsx)(tn,{combo:s,onUpdate:h,onCancel:f}),m&&(0,B.jsx)(mn,{binding:s.properties.bindings.parsed[0],bindingIndex:null,onCancel:function(){return y(!1)},onUpdate:function(n){g([n]),y(!1)}}),(0,B.jsx)(I.Z,{url:"https://zmk.dev/docs/features/combos",text:"ZMK Docs: Combos"}),(0,B.jsxs)("div",{className:E.combo,children:[(0,B.jsxs)("div",{className:E.heading,children:[(0,B.jsx)("div",{children:(0,B.jsx)(W,{value:s.name,validate:l,render:function(n){return(0,B.jsxs)("h5",{children:["Name: ",(0,B.jsx)("code",{children:n}),!s.name&&(0,B.jsx)("span",{style:{color:"red"},children:"*required"})]})},onUpdate:v})}),(0,B.jsx)("div",{className:E.actions,children:(0,B.jsx)(N.Z,{name:"wrench",className:"".concat(E.action),onClick:d})})]}),(0,B.jsxs)("div",{className:E.detail,children:[(0,B.jsx)("div",{className:E.comboOutput,children:(0,B.jsx)(S.Z,{binding:s.properties.bindings.parsed[0],keyWrapperProps:{className:P.Z.unified,onClick:function(n){n.stopPropagation(),y(!0)}}})}),(0,B.jsx)(O,{keyPositions:s.properties["key-positions"].parsed,onUpdate:C})]})]}),(0,B.jsxs)("div",{style:{textAlign:"center"},children:[(0,B.jsx)(Z.Z,{disabled:!j,onClick:x,children:"Create"}),(0,B.jsx)(Z.Z,{onClick:t,secondary:!0,children:"Cancel"})]})]})})}var Bn={name:"",labels:[],properties:{bindings:{parsed:[{value:"&none",params:[]}]},"key-positions":{parsed:[]}}};function wn(n,e){return(0,i.useCallback)((function(r){return n((function(n){return Cn(Cn({},n),{},{properties:Cn(Cn({},n.properties),{},hn({},e,{parsed:r}))})}))}),[n,e])}var kn=r(94184),On=r.n(kn);function Sn(n){return Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Sn(n)}function Pn(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.push.apply(r,t)}return r}function Zn(n){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Pn(Object(r),!0).forEach((function(e){Nn(n,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Pn(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}))}return n}function Nn(n,e,r){return(e=function(n){var e=function(n,e){if("object"!==Sn(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var t=r.call(n,"string");if("object"!==Sn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"===Sn(e)?e:String(e)}(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function In(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var t,o,i,a,l=[],c=!0,s=!1;try{if(i=(r=r.call(n)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(t=i.call(r)).done)&&(l.push(t.value),l.length!==e);c=!0);}catch(n){s=!0,o=n}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(n,e)||function(n,e){if(n){if("string"==typeof n)return Yn(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yn(n,e):void 0}}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yn(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function Dn(){var n=(0,i.useContext)(F.c).identifiers,e=(0,a.v9)(pn.DP),r=(0,a.I0)(),t=In((0,i.useState)(null),2),l=t[0],c=t[1],s=In((0,i.useState)(null),2),u=s[0],p=s[1],A=In((0,i.useState)(null),2),d=A[0],f=A[1],b=(0,i.useCallback)((function(){f(!0)}),[f]),m=(0,i.useCallback)((function(){return f(null)}),[f]);function y(e){return(0,on.G3)(e)||(n.includes(e)?'Cannot use existing identifier "'.concat(e,'"'):null)}var v=(0,i.useCallback)((function(n){r((0,pn.ij)({comboIndex:l,bindings:[n]})),c(null)}),[l,c,r]);return(0,B.jsxs)("div",{className:E.main,children:[null!==u&&(0,B.jsx)(tn,{combo:e[u],onUpdate:function(n){return e=u,t=n,p(null),void r((0,pn.SD)({index:e,combo:t}));var e,t},onCancel:function(){return p(null)}}),d&&(0,B.jsx)(jn,Zn(Zn({},d.dialogProps||{}),{},{onSubmit:function(n){r((0,pn.CG)(n)),m()},onCancel:m})),null!==l&&(0,B.jsx)(mn,{binding:e[l].properties.bindings.parsed[0],bindingIndex:l,onCancel:function(){return c(null)},onUpdate:v}),(0,B.jsx)("div",{className:E.header,children:(0,B.jsx)(I.Z,{url:"https://zmk.dev/docs/features/combos",text:"ZMK Docs: Combos"})}),(0,B.jsx)("div",{className:E.comboPanel,children:e.map((function(n,t){return(0,B.jsxs)("div",{className:E.combo,children:[(0,B.jsxs)("div",{className:E.heading,children:[(0,B.jsx)(W,{value:n.name,validate:y,render:function(n){return(0,B.jsx)("h5",{children:(0,B.jsx)("code",{children:n})})},onUpdate:function(n){return function(n,e){r((0,pn.l3)({index:n,name:e}))}(t,n)}}),(0,B.jsxs)("div",{className:E.actions,children:[(0,B.jsx)(N.Z,{name:"wrench",title:"Configure combo ".concat(n.name),className:E.action,onClick:function(){return p(t)}}),(0,B.jsx)(N.Z,{name:"copy",title:"Create new combo with configuration from ".concat(n.name),className:E.action,onClick:function(){return n=t,delete(r=o()(e[n])).index,r.name="",r.labels=[],void f({dialogProps:{initial:r}});var n,r}}),(0,B.jsx)(N.Z,{name:"trash-can",title:"Delete combo ".concat(n.name),className:On()(E.action,E.remove),onClick:function(){return n=t,void(window.confirm("Really delete combo: ".concat(e[n].name,"?"))&&r((0,pn.pd)({index:n})));var n}})]})]}),(0,B.jsxs)("div",{className:E.detail,children:[(0,B.jsx)("div",{className:E.comboOutput,children:(0,B.jsx)(S.Z,{binding:n.properties.bindings.parsed[0],keyWrapperProps:{className:P.Z.unified,onClick:function(n){n.stopPropagation(),c(t)}}})}),(0,B.jsx)(O,{keyPositions:n.properties["key-positions"].parsed,onUpdate:function(n){return function(n,e){r((0,pn.nJ)({comboIndex:n,keyPositions:e}))}(t,n)}})]})]},t)}))}),(0,B.jsx)("div",{className:E.footer,children:(0,B.jsx)(Z.Z,{onClick:b,children:"Add New Combo"})})]})}Dn.propTypes={};var Xn=Dn},56803:function(n,e,r){function t(n){return function(e){e.stopPropagation(),n()}}function o(n){return function(e){n[e.key]&&n[e.key]()}}r.d(e,{s:function(){return t},w:function(){return o}})},86015:function(n,e,r){var t=r(87537),o=r.n(t),i=r(23645),a=r.n(i)()(o());a.push([n.id,".ho3CuFFjX1VFNZJiAyVs {\n position: relative;\n}\n\n.u9J3v5ZrIbuVICzNBkRw {\n padding: 5px;\n cursor: pointer;\n opacity: 0.5;\n color: var(--key-color-base);\n}\n.u9J3v5ZrIbuVICzNBkRw:hover {\n opacity: 1;\n}\n\n.wmqWaOx7XyKADh7Kv4RZ {\n position: absolute;\n z-index: 10;\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 100%);\n max-width: 250px;\n width: 100%;\n\n border-radius: 4px;\n padding: 3px 5px;\n\n color: white;\n background-color: var(--error-highlight);\n font-size: 85%;\n font-family: sans-serif;\n\n opacity: 0.9;\n}\n.wmqWaOx7XyKADh7Kv4RZ::before {\n position: absolute;\n display: block;\n content: ' ';\n z-index: -1;\n\n left: 50%;\n width: 10px;\n height: 10px;\n\n background-color: var(--error-highlight);\n transform: translate(-50%, -7px) rotate(45deg);\n}\n","",{version:3,sources:["webpack://./src/Common/editablefield.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;AACpB;;AAEA;EACE,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,4BAA4B;AAC9B;AACA;EACE,UAAU;AACZ;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,SAAS;EACT,SAAS;EACT,gCAAgC;EAChC,gBAAgB;EAChB,WAAW;;EAEX,kBAAkB;EAClB,gBAAgB;;EAEhB,YAAY;EACZ,wCAAwC;EACxC,cAAc;EACd,uBAAuB;;EAEvB,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,cAAc;EACd,YAAY;EACZ,WAAW;;EAEX,SAAS;EACT,WAAW;EACX,YAAY;;EAEZ,wCAAwC;EACxC,8CAA8C;AAChD",sourcesContent:[".container {\n position: relative;\n}\n\n.edit {\n padding: 5px;\n cursor: pointer;\n opacity: 0.5;\n color: var(--key-color-base);\n}\n.edit:hover {\n opacity: 1;\n}\n\n.error {\n position: absolute;\n z-index: 10;\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 100%);\n max-width: 250px;\n width: 100%;\n\n border-radius: 4px;\n padding: 3px 5px;\n\n color: white;\n background-color: var(--error-highlight);\n font-size: 85%;\n font-family: sans-serif;\n\n opacity: 0.9;\n}\n.error::before {\n position: absolute;\n display: block;\n content: ' ';\n z-index: -1;\n\n left: 50%;\n width: 10px;\n height: 10px;\n\n background-color: var(--error-highlight);\n transform: translate(-50%, -7px) rotate(45deg);\n}\n"],sourceRoot:""}]),a.locals={container:"ho3CuFFjX1VFNZJiAyVs",edit:"u9J3v5ZrIbuVICzNBkRw",error:"wmqWaOx7XyKADh7Kv4RZ"},e.Z=a},78207:function(n,e,r){var t=r(87537),o=r.n(t),i=r(23645),a=r.n(i)()(o());a.push([n.id,'.pwXbGORsYKqyOPBm9_dW {\n padding-bottom: 60px;\n}\n\n.FDsUz791VURN5GgqawOQ, .MhI51kJR50XISY6jcLAw {\n width: 550px;\n margin: 1px auto;\n}\n.MhI51kJR50XISY6jcLAw {\n text-align: center;\n margin-top: 10px;\n padding-top: 20px;\n border-top: 2px solid var(--key-bg-base);\n}\n\n.Gy0KZGCgOeVminAfggFQ {\n cursor: pointer;\n background-color: var(--key-bg-base);\n}\n.Gy0KZGCgOeVminAfggFQ:hover {\n border: 4px solid var(--selection);\n box-sizing: border-box;\n}\n\n.Ld9cVdtpS_DpbEifyX9Y {\n background-color: var(--selection);\n}\n.Ld9cVdtpS_DpbEifyX9Y:hover {\n background-color: var(--hover-selection);\n}\n\n.mqpJ7uHAMKxvORoOIPFK {\n max-width: 450px;\n margin: 0 auto;\n}\n\n.BVucwy4AZCyl7GyivzMn {\n display: flex;\n justify-content: space-between;\n border-bottom: 2px solid var(--key-bg-base);\n margin: 5px 0;\n}\n\n.U6g0njWjBrtb_I3XhAeV {\n cursor: pointer;\n padding: 5px;\n opacity: 0.6;\n}\n.U6g0njWjBrtb_I3XhAeV:hover {\n opacity: 1;\n}\n\n.CROhsBLtunQ2BbfWdkQw {\n margin: 10px 0 40px;\n}\n\n.CROhsBLtunQ2BbfWdkQw .MhA4fXXuaZ1iPvv05w4m {\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n gap: 20px;\n}\n\n.CROhsBLtunQ2BbfWdkQw h5 {\n margin: 0;\n}\n\n.vujYcgQjiN4BGp37FMUH {\n color: var(--key-color-base);\n}\n\n.uh2yPWyfEOZtgXo2_KtU {\n color: var(--delete);\n}\n\n.NAB1EN6_pcYIy5Db9XnC {\n display: none !important;\n}\n.NAB1EN6_pcYIy5Db9XnC:hover {\n color: white;\n cursor: pointer;\n}\n.kYn8brsFgEaf61oQyv4d:hover .NAB1EN6_pcYIy5Db9XnC {\n display: flex !important;\n position: absolute;\n right: -48px;\n transform: scale(0.5);\n}\n\n.NGxnhfSJaJ9FNu3hlBfc.NAB1EN6_pcYIy5Db9XnC,\n.NGxnhfSJaJ9FNu3hlBfc.GXgG_IaQTricqThqzsKe > * {\n background-color: sandybrown;\n color: white;\n}\n.NGxnhfSJaJ9FNu3hlBfc.NAB1EN6_pcYIy5Db9XnC {\n display: flex;\n}\n\n.fljdvcebOv1gbKZpf0vW {\n margin: 10px 0;\n display: flex;\n align-items: center;\n}\n\n.fljdvcebOv1gbKZpf0vW label {\n display: inline-block;\n width: 120px;\n text-align: right;\n margin-right: 10px;\n}\n\n.bnN6JCit0RcjdQiqzw8w {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n.bnN6JCit0RcjdQiqzw8w li {\n cursor: pointer;\n display: inline-block;\n padding: 5px 10px;\n margin: 5px;\n border-radius: 30px;\n background-color: var(--key-bg-base);\n}\n.bnN6JCit0RcjdQiqzw8w li[data-selected="true"] {\n background-color: var(--selection);\n color: var(--key-color-hover);\n}\n.bnN6JCit0RcjdQiqzw8w li:hover {\n background-color: var(--hover-selection);\n color: var(--key-color-hover);\n}\n\n.NpLEYrC32KQ4rUx9hUFJ {\n background-color: var(--key-bg-base);\n border-radius: 30px;\n color: var(--key-color-base);\n font-size: 80%;\n text-align: center;\n padding: 5px;\n position: absolute;\n bottom: -40px;\n left: 50%;\n transform: translate(-50%, 0);\n width: 110%;\n\n pointer-events: none;\n transition: opacity ease-in-out .5s;\n}\n\n.l2gtE1XKS63R5TM5unip { position: relative }\n.l2gtE1XKS63R5TM5unip:hover .NpLEYrC32KQ4rUx9hUFJ { opacity: 0.25 }\n',"",{version:3,sources:["webpack://./src/Keyboard/Combos/styles.module.css"],names:[],mappings:"AAAA;EACE,oBAAoB;AACtB;;AAEA;EACE,YAAY;EACZ,gBAAgB;AAClB;AACA;EACE,kBAAkB;EAClB,gBAAgB;EAChB,iBAAiB;EACjB,wCAAwC;AAC1C;;AAEA;EACE,eAAe;EACf,oCAAoC;AACtC;AACA;EACE,kCAAkC;EAClC,sBAAsB;AACxB;;AAEA;EACE,kCAAkC;AACpC;AACA;EACE,wCAAwC;AAC1C;;AAEA;EACE,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,2CAA2C;EAC3C,aAAa;AACf;;AAEA;EACE,eAAe;EACf,YAAY;EACZ,YAAY;AACd;AACA;EACE,UAAU;AACZ;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,6BAA6B;EAC7B,mBAAmB;EACnB,SAAS;AACX;;AAEA;EACE,SAAS;AACX;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,wBAAwB;AAC1B;AACA;EACE,YAAY;EACZ,eAAe;AACjB;AACA;EACE,wBAAwB;EACxB,kBAAkB;EAClB,YAAY;EACZ,qBAAqB;AACvB;;AAEA;;EAEE,4BAA4B;EAC5B,YAAY;AACd;AACA;EACE,aAAa;AACf;;AAEA;EACE,cAAc;EACd,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;EACrB,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,qBAAqB;EACrB,SAAS;EACT,UAAU;AACZ;AACA;EACE,eAAe;EACf,qBAAqB;EACrB,iBAAiB;EACjB,WAAW;EACX,mBAAmB;EACnB,oCAAoC;AACtC;AACA;EACE,kCAAkC;EAClC,6BAA6B;AAC/B;AACA;EACE,wCAAwC;EACxC,6BAA6B;AAC/B;;AAEA;EACE,oCAAoC;EACpC,mBAAmB;EACnB,4BAA4B;EAC5B,cAAc;EACd,kBAAkB;EAClB,YAAY;EACZ,kBAAkB;EAClB,aAAa;EACb,SAAS;EACT,6BAA6B;EAC7B,WAAW;;EAEX,oBAAoB;EACpB,mCAAmC;AACrC;;AAEA,wBAAiB,mBAAmB;AACpC,oDAAwC,cAAc",sourcesContent:['.main {\n padding-bottom: 60px;\n}\n\n.header, .footer {\n width: 550px;\n margin: 1px auto;\n}\n.footer {\n text-align: center;\n margin-top: 10px;\n padding-top: 20px;\n border-top: 2px solid var(--key-bg-base);\n}\n\n.selectable {\n cursor: pointer;\n background-color: var(--key-bg-base);\n}\n.selectable:hover {\n border: 4px solid var(--selection);\n box-sizing: border-box;\n}\n\n.highlight {\n background-color: var(--selection);\n}\n.highlight:hover {\n background-color: var(--hover-selection);\n}\n\n.comboPanel {\n max-width: 450px;\n margin: 0 auto;\n}\n\n.heading {\n display: flex;\n justify-content: space-between;\n border-bottom: 2px solid var(--key-bg-base);\n margin: 5px 0;\n}\n\n.action {\n cursor: pointer;\n padding: 5px;\n opacity: 0.6;\n}\n.action:hover {\n opacity: 1;\n}\n\n.combo {\n margin: 10px 0 40px;\n}\n\n.combo .detail {\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n gap: 20px;\n}\n\n.combo h5 {\n margin: 0;\n}\n\n.edit {\n color: var(--key-color-base);\n}\n\n.remove {\n color: var(--delete);\n}\n\n.addComboInput {\n display: none !important;\n}\n.addComboInput:hover {\n color: white;\n cursor: pointer;\n}\n.comboInputList:hover .addComboInput {\n display: flex !important;\n position: absolute;\n right: -48px;\n transform: scale(0.5);\n}\n\n.active.addComboInput,\n.active.comboInput > * {\n background-color: sandybrown;\n color: white;\n}\n.active.addComboInput {\n display: flex;\n}\n\n.field {\n margin: 10px 0;\n display: flex;\n align-items: center;\n}\n\n.field label {\n display: inline-block;\n width: 120px;\n text-align: right;\n margin-right: 10px;\n}\n\n.layerList {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n.layerList li {\n cursor: pointer;\n display: inline-block;\n padding: 5px 10px;\n margin: 5px;\n border-radius: 30px;\n background-color: var(--key-bg-base);\n}\n.layerList li[data-selected="true"] {\n background-color: var(--selection);\n color: var(--key-color-hover);\n}\n.layerList li:hover {\n background-color: var(--hover-selection);\n color: var(--key-color-hover);\n}\n\n.floatingMessage {\n background-color: var(--key-bg-base);\n border-radius: 30px;\n color: var(--key-color-base);\n font-size: 80%;\n text-align: center;\n padding: 5px;\n position: absolute;\n bottom: -40px;\n left: 50%;\n transform: translate(-50%, 0);\n width: 110%;\n\n pointer-events: none;\n transition: opacity ease-in-out .5s;\n}\n\n.comboInputMap { position: relative }\n.comboInputMap:hover .floatingMessage { opacity: 0.25 }\n'],sourceRoot:""}]),a.locals={main:"pwXbGORsYKqyOPBm9_dW",header:"FDsUz791VURN5GgqawOQ",footer:"MhI51kJR50XISY6jcLAw",selectable:"Gy0KZGCgOeVminAfggFQ",highlight:"Ld9cVdtpS_DpbEifyX9Y",comboPanel:"mqpJ7uHAMKxvORoOIPFK",heading:"BVucwy4AZCyl7GyivzMn",action:"U6g0njWjBrtb_I3XhAeV",combo:"CROhsBLtunQ2BbfWdkQw",detail:"MhA4fXXuaZ1iPvv05w4m",edit:"vujYcgQjiN4BGp37FMUH",remove:"uh2yPWyfEOZtgXo2_KtU",addComboInput:"NAB1EN6_pcYIy5Db9XnC",comboInputList:"kYn8brsFgEaf61oQyv4d",active:"NGxnhfSJaJ9FNu3hlBfc",comboInput:"GXgG_IaQTricqThqzsKe",field:"fljdvcebOv1gbKZpf0vW",layerList:"bnN6JCit0RcjdQiqzw8w",floatingMessage:"NpLEYrC32KQ4rUx9hUFJ",comboInputMap:"l2gtE1XKS63R5TM5unip"},e.Z=a}}]); +//# sourceMappingURL=ComboEditorTab.f319f20b57e6e2bd20c9.js.map
\ No newline at end of file |