2020-02-29 01:07:44 +00:00
|
|
|
(this["webpackJsonpfeature-change-applier"]=this["webpackJsonpfeature-change-applier"]||[]).push([[0],[,,,,,,,,,,,function(e,t,n){e.exports=n(28)},,,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),o=n(5),c=n.n(o),u=(n(16),n(17),n(3)),i=(n(18),n(19),function(e){var t=e.lexicon,n=e.dispatch;return r.a.createElement("div",{className:"ProtoLang","data-testid":"ProtoLang"},r.a.createElement("h3",null,"Proto Language Lexicon"),r.a.createElement("br",null),r.a.createElement("form",{"data-testid":"ProtoLang-Lexicon"},r.a.createElement("textarea",{name:"lexicon",cols:"30",rows:"10","data-testid":"ProtoLang-Lexicon__textarea",value:function(){return t?t.map((e="lexeme",function(t){return t[e]})).join("\n"):"";var e}(),onChange:function(e){console.log(e.target.value.split(/\n/).map((function(e){return{lexeme:e.split("#")[0].trim(),epoch:e.split("#")[1]||""}}))),n({type:"SET_LEXICON",value:e.target.value.split(/\n/).map((function(e){return{lexeme:e.split("#")[0].trim(),epoch:e.split("#")[1]||""}}))})}})))}),s=n(4),l=(n(20),function(e){var t=e.phones,n=e.features,o=e.dispatch,c=Object(a.useState)("aspirated"),i=Object(u.a)(c,2),l=i[0],p=i[1],m=Object(a.useState)("t\u02b0 / p\u02b0 / k\u02b0"),h=Object(u.a)(m,2),f=h[0],v=h[1],g=Object(a.useState)("t / p / k"),d=Object(u.a)(g,2),E=d[0],b=d[1],O=function(e){return""===e?[""]:e.split("/").map((function(e){return e.trim()}))},j=function(e){var t=Object(u.a)(e,3),n=t[0],a=t[1],r=t[2];return{type:"ADD_FEATURE",value:{positivePhones:O(n),negativePhones:O(a),feature:r}}};return r.a.createElement("div",{className:"Features","data-testid":"Features"},r.a.createElement("h3",null,"Phonetic Features"),r.a.createElement("ul",{className:"Features__list","data-testid":"Features-list"},t?r.a.createElement(r.a.Fragment,null,function(e){var t=function(e){return function(t){return t[e]}};return function(e){return e.map((function(e,t){var n=Object.keys(e),a=Object(u.a)(n,1)[0],c=e[a],i=c.plus,s=c.minus;return r.a.createElement("li",{key:"feature__".concat(a)},r.a.createElement("span",{className:"feature--names-and-phones"},r.a.createElement("span",{className:"feature--feature-name"},"[+ ".concat(a,"]")),r.a.createElement("span",{className:"feature--feature-phones"},i)),r.a.createElement("span",{className:"feature--names-and-phones"},r.a.createElement("span",{className:"feature--feature-name"},"[- ".concat(a,"]")),r.a.createElement("span",{className:"feature--feature-phones"},s)),r.a.createElement("button",{className:"delete-feature",onClick:function(e){return function(e,t){return e.preventDefault(),o({type:"DELETE_FEATURE",value:t})}(e,a)}},"X"))}))}(function(e){return Object.keys(e).map((function(n){var a=e[n].positive.map(t("grapheme")).join(" / "),r=e[n].negative.map(t("grapheme")).join(" / ");return Object(s.a)({},n,{plus:a,minus:r})}))}(e))}(n)):r.a.createElement(r.a.Fragment,null)),r.a.createElement("form",{className:"Features__form","data-testid":"Features-form"},r.a.createElement("input",{type:"text",name:"feature",value:l,onChange:function(e){return p(e.target.value)}}),r.a.createElement("label",{htmlFor:"positive-phones"},"+",r.a.createElement("input",{id:"positive-phones",type:"text",name:"phonemes",value:f,onChange:function(e){return v(e.target.value)}})),r.a.createElement("label",{htmlFor:"negative-phones"},"-",r.a.createElement("input",{id:"negative-phones",type:"text",name:"phonemes",value:E,onChange:function(e){return b(e.target.value)}})),r.a.createElement("input",{className:"form form--add",type:"submit",onClick:function(e){return function(e){return function(t){return function(n){return function(a){return e.preventDefault(),t(n(a))}}}}(e)(o)(j)([f,E,l])},value:"Add feature"})))}),p=(n(21),n(2)),m=(n(22),function(e){var t=e.epochIndex,n=e.error,o=e.removeEpoch,c=e.epochs,i=Object(a.useState)(e.epoch?e.epoch:{name:"",changes:[""],parent:"none"}),s=Object(u.a)(i,2),l=s[0],m=s[1],h=function(n,a){a(n),e.updateEpoch(l,t)
|