lecodes-cli 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +8 -8
- package/runtime/sdk-types.json +1 -1
- package/runtime/web/VERSION.json +3 -3
- package/runtime/web/assets/keyboardMotion-C2Bk5H0n.js +1 -0
- package/runtime/web/assets/{map-XzoOFt0E.js → map-8PhtP3jn.js} +2 -2
- package/runtime/web/assets/{mapImpl-bxvQ2h1Z.js → mapImpl-DS04r04e.js} +2 -2
- package/runtime/web/index.html +1 -0
- package/runtime/web/keyboard.js +18 -0
- package/runtime/web/player.js +15 -15
- package/runtime/web-lite/lite.js +1 -1
- package/runtime/web-page/page.js +6 -6
package/runtime/web/index.html
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{a as H}from"./assets/keyboardMotion-C2Bk5H0n.js";const B=`
|
|
2
|
+
.keys { position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden; box-sizing: border-box; font: 400 22px/1 -apple-system, "SF Pro Text", Roboto, system-ui, sans-serif; color: #000; transform: translateY(100%); will-change: transform; }
|
|
3
|
+
.keys.shown { transform: translateY(0); }
|
|
4
|
+
.keys.ios { background: #d1d3d9; }
|
|
5
|
+
.keys.android { background: #eceff1; color: #202124; }
|
|
6
|
+
.keys .bar { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-evenly; }
|
|
7
|
+
.keys.ios .bar i { display: block; width: 1px; height: 24px; background: rgba(0, 0, 0, 0.14); }
|
|
8
|
+
.keys.android .bar i { display: block; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, 0.08); }
|
|
9
|
+
.keys .k { position: absolute; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 5px; box-shadow: 0 1px 0 #8d8f94; white-space: nowrap; }
|
|
10
|
+
.keys.android .k { border-radius: 6px; box-shadow: none; }
|
|
11
|
+
.keys .k.s { background: #acb1ba; font-size: 16px; }
|
|
12
|
+
.keys.android .k.s { background: #d4d8dd; }
|
|
13
|
+
.keys.ios .k.space { background: #fff; font-size: 16px; }
|
|
14
|
+
.keys.android .k.space { background: #fff; }
|
|
15
|
+
.keys .k.shift::before { content: ""; display: block; width: 0; height: 0; border-style: solid; border-width: 0 9px 10px 9px; border-color: transparent transparent #000 transparent; }
|
|
16
|
+
.keys .k.del::before { content: "⌫"; font-size: 20px; }
|
|
17
|
+
.keys .k.emoji::before { content: "☺"; font-size: 20px; }
|
|
18
|
+
`,M={en:[["q","w","e","r","t","y","u","i","o","p"],["a","s","d","f","g","h","j","k","l"],["z","x","c","v","b","n","m"]],ru:[["й","ц","у","к","е","н","г","ш","щ","з","х"],["ф","ы","в","а","п","р","о","л","д","ж","э"],["я","ч","с","м","и","т","ь","б","ю"]]},N={en:{space:"space",enter:"return"},ru:{space:"Пробел",enter:"Ввод"}},f=s=>`${Math.round(s*2)/2}px`,P=(s,e)=>{const{look:i,width:d,height:C,inset:D}=e,Y=e.language.slice(0,2)==="ru"?"ru":"en",u=M[Y],$=N[Y],k=i==="ios",m=[],r=(t,l,v,L,j,X)=>{const x=s.createElement("div");x.className=`k${l?` ${l}`:""}`,x.textContent=t,Object.assign(x.style,{left:f(v),top:f(L),width:f(j),height:f(X)}),m.push(x)},y=k?44:40,b=s.createElement("div");b.className="bar",Object.assign(b.style,{top:"0",height:f(y)});for(let t=0;t<(k?2:3);t++)b.append(s.createElement("i"));m.push(b);const o=3,n=6,g=k?11:9,z=u[0].length,p=(d-o*2-n*(z-1))/z,O=C-y-D,a=Math.min(k?42:46,(O-g*5)/4),K=y+Math.max(g,(O-(a*4+g*3))/2-2),w=t=>K+t*(a+g),R=t=>(d-t*p-(t-1)*n)/2;u.forEach((t,l)=>{const v=R(t.length);t.forEach((L,j)=>r(L,"",v+j*(p+n),w(l),p,a))});const T=u[2],E=R(T.length)-n-o;r("","s shift",o,w(2),E,a),r("","s del",d-o-E,w(2),E,a);const h=w(3),c=p*2+n;if(k){r("123","s",o,h,c,a),r("","s emoji",o+c+n,h,p,a);const t=o+c+n+p+n;r($.space,"space",t,h,d-t-o-c-n,a),r($.enter,"s",d-o-c,h,c,a)}else{r("?123","s",o,h,c,a),r(",","",o+c+n,h,p,a);const t=o+c+n+p+n,l=d-o-c-n-p;r("","space",t,h,l-n-t,a),r(".","",l,h,p,a),r("↵","s",d-o-c,h,c,a)}return m},S=(s,e)=>{s.style.transition=e>0?`transform ${e}ms ${H}`:""},W=(s,e,i=0)=>{const d=s.classList.contains("shown");S(s,i),s.className=`keys ${e.look}${d?" shown":""}`,s.style.height=f(e.height),s.replaceChildren(...P(s.ownerDocument,e)),d||(i>0&&s.offsetHeight,s.classList.add("shown"))},q=(s,e=0)=>{const i=()=>{s.classList.contains("shown")||(s.replaceChildren(),s.style.height="0")};if(!s.classList.contains("shown")){i();return}S(s,e),s.classList.remove("shown"),e>0?s.addEventListener("transitionend",i,{once:!0}):i()},F=s=>{if(s.dataset.pointer)return;s.dataset.pointer="taken",s.style.pointerEvents="auto";const e=i=>{i.preventDefault(),i.stopPropagation()};for(const i of["pointerdown","mousedown","touchstart","click"])s.addEventListener(i,e,{passive:!1})};export{B as KEYBOARD_STYLE,q as hideKeyboard,W as showKeyboard,F as takeKeyboardPointer};
|