efficient-shell 16.6.0 → 16.10.0
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/README.md +30 -4
- package/dist/{Browser-UHT6QSUN.js → Browser-TXL5U5PM.js} +13 -13
- package/dist/{Calculator-ZG5RX2HX.js → Calculator-VOZDVOYE.js} +22 -22
- package/dist/{CurrencyConverter-AHGYTGKM.js → CurrencyConverter-AMGFHBJE.js} +5 -5
- package/dist/{Files-4HJWEYDE.js → Files-2EE24L5G.js} +64 -64
- package/dist/{Notepad-GXKGVTNG.js → Notepad-L2WODBHG.js} +9 -9
- package/dist/{PomodoroTimer-GN2OSLJ6.js → PomodoroTimer-77VMHGDE.js} +4 -4
- package/dist/{Preview-EN4YCUH5.js → Preview-FWN44NN2.js} +1 -1
- package/dist/{Stock-44BSCZOL.js → Stock-PXLNR6A6.js} +3 -3
- package/dist/{Weather-GNGUF6A4.js → Weather-WGLPPZPX.js} +16 -16
- package/dist/{WorldClock-EBZJRH5F.js → WorldClock-UY4B5VKZ.js} +7 -7
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +8 -8
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-MS6IZF6E.js → chunk-2FLRIQ5V.js} +1 -1
- package/dist/{chunk-3C7JKJGL.js → chunk-2SOK37OP.js} +1 -1
- package/dist/{chunk-JKO4JZPO.js → chunk-36KGBTNC.js} +1 -1
- package/dist/chunk-E5WGELKZ.js +8 -0
- package/dist/{chunk-H6JJAVYL.js → chunk-EC6XKOAE.js} +1 -1
- package/dist/chunk-EJFJOHPZ.js +1 -0
- package/dist/{chunk-UQPVUPSS.js → chunk-FFCVC4ES.js} +1 -1
- package/dist/chunk-FUXGLHAA.js +1 -0
- package/dist/chunk-IJLXI67O.js +1 -0
- package/dist/{chunk-HOTIZZXC.js → chunk-LBXKYVM3.js} +1 -1
- package/dist/chunk-LO7LNWTZ.js +2 -0
- package/dist/chunk-MAQAP6SX.js +30 -0
- package/dist/chunk-MHKTBQ53.js +5 -0
- package/dist/{chunk-EJTAPBGB.js → chunk-MIHPFJCP.js} +13 -13
- package/dist/chunk-MWJNMENV.js +2 -0
- package/dist/{chunk-OLFYNMTD.js → chunk-PO7UCZSK.js} +1 -1
- package/dist/chunk-RO3M4JWS.js +1 -0
- package/dist/{chunk-ATTQTQJI.js → chunk-S24LTOBM.js} +4 -4
- package/dist/chunk-S3TQ3VOK.js +2 -0
- package/dist/chunk-XCTS44UZ.js +1 -0
- package/dist/{chunk-YYGA4Y6E.js → chunk-YAVIKKIQ.js} +1 -1
- package/dist/{chunk-DX24Q5OR.js → chunk-ZKXDWUNI.js} +1 -1
- package/dist/format/index.d.ts +84 -6
- package/dist/format/index.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/Select.d.ts +1 -1
- package/dist/forms/TextToolbar.d.ts +1 -1
- package/dist/forms/textAlign.d.ts +1 -1
- package/dist/hooks/useMarquee.js +1 -1
- package/dist/icons/efficient-glyphs.d.ts +1 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +2 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +1 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +1 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/ScrollExpandIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollExpandIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/ScrollExpandMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollExpandMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollExpandSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollExpandSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +164 -164
- package/dist/map/index.d.ts +39 -35
- package/dist/map/index.js +12 -12
- package/dist/map-site.css +21 -0
- package/dist/motion/entrance.js +1 -1
- package/dist/motion/values.d.ts +7 -2
- package/dist/motion/values.js +1 -1
- package/dist/motion.css +28 -5
- package/dist/{names-CpcmfUzD.d.ts → names-Bw6ChIJl.d.ts} +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/utils/edgeScroll.d.ts +4 -1
- package/dist/utils/edgeScroll.js +1 -1
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-AIJ3G6BD.js +0 -1
- package/dist/chunk-EJMCK7E3.js +0 -8
- package/dist/chunk-LACL4MAR.js +0 -1
- package/dist/chunk-N7EZ2BFE.js +0 -30
- package/dist/chunk-OMOAD5LL.js +0 -1
- package/dist/chunk-WSQ73CRR.js +0 -2
- package/dist/chunk-YVXF7L66.js +0 -1
- /package/dist/{chunk-OQOWFHRZ.js → chunk-4B54NLXF.js} +0 -0
package/README.md
CHANGED
|
@@ -2669,14 +2669,24 @@ motion nothing waits and nothing plays. The keyframes are in `motion.css`.
|
|
|
2669
2669
|
|
|
2670
2670
|
**Scroll.** A part plays an effect as the visitor scrolls, and a section can
|
|
2671
2671
|
stay pinned to the screen while its parts play. `SCROLL_EFFECTS` (None, Zoom
|
|
2672
|
-
in, Zoom out, Fade in, Fade out, Move up, Move down, Reveal, Parallax
|
|
2672
|
+
in, Zoom out, Fade in, Fade out, Move up, Move down, Reveal, Parallax,
|
|
2673
|
+
Expand);
|
|
2673
2674
|
`SCROLL_EFFECTS_WITH_ZOOM` names the two that take a Zoom. `SCROLL_ZOOM` is the
|
|
2674
2675
|
size added to the whole picture in percent (0–100, step 10, default 30 = 1.3
|
|
2675
2676
|
times), toward the picture's focus point. `SCROLL_START` / `SCROLL_END` are
|
|
2676
2677
|
where in the scroll the part plays (0–100 %). `PIN_LENGTH` is how long a
|
|
2677
2678
|
section stays pinned, in screens (0–4, default 2; 0 = the next section slides
|
|
2678
|
-
over at once). `
|
|
2679
|
-
|
|
2679
|
+
over at once). `SCROLL_EASES` is the Speed of a part: the curve its effect plays on (`linear`,
|
|
2680
|
+
the default, `smooth` and `arrive`, named after `MOTION_EASING`).
|
|
2681
|
+
`readScroll(effect, zoom, start, end, ease)` and `readPin(on, length)`
|
|
2682
|
+
read stored values (an End before its Start swaps with it; an unknown curve
|
|
2683
|
+
reads as `linear`). Expand opens a part from `--motion-expand-side` on each
|
|
2684
|
+
side (a host's answer per view, default `0px`) to the screen edges, by
|
|
2685
|
+
`clip-path` only; inside a pinned track it plays on the approach (from the
|
|
2686
|
+
track's top at the screen bottom to the stop), so the section is full width
|
|
2687
|
+
when its frame sticks. A host that draws the effect tiles from
|
|
2688
|
+
`SCROLL_EFFECTS` draws only the values it has a glyph and word for, so a new
|
|
2689
|
+
value never breaks an older editor.
|
|
2680
2690
|
`scrollAttrs(value, origin?)` and `pinAttrs(value)` give the element its
|
|
2681
2691
|
attributes (`data-motion-scroll`, `data-motion-pin`) and, only when changed,
|
|
2682
2692
|
the inline custom properties; the pinned frame carries `data-motion-pin-frame`.
|
|
@@ -2712,6 +2722,7 @@ screen and no pull: when the effect screens end, the frame goes up with the
|
|
|
2712
2722
|
page and the next section follows right under it. The custom
|
|
2713
2723
|
property names are exported, one each: `SCROLL_ZOOM_VAR`,
|
|
2714
2724
|
`SCROLL_ORIGIN_VAR`, `SCROLL_START_VAR`, `SCROLL_END_VAR`,
|
|
2725
|
+
`SCROLL_EASE_VAR`, `EXPAND_SIDE_VAR`,
|
|
2715
2726
|
`SCROLL_PROGRESS_VAR`, `PIN_ON_VAR`, `PIN_TOP_VAR`, `PIN_LENGTH_VAR`,
|
|
2716
2727
|
`PIN_POSITION_VAR`, `PIN_STICK_VAR`, `PIN_TRACK_POSITION_VAR`,
|
|
2717
2728
|
`PIN_ABOVE_Z_VAR` and `PIN_OVER_VAR` (and, for an
|
|
@@ -2730,7 +2741,9 @@ effect screens; outside one it is the part's own pass through the screen. Only
|
|
|
2730
2741
|
opacity, transform and clip-path move. One element plays one animation: an
|
|
2731
2742
|
element that also has an Entrance keeps it and plays no scroll effect, so a
|
|
2732
2743
|
host that offers both puts the scroll attributes on a wrapper. A browser
|
|
2733
|
-
without scroll timelines
|
|
2744
|
+
without scroll timelines draws every scroll part as it is (no hidden part
|
|
2745
|
+
when the script does not run) until `armScrollProgress(root)` marks the page
|
|
2746
|
+
(`data-motion-scrub`) and writes
|
|
2734
2747
|
`--motion-p` once per frame, measured from the layout box (`layoutBox`), so the
|
|
2735
2748
|
effect's own translate or scale does not move it;
|
|
2736
2749
|
`scrollProgress` is the same sum, for a host that needs the number. With
|
|
@@ -2738,6 +2751,19 @@ reduced motion a track does not pin and every part shows its own look, with
|
|
|
2738
2751
|
no effect; a stuck section (the stick form, or a track a view draws stuck)
|
|
2739
2752
|
still sticks, as nothing moves on it.
|
|
2740
2753
|
|
|
2754
|
+
**Pin steps.** `armPinSteps(root, onStep?)` makes every track that pins in the
|
|
2755
|
+
current view take two gestures (owner 2026-11-26). Gesture 1, of any size,
|
|
2756
|
+
stops where the frame is held, and the next gesture glides to the end of the
|
|
2757
|
+
pin: every part has played and the frame is still held. Gesture 2 glides on
|
|
2758
|
+
until the next section stands at the stop. Up mirrors it. A gesture is one
|
|
2759
|
+
wheel or trackpad burst (momentum included), one touch swipe or one key
|
|
2760
|
+
(Space, Page Down / Up, the arrows). Some input is never a step: a key with Alt, Ctrl or Cmd; a key while typing; Space on a button, summary, checkbox (native or ARIA), switch or media player (the page keys still step there; on a link Space is a step, as a browser scrolls with it); any key on a control the arrows move inside or in an open menu; a wheel with Ctrl (a pinch-zoom) or a second finger (a zoom's scroll is never pulled back); and a wheel, swipe or key that starts in a box that still scrolls that way, in a map, or in a box marked with `PIN_FREE_ATTR` (`data-motion-pin-free`). A wheel burst keeps its first decision: one that began in a box stays the box's, and once the box is at its end the rest is cancelled, so it never scrolls the page on. The scroll a field's or a control's key makes is never pulled back to a stop. A fling that slips past
|
|
2761
|
+
a stop is pulled back to it; a jump the visitor did not scroll (an anchor) is
|
|
2762
|
+
left alone. Reduced motion jumps instead of gliding. `pinStops`,
|
|
2763
|
+
`pinStepTarget` and `pinCatch` are the rules as pure functions; `PIN_STEP`
|
|
2764
|
+
names the glide (750 ms), the quiet that ends a wheel gesture (220 ms) and the
|
|
2765
|
+
swipe (24 px). Call it once a page; it returns its disarm.
|
|
2766
|
+
|
|
2741
2767
|
**Hover.** `HOVER_KINDS` is the one list of hover kinds, in panel order (None,
|
|
2742
2768
|
Next image, Rotate, Zoom, Lift, Black and white). `hoverKindsOf(offered)` gives
|
|
2743
2769
|
the kinds one thing offers, in the list's order. The words and what each kind
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import{InputEndActionButton as e}from"./chunk-BYTQRQ5P.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-
|
|
1
|
+
import{InputEndActionButton as e}from"./chunk-BYTQRQ5P.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-ZKXDWUNI.js";import{WindowTitle as n}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-RO3M4JWS.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.js";import"./chunk-TSZPGDU3.js";import{Icon as i}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-LYGIOJ3J.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var p="react-os-shell:browser-bookmarks",d="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(p);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(d)||k}function j(){const h=a(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,j]=l(k||b),[C,R]=l(w),[W,P]=l([w]),[H,L]=l(0),[S,U]=l(0),[z,D]=l(x),[T,J]=l(!1),[M,O]=l(null),Z=a(null),B=a(null);c(()=>{try{localStorage.setItem(p,JSON.stringify(z))}catch{}},[z]);const G=e=>{const t=f(e);t&&(j(t),R(t),P(e=>{const o=e.slice(0,H+1);return o.push(t),o}),L(e=>e+1),J(!1))},Y=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},E=()=>{const e=M?.trim();e?(D(t=>[...t,{label:e,url:w}]),O(null)):O(null)};c(()=>{if(null===M)return;Z.current?.focus(),Z.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||O(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==M]);const I=e=>{D(t=>t.filter((t,o)=>o!==e))},Q=H>0,V=H<W.length-1,A=z.some(e=>e.url===w),F="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"relative flex flex-col h-full bg-white",children:[
|
|
3
3
|
/* @__PURE__ */u(n,{title:`Browser - ${N(w)}`}),
|
|
4
4
|
/* @__PURE__ */u(r,{app:"browser"}),
|
|
5
5
|
/* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
|
|
6
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(
|
|
8
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
9
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
10
|
-
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),
|
|
6
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(H>0){const e=H-1;L(e),j(W[e]),R(W[e]),J(!1)}},disabled:!Q,className:F,title:"Back",children:/* @__PURE__ */u(i,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
|
|
7
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(H<W.length-1){const e=H+1;L(e),j(W[e]),R(W[e]),J(!1)}},disabled:!V,className:F,title:"Forward",children:/* @__PURE__ */u(i,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */u("button",{onClick:()=>U(e=>e+1),className:F,title:"Refresh",children:/* @__PURE__ */u(i,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
9
|
+
/* @__PURE__ */u("button",{onClick:()=>G(b),className:F,title:"Home",children:/* @__PURE__ */u(i,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
10
|
+
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),G(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
|
|
11
11
|
/* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
|
|
12
12
|
/* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>R(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
|
|
13
13
|
/* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(i,{name:"close"}),onClick:()=>R(w)}})})]})}),
|
|
14
|
-
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>I
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
14
|
+
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>A?I(z.findIndex(e=>e.url===w)):void O(N(w)),className:F+" "+(A?"text-yellow-500":""),title:A?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(i,{name:"star",className:"h-4 w-4",fill:A?"currentColor":"none",strokeWidth:1.5})}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:Y,className:F,title:"Open in new tab",children:/* @__PURE__ */u(i,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>J(e=>!e),className:F,title:"Embedding help",children:/* @__PURE__ */u(i,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==M&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
|
|
17
17
|
/* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
|
|
18
18
|
/* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
|
|
19
|
-
/* @__PURE__ */u("input",{ref:
|
|
19
|
+
/* @__PURE__ */u("input",{ref:Z,type:"text",value:M,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key?E():"Escape"===e.key&&O(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
|
|
20
20
|
/* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
|
|
21
21
|
/* @__PURE__ */u("button",{onClick:()=>O(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:
|
|
23
|
-
/* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:E,disabled:!M.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
|
|
23
|
+
/* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===z.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),z.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>G(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&I(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
|
|
24
24
|
/* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
|
|
25
25
|
/* @__PURE__ */u("div",{className:"flex-1"}),
|
|
26
26
|
/* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(d,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
|
|
27
|
-
/* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(v,{url:w,iframeKey:
|
|
27
|
+
/* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(v,{url:w,iframeKey:S,iframeRef:B,openExternal:Y,showHelp:T,dismissHelp:()=>J(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function v({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[a,p]=l(!1);c(()=>{p(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!a?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
|
|
28
28
|
/* @__PURE__ */u(i,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
|
|
29
29
|
/* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[N(e)," can't be embedded"]}),
|
|
30
30
|
/* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-
|
|
1
|
+
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-LBXKYVM3.js";import{useWidgetSettings as n}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.js";import"./chunk-TSZPGDU3.js";import{Icon as r}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-LYGIOJ3J.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[j,b]=c(null),[g,N]=c(!1),[y,C]=c(""),[x,f]=c([]),[v,$]=c(!1),[P,T]=c(()=>t(h)),[B,E]=c(!1),[J,V]=c(P),W=i(null);n(o(()=>{V({...P}),E(!0)},[P]));const Z=o(t=>{C(""),k(e=>g||"0"===e?(N(!1),"."===t?"0.":t):"."===t&&e.includes(".")?e:e+t)},[g]),H=o(()=>{k("0"),d(null),b(null),N(!1)},[]),M=o((t,e,n)=>{switch(n){case"+":return t+e;case"-":return t-e;case"×":return t*e;case"÷":return 0===e?0:t/e;default:return e}},[]),R=o(t=>{const e=parseFloat(m);if(null!==p&&j&&!g){const t=M(p,e,j);k(String(t)),d(t),f(n=>[`${p} ${j} ${e} = ${t}`,...n].slice(0,20))}else d(e);b(t),N(!0)},[m,p,j,g,M]),U=o(()=>{if(null===p||!j)return;const t=parseFloat(m),e=M(p,t,j),n=`${p} ${j} ${t} =`;f(t=>[`${n} ${e}`,...t].slice(0,20)),C(n),k(String(e)),d(null),b(null),N(!0)},[m,p,j,M]),A=o(()=>{k(t=>String(parseFloat(t)/100))},[]),D=o(()=>{k(t=>t.startsWith("-")?t.slice(1):"0"===t?t:"-"+t)},[]);s(()=>{const t=t=>{const e=t.target.tagName;"INPUT"!==e&&"TEXTAREA"!==e&&"SELECT"!==e&&(t.key>="0"&&t.key<="9"?Z(t.key):"."===t.key?Z("."):"+"===t.key?R("+"):"-"===t.key?R("-"):"*"===t.key?R("×"):"/"===t.key?(t.preventDefault(),R("÷")):"Enter"===t.key||"="===t.key?("Enter"===t.key&&t.target instanceof Node&&W.current?.contains(t.target)&&t.preventDefault(),U()):"Escape"===t.key?H():"Backspace"===t.key?k(t=>t.length>1?t.slice(0,-1):"0"):"%"===t.key&&A())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[Z,R,U,H,A]);const F="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",G=`${F} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,S=`${F} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,L=`${F} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,O=`${F} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
2
|
return l(a,{children:[
|
|
3
|
-
/* @__PURE__ */l("div",{ref:W,className:"flex flex-col h-full",style:{opacity:
|
|
3
|
+
/* @__PURE__ */l("div",{ref:W,className:"flex flex-col h-full",style:{opacity:P.activeOpacity/100,backdropFilter:P.activeBlur>0?`blur(${P.activeBlur}px)`:void 0},children:[
|
|
4
4
|
/* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
|
|
5
5
|
/* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((t,e)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:t},e))}),(y||j&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${j} ${g?"":m}`}),
|
|
6
6
|
/* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
|
|
7
7
|
/* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
|
|
8
8
|
/* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(t=>{const e=parseFloat(t);return isNaN(e)||t.endsWith(".")||t.endsWith(".0")||Math.abs(e)<1e15&&t.length<16?t:e.toExponential(6)})(m)})]})]}),
|
|
9
9
|
/* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
|
|
10
|
-
/* @__PURE__ */u("button",{onClick:
|
|
11
|
-
/* @__PURE__ */u("button",{onClick:D,className:
|
|
12
|
-
/* @__PURE__ */u("button",{onClick:
|
|
13
|
-
/* @__PURE__ */u("button",{onClick:()=>R("÷"),className:`${
|
|
14
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
17
|
-
/* @__PURE__ */u("button",{onClick:()=>R("×"),className:`${
|
|
18
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
19
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
20
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
21
|
-
/* @__PURE__ */u("button",{onClick:()=>R("-"),className:`${
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
23
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
24
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
25
|
-
/* @__PURE__ */u("button",{onClick:()=>R("+"),className:`${
|
|
26
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
27
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
28
|
-
/* @__PURE__ */u("button",{onClick:U,className:
|
|
29
|
-
/* @__PURE__ */u(e,{open:
|
|
10
|
+
/* @__PURE__ */u("button",{onClick:H,className:L,children:"AC"}),
|
|
11
|
+
/* @__PURE__ */u("button",{onClick:D,className:L,children:"+/−"}),
|
|
12
|
+
/* @__PURE__ */u("button",{onClick:A,className:L,children:"%"}),
|
|
13
|
+
/* @__PURE__ */u("button",{onClick:()=>R("÷"),className:`${S} ${"÷"===j?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("7"),className:G,children:"7"}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("8"),className:G,children:"8"}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("9"),className:G,children:"9"}),
|
|
17
|
+
/* @__PURE__ */u("button",{onClick:()=>R("×"),className:`${S} ${"×"===j?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("4"),className:G,children:"4"}),
|
|
19
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("5"),className:G,children:"5"}),
|
|
20
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("6"),className:G,children:"6"}),
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>R("-"),className:`${S} ${"-"===j?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("1"),className:G,children:"1"}),
|
|
23
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("2"),className:G,children:"2"}),
|
|
24
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("3"),className:G,children:"3"}),
|
|
25
|
+
/* @__PURE__ */u("button",{onClick:()=>R("+"),className:`${S} ${"+"===j?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("0"),className:`${G} col-span-2`,children:"0"}),
|
|
27
|
+
/* @__PURE__ */u("button",{onClick:()=>Z("."),className:G,children:"."}),
|
|
28
|
+
/* @__PURE__ */u("button",{onClick:U,className:O,children:"="})]})]}),
|
|
29
|
+
/* @__PURE__ */u(e,{open:B,onClose:()=>E(!1),title:"Calculator Settings",appearance:J,onAppearanceChange:V,onSave:()=>{T(J),localStorage.setItem(h,JSON.stringify(J)),E(!1)}})]})}export{m as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-
|
|
1
|
+
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-LBXKYVM3.js";import{useWidgetSettings as r}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.js";import"./chunk-TSZPGDU3.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-LYGIOJ3J.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",k="currency_rates_cache";function d(t){try{const e=JSON.parse(localStorage.getItem(k)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function j(t,e){try{const r=JSON.parse(localStorage.getItem(k)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(k,JSON.stringify(r))}catch{}}function g(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,k]=s(g),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,U]=s(!1),[v,J]=s([]),[P,B]=s(f),[R,H]=s("USD"),[Y,A]=s("CNY");r(o(()=>{J([...u]),B({...f}),U(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=d(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,j(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
|
|
2
2
|
return i(a,{children:[
|
|
3
3
|
/* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
|
|
4
4
|
return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);k(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
|
|
@@ -9,13 +9,13 @@ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);k(t),l
|
|
|
9
9
|
/* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
|
|
10
10
|
/* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
|
|
11
11
|
/* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
|
|
12
|
-
/* @__PURE__ */m(e,{open:C,onClose:()=>U(!1),title:"Currency Settings",appearance:
|
|
12
|
+
/* @__PURE__ */m(e,{open:C,onClose:()=>U(!1),title:"Currency Settings",appearance:P,onAppearanceChange:B,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);k(t),x(P),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(P)),U(!1)},children:/* @__PURE__ */i("div",{children:[
|
|
13
13
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
|
|
14
14
|
/* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",v.length,"/",4,")"]})]}),
|
|
15
15
|
/* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:v.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
|
|
16
16
|
/* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
|
|
17
|
-
/* @__PURE__ */m("button",{onClick:()=>
|
|
17
|
+
/* @__PURE__ */m("button",{onClick:()=>J(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),v.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
|
|
18
18
|
/* @__PURE__ */m("select",{value:R,onChange:t=>H(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
|
|
19
19
|
/* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
|
|
20
|
-
/* @__PURE__ */m("select",{value:
|
|
21
|
-
/* @__PURE__ */m("button",{onClick:()=>{R!==
|
|
20
|
+
/* @__PURE__ */m("select",{value:Y,onChange:t=>A(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
|
|
21
|
+
/* @__PURE__ */m("button",{onClick:()=>{R!==Y&&v.length<4&&J(t=>[...t,[R,Y]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
|